[IMP] etherpad fullscreen

bzr revid: fp@openerp.com-20120717225636-bqudwmo6cve50fjn
This commit is contained in:
Fabien Pinckaers 2012-07-18 00:56:36 +02:00
parent 4c82865bfd
commit d17e291031
3 changed files with 24 additions and 23 deletions

View File

@ -1,29 +1,32 @@
.etherpad_head{ .oe_etherpad_head{
width: 100%; width: 100%;
display: block; display: block;
padding-left:3px; padding-left:3px;
cursor:pointer; cursor:pointer;
} }
.etherpad_zoom_head{ .oe_etherpad_fullscreen div.oe_etherpad_head .oe_normal {
position: fixed; display: none;
left: 0px;
top: 0px;
width: 100%;
height: 15px;
} }
.etherpad_zoom{ .oe_etherpad_normal div.oe_etherpad_head .oe_fullscreen {
display: none;
}
.oe_etherpad_fullscreen {
position: fixed; position: fixed;
top: 0px;
left: 0px; left: 0px;
top: 15px;
width: 100%; width: 100%;
height: 100% !important; height: 100%;
background-color: white;
z-index:10001 !important; z-index:10001 !important;
background-color:white;
} }
.etherpad_default{ .etherpad_default{
width: 100%; width: 100%;
height: 450px; height: 450px;
} }
.oe_etherpad_fullscreen .etherpad_default{
height: 100%
}
.etherpad_body{ .etherpad_body{
overflow:hidden; overflow:hidden;
} }
@ -50,7 +53,6 @@
list-style-type: none !important; list-style-type: none !important;
} }
.etherpad_readonly{ .etherpad_readonly{
font-family: arial, sans-serif; font-family: arial, sans-serif;
font-size: 13px; font-size: 13px;

View File

@ -4,13 +4,9 @@ instance.web.form.FieldEtherpad = instance.web.form.AbstractField.extend(_.exten
template: 'FieldEtherpad', template: 'FieldEtherpad',
initialize_content: function() { initialize_content: function() {
this.$textarea = undefined; this.$textarea = undefined;
this.$element.find('span').text('Fullscreen'); this.$element.find('div.oe_etherpad_head').click(_.bind(function(ev){
this.$element.find('span').click(_.bind(function(ev){ this.$element.toggleClass('oe_etherpad_fullscreen').toggleClass('oe_etherpad_normal');
this.$element.find('span').toggleClass('etherpad_zoom_head');
var iszoom = this.$element.find('span').hasClass('etherpad_zoom_head');
this.$element.find('span').text((iszoom?'Back to Task':this.field.string));
this.$element.find('div').toggleClass('etherpad_zoom');
$("body").toggleClass('etherpad_body');
},this)); },this));
}, },
set_value: function(value_) { set_value: function(value_) {
@ -21,7 +17,7 @@ instance.web.form.FieldEtherpad = instance.web.form.AbstractField.extend(_.exten
var show_value = instance.web.format_value(this.get('value'), this, ''); var show_value = instance.web.format_value(this.get('value'), this, '');
if (!this.get("effective_readonly")) { if (!this.get("effective_readonly")) {
var pad_username = this.session.username; var pad_username = this.session.username;
this.$element.find('div').html('<iframe width="100%" height="100%" frameborder="0" src="'+show_value.split('\n')[0]+'?showChat=false&showLineNumbers=false&userName='+pad_username+'"></iframe>'); this.$element.find('div.oe_etherpad_default').html('<iframe width="100%" height="100%" frameborder="0" src="'+show_value.split('\n')[0]+'?showChat=false&showLineNumbers=false&userName='+pad_username+'"></iframe>');
} else { } else {
if(this.get('value') != false) if(this.get('value') != false)
{ {

View File

@ -5,9 +5,12 @@
<t t-name="FieldEtherpad"> <t t-name="FieldEtherpad">
<t t-if="!widget.get('effective_readonly')"> <t t-if="!widget.get('effective_readonly')">
<div class="oe_form_field_text"> <div class="oe_form_field_text oe_etherpad_normal">
<span class="etherpad_head"></span> <div class="oe_etherpad_head">
<div class="etherpad_default" ></div> <span class="oe_normal">Fullscreen</span>
<span class="oe_fullscreen">Return to Record</span>
</div>
<div class="oe_etherpad_default" ></div>
</div> </div>
</t> </t>
</t> </t>