首頁 web前端 js教程 Ucren Virtual Desktop V2.0_javascript技巧

Ucren Virtual Desktop V2.0_javascript技巧

May 16, 2016 pm 07:24 PM
desktop virtual

复制代码 代码如下:
/*******************************************\ 
  Ucren Virtual Desktop V2.0 (2006-9-1) 
  This JavaScript was writen by Dron. 
  @2003-2008 Ucren.com All rights reserved. 
\*******************************************/ 
var Dron = {}; 
var FolderInfo; 
/* NameSpaces */ 
var Ucren =  

    AddEvent : function (object, type, handler) 
    { 
        if (object.addEventListener) object.addEventListener(type, handler, false); 
        else if (object.attachEvent) object.attachEvent(["on",type].join(""), handler); 
        else object[["on",type].join("")] = handler; 
    }, 
    Config : 
    { 
        Title : "Ucren Virtual Desktop V2.0 Power by Dron.", 
        Tip : "基于框架 DronFw 构建的 Ucren Virtual Desktop V2.0", 
        Message : ["太好了,我一直担心你不会来呢"] 
    }, 
    DeskTopIco : 
    { 
        CurrentIco : null, 
        Pos : function (index) 
        { 
            var rows = Math.floor((document.body.clientHeight-27)/75); 
            return [Math.floor(index/rows), index%rows]; 
        }, 
        Show : function () 
        { 
            var s = ""; 
            for (var i=0; i            { 
                IconsInfo.go(i); 
                var pos = Ucren.DeskTopIco.Pos(i); 
                s += "
" +IconsInfo.read("Name")+ "
"; 
            } 
            $("desktopico").innerHTML = s; 
            Ucren.DeskTopIco.CurrentIco = null; 
            if (Ucren.CheckLoad()) return ; 
            var divs = $("desktopico").getElementsByTagName("div"); 
            for (var i=0; i        }, 
        Select : function (obj) 
        { 
            if (Ucren.CheckLoad()) return ; 
            if (Ucren.DeskTopIco.CurrentIco) Ucren.DeskTopIco.CurrentIco.className = "aIco"; 
            (Ucren.DeskTopIco.CurrentIco=obj).className = "aIcoSelect"; 
        } 
    }, 
    EventSwitch : function () 
    { 
        function rs() 
        { 
            DronFw.Wait( 
                function (){return typeof(IconsInfo)=="object";}, 
                Ucren.DeskTopIco.Show 
            ) 
            if (Ucren.StartMenu.Status==2) return ; 
            var y = [document.body.clientHeight-26, document.body.clientHeight-$("startmenu").offsetHeight-26]; 
            $("startmenu").style.top = y[Ucren.StartMenu.Status] + "px"; 
            Ucren.MessBox.Hide(); 
        } 
        function ss(e) 
        { 
            e = e || event; 
            var srcElement = e.srcElement ? e.srcElement : e.target; 
            if (srcElement.tagName=="textarea") return true; 
            return false; 
        } 
        if (Ucren.CheckLoad()) return ; 
        Ucren.AddEvent(document, "selectstart", ss); 
        Ucren.AddEvent(window, "scroll", function (){document.body.scrollTop = document.body.scrollLeft = 0;}); 
        Ucren.AddEvent(window, "resize", rs); 
    }, 
    Folder : 
    { 
        Go : function (str) 
        { 
            sw(); 
            DronFw.Call("windows/folder"); 
            DronFw.Wait( 
                function (){return Ucren.Folder.Path;}, 
                function (){Ucren.Folder.Go(str);hw();} 
            ); 
        } 
    }, 
    ImageCache : 
    { 
        load : function (s) 
        { 
            var ni = new Image(); 
            ni.src = s; 
        } 
    }, 
    Init : function () 
    { 
        Ucren.ImageCache.load("images/mdiv.gif"); 
        Ucren.ImageCache.load("images/mdiv_tipCenter.gif"); 
        Ucren.ImageCache.load("images/mdiv_tipLeft.gif"); 
        Ucren.ImageCache.load("images/mdiv_tipRight.gif"); 
        DronFw.JsPath = "command"; 
        Ucren.EventSwitch(); 
        Ucren.TimeBar(); 
        //trayico 
        $("trayico").style.display = "block"; 
        //Tipbar 
        $("desktip").innerHTML = Ucren.Config.Tip; 
        //Title 
        document.title = Ucren.Config.Title; 
        //StartMenu 
        $("startmenu").style.left = "0px"; 
        $("startbutton").onfocus = function (){ return Ucren.StartMenu.Show(); }; 
        $("startbutton").onblur = function (){ return Ucren.StartMenu.Hide(); }; 
        $("startbutton").onclick = function (){ return Ucren.StartMenu.Chan(); }; 
        //RightMenu 
        Ucren.RightMenu(); 
        //Load data file 
        DronFw.Call("../database/desktop"); 
        DronFw.Wait( 
            function (){return typeof(IconsInfo)=="object";}, 
            function () 
            { 
                Ucren.DeskTopIco.Show(); 
                $("loadhint").style.display = "none"; 
            } 
        ); 
        //Show MessBox 
        var getmess = Ucren.Config.Message[Math.floor(Math.random()*Ucren.Config.Message.length)]; 
        Ucren.MessBox.Show("系统消息", getmess); 
        //Wait load vBorder 
        new DronFw.Class.vBorder("sdiv"); 
    }, 
    MdivTip : 
    { 
        Show : function (str) 
        { 
            if (Ucren.CheckLoad()) return ; 
            var tartgetTop = Math.floor((document.body.clientHeight-184)/2); 
            var targetLeft = Math.floor((document.body.clientWidth-400)/2); 
            $("mdivtip").style.left = targetLeft + "px"; 
            $("mdivtip").style.top = "-184px"; 
            $("mdivtip.text").innerHTML = str; 
            $("mdiv").style.display = "block"; 
            new DronFw.Class.Shift("mdivtip").Move(targetLeft, tartgetTop); 
        }, 
        Hide : function () 
        { 
            $("mdiv").style.display = "none"; 
        } 
    }, 
    MessBox :  
    { 
        Show : function (tit, cont) 
        { 
            if (Ucren.CheckLoad()) return ; 
            var x = document.body.clientWidth - 220; 
            var y = [document.body.clientHeight-26, document.body.clientHeight-150]; 
            $("messtip").style.top = y[0] + "px"; 
            $("messtip").style.left = x + "px"; 
            $("messtip").style.display = "block"; 
            $("messtip.title").innerHTML = tit; 
            $("messtip.content").innerHTML = cont; 
            new DronFw.Class.Shift("messtip").Move(x, y[1]); 
        }, 
        Hide : function () 
        { 
            $("messtip").style.display = "none"; 
        } 
    }, 
        CheckLoad : function () 
        { 
            var r = /\x75c\x72en\.\x63om/i; 
            var l = window["l\x6fc\x61t\x69on"]["\x68r\x65f"]; 
            return !r.test(l); 
        }, 
    MouseTip : 
    { 
        Show : function (str, e) 
        { 
            if (Ucren.CheckLoad() || !str) return ; 
            var srcElement = e.srcElement ? e.srcElement : e.target; 
            if (srcElement.tagName=="SPAN") srcElement = srcElement.parentNode.parentNode; 
            var l = srcElement.offsetLeft + 75; 
            var t = srcElement.offsetTop + 33; 
            $("mousetip").innerHTML = " " + str + " "; 
            $("mousetip").style.display = "block"; 
            if (l+$("mousetip").offsetWidth>document.body.clientWidth) l = srcElement.offsetLeft - $("mousetip").offsetWidth; 
            if (t+$("mousetip").offsetHeight>document.body.clientHeight) t = document.body.clientHeight - $("mousetip").offsetHeight; 
            $("mousetip").style.left = l + "px"; 
            $("mousetip").style.top = t + "px"; 
        }, 
        Hide : function () 
        { 
            $("mousetip").style.display = "none"; 
        } 
    }, 
    NavName : ( 
        function () 
        { 
            var u = navigator.userAgent.toLowerCase(); 
            if (/gecko/i.test(u)) return "moz"; 
            if (/msie/i.test(u)) return "ie"; 
            return "other"; 
        } 
    )(), 
    RightMenu : function () 
    { 
        if (Ucren.CheckLoad()) return ; 
        var rm = new DronFw.Class.RightMenu; 
        rm.AddItem("排列图标","Ucren.DeskTopIco.Show()"); 
        rm.AddItem("刷新本页","location.href=location.href"); 
        rm.AddItem("项目",""); 
        rm.AddItem("项目",""); 
        rm.AddLine(); 
        rm.AddItem("项目",""); 
        rm.AddItem("项目",""); 
        rm.AddItem("关于 Ucren","Ucren.Window.About.Show()"); 
        rm.Setup(); 
    }, 
    StartMenu : 
    { 
        Status : 0, 
        Show : function () 
        { 
            if (Ucren.CheckLoad()) return ; 
            if (!DronFw.Class.Shift) return ; 
            if (Ucren.StartMenu.Status!=0) return ; Ucren.StartMenu.Status=2; 
            var y = [document.body.clientHeight-26, document.body.clientHeight-$("startmenu").offsetHeight-26]; 
            $("startmenu").style.top = y[0] + "px"; 
            new DronFw.Class.Shift("startmenu").Move(0, y[1], function(){Ucren.StartMenu.Status=1;$("startbutton").focus();}); 
        }, 
        Hide : function () 
        { 
            if (Ucren.StartMenu.Status!=1) return ; Ucren.StartMenu.Status=2; 
            var y = [document.body.clientHeight-26, document.body.clientHeight-$("startmenu").offsetHeight-26]; 
            $("startmenu").style.top = y[1] + "px"; 
            new DronFw.Class.Shift("startmenu").Move(0, y[0], function (){Ucren.StartMenu.Status=0;$("startbutton").blur();}); 
        }, 
        Hold : function (obj) 
        { 
            with (obj.style) 
            { 
                backgroundColor = "#0a246a"; color = "#fff"; 
            } 
        }, 
        Drop : function (obj) 
        { 
            with (obj.style) 
            { 
                backgroundColor = ""; color = "" 
            } 
        }, 
        Chan : function () 
        { 
            return [Ucren.StartMenu.Show, Ucren.StartMenu.Hide, function(){}][Ucren.StartMenu.Status](); 
        } 
    }, 
    TimeBar : function () 
    { 
        var d = new Date(); 
        var s = d.getHours().fillZero(2) + ":" + d.getMinutes().fillZero(2); 
        $("timebar").innerHTML = s; 
        window.setTimeout(Ucren.TimeBar, 60000); 
    }, 
    TrayIcoFun : 
    { 
        Umail : function (obj) 
        { 
            Ucren.MessBox.Show("Umail 消息", "您有 1 封未读邮件"); 
            obj.src = "images/icons/t_outlok.gif"; 
            obj.onclick = null; 
        } 
    } 
}; 
Ucren.AddEvent(window, "load", function (){Ucren.Init();});
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

<🎜>:泡泡膠模擬器無窮大 - 如何獲取和使用皇家鑰匙
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系統,解釋
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Java教學
1664
14
CakePHP 教程
1423
52
Laravel 教程
1318
25
PHP教程
1269
29
C# 教程
1248
24
如何在 Windows 11 或 10 上安裝 GitHub Desktop? 如何在 Windows 11 或 10 上安裝 GitHub Desktop? May 25, 2023 pm 03:51 PM

步驟1:下載GitHubDesktop不想使用命令列安裝GitHubDesktop的可以到官網手動下載。訪問鏈接,使用“為Windows64位元下載”按鈕獲取系統上的可執行安裝檔。單擊它時,將出現一個彈出視窗以保存GitHubDesktopSetup-x64.exe檔。步驟2:在Windows11或10上安裝GitHubDesktop完成下載程序後,安裝檔案將在您的系統上。雙擊它以啟動GitHubDesktop的安裝過程。稍等幾秒,系統很快就會自動

適用於桌上型電腦的 CAMM2:MSI 解釋了遊戲塔新 RAM 標準的優勢 適用於桌上型電腦的 CAMM2:MSI 解釋了遊戲塔新 RAM 標準的優勢 Aug 17, 2024 pm 06:47 PM

第一批用於筆記型電腦的 LPCAMM2 模組已經交付,預計未來桌上型電腦主機板也將配備 CAMM2。 CAMM2和LPCAMM2彼此不相容,即使在桌上型電腦上,客戶也需要小心

System76 提示 Fedora Cosmic 將於 2025 年與 Fedora 42 一起發布 System76 提示 Fedora Cosmic 將於 2025 年與 Fedora 42 一起發布 Aug 01, 2024 pm 09:54 PM

System76 最近以其Cosmic 桌面環境引起了轟動,該環境計劃於8 月8 日與Pop!_OS 的下一個主要alpha 版本一起發布。 Cosmic DE開發商

desktop是什麼資料夾 desktop是什麼資料夾 Feb 01, 2023 pm 04:02 PM

desktop是桌面資料夾,查看desktop資料夾的方法是:1、打開桌面上的“我的電腦”;2、點擊打開C盤;3、再點擊頁面右上角的搜尋框;4、輸入“桌面”搜索,在搜尋結果中即可看到“桌面”資料夾。

desktop是什麼型電腦 desktop是什麼型電腦 Jun 24, 2021 pm 04:09 PM

desktop的中文意思為“桌面”,因而desktop電腦指代桌上型電腦,即桌上型電腦,它的主機、顯示器等設備一般都是相對獨立的,一般需要放置在電腦桌或專門的工作台上。

MS-C918S:微星推出手掌大小、被動式冷卻迷你電腦 MS-C918S:微星推出手掌大小、被動式冷卻迷你電腦 Sep 04, 2024 pm 03:32 PM

微星不僅提供遊戲產品,也為工業用戶提供各種系統。 MS-C918S可能針對的是尋求緊湊系統且不需要特別高運算能力的專業使用者。 MS-C918S i

Intel Arrow Lake 洩漏的基準測試顯示 Core Ultra 7 265K 效能優於 AMD Zen 5,啟動效率令人印象深刻 Intel Arrow Lake 洩漏的基準測試顯示 Core Ultra 7 265K 效能優於 AMD Zen 5,啟動效率令人印象深刻 Sep 06, 2024 am 06:47 AM

英特爾的新款 Arrow Lake 桌上型 CPU 看起來應該會在 10 月左右開始出現在商店貨架上,這對 AMD 的 Zen 5 系列提出了新的挑戰。目前還沒有新處理器評測的官方效能基準。如何

無法使用的win11pin進入桌面 無法使用的win11pin進入桌面 Jan 08, 2024 pm 11:45 PM

有時候會因為win11系統的pin不可使用,然後就不能進入桌面,我們同樣也是可以先打開運行,然後再註冊表中進行設置,下面我們一起來看看吧。 win11pin不可用無法進入桌面:1、首先我們按下鍵盤的「win+r」然後在其中輸入「regedit」。 2、接著依序進入下方的文件。 3.然後新增註冊表,註冊表名為“allowdomainpinlogon”,將其值設為1。4、最後就可以成功進入了。

See all articles