code collection v0.44 hta_hta

复制代码 代码如下:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>code collection v0.44</title>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<HTA:APPLICATION 
    ID="ttyp's code collection v0.44" 
    APPLICATIONNAME="ttyp's code collection v0.44" 
    VERSION="0.1" 
    SCROLL="no" 
    INNERBORDER="no" 
    CONTEXTMENU="yes" 
    CAPTION="yes" 
    ICON="skin//cc.ico" 
    SHOWINTASKBAR="yes" 
    SINGLEINSTANCE="yes" 
    SYSMENU="yes" 
    WINDOWSTATE="normal"
    NAVIGABLE="yes"
    />
<script language="JavaScript" src="js/xml.js"></script>
<script language="JavaScript" src="js/xmlhttp.js"></script>
<SCRIPT language=JavaScript src="js/skin.js"></script>
<SCRIPT language=JavaScript src="js/progressorbar.js"></script>
<script language="JavaScript" src="js/xtree.js"></script>
<script language="JavaScript" src="js/dom.js"></script>
<script language="JavaScript" src="js/config.js"></script>
<script language="JavaScript" src="js/global.js"></script>
<script language="JavaScript" src="js/highlight.js"></script>
<script language="VbScript" src="js/ts.vbs"></script>
<script language="JavaScript" src="js/autoupdate.js"></script>
<SCRIPT language=JavaScript src="js/dmenu.js"></script>
<SCRIPT language=JavaScript src="js/output.js"></script>
<SCRIPT language=JavaScript src="js/splitbar.js"></script>
<SCRIPT language=JavaScript src="js/search.js"></script>
<SCRIPT language=JavaScript src="js/toolbar.js"></script>
<SCRIPT language=JavaScript src="js/inputfile.js"></script>
<SCRIPT language=JavaScript src="js/createlink.js"></script>
<SCRIPT language=JavaScript src="js/password.js"></script>
<SCRIPT language=JavaScript src="js/chm.js"></script>

<SCRIPT LANGUAGE="JavaScript">

var _designMode=0;
var g_prompt;
var g_window;
var doc;

<!--
function init()
{    

    //定义全局变量
    g_prompt    = new CLASS_PROMPT();
    g_window    = new CLASS_WINDOW();

    var doc        = new CLASS_XML("xml/data.xml")

    //用于直接加载时获得根接点
    var rootXml    = doc.root();
    var root    = getRootNode(rootXml);

    //dom.js
    loadChild(root,rootXml);

    doc.dispose();

    root.setup(document.getElementById("divTree"));    

    bt_newitem.onclick = function(){
        if(Global.selectedNode!=null){
            writeDate(document.frames.fraGeneral,"");
            changeModel(0);

            var o = new Node("新接点","javascript:writeCode()","fraGeneral");
            if(Global.selectedNode.childNodes.length>0&&Global.selectedNode.load==false){
                Global.selectedNode.expand();
                Global.selectedNode.load = false;
            }else{
                Global.selectedNode.load = true;
            }
            Global.selectedNode.add(o);

            o.select();
            o.edit();

            var o_xml    = new CLASS_XML("xml/data.xml");

            var n = o_xml.selectSingleNode("//*[@id=" + o.parent.key + "]");

            var q = o_xml.createElement("item");
                q.setAttribute("name","新接点");
                q.setAttribute("id",o.key);

            n.appendChild(q);

            //保存菜单文件
            o_xml.save();
            o_xml.dispose();

        }else{
            g_prompt.show("请选择要添加的接点栏目");
        }        
    }

    bt_delete.onclick = function(){
        var _o = Global.selectedNode;
        if(_o){
            if(_o.childNodes.length==0){            
                var o_xml    = new CLASS_XML("xml/data.xml");
                var    m        = o_xml.selectSingleNode("//*[@id=" + _o.key + "]");

                if(m!=null&&m.nodeName=="item"){
                    if(confirm("是否真的删除接点[" + _o.text + "]?")){
                        m.parentNode.removeChild(m);

                        o_xml.save();

                        //删除数据文件
                        deleteContent(_o.key);

                        _o.remove();
                    }
                }else{
                    g_prompt.show("根接点不能删除!");
                }

                o_xml.dispose();
            }else{
                g_prompt.show("有子接点不能删除",true);
            }
        }else{
            g_prompt.show("请选择要删除的接点");
        }
    }

    bt_save.onclick = function(){        
        var _o = Global.selectedNode;
        if(_o){        
            //获取文本
            var s = "";
            var t = _o.text;

            switch(_designMode){
                case 0:
                    s = document.frames.fraGeneral.document.documentElement.outerHTML;
                break;
                case 1:
                    s = document.getElementById("editBox").innerText;                    
                break;
                case 2:
                    s = document.frames.fraPreview.document.documentElement.outerHTML;
                default:
                break;
            }

            //保存文本(dom.js)
            if(saveContent(_o.key,t,s)){
                g_prompt.show("[" + _o.text + "]保存成功!");
            }else{
                g_prompt.show("[" + _o.text + "]保存失败!");
            }
        }else{
            g_prompt.show("请选择要保存的接点");
        }
    }

    bt_update.onclick = function(){
        var    auto = new CLASS_AUTOUPDATE("CLASS_AUTOUPDATE",g_window);
            auto.update();

    }

    /*
     *    树接点编辑事件
     */
    Node.prototype.onAfterEdit = function(e,oldText,newText){
        if(oldText!=newText){
            var _o    = Global.selectedNode;
                _o.setText(this.text);

            var o_xml = new CLASS_XML("xml/data.xml");

            var m    = o_xml.selectSingleNode("//*[@id=" + _o.key + "]");
            if(m!=null){
                m.setAttribute("name",this.text);
                m.setAttribute("password",this.password);
                //保存菜单文件
                o_xml.save();

                var data = new CLASS_XML("xml\\" + _o.key + ".xml");
                if(data.error == false){
                    var    title = data.selectSingleNode("//title");

                    if(title!=null){
                        title.setAttribute("value",this.text);
                    }
                    data.save();
                }
                data.dispose();                
            }else{
                document.title = "Error:没有找到接点" + _o.key;
            }

            o_xml.dispose();

            this.select();
        }

    }

    /*
     *    接点拖动事件
     */
    Node.prototype.onDrag = function(from,to){
        var _f = from.path+"";
        var _t = to.path+"";
        if(_f.length<_t.length&&_t.substring(0,_f.length)==_f){
            g_prompt.show("不能移动到子接点");
            return;
        }

        //处理树
        to.moveToChild(from);

        /*
         *开始移动接点
         */        
        var o_xml = new CLASS_XML("xml/data.xml");

        //处理XML
        var o_f = o_xml.selectSingleNode("//*[@id=" + from.key + "]");
        var o_t = o_xml.selectSingleNode("//*[@id=" + to.key + "]");

        o_t.appendChild(o_f);

        o_xml.save();
        o_xml.dispose();

    }

    Node.prototype.onExpand = function(n){
        var o = this;    

        if(!this.load){

            if(this.locked){

                var r = window.showModalDialog("js/password.htm",this.key,"dialogHeight:80px;dialogWidth:250px;");            

                if(typeof(r)=="undefined"||r==0){                    
                    return false;
                }else{            
                    o.locked = false;
                }

                
            }

            this.open    = 1;
            this.load    = true;

            var o_xml    = new CLASS_XML("xml/data.xml");
            var m        = o_xml.selectSingleNode("//*[@id=" + o.key + "]");

            var    f    = o.getFirstChild();            
                f.remove();

            //dom.js
            loadChild(o,m);

            o_xml.dispose();
        } 
        return true;
    }

    document.frames.fraGeneral.document.designMode = "on";

    //创建右键菜单
    var g_rightmenu = new CLASS_RIGHTMENU(document.getElementById("test"),document.getElementById("divTree"),"xml/rightmenu.xml");

    //创建分割条
    var g_splitbar    = new CLASS_SPLITBAR_HORIZON(document.getElementById("divSplit"),document.getElementById("divTree"),document.getElementById("divList"));

    var    auto    = new CLASS_AUTOUPDATE("CLASS_AUTOUPDATE",g_window);
        auto.check();

        CLASS_TOOLBAR.prototype.highlight = doHighlight;
    var g_toolbar    =  new CLASS_TOOLBAR(document.getElementById("cbHead"),document.frames.fraGeneral,g_window);
        g_toolbar.path = skinPath;

    //全局键盘事件
    document.onkeydown = function(e){
        var code,o;

        //兼容ns&ie事件
        if(!e) e = window.event;

        //兼容ns&ie按键
        code = e.which ? e.which : e.keyCode;        

        switch(code){
            case 83:
            case 115:                //ctrl+s
                if(e.ctrlKey){
                    document.getElementById("bt_save").click();
                }
                break;
            case 110:                //ctrl+n
            case 78:
                if(e.ctrlKey){
                    document.getElementById("bt_newitem").click();
                }
                break;
            case 46:                //delete
                if(e.shiftKey){
                    document.getElementById("bt_delete").click();
                }
                break;
            case 81:    //ctrl+q
            case 113:
                if(e.ctrlKey)
                {
                    changeModel(0,true);
                }
                break;
            case 87:    //ctrl+w
            case 119:
                if(e.ctrlKey)
                {
                    changeModel(1,true);
                }
                break;
            case 69:    //ctrl+e,ctrl+b
            case 101:
            case 66:
            case 98:
                if(e.ctrlKey)
                {
                    changeModel(2,true);
                }
                break;
            default:break;
        }
    }

    //开始画面
    about();

}

/*
 *    数据导入导出
 */
function odata(flag){

    var _o    = Global.selectedNode;
    if(_o){
        if(flag){                
            outData(_o);
        }else{
            inData(_o);
        }
    }else{
        g_prompt.show("请选择要操作的接点");
    }
}

/*
 *    重命名接点
 */
function editNode(){
    var _o    = Global.selectedNode;
    if(_o){
        _o.edit();
    }
}

/*
 *    转到连接
 */
function go(url){
    changeModel(2,false);
    document.getElementById("fraPreview").src = url;
}

/*
 *    写正文
 */
function writeCode(id){    

    //获得接点的文本(dom.js)
    var sid;
    if(typeof(id)=="undefined"){
        sid = Global.selectedNode.key;
        if(Global.selectedNode.locked){
            var r = window.showModalDialog("js/password.htm",Global.selectedNode.key,"dialogHeight:80px;dialogWidth:250px;");            
            if(typeof(r)=="undefined"||r==0){                
                Global.selectedNode.unselect();
                return false;
            }else{
                Global.selectedNode.locked = false;    
            }
        }
    }else{
        sid = id;
        //判断id是否是锁定的
    }

    var s= readContent(sid);

    changeModel(2,false);

    writeDate(document.frames.fraPreview,s);
    writeDate(document.frames.fraGeneral,s);
    document.getElementById("editBox").innerText = s;

}

/*
 *    关于
 */
function about(){    
    var doc    = new CLASS_XML("xml\\autoupdate.xml");
    var info= doc.selectNodes("//UpdateInfo");
    var ab    = doc.selectSingleNode("//About");
    var ns    = doc.selectSingleNode("//nextversion");

    var s    = "";
    if(doc.error==false){
        if(ab!=null){
            s += ab.childNodes[0].text;
        }

        for(var i=0;i<info.length;i++){
            //s += "<xmp>" + info[i].childNodes[0].text + "</xmp><br>";
            s += info[i].childNodes[0].text + "";
        }
        if(ns!=null){
            s += ns.childNodes[0].text;
        }        
    }else{
        s    = "读配置文件失败!";
    }
    doc.dispose();

    //切换浏览模式
    changeModel(2,false);

    //写正文
    writeDate(document.frames.fraPreview,s);
    writeDate(document.frames.fraGeneral,s);
    document.getElementById("editBox").innerText = s;
}

/*
 *    写框价数据
 */
function writeDate(fra,data){
    fra.document.close();
    fra.document.write(data);
    fra.document.close();
}

/*
 *    切换浏览模式
 */
function changeModel(n,flag){
    var _dm=parseInt(n);

    document.getElementById("Img_modelBtn").style.pixelTop=_dm*(-15);

    var d = document.getElementById("editBox");
    var g = document.getElementById("fraGeneral");
    var p = document.getElementById("fraPreview");

    var gd= document.frames.fraGeneral.document;
    var pd= document.frames.fraPreview.document;

    var c = document.getElementById("cbHead");

    switch(_dm){
        case 0:    //普通
            d.style.display = "none";
            g.style.display = "";
            p.style.display = "none";
            c.style.display = "";

            if(flag==true){
                writeDate(document.frames.fraGeneral,d.innerText);
            }

        break;
        case 1:    //HTML
            d.style.display = "";
            g.style.display = "none";
            p.style.display = "none";
            c.style.display = "none";

            if(flag==true){
                d.innerText = gd.documentElement.outerHTML;
            }

        break;
        case 2:    //浏览
            d.style.display = "none";
            g.style.display = "none";
            p.style.display = "";
            c.style.display = "none";

            if(flag==true){
                if(_designMode==0){
                    writeDate(document.frames.fraPreview,gd.documentElement.outerHTML);
                    d.innerText = gd.documentElement.outerHTML;
                }
                if(_designMode==1){
                    writeDate(document.frames.fraGeneral,d.innerText);
                    writeDate(document.frames.fraPreview,d.innerText);
                }
            }

        break;
    }

    _designMode = _dm;
}

function editTab(){
    sel    =event.srcElement.document.selection.createRange();
    switch (event.keyCode){
        case 8:
            break
        case 9:
            sel.text = "\t\t\t\t";
             event.returnValue = false;
            break;
        case 13 :
            break;
        default:
            break;
    }
}
//-->
</SCRIPT>
</head>

<body marginleft=0 marginright=0 onload="init()" oncontextmenu="if(event.srcElement.tagName!='TEXTAREA'&&event.srcElement.tagName!='INPUT'&&event.srcElement.contentEditable!='true'){return false;}">
<SCRIPT LANGUAGE="JavaScript">
<!--
    progressorbar.start();
//-->
</SCRIPT>
<DIV id=test style="diaplay:none;position:absolute;"></DIV>
<div id="logoBar" noWrap oncontextmenu ="return false;" onselectstart="return false;"><b>Welcome to <a href='mailto:ttyp@21cn.com'><font color='#ffffff'>ttyp</font></a></b>'s code collection v0.44,and enjoy it:)</div>
<div id="toolBar" noWrap oncontextmenu ="return false;" onselectstart="return false;">
    <a href="#" class="bt_off" id="bt_newitem" hideFocus="true"><div></div>NewItem</a><a href="#" class="bt_off" id="bt_delete" hideFocus="true" style="border-right-width:0px"><div></div>Delete</a><a href="#" class="bt_off" id="bt_save" hideFocus="true" style="border-right-width:1px"><div></div>Save</a>
    <span id="settingBar">
        <a href="#" class="setting" id="bt_update" hideFocus="true" style="border-right:0px">Update</a>
    </span>
</div>
</div>
<div id="divTree" xmlSrc="xml/data.xml"></div>
<div id="divList" onfocus="this.blur();">
    <div id=cbHead style="display:none;"></div>
    <div id="divContent">
        <iframe id="fraGeneral" name="fraGeneral" style="display:none;" frameborder=0 width="100%" height="100%" marginwidth=0 marginheight=0 ></iframe>
        <iframe id="fraPreview" name="fraPreview" style="display:none;" frameborder=0 width="100%" height="100%" marginwidth=0 marginheight=0 ></iframe>
        <div id="editBox" name="editBox" style="width:100%;height:100%;" marginheight="1" marginwidth="1" contenteditable="true" onselectstart="event.cancelBubble=true;" designMode="off" oncontextmenu="return true;" onkeydown="editTab()"></div>
    </div>
    <SPAN STYLE="position:absolute;width:123;height:15;clip: rect(0 123 15 0)" onfocus="this.blur();">
    <IMG ID="Img_modelBtn" style="border:0" SRC="skin/default/img/editmode.gif" STYLE="position:absolute;top:0;left:0" usemap="#MBtnMap">
    </SPAN>
</div>
<div id="divSplit"></div>
<map name="MBtnMap">
<area shape="rect" coords="0, 0, 40, 44"   alt="普通设计模式"    onclick="changeModel(0,true)">
<area shape="rect" coords="41, 0, 81, 44"  alt="HTML原码模式"    onclick="changeModel(1,true)">
<area shape="rect" coords="82, 0, 122, 44" alt="预览模式"        onclick="changeModel(2,true)">
</map>
</body>
</html>
<SCRIPT language=JavaScript src="js/plugin.js"></script>

时间: 2024-10-22 17:01:28

code collection v0.44 hta_hta的相关文章

Creating Collection Classes in C#

Creating Collection Classes in C# IntroductionCollection classes are used frequently in .NET. For example, classes like ArrayList, NamevalueCollection, HashTable are collection classes. One peculiar thing of collection classes is that they can be use

使用gcc的-finstrument-functions选项进行函数跟踪【转】

转自:http://blog.csdn.net/jasonchen_gbd/article/details/44044899 版权声明:本文为博主原创文章,转载请附上原博链接. GCC Function instrumentation机制可以用来跟踪函数的调用关系,在gcc中对应的选项为"-finstrument-functions".可查看gcc的man page来获取更详细信息.编译时如果为gcc加上"-finstrument-functions"选项,那在每个

必虎路由器大量高危漏洞分析

前言 这件事情还得从几个月前说起.有一名叫做Tao Sauvage的老外开开心心的来中国旅游.想着得带点中国的土特产回去,选了半天,选中了一款叫做必虎的无线路由器. 看着这个超低的价格和完美的做工,这个老外感觉自己赚大发了,简直是天赐礼物!249!买不了吃亏!249!买不了上当!必虎的英文翻译叫做"Tiger Will Power",我擦!叼炸天的名字啊!虎之力路由器!感觉身体被掏空!但是因为是国产路由器,谷歌翻译也不准确,他也不懂中文. 怎么办呢?把路由器拆开研究一下看看吧!橙色的地

用javascript操作xml

javascript|xml <script language="JavaScript"><!--var doc = new ActiveXObject("Msxml2.DOMDocument"); //ie5.5+,CreateObject("Microsoft.XMLDOM") //加载文档//doc.load("b.xml"); //创建文件头var p = doc.createProcessingIn

疯掉了,尽然有js写的操作系统_javascript技巧

http://www.masswerk.at/jsuix/ // JS/UIX v0.44 // (c) mass:werk (N.Landsteiner) 2003 // all rights reserved // term gui var conf_term_x=102; var conf_term_y=34; var conf_kbd_offset=34; var termImgPath='jsuix_support/'; var termDiv='termDiv'; var termB

oracle 11.2.0.4 ASM RAC 数据恢复一个例子

这是一个朋友的客户的数据库,数据库出故障之后,无法顺利打开,如下是数据库在open的时候所报的错误: ORA-279 signalled during: ALTER DATABASE RECOVER  database using backup controlfile until cancel  ... ALTER DATABASE RECOVER    CONTINUE DEFAULT Media Recovery Log /space/sys_software/oracle/app/prod

iOS之UI--Quartz2D的入门应用--重绘下载圆形进度条

iOS之重绘下载圆形进度条 开发须知快速预览: 1.关于了解PI的数值: 2.- (void)drawRect:(CGRect)rect 相关: 这个方法只在self对应的控件首次创建系统会执行,为了能够达到重绘的作用, 就需要重新绘制调用这个drawRect方法,但是推荐使用一下方法: rect其实就是self本身,关于self的不变的数据,可以抽取出来优化. 效果展示: 根据效果展示应该能够很快知道需求吧,然后根据需求开始的开发过程: 1.拖拽需要的UI控件,并设置相关的属性 2.创建UIV

Magento1.9.1.0重要改进之一--邮件异步队列发送

In this post I wanted to take a tour through the new functionality in Magento 1.9.1 with regards to sending emails from your store. The astute among you will have noticed there were some changes to email in Magento 1.9.1 from the Magento 1.9.1 releas

我的Java开发学习之旅------&amp;gt;Java利用Comparator接口对多个排序条件进行处理

一需求 二实现Comparator接口 三验证排序结果 验证第一条件首先按级别排序级别最高的排在前面 验证第二条如果级别相等那么按工资排序工资高的排在前面 验证第三条如果工资相当则按入职年数排序入职时间最长的排在前面 附录javautilComparator接口源代码 一.需求 假设现在有个如此的需求:需要对一个这样的雇员列表进行排序,排序规则如下: 1.首先级别最高的排在前面, 2.如果级别相等,那么按工资排序,工资高的排在前面, 3.如果工资相当则按入职年数排序,入职时间最长的排在前面. 雇