Changeset 1865784
- Timestamp:
- 04/28/2018 02:33:24 PM (8 years ago)
- Location:
- indent-lists-button
- Files:
-
- 17 added
- 3 edited
-
tags/0.1.37 (added)
-
tags/0.1.37/css (added)
-
tags/0.1.37/css/admin (added)
-
tags/0.1.37/css/admin/ili-admin.css (added)
-
tags/0.1.37/ili-indent-lists-button.php (added)
-
tags/0.1.37/js (added)
-
tags/0.1.37/js/mce-plugin.js (added)
-
tags/0.1.37/languages (added)
-
tags/0.1.37/readme.txt (added)
-
trunk/css/css (added)
-
trunk/css/css/admin (added)
-
trunk/css/css/admin/ili-admin.css (added)
-
trunk/css/ili-indent-lists-button.php (added)
-
trunk/css/js (added)
-
trunk/css/js/mce-plugin.js (added)
-
trunk/css/languages (added)
-
trunk/css/readme.txt (added)
-
trunk/ili-indent-lists-button.php (modified) (2 diffs)
-
trunk/js/mce-plugin.js (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indent-lists-button/trunk/ili-indent-lists-button.php
r1827735 r1865784 2 2 /* 3 3 * Plugin Name: Indent Lists Button 4 * Version: 0.1.3 64 * Version: 0.1.37 5 5 * Plugin URI: http://www.elisewebredactie.nl/indent-lists-button 6 6 * Author: Klaas van der Linden … … 41 41 // Register a new tinymce external plugin at wordpress. 42 42 function register_mce_plugin($plugin_array) { 43 $plugin_array ['ili_mce_plugin'] = $this->url . 'js/mce-plugin.js ';43 $plugin_array ['ili_mce_plugin'] = $this->url . 'js/mce-plugin.js?v=9'; 44 44 return $plugin_array; 45 45 } -
indent-lists-button/trunk/js/mce-plugin.js
r1580326 r1865784 1 (function( ) {1 (function($) { 2 2 /* Bail out if the admin_head hook hasn't been called to add the iliGlob variable */ 3 3 if(typeof iliGlob === 'undefined') … … 8 8 }); 9 9 /* 10 * Variable s to save the instances of the button and the editorfor use in11 * the callbacks , plus one for jquery.10 * Variable to save the instances of the button for use in 11 * the callbacks. 12 12 */ 13 13 var iliButton = null; 14 var theEditor = null;15 var $ = jQuery;16 14 /* Firstly, create a tinymce plugin that adds a new button editor to the editor */ 17 15 tinymce.create('tinymce.plugins.ili_mce_plugin', { 18 16 init : function(ed, url) { 19 theEditor = ed;20 17 /** 21 18 * Tell tinyMCE that this plugin should add a button to the editor, setting the … … 40 37 */ 41 38 ed.addCommand('indent_lists', function() { 42 if (e = theEditor.selection.getNode()) { 39 var nodeAtCaret = tinymce.activeEditor.selection.getNode(); 40 if (nodeAtCaret) { 43 41 /* Indent a list if present in this main node */ 44 $( e).closest('ul, ol').toggleClass('ili-indent');42 $(nodeAtCaret).closest('ul, ol').toggleClass('ili-indent'); 45 43 ed.execCommand("mceRepaint"); 46 44 } … … 55 53 if (iliButton) { 56 54 icon = $('i.mce-i-ili_button'); 57 list = $(t heEditor.selection.getNode()).closest('ul, ol');58 inList = (list.length == 1);55 list = $(tinymce.activeEditor.selection.getNode()).closest('ul, ol'); 56 inList = (list.length === 1); 59 57 inIndentedList = (inList && list.hasClass('ili-indent')); 60 58 /* Disable the button whenever the caret is outside a list. */ … … 85 83 // Secondly, add the newly created plugin to the tinymce.PluginManager 86 84 tinymce.PluginManager.add('ili_mce_plugin', tinymce.plugins.ili_mce_plugin); 87 })( );85 })(jQuery); -
indent-lists-button/trunk/readme.txt
r1827735 r1865784 4 4 Tags: lists, indent, indentation, bullet lists, list, align, alignment, opsomming, inspringen, Twenty Sixteen, Twenty Fifteen, indent lists, opsommingen inspringen, 5 5 Requires at least: 3.0.1 6 Tested up to: 4.9. 47 Stable tag: 0.1.3 66 Tested up to: 4.9.5 7 Stable tag: 0.1.37 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 31 31 1. Twenty Fifteen 32 32 2. Twenty Sixteen 33 3. Twenty Seventeen 34 4. Twety Eighteen 35 5. Business Elite 33 36 34 37 = Contact = … … 45 48 46 49 == Changelog == 50 51 = 0.1.37 (2017-01-17) = 52 53 * Bug fix (Thanks to Michel for finding the bug!) 54 47 55 = 0.1.35 (2017-01-17) = 48 56
Note: See TracChangeset
for help on using the changeset viewer.