From c2d316449f85bd2b74ae9ffaa3d08b7a5ee282cf Mon Sep 17 00:00:00 2001 From: Alex Bitney Date: Sun, 7 Feb 2016 00:00:41 +0200 Subject: added tags when posting new message added templates engine (rythm engine) and moved something to it. WARNING: textext plugin does not work when minimized, and also I fixed bug in it. --- src/main/webapp/textext/textext.plugin.arrow.js | 106 ++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 src/main/webapp/textext/textext.plugin.arrow.js (limited to 'src/main/webapp/textext/textext.plugin.arrow.js') diff --git a/src/main/webapp/textext/textext.plugin.arrow.js b/src/main/webapp/textext/textext.plugin.arrow.js new file mode 100644 index 00000000..0531acb9 --- /dev/null +++ b/src/main/webapp/textext/textext.plugin.arrow.js @@ -0,0 +1,106 @@ +/** + * jQuery TextExt Plugin + * http://textextjs.com + * + * @version 1.3.1 + * @copyright Copyright (C) 2011 Alex Gorbatchev. All rights reserved. + * @license MIT License + */ +(function($) +{ + /** + * Displays a dropdown style arrow button. The `TextExtArrow` works together with the + * `TextExtAutocomplete` plugin and whenever clicked tells the autocomplete plugin to + * display its suggestions. + * + * @author agorbatchev + * @date 2011/12/27 + * @id TextExtArrow + */ + function TextExtArrow() {}; + + $.fn.textext.TextExtArrow = TextExtArrow; + $.fn.textext.addPlugin('arrow', TextExtArrow); + + var p = TextExtArrow.prototype, + /** + * Arrow plugin only has one option and that is its HTML template. It could be + * changed when passed to the `$().textext()` function. For example: + * + * $('textarea').textext({ + * plugins: 'arrow', + * html: { + * arrow: "" + * } + * }) + * + * @author agorbatchev + * @date 2011/12/27 + * @id TextExtArrow.options + */ + + /** + * HTML source that is used to generate markup required for the arrow. + * + * @name html.arrow + * @default '
' + * @author agorbatchev + * @date 2011/12/27 + * @id TextExtArrow.options.html.arrow + */ + OPT_HTML_ARROW = 'html.arrow', + + DEFAULT_OPTS = { + html : { + arrow : '' + } + } + ; + + /** + * Initialization method called by the core during plugin instantiation. + * + * @signature TextExtArrow.init(core) + * + * @param core {TextExt} Instance of the TextExt core class. + * + * @author agorbatchev + * @date 2011/12/27 + * @id TextExtArrow.init + */ + p.init = function(core) + { + var self = this, + arrow + ; + + self.baseInit(core, DEFAULT_OPTS); + + self._arrow = arrow = $(self.opts(OPT_HTML_ARROW)); + self.core().wrapElement().append(arrow); + arrow.bind('click', function(e) { self.onArrowClick(e); }); + }; + + //-------------------------------------------------------------------------------- + // Event handlers + + /** + * Reacts to the `click` event whenever user clicks the arrow. + * + * @signature TextExtArrow.onArrowClick(e) + * + * @param e {Object} jQuery event. + * @author agorbatchev + * @date 2011/12/27 + * @id TextExtArrow.onArrowClick + */ + p.onArrowClick = function(e) + { + this.trigger('toggleDropdown'); + this.core().focusInput(); + }; + + //-------------------------------------------------------------------------------- + // Core functionality + +})(jQuery); -- cgit v1.2.3