diff -r 000000000000 -r bca7a7e058a3 src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSONP.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/util/JSONP.js Thu Feb 13 11:43:31 2020 +0100 @@ -0,0 +1,38 @@ +/** + * JSONP.js + * + * Copyright, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://www.tinymce.com/license + * Contributing: http://www.tinymce.com/contributing + */ + +define("tinymce/util/JSONP", [ + "tinymce/dom/DOMUtils" +], function(DOMUtils) { + return { + callbacks: {}, + count: 0, + + send: function(settings) { + var self = this, dom = DOMUtils.DOM, count = settings.count !== undefined ? settings.count : self.count; + var id = 'tinymce_jsonp_' + count; + + self.callbacks[count] = function(json) { + dom.remove(id); + delete self.callbacks[count]; + + settings.callback(json); + }; + + dom.add(dom.doc.body, 'script', { + id: id, + src: settings.url, + type: 'text/javascript' + }); + + self.count++; + } + }; +}); \ No newline at end of file