commit 19617dfb06a4c0f83d9ab81164ce762230a73c40
parent a37cf2e795bd6da71849fb0e3349432e9f8cb0dd
Author: Jan Dankert <devnull@localhost>
Date: Tue, 6 Mar 2018 22:00:19 +0100
Neues Objekt "Workbench" zum Kapseln der Workbench-Operationen.
Diffstat:
2 files changed, 101 insertions(+), 61 deletions(-)
diff --git a/modules/cms-ui/themes/default/script/openrat.js b/modules/cms-ui/themes/default/script/openrat.js
@@ -1,4 +1,6 @@
+'use strict';
+
// Default-Subaction
var DEFAULT_CONTENT_ACTION = 'edit';
@@ -15,25 +17,108 @@ $( function()
refreshAll();
- // Alle 5 Minuten pingen.
- window.setInterval( function(){ping();}, 300000 );
+ Workbench.initialize();
});
-
-/**
- * Ping den Server. Führt keine Aktion aus, aber sorgt dafür, dass die Sitzung erhalten bleibt.
- *
- * "Geben Sie mir ein Ping, Vasily. Und bitte nur ein einziges Ping!" (aus: Jagd auf Roter Oktober)
- */
-function ping()
+
+var Workbench = new function()
{
- $.ajax( createUrl('title','ping',0) );
- //window.console && console.log("session-ping");
+ /**
+ * Initializes the Workbench.
+ */
+ this.initialize = function() {
+
+ // Initialze Ping timer.
+ this.initializePingTimer();
+ }
+
+
+ /**
+ * Registriert den Ping-Timer für den Sitzungserhalt.
+ */
+ this.initializePingTimer = function() {
+
+ /**
+ * Ping den Server. Führt keine Aktion aus, aber sorgt dafür, dass die Sitzung erhalten bleibt.
+ *
+ * "Geben Sie mir ein Ping, Vasily. Und bitte nur ein einziges Ping!" (aus: Jagd auf Roter Oktober)
+ */
+ var ping = function()
+ {
+ $.ajax( createUrl('title','ping',0) );
+ //window.console && console.log("session-ping");
+ }
+
+ // Alle 5 Minuten pingen.
+ var timeoutMinutes = 5;
+
+ window.setInterval( ping, timeoutMinutes*60*1000 );
+ }
+
+
+ /**
+ *
+ */
+ this.openNewTab = function(contentEl,action,method,id,params ) {
+
+ // Schauen, ob der Inhalt schon geladen ist...
+ var targetEl = $(contentEl).children('div.sheet.action-'+action+'.method-'+method+'.id-'+id);
+
+ if ( targetEl.length == 0 )
+ {
+ // Noch nicht vorhanden, neues Element erstellen.
+ $(contentEl).children('div.sheet').hide();
+ targetEl = $('<div class="sheet action-'+action+' method-'+method+' id-'+id + '" />' );
+ $(contentEl).append(targetEl);
+ }
+ else
+ {
+ if ( targetEl.is(':visible') )
+ {
+ return;
+ }
+ else
+ {
+ $(contentEl).children('div.sheet').hide();
+ targetEl.show();
+ return;
+ }
+ }
+
+ var url = createUrl(action,method,id,params); // URL für das Laden erzeugen.
+
+ $(targetEl).empty().fadeTo(1,0.7).addClass('loader').html('').load(url,function(response, status, xhr) {
+ $(targetEl).fadeTo(350,1);
+
+ if ( status == "error" )
+ {
+ // Seite nicht gefunden.
+ $(targetEl).html("");
+ $(targetEl).removeClass("loader");
+
+ notify('error',response);
+ // OK-button Ausblenden.
+ //$(targetEl).closest('div.panel').find('div.bottom > div.command > input').addClass('invisible');
+ // var msg = "Sorry but there was an error: ";
+ //$(this).html(msg + xhr.status + " " + xhr.statusText);
+ return;
+ }
+
+ $(targetEl).removeClass("loader");
+ registerViewEvents( targetEl );
+ });
+
+ }
+
}
+
+
+
+
function refreshAll()
{
//$('ul#history').sortable();
@@ -410,52 +495,7 @@ function loadViewByName(viewName, url )
*/
function loadView(contentEl,action,method,id,params )
{
- // Schauen, ob der Inhalt schon geladen ist...
- var targetEl = $(contentEl).children('div.sheet.action-'+action+'.method-'+method+'.id-'+id);
-
- if ( targetEl.length == 0 )
- {
- // Noch nicht vorhanden, neues Element erstellen.
- $(contentEl).children('div.sheet').hide();
- targetEl = $('<div class="sheet action-'+action+' method-'+method+' id-'+id + '" />' );
- $(contentEl).append(targetEl);
- }
- else
- {
- if ( targetEl.is(':visible') )
- {
- return;
- }
- else
- {
- $(contentEl).children('div.sheet').hide();
- targetEl.show();
- return;
- }
- }
-
- var url = createUrl(action,method,id,params); // URL für das Laden erzeugen.
-
- $(targetEl).empty().fadeTo(1,0.7).addClass('loader').html('').load(url,function(response, status, xhr) {
- $(targetEl).fadeTo(350,1);
-
- if ( status == "error" )
- {
- // Seite nicht gefunden.
- $(targetEl).html("");
- $(targetEl).removeClass("loader");
-
- notify('error',response);
- // OK-button Ausblenden.
- //$(targetEl).closest('div.panel').find('div.bottom > div.command > input').addClass('invisible');
- // var msg = "Sorry but there was an error: ";
- //$(this).html(msg + xhr.status + " " + xhr.statusText);
- return;
- }
-
- $(targetEl).removeClass("loader");
- registerViewEvents( targetEl );
- });
+ Workbench.openNewTab(contentEl,action,method,id,params );
}
diff --git a/modules/cms-ui/themes/default/script/openrat.min.js b/modules/cms-ui/themes/default/script/openrat.min.js
@@ -1,10 +1,10 @@
-;var DEFAULT_CONTENT_ACTION='edit',OR_THEMES_EXT_DIR='modules/cms-ui/themes/';$(function(){$('html').removeClass('nojs');$('.initial-hidden').removeClass('initial-hidden');refreshAll();window.setInterval(function(){ping()},300000)});function ping(){$.ajax(createUrl('title','ping',0))};function refreshAll(){refreshTitleBar();refreshWorkbench();$('div#filler').click(function(){if($('div#dialog').hasClass('modal')){}
+'use strict';var DEFAULT_CONTENT_ACTION='edit',OR_THEMES_EXT_DIR='modules/cms-ui/themes/';$(function(){$('html').removeClass('nojs');$('.initial-hidden').removeClass('initial-hidden');refreshAll();Workbench.initialize()});var Workbench=new function(){this.initialize=function(){this.initializePingTimer()};this.initializePingTimer=function(){var e=function(){$.ajax(createUrl('title','ping',0))},i=5;window.setInterval(e,i*60*1000)};this.openNewTab=function(e,i,t,n,s){var a=$(e).children('div.sheet.action-'+i+'.method-'+t+'.id-'+n);if(a.length==0){$(e).children('div.sheet').hide();a=$('<div class="sheet action-'+i+' method-'+t+' id-'+n+'" />');$(e).append(a)}
+else{if(a.is(':visible')){return}
+else{$(e).children('div.sheet').hide();a.show();return}};var d=createUrl(i,t,n,s);$(a).empty().fadeTo(1,0.7).addClass('loader').html('').load(d,function(e,i,t){$(a).fadeTo(350,1);if(i=='error'){$(a).html('');$(a).removeClass('loader');notify('error',e);return};$(a).removeClass('loader');registerViewEvents(a)})}};function refreshAll(){refreshTitleBar();refreshWorkbench();$('div#filler').click(function(){if($('div#dialog').hasClass('modal')){}
else{$('div#dialog').html('').hide();$('div#filler').fadeOut(500)}})};function refreshAllRefreshables(){$('#workbench div.panel > div.header > ul.views > li.active').each(function(){if($(this).hasClass('static'))return;var e=$(this).data('method'),i=$(this).data('action'),t=$(this).data('id'),a=$(this).data('extra');loadView($(this).closest('div.panel').find('div.content'),i,e,t,a)})};function refreshActualView(e){$(e).closest('div.panel').find('li.active').each(function(){var e=$(this).attr('data-method'),i=$(this).attr('data-action'),t=$(this).attr('data-id');loadView($(this).closest('div.panel').find('div.content'),i,e,t)})};function refreshWorkbench(){$('ul#history').empty();resizeWorkbench();$('div.modaldialog').fadeOut(500);$('#workbench').removeClass('modal');$('div#filler').fadeOut(500);$('#workbench').fadeIn(750).find('li.active').each(function(){var i=$(this).attr('data-method'),e=$(this).attr('data-action');if(e)loadView($(this).closest('div.panel').find('div.content'),e,i,0)});$('div.backward_link').click(function(){var e=$(this).closest('div.header').find('ul.views'),i=e.find('li.action.active').prev();e.scrollTo(i,500,{'axis':'x'});i.click()});$('div.forward_link').click(function(){var e=$(this).closest('div.header').find('ul.views'),i=e.find('li.action.active').next();e.scrollTo(i,500,{'axis':'x'});i.click()});registerWorkbenchEvents();$(window).resize(function(){resizeWorkbench()})};function registerWorkbenchEvents(){$('ul.views > li.action').draggable({cursor:'move',revert:'invalid'});$('ul.views').droppable({accept:'li.action',hoverClass:'drophover',activeClass:'dropactive',drop:function(e,i){var a=i.draggable,s=$(this),n=a.parent();if($(a).closest('div.panel').attr('id')==$(s).closest('div.panel').attr('id'))$(a).css({top:0,left:0});else $(a).detach().css({top:0,left:0}).appendTo(s).click();if(n.find('li').size()==0){var t=n.closest('div.container');n.closest('div.panel').remove();if(t.hasClass('autosize'))t.children('div.panel').addClass('autosize').removeClass('resizable');else t.children('div.panel').addClass('resizable').removeClass('autosize');t.replaceWith(t.children('div.panel'));resizeWorkbench()}}});$('div.content').droppable({accept:'li.action',hoverClass:'drophover',activeClass:'dropactive',drop:function(e,i){var n=i.draggable,s=$(this),o=n.parent(),d=n.offset(),l=s.offset(),h=d.left-l.left,v=l.left+s.width()-d.left,r=d.top-l.top,c=l.top+s.height()-d.top,t=$('<div class="container"><div class="first" /><div class="divider" /><div class="second"></div>');if(h<Math.min(v,Math.min(r,c))){t.addClass('axle-x');t.children('div.divider').addClass('to-right');t.children('div.first').removeClass('first').addClass('resizable');t.children('div.second').removeClass('first').addClass('autosize')}
else if(v<Math.min(r,c)){t.addClass('axle-x');t.children('div.divider').addClass('to-left');t.children('div.first').removeClass('first').addClass('autosize');t.children('div.second').removeClass('first').addClass('resizable')}
else if(r<c){t.addClass('axle-y');t.children('div.divider').addClass('to-bottom');t.children('div.first').removeClass('first').addClass('resizable');t.children('div.second').removeClass('first').addClass('autosize')}
-else{t.addClass('axle-y');t.children('div.divider').addClass('to-top');t.children('div.first').removeClass('first').addClass('autosize');t.children('div.second').removeClass('first').addClass('resizable')};t.children('div.resizable').addClass('bar').data('size-factor',0.4);$(n).closest('div.panel').clone().addClass('resizable').removeClass('autosize').replaceAll(t.children('div.resizable'));t.find('ul.views > li').remove();$(n).detach().css({top:0,left:0}).appendTo(t.find('ul.views')).click();var a=$(s).closest('div.panel').replaceWith(t);t.children('div.autosize').replaceWith(a);if(a.hasClass('autosize')){t.addClass('autosize').removeClass('resizable')};if(a.hasClass('resizable')){t.addClass('resizable').removeClass('autosize')};a.addClass('autosize').removeClass('resizable');if(o.find('li').length==0){var a=o.closest('div.container');o.closest('div.panel').remove();if(a.hasClass('autosize'))a.children('div.panel').addClass('autosize').removeClass('resizable');else a.children('div.panel').addClass('resizable').removeClass('autosize');a.replaceWith(a.children('div.panel'));resizeWorkbench()};resizeWorkbench();registerWorkbenchEvents()}});if($('#workbench div.panel.modal').length>0){$('#workbench div.panel.modal').parent().addClass('modal');$('div#filler').fadeTo(500,0.5);$('#workbench').addClass('modal')};$('div.container.axle-x > div.divider').draggable({stop:function(e,i){var t=i.position.left,a=$(this).hasClass('to-right')?1:-1;$(this).parent().children('div.resizable').each(function(){var e=((a*t)+$(this).width())/($(this).parent().width());e=Math.min(0.5,Math.max(0.1,e));$(this).data('size-factor',e)});resizeWorkbenchContainer($(this).parent())},axis:'x',revert:!0,revertDuration:0});$('div.container.axle-y > div.divider').draggable({stop:function(e,i){var t=i.position.top,a=$(this).hasClass('to-bottom')?1:-1;$(this).parent().children('div.resizable').each(function(){var e=((a*t)+$(this).height())/($(this).parent().height());e=Math.min(0.5,Math.max(0.1,e));$(this).data('size-factor',e)});resizeWorkbenchContainer($(this).parent())},axis:'y',revert:!0,revertDuration:0});$('ul.views > li.action').click(function(){$(this).orLoadView()});$('div.header').dblclick(function(){fullscreen(this)});loadTree()};function refreshTitleBar(){$('#header').load(createUrl('title','show',0),function(){$(this).fadeIn('slow');registerHeaderEvents()})};function loadViewByName(e,i){alert('loadViewByName');loadView($('div#'+e),i)};function loadView(e,i,t,n,s){var a=$(e).children('div.sheet.action-'+i+'.method-'+t+'.id-'+n);if(a.length==0){$(e).children('div.sheet').hide();a=$('<div class="sheet action-'+i+' method-'+t+' id-'+n+'" />');$(e).append(a)}
-else{if(a.is(':visible')){return}
-else{$(e).children('div.sheet').hide();a.show();return}};var d=createUrl(i,t,n,s);$(a).empty().fadeTo(1,0.7).addClass('loader').html('').load(d,function(e,i,t){$(a).fadeTo(350,1);if(i=='error'){$(a).html('');$(a).removeClass('loader');notify('error',e);return};$(a).removeClass('loader');registerViewEvents(a)})};function registerViewEvents(e){$(e).trigger('orViewLoaded');$(e).find('input[data-hint]').orHint();$(e).closest('div.panel').find('div.header div.dropdown div.entry.perview').remove();$(e).find('div.headermenu > a').each(function(e,i){});$(e).find('div.header > a.back').each(function(i,t){$(t).removeClass('button').wrap('<div class="entry perview" />').parent().appendTo($(e).closest('div.panel').find('div.header div.dropdown').first())});$(e).find('div.selector.tree').each(function(){var e=this;$(this).orTree({type:'project',selectable:$(e).attr('data-types').split(','),id:$(e).attr('data-init-folderid'),onSelect:function(i,t,a){var n=$(e).parent();$(n).find('input[type=text]').attr('value',i);$(n).find('input[type=hidden]').attr('value',a)}})});$('div.content li.object').draggable({cursor:'move',revert:'invalid'});$('div.content li.object > div.entry[data-type=\'folder\']').droppable({accept:'li.object',hoverClass:'drophover',activeClass:'dropactive',drop:function(e,i){var t=i.draggable,a=$(this).parent();startDialog($(this).text(),$(t).attr('data-type'),'copy',$(a).attr('data-id'),{'action':$(t).attr('data-type'),'subaction':'copy','id':$(t).attr('data-id'),'targetFolderId':$(a).attr('data-id')});$(t).detach().css({top:0,left:0}).appendTo(a).click()}});$(e).find('input').change(function(){$(this).closest('div.panel').find('ul.views li.action.active').addClass('dirty')})};function registerHeaderEvents(){$('body').click(function(){$('.toolbar-icon.menu').parent().removeClass('open')});$('#header .toolbar-icon.menu').click(function(e){e.stopPropagation();$(this).parent().toggleClass('open')});$('#header .toolbar-icon.menu').mouseover(function(){$(this).parent().find('.toolbar-icon.menu').removeClass('open');$(this).addClass('open')});$('#header').trigger('orHeaderLoaded');$('div.search input').blur(function(){$('div.search input div.dropdown').fadeOut()});$('div.search input').orHint();$('div.search input').orSearch({dropdown:'div.search div.dropdown'})};function fullscreen(e){$(e).closest('div.panel').fadeOut('fast',function(){$(this).toggleClass('fullscreen').fadeIn('fast')})};function loadTree(){if($('div#panel-tree li.action').data('action')=='tree'){$('div#panel-tree div.content > div.sheet.action-tree.method-tree').html(' ');$('div#panel-tree div.content > div.sheet.action-tree.method-tree').orTree({type:'root',id:0,onSelect:function(e,i,t,a){openNewAction(e,i,t,a)}});$('div#panel-tree div.content > div.sheet.action-tree.method-tree > ul.tree > div.tree').delay(500).click();$('div#panel-tree div.content > div.sheet.action-tree.method-tree > ul.tree > div.tree').delay(500).click()}};function submitUrl(e,i){postUrl(i,e);refreshAllRefreshables()};function postUrl(e,i){e+='&output=json';$.ajax({'type':'POST',url:e,data:{},success:function(e,t,a){$('div.panel div.status div.loader').html(' ');doResponse(e,t,i)}})};function getActiveView(){var e=$('#panel-content').find('li.active');return{'action':$(e).data('action'),'id':$(e).data('id'),'extraid':$(e).data('extra')}};function startView(e,i){var t=getActiveView();loadView($(e).closest('div.panel').find('div.content'),t.action,i,t.id,t.extraid)};function startDialog(e,i,t,a,n){if(i==null||i.length==0)i=$('#panel-content').find('li.active').data('action');if(a==null||a.length==0)a=$('#panel-content').find('li.active').data('id');if(typeof n==='undefined')n=$('#panel-content').find('li.active').data('extra');$('div#filler').fadeTo(500,0.5);$('div#dialog').html('<div class="header"><ul class="views"><li class="action active"><img class="icon" title="" src="./themes/default/images/icon/'+t+'.png" /><div class="tabname" style="width:100px;">'+e+'</div></li></ul></div><div class="content" />');$('div#dialog').data('id',a);$('div#dialog').show();loadView($('div#dialog div.content'),i,t,a,n)};function modalView(e,i){var t=$(e).closest('div.panel').find('li.active').attr('data-action'),a=$(e).closest('div.panel').find('li.active').attr('data-method'),n=$(e).closest('div.panel').find('li.active').attr('data-id');$(e).closest('div.content').modal({'overlayClose':'true','xxxonClose':function(){alert('close)')}});loadView($(e).closest('div.content'),t,a,n)};function setTitle(e){if(e)$('head > title').text(e+' - '+$('head > title').data('default'));else $('head > title').text($('head > title').data('default'))};function openNewAction(e,i,t,a){setTitle(e);$('ul#history li.active').removeClass('active');if($('ul#history li.'+i+'.id'+t).length>0){$('ul#history li.'+i+'.id'+t).addClass('active')}
+else{t.addClass('axle-y');t.children('div.divider').addClass('to-top');t.children('div.first').removeClass('first').addClass('autosize');t.children('div.second').removeClass('first').addClass('resizable')};t.children('div.resizable').addClass('bar').data('size-factor',0.4);$(n).closest('div.panel').clone().addClass('resizable').removeClass('autosize').replaceAll(t.children('div.resizable'));t.find('ul.views > li').remove();$(n).detach().css({top:0,left:0}).appendTo(t.find('ul.views')).click();var a=$(s).closest('div.panel').replaceWith(t);t.children('div.autosize').replaceWith(a);if(a.hasClass('autosize')){t.addClass('autosize').removeClass('resizable')};if(a.hasClass('resizable')){t.addClass('resizable').removeClass('autosize')};a.addClass('autosize').removeClass('resizable');if(o.find('li').length==0){var a=o.closest('div.container');o.closest('div.panel').remove();if(a.hasClass('autosize'))a.children('div.panel').addClass('autosize').removeClass('resizable');else a.children('div.panel').addClass('resizable').removeClass('autosize');a.replaceWith(a.children('div.panel'));resizeWorkbench()};resizeWorkbench();registerWorkbenchEvents()}});if($('#workbench div.panel.modal').length>0){$('#workbench div.panel.modal').parent().addClass('modal');$('div#filler').fadeTo(500,0.5);$('#workbench').addClass('modal')};$('div.container.axle-x > div.divider').draggable({stop:function(e,i){var t=i.position.left,a=$(this).hasClass('to-right')?1:-1;$(this).parent().children('div.resizable').each(function(){var e=((a*t)+$(this).width())/($(this).parent().width());e=Math.min(0.5,Math.max(0.1,e));$(this).data('size-factor',e)});resizeWorkbenchContainer($(this).parent())},axis:'x',revert:!0,revertDuration:0});$('div.container.axle-y > div.divider').draggable({stop:function(e,i){var t=i.position.top,a=$(this).hasClass('to-bottom')?1:-1;$(this).parent().children('div.resizable').each(function(){var e=((a*t)+$(this).height())/($(this).parent().height());e=Math.min(0.5,Math.max(0.1,e));$(this).data('size-factor',e)});resizeWorkbenchContainer($(this).parent())},axis:'y',revert:!0,revertDuration:0});$('ul.views > li.action').click(function(){$(this).orLoadView()});$('div.header').dblclick(function(){fullscreen(this)});loadTree()};function refreshTitleBar(){$('#header').load(createUrl('title','show',0),function(){$(this).fadeIn('slow');registerHeaderEvents()})};function loadViewByName(e,i){alert('loadViewByName');loadView($('div#'+e),i)};function loadView(e,i,t,a,n){Workbench.openNewTab(e,i,t,a,n)};function registerViewEvents(e){$(e).trigger('orViewLoaded');$(e).find('input[data-hint]').orHint();$(e).closest('div.panel').find('div.header div.dropdown div.entry.perview').remove();$(e).find('div.headermenu > a').each(function(e,i){});$(e).find('div.header > a.back').each(function(i,t){$(t).removeClass('button').wrap('<div class="entry perview" />').parent().appendTo($(e).closest('div.panel').find('div.header div.dropdown').first())});$(e).find('div.selector.tree').each(function(){var e=this;$(this).orTree({type:'project',selectable:$(e).attr('data-types').split(','),id:$(e).attr('data-init-folderid'),onSelect:function(i,t,a){var n=$(e).parent();$(n).find('input[type=text]').attr('value',i);$(n).find('input[type=hidden]').attr('value',a)}})});$('div.content li.object').draggable({cursor:'move',revert:'invalid'});$('div.content li.object > div.entry[data-type=\'folder\']').droppable({accept:'li.object',hoverClass:'drophover',activeClass:'dropactive',drop:function(e,i){var t=i.draggable,a=$(this).parent();startDialog($(this).text(),$(t).attr('data-type'),'copy',$(a).attr('data-id'),{'action':$(t).attr('data-type'),'subaction':'copy','id':$(t).attr('data-id'),'targetFolderId':$(a).attr('data-id')});$(t).detach().css({top:0,left:0}).appendTo(a).click()}});$(e).find('input').change(function(){$(this).closest('div.panel').find('ul.views li.action.active').addClass('dirty')})};function registerHeaderEvents(){$('body').click(function(){$('.toolbar-icon.menu').parent().removeClass('open')});$('#header .toolbar-icon.menu').click(function(e){e.stopPropagation();$(this).parent().toggleClass('open')});$('#header .toolbar-icon.menu').mouseover(function(){$(this).parent().find('.toolbar-icon.menu').removeClass('open');$(this).addClass('open')});$('#header').trigger('orHeaderLoaded');$('div.search input').blur(function(){$('div.search input div.dropdown').fadeOut()});$('div.search input').orHint();$('div.search input').orSearch({dropdown:'div.search div.dropdown'})};function fullscreen(e){$(e).closest('div.panel').fadeOut('fast',function(){$(this).toggleClass('fullscreen').fadeIn('fast')})};function loadTree(){if($('div#panel-tree li.action').data('action')=='tree'){$('div#panel-tree div.content > div.sheet.action-tree.method-tree').html(' ');$('div#panel-tree div.content > div.sheet.action-tree.method-tree').orTree({type:'root',id:0,onSelect:function(e,i,t,a){openNewAction(e,i,t,a)}});$('div#panel-tree div.content > div.sheet.action-tree.method-tree > ul.tree > div.tree').delay(500).click();$('div#panel-tree div.content > div.sheet.action-tree.method-tree > ul.tree > div.tree').delay(500).click()}};function submitUrl(e,i){postUrl(i,e);refreshAllRefreshables()};function postUrl(e,i){e+='&output=json';$.ajax({'type':'POST',url:e,data:{},success:function(e,t,a){$('div.panel div.status div.loader').html(' ');doResponse(e,t,i)}})};function getActiveView(){var e=$('#panel-content').find('li.active');return{'action':$(e).data('action'),'id':$(e).data('id'),'extraid':$(e).data('extra')}};function startView(e,i){var t=getActiveView();loadView($(e).closest('div.panel').find('div.content'),t.action,i,t.id,t.extraid)};function startDialog(e,i,t,a,n){if(i==null||i.length==0)i=$('#panel-content').find('li.active').data('action');if(a==null||a.length==0)a=$('#panel-content').find('li.active').data('id');if(typeof n==='undefined')n=$('#panel-content').find('li.active').data('extra');$('div#filler').fadeTo(500,0.5);$('div#dialog').html('<div class="header"><ul class="views"><li class="action active"><img class="icon" title="" src="./themes/default/images/icon/'+t+'.png" /><div class="tabname" style="width:100px;">'+e+'</div></li></ul></div><div class="content" />');$('div#dialog').data('id',a);$('div#dialog').show();loadView($('div#dialog div.content'),i,t,a,n)};function modalView(e,i){var t=$(e).closest('div.panel').find('li.active').attr('data-action'),a=$(e).closest('div.panel').find('li.active').attr('data-method'),n=$(e).closest('div.panel').find('li.active').attr('data-id');$(e).closest('div.content').modal({'overlayClose':'true','xxxonClose':function(){alert('close)')}});loadView($(e).closest('div.content'),t,a,n)};function setTitle(e){if(e)$('head > title').text(e+' - '+$('head > title').data('default'));else $('head > title').text($('head > title').data('default'))};function openNewAction(e,i,t,a){setTitle(e);$('ul#history li.active').removeClass('active');if($('ul#history li.'+i+'.id'+t).length>0){$('ul#history li.'+i+'.id'+t).addClass('active')}
else{$('ul#history').append('<li class="action active '+i+' id'+t+'"><img src="'+OR_THEMES_EXT_DIR+'default/images/icon_'+i+'.png" title="" />'+e+'</li>');$('ul#history li.active').click(function(){$('ul#history li.active').removeClass('active');$(this).addClass('active');setNewAction(i,t,a)})};$('div#panel-content > div.header > ul.views li.active').removeClass('active');if($('div#panel-content > div.header > ul.views > li.'+i+'.id'+t).length>0){$('div#panel-content > div.header > ul.views > li.'+i+'.id'+t).addClass('active')}
else{$('div#panel-content > div.header > ul.views > li.active').removeClass('active');var s=7;if($('div#panel-content > div.header > ul.views > li.action').length>=s)$('div#panel-content > div.header > ul.views > li.action').first().remove();var n=$('<li class="action active '+i+' id'+t+'" title="'+e+'"><img class="icon" src="'+OR_THEMES_EXT_DIR+'default/images/icon_'+i+'.png" title="" /><div class="tabname">'+e+'</div><img class="close icon" src="'+OR_THEMES_EXT_DIR+'default/images/icon/close.gif" title="" /></li>');$('div#panel-content > div.header > ul.views').append(n);n.data('action',i);n.data('id',t);n.data('extra',a);n.data('method',DEFAULT_CONTENT_ACTION);resizeTabs($('div#contentbar'),!0);$('div#panel-content > div.header > ul.views').scrollLeft(9999);$('div#panel-content > div.header > ul.views img.close').click(function(){setTitle('');var i=$(this).closest('li.action').data('action'),t=$(this).closest('li.action').data('id');$('#workbench div.content > div.sheet.action-'+i+'.id-'+t).remove();if($(this).closest('li.action').hasClass('active')){$('#workbench div.refreshable div.content').html('');var e=$(this).closest('ul.views');$(this).parent().remove();$(e).find('li.action').last().click()}
else{$(this).parent().remove()};resizeTabs($('div#panel-content'),!0)});$('div#panel-content > div.header > ul.views > li.active').click(function(){$('div#panel-content > div.header > ul.views li.active').removeClass('active');$(this).addClass('active');setTitle($(this).children('div.tabname').text());setNewAction(i,t,a)});resizeTabs($('div#panel-content '))};setNewAction(i,t,a)};function filterMenus(e){$('div.clickable').addClass('active');$('div.clickable.filtered').removeClass('active').addClass('inactive');$('div.clickable.filtered.on-action-'+e).addClass('active').removeClass('inactive')};function setNewAction(e,i,t){filterMenus(e);$('#workbench ul.views > li.action.dependent').data('action',e).data('id',i).data('extra',t);refreshAllRefreshables()};function setNewId(e){$('#workbench div.refreshable').attr('data-id',e);refreshAllRefreshables()};function notifyBrowser(e){if(!('Notification' in window)){return}