commit
db25f52a41
|
@ -162,6 +162,8 @@ define([
|
||||||
this.api.asc_registerCallback("asc_onPluginMouseMove", _.bind(this.onPluginMouseMove, this));
|
this.api.asc_registerCallback("asc_onPluginMouseMove", _.bind(this.onPluginMouseMove, this));
|
||||||
this.api.asc_registerCallback('asc_onPluginsReset', _.bind(this.resetPluginsList, this));
|
this.api.asc_registerCallback('asc_onPluginsReset', _.bind(this.resetPluginsList, this));
|
||||||
this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.onPluginsInit, this));
|
this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.onPluginsInit, this));
|
||||||
|
this.api.asc_registerCallback('asc_onPluginShowButton', _.bind(this.onPluginShowButton, this));
|
||||||
|
this.api.asc_registerCallback('asc_onPluginHideButton', _.bind(this.onPluginHideButton, this));
|
||||||
|
|
||||||
this.loadPlugins();
|
this.loadPlugins();
|
||||||
}
|
}
|
||||||
|
@ -381,6 +383,7 @@ define([
|
||||||
buttons: isCustomWindow ? undefined : newBtns,
|
buttons: isCustomWindow ? undefined : newBtns,
|
||||||
toolcallback: _.bind(this.onToolClose, this),
|
toolcallback: _.bind(this.onToolClose, this),
|
||||||
help: !!help,
|
help: !!help,
|
||||||
|
loader: plugin.get_Loader(),
|
||||||
modal: isModal!==undefined ? isModal : true
|
modal: isModal!==undefined ? isModal : true
|
||||||
});
|
});
|
||||||
me.pluginDlg.on({
|
me.pluginDlg.on({
|
||||||
|
@ -399,6 +402,9 @@ define([
|
||||||
},
|
},
|
||||||
'help': function(){
|
'help': function(){
|
||||||
help && window.open(help, '_blank');
|
help && window.open(help, '_blank');
|
||||||
|
},
|
||||||
|
'header:click': function(type){
|
||||||
|
me.api.asc_pluginButtonClick(type);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -458,6 +464,14 @@ define([
|
||||||
this.parsePlugins(pluginsdata)
|
this.parsePlugins(pluginsdata)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onPluginShowButton: function(id) {
|
||||||
|
this.pluginDlg && this.pluginDlg.showButton(id);
|
||||||
|
},
|
||||||
|
|
||||||
|
onPluginHideButton: function(id) {
|
||||||
|
this.pluginDlg && this.pluginDlg.hideButton(id);
|
||||||
|
},
|
||||||
|
|
||||||
runAutoStartPlugins: function() {
|
runAutoStartPlugins: function() {
|
||||||
if (this.autostart && this.autostart.length > 0) {
|
if (this.autostart && this.autostart.length > 0) {
|
||||||
this.api.asc_pluginRun(this.autostart.shift(), 0, '');
|
this.api.asc_pluginRun(this.autostart.shift(), 0, '');
|
||||||
|
|
|
@ -77,6 +77,7 @@ define([
|
||||||
_options.tpl = _.template(this.template)(_options);
|
_options.tpl = _.template(this.template)(_options);
|
||||||
|
|
||||||
this.url = options.url || '';
|
this.url = options.url || '';
|
||||||
|
this.loader = (options.loader!==undefined) ? options.loader : true;
|
||||||
this.frameId = options.frameId || 'plugin_iframe';
|
this.frameId = options.frameId || 'plugin_iframe';
|
||||||
Common.UI.Window.prototype.initialize.call(this, _options);
|
Common.UI.Window.prototype.initialize.call(this, _options);
|
||||||
},
|
},
|
||||||
|
@ -90,6 +91,8 @@ define([
|
||||||
if (!this.options.header) this._headerFooterHeight -= 34;
|
if (!this.options.header) this._headerFooterHeight -= 34;
|
||||||
this._headerFooterHeight += ((parseInt(this.$window.css('border-top-width')) + parseInt(this.$window.css('border-bottom-width'))));
|
this._headerFooterHeight += ((parseInt(this.$window.css('border-top-width')) + parseInt(this.$window.css('border-bottom-width'))));
|
||||||
|
|
||||||
|
this.$window.find('.header').prepend($('<div class="tools left hidden"></div>'));
|
||||||
|
|
||||||
var iframe = document.createElement("iframe");
|
var iframe = document.createElement("iframe");
|
||||||
iframe.id = this.frameId;
|
iframe.id = this.frameId;
|
||||||
iframe.name = 'pluginFrameEditor';
|
iframe.name = 'pluginFrameEditor';
|
||||||
|
@ -102,6 +105,7 @@ define([
|
||||||
iframe.onload = _.bind(this._onLoad,this);
|
iframe.onload = _.bind(this._onLoad,this);
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
|
if (this.loader) {
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
if (me.isLoaded) return;
|
if (me.isLoaded) return;
|
||||||
me.loadMask = new Common.UI.LoadMask({owner: $('#id-plugin-placeholder')});
|
me.loadMask = new Common.UI.LoadMask({owner: $('#id-plugin-placeholder')});
|
||||||
|
@ -109,6 +113,7 @@ define([
|
||||||
me.loadMask.show();
|
me.loadMask.show();
|
||||||
if (me.isLoaded) me.loadMask.hide();
|
if (me.isLoaded) me.loadMask.hide();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
iframe.src = this.url;
|
iframe.src = this.url;
|
||||||
$('#id-plugin-placeholder').append(iframe);
|
$('#id-plugin-placeholder').append(iframe);
|
||||||
|
@ -180,6 +185,32 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showButton: function(id) {
|
||||||
|
var header = this.$window.find('.header .tools.left');
|
||||||
|
if (id=='back') {
|
||||||
|
var btn = header.find('#id-plugindlg-' + id);
|
||||||
|
if (btn.length<1) {
|
||||||
|
btn = $('<div id="id-plugindlg-' + id + '" class="tool help" style="font-size:20px;">←</div>');
|
||||||
|
btn.on('click', _.bind(function() {
|
||||||
|
this.fireEvent('header:click',id);
|
||||||
|
}, this));
|
||||||
|
header.prepend(btn);
|
||||||
|
}
|
||||||
|
btn.show();
|
||||||
|
header.removeClass('hidden');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
hideButton: function(id) {
|
||||||
|
var header = this.$window.find('.header .tools.left');
|
||||||
|
if (id=='back') {
|
||||||
|
var btn = header.find('#id-plugindlg-' + id);
|
||||||
|
if (btn.length>0) {
|
||||||
|
btn.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
textLoading : 'Loading'
|
textLoading : 'Loading'
|
||||||
}, Common.Views.PluginDlg || {}));
|
}, Common.Views.PluginDlg || {}));
|
||||||
});
|
});
|
|
@ -46,8 +46,8 @@
|
||||||
&:before, &:after {
|
&:before, &:after {
|
||||||
content: ' ';
|
content: ' ';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 7px;
|
left: 8px;
|
||||||
left: calc(7px / @pixel-ratio-factor);
|
left: calc(8px / @pixel-ratio-factor);
|
||||||
top: @scaled-one-px-value-ie;
|
top: @scaled-one-px-value-ie;
|
||||||
top: @scaled-one-px-value;
|
top: @scaled-one-px-value;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
|
@ -116,6 +116,12 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
padding-right: 6px;
|
padding-right: 6px;
|
||||||
|
|
||||||
|
&.left {
|
||||||
|
left: 0;
|
||||||
|
right: auto;
|
||||||
|
padding-left: 6px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tool.help {
|
.tool.help {
|
||||||
|
|
|
@ -175,6 +175,7 @@ define([
|
||||||
buttons: isCustomWindow ? undefined : newBtns,
|
buttons: isCustomWindow ? undefined : newBtns,
|
||||||
toolcallback: _.bind(this.onToolClose, this),
|
toolcallback: _.bind(this.onToolClose, this),
|
||||||
help: !!help,
|
help: !!help,
|
||||||
|
loader: plugin.get_Loader(),
|
||||||
modal: isModal!==undefined ? isModal : true
|
modal: isModal!==undefined ? isModal : true
|
||||||
});
|
});
|
||||||
me.pluginDlg.on({
|
me.pluginDlg.on({
|
||||||
|
|
Loading…
Reference in a new issue