/*
////定义一些全局的变量，暴露编辑器文档对象等等，在所有的脚本插件之前实现////
*/

/*
////编辑器内置对象////
*/
var objApp = window.external;
/*
///编辑器文档对象，就是html文档里面的document对象////
*/
var objEditorDocument = objApp.EditorDocument;
var objEditorWindow = objApp.EditorDocumentWindow;
//var console = objEditorDocument.defaultView.console;
/*
////一个工具类，用来提供更多的本地化功能////
*/
var objTools = objApp.CreateCommonTools();


function Alert(msg) {
    return objApp.ShowMessage(msg, 0);
}


/*

////下面是几个小例子////

////添加一个工具栏按钮，并且相应消息////
function onmybuttonclicked() {
//TP_alert("clicked plugin button");
//objApp.RemoveToolButton("mybuttonid");
var rect = objApp.GetToolButtonRect("mybuttonid");
var arr = rect.split(',');
objApp.ShowSelectorWindow("e:\\1.htm", (parseInt(arr[0]) + parseInt(arr[2])) / 2, arr[3], 100, 100, "");
}
objApp.AddToolButton("mybuttonid", "test", "", "onmybuttonclicked");

////获得插件所在的路径////
var pluginpath =objApp.GetPluginPath("plugin_share.js");
TP_alert(pluginpath);
//
////添加脚本运行////
objApp.AddScript(pluginpath + "test.js");


////监听编辑器文档消息////
function onEditorDocumentClicked(event) {
TP_alert(event.srcElement.tagName + " has been clicked");
}
objEditorDocument.addEventListener("click", onEditorDocumentClicked);

*/
