Skip to content
Code-Schnipsel Gruppen Projekte
Commit 89c4c07d erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

refactor: Code style

Übergeordneter b954e64c
No related branches found
No related tags found
2 Merge Requests!13Dev,!12Feat#19
...@@ -18,16 +18,17 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -18,16 +18,17 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
'text!package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings.html', 'text!package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings.html',
'css!package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings.css' 'css!package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings.css'
], function (QUI, ], function (
QUIControl, QUI,
QUIConfirm, QUIControl,
QUIButton, QUIConfirm,
QUISwitch, QUIButton,
QUILocale, QUISwitch,
Mustache, QUILocale,
Grid, Mustache,
ControlsUtils, Grid,
templateEntry ControlsUtils,
templateEntry
) { ) {
"use strict"; "use strict";
...@@ -36,7 +37,7 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -36,7 +37,7 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
return new Class({ return new Class({
Extends: QUIControl, Extends: QUIControl,
Type: 'package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', Type : 'package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings',
Binds: [ Binds: [
'$onImport', '$onImport',
...@@ -51,7 +52,7 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -51,7 +52,7 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
this.parent(options); this.parent(options);
this.$Input = null; this.$Input = null;
this.$Grid = null; this.$Grid = null;
this.$data = []; this.$data = [];
...@@ -68,14 +69,14 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -68,14 +69,14 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
this.$Elm = new Element('div', { this.$Elm = new Element('div', {
'class': 'quiqqer-menu-navTabsVertival-settings', 'class': 'quiqqer-menu-navTabsVertival-settings',
styles: { styles : {
clear: 'both', clear : 'both',
'float': 'left', 'float' : 'left',
height: 400, height : 400,
overflow: 'hidden', overflow: 'hidden',
position: 'relative', position: 'relative',
margin: '10px 0 0 0', margin : '10px 0 0 0',
width: '100%' width : '100%'
} }
}).wraps(this.$Input); }).wraps(this.$Input);
...@@ -89,24 +90,24 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -89,24 +90,24 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
}).inject(this.$Elm); }).inject(this.$Elm);
this.$Grid = new Grid(Desktop, { this.$Grid = new Grid(Desktop, {
height: 400, height : 400,
width: size.x, width : size.x,
buttons: [ buttons : [
{ {
name: 'up', name : 'up',
icon: 'fa fa-angle-up', icon : 'fa fa-angle-up',
disabled: true, disabled: true,
events: { events : {
onClick: function () { onClick: function () {
this.$Grid.moveup(); this.$Grid.moveup();
this.$refreshSorting(); this.$refreshSorting();
}.bind(this) }.bind(this)
} }
}, { }, {
name: 'down', name : 'down',
icon: 'fa fa-angle-down', icon : 'fa fa-angle-down',
disabled: true, disabled: true,
events: { events : {
onClick: function () { onClick: function () {
this.$Grid.movedown(); this.$Grid.movedown();
this.$refreshSorting(); this.$refreshSorting();
...@@ -115,72 +116,72 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -115,72 +116,72 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
}, { }, {
type: 'separator' type: 'separator'
}, { }, {
name: 'add', name : 'add',
textimage: 'fa fa-plus', textimage: 'fa fa-plus',
text: QUILocale.get('quiqqer/quiqqer', 'add'), text : QUILocale.get('quiqqer/quiqqer', 'add'),
events: { events : {
onClick: this.$openAddDialog onClick: this.$openAddDialog
} }
}, { }, {
type: 'separator' type: 'separator'
}, { }, {
name: 'edit', name : 'edit',
textimage: 'fa fa-edit', textimage: 'fa fa-edit',
text: QUILocale.get('quiqqer/quiqqer', 'edit'), text : QUILocale.get('quiqqer/quiqqer', 'edit'),
disabled: true, disabled : true,
events: { events : {
onClick: this.$openEditDialog onClick: this.$openEditDialog
} }
}, { }, {
name: 'delete', name : 'delete',
textimage: 'fa fa-trash', textimage: 'fa fa-trash',
text: QUILocale.get('quiqqer/quiqqer', 'delete'), text : QUILocale.get('quiqqer/quiqqer', 'delete'),
disabled: true, disabled : true,
events: { events : {
onClick: this.$openDeleteDialog onClick: this.$openDeleteDialog
} }
} }
], ],
columnModel: [ columnModel: [
{ {
header: QUILocale.get(lg, 'control.navTabsVertical.entries.isDisable'), header : QUILocale.get(lg, 'control.navTabsVertical.entries.isDisable'),
dataIndex: 'isDisabledDisplay', dataIndex: 'isDisabledDisplay',
dataType: 'QUI', dataType : 'QUI',
width: 80 width : 80
}, { }, {
dataIndex: 'isDisabled', dataIndex: 'isDisabled',
hidden: true hidden : true
}, { }, {
header: QUILocale.get(lg, 'control.navTabsVertical.entries.entryTitleIcon'), header : QUILocale.get(lg, 'control.navTabsVertical.entries.entryTitleIcon'),
dataIndex: 'titleIconPreview', dataIndex: 'titleIconPreview',
dataType: 'node', dataType : 'node',
width: 120 width : 120
}, },
{ {
header: QUILocale.get(lg, 'control.navTabsVertical.entries.entryTitle'), header : QUILocale.get(lg, 'control.navTabsVertical.entries.entryTitle'),
dataIndex: 'entryTitle', dataIndex: 'entryTitle',
dataType: 'code', dataType : 'code',
width: 120 width : 120
}, },
{ {
header: QUILocale.get(lg, 'control.navTabsVertical.entries.entryImage'), header : QUILocale.get(lg, 'control.navTabsVertical.entries.entryImage'),
dataIndex: 'entryImagePreview', dataIndex: 'entryImagePreview',
dataType: 'node', dataType : 'node',
width: 60 width : 60
}, },
{ {
header: QUILocale.get(lg, 'control.navTabsVertical.entries.entryContent'), header : QUILocale.get(lg, 'control.navTabsVertical.entries.entryContent'),
dataIndex: 'entryContent', dataIndex: 'entryContent',
dataType: 'code', dataType : 'code',
width: 250 width : 250
}, },
{ {
dataIndex: 'newTab', dataIndex: 'newTab',
hidden: true hidden : true
}, { }, {
dataIndex: 'image', dataIndex: 'image',
dataType: 'string', dataType : 'string',
hidden: true hidden : true
} }
] ]
}); });
...@@ -189,19 +190,19 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -189,19 +190,19 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
onClick: function () { onClick: function () {
var buttons = this.$Grid.getButtons(), var buttons = this.$Grid.getButtons(),
Edit = buttons.filter(function (Btn) { Edit = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'edit'; return Btn.getAttribute('name') === 'edit';
})[0], })[0],
Up = buttons.filter(function (Btn) { Up = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'up'; return Btn.getAttribute('name') === 'up';
})[0], })[0],
Down = buttons.filter(function (Btn) { Down = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'down'; return Btn.getAttribute('name') === 'down';
})[0], })[0],
Delete = buttons.filter(function (Btn) { Delete = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'delete'; return Btn.getAttribute('name') === 'delete';
})[0]; })[0];
...@@ -269,11 +270,11 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -269,11 +270,11 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
var data = []; var data = [];
for (i = 0, len = this.$data.length; i < len; i++) { for (i = 0, len = this.$data.length; i < len; i++) {
entry = this.$data[i]; entry = this.$data[i];
insert = { insert = {
titleIcon: '', titleIcon : '',
entryImage: '', entryImage : '',
titleIconPreview: new Element('span', {html: '&nbsp;'}), titleIconPreview : new Element('span', {html: '&nbsp;'}),
entryImagePreview: new Element('span', {html: '&nbsp;'}) entryImagePreview: new Element('span', {html: '&nbsp;'})
}; };
...@@ -281,8 +282,8 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -281,8 +282,8 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
insert.isDisabledDisplay = new QUISwitch({ insert.isDisabledDisplay = new QUISwitch({
status: entry.isDisabled, status: entry.isDisabled,
name: i, name : i,
uid: i, uid : i,
events: { events: {
onChange: this.$toggleSlideStatus onChange: this.$toggleSlideStatus
} }
...@@ -331,19 +332,19 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -331,19 +332,19 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
var buttons = this.$Grid.getButtons(), var buttons = this.$Grid.getButtons(),
Edit = buttons.filter(function (Btn) { Edit = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'edit'; return Btn.getAttribute('name') === 'edit';
})[0], })[0],
Up = buttons.filter(function (Btn) { Up = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'up'; return Btn.getAttribute('name') === 'up';
})[0], })[0],
Down = buttons.filter(function (Btn) { Down = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'down'; return Btn.getAttribute('name') === 'down';
})[0], })[0],
Delete = buttons.filter(function (Btn) { Delete = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'delete'; return Btn.getAttribute('name') === 'delete';
})[0]; })[0];
...@@ -367,11 +368,11 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -367,11 +368,11 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
*/ */
add: function (params) { add: function (params) {
var entry = { var entry = {
titleIcon: '', titleIcon : '',
entryTitle: '', entryTitle : '',
entryImage: '', entryImage : '',
entryContent: '', entryContent: '',
isDisabled: 0 isDisabled : 0
}; };
if ("isDisabled" in params) { if ("isDisabled" in params) {
...@@ -412,11 +413,11 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -412,11 +413,11 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
} }
var entry = { var entry = {
titleIcon: '', titleIcon : '',
entryTitle: '', entryTitle : '',
entryImage: '', entryImage : '',
entryContent: '', entryContent: '',
isDisabled: 0 isDisabled : 0
}; };
if ("isDisabled" in params) { if ("isDisabled" in params) {
...@@ -492,14 +493,14 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -492,14 +493,14 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
*/ */
$refreshSorting: function () { $refreshSorting: function () {
var gridData = this.$Grid.getData(), var gridData = this.$Grid.getData(),
data = []; data = [];
for (var i = 0, len = gridData.length; i < len; i++) { for (var i = 0, len = gridData.length; i < len; i++) {
data.push({ data.push({
isDisabled: parseInt(gridData[i].isDisabled), isDisabled : parseInt(gridData[i].isDisabled),
titleIcon: gridData[i].titleIcon, titleIcon : gridData[i].titleIcon,
entryTitle: gridData[i].entryTitle, entryTitle : gridData[i].entryTitle,
entryImage: gridData[i].entryImage, entryImage : gridData[i].entryImage,
entryContent: gridData[i].entryContent entryContent: gridData[i].entryContent
}); });
} }
...@@ -519,17 +520,17 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -519,17 +520,17 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
*/ */
$openDeleteDialog: function () { $openDeleteDialog: function () {
new QUIConfirm({ new QUIConfirm({
icon: 'fa fa-icon', icon : 'fa fa-icon',
text: QUILocale.get(lg, 'control.navTabsVertical.entries.delete.title'), text : QUILocale.get(lg, 'control.navTabsVertical.entries.delete.title'),
information: QUILocale.get(lg, 'control.navTabsVertical.entries.delete.information'), information: QUILocale.get(lg, 'control.navTabsVertical.entries.delete.information'),
texticon: false, texticon : false,
maxWidth: 600, maxWidth : 600,
maxHeight: 400, maxHeight : 400,
ok_button: { ok_button : {
text: QUILocale.get('quiqqer/quiqqer', 'delete'), text : QUILocale.get('quiqqer/quiqqer', 'delete'),
textimage: 'fa fa-trash' textimage: 'fa fa-trash'
}, },
events: { events : {
onSubmit: function () { onSubmit: function () {
var selected = this.$Grid.getSelectedIndices(); var selected = this.$Grid.getSelectedIndices();
...@@ -547,15 +548,15 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -547,15 +548,15 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
* @retrun {Promise} * @retrun {Promise}
*/ */
$openEditDialog: function () { $openEditDialog: function () {
var self = this, var self = this,
data = this.$Grid.getSelectedData(), data = this.$Grid.getSelectedData(),
index = this.$Grid.getSelectedIndices(); index = this.$Grid.getSelectedIndices();
if (!data.length) { if (!data.length) {
return Promise.resolve(); return Promise.resolve();
} }
data = data[0]; data = data[0];
index = index[0]; index = index[0];
return this.$createDialog().then(function (Dialog) { return this.$createDialog().then(function (Dialog) {
...@@ -564,19 +565,19 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -564,19 +565,19 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
Dialog.Loader.show(); Dialog.Loader.show();
var Content = Dialog.getContent(); var Content = Dialog.getContent();
var Form = Content.getElement('form'); var Form = Content.getElement('form');
var Image = Form.elements.titleIcon; var Image = Form.elements.titleIcon;
var entryTitle = Form.elements.entryTitle; var entryTitle = Form.elements.entryTitle;
var entryImage = Form.elements.entryImage; var entryImage = Form.elements.entryImage;
var entryContent = Form.elements.entryContent; var entryContent = Form.elements.entryContent;
self.edit(index, { self.edit(index, {
titleIcon: Image.value, titleIcon : Image.value,
entryTitle: entryTitle.value, entryTitle : entryTitle.value,
entryImage: entryImage.value, entryImage : entryImage.value,
entryContent: entryContent.value, entryContent: entryContent.value,
isDisabled: Dialog.IsDisabledSwitch.getStatus() isDisabled : Dialog.IsDisabledSwitch.getStatus()
}); });
Dialog.close(); Dialog.close();
...@@ -586,11 +587,11 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -586,11 +587,11 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
Dialog.addEvent('onOpenAfterCreate', function () { Dialog.addEvent('onOpenAfterCreate', function () {
var Content = Dialog.getContent(); var Content = Dialog.getContent();
var Form = Content.getElement('form'); var Form = Content.getElement('form');
var Image = Form.elements.titleIcon; var Image = Form.elements.titleIcon;
var entryTitle = Form.elements.entryTitle; var entryTitle = Form.elements.entryTitle;
var entryImage = Form.elements.entryImage; var entryImage = Form.elements.entryImage;
var entryContent = Form.elements.entryContent; var entryContent = Form.elements.entryContent;
if (data.isDisabled) { if (data.isDisabled) {
...@@ -599,9 +600,9 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -599,9 +600,9 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
Dialog.IsDisabledSwitch.off(); Dialog.IsDisabledSwitch.off();
} }
Image.value = data.titleIcon; Image.value = data.titleIcon;
entryTitle.value = data.entryTitle; entryTitle.value = data.entryTitle;
entryImage.value = data.entryImage; entryImage.value = data.entryImage;
entryContent.value = data.entryContent; entryContent.value = data.entryContent;
if (data.newTab && data.newTab.getAttribute('data-enabled') === "1") { if (data.newTab && data.newTab.getAttribute('data-enabled') === "1") {
...@@ -634,19 +635,19 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -634,19 +635,19 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
Dialog.Loader.show(); Dialog.Loader.show();
var Content = Dialog.getContent(); var Content = Dialog.getContent();
var Form = Content.getElement('form'); var Form = Content.getElement('form');
var Image = Form.elements.titleIcon; var Image = Form.elements.titleIcon;
var entryTitle = Form.elements.entryTitle; var entryTitle = Form.elements.entryTitle;
var entryImage = Form.elements.entryImage; var entryImage = Form.elements.entryImage;
var entryContent = Form.elements.entryContent; var entryContent = Form.elements.entryContent;
self.add({ self.add({
titleIcon: Image.value, titleIcon : Image.value,
entryTitle: entryTitle.value, entryTitle : entryTitle.value,
entryImage: entryImage.value, entryImage : entryImage.value,
entryContent: entryContent.value, entryContent: entryContent.value,
isDisabled: Dialog.IsDisabledSwitch.getStatus() isDisabled : Dialog.IsDisabledSwitch.getStatus()
}); });
Dialog.close(); Dialog.close();
...@@ -666,26 +667,26 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -666,26 +667,26 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
return new Promise(function (resolve) { return new Promise(function (resolve) {
var Dialog = new QUIConfirm({ var Dialog = new QUIConfirm({
title: QUILocale.get(lg, 'control.navTabsVertical.entries.add.title'), title : QUILocale.get(lg, 'control.navTabsVertical.entries.add.title'),
icon: 'fa fa-edit', icon : 'fa fa-edit',
maxWidth: 800, maxWidth : 800,
maxHeight: 600, maxHeight : 600,
autoclose: false, autoclose : false,
IsDisabledSwitch: false, IsDisabledSwitch: false,
NewTabSwitch: false, NewTabSwitch : false,
events: { events : {
onOpen: function (Win) { onOpen: function (Win) {
Win.Loader.show(); Win.Loader.show();
Win.getContent().set('html', ''); Win.getContent().set('html', '');
var prefix = 'control.navTabsVertical.entries.', var prefix = 'control.navTabsVertical.entries.',
Container = new Element('div', { Container = new Element('div', {
html: Mustache.render(templateEntry, { html : Mustache.render(templateEntry, {
fieldIsDisabled: QUILocale.get(lg, prefix + 'isDisable'), fieldIsDisabled : QUILocale.get(lg, prefix + 'isDisable'),
fieldTitleIcon: QUILocale.get(lg, prefix + 'entryTitleIcon'), fieldTitleIcon : QUILocale.get(lg, prefix + 'entryTitleIcon'),
fieldEntryTitle: QUILocale.get(lg, prefix + 'entryTitle'), fieldEntryTitle : QUILocale.get(lg, prefix + 'entryTitle'),
fieldEntryImage: QUILocale.get(lg, prefix + 'entryImage'), fieldEntryImage : QUILocale.get(lg, prefix + 'entryImage'),
fieldEntryContent: QUILocale.get(lg, prefix + 'entryContent') fieldEntryContent: QUILocale.get(lg, prefix + 'entryContent')
}), }),
'class': 'quiqqer-menu-navTabsVertival-settings' 'class': 'quiqqer-menu-navTabsVertival-settings'
...@@ -698,7 +699,7 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -698,7 +699,7 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
}); });
Win.IsDisabledSwitch = new QUISwitch({ Win.IsDisabledSwitch = new QUISwitch({
name: 'isDisabled', name : 'isDisabled',
status: false status: false
}).inject(Container.getElement('#isDisabledWrapper')); }).inject(Container.getElement('#isDisabledWrapper'));
...@@ -711,7 +712,7 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -711,7 +712,7 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
return ControlsUtils.parse(Container); return ControlsUtils.parse(Container);
}).then(function () { }).then(function () {
var controls = QUI.Controls.getControlsInElement(Container), var controls = QUI.Controls.getControlsInElement(Container),
project = self.getAttribute('project'); project = self.getAttribute('project');
controls.each(function (Control) { controls.each(function (Control) {
if (Control === self) { if (Control === self) {
...@@ -727,7 +728,7 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ ...@@ -727,7 +728,7 @@ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
moofx(Container).animate({ moofx(Container).animate({
opacity: 1, opacity: 1,
top: 0 top : 0
}, { }, {
duration: 250, duration: 250,
callback: function () { callback: function () {
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren