openrat-cms

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

commit fe63a49159a92008b159750453f833fdd41f4252
parent ef5abe8d10192170b2b70d383a06336ae26e535b
Author: dankert <openrat@jandankert.de>
Date:   Sun,  6 Feb 2022 22:06:09 +0100

Refactoring: Ommit unnecessary parameters.

Diffstat:
Mmodules/cms/ui/themes/default/script/openrat/view.js | 9++-------
Mmodules/cms/ui/themes/default/script/openrat/view.min.js | 5++---
Mmodules/cms/ui/themes/default/script/openrat/workbench.js | 16++++++++--------
Mmodules/cms/ui/themes/default/script/openrat/workbench.min.js | 16++++++++--------
Mmodules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.js | 2+-
Mmodules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js | 2+-
6 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/modules/cms/ui/themes/default/script/openrat/view.js b/modules/cms/ui/themes/default/script/openrat/view.js @@ -66,7 +66,7 @@ export default class View { */ async loadView() { - let url = View.createUrl( this.action,this.method,this.id,this.params,false); // URL für das Laden erzeugen. + let url = View.createUrl(this.action, this.method, this.id, this.params); // URL für das Laden erzeugen. let element = this.element; let view = this; @@ -150,11 +150,9 @@ export default class View { * @param subaction * @param id * @param extraid - * @param api * @returns string */ - static createUrl(action,subaction,id,extraid={},api=false ) - { + static createUrl(action, subaction, id= 0, extraid = {}) { let url = './?'; if(action) @@ -180,9 +178,6 @@ export default class View { else throw "Illegal argument"; - //if ( api ) - // url += '&output=json'; - return url; } diff --git a/modules/cms/ui/themes/default/script/openrat/view.min.js b/modules/cms/ui/themes/default/script/openrat/view.min.js @@ -29,7 +29,7 @@ fireViewLoadedEvents(element) { Callback.afterViewLoadedHandler.fire( element ); } async loadView() { -let url = View.createUrl( this.action,this.method,this.id,this.params,false); +let url = View.createUrl(this.action, this.method, this.id, this.params); let element = this.element; let view = this; console.debug( view ); @@ -82,8 +82,7 @@ notice.show(); finally { } } -static createUrl(action,subaction,id,extraid={},api=false ) -{ +static createUrl(action, subaction, id= 0, extraid = {}) { let url = './?'; if(action) url += '&action='+action; diff --git a/modules/cms/ui/themes/default/script/openrat/workbench.js b/modules/cms/ui/themes/default/script/openrat/workbench.js @@ -191,7 +191,7 @@ export default class Workbench { * "Geben Sie mir ein Ping, Vasily. Und bitte nur ein einziges Ping!" (aus: Jagd auf Roter Oktober) */ let ping = async () => { - let url = View.createUrl('profile','ping',0, {}, true); + let url = View.createUrl('profile', 'ping' ); console.debug('ping'); try { @@ -312,7 +312,7 @@ export default class Workbench { async loadUserStyle() { - let url = View.createUrl('profile', 'userinfo', 0, {}, true); + let url = View.createUrl('profile', 'userinfo' ); let response = await fetch(url,{ method: 'GET', @@ -336,7 +336,7 @@ export default class Workbench { async loadLanguage() { - let url = View.createUrl('profile', 'language', 0, {}, true); + let url = View.createUrl('profile', 'language'); let response = await fetch(url,{ method: 'GET', @@ -355,7 +355,7 @@ export default class Workbench { */ async loadUISettings() { - let url = View.createUrl('profile', 'uisettings', 0, {}, true); + let url = View.createUrl('profile', 'uisettings' ); let response = await fetch(url,{ method: 'GET', @@ -427,7 +427,7 @@ export default class Workbench { if ( window.localStorage ) window.localStorage.setItem('style',styleName); - let styleUrl = View.createUrl('index','themestyle',0,{'style':styleName} ); + let styleUrl = View.createUrl('index', 'themestyle', 0, {'style': styleName}); document.getElementById('user-style').setAttribute('href',styleUrl); } @@ -606,7 +606,7 @@ export default class Workbench { // Jeder Menüeintrag bekommt die Id und Parameter. $('.or-workbench-title .or-filtered .or-link').attr('data-id', id); - let url = View.createUrl('profile', 'available', id, {'queryaction': action}, true); + let url = View.createUrl('profile', 'available', id, {'queryaction': action}); // Die Inhalte des Zweiges laden. let response = await fetch(url, { @@ -744,7 +744,7 @@ export default class Workbench { Callback.afterNewActionHandler.add( function() { - let url = View.createUrl('tree','path',Workbench.state.id, {'type':Workbench.state.action} ); + let url = View.createUrl('tree', 'path', Workbench.state.id, {'type': Workbench.state.action}); // Die Inhalte des Zweiges laden. let loadPromise = fetch( url,{ @@ -836,7 +836,7 @@ export default class Workbench { $element.find('.or-act-load-nav-tree').each( async function() { let type = $(this).data('type') || 'root'; - let loadBranchUrl = View.createUrl('tree','branch',0,{type:type}); + let loadBranchUrl = View.createUrl('tree', 'branch', 0, {type: type}); let $targetElement = $(this); let response = await fetch( loadBranchUrl,{ diff --git a/modules/cms/ui/themes/default/script/openrat/workbench.min.js b/modules/cms/ui/themes/default/script/openrat/workbench.min.js @@ -100,7 +100,7 @@ notice.show(); } initializePingTimer() { let ping = async () => { -let url = View.createUrl('profile','ping',0, {}, true); +let url = View.createUrl('profile', 'ping' ); console.debug('ping'); try { let response = await fetch( url,{ @@ -169,7 +169,7 @@ all.then( return all; } async loadUserStyle() { -let url = View.createUrl('profile', 'userinfo', 0, {}, true); +let url = View.createUrl('profile', 'userinfo' ); let response = await fetch(url,{ method: 'GET', headers: { @@ -185,7 +185,7 @@ this.setThemeColor(color); static settings = {}; static language = {}; async loadLanguage() { -let url = View.createUrl('profile', 'language', 0, {}, true); +let url = View.createUrl('profile', 'language'); let response = await fetch(url,{ method: 'GET', headers: { @@ -197,7 +197,7 @@ let data = await response.json(); Workbench.language = data.output.language; } async loadUISettings() { -let url = View.createUrl('profile', 'uisettings', 0, {}, true); +let url = View.createUrl('profile', 'uisettings' ); let response = await fetch(url,{ method: 'GET', headers: { @@ -235,7 +235,7 @@ setUserStyle( styleName ) { if ( window.localStorage ) window.localStorage.setItem('style',styleName); -let styleUrl = View.createUrl('index','themestyle',0,{'style':styleName} ); +let styleUrl = View.createUrl('index', 'themestyle', 0, {'style': styleName}); document.getElementById('user-style').setAttribute('href',styleUrl); } setThemeColor( color ) @@ -328,7 +328,7 @@ let id = Workbench.state.id; $('.or-workbench-title .or-dropdown-entry.or-act-clickable').addClass('dropdown-entry--active'); $('.or-workbench-title .or-filtered').removeClass('dropdown-entry--active').addClass('dropdown-entry--inactive'); $('.or-workbench-title .or-filtered .or-link').attr('data-id', id); -let url = View.createUrl('profile', 'available', id, {'queryaction': action}, true); +let url = View.createUrl('profile', 'available', id, {'queryaction': action}); let response = await fetch(url, { method: 'GET', headers: { @@ -414,7 +414,7 @@ $('.or-sidebar').find('.or-sidebar-button').orLinkify(); } ); Callback.afterNewActionHandler.add( function() { -let url = View.createUrl('tree','path',Workbench.state.id, {'type':Workbench.state.action} ); +let url = View.createUrl('tree', 'path', Workbench.state.id, {'type': Workbench.state.action}); let loadPromise = fetch( url,{ method: 'GET', headers: { @@ -470,7 +470,7 @@ $(this).parent().children('input').toggleAttr('type','text','password'); Callback.afterViewLoadedHandler.add( function($element) { $element.find('.or-act-load-nav-tree').each( async function() { let type = $(this).data('type') || 'root'; -let loadBranchUrl = View.createUrl('tree','branch',0,{type:type}); +let loadBranchUrl = View.createUrl('tree', 'branch', 0, {type: type}); let $targetElement = $(this); let response = await fetch( loadBranchUrl,{ method: 'GET', diff --git a/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.js b/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.js @@ -91,7 +91,7 @@ export default function( options ) window.open( $link.attr('data-url'),' _blank' ); break; case 'window': - window.location.href = View.createUrl($link.attr('data-action'),$link.attr('data-method'),$link.attr('data-id')); + window.location.href = View.createUrl($link.attr('data-action'), $link.attr('data-method'), $link.attr('data-id')); break; case 'popup': diff --git a/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js b/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js @@ -59,7 +59,7 @@ case 'external': window.open( $link.attr('data-url'),' _blank' ); break; case 'window': -window.location.href = View.createUrl($link.attr('data-action'),$link.attr('data-method'),$link.attr('data-id')); +window.location.href = View.createUrl($link.attr('data-action'), $link.attr('data-method'), $link.attr('data-id')); break; case 'popup': Workbench.popupWindow = window.open( $link.attr('data-url'), 'Popup', 'location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes');