Skip to content

Commit

Permalink
Update multicolumnwizard_be_src.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Aybee authored Jul 29, 2016
1 parent a4bc1d8 commit f3722a4
Showing 1 changed file with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,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 @@ -92,7 +92,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 @@ -149,11 +149,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 @@ -295,15 +295,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 All @@ -320,7 +320,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 @@ -329,13 +329,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 @@ -344,13 +344,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 @@ -359,13 +359,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 @@ -405,21 +405,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 @@ -434,7 +434,7 @@ var MultiColumnWizard = new Class(
{
return;
}

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

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

reinitStylect: function()
{

Expand Down Expand Up @@ -478,7 +478,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 @@ -490,10 +490,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 @@ -509,7 +509,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 @@ -556,7 +556,7 @@ Object.append(MultiColumnWizard,
// check maxCount for an inject
if (this.options.maxCount == 0 || (this.options.maxCount > 0 && rowCount < this.options.maxCount))
{
var copy = row.clone(true,true);
var copy = row.clone(true,true);

//get the current level of the row
level = row.getAllPrevious().length;
Expand Down Expand Up @@ -613,8 +613,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 @@ -639,7 +639,7 @@ Object.append(MultiColumnWizard,
MultiColumnWizard.clearElementValue(el);
});
}

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

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

var previous = row.getPrevious();
if (previous)
{
Expand Down Expand Up @@ -699,10 +699,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 f3722a4

Please sign in to comment.