first import
This commit is contained in:
10
sites/all/modules/wysiwyg/plugins/break/break.css
Normal file
10
sites/all/modules/wysiwyg/plugins/break/break.css
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
.wysiwyg-break {
|
||||
display: block;
|
||||
border: 0;
|
||||
border-top: 1px dotted #ccc;
|
||||
margin-top: 1em;
|
||||
width: 100%;
|
||||
height: 12px;
|
||||
background: transparent url(images/breaktext.gif) no-repeat center top;
|
||||
}
|
68
sites/all/modules/wysiwyg/plugins/break/break.js
Normal file
68
sites/all/modules/wysiwyg/plugins/break/break.js
Normal file
@@ -0,0 +1,68 @@
|
||||
(function ($) {
|
||||
|
||||
// @todo Array syntax required; 'break' is a predefined token in JavaScript.
|
||||
Drupal.wysiwyg.plugins['break'] = {
|
||||
|
||||
/**
|
||||
* Return whether the passed node belongs to this plugin.
|
||||
*/
|
||||
isNode: function(node) {
|
||||
return ($(node).is('img.wysiwyg-break'));
|
||||
},
|
||||
|
||||
/**
|
||||
* Execute the button.
|
||||
*/
|
||||
invoke: function(data, settings, instanceId) {
|
||||
if (data.format == 'html') {
|
||||
// Prevent duplicating a teaser break.
|
||||
if ($(data.node).is('img.wysiwyg-break')) {
|
||||
return;
|
||||
}
|
||||
var content = this._getPlaceholder(settings);
|
||||
}
|
||||
else {
|
||||
// Prevent duplicating a teaser break.
|
||||
// @todo data.content is the selection only; needs access to complete content.
|
||||
if (data.content.match(/<!--break-->/)) {
|
||||
return;
|
||||
}
|
||||
var content = '<!--break-->';
|
||||
}
|
||||
if (typeof content != 'undefined') {
|
||||
Drupal.wysiwyg.instances[instanceId].insert(content);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Replace all <!--break--> tags with images.
|
||||
*/
|
||||
attach: function(content, settings, instanceId) {
|
||||
content = content.replace(/<!--break-->/g, this._getPlaceholder(settings));
|
||||
return content;
|
||||
},
|
||||
|
||||
/**
|
||||
* Replace images with <!--break--> tags in content upon detaching editor.
|
||||
*/
|
||||
detach: function(content, settings, instanceId) {
|
||||
var $content = $('<div>' + content + '</div>'); // No .outerHTML() in jQuery :(
|
||||
// #404532: document.createComment() required or IE will strip the comment.
|
||||
// #474908: IE 8 breaks when using jQuery methods to replace the elements.
|
||||
// @todo Add a generic implementation for all Drupal plugins for this.
|
||||
$.each($('img.wysiwyg-break', $content), function (i, elem) {
|
||||
elem.parentNode.insertBefore(document.createComment('break'), elem);
|
||||
elem.parentNode.removeChild(elem);
|
||||
});
|
||||
return $content.html();
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper function to return a HTML placeholder.
|
||||
*/
|
||||
_getPlaceholder: function (settings) {
|
||||
return '<img src="' + settings.path + '/images/spacer.gif" alt="<--break->" title="<--break-->" class="wysiwyg-break drupal-content" />';
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
BIN
sites/all/modules/wysiwyg/plugins/break/images/break.gif
Normal file
BIN
sites/all/modules/wysiwyg/plugins/break/images/break.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 108 B |
BIN
sites/all/modules/wysiwyg/plugins/break/images/breaktext.gif
Normal file
BIN
sites/all/modules/wysiwyg/plugins/break/images/breaktext.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 255 B |
BIN
sites/all/modules/wysiwyg/plugins/break/images/spacer.gif
Normal file
BIN
sites/all/modules/wysiwyg/plugins/break/images/spacer.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 B |
6
sites/all/modules/wysiwyg/plugins/break/langs/ca.js
Normal file
6
sites/all/modules/wysiwyg/plugins/break/langs/ca.js
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
tinyMCE.addToLang('break', {
|
||||
title: 'Inserir marcador de document retallat',
|
||||
desc: 'Generar el punt de separació entre la versió retallada del document i la resta del contingut'
|
||||
});
|
||||
|
6
sites/all/modules/wysiwyg/plugins/break/langs/de.js
Normal file
6
sites/all/modules/wysiwyg/plugins/break/langs/de.js
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
tinyMCE.addToLang('break', {
|
||||
title: 'Anrisstext trennen',
|
||||
desc: 'Separiert den Anrisstext und Textkörper des Inhalts an dieser Stelle'
|
||||
});
|
||||
|
6
sites/all/modules/wysiwyg/plugins/break/langs/en.js
Normal file
6
sites/all/modules/wysiwyg/plugins/break/langs/en.js
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
tinyMCE.addToLang('break', {
|
||||
title: 'Insert teaser break',
|
||||
desc: 'Separate teaser and body of this content'
|
||||
});
|
||||
|
6
sites/all/modules/wysiwyg/plugins/break/langs/es.js
Normal file
6
sites/all/modules/wysiwyg/plugins/break/langs/es.js
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
tinyMCE.addToLang('break', {
|
||||
title: 'Insertar marcador de documento recortado',
|
||||
desc: 'Generar el punto de separación entre la versión recortada del documento y el resto del contenido'
|
||||
});
|
||||
|
Reference in New Issue
Block a user