Add consultation module assets and libraries
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
/* ===========================================================
|
||||
* trumbowyg.pasteimage.js v1.0
|
||||
* Basic base64 paste plugin for Trumbowyg
|
||||
* http://alex-d.github.com/Trumbowyg
|
||||
* ===========================================================
|
||||
* Author : Alexandre Demode (Alex-D)
|
||||
* Twitter : @AlexandreDemode
|
||||
* Website : alex-d.fr
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
$.extend(true, $.trumbowyg, {
|
||||
plugins: {
|
||||
pasteImage: {
|
||||
init: function (trumbowyg) {
|
||||
trumbowyg.pasteHandlers.push(function (pasteEvent) {
|
||||
try {
|
||||
var items = (pasteEvent.originalEvent || pasteEvent).clipboardData.items,
|
||||
mustPreventDefault = false,
|
||||
reader;
|
||||
|
||||
for (var i = items.length - 1; i >= 0; i -= 1) {
|
||||
if (items[i].type.match(/^image\//)) {
|
||||
reader = new FileReader();
|
||||
/* jshint -W083 */
|
||||
reader.onloadend = function (event) {
|
||||
trumbowyg.execCmd('insertImage', event.target.result, false, true);
|
||||
};
|
||||
/* jshint +W083 */
|
||||
reader.readAsDataURL(items[i].getAsFile());
|
||||
|
||||
mustPreventDefault = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (mustPreventDefault) {
|
||||
pasteEvent.stopPropagation();
|
||||
pasteEvent.preventDefault();
|
||||
}
|
||||
} catch (c) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
1
konsultasi/libs/Trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js
vendored
Normal file
1
konsultasi/libs/Trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e){"use strict";e.extend(!0,e.trumbowyg,{plugins:{pasteImage:{init:function(e){e.pasteHandlers.push(function(t){try{for(var a,n=(t.originalEvent||t).clipboardData.items,i=!1,r=n.length-1;r>=0;r-=1)n[r].type.match(/^image\//)&&(a=new FileReader,a.onloadend=function(t){e.execCmd("insertImage",t.target.result,!1,!0)},a.readAsDataURL(n[r].getAsFile()),i=!0);i&&(t.stopPropagation(),t.preventDefault())}catch(o){}})}}}})}(jQuery);
|
||||
Reference in New Issue
Block a user