diff --git a/apps/comments/js/vendor/At.js/CHANGELOG.md b/apps/comments/js/vendor/At.js/CHANGELOG.md deleted file mode 100644 index bfc2458847..0000000000 --- a/apps/comments/js/vendor/At.js/CHANGELOG.md +++ /dev/null @@ -1,314 +0,0 @@ -### v1.5.0 - -add `headerTpl` settings - -* 7a41d93 - #375 from vcekov/fix_scroll_position - Valentin Cekov -* ecbf34f - #373 from vcekov/val/fix_key_navigation_interefence_with_mouse - Valentin Cekov -* b68cf84 - #364 from WorktileTech/master - Harold.Luo -* f836f04 - #372 from vcekov/fix_caret_for_space_after_@ - Harold.Luo -* 06cf6bb - Properly set caret position after failed match - Valentin Cekov -* c9ed2e2 - support header template. - htz - -### v1.4.0 - -#### Contenteditable - -Pressing `Backspace` will turn the inserted element back to the origin query 'moment'. - -* 84edc9f - skip inserted element when moving left or right - ichord -* 25a61d3 - the jQuery npm package is now called jquery. Fixes #338 - Mick Staugaard -* 03ed71f - Merge pull request #351 from mociepka/master - Harold.Luo -* ae00dc3 - Point main script in package json - Michał Ociepka -* c5f31f5 - Merge branch 'dev' into HEAD - ichord -* c399397 - fix contenteditable cursor bug when typing "a" into query - ichord -* 7f4295a - fix previous replacements get clobbered when re-intering the inserted element - ichord -* f00fabd - Merge pull request #354 from lvegerano/master - Harold.Luo -* a42065e - Adds guard to event and dist file - Luis Vegerano -* e4aaa30 - Add option to disable loopUp on click - Luis Vegerano -* c9b7609 - Fix bug where callbacks would run before reaching minLen. Fixes #329. - Mike Leone -* f8692dc - Add support for minLen. Connects to issue #316. - Mike Leone -* fd7d298 - FIX: the value of `isSelecting` - ichord -* c374c93 - FIX: IME typing error - ichord - -### v1.3.0 - -* 7f2189d - fix #294 inserts "" suffix in contenteditable -* bae95d9 - add `tabSelectsMatch` setting to make tab selection optional -* e966aba - Merge pull request #298 from kkirsche/patch-1 - Harold.Luo -* 9f78239 - Remove moot `version` property from bower.json - Kevin Kirsche - -### v1.2.0 - -db09ac7 -> 886613f - -* 886613f - add `$.fn.atwho.debug = false` to trigger debug mode -* 6567af9 - Enable default events when nothing is highlighted - Teemu -* 752ad4a - Add scrollDuration option. - Takuru -* bf17d43 - add parameter to allow for a spacebar in the middle of a search so that you can match a first + last name, for example - Feather Knee -* a1d5fe7 - add `reposition` API - ichord -* 9bcb06e - add "onInsert", "onDispaly" arguments to `tplEval` - ichord -* db09ac7 - add `hide` api - ichord - -### v1.1.0 - -* lisafeather/displyTplCallBack - #259 -* ADD: `editableAtwhoQueryAttrs` options -* Added setting for 'spaceSelectsMatch' (default false/off) - -### v1.0.0 - -**The naming convention are using camel case**. -It means that every callback and setting's name are switched from underscope_naming to CamelNaming. -Sorry about this. - -Future version's naming will follow the rules of http://semver.org constantly. - -#### Options: - -* Replaced `tpl` with `displayTpl`: display template of dropdown menu items. - In previous versions, At.js will fetch the value of `data-value` to insert; It stops doing it. - Please use the `insertTpl` option to manage the content to insert instead. - The default value is `"
hello!
- - diff --git a/apps/comments/js/vendor/At.js/examples/hashtags.html b/apps/comments/js/vendor/At.js/examples/hashtags.html deleted file mode 100644 index 3894ceea99..0000000000 --- a/apps/comments/js/vendor/At.js/examples/hashtags.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - -
- And!! it support ContentEditable mode too!!
-
-
-
-
- Try here now!
- :h
-
We will get the rect of @icho
" -# mirror.create(html).rect() -class Mirror - css_attr: [ - "borderBottomWidth", - "borderLeftWidth", - "borderRightWidth", - "borderTopStyle", - "borderRightStyle", - "borderBottomStyle", - "borderLeftStyle", - "borderTopWidth", - "boxSizing", - "fontFamily", - "fontSize", - "fontWeight", - "height", - "letterSpacing", - "lineHeight", - "marginBottom", - "marginLeft", - "marginRight", - "marginTop", - "outlineWidth", - "overflow", - "overflowX", - "overflowY", - "paddingBottom", - "paddingLeft", - "paddingRight", - "paddingTop", - "textAlign", - "textOverflow", - "textTransform", - "whiteSpace", - "wordBreak", - "wordWrap", - ] - - constructor: (@$inputor) -> - - mirrorCss: -> - css = - position: 'absolute' - left: -9999 - top: 0 - zIndex: -20000 - if @$inputor.prop( 'tagName' ) == 'TEXTAREA' - @css_attr.push( 'width' ) - $.each @css_attr, (i,p) => - css[p] = @$inputor.css p - css - - create: (html) -> - @$mirror = $('') - @$mirror.css this.mirrorCss() - @$mirror.html(html) - @$inputor.after(@$mirror) - this - - # 获得标记的位置 - # - # @return [Object] 标记的坐标 - # {left: 0, top: 0, bottom: 0} - rect: -> - $flag = @$mirror.find "#caret" - pos = $flag.position() - rect = {left: pos.left, top: pos.top, height: $flag.height() } - @$mirror.remove() - rect - -Utils = - contentEditable: ($inputor)-> - !!($inputor[0].contentEditable && $inputor[0].contentEditable == 'true') - -methods = - pos: (pos) -> - if pos or pos == 0 - this.setPos pos - else - this.getPos() - - position: (pos) -> - if oDocument.selection then this.getIEPosition pos else this.getPosition pos - - offset: (pos) -> - offset = this.getOffset(pos) - offset - -oDocument = null -oWindow = null -oFrame = null -setContextBy = (settings) -> - if iframe = settings?.iframe - oFrame = iframe - oWindow = iframe.contentWindow - oDocument = iframe.contentDocument || oWindow.document - else - oFrame = undefined - oWindow = window - oDocument = document -discoveryIframeOf = ($dom) -> - oDocument = $dom[0].ownerDocument - oWindow = oDocument.defaultView || oDocument.parentWindow - try - oFrame = oWindow.frameElement - catch error - # throws error in cross-domain iframes - -$.fn.caret = (method, value, settings) -> - # http://stackoverflow.com/questions/16010204/get-reference-of-window-object-from-a-dom-element - if methods[method] - if $.isPlainObject(value) - setContextBy value - value = undefined - else - setContextBy settings - caret = if Utils.contentEditable(this) then new EditableCaret(this) else new InputCaret(this) - methods[method].apply caret, [value] - else - $.error "Method #{method} does not exist on jQuery.caret" - - - -$.fn.caret.EditableCaret = EditableCaret -$.fn.caret.InputCaret = InputCaret -$.fn.caret.Utils = Utils -$.fn.caret.apis = methods diff --git a/apps/comments/js/vendor/Caret.js/src/jquery.caret.js b/apps/comments/js/vendor/Caret.js/src/jquery.caret.js deleted file mode 100644 index 1cdde1d0c9..0000000000 --- a/apps/comments/js/vendor/Caret.js/src/jquery.caret.js +++ /dev/null @@ -1,406 +0,0 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(["jquery"], function ($) { - return (root.returnExportsGlobal = factory($)); - }); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like enviroments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(jQuery); - } -}(this, function ($) { - -//@ sourceMappingURL=jquery.caret.map -/* - Implement Github like autocomplete mentions - http://ichord.github.com/At.js - - Copyright (c) 2013 chord.luo@gmail.com - Licensed under the MIT license. -*/ - -/* -本插件操作 textarea 或者 input 内的插入符 -只实现了获得插入符在文本框中的位置,我设置 -插入符的位置. -*/ - -"use strict"; -var EditableCaret, InputCaret, Mirror, Utils, discoveryIframeOf, methods, oDocument, oFrame, oWindow, pluginName, setContextBy; - -pluginName = 'caret'; - -EditableCaret = (function() { - function EditableCaret($inputor) { - this.$inputor = $inputor; - this.domInputor = this.$inputor[0]; - } - - EditableCaret.prototype.setPos = function(pos) { - return this.domInputor; - }; - - EditableCaret.prototype.getIEPosition = function() { - return this.getPosition(); - }; - - EditableCaret.prototype.getPosition = function() { - var inputor_offset, offset; - offset = this.getOffset(); - inputor_offset = this.$inputor.offset(); - offset.left -= inputor_offset.left; - offset.top -= inputor_offset.top; - return offset; - }; - - EditableCaret.prototype.getOldIEPos = function() { - var preCaretTextRange, textRange; - textRange = oDocument.selection.createRange(); - preCaretTextRange = oDocument.body.createTextRange(); - preCaretTextRange.moveToElementText(this.domInputor); - preCaretTextRange.setEndPoint("EndToEnd", textRange); - return preCaretTextRange.text.length; - }; - - EditableCaret.prototype.getPos = function() { - var clonedRange, pos, range; - if (range = this.range()) { - clonedRange = range.cloneRange(); - clonedRange.selectNodeContents(this.domInputor); - clonedRange.setEnd(range.endContainer, range.endOffset); - pos = clonedRange.toString().length; - clonedRange.detach(); - return pos; - } else if (oDocument.selection) { - return this.getOldIEPos(); - } - }; - - EditableCaret.prototype.getOldIEOffset = function() { - var range, rect; - range = oDocument.selection.createRange().duplicate(); - range.moveStart("character", -1); - rect = range.getBoundingClientRect(); - return { - height: rect.bottom - rect.top, - left: rect.left, - top: rect.top - }; - }; - - EditableCaret.prototype.getOffset = function(pos) { - var clonedRange, offset, range, rect, shadowCaret; - if (oWindow.getSelection && (range = this.range())) { - if (range.endOffset - 1 > 0 && range.endContainer === !this.domInputor) { - clonedRange = range.cloneRange(); - clonedRange.setStart(range.endContainer, range.endOffset - 1); - clonedRange.setEnd(range.endContainer, range.endOffset); - rect = clonedRange.getBoundingClientRect(); - offset = { - height: rect.height, - left: rect.left + rect.width, - top: rect.top - }; - clonedRange.detach(); - } - if (!offset || (offset != null ? offset.height : void 0) === 0) { - clonedRange = range.cloneRange(); - shadowCaret = $(oDocument.createTextNode("|")); - clonedRange.insertNode(shadowCaret[0]); - clonedRange.selectNode(shadowCaret[0]); - rect = clonedRange.getBoundingClientRect(); - offset = { - height: rect.height, - left: rect.left, - top: rect.top - }; - shadowCaret.remove(); - clonedRange.detach(); - } - } else if (oDocument.selection) { - offset = this.getOldIEOffset(); - } - if (offset) { - offset.top += $(oWindow).scrollTop(); - offset.left += $(oWindow).scrollLeft(); - } - return offset; - }; - - EditableCaret.prototype.range = function() { - var sel; - if (!oWindow.getSelection) { - return; - } - sel = oWindow.getSelection(); - if (sel.rangeCount > 0) { - return sel.getRangeAt(0); - } else { - return null; - } - }; - - return EditableCaret; - -})(); - -InputCaret = (function() { - function InputCaret($inputor) { - this.$inputor = $inputor; - this.domInputor = this.$inputor[0]; - } - - InputCaret.prototype.getIEPos = function() { - var endRange, inputor, len, normalizedValue, pos, range, textInputRange; - inputor = this.domInputor; - range = oDocument.selection.createRange(); - pos = 0; - if (range && range.parentElement() === inputor) { - normalizedValue = inputor.value.replace(/\r\n/g, "\n"); - len = normalizedValue.length; - textInputRange = inputor.createTextRange(); - textInputRange.moveToBookmark(range.getBookmark()); - endRange = inputor.createTextRange(); - endRange.collapse(false); - if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) { - pos = len; - } else { - pos = -textInputRange.moveStart("character", -len); - } - } - return pos; - }; - - InputCaret.prototype.getPos = function() { - if (oDocument.selection) { - return this.getIEPos(); - } else { - return this.domInputor.selectionStart; - } - }; - - InputCaret.prototype.setPos = function(pos) { - var inputor, range; - inputor = this.domInputor; - if (oDocument.selection) { - range = inputor.createTextRange(); - range.move("character", pos); - range.select(); - } else if (inputor.setSelectionRange) { - inputor.setSelectionRange(pos, pos); - } - return inputor; - }; - - InputCaret.prototype.getIEOffset = function(pos) { - var h, textRange, x, y; - textRange = this.domInputor.createTextRange(); - pos || (pos = this.getPos()); - textRange.move('character', pos); - x = textRange.boundingLeft; - y = textRange.boundingTop; - h = textRange.boundingHeight; - return { - left: x, - top: y, - height: h - }; - }; - - InputCaret.prototype.getOffset = function(pos) { - var $inputor, offset, position; - $inputor = this.$inputor; - if (oDocument.selection) { - offset = this.getIEOffset(pos); - offset.top += $(oWindow).scrollTop() + $inputor.scrollTop(); - offset.left += $(oWindow).scrollLeft() + $inputor.scrollLeft(); - return offset; - } else { - offset = $inputor.offset(); - position = this.getPosition(pos); - return offset = { - left: offset.left + position.left - $inputor.scrollLeft(), - top: offset.top + position.top - $inputor.scrollTop(), - height: position.height - }; - } - }; - - InputCaret.prototype.getPosition = function(pos) { - var $inputor, at_rect, end_range, format, html, mirror, start_range; - $inputor = this.$inputor; - format = function(value) { - value = value.replace(/<|>|`|"|&/g, '?').replace(/\r\n|\r|\n/g, "