CPAN-Testers-WWW-Blog

 view release on metacpan or  search on metacpan

vhost/html/js/tiny_mce/plugins/compat2x/editor_plugin_src.js  view on Meta::CPAN

				return tinyMCE.activeEditor ? tinyMCE.activeEditor.dom : tinymce.DOM;
			},

			convertRelativeToAbsoluteURL : function(b, u) {
				return new tinymce.util.URI(b).toAbsolute(u);
			},

			convertAbsoluteURLToRelativeURL : function(b, u) {
				return new tinymce.util.URI(b).toRelative(u);
			}
		});

		// Extend Editor class
		tinymce.extend(tinymce.Editor.prototype, {
			getFocusElement : function() {
				return this.selection.getNode();
			},

			getData : function(n) {
				if (!this.data)
					this.data = [];

				if (!this.data[n])
					this.data[n] = [];

				return this.data[n];
			},

			hasPlugin : function(n) {
				return this.plugins[n] != null;
			},

			getContainerWin : function() {
				return window;
			},

			getHTML : function(raw) {
				return this.getContent({ format : raw ? 'raw' : 'html'});
			},

			setHTML : function(h) {
				this.setContent(h);
			},

			getSel : function() {
				return this.selection.getSel();
			},

			getRng : function() {
				return this.selection.getRng();
			},

			isHidden : function() {
				var s;

				if (!tinymce.isGecko)
					return false;

				s = this.getSel();

				// Weird, wheres that cursor selection?
				return (!s || !s.rangeCount || s.rangeCount == 0);
			},

			translate : function(s) {
				var c = this.settings.language, o;

				if (!s)
					return s;

				o = tinymce.EditorManager.i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {
					return tinymce.EditorManager.i18n[c + '.' + b] || '{#' + b + '}';
				});

				o = o.replace(/{\$lang_([^}]+)\}/g, function(a, b) {
					return tinymce.EditorManager.i18n[c + '.' + b] || '{$lang_' + b + '}';
				});

				return o;
			},

			repaint : function() {
				this.execCommand('mceRepaint');
			}
		});

		// Extend selection
		tinymce.extend(tinymce.dom.Selection.prototype, {
			getSelectedText : function() {
				return this.getContent({format : 'text'});
			},

			getSelectedHTML : function() {
				return this.getContent({format : 'html'});
			},

			getFocusElement : function() {
				return this.getNode();
			},

			selectNode : function(node, collapse, select_text_node, to_start) {
				var t = this;

				t.select(node, select_text_node || 0);

				if (!is(collapse))
					collapse = true;

				if (collapse) {
					if (!is(to_start))
						to_start = true;

					t.collapse(to_start);
				}
			}
		});
	}).call(this);

	// Register plugin
	tinymce.PluginManager.add('compat2x', tinymce.plugins.Compat2x);
})();



( run in 0.896 second using v1.01-cache-2.11-cpan-39bf76dae61 )