Refactoring
This commit is contained in:
7
web/bower_components/tinymce/plugins/nonbreaking/index.js
vendored
Normal file
7
web/bower_components/tinymce/plugins/nonbreaking/index.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
// Exports the "nonbreaking" plugin for usage with module loaders
|
||||
// Usage:
|
||||
// CommonJS:
|
||||
// require('tinymce/plugins/nonbreaking')
|
||||
// ES2015:
|
||||
// import 'tinymce/plugins/nonbreaking'
|
||||
require('./plugin.js');
|
||||
53
web/bower_components/tinymce/plugins/nonbreaking/plugin.js
vendored
Normal file
53
web/bower_components/tinymce/plugins/nonbreaking/plugin.js
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* plugin.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
/*global tinymce:true */
|
||||
|
||||
tinymce.PluginManager.add('nonbreaking', function(editor) {
|
||||
var setting = editor.getParam('nonbreaking_force_tab');
|
||||
|
||||
editor.addCommand('mceNonBreaking', function() {
|
||||
editor.insertContent(
|
||||
(editor.plugins.visualchars && editor.plugins.visualchars.state) ?
|
||||
'<span class="mce-nbsp"> </span>' : ' '
|
||||
);
|
||||
|
||||
editor.dom.setAttrib(editor.dom.select('span.mce-nbsp'), 'data-mce-bogus', '1');
|
||||
});
|
||||
|
||||
editor.addButton('nonbreaking', {
|
||||
title: 'Nonbreaking space',
|
||||
cmd: 'mceNonBreaking'
|
||||
});
|
||||
|
||||
editor.addMenuItem('nonbreaking', {
|
||||
text: 'Nonbreaking space',
|
||||
cmd: 'mceNonBreaking',
|
||||
context: 'insert'
|
||||
});
|
||||
|
||||
if (setting) {
|
||||
var spaces = +setting > 1 ? +setting : 3; // defaults to 3 spaces if setting is true (or 1)
|
||||
|
||||
editor.on('keydown', function(e) {
|
||||
if (e.keyCode == 9) {
|
||||
|
||||
if (e.shiftKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
for (var i = 0; i < spaces; i++) {
|
||||
editor.execCommand('mceNonBreaking');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
1
web/bower_components/tinymce/plugins/nonbreaking/plugin.min.js
vendored
Normal file
1
web/bower_components/tinymce/plugins/nonbreaking/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("nonbreaking",function(e){var t=e.getParam("nonbreaking_force_tab");if(e.addCommand("mceNonBreaking",function(){e.insertContent(e.plugins.visualchars&&e.plugins.visualchars.state?'<span class="mce-nbsp"> </span>':" "),e.dom.setAttrib(e.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),e.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),e.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),t){var n=+t>1?+t:3;e.on("keydown",function(t){if(9==t.keyCode){if(t.shiftKey)return;t.preventDefault();for(var r=0;r<n;r++)e.execCommand("mceNonBreaking")}})}});
|
||||
Reference in New Issue
Block a user