├── .installed ├── EzDesk.exe ├── Resources ├── css │ ├── .DS_Store │ └── all-examples.css ├── default_app_logo.png ├── head.png ├── images │ ├── Style-Config.png │ ├── spaces-icon.png │ └── stacks │ │ ├── adobeAcrobat.png │ │ ├── aperture.png │ │ ├── coda.png │ │ ├── finder.png │ │ ├── photoshop.png │ │ ├── safari.png │ │ ├── stack-down.png │ │ └── stack.png ├── index.html ├── js │ ├── ClientService.js │ ├── jquery-1.6.1.min.js │ ├── jquery-ui-1.8.12.custom.min.js │ ├── jquery.ba-postmessage.js │ ├── jquery.iframe.js │ ├── jquery.jqDock.min.js │ └── stackMenu.js └── modules │ ├── circle │ ├── functionimages │ │ ├── Aol-icon.png │ │ ├── Email-icon.png │ │ ├── Misterwong-icon.png │ │ ├── Msn-icon.png │ │ ├── Simpy-icon.png │ │ ├── bg_bg.png │ │ ├── minimain.2.png │ │ ├── minimain.png │ │ └── project-icon.png │ └── minimain.html │ └── taskboard │ ├── css │ └── s.css │ ├── img │ └── i.png │ ├── js │ └── s.js │ └── taskboard.html ├── RunInBrowser.png ├── RunInTitanium.png ├── manifest ├── modules ├── tiapp │ └── 1.1.0 │ │ ├── tiappmodule.dll │ │ └── tiappmodule.dll.manifest ├── ticodec │ └── 1.1.0 │ │ ├── ticodecmodule.dll │ │ └── ticodecmodule.dll.manifest ├── tidatabase │ └── 1.1.0 │ │ ├── tidatabasemodule.dll │ │ └── tidatabasemodule.dll.manifest ├── tifilesystem │ └── 1.1.0 │ │ ├── tifilesystemmodule.dll │ │ ├── tifilesystemmodule.dll.manifest │ │ └── tifilesystemmodule.js ├── timedia │ └── 1.1.0 │ │ ├── timediamodule.dll │ │ └── timediamodule.dll.manifest ├── timonkey │ └── 1.1.0 │ │ ├── timonkeymodule.dll │ │ └── timonkeymodule.dll.manifest ├── tinetwork │ └── 1.1.0 │ │ ├── tinetworkmodule.dll │ │ ├── tinetworkmodule.dll.manifest │ │ ├── tinetworkmodule.js │ │ └── update.html ├── tiplatform │ └── 1.1.0 │ │ ├── tiplatformmodule.dll │ │ └── tiplatformmodule.dll.manifest ├── tiprocess │ └── 1.1.0 │ │ ├── tiprocessmodule.dll │ │ ├── tiprocessmodule.dll.manifest │ │ └── tiprocessmodule.js ├── tiui │ └── 1.1.0 │ │ ├── default.css │ │ ├── jquery-1.3.2.js │ │ ├── tinotification.html │ │ ├── tiuimodule.dll │ │ ├── tiuimodule.dll.manifest │ │ └── ui.js └── tiworker │ └── 1.1.0 │ ├── tiworkermodule.dll │ └── tiworkermodule.dll.manifest ├── readme.txt ├── runtime └── 1.1.0 │ ├── CFLite.dll │ ├── CFLite.resources │ ├── CFCharacterSetBitmaps.bitmap │ ├── CFUniCharPropertyDatabase.data │ ├── CFUnicodeData-L.mapping │ └── Info.plist │ ├── JavaScriptCore.dll │ ├── JavaScriptCore.resources │ └── Info.plist │ ├── PocoCrypto.dll │ ├── PocoData.dll │ ├── PocoFoundation.dll │ ├── PocoNet.dll │ ├── PocoNetSSL.dll │ ├── PocoSQLite.dll │ ├── PocoUtil.dll │ ├── PocoXML.dll │ ├── PocoZip.dll │ ├── SQLite3.dll │ ├── WebKit.dll │ ├── WebKit.resources │ ├── Info.plist │ └── en.lproj │ │ ├── Localizable.strings │ │ └── localizedStrings.js │ ├── cairo.dll │ ├── icudt40.dll │ ├── icuin40.dll │ ├── icuuc40.dll │ ├── kboot.exe │ ├── khost.dll │ ├── khost.dll.manifest │ ├── libcurl.dll │ ├── libeay32.dll │ ├── libpng13.dll │ ├── libxml2.dll │ ├── libxslt.dll │ ├── objc.dll │ ├── pthreadVC2.dll │ ├── rootcert.pem │ ├── ssleay32.dll │ └── zlib1.dll └── tiapp.xml /.installed: -------------------------------------------------------------------------------- 1 | fdsa -------------------------------------------------------------------------------- /EzDesk.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/EzDesk.exe -------------------------------------------------------------------------------- /Resources/css/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/css/.DS_Store -------------------------------------------------------------------------------- /Resources/css/all-examples.css: -------------------------------------------------------------------------------- 1 | * { margin: 0; padding: 0; } 2 | body { font: 13px "Trebuchet MS", Verdana, Helvetica, sans-serif; color: #666; } 3 | 4 | /* ================ STACK #2 ================ */ 5 | .stack2 { position: fixed; top: 28px; right: 40px; } 6 | .stack2 > img { position: relative; cursor: pointer; padding-bottom: 35px; z-index: 2; } 7 | .stack2 ul { list-style: none; position: absolute; top: 7px; cursor: pointer; z-index: 1; } 8 | .stack2 ul li { position: absolute; } 9 | .stack2 ul li img { border: 0; } 10 | .stack2 ul li span { display: none; } 11 | .stack2 .openStack li span { 12 | font-family: "Lucida Grande", Lucida, Verdana, sans-serif; 13 | display:block; 14 | height: 14px; 15 | position:absolute; 16 | top: 17px; 17 | right:60px; 18 | line-height: 14px; 19 | border: 0; 20 | background-color:#000; 21 | padding: 3px 10px; 22 | border-radius: 10px; 23 | -webkit-border-radius: 10px; 24 | -moz-border-radius: 10px; 25 | color: #fcfcfc; 26 | text-align: center; 27 | text-shadow: #000 1px 1px 1px; 28 | opacity: .85; 29 | filter: alpha(opacity = 85); 30 | } 31 | 32 | /* IE Fixes */ 33 | .stack2 { _position: absolute; } 34 | .stack2 ul { _z-index:-1; _top:-15px; } 35 | .stack2 ul li { *right:5px; } -------------------------------------------------------------------------------- /Resources/default_app_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/default_app_logo.png -------------------------------------------------------------------------------- /Resources/head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/head.png -------------------------------------------------------------------------------- /Resources/images/Style-Config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/images/Style-Config.png -------------------------------------------------------------------------------- /Resources/images/spaces-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/images/spaces-icon.png -------------------------------------------------------------------------------- /Resources/images/stacks/adobeAcrobat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/images/stacks/adobeAcrobat.png -------------------------------------------------------------------------------- /Resources/images/stacks/aperture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/images/stacks/aperture.png -------------------------------------------------------------------------------- /Resources/images/stacks/coda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/images/stacks/coda.png -------------------------------------------------------------------------------- /Resources/images/stacks/finder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/images/stacks/finder.png -------------------------------------------------------------------------------- /Resources/images/stacks/photoshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/images/stacks/photoshop.png -------------------------------------------------------------------------------- /Resources/images/stacks/safari.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/images/stacks/safari.png -------------------------------------------------------------------------------- /Resources/images/stacks/stack-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/images/stacks/stack-down.png -------------------------------------------------------------------------------- /Resources/images/stacks/stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/images/stacks/stack.png -------------------------------------------------------------------------------- /Resources/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 61 | 62 | 63 |
64 | stack 65 | 70 |
71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Resources/js/ClientService.js: -------------------------------------------------------------------------------- 1 | function GetClientService() { 2 | try { 3 | var currentWindow = Titanium.UI.getCurrentWindow(); 4 | desktopClient.setTopMost(true); 5 | desktopClient.createTray(); 6 | return desktopClient; 7 | } 8 | catch (exp) { 9 | return webClient; 10 | } 11 | } 12 | 13 | function getDesireRectangle() 14 | { 15 | var screenWidth = document.documentElement.clientWidth; 16 | var screenHeight = document.documentElement.clientHeight; 17 | 18 | var desireWidth = 1024; 19 | var desireheight = 768; 20 | 21 | var left = ((screenWidth - desireWidth) / 2 - 100 ) > 0? (screenWidth - desireWidth) / 2 - 100 : 50; 22 | var top = ((screenHeight - desireheight) / 2 - 100 ) > 0? (screenHeight - desireheight) / 2 - 100 : 30; 23 | var desireX = left + ((Math.random() > 0.5) ? 15 : -15); 24 | var desireY = top + ((Math.random() > 0.5) ? 15 : -15); 25 | 26 | return { 27 | width:desireWidth, 28 | height:desireheight, 29 | desireX:desireX, 30 | desireY:desireY 31 | }; 32 | } 33 | 34 | var desktopClient = { 35 | newWindow: function (url) { 36 | var desireRectangle = getDesireRectangle(); 37 | 38 | setTimeout(function(){ 39 | try 40 | { 41 | var newWindow = Titanium.UI.createWindow({ 42 | id: "propertyWindow", 43 | url: url, 44 | title:"EzDesk Ultimate", 45 | x: desireRectangle.desireX, 46 | y: desireRectangle.desireY, 47 | width: desireRectangle.width, 48 | minWidth: 480, 49 | height: desireRectangle.height, 50 | minHeight: 360, 51 | maximizable: true, 52 | minimizable: true, 53 | closeable: true, 54 | resizable: true, 55 | fullscreen: false, 56 | maximized: false, 57 | minimized: false, 58 | usingChrome: true, 59 | topMost: false, 60 | visible: true, 61 | transparentBackground: false, 62 | transparency: false 63 | }); 64 | 65 | newWindow.open(); 66 | newWindow.show(); 67 | newWindow.setTitle("EzDesk Ultimate"); 68 | } 69 | catch(exp) 70 | { 71 | alert(exp); 72 | } 73 | 74 | },100); 75 | 76 | }, 77 | setTopMost: function (value) { 78 | Titanium.UI.getCurrentWindow().setTopMost(value); 79 | }, 80 | createTray: function () { 81 | _self = this; 82 | 83 | var tray = Titanium.UI.addTray('app://head.png'); 84 | var menu = Titanium.UI.createMenu(); 85 | 86 | menu.appendItem(Titanium.UI.createMenuItem('DoSomething', function () { console.log('DoSomething'); alert("DoSomething!"); $.postMessage('DoSomething', '*', parent); } )); 87 | menu.appendItem(Titanium.UI.createMenuItem('置顶', function () { _self.setTopMost(true);})); 88 | menu.appendItem(Titanium.UI.createMenuItem('不置顶', function () { _self.setTopMost(false);})); 89 | menu.appendItem(Titanium.UI.createMenuItem('显示', function () { 90 | _self.showCurrentWindow(); 91 | })); 92 | menu.appendItem(Titanium.UI.createMenuItem('隐藏', function () { _self.hideCurrentWindow();})); 93 | menu.appendItem(Titanium.UI.createMenuItem('退出', function () { Titanium.App.exit(); })); 94 | 95 | tray.setMenu(menu); 96 | tray.setHint("易得桌面"); 97 | return tray; 98 | }, 99 | hideCurrentWindow: function() 100 | { 101 | Titanium.UI.getCurrentWindow().hide(); 102 | }, 103 | showCurrentWindow:function() 104 | { 105 | Titanium.UI.getCurrentWindow().show(); 106 | }, 107 | }; 108 | 109 | var webClient = { 110 | newWindow: function (url) { 111 | var desireRectangle = getDesireRectangle(); 112 | 113 | 114 | var iframe = document.createElement('iframe'); 115 | iframe.src = url; 116 | iframe.width = desireRectangle.width; 117 | iframe.height = desireRectangle.height; 118 | iframe.frameborder = 'no'; 119 | iframe.border = '0px;'; 120 | $('body').append(iframe); 121 | $(iframe).css({ 'position': 'absolute', 'float': 'left', 'top': desireRectangle.desireY, 'left': desireRectangle.desireX }); 122 | }, 123 | setTopMost: function (value) { 124 | return; 125 | }, 126 | createTray: function () { 127 | return; 128 | }, 129 | hideCurrentWindow: function() 130 | { 131 | return; 132 | }, 133 | showCurrentWindow:function() 134 | { 135 | return; 136 | }, 137 | }; -------------------------------------------------------------------------------- /Resources/js/jquery.ba-postmessage.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery postMessage - v0.5 - 9/11/2009 3 | * http://benalman.com/projects/jquery-postmessage-plugin/ 4 | * 5 | * Copyright (c) 2009 "Cowboy" Ben Alman 6 | * Dual licensed under the MIT and GPL licenses. 7 | * http://benalman.com/about/license/ 8 | */ 9 | 10 | // Script: jQuery postMessage: Cross-domain scripting goodness 11 | // 12 | // *Version: 0.5, Last updated: 9/11/2009* 13 | // 14 | // Project Home - http://benalman.com/projects/jquery-postmessage-plugin/ 15 | // GitHub - http://github.com/cowboy/jquery-postmessage/ 16 | // Source - http://github.com/cowboy/jquery-postmessage/raw/master/jquery.ba-postmessage.js 17 | // (Minified) - http://github.com/cowboy/jquery-postmessage/raw/master/jquery.ba-postmessage.min.js (0.9kb) 18 | // 19 | // About: License 20 | // 21 | // Copyright (c) 2009 "Cowboy" Ben Alman, 22 | // Dual licensed under the MIT and GPL licenses. 23 | // http://benalman.com/about/license/ 24 | // 25 | // About: Examples 26 | // 27 | // This working example, complete with fully commented code, illustrates one 28 | // way in which this plugin can be used. 29 | // 30 | // Iframe resizing - http://benalman.com/code/projects/jquery-postmessage/examples/iframe/ 31 | // 32 | // About: Support and Testing 33 | // 34 | // Information about what version or versions of jQuery this plugin has been 35 | // tested with and what browsers it has been tested in. 36 | // 37 | // jQuery Versions - 1.3.2 38 | // Browsers Tested - Internet Explorer 6-8, Firefox 3, Safari 3-4, Chrome, Opera 9. 39 | // 40 | // About: Release History 41 | // 42 | // 0.5 - (9/11/2009) Improved cache-busting 43 | // 0.4 - (8/25/2009) Initial release 44 | 45 | (function($){ 46 | '$:nomunge'; // Used by YUI compressor. 47 | 48 | // A few vars used in non-awesome browsers. 49 | var interval_id, 50 | last_hash, 51 | cache_bust = 1, 52 | 53 | // A var used in awesome browsers. 54 | rm_callback, 55 | 56 | // A few convenient shortcuts. 57 | window = this, 58 | FALSE = !1, 59 | 60 | // Reused internal strings. 61 | postMessage = 'postMessage', 62 | addEventListener = 'addEventListener', 63 | 64 | p_receiveMessage, 65 | 66 | // I couldn't get window.postMessage to actually work in Opera 9.64! 67 | has_postMessage = window[postMessage] && !$.browser.opera; 68 | 69 | // Method: jQuery.postMessage 70 | // 71 | // This method will call window.postMessage if available, setting the 72 | // targetOrigin parameter to the base of the target_url parameter for maximum 73 | // security in browsers that support it. If window.postMessage is not available, 74 | // the target window's location.hash will be used to pass the message. If an 75 | // object is passed as the message param, it will be serialized into a string 76 | // using the jQuery.param method. 77 | // 78 | // Usage: 79 | // 80 | // > jQuery.postMessage( message, target_url [, target ] ); 81 | // 82 | // Arguments: 83 | // 84 | // message - (String) A message to be passed to the other frame. 85 | // message - (Object) An object to be serialized into a params string, using 86 | // the jQuery.param method. 87 | // target_url - (String) The URL of the other frame this window is 88 | // attempting to communicate with. This must be the exact URL (including 89 | // any query string) of the other window for this script to work in 90 | // browsers that don't support window.postMessage. 91 | // target - (Object) A reference to the other frame this window is 92 | // attempting to communicate with. If omitted, defaults to `parent`. 93 | // 94 | // Returns: 95 | // 96 | // Nothing. 97 | 98 | $[postMessage] = function( message, target_url, target ) { 99 | if ( !target_url ) { return; } 100 | 101 | // Serialize the message if not a string. Note that this is the only real 102 | // jQuery dependency for this script. If removed, this script could be 103 | // written as very basic JavaScript. 104 | message = typeof message === 'string' ? message : $.param( message ); 105 | 106 | // Default to parent if unspecified. 107 | target = target || parent; 108 | 109 | if ( has_postMessage ) { 110 | // The browser supports window.postMessage, so call it with a targetOrigin 111 | // set appropriately, based on the target_url parameter. 112 | target[postMessage]( message, target_url.replace( /([^:]+:\/\/[^\/]+).*/, '$1' ) ); 113 | 114 | } else if ( target_url ) { 115 | // The browser does not support window.postMessage, so set the location 116 | // of the target to target_url#message. A bit ugly, but it works! A cache 117 | // bust parameter is added to ensure that repeat messages trigger the 118 | // callback. 119 | target.location = target_url.replace( /#.*$/, '' ) + '#' + (+new Date) + (cache_bust++) + '&' + message; 120 | } 121 | }; 122 | 123 | // Method: jQuery.receiveMessage 124 | // 125 | // Register a single callback for either a window.postMessage call, if 126 | // supported, or if unsupported, for any change in the current window 127 | // location.hash. If window.postMessage is supported and source_origin is 128 | // specified, the source window will be checked against this for maximum 129 | // security. If window.postMessage is unsupported, a polling loop will be 130 | // started to watch for changes to the location.hash. 131 | // 132 | // Note that for simplicity's sake, only a single callback can be registered 133 | // at one time. Passing no params will unbind this event (or stop the polling 134 | // loop), and calling this method a second time with another callback will 135 | // unbind the event (or stop the polling loop) first, before binding the new 136 | // callback. 137 | // 138 | // Also note that if window.postMessage is available, the optional 139 | // source_origin param will be used to test the event.origin property. From 140 | // the MDC window.postMessage docs: This string is the concatenation of the 141 | // protocol and "://", the host name if one exists, and ":" followed by a port 142 | // number if a port is present and differs from the default port for the given 143 | // protocol. Examples of typical origins are https://example.org (implying 144 | // port 443), http://example.net (implying port 80), and http://example.com:8080. 145 | // 146 | // Usage: 147 | // 148 | // > jQuery.receiveMessage( callback [, source_origin ] [, delay ] ); 149 | // 150 | // Arguments: 151 | // 152 | // callback - (Function) This callback will execute whenever a 153 | // message is received, provided the source_origin matches. If callback is 154 | // omitted, any existing receiveMessage event bind or polling loop will be 155 | // canceled. 156 | // source_origin - (String) If window.postMessage is available and this value 157 | // is not equal to the event.origin property, the callback will not be 158 | // called. 159 | // source_origin - (Function) If window.postMessage is available and this 160 | // function returns false when passed the event.origin property, the 161 | // callback will not be called. 162 | // delay - (Number) An optional zero-or-greater delay in milliseconds at 163 | // which the polling loop will execute (for browser that don't support 164 | // window.postMessage). If omitted, defaults to 100. 165 | // 166 | // Returns: 167 | // 168 | // Nothing! 169 | 170 | $.receiveMessage = p_receiveMessage = function( callback, source_origin, delay ) { 171 | if ( has_postMessage ) { 172 | // Since the browser supports window.postMessage, the callback will be 173 | // bound to the actual event associated with window.postMessage. 174 | 175 | if ( callback ) { 176 | // Unbind an existing callback if it exists. 177 | rm_callback && p_receiveMessage(); 178 | 179 | // Bind the callback. A reference to the callback is stored for ease of 180 | // unbinding. 181 | rm_callback = function(e) { 182 | if ( ( typeof source_origin === 'string' && e.origin !== source_origin ) 183 | || ( $.isFunction( source_origin ) && source_origin( e.origin ) === FALSE ) ) { 184 | return FALSE; 185 | } 186 | callback( e ); 187 | }; 188 | } 189 | 190 | if ( window[addEventListener] ) { 191 | window[ callback ? addEventListener : 'removeEventListener' ]( 'message', rm_callback, FALSE ); 192 | } else { 193 | window[ callback ? 'attachEvent' : 'detachEvent' ]( 'onmessage', rm_callback ); 194 | } 195 | 196 | } else { 197 | // Since the browser sucks, a polling loop will be started, and the 198 | // callback will be called whenever the location.hash changes. 199 | 200 | interval_id && clearInterval( interval_id ); 201 | interval_id = null; 202 | 203 | if ( callback ) { 204 | delay = typeof source_origin === 'number' 205 | ? source_origin 206 | : typeof delay === 'number' 207 | ? delay 208 | : 100; 209 | 210 | interval_id = setInterval(function(){ 211 | var hash = document.location.hash, 212 | re = /^#?\d+&/; 213 | if ( hash !== last_hash && re.test( hash ) ) { 214 | last_hash = hash; 215 | callback({ data: hash.replace( re, '' ) }); 216 | } 217 | }, delay ); 218 | } 219 | } 220 | }; 221 | 222 | })(jQuery); 223 | -------------------------------------------------------------------------------- /Resources/js/jquery.iframe.js: -------------------------------------------------------------------------------- 1 | /* 2 | * IFrame Loader Plugin for JQuery 3 | * - Notifies your event handler when iframe has finished loading 4 | * - Your event handler receives loading duration (as well as iframe) 5 | * - Optionally calls your timeout handler 6 | * 7 | * http://project.ajaxpatterns.org/jquery-iframe 8 | * 9 | * The MIT License 10 | * 11 | * Copyright (c) 2009, Michael Mahemoff 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | 32 | (function($) { 33 | 34 | var timer; 35 | 36 | $.fn.src = function(url, onLoad, options) { 37 | setIFrames($(this), onLoad, options, function() { 38 | this.src = url; 39 | }); 40 | return $(this); 41 | } 42 | 43 | $.fn.squirt = function(content, onLoad, options) { 44 | 45 | setIFrames($(this), onLoad, options, function() { 46 | var doc = this.contentDocument || this.contentWindow.document; 47 | doc.open(); 48 | doc.writeln(content); 49 | doc.close(); 50 | }); 51 | return this; 52 | 53 | } 54 | 55 | function setIFrames(iframes, onLoad, options, iFrameSetter) { 56 | iframes.each(function() { 57 | if (this.tagName=="IFRAME") setIFrame(this, onLoad, options, iFrameSetter); 58 | }); 59 | } 60 | 61 | function setIFrame(iframe, onLoad, options, iFrameSetter) { 62 | 63 | var iframe; 64 | iframe.onload = null; 65 | if (timer) clearTimeout(timer); 66 | 67 | var defaults = { 68 | timeoutDuration: 0, 69 | timeout: null, 70 | } 71 | var opts = $.extend(defaults, options); 72 | if (opts.timeout && !opts.timeoutDuration) opts.timeoutDuration = 60000; 73 | 74 | opts.frameactive = true; 75 | var startTime = (new Date()).getTime(); 76 | if (opts.timeout) { 77 | var timer = setTimeout(function() { 78 | opts.frameactive=false; 79 | iframe.onload=null; 80 | if (opts.timeout) opts.timeout(iframe, opts.timeout); 81 | }, opts.timeoutDuration); 82 | }; 83 | 84 | var onloadHandler = function() { 85 | var duration=(new Date()).getTime()-startTime; 86 | if (timer) clearTimeout(timer); 87 | if (onLoad && opts.frameactive) onLoad.apply(iframe,[duration]); 88 | opts.frameactive=false; 89 | } 90 | iFrameSetter.apply(iframe); 91 | iframe.onload = onloadHandler; 92 | opts.completeReadyStateChanges=0; 93 | iframe.onreadystatechange = function() { // IE ftw 94 | if (++(opts.completeReadyStateChanges)==3) onloadHandler(); 95 | } 96 | 97 | return iframe; 98 | 99 | }; 100 | 101 | })(jQuery); -------------------------------------------------------------------------------- /Resources/js/jquery.jqDock.min.js: -------------------------------------------------------------------------------- 1 | /*jQuery plugin : jqDock v1.2 */ 2 | ;(function($){if(!$.fn.jqDock){var jqDock=function(){return{version:1.2,defaults:{size:36,distance:54,coefficient:1.5,duration:500,align:'bottom',labels:false,source:false,loader:null},useJqLoader:$.browser.opera||$.browser.safari,shrinkInterval:100,docks:[],X:0,Y:0,verthorz:{v:{wh:'height',xy:'Y',tl:'top',lead:'Top',trail:'Bottom',act:'ActualInv'},h:{wh:'width',xy:'X',tl:'left',lead:'Left',trail:'Right',act:'Actual'}},elementCss:{position:'relative',borderWidth:0,borderStyle:'none',verticalAlign:'top'},vanillaDiv:'
',initDock:function(id){var ME=this,Dock=this.docks[id],op=Dock.Opts,off=0,AI=$('a, img',Dock.Menu),i=0,j,el,wh,acc,upad,opPre95=($.browser.opera&&(1*($.browser.version.match(/^(\d+\.\d+)/)||[0,0])[1])<9.5);this.removeText(Dock.Menu);if(op.orient.vh=='h'){AI.css(this.elementCss);if(opPre95||!$.boxModel){AI.filter('a').css({lineHeight:0,fontSize:'0px'})}else{var hcss={display:'block'};hcss['float']='left';AI.filter('img').css(hcss)}}else{AI.not($('a img',Dock.Menu)).wrap(this.vanillaDiv+'
').end().css(this.elementCss).css({display:'block'})}while(i'].join('');Dock.Yard=$(Dock.Menu).wrapInner(wrap).find('div.jqDock');$.each([op.vh.lead,op.vh.trail],function(n,v){Dock.Borders[v]=ME.asNumber(Dock.Yard.css('border'+v+'Width'))});if(Dock.Borders[op.vh.lead]){Dock.Yard.css(op.vh.tl,Math.ceil(Dock.Borders[op.vh.lead]/2))}while(i').hide().bind('click',function(){Dock.Elem[Dock.Current].Img.trigger('click')}).appendTo(Dock.Yard)}if(label.txt){Dock.Label.text(label.txt);$.each(['Top','Right','Bottom','Left'],function(n,v){pad[v]=ME.asNumber(Dock.Label.css('padding'+v))});$.each(this.verthorz,function(vh,o){label[o.wh]=Dock.Label[o.wh]();label[o.wh+'Pad']=pad[o.lead]+pad[o.trail]})}},doLabel:function(id,off){var Dock=this.docks[id];if(Dock.Opts.labels&&Dock.Current!==false){var el=Dock.Elem[Dock.Current],L=el.Label,op=Dock.Opts,what=typeof off=='string'?off:'move';switch(what){case'show':case'hide':Dock.Label[L.txt?what:'hide']();break;case'change':Dock.Label[0].className=Dock.Label[0].className.replace(/(jqDockLabel)(Link|Image)/,'$1'+(el.Linked?'Link':'Image'));Dock.Label.text(L.txt).css({width:L.width,height:L.height}).hide();break;default:var doff=Dock.Yard.offset(),css={top:off.top-doff.top,left:off.left-doff.left},splt=op.labels.split('');if(splt[0]=='m'){css.top+=Math.floor((el[op.vh.inv.act]-L.height-L.heightPad)/2)}else if(splt[0]=='b'){css.top+=el[op.vh.inv.act]+el.Pad.Top+el.Pad.Bottom-L.height-L.heightPad}if(splt[1]=='c'){css.left+=Math.floor((el[op.vh.act]-L.width-L.widthPad)/2)}else if(splt[1]=='r'){css.left+=el[op.vh.act]+el.Pad.Left+el.Pad.Right-L.width-L.widthPad}Dock.Label.css(css)}}},mouseHandler:function(e){var r=null,t=e.target.className.match(/jqDockMouse(\d+)_(\d+)/),rt=!!(e.relatedTarget)&&e.relatedTarget.tagName!==undefined;if(t){r=false;var id=1*t[1],Dock=this.docks[id],idx=t[2]=='00'?Dock.Current:1*t[2];this.X=e.pageX;this.Y=e.pageY;if(e.type=='mousemove'){if(idx==Dock.Current){this.deltaXY(id);if(Dock.OnDock&&Dock.Expanded){this.setSizes(id);this.factorSizes(id)}}}else{var rel=rt&&e.relatedTarget.className.match(/jqDockMouse(\d+)_(\d+)/);if(e.type=='mouseover'&&(!Dock.OnDock||idx!==Dock.Current)){Dock.Current=idx;this.doLabel(id,'change');this.deltaXY(id);if(Dock.Expanded){this.doLabel(id,'show')}if(rt&&(!rel||rel[1]!=id)){Dock.Timestamp=(new Date()).getTime();this.setSizes(id);Dock.OnDock=true;this.overDock(id)}}else if(rt&&e.type=='mouseout'){if(!rel||rel[1]!=id){Dock.OnDock=false;this.doLabel(id,'hide');var i=Dock.Elem.length;while((i--)){Dock.Elem[i].Final=Dock.Elem[i].Intial}this.offDock(id)}}}}return r},overDock:function(id){var Dock=this.docks[id];if(Dock.OnDock){var ME=this,el=Dock.Elem,i=el.length;while((i--)&&!(el[i].Actualel.Initial){sz=el.Actual-el.ShrinkStep;if(sz>el.Initial){done=false}else{sz=el.Initial}this.changeSize(id,i,sz)}}this.deltaXY(id);if(done){while(i=op.duration){Dock.Timestamp=0}}if(lapse>60){var f=lapse=Dock.Elem.length){setTimeout(function(){jqDock.initDock(id)},0)}};if(jqld){$('').bind('load',iLoaded).attr({src:this.Source[1]})}else{var pre=new Image();pre.onload=function(){iLoaded.call(this);pre.onload=function(){}};pre.src=this.Source[1]}})}).end()};$.jqDock=function(x){return jqDock[x]?jqDock[x]:null}}})(jQuery); 3 | 4 | -------------------------------------------------------------------------------- /Resources/js/stackMenu.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | // Stack initialize 3 | var openspeed = 300; 4 | var closespeed = 300; 5 | $('.stack2>img').toggle(function(){ 6 | var vertical = 0; 7 | var horizontal = 0; 8 | var $el=$(this); 9 | $el.next().children().each(function(){ 10 | $(this).animate({top: vertical + 'px', left: horizontal + 'px'}, openspeed); 11 | vertical = vertical + 55; 12 | horizontal = (horizontal+.75)*2; 13 | }); 14 | $el.next().animate({top: '40px', left: '10px'}, openspeed).addClass('openStack') 15 | .find('li a>img').animate({width: '50px', marginLeft: '9px'}, openspeed); 16 | $el.animate({paddingBottom: '0'}); 17 | }, function(){ 18 | //reverse above 19 | var $el=$(this); 20 | $el.next().removeClass('openStack').children('li').animate({top: '-33px', left: '-10px'}, closespeed); 21 | $el.next().find('li a>img').animate({width: '79px', marginLeft: '0'}, closespeed); 22 | $el.animate({paddingBottom: '35px'}); 23 | }); 24 | 25 | // Stacks additional animation 26 | $('.stack2 li a').hover(function(){ 27 | $("img",this).animate({width: '56px'}, 100); 28 | $("span",this).animate({marginRight: '30px'}); 29 | },function(){ 30 | $("img",this).animate({width: '50px'}, 100); 31 | $("span",this).animate({marginRight: '0'}); 32 | }); 33 | }); -------------------------------------------------------------------------------- /Resources/modules/circle/functionimages/Aol-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/modules/circle/functionimages/Aol-icon.png -------------------------------------------------------------------------------- /Resources/modules/circle/functionimages/Email-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/modules/circle/functionimages/Email-icon.png -------------------------------------------------------------------------------- /Resources/modules/circle/functionimages/Misterwong-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/modules/circle/functionimages/Misterwong-icon.png -------------------------------------------------------------------------------- /Resources/modules/circle/functionimages/Msn-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/modules/circle/functionimages/Msn-icon.png -------------------------------------------------------------------------------- /Resources/modules/circle/functionimages/Simpy-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/modules/circle/functionimages/Simpy-icon.png -------------------------------------------------------------------------------- /Resources/modules/circle/functionimages/bg_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/modules/circle/functionimages/bg_bg.png -------------------------------------------------------------------------------- /Resources/modules/circle/functionimages/minimain.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/modules/circle/functionimages/minimain.2.png -------------------------------------------------------------------------------- /Resources/modules/circle/functionimages/minimain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/modules/circle/functionimages/minimain.png -------------------------------------------------------------------------------- /Resources/modules/circle/functionimages/project-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/modules/circle/functionimages/project-icon.png -------------------------------------------------------------------------------- /Resources/modules/circle/minimain.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 99 | 100 | 101 | 102 | 188 | 189 | 190 |
191 | 192 | 193 |
194 | 195 | -------------------------------------------------------------------------------- /Resources/modules/taskboard/css/s.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Hai! 3 | * 4 | * This is a style-sheet that makes Taskboard 10k look pretty. 5 | * At least I hope it does. 6 | * 7 | * I'm really glad that anyone is interested what I've done here :) 8 | * It was quite fun to play with HTML5 and bits of CSS3 to making it 9 | * all fit into 10k. 10 | * 11 | * ==================================================================== 12 | * 13 | * TABLE OF CONTENTS: 14 | * 15 | * -- Generic styles (basic reset) 16 | * 17 | * -- Card styles [section.card] 18 | * ---- Card colors 19 | * ---- Special card states 20 | * ---- Card text 21 | * 22 | * -- Tags [span.tag] 23 | * 24 | * -- Action toolbars [menu] 25 | * ---- Action icons 26 | * 27 | * -- Deck with new cards [aside#deck] 28 | * 29 | * -- Footer [footer] 30 | * 31 | */ 32 | 33 | 34 | /* 35 | * Generic styles (basic reset) 36 | * ============================== 37 | */ 38 | 39 | html, body, 40 | section, aside, menu, footer, 41 | div, h2, p, ul, li, 42 | span, a { margin: 0; padding: 0 } 43 | 44 | ul, li { list-style: none } 45 | 46 | section, aside, menu, footer { display: block } /* -- make sure HTML5 elements are blocks */ 47 | 48 | body { font-family: georgia, times, serif; } 49 | 50 | a { outline: 0; color: #05C; } 51 | 52 | 53 | /* 54 | * Card styles 55 | * ============= 56 | */ 57 | 58 | .card { 59 | position: absolute; 60 | 61 | width: 284px; 62 | min-height: 50px; 63 | padding: 7px; 64 | 65 | background: #FC3; 66 | border: 1px solid #FD5; 67 | 68 | -moz-border-radius: 5px; 69 | -webkit-border-radius: 5px; 70 | border-radius: 5px; 71 | 72 | -moz-box-shadow: 3px 3px 5px rgba(0,0,0,.2); /* -- repeating rgba shadow color 3 times */ 73 | -webkit-box-shadow: 3px 3px 5px rgba(0,0,0,.2); /* is not very nice when you count every byte */ 74 | box-shadow: 3px 3px 5px rgba(0,0,0,.2); /* so this is shortest value possible ;) */ 75 | 76 | /* cursor: url(grab.cur); -- custom cursors are nice, but the they weight too much for 10k */ 77 | cursor: -moz-grab; /* lucky that at least Firefox defines drag & drop cursors :) */ 78 | } 79 | 80 | .edit .card { cursor: default; } /* -- when in edit mode don't show drag & drop cursor */ 81 | 82 | /* Card colors 83 | ------------- */ 84 | 85 | /* .yellow { background: #FC3; border-color: #FD5 } -- yellow is default */ 86 | .orange { background: #F91; border-color: #FA3 } 87 | .blue { background: #0AC; border-color: #0BC } 88 | .red { background: #E43; border-color: #E54 } 89 | .green { background: #8C4; border-color: #9D6 } 90 | 91 | /* 92 | -- previous colour pallettes 93 | 94 | -- vivid palette 95 | 96 | .yellow { background: #FD6; border-color: #FE7 } 97 | .orange { background: #FA2; border-color: #FB3 } 98 | .blue { background: #1CD; border-color: #1DD } 99 | .red { background: #F50; border-color: #F61 } 100 | .green { background: #4B4; border-color: #4C4 } 101 | 102 | -- autumn palette 103 | 104 | .yellow { background: #FC3; border-color: #FC3 } 105 | .orange { background: #E83; border-color: #E83 } 106 | .blue { background: #089; border-color: #089 } 107 | .red { background: #D44; border-color: #D44 } 108 | .green { background: #9B4; border-color: #9B4 } 109 | 110 | */ 111 | 112 | 113 | /* -- let's treat white cards a little bit special */ 114 | .white { 115 | background: #FFF; 116 | border: 1px dashed #DDD; 117 | 118 | -moz-box-shadow: none; 119 | -webkit-box-shadow: none; 120 | box-shadow: none; 121 | } 122 | 123 | .white:hover { border-color: #AAA } 124 | 125 | /* Special card states 126 | --------------------- */ 127 | 128 | .drag { 129 | cursor: move; 130 | /* cursor: url(grabbing.cur); -- bye bye nice user experience */ 131 | cursor: -moz-grabbing; 132 | 133 | opacity: .8; 134 | } 135 | 136 | .pick { 137 | z-index: 100; 138 | 139 | -moz-transform: scale(1.03); /* -- subtle scale... for those supporting it ;) */ 140 | -webkit-transform: scale(1.03); 141 | transform: scale(1.03); 142 | 143 | -moz-box-shadow: 8px 8px 5px rgba(0,0,0,.2); 144 | -webkit-box-shadow: 8px 8px 5px rgba(0,0,0,.2); 145 | box-shadow: 8px 8px 5px rgba(0,0,0,.2); 146 | } 147 | 148 | /* -- to focus on selected and edited cards we make others transparent */ 149 | .mark .card, .edit .card { opacity: .3 } 150 | .mark .card.mark, .edit .card.edit { opacity: 1 } 151 | 152 | 153 | /* Card text 154 | ------------- */ 155 | 156 | .text { 157 | overflow: hidden; 158 | padding: 2px; 159 | min-height: 1em; 160 | } 161 | 162 | .edit > .text { 163 | background: rgba(255,255,255,.5); 164 | outline: 1px solid #FFF; 165 | } 166 | 167 | .edit.white .text { 168 | background: #F4F4F4; /* no need for rgba, card is white anyway */ 169 | outline-color: #EEE; 170 | } 171 | 172 | .text a { text-decoration:none; } 173 | 174 | .text a:hover { 175 | border-bottom: 1px solid; 176 | background: rgba(255,255,255,.3); 177 | } 178 | 179 | 180 | /* 181 | * Tags 182 | * ====== 183 | */ 184 | 185 | .tag { 186 | background: rgba(255,255,255,.4); 187 | padding: .1em .3em .1em .2em; 188 | cursor: pointer; 189 | 190 | -moz-border-radius: 10px; 191 | -webkit-border-radius: 10px; 192 | border-radius: 10px; 193 | 194 | -webkit-box-shadow: 1px 1px 1px rgba(0,0,0,.2); /* -- only -webkit, because of Chrome (see comment for .tag.mark) */ 195 | } 196 | 197 | /* -- hovered tag */ 198 | .tag.hover { background: rgba(255,255,255,.8) } 199 | 200 | /* -- selected tag */ 201 | .tag.mark { 202 | background: rgba(255,255,255,.9); 203 | 204 | -moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,.2); 205 | -webkit-box-shadow: none; /* inset 1px 1px 1px rgba(100,100,100,.5); -- inset shadow + border radius looks like shit in Chrome */ 206 | box-shadow: inset 1px 1px 1px rgba(0,0,0,.2); 207 | } 208 | 209 | /* -- make tags on white cards noticable */ 210 | .white .tag { background: #EEE } 211 | .white .tag.hover, 212 | .white .tag.mark { background: #DDD } 213 | 214 | 215 | /* 216 | * Action toolbars 217 | * ======================= 218 | */ 219 | 220 | body > menu { position: fixed; top: 5px; left: 5px; } /* -- global actions bar */ 221 | 222 | .card menu { position: absolute; top: -10px; right: 0; } /* -- card actions bar */ 223 | .card.edit menu, .drag menu { display: none } /* -- hide card actions when editing or dragging */ 224 | .edit menu.edit { display: block; left: 0; } 225 | 226 | /* Action icons 227 | -------------- */ 228 | 229 | menu a { 230 | float: left; 231 | height: 20px; width: 20px; 232 | 233 | background: url(../img/i.png) no-repeat 2px 0; 234 | } 235 | 236 | menu a:hover { 237 | position: relative; top: -2px; height: 22px; 238 | 239 | /* -- background icons get blurry on scale, so it's not pretty enough to waste all these bytes 240 | -webkit-transform: scale(1.1); 241 | -moz-transform: scale(1.1); 242 | transform: scale(1.1); 243 | */ 244 | } 245 | 246 | menu a:active { top: -1px; } 247 | 248 | /* -- one char classes, because bytes are precious in 10k apart */ 249 | /* menu .b { background-position: 0 0 } -- b is default so, again, let's save some bytes */ 250 | menu .i { background-position: 2px -20px } 251 | menu .h { background-position: 2px -40px } 252 | menu .p { background-position: 2px -60px } 253 | menu .e { background-position: 2px -80px } 254 | menu .c { background-position: 2px -100px } 255 | menu .r, 256 | menu .d { background-position: 2px -120px } 257 | 258 | 259 | /* 260 | * Deck with new cards 261 | * ===================== 262 | */ 263 | 264 | #deck { 265 | position: fixed; 266 | top: 10px; left: -280px; 267 | } 268 | 269 | #deck .white { border-color: #AAA } 270 | 271 | /* -- disable deck when cards are selected or edited */ 272 | .mark #deck, .edit #deck { opacity: .3 } 273 | 274 | .edit #deck .card, 275 | .mark #deck .card { 276 | cursor: default; 277 | opacity: 1; 278 | } 279 | 280 | 281 | /* 282 | * Footer 283 | * ======== 284 | */ 285 | 286 | footer { 287 | position: fixed; 288 | bottom: 0; right: 0; 289 | padding: 5px; 290 | font-size: .7em; 291 | opacity: .6; 292 | } 293 | 294 | footer:hover { opacity: 1 } 295 | -------------------------------------------------------------------------------- /Resources/modules/taskboard/img/i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runawaygo/HtmlOnClient/e7c29dd62f8f238448f49a5bc69c6927b57cb168/Resources/modules/taskboard/img/i.png -------------------------------------------------------------------------------- /Resources/modules/taskboard/js/s.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Hai! 3 | * 4 | * This is a script that makes Taskboard 10k awesome ;) 5 | * At least it's my very humble opinion. 6 | * 7 | * So, you want to know how it was all done? 8 | * Great! But make sure you are brave enough to go down into dungerons 9 | * of this script. There is a lot of magic down there. 10 | * 11 | * Really. This whole thing had to fit into 10k limit, so not very best 12 | * JavaScript programming practices were used in some places. And it is 13 | * very likely that there are pieces of code that will be not easy to 14 | * decypher. 15 | * 16 | * So you still want to move forward? 17 | * 18 | * You were warned ;) 19 | * 20 | * ==================================================================== 21 | * 22 | * 23 | */ 24 | 25 | (function (document, $, storage) { // let's pull all of this into context of nice function 26 | 27 | // So here we start with very long definition of constants. 28 | // These are strings and other values used a lot in the script. 29 | // Sometimes they may feel as an overhead, but it was all done 30 | // to make this script nicely minify. 31 | 32 | // CONSTANTS 33 | // =========== 34 | 35 | var HTML_CARD = "
", 36 | 37 | // some class names 38 | DRAG = "drag", 39 | EDIT = "edit", 40 | PICK = "pick", 41 | MARK = "mark", 42 | 43 | // selectors 44 | CARD = ".card", 45 | TEXT = ".text", 46 | TAG = ".tag", 47 | ACTION = "menu a", 48 | 49 | HAS_MARK = ':has(.' + MARK + ')', 50 | 51 | DOT = ".", // :) used to turn class names into selectors 52 | 53 | // events 54 | CLICK = "click", 55 | DBLCLICK = "dblclick", 56 | HOVER = "hover", 57 | KEYDOWN = "keydown", 58 | MOUSEDOWN = "mousedown", 59 | MOUSEUP = "mouseup", 60 | MOUSEMOVE = "mousemove", 61 | 62 | // other strings 63 | CONTENTEDITABLE = "contentEditable", 64 | 65 | VALUE = "value", 66 | 67 | TOP = "top", 68 | LEFT = "left", 69 | 70 | STORAGE_KEY = "board", 71 | 72 | TRUE = !0 + "", // == "true" // little inconsistency, but I use "true" only as a string 73 | FALSE = !1, // == false // and false more as boolean 74 | 75 | COLORS = ['white', 'green', 'blue', 'red', 'orange', 'yellow'], 76 | 77 | // checks if class name contains one of the colors 78 | R_COLORCLASS = new RegExp('\\b(' + COLORS.join(')|(') + ')\\b'), 79 | 80 | // checks if event type is mouseenter or mouseover 81 | R_MOUSEIN = /^mouse(enter|over)/i, 82 | 83 | // namespace object for actions triggered by toolbar icons 84 | ACTIONS = { 85 | 86 | // clears board by removing saved data & reloads the page 87 | r: function () { 88 | if (confirm("Are you sure you want to clear all saved data?")) { 89 | storage.removeItem(STORAGE_KEY); // .clear() would be fine too, but I don't want to remove 90 | // data of other demos on 10k apart domain :) 91 | location.reload(); 92 | } 93 | }, 94 | 95 | // CARD ACTIONS 96 | 97 | // edit 98 | e: function ($card) { 99 | $card[DBLCLICK](); // hacky way of saying .trigger("dblclick"), 100 | // because dblclick launches edit mode 101 | // see line 484 where it is handled 102 | }, 103 | 104 | // change color, by switching to next color from the list 105 | // 'cause color pickers are so unusable... 106 | // and, anyway, there are only six colors, right? 107 | c: function ($card) { 108 | var color = $card.color(); 109 | if (color) { 110 | $card.rC(color); // .removeClass -- I guess this is the first place I use my short alias 111 | // you will find more about that around line 359 where 112 | // they are defined 113 | color = COLORS.indexOf(color); 114 | color = COLORS[++color < 6 ? color : 0]; // 6 is COLORS.length 115 | $card.aC(color); // .addClass 116 | save(); 117 | } 118 | }, 119 | 120 | // delete 121 | d: function ($card) { 122 | if (confirm("Are you sure you want to delete this card?")) { 123 | $card.fadeOut(function () { 124 | $card.remove(); 125 | save(); 126 | }); 127 | } 128 | }, 129 | 130 | // TEXT FORMATTING 131 | 132 | // bold -- yes, you guesed it right ;) 133 | b: function () { 134 | document.execCommand("bold", FALSE, ""); 135 | }, 136 | 137 | // italic 138 | i: function () { 139 | document.execCommand("italic", FALSE, ""); 140 | }, 141 | 142 | // heading 143 | h: function () { 144 | block("p", "h2"); 145 | }, 146 | 147 | // paragraph 148 | p: function () { 149 | block("h2", "p"); 150 | } 151 | 152 | }, 153 | 154 | // list of some more or less useful tips 155 | TIPS = [ 156 | "Need a new card? Just grab it from a deck on the left", 157 | "Move cards around to arrange them in any way you want: todo list? kanban board?", 158 | "Double-click card to edit", 159 | "You can use hotkeys when editing text, just check Ctrl+I or Ctrl+B", 160 | //"Just guess what ESC and Ctrl+S do", -- let them discover it... cause Ctrl+S is not working in IE9 161 | "Every change is immediately saved in your browser", 162 | "You've already noticed #tags, didn't you?", 163 | "Ctrl+H makes a

Heading

and Ctrl+G turns text into a paragraph", 164 | 0, // pause 165 | "It's not a tip... I just had some spare bytes below 10k limit ;)" 166 | ], 167 | 168 | // Now, these down there can be finally called variables 169 | // even though some of them don't change much 170 | 171 | // VARIABLES 172 | // =========== 173 | 174 | // jQuery objects with application elements 175 | $document = $(document), 176 | $body = $(document.body), 177 | 178 | $board, //

-- contains all the cards added by user 179 | $deck, //