Skip to content

Commit

Permalink
Merge pull request #208 from Aybee/Aybee-patch-2
Browse files Browse the repository at this point in the history
Update multicolumnwizard_be_src.js
  • Loading branch information
davidmaack authored Oct 3, 2017
2 parents 9ae5c64 + f3722a4 commit 3a162a2
Showing 1 changed file with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ var MultiColumnWizard = new Class(
}

var self = this;

this.options.table.getElement('tbody').getChildren('tr').each(function(el, index){

el.getChildren('td.operations a').each(function(operation) {
var key = operation.get('rel');
var key = operation.get('data-operations');

// call static load callbacks
if (MultiColumnWizard.operationLoadCallbacks[key])
Expand Down Expand Up @@ -84,7 +84,7 @@ var MultiColumnWizard = new Class(
{
el.getChildren('td.operations a').each(function(operation)
{
var key = operation.get('rel');
var key = operation.get('data-operations');

// remove all click events
operation.removeEvents('click');
Expand Down Expand Up @@ -143,11 +143,11 @@ var MultiColumnWizard = new Class(
callback.pass([operation, el], self)();
});
}


});
});

// var sortingMcwEl = new Sortables(this.options.table.getElement('tbody'), {
// handle: 'img.movehandler'
// });
Expand Down Expand Up @@ -289,15 +289,15 @@ var MultiColumnWizard = new Class(
if (typeOf(el.getProperty('id')) != 'string') el.destroy();
break;
case 'SCRIPT':
//rewrite inline
//rewrite inline
//ToDO: refactor this part. For some reason replace will only find the first token of _row[0-9]+_
var newScript = '';
var script = el.get('html').toString();
var length = 0;
var start = script.search(/_row[0-9]+_/i);
while(start > 0)
{
length = script.match(/(_row[0-9]+)+_/i)[0].length;
length = script.match(/(_row[0-9]+)+_/i)[0].length;
newScript = newScript + script.substr(0, start) + '_row' + level + '_';
script = script.substr(start + length);
start = script.search(/_row[0-9]+_/i);
Expand Down Expand Up @@ -335,7 +335,7 @@ var MultiColumnWizard = new Class(

/**
* Add a load callback for the instance
* @param string the key e.g. 'copy' - your button has to have the matching rel="" attribute (<a href="jsfallbackurl" rel="copy">...</a>)
* @param string the key e.g. 'copy' - your button has to have the matching data-operations="" attribute (<a href="jsfallbackurl" data-operations="copy">...</a>)
* @param function callback
*/
addOperationLoadCallback: function(key, func)
Expand All @@ -344,13 +344,13 @@ var MultiColumnWizard = new Class(
{
this.operationLoadCallbacks[key] = [];
}

this.operationLoadCallbacks[key].include(func);
},

/**
* Add a load callback for the instance
* @param string the key e.g. 'copy' - your button has to have the matching rel="" attribute (<a href="jsfallbackurl" rel="copy">...</a>)
* @param string the key e.g. 'copy' - your button has to have the matching data-operations="" attribute (<a href="jsfallbackurl" data-operations="copy">...</a>)
* @param function callback
*/
addOperationUpdateCallback: function(key, func)
Expand All @@ -359,13 +359,13 @@ var MultiColumnWizard = new Class(
{
this.operationUpdateCallbacks[key] = [];
}

this.operationLoadCallbacks[key].include(func);
},

/**
* Add a click callback for the instance
* @param string the key e.g. 'copy' - your button has to have the matching rel="" attribute (<a href="jsfallbackurl" rel="copy">...</a>)
* @param string the key e.g. 'copy' - your button has to have the matching data-operations="" attribute (<a href="jsfallbackurl" data-operations="copy">...</a>)
* @param function callback
*/
addOperationClickCallback: function(key, func)
Expand All @@ -374,13 +374,13 @@ var MultiColumnWizard = new Class(
{
this.operationClickCallbacks[key] = [];
}

this.operationClickCallbacks[key].include(func);
},

killAllTinyMCE: function(el, row)
{
var parent = row.getParent('.multicolumnwizard');
var parent = row.getParent('.multicolumnwizard');

// skip if no tinymce class was found
if(parent.getElements('.tinymce').length == 0)
Expand Down Expand Up @@ -420,21 +420,21 @@ var MultiColumnWizard = new Class(

// search for dmg tinymces
parent.getElements('span.mceEditor').each(function(item, index){
item.dispose();
});
item.dispose();
});

// search for scripttags tinymces
parent.getElements('.tinymce').each(function(item, index){
item.getElements('script').each(function(item, index){
item.dispose();
});
});
});
},

reinitTinyMCE: function(el, row, isParent)
{
var parent = null;

if(isParent != true)
{
parent = row.getParent('.multicolumnwizard');
Expand All @@ -449,7 +449,7 @@ var MultiColumnWizard = new Class(
{
return;
}

var varTinys = parent.getElements('.tinymce textarea');

var addEditorCommand = 'mceAddControl';
Expand All @@ -465,7 +465,7 @@ var MultiColumnWizard = new Class(
$(tinymce.get(item.get('id')).editorContainer).getElements('iframe')[0].set('title','MultiColumnWizard - TinyMCE');
});
},

reinitStylect: function()
{

Expand Down Expand Up @@ -493,7 +493,7 @@ Object.append(MultiColumnWizard,

/**
* Add a load callback for all the MCW's
* @param string the key e.g. 'copy' - your button has to have the matching rel="" attribute (<a href="jsfallbackurl" rel="copy">...</a>)
* @param string the key e.g. 'copy' - your button has to have the matching data-operations="" attribute (<a href="jsfallbackurl" data-operations="copy">...</a>)
* @param function callback
*/
addOperationLoadCallback: function(key, func)
Expand All @@ -505,10 +505,10 @@ Object.append(MultiColumnWizard,

MultiColumnWizard.operationLoadCallbacks[key].include(func);
},

/**
* Add a dupate callback for all the MCW's
* @param string the key e.g. 'copy' - your button has to have the matching rel="" attribute (<a href="jsfallbackurl" rel="copy">...</a>)
* @param string the key e.g. 'copy' - your button has to have the matching data-operations="" attribute (<a href="jsfallbackurl" data-operations="copy">...</a>)
* @param function callback
*/
addOperationUpdateCallback: function(key, func)
Expand All @@ -524,7 +524,7 @@ Object.append(MultiColumnWizard,

/**
* Add a click callback for all the MCW's
* @param string the key e.g. 'copy' - your button has to have the matching rel="" attribute (<a href="jsfallbackurl" rel="copy">...</a>)
* @param string the key e.g. 'copy' - your button has to have the matching data-operations="" attribute (<a href="jsfallbackurl" data-operations="copy">...</a>)
* @param function callback
*/
addOperationClickCallback: function(key, func)
Expand Down Expand Up @@ -714,8 +714,8 @@ Object.append(MultiColumnWizard,
*/
deleteClick: function(el, row)
{
this.killAllTinyMCE(el, row);
var parent = row.getParent('.multicolumnwizard');
this.killAllTinyMCE(el, row);
var parent = row.getParent('.multicolumnwizard');

if (row.getSiblings().length > 0) {
//get all following rows
Expand All @@ -740,7 +740,7 @@ Object.append(MultiColumnWizard,
MultiColumnWizard.clearElementValue(el);
});
}

this.reinitTinyMCE(el, parent, true);
},

Expand All @@ -753,7 +753,7 @@ Object.append(MultiColumnWizard,
upClick: function(el, row)
{
this.killAllTinyMCE(el, row);

var previous = row.getPrevious();
if (previous)
{
Expand Down Expand Up @@ -800,10 +800,10 @@ Object.append(MultiColumnWizard,

row.inject(next, 'after');
}

this.reinitTinyMCE(el, row, false);
},

/**
* @param Element the element which should be cleared
*/
Expand Down

0 comments on commit 3a162a2

Please sign in to comment.