Sha256: 1cdb9e72035aba0f2f66ef418c43560a55a11d93cdc6133774ec0a24a10010c1

Contents?: true

Size: 780 Bytes

Versions: 3

Compression:

Stored size: 780 Bytes

Contents

/**
 * JSONP.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
 *
 * 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++;
		}
	};
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spiderfw-1.0.1 apps/core/components/public/js/tinymce/classes/util/JSONP.js
spiderfw-1.0.0 apps/core/components/public/js/tinymce/classes/util/JSONP.js
spiderfw-0.6.39 apps/core/components/public/js/tinymce/classes/util/JSONP.js