Sha256: 3e2b792d702c43ab462c0629ec645689638fd2801fa001f6258df638a3c16512
Contents?: true
Size: 1.35 KB
Versions: 11
Compression:
Stored size: 1.35 KB
Contents
/*jslint newcap: true */ /*global inlineAttachment: false, jQuery: false */ /** * jQuery plugin for inline attach * * @param {document} document * @param {window} window * @param {jQuery} $ */ (function(document, window, $) { 'use strict'; inlineAttachment.editors.jquery = {}; /** * Creates a new editor using jQuery */ var editor = function(instance) { var $this = $(instance); return { getValue: function() { return $this.val(); }, insertValue: function(val) { inlineAttachment.util.insertTextAtCursor($this[0], val); }, setValue: function(val) { $this.val(val); } }; }; $.fn.inlineattachment = function(options) { var set = $(this); set.each(function() { var $this = $(this), ed = new editor($this), inlineattach = new inlineAttachment(options, ed); $this.bind({ 'paste': function(e) { inlineattach.onPaste(e.originalEvent); }, 'drop': function(e) { e.stopPropagation(); e.preventDefault(); inlineattach.onDrop(e.originalEvent); }, 'dragenter dragover': function(e) { e.stopPropagation(); e.preventDefault(); } }); }); return this; }; inlineAttachment.editors.jquery.Editor = editor; })(document, window, jQuery);
Version data entries
11 entries across 11 versions & 1 rubygems