-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR makes it easier to expand the functionality of TinyMCE and allows to install/uninstall (as Joomla-Plugins) or enable/disable Buttons. For that there is a new plugin category "editors_buttons" which must be used. Also jdragdrop is fitted for this changes. (based on
- Loading branch information
Showing
14 changed files
with
379 additions
and
447 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-12.sql
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) | ||
VALUES (458, 'PLG_EDITORS_BUTTONS_JDRAGDROP_NAME', 'plugin', 'jdragdrop', 'editors_buttons', 0, 1, 1, 1, '{"name":"PLG_EDITORS_BUTTONS_JDRAGDROP_NAME","type":"plugin","creationDate":"August 2016","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.7.0","description":"PLG_EDITORS_BUTTONS_JDRAGDROP_DESC","group":"","filename":"jdragdrop"}', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); | ||
|
2 changes: 2 additions & 0 deletions
2
administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-12.sql
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") | ||
VALUES (458, 'PLG_EDITORS_BUTTONS_JDRAGDROP_NAME', 'plugin', 'jdragdrop', 'editors_buttons', 0, 1, 1, 1, '{"name":"PLG_EDITORS_BUTTONS_JDRAGDROP_NAME","type":"plugin","creationDate":"August 2016","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.7.0","description":"PLG_EDITORS_BUTTONS_JDRAGDROP_DESC","group":"","filename":"jdragdrop"}', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); |
6 changes: 6 additions & 0 deletions
6
administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-12.sql
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SET IDENTITY_INSERT [#__extensions] ON; | ||
|
||
INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) | ||
SELECT 458, 'PLG_EDITORS_BUTTONS_JDRAGDROP_NAME', 'plugin', 'jdragdrop', 'editors_buttons', 0, 1, 1, 1, '{"name":"PLG_EDITORS_BUTTONS_JDRAGDROP_NAME","type":"plugin","creationDate":"August 2016","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.7.0","description":"PLG_EDITORS_BUTTONS_JDRAGDROP_DESC","group":"","filename":"jdragdrop"}', '', '', '', 0, '0000-00-00 00:00:00', 0, 0; | ||
|
||
SET IDENTITY_INSERT [#__extensions] OFF; |
7 changes: 7 additions & 0 deletions
7
administrator/language/en-GB/en-GB.plg_editors_buttons_jdragdrop.ini
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
; Joomla! Project | ||
; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. | ||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
; Note : All ini files need to be saved as UTF-8 | ||
|
||
PLG_EDITORS_BUTTONS_JDRAGDROP_NAME="JDragDrop" | ||
PLG_EDITORS_BUTTONS_JDRAGDROP_DESC="Drag and Drop Plugin for TinyMCE" |
8 changes: 8 additions & 0 deletions
8
administrator/language/en-GB/en-GB.plg_editors_buttons_jdragdrop.sys.ini
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
; Joomla! Project | ||
; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. | ||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
; Note : All ini files need to be saved as UTF-8 | ||
|
||
PLG_EDITORS_BUTTONS_JDRAGDROP_NAME="JDragDrop" | ||
PLG_EDITORS_BUTTONS_JDRAGDROP_DESC="Drag and Drop Plugin for TinyMCE" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/** | ||
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
;(function(tinyMCE, Joomla, $, window, document){ | ||
"use strict"; | ||
|
||
// This line is for Mootools b/c | ||
window.getSize = window.getSize || function(){return {x: $(window).width(), y: $(window).height()};}; | ||
|
||
window.jInsertEditorText = function ( text, editor ) { | ||
tinyMCE.activeEditor.execCommand('mceInsertContent', false, text); | ||
} | ||
|
||
var JoomlaTinyMCE = { | ||
|
||
/** | ||
* Find all TinyMCE elements and initialize TinyMCE instance for each | ||
* | ||
* @param {HTMLElement} target Target Element where to search for the editor element | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
setupEditors: function ( target ) { | ||
target = target || document; | ||
var pluginOptions = Joomla.getOptions ? Joomla.getOptions('plg_editor_tinymce', {}) | ||
: (Joomla.optionsStorage.plg_editor_tinymce || {}), | ||
$editors = $(target).find('.joomla-editor-tinymce'); | ||
|
||
for(var i = 0, l = $editors.length; i < l; i++) { | ||
this.setupEditor($editors[i], pluginOptions); | ||
} | ||
}, | ||
|
||
/** | ||
* Initialize TinyMCE editor instance | ||
* | ||
* @param {HTMLElement} element | ||
* @param {Object} pluginOptions | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
setupEditor: function ( element, pluginOptions ) { | ||
var name = element ? $(element).attr('name').replace(/\[\]|\]/g, '').split('[').pop() : 'default', // Get Editor name | ||
tinyMCEOptions = pluginOptions ? pluginOptions.tinyMCE || {} : {}, | ||
defaultOptions = tinyMCEOptions['default'] || {}, | ||
options = tinyMCEOptions[name] ? tinyMCEOptions[name] : defaultOptions; // Check specific options by the name | ||
|
||
// Avoid unexpected changes | ||
options = jQuery.extend({}, options); | ||
|
||
if (element) { | ||
// We already have the Target, so reset the selector and assign given element as target | ||
options.selector = null; | ||
options.target = element; | ||
} | ||
|
||
if (options.setupCallbacString && !options.setup) { | ||
options.setup = new Function('editor', options.setupCallbacString); | ||
} | ||
|
||
tinyMCE.init(options); | ||
} | ||
|
||
}; | ||
|
||
Joomla.JoomlaTinyMCE = JoomlaTinyMCE; | ||
|
||
// Init on doomready | ||
$(document).ready(function(){ | ||
Joomla.JoomlaTinyMCE.setupEditors(); | ||
|
||
// Init in subform field | ||
$(document).on('subform-row-add', function(event, row){ | ||
Joomla.JoomlaTinyMCE.setupEditors(row); | ||
}) | ||
}); | ||
|
||
}(tinyMCE, Joomla, jQuery, window, document)); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.