Skip to content

Commit 058eaf3

Browse files
committed
Merge pull request #116 from SDKiller/master
Redactor plugins were updated since v.10.2
2 parents aa670ee + 1bfd203 commit 058eaf3

File tree

14 files changed

+242
-103
lines changed

14 files changed

+242
-103
lines changed

assets/plugins/clips/clips.js

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,62 @@
1-
if (!RedactorPlugins) var RedactorPlugins = {};
2-
3-
RedactorPlugins.clips = function()
1+
(function($)
42
{
5-
return {
6-
init: function()
7-
{
8-
var items = [
9-
['Lorem ipsum...', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'],
10-
['Red label', '<span class="label-red">Label</span>']
11-
];
3+
$.Redactor.prototype.clips = function()
4+
{
5+
return {
6+
init: function()
7+
{
8+
var items = [
9+
['Lorem ipsum...', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'],
10+
['Red label', '<span class="label-red">Label</span>']
11+
];
1212

13-
this.clips.template = $('<ul id="redactor-modal-list">');
13+
this.clips.template = $('<ul id="redactor-modal-list">');
1414

15-
for (var i = 0; i < items.length; i++)
16-
{
17-
var li = $('<li>');
18-
var a = $('<a href="#" class="redactor-clip-link">').text(items[i][0]);
19-
var div = $('<div class="redactor-clip">').hide().html(items[i][1]);
15+
for (var i = 0; i < items.length; i++)
16+
{
17+
var li = $('<li>');
18+
var a = $('<a href="#" class="redactor-clip-link">').text(items[i][0]);
19+
var div = $('<div class="redactor-clip">').hide().html(items[i][1]);
2020

21-
li.append(a);
22-
li.append(div);
23-
this.clips.template.append(li);
24-
}
21+
li.append(a);
22+
li.append(div);
23+
this.clips.template.append(li);
24+
}
2525

26-
this.modal.addTemplate('clips', '<section>' + this.utils.getOuterHtml(this.clips.template) + '</section>');
26+
this.modal.addTemplate('clips', '<section>' + this.utils.getOuterHtml(this.clips.template) + '</section>');
2727

28-
var button = this.button.add('clips', 'Clips');
29-
this.button.addCallback(button, this.clips.show);
28+
var button = this.button.add('clips', 'Clips');
29+
this.button.addCallback(button, this.clips.show);
3030

31-
},
32-
show: function()
33-
{
34-
this.modal.load('clips', 'Insert Clips', 400);
31+
},
32+
show: function()
33+
{
34+
this.modal.load('clips', 'Insert Clips', 400);
3535

36-
this.modal.createCancelButton();
36+
this.modal.createCancelButton();
3737

38-
$('#redactor-modal-list').find('.redactor-clip-link').each($.proxy(this.clips.load, this));
38+
$('#redactor-modal-list').find('.redactor-clip-link').each($.proxy(this.clips.load, this));
3939

40-
this.selection.save();
41-
this.modal.show();
42-
},
43-
load: function(i,s)
44-
{
45-
$(s).on('click', $.proxy(function(e)
40+
this.selection.save();
41+
this.modal.show();
42+
},
43+
load: function(i,s)
44+
{
45+
$(s).on('click', $.proxy(function(e)
46+
{
47+
e.preventDefault();
48+
this.clips.insert($(s).next().html());
49+
50+
}, this));
51+
},
52+
insert: function(html)
4653
{
47-
e.preventDefault();
48-
this.clips.insert($(s).next().html());
49-
50-
}, this));
51-
},
52-
insert: function(html)
53-
{
54-
this.selection.restore();
55-
this.insert.html(html);
56-
this.modal.close();
57-
this.observe.load();
58-
}
54+
this.selection.restore();
55+
this.insert.html(html);
56+
this.modal.close();
57+
this.observe.load();
58+
}
59+
};
5960
};
60-
};
61+
})(jQuery);
6162

assets/plugins/counter/counter.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if (!RedactorPlugins) var RedactorPlugins = {};
2-
31
(function($)
42
{
5-
RedactorPlugins.counter = function()
3+
$.Redactor.prototype.counter = function()
64
{
75
return {
86
init: function()
@@ -18,8 +16,8 @@ if (!RedactorPlugins) var RedactorPlugins = {};
1816
var text = html.replace(/<\/(.*?)>/gi, ' ');
1917
text = text.replace(/<(.*?)>/gi, '');
2018
text = text.replace(/\t/gi, '');
21-
text = text.replace(/\n/gi, '');
22-
text = text.replace(/\r/gi, '');
19+
text = text.replace(/\n/gi, ' ');
20+
text = text.replace(/\r/gi, ' ');
2321
text = $.trim(text);
2422

2523
if (text !== '')

assets/plugins/definedlinks/definedlinks.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if (!RedactorPlugins) var RedactorPlugins = {};
2-
31
(function($)
42
{
5-
RedactorPlugins.definedlinks = function()
3+
$.Redactor.prototype.definedlinks = function()
64
{
75
return {
86
init: function()

assets/plugins/filemanager/filemanager.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if (!RedactorPlugins) var RedactorPlugins = {};
2-
31
(function($)
42
{
5-
RedactorPlugins.filemanager = function()
3+
$.Redactor.prototype.filemanager = function()
64
{
75
return {
86
init: function()

assets/plugins/fontcolor/fontcolor.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if (!RedactorPlugins) var RedactorPlugins = {};
2-
31
(function($)
42
{
5-
RedactorPlugins.fontcolor = function()
3+
$.Redactor.prototype.fontcolor = function()
64
{
75
return {
86
init: function()

assets/plugins/fontfamily/fontfamily.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if (!RedactorPlugins) var RedactorPlugins = {};
2-
31
(function($)
42
{
5-
RedactorPlugins.fontfamily = function()
3+
$.Redactor.prototype.fontfamily = function()
64
{
75
return {
86
init: function ()

assets/plugins/fontsize/fontsize.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if (!RedactorPlugins) var RedactorPlugins = {};
2-
31
(function($)
42
{
5-
RedactorPlugins.fontsize = function()
3+
$.Redactor.prototype.fontsize = function()
64
{
75
return {
86
init: function()

assets/plugins/fullscreen/fullscreen.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if (!RedactorPlugins) var RedactorPlugins = {};
2-
31
(function($)
42
{
5-
RedactorPlugins.fullscreen = function()
3+
$.Redactor.prototype.fullscreen = function()
64
{
75
return {
86
init: function()

assets/plugins/imagemanager/imagemanager.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if (!RedactorPlugins) var RedactorPlugins = {};
2-
31
(function($)
42
{
5-
RedactorPlugins.imagemanager = function()
3+
$.Redactor.prototype.imagemanager = function()
64
{
75
return {
86
init: function()

assets/plugins/limiter/limiter.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if (!RedactorPlugins) var RedactorPlugins = {};
2-
31
(function($)
42
{
5-
RedactorPlugins.limiter = function()
3+
$.Redactor.prototype.limiter = function()
64
{
75
return {
86
init: function()

0 commit comments

Comments
 (0)