-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from SDKiller/master
Redactor plugins were updated since v.10.2
- Loading branch information
Showing
14 changed files
with
242 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.