You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2017/04/30 17:29:48 UTC
[36/50] [abbrv] openmeetings git commit: [OPENMEETINGS-551] initial
work on minimizing (broken)
[OPENMEETINGS-551] initial work on minimizing (broken)
Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/ac232ec4
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/ac232ec4
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/ac232ec4
Branch: refs/heads/master
Commit: ac232ec46e9e2fb68289fbcca68ba15d1d09c957
Parents: 1123594
Author: Maxim Solodovnik <so...@apache.org>
Authored: Wed Apr 19 03:26:57 2017 +0000
Committer: Maxim Solodovnik <so...@apache.org>
Committed: Wed Apr 19 03:26:57 2017 +0000
----------------------------------------------------------------------
.../apache/openmeetings/web/room/RoomPanel.java | 12 +-
.../web/room/jquery.dialogextend.js | 329 +++++++++++++++++++
.../web/room/jquery.dialogextend.min.js | 3 +
.../org/apache/openmeetings/web/room/room.js | 45 ++-
4 files changed, 366 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/ac232ec4/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
index 8c2497f..9990345 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
@@ -78,7 +78,6 @@ import org.apache.wicket.markup.head.PriorityHeaderItem;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.protocol.ws.api.event.WebSocketPushPayload;
import org.apache.wicket.request.resource.JavaScriptResourceReference;
-import org.apache.wicket.request.resource.ResourceReference;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
@@ -170,11 +169,9 @@ public class RoomPanel extends BasePanel {
.put("height", c.getHeight());
target.appendJavaScript(String.format("VideoManager.play(%s);", json));
}
-
}
-
}
-
+
@Override
protected void onInitialize() {
super.onInitialize();
@@ -542,14 +539,11 @@ public class RoomPanel extends BasePanel {
getMainPanel().getChat().roomExit(r, handler);
}
- private static ResourceReference newResourceReference() {
- return new JavaScriptResourceReference(RoomPanel.class, "room.js");
- }
-
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
- response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(newResourceReference())));
+ response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(RoomPanel.class, "jquery.dialogextend.js"))));
+ response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(RoomPanel.class, "room.js"))));
WebSession ws = WebSession.get();
if (!Strings.isEmpty(r.getRedirectURL()) && (ws.getSoapLogin() != null || ws.getInvitation() != null)) {
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forScript(
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/ac232ec4/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/jquery.dialogextend.js
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/jquery.dialogextend.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/jquery.dialogextend.js
new file mode 100644
index 0000000..7a605e9
--- /dev/null
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/jquery.dialogextend.js
@@ -0,0 +1,329 @@
+/*
+ * Licensed MIT https://github.com/ROMB/jquery-dialogextend/blob/master/LICENSE.md
+ */
+(function() {
+ var $;
+
+ $ = jQuery;
+
+ $.widget("ui.dialogExtend", {
+ version: "2.0.4",
+ modes: {},
+ options: {
+ "closable": true,
+ "dblclick": false,
+ "titlebar": false,
+ "icons": {
+ "close": "ui-icon-closethick",
+ "restore": "ui-icon-newwin"
+ },
+ "load": null,
+ "beforeRestore": null,
+ "restore": null
+ },
+ _create: function() {
+ this._state = "normal";
+ if (!$(this.element[0]).data("ui-dialog")) {
+ $.error("jQuery.dialogExtend Error : Only jQuery UI Dialog element is accepted");
+ }
+ this._verifyOptions();
+ this._initStyles();
+ this._initButtons();
+ this._initTitleBar();
+ this._setState("normal");
+ this._on("load", function(e) {
+ return console.log("test", e);
+ });
+ return this._trigger("load");
+ },
+ _setState: function(state) {
+ $(this.element[0]).removeClass("ui-dialog-" + this._state).addClass("ui-dialog-" + state);
+ return this._state = state;
+ },
+ _verifyOptions: function() {
+ var name, _ref, _results;
+
+ if (this.options.dblclick && !(this.options.dblclick in this.modes)) {
+ $.error("jQuery.dialogExtend Error : Invalid <dblclick> value '" + this.options.dblclick + "'");
+ this.options.dblclick = false;
+ }
+ if (this.options.titlebar && ((_ref = this.options.titlebar) !== "none" && _ref !== "transparent")) {
+ $.error("jQuery.dialogExtend Error : Invalid <titlebar> value '" + this.options.titlebar + "'");
+ this.options.titlebar = false;
+ }
+ _results = [];
+ for (name in this.modes) {
+ if (this["_verifyOptions_" + name]) {
+ _results.push(this["_verifyOptions_" + name]());
+ } else {
+ _results.push(void 0);
+ }
+ }
+ return _results;
+ },
+ _initStyles: function() {
+ var name, style, _results;
+
+ if (!$(".dialog-extend-css").length) {
+ style = '';
+ style += '<style class="dialog-extend-css" type="text/css">';
+ style += '.ui-dialog .ui-dialog-titlebar-buttonpane>a { float: right; }';
+ style += '.ui-dialog .ui-dialog-titlebar-restore { width: 19px; height: 18px; }';
+ style += '.ui-dialog .ui-dialog-titlebar-restore span { display: block; margin: 1px; }';
+ style += '.ui-dialog .ui-dialog-titlebar-restore:hover,';
+ style += '.ui-dialog .ui-dialog-titlebar-restore:focus { padding: 0; }';
+ style += '.ui-dialog .ui-dialog-titlebar ::selection { background-color: transparent; }';
+ style += '</style>';
+ $(style).appendTo("body");
+ }
+ _results = [];
+ for (name in this.modes) {
+ _results.push(this["_initStyles_" + name]());
+ }
+ return _results;
+ },
+ _initButtons: function() {
+ var buttonPane, mode, name, titlebar, _ref,
+ _this = this;
+
+ titlebar = $(this.element[0]).dialog("widget").find(".ui-dialog-titlebar");
+ buttonPane = $('<div class="ui-dialog-titlebar-buttonpane"></div>').appendTo(titlebar);
+ buttonPane.css({
+ "position": "absolute",
+ "top": "50%",
+ "right": "0.3em",
+ "margin-top": "-10px",
+ "height": "18px"
+ });
+ titlebar.find(".ui-dialog-titlebar-close").css({
+ "position": "relative",
+ "float": "right",
+ "top": "auto",
+ "right": "auto",
+ "margin": 0
+ }).find(".ui-icon").removeClass("ui-icon-closethick").addClass(this.options.icons.close).end().appendTo(buttonPane).end();
+ buttonPane.append('<a class="ui-dialog-titlebar-restore ui-corner-all ui-state-default" href="#"><span class="ui-icon ' + this.options.icons.restore + '" title="restore">restore</span></a>').find('.ui-dialog-titlebar-restore').attr("role", "button").mouseover(function() {
+ return $(this).addClass("ui-state-hover");
+ }).mouseout(function() {
+ return $(this).removeClass("ui-state-hover");
+ }).focus(function() {
+ return $(this).addClass("ui-state-focus");
+ }).blur(function() {
+ return $(this).removeClass("ui-state-focus");
+ }).end().find(".ui-dialog-titlebar-close").toggle(this.options.closable).end().find(".ui-dialog-titlebar-restore").hide().click(function(e) {
+ e.preventDefault();
+ return _this.restore();
+ }).end();
+ _ref = this.modes;
+ for (name in _ref) {
+ mode = _ref[name];
+ this._initModuleButton(name, mode);
+ }
+ return titlebar.dblclick(function(evt) {
+ if (_this.options.dblclick) {
+ if (_this._state !== "normal") {
+ return _this.restore();
+ } else {
+ return _this[_this.options.dblclick]();
+ }
+ }
+ }).select(function() {
+ return false;
+ });
+ },
+ _initModuleButton: function(name, mode) {
+ var buttonPane,
+ _this = this;
+
+ buttonPane = $(this.element[0]).dialog("widget").find('.ui-dialog-titlebar-buttonpane');
+ return buttonPane.append('<a class="ui-dialog-titlebar-' + name + ' ui-corner-all ui-state-default" href="#" title="' + name + '"><span class="ui-icon ' + this.options.icons[name] + '">' + name + '</span></a>').find(".ui-dialog-titlebar-" + name).attr("role", "button").mouseover(function() {
+ return $(this).addClass("ui-state-hover");
+ }).mouseout(function() {
+ return $(this).removeClass("ui-state-hover");
+ }).focus(function() {
+ return $(this).addClass("ui-state-focus");
+ }).blur(function() {
+ return $(this).removeClass("ui-state-focus");
+ }).end().find(".ui-dialog-titlebar-" + name).toggle(this.options[mode.option]).click(function(e) {
+ e.preventDefault();
+ return _this[name]();
+ }).end();
+ },
+ _initTitleBar: function() {
+ var handle;
+
+ switch (this.options.titlebar) {
+ case false:
+ return 0;
+ case "none":
+ if ($(this.element[0]).dialog("option", "draggable")) {
+ handle = $("<div />").addClass("ui-dialog-draggable-handle").css("cursor", "move").height(5);
+ $(this.element[0]).dialog("widget").prepend(handle).draggable("option", "handle", handle);
+ }
+ return $(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").find(".ui-dialog-title").html(" ").end().css({
+ "background-color": "transparent",
+ "background-image": "none",
+ "border": 0,
+ "position": "absolute",
+ "right": 0,
+ "top": 0,
+ "z-index": 9999
+ }).end();
+ case "transparent":
+ return $(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").css({
+ "background-color": "transparent",
+ "background-image": "none",
+ "border": 0
+ });
+ default:
+ return $.error("jQuery.dialogExtend Error : Invalid <titlebar> value '" + this.options.titlebar + "'");
+ }
+ },
+ state: function() {
+ return this._state;
+ },
+ restore: function() {
+ this._trigger("beforeRestore");
+ this._restore();
+ this._toggleButtons();
+ return this._trigger("restore");
+ },
+ _restore: function() {
+ if (this._state !== "normal") {
+ this["_restore_" + this._state]();
+ this._setState("normal");
+ return $(this.element[0]).dialog("widget").focus();
+ }
+ },
+ _saveSnapshot: function() {
+ if (this._state === "normal") {
+ this.original_config_resizable = $(this.element[0]).dialog("option", "resizable");
+ this.original_config_draggable = $(this.element[0]).dialog("option", "draggable");
+ this.original_size_height = $(this.element[0]).dialog("widget").outerHeight();
+ this.original_size_width = $(this.element[0]).dialog("option", "width");
+ this.original_size_maxHeight = $(this.element[0]).dialog("option", "maxHeight");
+ this.original_position_mode = $(this.element[0]).dialog("widget").css("position");
+ this.original_position_left = $(this.element[0]).dialog("widget").offset().left - $('body').scrollLeft();
+ this.original_position_top = $(this.element[0]).dialog("widget").offset().top - $('body').scrollTop();
+ return this.original_titlebar_wrap = $(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").css("white-space");
+ }
+ },
+ _loadSnapshot: function() {
+ return {
+ "config": {
+ "resizable": this.original_config_resizable,
+ "draggable": this.original_config_draggable
+ },
+ "size": {
+ "height": this.original_size_height,
+ "width": this.original_size_width,
+ "maxHeight": this.original_size_maxHeight
+ },
+ "position": {
+ "mode": this.original_position_mode,
+ "left": this.original_position_left,
+ "top": this.original_position_top
+ },
+ "titlebar": {
+ "wrap": this.original_titlebar_wrap
+ }
+ };
+ },
+ _toggleButtons: function(newstate) {
+ var mode, name, state, _ref, _ref1, _results;
+
+ state = newstate || this._state;
+ $(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-restore").toggle(state !== "normal").css({
+ "right": "1.4em"
+ }).end();
+ _ref = this.modes;
+ for (name in _ref) {
+ mode = _ref[name];
+ $(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-" + name).toggle(state !== mode.state && this.options[mode.option]);
+ }
+ _ref1 = this.modes;
+ _results = [];
+ for (name in _ref1) {
+ mode = _ref1[name];
+ if (mode.state === state) {
+ _results.push($(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-restore").insertAfter($(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-" + name)).end());
+ } else {
+ _results.push(void 0);
+ }
+ }
+ return _results;
+ }
+ });
+
+}).call(this);
+
+(function() {
+ var $;
+
+ $ = jQuery;
+
+ $.extend(true, $.ui.dialogExtend.prototype, {
+ modes: {
+ "collapse": {
+ option: "collapsable",
+ state: "collapsed"
+ }
+ },
+ options: {
+ "collapsable": false,
+ "icons": {
+ "collapse": "ui-icon-triangle-1-s"
+ },
+ "beforeCollapse": null,
+ "collapse": null
+ },
+ collapse: function() {
+ var newHeight, pos;
+
+ newHeight = $(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").height() + 15;
+ this._trigger("beforeCollapse");
+ if (this._state !== "normal") {
+ this._restore();
+ }
+ this._saveSnapshot();
+ pos = $(this.element[0]).dialog("widget").position();
+ $(this.element[0]).dialog("option", {
+ "resizable": false,
+ "height": newHeight,
+ "maxHeight": newHeight,
+ "position": [pos.left - $(document).scrollLeft(), pos.top - $(document).scrollTop()]
+ }).on('dialogclose', this._collapse_restore).hide().dialog("widget").find(".ui-dialog-buttonpane:visible").hide().end().find(".ui-dialog-titlebar").css("white-space", "nowrap").end().find(".ui-dialog-content");
+ this._setState("collapsed");
+ this._toggleButtons();
+ return this._trigger("collapse");
+ },
+ _restore_collapsed: function() {
+ var original;
+
+ original = this._loadSnapshot();
+ return $(this.element[0]).show().dialog("widget").find(".ui-dialog-buttonpane:hidden").show().end().find(".ui-dialog-titlebar").css("white-space", original.titlebar.wrap).end().find(".ui-dialog-content").dialog("option", {
+ "resizable": original.config.resizable,
+ "height": original.size.height,
+ "maxHeight": original.size.maxHeight
+ }).off('dialogclose', this._collapse_restore);
+ },
+ _initStyles_collapse: function() {
+ var style;
+
+ if (!$(".dialog-extend-collapse-css").length) {
+ style = '';
+ style += '<style class="dialog-extend-collapse-css" type="text/css">';
+ style += '.ui-dialog .ui-dialog-titlebar-collapse { width: 19px; height: 18px; }';
+ style += '.ui-dialog .ui-dialog-titlebar-collapse span { display: block; margin: 1px; }';
+ style += '.ui-dialog .ui-dialog-titlebar-collapse:hover,';
+ style += '.ui-dialog .ui-dialog-titlebar-collapse:focus { padding: 0; }';
+ style += '</style>';
+ return $(style).appendTo("body");
+ }
+ },
+ _collapse_restore: function() {
+ return $(this).dialogExtend("restore");
+ }
+ });
+
+}).call(this);
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/ac232ec4/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/jquery.dialogextend.min.js
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/jquery.dialogextend.min.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/jquery.dialogextend.min.js
new file mode 100644
index 0000000..7aaae95
--- /dev/null
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/jquery.dialogextend.min.js
@@ -0,0 +1,3 @@
+/* Licensed MIT */
+/*! jquery-dialogextend 2.0.4 2014-07-08 */
+(function(){var i;i=jQuery,i.widget("ui.dialogExtend",{version:"2.0.4",modes:{},options:{closable:!0,dblclick:!1,titlebar:!1,icons:{close:"ui-icon-closethick",restore:"ui-icon-newwin"},load:null,beforeRestore:null,restore:null},_create:function(){return this._state="normal",i(this.element[0]).data("ui-dialog")||i.error("jQuery.dialogExtend Error : Only jQuery UI Dialog element is accepted"),this._verifyOptions(),this._initStyles(),this._initButtons(),this._initTitleBar(),this._setState("normal"),this._on("load",function(i){return console.log("test",i)}),this._trigger("load")},_setState:function(t){return i(this.element[0]).removeClass("ui-dialog-"+this._state).addClass("ui-dialog-"+t),this._state=t},_verifyOptions:function(){var t,e,o;!this.options.dblclick||this.options.dblclick in this.modes||(i.error("jQuery.dialogExtend Error : Invalid <dblclick> value '"+this.options.dblclick+"'"),this.options.dblclick=!1),this.options.titlebar&&"none"!==(e=this.options.titlebar)&&"transparent"
!==e&&(i.error("jQuery.dialogExtend Error : Invalid <titlebar> value '"+this.options.titlebar+"'"),this.options.titlebar=!1),o=[];for(t in this.modes)this["_verifyOptions_"+t]?o.push(this["_verifyOptions_"+t]()):o.push(void 0);return o},_initStyles:function(){var t,e,o;i(".dialog-extend-css").length||(e="",e+='<style class="dialog-extend-css" type="text/css">',e+=".ui-dialog .ui-dialog-titlebar-buttonpane>a { float: right; }",e+=".ui-dialog .ui-dialog-titlebar-restore { width: 19px; height: 18px; }",e+=".ui-dialog .ui-dialog-titlebar-restore span { display: block; margin: 1px; }",e+=".ui-dialog .ui-dialog-titlebar-restore:hover,",e+=".ui-dialog .ui-dialog-titlebar-restore:focus { padding: 0; }",e+=".ui-dialog .ui-dialog-titlebar ::selection { background-color: transparent; }",e+="</style>",i(e).appendTo("body")),o=[];for(t in this.modes)o.push(this["_initStyles_"+t]());return o},_initButtons:function(){var t,e,o,n,a,l=this;n=i(this.element[0]).dialog("widget").find(".ui-dialog-title
bar"),t=i('<div class="ui-dialog-titlebar-buttonpane"></div>').appendTo(n),t.css({position:"absolute",top:"50%",right:"0.3em","margin-top":"-10px",height:"18px"}),n.find(".ui-dialog-titlebar-close").css({position:"relative","float":"right",top:"auto",right:"auto",margin:0}).find(".ui-icon").removeClass("ui-icon-closethick").addClass(this.options.icons.close).end().appendTo(t).end(),t.append('<a class="ui-dialog-titlebar-restore ui-corner-all ui-state-default" href="#"><span class="ui-icon '+this.options.icons.restore+'" title="restore">restore</span></a>').find(".ui-dialog-titlebar-restore").attr("role","button").mouseover(function(){return i(this).addClass("ui-state-hover")}).mouseout(function(){return i(this).removeClass("ui-state-hover")}).focus(function(){return i(this).addClass("ui-state-focus")}).blur(function(){return i(this).removeClass("ui-state-focus")}).end().find(".ui-dialog-titlebar-close").toggle(this.options.closable).end().find(".ui-dialog-titlebar-restore").hide().c
lick(function(i){return i.preventDefault(),l.restore()}).end(),a=this.modes;for(o in a)e=a[o],this._initModuleButton(o,e);return n.dblclick(function(){return l.options.dblclick?"normal"!==l._state?l.restore():l[l.options.dblclick]():void 0}).select(function(){return!1})},_initModuleButton:function(t,e){var o,n=this;return o=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-buttonpane"),o.append('<a class="ui-dialog-titlebar-'+t+' ui-corner-all ui-state-default" href="#" title="'+t+'"><span class="ui-icon '+this.options.icons[t]+'">'+t+"</span></a>").find(".ui-dialog-titlebar-"+t).attr("role","button").mouseover(function(){return i(this).addClass("ui-state-hover")}).mouseout(function(){return i(this).removeClass("ui-state-hover")}).focus(function(){return i(this).addClass("ui-state-focus")}).blur(function(){return i(this).removeClass("ui-state-focus")}).end().find(".ui-dialog-titlebar-"+t).toggle(this.options[e.option]).click(function(i){return i.preventDefault(),n[t]()})
.end()},_initTitleBar:function(){var t;switch(this.options.titlebar){case!1:return 0;case"none":return i(this.element[0]).dialog("option","draggable")&&(t=i("<div />").addClass("ui-dialog-draggable-handle").css("cursor","move").height(5),i(this.element[0]).dialog("widget").prepend(t).draggable("option","handle",t)),i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").find(".ui-dialog-title").html(" ").end().css({"background-color":"transparent","background-image":"none",border:0,position:"absolute",right:0,top:0,"z-index":9999}).end();case"transparent":return i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").css({"background-color":"transparent","background-image":"none",border:0});default:return i.error("jQuery.dialogExtend Error : Invalid <titlebar> value '"+this.options.titlebar+"'")}},state:function(){return this._state},restore:function(){return this._trigger("beforeRestore"),this._restore(),this._toggleButtons(),this._trigger("restore")},_restore:
function(){return"normal"!==this._state?(this["_restore_"+this._state](),this._setState("normal"),i(this.element[0]).dialog("widget").focus()):void 0},_saveSnapshot:function(){return"normal"===this._state?(this.original_config_resizable=i(this.element[0]).dialog("option","resizable"),this.original_config_draggable=i(this.element[0]).dialog("option","draggable"),this.original_size_height=i(this.element[0]).dialog("widget").outerHeight(),this.original_size_width=i(this.element[0]).dialog("option","width"),this.original_size_maxHeight=i(this.element[0]).dialog("option","maxHeight"),this.original_position_mode=i(this.element[0]).dialog("widget").css("position"),this.original_position_left=i(this.element[0]).dialog("widget").offset().left-i("body").scrollLeft(),this.original_position_top=i(this.element[0]).dialog("widget").offset().top-i("body").scrollTop(),this.original_titlebar_wrap=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").css("white-space")):void 0},_loadSnapsho
t:function(){return{config:{resizable:this.original_config_resizable,draggable:this.original_config_draggable},size:{height:this.original_size_height,width:this.original_size_width,maxHeight:this.original_size_maxHeight},position:{mode:this.original_position_mode,left:this.original_position_left,top:this.original_position_top},titlebar:{wrap:this.original_titlebar_wrap}}},_toggleButtons:function(t){var e,o,n,a,l,s;n=t||this._state,i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-restore").toggle("normal"!==n).css({right:"1.4em"}).end(),a=this.modes;for(o in a)e=a[o],i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-"+o).toggle(n!==e.state&&this.options[e.option]);l=this.modes,s=[];for(o in l)e=l[o],e.state===n?s.push(i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-restore").insertAfter(i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-"+o)).end()):s.push(void 0);return s}})}).call(this),function(){var i;i=jQuery,i.extend(!0,i.ui.dia
logExtend.prototype,{modes:{collapse:{option:"collapsable",state:"collapsed"}},options:{collapsable:!1,icons:{collapse:"ui-icon-triangle-1-s"},beforeCollapse:null,collapse:null},collapse:function(){var t,e;return t=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").height()+15,this._trigger("beforeCollapse"),"normal"!==this._state&&this._restore(),this._saveSnapshot(),e=i(this.element[0]).dialog("widget").position(),i(this.element[0]).dialog("option",{resizable:!1,height:t,maxHeight:t,position:[e.left-i(document).scrollLeft(),e.top-i(document).scrollTop()]}).on("dialogclose",this._collapse_restore).hide().dialog("widget").find(".ui-dialog-buttonpane:visible").hide().end().find(".ui-dialog-titlebar").css("white-space","nowrap").end().find(".ui-dialog-content"),this._setState("collapsed"),this._toggleButtons(),this._trigger("collapse")},_restore_collapsed:function(){var t;return t=this._loadSnapshot(),i(this.element[0]).show().dialog("widget").find(".ui-dialog-buttonpane:
hidden").show().end().find(".ui-dialog-titlebar").css("white-space",t.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{resizable:t.config.resizable,height:t.size.height,maxHeight:t.size.maxHeight}).off("dialogclose",this._collapse_restore)},_initStyles_collapse:function(){var t;return i(".dialog-extend-collapse-css").length?void 0:(t="",t+='<style class="dialog-extend-collapse-css" type="text/css">',t+=".ui-dialog .ui-dialog-titlebar-collapse { width: 19px; height: 18px; }",t+=".ui-dialog .ui-dialog-titlebar-collapse span { display: block; margin: 1px; }",t+=".ui-dialog .ui-dialog-titlebar-collapse:hover,",t+=".ui-dialog .ui-dialog-titlebar-collapse:focus { padding: 0; }",t+="</style>",i(t).appendTo("body"))},_collapse_restore:function(){return i(this).dialogExtend("restore")}})}.call(this);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/ac232ec4/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
index 2b9e9e4..c85190e 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
@@ -17,39 +17,57 @@
* under the License.
*/
var Video = (function() {
- var self = {}, c, box, v, vc, t, swf;
+ var self = {}, c, box, v, vc, t, swf, size;
function _getName() {
return c.user.firstName + ' ' + c.user.lastName;
}
- function _resetSize() {
- v.dialog("option", "width", c.width).dialog("option", "height", t.height() + c.height + 2);
- vc.width(c.width).height(c.height);
- swf.attr('width', c.width).attr('height', c.height);
+ function _resetSize(_w, _h) {
+ var w = _w || size.width, h = _h || size.height;
+ _setSize(w, h);
+ }
+ function _setSize(w, h) {
+ v.dialog("option", "width", w).dialog("option", "height", t.height() + h + 2);
+ vc.width(w).height(h);
+ swf.attr('width', w).attr('height', h);
}
function _init(_box, _c) {
c = _c;
box = _box;
+ size = {width: c.width, height: c.height};
var _id = "video" + c.uid, name = _getName()
- , w = c.self ? Math.max(300, c.width) : c.width
- , h = c.self ? Math.max(200, c.height) : c.height;
+ , _w = c.self ? Math.max(300, c.width) : c.width
+ , _h = c.self ? Math.max(200, c.height) : c.height;
box.append($('#user-video').clone().attr('id', _id).attr('title', name).data(self));
v = $('#' + _id);
v.dialog({
classes: {
'ui-dialog': 'ui-corner-all video user-video'
- , 'ui-dialog-titlebar': 'ui-corner-all no-close'
}
- , width: w
+ , width: _w
, minWidth: 40
, minHeight: 50
, autoOpen: true
, modal: false
- //resizeStop
+ , resizeStop: function(event, ui) {
+ var i = 0;
+ }
+ }).dialogExtend({
+ icons: {
+ 'collapse': 'ui-icon-minus'
+ }
+ , closable: false
+ , collapsable: true
+ , dblclick: "collapse"
+ , restore : function(evt, dlg) {
+ var w = c.self ? Math.max(300, size.width) : size.width
+ , h = c.self ? Math.max(200, size.height) : size.height;
+ _setSize(w, h);
+ }
});
t = v.parent().find('.ui-dialog-titlebar').attr('title', name);
vc = v.find('.video');
- vc.width(w).height(h);
+ vc.width(_w).height(_h);
//broadcast
var o = VideoManager.getOptions();
if (c.self) {
@@ -65,7 +83,7 @@ var Video = (function() {
o.sid = c.sid;
o.broadcastId = c.broadcastId;
swf = initVideo(vc, _id + '-swf', o);
- swf.attr('width', w).attr('height', h);
+ swf.attr('width', _w).attr('height', _h);
}
function _update(_c) {
// TODO check, update video
@@ -106,8 +124,7 @@ var VideoManager = (function() {
Video().init(box, c);
}
function _close(uid) {
- var _id = _getVid(uid)
- , v = $('#' + _id);
+ var _id = _getVid(uid), v = $('#' + _id);
if (v.length == 1) {
v.remove();
}