nodebb-plugin-mega-colors
Advanced tools
+9
-9
@@ -1,8 +0,8 @@ | ||
| $('document').ready(function() { | ||
| require(['composer', 'composer/controls'], function(composer, controls) { | ||
| $('document').ready(function () { | ||
| require(['composer', 'composer/controls'], function (composer, controls) { | ||
| var text, start, end; | ||
| composer.addButton('fa fa-eyedropper', function(textarea, selectionStart, selectionEnd) { | ||
| composer.addButton('fa fa-eyedropper', function (textarea, selectionStart, selectionEnd) { | ||
| text = textarea; | ||
| }); | ||
| $(document).on('click','[data-format="eyedropper"]',function(){ | ||
| $(document).on('click', '[data-format="eyedropper"]', function () { | ||
| $('.fa-eyedropper').ColorPicker({ | ||
@@ -20,7 +20,7 @@ onShow: function (el) { | ||
| $(el).ColorPickerHide(); | ||
| if(start === end){ | ||
| controls.insertIntoTextarea(text, '%(#'+hex+')[Цветной текст]'); | ||
| controls.updateTextareaSelection(text, start + 11, end + 27); | ||
| if (start === end) { | ||
| controls.insertIntoTextarea(text, '%(#' + hex + ')[Colored Text Here]'); | ||
| controls.updateTextareaSelection(text, start + 11, end + 28); | ||
| } else { | ||
| controls.wrapSelectionInTextareaWith(text, '%(#'+hex+')[',']'); | ||
| controls.wrapSelectionInTextareaWith(text, '%(#' + hex + ')[', ']'); | ||
| controls.updateTextareaSelection(text, start + 11, end + 11); | ||
@@ -31,3 +31,3 @@ } | ||
| }); | ||
| $(document).on('blur','textarea.write',function(){ | ||
| $(document).on('blur', 'textarea.write', function () { | ||
| start = this.selectionStart; | ||
@@ -34,0 +34,0 @@ end = this.selectionEnd; |
+1
-1
| { | ||
| "name": "nodebb-plugin-mega-colors", | ||
| "version": "0.10.17", | ||
| "version": "0.10.18", | ||
| "nbbpm": { | ||
@@ -5,0 +5,0 @@ "compatibility": "^0.7.1 || ^0.8.0 || ^0.9.0 || ^1.0.0" |
55850
0.03%