tijian_tieying/web/Web/UEditor/dialogs/internal.js

80 lines
2.4 KiB
JavaScript
Raw Normal View History

2025-02-20 12:14:39 +08:00
(function () {
var parent = window.parent;
//dialog<6F><67><EFBFBD><EFBFBD>
dialog = parent.$EDITORUI[window.frameElement.id.replace( /_iframe$/, '' )];
//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>dialog<6F>ı<C4B1><E0BCAD>ʵ<EFBFBD><CAB5>
editor = dialog.editor;
UE = parent.UE;
domUtils = UE.dom.domUtils;
utils = UE.utils;
browser = UE.browser;
ajax = UE.ajax;
$G = function ( id ) {
return document.getElementById( id )
};
//focusԪ<73><D4AA>
$focus = function ( node ) {
setTimeout( function () {
if ( browser.ie ) {
var r = node.createTextRange();
r.collapse( false );
r.select();
} else {
node.focus()
}
}, 0 )
};
utils.loadFile(document,{
href:editor.options.themePath + editor.options.theme + "/dialogbase.css?cache="+Math.random(),
tag:"link",
type:"text/css",
rel:"stylesheet"
});
lang = editor.getLang(dialog.className.split( "-" )[2]);
domUtils.on(window,'load',function () {
var langImgPath = editor.options.langPath + editor.options.lang + "/images/";
//<2F><><EFBFBD>Ծ<EFBFBD>̬<EFBFBD><CCAC>Դ
for ( var i in lang.static ) {
var dom = $G( i );
if(!dom) continue;
var tagName = dom.tagName,
content = lang.static[i];
if(content.src){
//clone
content = utils.extend({},content,false);
content.src = langImgPath + content.src;
}
if(content.style){
content = utils.extend({},content,false);
content.style = content.style.replace(/url\s*\(/g,"url(" + langImgPath)
}
switch ( tagName.toLowerCase() ) {
case "var":
dom.parentNode.replaceChild( document.createTextNode( content ), dom );
break;
case "select":
var ops = dom.options;
for ( var j = 0, oj; oj = ops[j]; ) {
oj.innerHTML = content.options[j++];
}
for ( var p in content ) {
p != "options" && dom.setAttribute( p, content[p] );
}
break;
default :
domUtils.setAttributes( dom, content);
}
}
} );
})();