Skip to content

Commit

Permalink
Merge pull request #116 from SDKiller/master
Browse files Browse the repository at this point in the history
Redactor plugins were updated since v.10.2
  • Loading branch information
samdark committed Aug 7, 2015
2 parents aa670ee + 1bfd203 commit 058eaf3
Show file tree
Hide file tree
Showing 14 changed files with 242 additions and 103 deletions.
97 changes: 49 additions & 48 deletions assets/plugins/clips/clips.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
if (!RedactorPlugins) var RedactorPlugins = {};

RedactorPlugins.clips = function()
(function($)
{
return {
init: function()
{
var items = [
['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.'],
['Red label', '<span class="label-red">Label</span>']
];
$.Redactor.prototype.clips = function()
{
return {
init: function()
{
var items = [
['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.'],
['Red label', '<span class="label-red">Label</span>']
];

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

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

li.append(a);
li.append(div);
this.clips.template.append(li);
}
li.append(a);
li.append(div);
this.clips.template.append(li);
}

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

var button = this.button.add('clips', 'Clips');
this.button.addCallback(button, this.clips.show);
var button = this.button.add('clips', 'Clips');
this.button.addCallback(button, this.clips.show);

},
show: function()
{
this.modal.load('clips', 'Insert Clips', 400);
},
show: function()
{
this.modal.load('clips', 'Insert Clips', 400);

this.modal.createCancelButton();
this.modal.createCancelButton();

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

this.selection.save();
this.modal.show();
},
load: function(i,s)
{
$(s).on('click', $.proxy(function(e)
this.selection.save();
this.modal.show();
},
load: function(i,s)
{
$(s).on('click', $.proxy(function(e)
{
e.preventDefault();
this.clips.insert($(s).next().html());

}, this));
},
insert: function(html)
{
e.preventDefault();
this.clips.insert($(s).next().html());

}, this));
},
insert: function(html)
{
this.selection.restore();
this.insert.html(html);
this.modal.close();
this.observe.load();
}
this.selection.restore();
this.insert.html(html);
this.modal.close();
this.observe.load();
}
};
};
};
})(jQuery);

8 changes: 3 additions & 5 deletions assets/plugins/counter/counter.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
RedactorPlugins.counter = function()
$.Redactor.prototype.counter = function()
{
return {
init: function()
Expand All @@ -18,8 +16,8 @@ if (!RedactorPlugins) var RedactorPlugins = {};
var text = html.replace(/<\/(.*?)>/gi, ' ');
text = text.replace(/<(.*?)>/gi, '');
text = text.replace(/\t/gi, '');
text = text.replace(/\n/gi, '');
text = text.replace(/\r/gi, '');
text = text.replace(/\n/gi, ' ');
text = text.replace(/\r/gi, ' ');
text = $.trim(text);

if (text !== '')
Expand Down
4 changes: 1 addition & 3 deletions assets/plugins/definedlinks/definedlinks.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
RedactorPlugins.definedlinks = function()
$.Redactor.prototype.definedlinks = function()
{
return {
init: function()
Expand Down
4 changes: 1 addition & 3 deletions assets/plugins/filemanager/filemanager.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
RedactorPlugins.filemanager = function()
$.Redactor.prototype.filemanager = function()
{
return {
init: function()
Expand Down
4 changes: 1 addition & 3 deletions assets/plugins/fontcolor/fontcolor.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
RedactorPlugins.fontcolor = function()
$.Redactor.prototype.fontcolor = function()
{
return {
init: function()
Expand Down
4 changes: 1 addition & 3 deletions assets/plugins/fontfamily/fontfamily.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
RedactorPlugins.fontfamily = function()
$.Redactor.prototype.fontfamily = function()
{
return {
init: function ()
Expand Down
4 changes: 1 addition & 3 deletions assets/plugins/fontsize/fontsize.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
RedactorPlugins.fontsize = function()
$.Redactor.prototype.fontsize = function()
{
return {
init: function()
Expand Down
4 changes: 1 addition & 3 deletions assets/plugins/fullscreen/fullscreen.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
RedactorPlugins.fullscreen = function()
$.Redactor.prototype.fullscreen = function()
{
return {
init: function()
Expand Down
4 changes: 1 addition & 3 deletions assets/plugins/imagemanager/imagemanager.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
RedactorPlugins.imagemanager = function()
$.Redactor.prototype.imagemanager = function()
{
return {
init: function()
Expand Down
4 changes: 1 addition & 3 deletions assets/plugins/limiter/limiter.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
RedactorPlugins.limiter = function()
$.Redactor.prototype.limiter = function()
{
return {
init: function()
Expand Down
Loading

0 comments on commit 058eaf3

Please sign in to comment.