/** * @version $Id: jce.js 49 2009-05-28 10:02:46Z happynoodleboy $ * @package JCE * @copyright Copyright (C) 2005 - 2009 Ryan Demmer. All rights reserved. * @author Ryan Demmer * @license GNU/GPL * JCE is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. */ if(!tinymce) document.location.href = 'index.php'; //Common scripts for JCE //DOM utilities var Editor = { dom : { doc : document, /* * Shortcut for document.getElementById * @param {string/element} The element id or element * @return {Element} the target element */ get : function(o){ if(typeof o == 'string'){ o = this.doc.getElementById(o); } return o; }, /* * Attribute getter/setter * @param {string/element} The element id or element * @param {string} The attribute name * @param {string} The attribute value * @return {string} Attribute value */ attr : function(o, a, v){ if(typeof v != 'undefined'){ return this.get(o).setAttribute(a, v); } return this.get(o).getAttribute(a); }, value : function(o, v){ var n = this.get(o); if(!n){ return; } if(typeof v != 'undefined'){ if(n.nodeName == 'SELECT'){ return this.setSelect(o, v); } return n.value = v; } if(n.nodeName == 'SELECT'){ return this.getSelect(o); } return n.value; }, style : function(o, s, v){ if(typeof v != 'undefined'){ return this.get(o).style.s = v; } return this.get(o).style.s; }, html : function(o, v){ if(typeof v != 'undefined'){ return this.get(o).innerHTML = v; } return this.get(o).innerHTML; }, ischecked : function(o){ return this.get(o).checked; }, check : function(o, b){ return this.get(o).checked = b; }, disabled : function(o){ return this.get(o).disabled ? true : false; }, disable : function(o, b){ return this.get(o).disabled = b; }, hasClass : function(o, c){ return tinyMCEPopup.dom.hasClass(o, c); }, setClass : function(o, c){ return this.get(o).className = c; }, addClass : function(o, c){ return tinyMCEPopup.dom.addClass(o, c); }, removeClass : function(o, c){ return tinyMCEPopup.dom.removeClass(o, c); }, show : function(o){ this.get(o).style.display = 'block'; }, hide : function(o){ this.get(o).style.display = 'none'; }, getSelect : function(fn, v){ var s = this.get(fn); if(!s){ return; } return s.value; }, /* From TinyMCE form_utils.js function, slightly modified. * @author Moxiecode * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. */ setSelect : function(fn, v, ac, ic){ var s = this.get(fn); if(!s){ return; } var found = false; for (var i=0; i