Skip to content

Commit 3a162a2

Browse files
authored
Merge pull request #208 from Aybee/Aybee-patch-2
Update multicolumnwizard_be_src.js
2 parents 9ae5c64 + f3722a4 commit 3a162a2

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

system/modules/multicolumnwizard/html/js/multicolumnwizard_be_src.js

+32-32
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ var MultiColumnWizard = new Class(
4444
}
4545

4646
var self = this;
47-
47+
4848
this.options.table.getElement('tbody').getChildren('tr').each(function(el, index){
4949

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

5353
// call static load callbacks
5454
if (MultiColumnWizard.operationLoadCallbacks[key])
@@ -84,7 +84,7 @@ var MultiColumnWizard = new Class(
8484
{
8585
el.getChildren('td.operations a').each(function(operation)
8686
{
87-
var key = operation.get('rel');
87+
var key = operation.get('data-operations');
8888

8989
// remove all click events
9090
operation.removeEvents('click');
@@ -143,11 +143,11 @@ var MultiColumnWizard = new Class(
143143
callback.pass([operation, el], self)();
144144
});
145145
}
146-
146+
147147

148148
});
149149
});
150-
150+
151151
// var sortingMcwEl = new Sortables(this.options.table.getElement('tbody'), {
152152
// handle: 'img.movehandler'
153153
// });
@@ -289,15 +289,15 @@ var MultiColumnWizard = new Class(
289289
if (typeOf(el.getProperty('id')) != 'string') el.destroy();
290290
break;
291291
case 'SCRIPT':
292-
//rewrite inline
292+
//rewrite inline
293293
//ToDO: refactor this part. For some reason replace will only find the first token of _row[0-9]+_
294294
var newScript = '';
295295
var script = el.get('html').toString();
296296
var length = 0;
297297
var start = script.search(/_row[0-9]+_/i);
298298
while(start > 0)
299299
{
300-
length = script.match(/(_row[0-9]+)+_/i)[0].length;
300+
length = script.match(/(_row[0-9]+)+_/i)[0].length;
301301
newScript = newScript + script.substr(0, start) + '_row' + level + '_';
302302
script = script.substr(start + length);
303303
start = script.search(/_row[0-9]+_/i);
@@ -335,7 +335,7 @@ var MultiColumnWizard = new Class(
335335

336336
/**
337337
* Add a load callback for the instance
338-
* @param string the key e.g. 'copy' - your button has to have the matching rel="" attribute (<a href="jsfallbackurl" rel="copy">...</a>)
338+
* @param string the key e.g. 'copy' - your button has to have the matching data-operations="" attribute (<a href="jsfallbackurl" data-operations="copy">...</a>)
339339
* @param function callback
340340
*/
341341
addOperationLoadCallback: function(key, func)
@@ -344,13 +344,13 @@ var MultiColumnWizard = new Class(
344344
{
345345
this.operationLoadCallbacks[key] = [];
346346
}
347-
347+
348348
this.operationLoadCallbacks[key].include(func);
349349
},
350350

351351
/**
352352
* Add a load callback for the instance
353-
* @param string the key e.g. 'copy' - your button has to have the matching rel="" attribute (<a href="jsfallbackurl" rel="copy">...</a>)
353+
* @param string the key e.g. 'copy' - your button has to have the matching data-operations="" attribute (<a href="jsfallbackurl" data-operations="copy">...</a>)
354354
* @param function callback
355355
*/
356356
addOperationUpdateCallback: function(key, func)
@@ -359,13 +359,13 @@ var MultiColumnWizard = new Class(
359359
{
360360
this.operationUpdateCallbacks[key] = [];
361361
}
362-
362+
363363
this.operationLoadCallbacks[key].include(func);
364364
},
365365

366366
/**
367367
* Add a click callback for the instance
368-
* @param string the key e.g. 'copy' - your button has to have the matching rel="" attribute (<a href="jsfallbackurl" rel="copy">...</a>)
368+
* @param string the key e.g. 'copy' - your button has to have the matching data-operations="" attribute (<a href="jsfallbackurl" data-operations="copy">...</a>)
369369
* @param function callback
370370
*/
371371
addOperationClickCallback: function(key, func)
@@ -374,13 +374,13 @@ var MultiColumnWizard = new Class(
374374
{
375375
this.operationClickCallbacks[key] = [];
376376
}
377-
377+
378378
this.operationClickCallbacks[key].include(func);
379379
},
380380

381381
killAllTinyMCE: function(el, row)
382382
{
383-
var parent = row.getParent('.multicolumnwizard');
383+
var parent = row.getParent('.multicolumnwizard');
384384

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

421421
// search for dmg tinymces
422422
parent.getElements('span.mceEditor').each(function(item, index){
423-
item.dispose();
424-
});
425-
423+
item.dispose();
424+
});
425+
426426
// search for scripttags tinymces
427427
parent.getElements('.tinymce').each(function(item, index){
428428
item.getElements('script').each(function(item, index){
429429
item.dispose();
430430
});
431-
});
431+
});
432432
},
433-
433+
434434
reinitTinyMCE: function(el, row, isParent)
435435
{
436436
var parent = null;
437-
437+
438438
if(isParent != true)
439439
{
440440
parent = row.getParent('.multicolumnwizard');
@@ -449,7 +449,7 @@ var MultiColumnWizard = new Class(
449449
{
450450
return;
451451
}
452-
452+
453453
var varTinys = parent.getElements('.tinymce textarea');
454454

455455
var addEditorCommand = 'mceAddControl';
@@ -465,7 +465,7 @@ var MultiColumnWizard = new Class(
465465
$(tinymce.get(item.get('id')).editorContainer).getElements('iframe')[0].set('title','MultiColumnWizard - TinyMCE');
466466
});
467467
},
468-
468+
469469
reinitStylect: function()
470470
{
471471

@@ -493,7 +493,7 @@ Object.append(MultiColumnWizard,
493493

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

506506
MultiColumnWizard.operationLoadCallbacks[key].include(func);
507507
},
508-
508+
509509
/**
510510
* Add a dupate callback for all the MCW's
511-
* @param string the key e.g. 'copy' - your button has to have the matching rel="" attribute (<a href="jsfallbackurl" rel="copy">...</a>)
511+
* @param string the key e.g. 'copy' - your button has to have the matching data-operations="" attribute (<a href="jsfallbackurl" data-operations="copy">...</a>)
512512
* @param function callback
513513
*/
514514
addOperationUpdateCallback: function(key, func)
@@ -524,7 +524,7 @@ Object.append(MultiColumnWizard,
524524

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

720720
if (row.getSiblings().length > 0) {
721721
//get all following rows
@@ -740,7 +740,7 @@ Object.append(MultiColumnWizard,
740740
MultiColumnWizard.clearElementValue(el);
741741
});
742742
}
743-
743+
744744
this.reinitTinyMCE(el, parent, true);
745745
},
746746

@@ -753,7 +753,7 @@ Object.append(MultiColumnWizard,
753753
upClick: function(el, row)
754754
{
755755
this.killAllTinyMCE(el, row);
756-
756+
757757
var previous = row.getPrevious();
758758
if (previous)
759759
{
@@ -800,10 +800,10 @@ Object.append(MultiColumnWizard,
800800

801801
row.inject(next, 'after');
802802
}
803-
803+
804804
this.reinitTinyMCE(el, row, false);
805805
},
806-
806+
807807
/**
808808
* @param Element the element which should be cleared
809809
*/

0 commit comments

Comments
 (0)