openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit beb0f6b0e8ed800179854ce1cd72db57e691f4d4
parent 712cb2264af0a165dad823eb473eaad3209ad12d
Author: Jan Dankert <devnull@localhost>
Date:   Fri, 31 Aug 2018 00:40:52 +0200

Mehrere View-Abschnitte gleichzeitig im Hauptbereich anzeigen und auf-/zuklappbar machen.

Diffstat:
modules/cms-ui/action/IndexAction.class.php | 20+++++++++++++++++++-
modules/cms-ui/themes/default/layout/index.php | 42++++++++++++++++++++----------------------
modules/cms-ui/themes/default/script/openrat.js | 15++++++++++++++-
modules/cms-ui/themes/default/script/openrat.min.js | 22+++++++++++-----------
modules/template-engine/components/html/group/Group.class.php | 4++--
modules/template-engine/components/html/group/group.css | 33++-------------------------------
modules/template-engine/components/html/group/group.js | 7++-----
modules/template-engine/components/html/group/group.less | 41-----------------------------------------
modules/template-engine/components/html/group/group.min.css | 4++--
modules/template-engine/components/html/group/group.min.js | 4++--
10 files changed, 74 insertions(+), 118 deletions(-)

diff --git a/modules/cms-ui/action/IndexAction.class.php b/modules/cms-ui/action/IndexAction.class.php @@ -159,7 +159,25 @@ class IndexAction extends Action if ( !empty($messageOfTheDay) ) $this->addNotice('user','','MOTD',OR_NOTICE_WARN,array('motd',$messageOfTheDay) ); - // HTML-Datei direkt einbinden. + $methods = array( + 'edit' => true, + 'info' => true, + 'preview' => false, + 'rights' => false, + 'preview' => false, + 'settings' => false, + 'history' => false, + 'prop' => false, + ); + + $methodList = array(); + foreach( $methods as $method=>$openByDefault ) + { + $methodList[] = array('name'=>$method,'open'=>$openByDefault); + } + $this->setTemplateVar('methodList', $methodList); + + // HTML-Datei direkt einbinden. $vars = $this->getOutputData(); $output = $vars['output']; // will be extracted in the included template file. $notices = $vars['notices']; // will be extracted in the included template file. diff --git a/modules/cms-ui/themes/default/layout/index.php b/modules/cms-ui/themes/default/layout/index.php @@ -3,7 +3,7 @@ if (!defined('OR_VERSION')) die('Forbidden'); if (!headers_sent()) header('Content-Type: text/html; charset=UTF-8') ?><!DOCTYPE html> -<html class="theme-<?php echo strtolower($style) ?> nojs"> +<html class="theme-<?php echo strtolower($style) ?> nojs" lang="<?php echo Conf()->subset('language')->get('language_code') ?>"> <head> <?php $appName = config('application','name'); $appOperator = config('application','operator'); $title = $appName.(($appOperator!=$appName)?' - '.$appOperator:''); ?> @@ -14,12 +14,6 @@ <meta http-equiv="refresh" content="<?php echo isset($refresh_timeout)?$refresh_timeout:0 ?>; URL=<?php echo $refresh_url; if (ini_get('session.use_trans_sid')) echo '&'.session_name().'='.session_id(); ?>"> <?php } ?> <meta name="robots" content="noindex,nofollow" > -<?php if (isset($metaList) && is_array($metaList)) foreach( $metaList as $meta ) - { - ?> - <link rel="<?php echo $meta['name'] ?>" href="<?php echo $meta['url'] ?>" title="<?php echo $meta['title'] ?>" ><?php - } ?> - <?php foreach( $jsFiles as $jsFile ) { ?> <script src="<?php echo $jsFile ?>" defer></script> <?php } ?> <link rel="stylesheet" type="text/css" href="<?php echo OR_HTML_MODULES_DIR . 'editor/codemirror/lib/codemirror.css' ?>" /> @@ -52,25 +46,29 @@ </nav> - <main> + <main id="editor"> <header> <span class="title"></span> </header> - <div id="editor" class="view view-loader" data-action="<?php echo $action ?>" data-method="edit" data-id="<?php echo $id ?>"> - <?php embedView($action,'edit'); ?> - </div> - </main> + <?php foreach( $methodList as $method ) { ?> + <section class="toggle-open-close <?php echo $method ['open']?'open':'closed' ?>"> - <aside> - <header> - <a href=""></a> - </header> - <div id="info" class="view view-loader" data-method="info" data-id="<?php echo $id ?>"> - <?php embedView($action,'info'); ?> - </div> + <header class="on-click-open-close"> + <div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div> + <img src="/themes/default/images/icon/method/<?php echo $method['name'] ?>.svg" /> + <h1><?php echo lang('METHOD_'.$method['name'] ) ?></h1> + </header> + + + <div class="view view-loader data-action="<?php echo $action ?>" data-method="<?php echo $method['name'] ?>" data-id="<?php echo $id ?>"> + <?php embedView($action,$method['name']); ?> + </div> + </section> + <?php } ?> + + </main> - </aside> </div> </div> @@ -92,8 +90,8 @@ <div id="noticebar"> - <?php /* Inline Notices */if(is_array($notices)) foreach( $notices as $notice ) { ?> - <div class="notice <?php echo $notice['status'] ?>"><div class="text"><?php echo $notice['text'] ?></div></div>' + <?php /* Inline Notices */ foreach( $notices as $notice ) { ?> + <div class="notice <?php echo $notice['status'] ?>"><div class="text"><?php echo $notice['text'] ?></div></div> <?php } ?> </div> diff --git a/modules/cms-ui/themes/default/script/openrat.js b/modules/cms-ui/themes/default/script/openrat.js @@ -54,6 +54,8 @@ $( function() $(this).fadeOut('fast',function() { $(this).remove(); } ); } ); + registerOpenClose( $('section.toggle-open-close') ); + }); function initActualHistoryState() { @@ -345,7 +347,7 @@ function registerViewEvents( viewEl ) // Bei Ă„nderungen in der View das Tab als 'dirty' markieren $(viewEl).find('input').change( function() { - $('#editor').find('header').addClass('dirty'); + $(this).parent('div.view').addClass('dirty'); }); } @@ -771,4 +773,15 @@ function notify( type,msg ) $(this).fadeOut('fast',function() { $(this).remove(); } ); } ); +} + + + + +function registerOpenClose( $el ) +{ + $($el).children('.on-click-open-close').click( function() { + $(this).closest('.toggle-open-close').toggleClass('open closed'); + }); + } \ No newline at end of file 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');registerHeaderEvents();registerWorkbenchEvents();$('.view').each(function(t){registerViewEvents(this)});window.onpopstate=function(t){Navigator.navigateTo(t.state)};initActualHistoryState();Workbench.initialize();$('#noticebar .notice').click(function(){$(this).fadeOut('fast',function(){$(this).remove()})});loadTree();$(document).keyup(function(t){if(t.keyCode==27){$('#dialog .view').fadeOut('fast').html('');$('#dialog').removeClass('is-open').addClass('is-closed')}});$('#noticebar .notice').fadeIn().click(function(){$(this).fadeOut('fast',function(){$(this).remove()})})});function initActualHistoryState(){var t={};t.name=window.document.title;var e=new URLSearchParams(window.location.search);if(e.has('action')){t.action=e.get('action');t.id=e.get('id');t.name=window.document.title;t.data={};var e=Array.from(e.entries());for(var i in e){t.data[e[i][0]]=e[i][1]};Navigator.toActualHistory(t);filterMenus(t.action,t.id,t.data)}};var Navigator=new function(){'use strict';this.navigateTo=function(t){Workbench.loadNewActionState(t)};this.navigateToNew=function(t){Workbench.loadNewActionState(t);window.history.pushState(t,t.name,createUrl(t.action,null,t.id,t.data,!1))};this.navigateToNewAction=function(t,e,i,a){var n={action:t,method:e,id:i,data:a};this.navigateToNew(n)};this.toActualHistory=function(t){window.history.replaceState(t,t.name,createUrl(t.action,null,t.id,t.data,!1))}},Workbench=new function(){'use strict';this.initialize=function(){this.initializePingTimer()};this.initializePingTimer=function(){var t=function(){$.ajax(createUrl('title','ping',0))},e=5;window.setInterval(t,e*60*1000)};this.loadNewActionState=function(t){Workbench.loadNewAction(t.action,t.id,t.data)};this.loadNewAction=function(t,e,i){$('#editor').attr('data-action',t);$('#editor').attr('data-id',e);$('#workbench .view-loader').each(function(a){var n=$(this),o=n.data('method');Workbench.loadViewIntoElement(n,t,o,e,i)});filterMenus(t,e,i)};this.loadViewIntoElement=function(t,e,i,a,n){var o=createUrl(e,i,a,n,!0);t.empty().fadeTo(1,0.7).addClass('loader').html('').load(o,function(e,i,a){t.fadeTo(350,1);$(t).removeClass('loader');if(i=='error'){$(t).html('');notify('error',e);return};registerViewEvents(t)})}};function registerWorkbenchEvents(){$('div.header').dblclick(function(){fullscreen(this)});$('div#filler').click(function(){if($('div#dialog').hasClass('modal')){} -else{$('div#dialog').removeClass('is-open').addClass('is-closed');$('div#dialog > .view').html('')}})};function loadView(t,e,i,a,n){Navigator.navigateToNewAction(e,i,a,n)};function registerViewEvents(t){$(t).trigger('orViewLoaded');$(t).closest('div.panel').find('div.header div.dropdown div.entry.perview').remove();$(t).find('div.headermenu > a').each(function(t,e){});$(t).find('div.header > a.back').each(function(e,i){$(i).removeClass('button').wrap('<div class="entry perview" />').parent().appendTo($(t).closest('div.panel').find('div.header div.dropdown').first())});$(t).find('div.selector.tree').each(function(){var t=this;$(this).orTree({type:'project',selectable:$(t).attr('data-types').split(','),id:$(t).attr('data-init-folderid'),onSelect:function(e,i,a){var n=$(t).parent();$(n).find('input[type=text]').attr('value',e);$(n).find('input[type=hidden]').attr('value',a)}})});$('div.content li.object').draggable({cursor:'move',revert:'invalid'});$('div.content li.object > .entry[data-type=\'folder\']').droppable({accept:'li.object',hoverClass:'drophover',activeClass:'dropactive',drop:function(t,e){var i=e.draggable,a=$(this).parent();startDialog($(this).text(),$(i).attr('data-type'),'copy',$(a).attr('data-id'),{'action':$(i).attr('data-type'),'subaction':'copy','id':$(i).attr('data-id'),'targetFolderId':$(a).attr('data-id')});$(i).detach().css({top:0,left:0}).appendTo(a).click()}});$(t).find('input').change(function(){$('#editor').find('header').addClass('dirty')})};function registerHeaderEvents(){$('body').click(function(){$('.toolbar-icon.menu').parent().removeClass('open')});$('#title .toolbar-icon.menu').click(function(t){t.stopPropagation();$(this).parent().toggleClass('open')});$('#title .toolbar-icon.menu').mouseover(function(){$(this).parent().find('.toolbar-icon.menu').removeClass('open');$(this).addClass('open')});$('#title div.search input').blur(function(){$('div.search input div.dropdown').fadeOut()});$('#title div.search input').orSearch({dropdown:'#title div.search div.dropdown'})};function fullscreen(t){$(t).closest('div.panel').fadeOut('fast',function(){$(this).toggleClass('fullscreen').fadeIn('fast')})};function loadTree(){$('#navigation').html('&nbsp;');$('#navigation').orTree({type:'root',id:0,onSelect:function(t,e,i,a){openNewAction(t,e,i,a)}});$('#navigation > div.sheet.action-tree.method-tree > ul.tree > div.tree').delay(500).click();$('#navigation > div.sheet.action-tree.method-tree > ul.tree > div.tree').delay(500).click()};function submitUrl(t,e){postUrl(e,t)};function postUrl(t,e){t+='&output=json';$.ajax({'type':'POST',url:t,data:{},success:function(t,i,a){$('div.panel div.status div.loader').html('&nbsp;');doResponse(t,i,e)}})};function startDialog(t,e,i,a,n){if(!e)e=$('#editor').attr('data-action');a=$('#editor').attr('data-id');$('div#dialog > .view').html('<div class="header"><img class="icon" title="" src="./themes/default/images/icon/'+i+'.png" />'+t+'</div>');$('div#dialog > .view').data('id',a);$('div#dialog').removeClass('is-closed').addClass('is-open');Workbench.loadViewIntoElement($('div#dialog > .view'),e,i,a,n)};function modalView(t,e){var i=$(t).closest('div.panel').find('li.active').attr('data-action'),a=$(t).closest('div.panel').find('li.active').attr('data-method'),n=$(t).closest('div.panel').find('li.active').attr('data-id');$(t).closest('div.content').modal({'overlayClose':'true','xxxonClose':function(){alert('close)')}});loadView($(t).closest('div.content'),i,a,n)};function setTitle(t){if(t)$('head > title').text(t+' - '+$('head > title').data('default'));else $('head > title').text($('head > title').data('default'))};function openNewAction(t,e,i,a){setTitle(t);setNewAction(e,i,a)};function filterMenus(t,e,i){$('div.clickable').addClass('active');$('div.clickable.filtered').removeClass('active').addClass('inactive');$('div.clickable.filtered.on-action-'+t).addClass('active').removeClass('inactive');$('div.clickable.filtered a').attr('data-action',t);$('div.clickable.filtered a').attr('data-id',e);$('div.clickable.filtered a').attr('data-extra',JSON.stringify(i))};function setNewAction(t,e,i){Navigator.navigateToNewAction(t,'edit',e,i)};function setNewId(t){};function notifyBrowser(t){if(!('Notification' in window)){return} -else if(Notification.permission==='granted'){var e=new Notification(t)} -else if(Notification.permission!=='denied'){Notification.requestPermission(function(e){if(e==='granted'){var i=new Notification(t)}})}};function setUserStyle(t){var e=$('html'),i=e.attr('class').split(/\s+/);$.each(i,function(t,i){if(i.startsWith('theme-')){e.removeClass(i)}});e.addClass('theme-'+t.toLowerCase())};function insert(t,e,i){var a=document.forms[0].elements[t];a.focus();if(typeof document.selection!='undefined'){var r=document.selection.createRange(),n=r.text;r.text=e+n+i;r=document.selection.createRange();if(n.length==0){r.move('character',-i.length)} -else{r.moveStart('character',e.length+n.length+i.length)};r.select()} -else if(typeof a.selectionStart!='undefined'){var d=a.selectionStart,c=a.selectionEnd,n=a.value.substring(d,c);a.value=a.value.substr(0,d)+e+n+i+a.value.substr(c);var o;if(n.length==0){o=d+e.length} -else{o=d+e.length+n.length+i.length};a.selectionStart=o;a.selectionEnd=o} -else{o=a.value.length;var n=prompt('Text');a.value=a.value.substr(0,o)+e+n+i+a.value.substr(o)}};function createUrl(t,e,i,a,o){var n='./';n+='?action='+t;if(e!=null)n+='&subaction='+e;n+='&id='+i;if(o)n+='&embed=1';if(typeof a==='string'){a=a.replace(/'/g,'"');jQuery.each(jQuery.parseJSON(a),function(t,e){if(t=='action'||t=='subaction'||t=='id')return;n=n+'&'+t+'='+e})} -else if(typeof a==='object'){jQuery.each(a,function(t,e){if(t=='action'||t=='subaction'||t=='id')return;n=n+'&'+t+'='+e})} -else{};return n};function resizeWorkbenchContainer(t){};function resizeWorkbench(){};function resizeTabs(t){};function help(t,e,i){var a=$(t).closest('div.panel').find('li.action.active').attr('data-action'),n=$(t).closest('div.panel').find('li.action.active').attr('data-method');window.open(e+a+'/'+n+i,'OpenRat_Help','location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes')};function notify(t,e){var i=$('<div class="notice '+t+'"><div class="text">'+e+'</div></div>');$('#noticebar').prepend(i);$(i).fadeIn().click(function(){$(this).fadeOut('fast',function(){$(this).remove()})})};- \ No newline at end of file +;var DEFAULT_CONTENT_ACTION='edit',OR_THEMES_EXT_DIR='modules/cms-ui/themes/';$(function(){$('html').removeClass('nojs');$('.initial-hidden').removeClass('initial-hidden');registerHeaderEvents();registerWorkbenchEvents();$('.view').each(function(e){registerViewEvents(this)});window.onpopstate=function(e){Navigator.navigateTo(e.state)};initActualHistoryState();Workbench.initialize();$('#noticebar .notice').click(function(){$(this).fadeOut('fast',function(){$(this).remove()})});loadTree();$(document).keyup(function(e){if(e.keyCode==27){$('#dialog .view').fadeOut('fast').html('');$('#dialog').removeClass('is-open').addClass('is-closed')}});$('#noticebar .notice').fadeIn().click(function(){$(this).fadeOut('fast',function(){$(this).remove()})});registerOpenClose($('section.toggle-open-close'))});function initActualHistoryState(){var e={};e.name=window.document.title;var t=new URLSearchParams(window.location.search);if(t.has('action')){e.action=t.get('action');e.id=t.get('id');e.name=window.document.title;e.data={};var t=Array.from(t.entries());for(var i in t){e.data[t[i][0]]=t[i][1]};Navigator.toActualHistory(e);filterMenus(e.action,e.id,e.data)}};var Navigator=new function(){'use strict';this.navigateTo=function(e){Workbench.loadNewActionState(e)};this.navigateToNew=function(e){Workbench.loadNewActionState(e);window.history.pushState(e,e.name,createUrl(e.action,null,e.id,e.data,!1))};this.navigateToNewAction=function(e,t,i,a){var n={action:e,method:t,id:i,data:a};this.navigateToNew(n)};this.toActualHistory=function(e){window.history.replaceState(e,e.name,createUrl(e.action,null,e.id,e.data,!1))}},Workbench=new function(){'use strict';this.initialize=function(){this.initializePingTimer()};this.initializePingTimer=function(){var e=function(){$.ajax(createUrl('title','ping',0))},t=5;window.setInterval(e,t*60*1000)};this.loadNewActionState=function(e){Workbench.loadNewAction(e.action,e.id,e.data)};this.loadNewAction=function(e,t,i){$('#editor').attr('data-action',e);$('#editor').attr('data-id',t);$('#workbench .view-loader').each(function(a){var n=$(this),o=n.data('method');Workbench.loadViewIntoElement(n,e,o,t,i)});filterMenus(e,t,i)};this.loadViewIntoElement=function(e,t,i,a,n){var o=createUrl(t,i,a,n,!0);e.empty().fadeTo(1,0.7).addClass('loader').html('').load(o,function(t,i,a){e.fadeTo(350,1);$(e).removeClass('loader');if(i=='error'){$(e).html('');notify('error',t);return};registerViewEvents(e)})}};function registerWorkbenchEvents(){$('div.header').dblclick(function(){fullscreen(this)});$('div#filler').click(function(){if($('div#dialog').hasClass('modal')){} +else{$('div#dialog').removeClass('is-open').addClass('is-closed');$('div#dialog > .view').html('')}})};function loadView(e,t,i,a,n){Navigator.navigateToNewAction(t,i,a,n)};function registerViewEvents(e){$(e).trigger('orViewLoaded');$(e).closest('div.panel').find('div.header div.dropdown div.entry.perview').remove();$(e).find('div.headermenu > a').each(function(e,t){});$(e).find('div.header > a.back').each(function(t,i){$(i).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(t,i,a){var n=$(e).parent();$(n).find('input[type=text]').attr('value',t);$(n).find('input[type=hidden]').attr('value',a)}})});$('div.content li.object').draggable({cursor:'move',revert:'invalid'});$('div.content li.object > .entry[data-type=\'folder\']').droppable({accept:'li.object',hoverClass:'drophover',activeClass:'dropactive',drop:function(e,t){var i=t.draggable,a=$(this).parent();startDialog($(this).text(),$(i).attr('data-type'),'copy',$(a).attr('data-id'),{'action':$(i).attr('data-type'),'subaction':'copy','id':$(i).attr('data-id'),'targetFolderId':$(a).attr('data-id')});$(i).detach().css({top:0,left:0}).appendTo(a).click()}});$(e).find('input').change(function(){$(this).parent('div.view').addClass('dirty')})};function registerHeaderEvents(){$('body').click(function(){$('.toolbar-icon.menu').parent().removeClass('open')});$('#title .toolbar-icon.menu').click(function(e){e.stopPropagation();$(this).parent().toggleClass('open')});$('#title .toolbar-icon.menu').mouseover(function(){$(this).parent().find('.toolbar-icon.menu').removeClass('open');$(this).addClass('open')});$('#title div.search input').blur(function(){$('div.search input div.dropdown').fadeOut()});$('#title div.search input').orSearch({dropdown:'#title div.search div.dropdown'})};function fullscreen(e){$(e).closest('div.panel').fadeOut('fast',function(){$(this).toggleClass('fullscreen').fadeIn('fast')})};function loadTree(){$('#navigation').html('&nbsp;');$('#navigation').orTree({type:'root',id:0,onSelect:function(e,t,i,a){openNewAction(e,t,i,a)}});$('#navigation > div.sheet.action-tree.method-tree > ul.tree > div.tree').delay(500).click();$('#navigation > div.sheet.action-tree.method-tree > ul.tree > div.tree').delay(500).click()};function submitUrl(e,t){postUrl(t,e)};function postUrl(e,t){e+='&output=json';$.ajax({'type':'POST',url:e,data:{},success:function(e,i,a){$('div.panel div.status div.loader').html('&nbsp;');doResponse(e,i,t)}})};function startDialog(e,t,i,a,n){if(!t)t=$('#editor').attr('data-action');a=$('#editor').attr('data-id');$('div#dialog > .view').html('<div class="header"><img class="icon" title="" src="./themes/default/images/icon/'+i+'.png" />'+e+'</div>');$('div#dialog > .view').data('id',a);$('div#dialog').removeClass('is-closed').addClass('is-open');Workbench.loadViewIntoElement($('div#dialog > .view'),t,i,a,n)};function modalView(e,t){var i=$(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'),i,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,t,i,a){setTitle(e);setNewAction(t,i,a)};function filterMenus(e,t,i){$('div.clickable').addClass('active');$('div.clickable.filtered').removeClass('active').addClass('inactive');$('div.clickable.filtered.on-action-'+e).addClass('active').removeClass('inactive');$('div.clickable.filtered a').attr('data-action',e);$('div.clickable.filtered a').attr('data-id',t);$('div.clickable.filtered a').attr('data-extra',JSON.stringify(i))};function setNewAction(e,t,i){Navigator.navigateToNewAction(e,'edit',t,i)};function setNewId(e){};function notifyBrowser(e){if(!('Notification' in window)){return} +else if(Notification.permission==='granted'){var t=new Notification(e)} +else if(Notification.permission!=='denied'){Notification.requestPermission(function(t){if(t==='granted'){var i=new Notification(e)}})}};function setUserStyle(e){var t=$('html'),i=t.attr('class').split(/\s+/);$.each(i,function(e,i){if(i.startsWith('theme-')){t.removeClass(i)}});t.addClass('theme-'+e.toLowerCase())};function insert(e,t,i){var a=document.forms[0].elements[e];a.focus();if(typeof document.selection!='undefined'){var r=document.selection.createRange(),n=r.text;r.text=t+n+i;r=document.selection.createRange();if(n.length==0){r.move('character',-i.length)} +else{r.moveStart('character',t.length+n.length+i.length)};r.select()} +else if(typeof a.selectionStart!='undefined'){var c=a.selectionStart,s=a.selectionEnd,n=a.value.substring(c,s);a.value=a.value.substr(0,c)+t+n+i+a.value.substr(s);var o;if(n.length==0){o=c+t.length} +else{o=c+t.length+n.length+i.length};a.selectionStart=o;a.selectionEnd=o} +else{o=a.value.length;var n=prompt('Text');a.value=a.value.substr(0,o)+t+n+i+a.value.substr(o)}};function createUrl(e,t,i,a,o){var n='./';n+='?action='+e;if(t!=null)n+='&subaction='+t;n+='&id='+i;if(o)n+='&embed=1';if(typeof a==='string'){a=a.replace(/'/g,'"');jQuery.each(jQuery.parseJSON(a),function(e,t){if(e=='action'||e=='subaction'||e=='id')return;n=n+'&'+e+'='+t})} +else if(typeof a==='object'){jQuery.each(a,function(e,t){if(e=='action'||e=='subaction'||e=='id')return;n=n+'&'+e+'='+t})} +else{};return n};function resizeWorkbenchContainer(e){};function resizeWorkbench(){};function resizeTabs(e){};function help(e,t,i){var a=$(e).closest('div.panel').find('li.action.active').attr('data-action'),n=$(e).closest('div.panel').find('li.action.active').attr('data-method');window.open(t+a+'/'+n+i,'OpenRat_Help','location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes')};function notify(e,t){var i=$('<div class="notice '+e+'"><div class="text">'+t+'</div></div>');$('#noticebar').prepend(i);$(i).fadeIn().click(function(){$(this).fadeOut('fast',function(){$(this).remove()})})};function registerOpenClose(e){$(e).children('.on-click-open-close').click(function(){$(this).closest('.toggle-open-close').toggleClass('open closed')})};+ \ No newline at end of file diff --git a/modules/template-engine/components/html/group/Group.class.php b/modules/template-engine/components/html/group/Group.class.php @@ -13,14 +13,14 @@ class GroupComponent extends Component public function begin() { echo '<fieldset'; - echo ' class="'; + echo ' class="toggle-open-close'; echo '<?php echo '.$this->value($this->open).'?" open":" closed" ?>'; echo '<?php echo '.$this->value($this->show).'?" show":"" ?>'; echo '">'; if ( !empty($this->title)) { - echo '<legend>'; + echo '<legend class="on-click-open-close">'; if ( !empty($this->icon)) echo '<img src="/themes/default/images/icon/method/'.$this->htmlvalue($this->icon).'.svg" />'; diff --git a/modules/template-engine/components/html/group/group.css b/modules/template-engine/components/html/group/group.css @@ -8,34 +8,5 @@ fieldset { margin-left: 0px; margin-right: 0px; padding: 10px; - display: none; - /* Geschlossene Fieldsets */ - /* Offene Fieldsets */ } -fieldset > legend { - cursor: pointer; - margin-left: 30px; - font-weight: normal; -} -fieldset.show { - display: block; -} -fieldset.closed > legend > div.arrow.on-closed { - display: inline; -} -fieldset.closed > legend > div.arrow.on-open { - display: none; -} -fieldset.closed > div { - display: none; -} -fieldset.open > div { - display: block; -} -fieldset.open > legend > div.arrow.on-closed { - display: none; -} -fieldset.open > legend > div.arrow.on-open { - display: inline; -} -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22group.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AAAA%3BCAEC%2CiBAAA%3BCAEA%3BCACA%3BCACA%3BCAEA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3B%3B%3BAAbD%2CQAeG%3BCAED%3BCACA%3BCACA%3B%3BAAGD%2CQAAC%3BCACA%3B%3BAAID%2CQAAC%2COACE%2CSAAS%2CMAAG%2CMAAM%3BCACnB%3B%3BAAFF%2CQAAC%2COAIE%2CSAAS%2CMAAG%2CMAAM%3BCACnB%3B%3BAALF%2CQAAC%2COAOE%3BCAED%3B%3BAAKF%2CQAAC%2CKACE%3BCAED%3B%3BAAHF%2CQAAC%2CKAKE%2CSAAS%2CMAAG%2CMAAM%3BCAEnB%3B%3BAAPF%2CQAAC%2CKASE%2CSAAS%2CMAAG%2CMAAM%3BCAEnB%22%7D */- \ No newline at end of file +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22group.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AAAA%3BCAEC%2CiBAAA%3BCAEA%3BCACA%3BCACA%3BCAEA%3BCACA%3BCACA%3BCACA%3BCACA%22%7D */+ \ No newline at end of file diff --git a/modules/template-engine/components/html/group/group.js b/modules/template-engine/components/html/group/group.js @@ -1,6 +1,4 @@ $(document).on('orViewLoaded',function(event, data) { - $(event.target).find('fieldset > legend').click( function() { - $(this).parent().toggleClass('open closed'); - }); -});- \ No newline at end of file + registerOpenClose( $(event.target).find('fieldset.toggle-open-close') ); +}); diff --git a/modules/template-engine/components/html/group/group.less b/modules/template-engine/components/html/group/group.less @@ -11,48 +11,7 @@ fieldset margin-left:0px; margin-right:0px; padding:10px; - display: none; - > legend - { - cursor:pointer; - margin-left:30px; - font-weight:normal; - } - - &.show { - display: block; - } - - /* Geschlossene Fieldsets */ - &.closed { - > legend > div.arrow.on-closed { - display: inline; - } - > legend > div.arrow.on-open { - display: none; - } - > div - { - display:none; - } - } - - /* Offene Fieldsets */ - &.open { - > div - { - display:block; - } - > legend > div.arrow.on-closed - { - display:none; - } - > legend > div.arrow.on-open - { - display:inline; - } - } } diff --git a/modules/template-engine/components/html/group/group.min.css b/modules/template-engine/components/html/group/group.min.css @@ -1 +1 @@ -fieldset{border: 1px solid;border-bottom: 0px;border-left: 0px;border-right: 0px;margin-top: 20px;margin-bottom: 20px;margin-left: 0px;margin-right: 0px;padding: 10px;display: none}fieldset > legend{cursor: pointer;margin-left: 30px;font-weight: normal}fieldset.show{display: block}fieldset.closed > legend > div.arrow.on-closed{display: inline}fieldset.closed > legend > div.arrow.on-open{display: none}fieldset.closed > div{display: none}fieldset.open > div{display: block}fieldset.open > legend > div.arrow.on-closed{display: none}fieldset.open > legend > div.arrow.on-open{display: inline}- \ No newline at end of file +fieldset{border: 1px solid;border-bottom: 0px;border-left: 0px;border-right: 0px;margin-top: 20px;margin-bottom: 20px;margin-left: 0px;margin-right: 0px;padding: 10px}+ \ No newline at end of file diff --git a/modules/template-engine/components/html/group/group.min.js b/modules/template-engine/components/html/group/group.min.js @@ -1 +1 @@ -;$(document).on('orViewLoaded',function(e,n){$(e.target).find('fieldset > legend').click(function(){$(this).parent().toggleClass('open closed')})});- \ No newline at end of file +;$(document).on('orViewLoaded',function(e,o){registerOpenClose($(e.target).find('fieldset.toggle-open-close'))});+ \ No newline at end of file