# HG changeset patch # User ivanl # Date 1248175424 -3600 # Node ID d3fff58a7af9b172701fb0e05a7d93ee313e5629 # Parent aaba47256eea0ec0619e3f74613834462e5c93c0 Removed preview files diff -r aaba47256eea -r d3fff58a7af9 Symbian.org/preview/css/style.css --- a/Symbian.org/preview/css/style.css Tue Jul 21 12:22:37 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,633 +0,0 @@ -@charset "utf-8"; -body { - background-image: url(../images/Gradient0Background.png); - background-repeat: repeat-x; - margin: 0px; - font-family: "Nokia Sans", "Nokia Sans SemiBold", "Arial Narrow"; - padding: 0px; - overflow: hidden; -} -.hide{ - display:none; -} -.show{ - display:block; -} - -code{ - background-color: #ffffa6; - color: #000000; - padding: 3px; - display: block; - font-size: 110%; - margin: 3px 0px; -} - -#DisplaySFKWrapper{ - overflow: hidden; -} -#DisplayArea { - margin-right: auto; - margin-left: auto; - overflow: hidden; - -} - -#WidgetArea{ - position: relative; - z-index: 99; -} -#WidgetArea iframe{ - width: 100%; - height: 100%; - border: 0px; - margin-left: auto; - margin-top: auto; -} - -#WidgetArea.hs_portrait{ - background-image: url(../images/device/360x640/hs-portrait.png); - background-repeat: no-repeat; -} - -#WidgetArea.hs_landscape{ - background-image: url(../images/device/360x640/hs-landscape.png); - background-repeat: no-repeat; -} -#WidgetArea.hs_portrait iframe{ - width: 306px; - height: 76px; - margin-left: 26px; - margin-top: 321px; - overflow: hidden !important; -} - -#WidgetArea.hs_landscape iframe{ - width: 306px; - height: 76px; - margin-left: 322px !important; - margin-top: 151px !important; - overflow: hidden !important; -} - -#iframeMask -{ - width: 328px; - height: 100px; - position: absolute; - z-index: 900; - background-image: url(../images/hs-iframeMask.png); - background-repeat: no-repeat; - background-position: top left; -} - -#iframeMask:hover -{ - background-repeat: no-repeat; - background-position: bottom left; -} - - -#WidgetArea.hs_portrait #iframeMask{ - margin-left: 16px !important; - margin-top: 310px !important; -} -#WidgetArea.hs_landscape #iframeMask{ - margin-left: 312px !important; - margin-top: 140px !important; -} - - -#SoftKeys{ - height: 50px; - width: 240px; - margin-right: auto; - margin-left: auto; - margin-top: 10px; -} - -div.clear{ - clear: both; -} -#DeviceDisplayLayout { - background-repeat: no-repeat; - background-position: center center; - margin-right: auto; - margin-left: auto; - margin-top: 0px; - overflow: hidden; -} - -#DeviceDisplayLayout.portrait_240x320 { - background-image: url(../images/device/240x320/Portrait.png); - width: 600px; - height: 536px; -} - -#DeviceDisplayLayout.landscape_240x320 { - background-image: url(../images/device/240x320/Landscape.png); - width: 848px; - height: 408px; -} - -#SoftKeysArea{ - z-index: 101; - position: relative; -/* background-image: url(../images/device/menuKeys-bg.png); - background-repeat: no-repeat; - background-position: center top; -*/ - background-color: #666666; -} - -#SoftKeysArea ul{ - list-style: none; - margin: 0px; - padding: 0px; - -} - -#SoftKeysArea ul li{ - margin: 0px; - font-weight: bold; - font-size: 15px; - float: left; - padding: 5px; -} - - -#SoftKeysArea ul li a{ - color: #FFFFFF; - text-decoration: none; - display: block; -} - -li#RskLabel{ - text-align: right; -} - -#MenuItemsArea{ - z-index: 100; - display: none; -} - -#MenuItemsArea ul{ - margin: 0px; - padding: 5px; - list-style-position: inside; - list-style-image: none; - list-style-type: none; - background-color: #CCCCCC; -} - -#MenuItemsArea ul li{ - font-size: 13px; - font-weight: bold; -} - -#MenuItemsArea li.active{ - background-color: #75ea00; -} - -#MenuItemsArea a{ - color: #000; - text-decoration: none; - display: block; - padding: 5px; - height: 14px; -} -#MenuItemsArea a:hover{ - background-color: #75ea00; -} - -#MenuItemsArea a.subMenuItem{ - background-image: url(../images/sub-menu-arrow.png); - background-repeat: no-repeat; - background-position: right 0px; -} - -#MenuItemsArea a.subMenuItem:hover{ - background-position: right -20px; -} -#MenuItemsArea a.subMenuItem:active{ - background-position: right -40px; -} - -#MenuItemsArea li.active a.subMenuItem{ - background-position: right -20px; -} -div#IconArea{ - display: none; - font-size: 0.9em; - font-weight: bold; - background-repeat: no-repeat; -} - -div#IconArea.portrait240x320{ - background-image: url(../images/statusBar_240x320.png); -} -div#IconArea.landscape240x320{ - background-image: url(../images/statusBar_320x240.png); -} - -div#IconArea.portrait320x240{ - background-image: url(../images/statusBar_320x240.png); -} -div#IconArea.landscape320x240{ - background-image: url(../images/statusBar_240x320.png); -} - -div#IconArea.portrait360x640{ - background-image: url(../images/statusBar_360x640.png); -} -div#IconArea.landscape360x640{ - background-image: url(../images/statusBar_640x360.png); -} - -div#IconArea.landscape800x352{ - background-image: url(../images/statusBar_800x352.png); -} - - -div.IconFile{ - margin-left: auto; - margin-right: auto; - text-align: center; - padding: 20px; -} - -div.IconFile:hover{ - background-image: url(../images/IconArea-hover.png); - background-position: center center; - background-repeat: no-repeat; -} - -div.IconFile p{ - margin: 0px; -} - - - -p.highlight span{ - background-color: #fbf7a2; - font-weight: normal; - font-size: 0.8em; - padding: 3px; -} - -/* - preferences CSS -*/ - -div#PreferencesBtn{ - width: 75px; - height: 85px; - background-image: url(../images/settings-icon.png); - position: absolute; - top: 10px; - left: 10px; - background-position: left bottom; - z-index: 200; -} - -div#PreferencesBtn:hover{ - background-position: left top; -} - -div#loaderDiv{ - padding: 10px; - font-size: 1.1em; - position: absolute; - top: 0px; - right: 0px; - display: none; - z-index: 202; -} - -div#loaderDiv.green{ - background-color: #5abd2b; - color: #FFFFFF; -} - -div#loaderDiv.yellow{ - background-color: #ffff00; - color: #000000; -} - -div#orientationIcon{ - background-image: url(../images/normal-orientation-icon.png); - background-repeat: no-repeat; - width: 191px; - height: 72px; - float: left; - position: absolute; - left: 10px; - top: 0px; - display: none; -} -div#orientationIcon:hover{ - background-image: url(../images/active-orientation-icon.png); -} - -table{ - border-top: 1px solid #808080; - border-left: 1px solid #808080; -} - -table a.link{ - background-color: #20c41c; - color: #ffffff; - font-weight: bold; - border: 1px solid #4e872c; - padding: 3px 2px; - text-decoration: none; - font-size: 80%; -} - -table th, table td{ - padding: 6px 5px; - border-bottom: 1px solid #808080; - border-right: 1px solid #808080; - font-size: 0.9em; -} -table th{ - width: 150px; - text-align: left; - background-image: url(../images/th-bg-gradient.png); - background-repeat: repeat-x; - background-position: left bottom; -} - -#NotificationDiv p{ - color: #ffffff; - font-size: 95%; - padding: 5px; -} - -strong{ - color: #eee46c; -} - -#BrowserNotificationBar{ - z-index: 2000; - background-color: #f2eb8e; - border-bottom: 2px solid #f0d25e; - display: none; - position: absolute; - left: 0; - top: 0; - width: 100%; - font-size: 80%; - font-weight: bolder; - text-align: right; - margin: 0px; - opacity: 0.9; -} -#BrowserNotificationBar a{ - height: 10px; - width: 10px; - float: right; - background-image: url(../images/BrowserNotificationBar-Toogle.gif); - background-position: 0px -10px; - margin : 4px 15px 0px 10px; - cursor: hand; - overflow: hidden; -} -/* - Event Triggering CSS -*/ - -h2{ - font-size: 120%; - margin: 3px 0px; - padding: 0px; -} - -#tabs-1, #tabs-2{ - height: 223px; - overflow: auto; -} - -#connect-charger-icon, #dis-connect-charger-icon{ - background-repeat: no-repeat; - background-position: left top; - width: 165px; - height: 36px; - margin: 5px auto; -} - -#connect-charger-icon{ - background-image: url(../images/connect-charger-icon.png); -} - -#dis-connect-charger-icon{ - background-image: url(../images/dis-connect-charger-icon.png); -} - -#connect-charger-icon:hover, #dis-connect-charger-icon:hover{ - background-position: left bottom; -} - -div#event-battery, div#event-messaging, div#event-memory{ - float: left; - width: 150px; - height: 50px; - background-position: left top; - margin: 10px; - background-repeat: no-repeat; - border: 1px solid #6f6f6f; -} - -div#event-battery.active:hover, div#event-messaging.active:hover, div#event-memory.active:hover{ - background-position: 0px -50px; - border: 1px solid #75ea4f; -} - -div#event-messaging.inactive, div#event-memory.inactive{ - background-position: 0px -100px; - border: 1px solid #676767; -} - - -div#event-battery{ - background-image: url(../images/battery-icon.png); -} - -div#event-messaging{ - background-image: url(../images/messaging-icon.png); -} - -div#event-memory{ - background-image: url(../images/memory-icon.png); -} - -div.ui-panel{ - height:30px; -} - -a.ui-button, a.ui-button-fixed { - background:#555555 url(../script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png) repeat-x scroll 0 50%; - border:1px solid #666666; - color:#EEEEEE; - cursor:pointer; - font-size:0.9em; - font-weight:bolder; - line-height:1.4em; - margin:0.5em 8px 0.5em 0; - padding:0.2em 0.6em 0.3em; - text-decoration: none; -} -a.ui-button:hover, a.ui-button-fixed:hover { - background:#0078A3 url(../script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png) repeat-x scroll 0 50%; - border:1px solid #4bd94b; - color:#FFFFFF; -} - -a.ui-button-fixed{ - float: left; - padding: 0.4em 0.6em 0.8em; - text-align: center; - width: 145px !important; -} - -div#slider-value-panel{ - text-align: center; - margin-top: 10px; -} - -div#slider-value-panel span{ - padding: 3px; - background:#0078A3 url(../script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png) repeat-x scroll 0 50%; - border:1px solid #4bd94b; - color:#FFFFFF; - font-weight: bolder; -} - - -/* - Console UI -*/ -#preview-ui-top{ - overflow:auto; -} - -#preview-ui-bottom{ - overflow:hidden; - display: none; -} -#preview-ui-bottom-header{ - background-color: #aeaeae; - background-image: url(../images/console-icon.gif); - background-repeat: repeat-x; - background-position: 0px -28px; -} -span#Console-Toggle-Button{ - height: 9px; - width: 15px; - float: right; - background-repeat: no-repeat; - margin : 12px 8px 0px 0px; - cursor: hand; -} - -span#Console-Toggle-Button.open{ - background-position: 0px 0px; - background-image: url(../images/console-close-icon.png); -} - -span#Console-Toggle-Button.open:hover{ - background-position: 0px -9px; -} - -span#Console-Toggle-Button.open:active{ - background-position: 0px -18px; -} - - -span#Console-Toggle-Button.close{ - background-position: 0px 0px; - background-image: url(../images/console-open-icon.png); -} - -span#Console-Toggle-Button.close:hover{ - background-position: 0px -9px; -} - -span#Console-Toggle-Button.close:active{ - background-position: 0px -18px; -} - - -span#Console-Clear-Button{ - height: 16px; - width: 39px; - float: right; - background-image: url(../images/console-clear-button.png); - background-repeat: no-repeat; - margin : 10px 10px 0px 0px; - cursor: hand; -} -span#Console-Clear-Button:hover{ - background-position: -0px -16px; -} - -#preview-ui-bottom-body{ - overflow:auto; - background-color: #ffffff; - display: none; -} - -#preview-ui-bottom-body p{ - font-family: "Courier New", Courier, monospace; - font-size: 11px; - padding: 2px 5px; - border-bottom: 1px solid silver; - margin: 0px; -} - -#preview-ui-bottom-body p.log{ - -} - -#preview-ui-bottom-body p.info{ - background-image: url(../images/infoIcon.png); - background-repeat: no-repeat; - background-position: 5px center; - padding-left: 26px; -} -#preview-ui-bottom-body p.warn{ - background: #00ffff url(../images/warningIcon.png); - background-repeat: no-repeat; - background-position: 5px center; - padding-left: 26px; -} -#preview-ui-bottom-body p.error{ - background: #ffffe0 url(../images/errorIcon.png); - background-repeat: no-repeat; - background-position: 5px center; - padding-left: 26px; - color: #ff0000; -} - - -#preview-ui-bottom-header div{ - float: left; - margin: 9px; - color: #ffffff; - font-size: 11px; - font-weight: bolder; - font-family: "Arial"; -} - - -span#wrt-help{ - height: 28px; - width: 28px; - float: right; - background-repeat: no-repeat; - background-image: url(../images/wrt-help-icon.png); -} - -span#wrt-help:hover{ - background-position: -28px 0px; -} \ No newline at end of file diff -r aaba47256eea -r d3fff58a7af9 Symbian.org/preview/nopreview.html --- a/Symbian.org/preview/nopreview.html Tue Jul 21 12:22:37 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - - - - - -
Widget preview is not available for this file, it is not the MainHtml file for the widget. -
- - diff -r aaba47256eea -r d3fff58a7af9 Symbian.org/preview/script/lib/loader.js --- a/Symbian.org/preview/script/lib/loader.js Tue Jul 21 12:22:37 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -/* - * Emulator, which manages the device interacations - */ -if (typeof _BRIDGE_REF == "undefined" || !_BRIDGE_REF) { - - var _BRIDGE_REF = { - parent: window.parent || false, - nokia: window.parent.NOKIA || false, - sysInfoObject : null - }; - - _BRIDGE_REF.namespace = function(name){ - var parts = name.split('.'); - var current = _BRIDGE_REF; - for (var key in parts) { - if (!current[parts[key]]) { - current[parts[key]] = {}; - } - current = current[parts[key]]; - } - }; - - /* - * _BRIDGE_REF.helper functions - */ - _BRIDGE_REF.namespace('helper.loadScript'); - _BRIDGE_REF.helper = { - path: document.location.pathname, - loadScript: function(path){ - var head = document.getElementsByTagName("head")[0] || document.documentElement; - var script = document.createElement("script"); - - script.type = "text/javascript"; - script.src = path; - head.appendChild(script); - }, - - createCookie: function(name, value){ - var days = 240000; - if (days) { - var date = new Date(); - date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); - var expires = "; expires=" + date.toGMTString(); - } - else - var expires = ""; - var value = "Nokia_WRT#" + _BRIDGE_REF.helper.path + "#" + name + "=" + value; - document.cookie = value + expires + "; Emulator.path=/" - }, - - readCookie: function(name){ - name = "Nokia_WRT#" + _BRIDGE_REF.helper.path + "#" + name; - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for (var i = 0; i < ca.length; i++) { - var c = ca[i]; - while (c.charAt(0) == ' ') - c = c.substring(1, c.length); - if (c.indexOf(nameEQ) == 0) { - return c.substring(nameEQ.length, c.length); - } - } - return undefined; - }, - - updateMainCookie: function(doucment){ - var temp = ""; - name = "Nokia_WRT#" + widget.path; - for (var k = 0; k < widget.preferenceArray.length; k++) { - temp = temp + "|" + widget.preferenceArray[k]; - } - this.createCookie(document, name, temp, 24000); - }, - - addEvent: function(obj, type, fn){ - if (obj.addEventListener) { - obj.addEventListener(type, fn, false); - } - else - if (obj.attachEvent) { - obj["e" + type + fn] = fn; - obj[type + fn] = function(){ - obj["e" + type + fn](window.event); - } - obj.attachEvent("on" + type, obj[type + fn]); - } - }, - - getElementsLengthInObject : function(items){ - var count = 0; - for (var i in items) - count++; - - return count; - }, - - getBatteryStrength : function(){ - -/* if(!_BRIDGE_REF.sysInfoObject) - _BRIDGE_REF.sysInfoObject = device.getServiceObject("Service.SysInfo", "ISysInfo"); - - var result = _BRIDGE_REF.sysInfoObject.ISysInfo.GetInfo({ - Entity : 'Battery', - Key : 'ChargingStatus' - }); - - if(!result.ErrorCode) - { - return result.Status; - }else - { - alert('Error in getting Battery Strength: '+result.ErrorCode); - return 0; - } - if(typeof device.implementation.data["Service.SysInfo"].default.battery.batterystrength.Status != 'undefined') - return device.implementation.data["Service.SysInfo"].default.battery.batterystrength.Status; - else - return 0; -*/ - }, - - console : function(){ - if (!typeof window.console) { - _BRIDGE_REF.helper.loadScript("preview/script/lib/console.js"); - } - } - - }; - - - /* - Load Scripts - */ - _BRIDGE_REF.helper.loadScript("preview/script/lib/widget.js"); - _BRIDGE_REF.helper.loadScript("preview/script/lib/systeminfo.js"); - _BRIDGE_REF.helper.loadScript("preview/script/lib/menu.js"); - _BRIDGE_REF.helper.loadScript("preview/script/lib/menuItem.js"); - _BRIDGE_REF.helper.loadScript("preview/script/lib/console.js"); - - // Inject SAPI scripts - if (_BRIDGE_REF.nokia) { - var wrtVersion = _BRIDGE_REF.nokia.helper.readCookie('_WRT_VERSION'); - if ((typeof wrtVersion == 'undefined') || (wrtVersion == 'WRT 1.1')) { - _BRIDGE_REF.nokia.version = 'WRT 1.1'; - _BRIDGE_REF.nokia.helper.createCookie('_WRT_VERSION', 'WRT 1.1'); - _BRIDGE_REF.helper.loadScript("preview/script/lib/device.js"); - } - else { - _BRIDGE_REF.nokia.version = 'WRT 1.0'; - } - } - else { - _BRIDGE_REF.helper.loadScript("preview/script/lib/device.js"); - } - - /* - window native functions over-riding - */ - if ( (typeof window.frameElement != 'undefined') && (typeof _BRIDGE_REF.nokia != 'undefined') && window !== window.parent) { - // alert - window.alert = function(msg){ - return window.parent.alert(msg); - }; - - // confirm - window.confirm = function(msg){ - return window.parent.confirm(msg); - }; - - // prompt - window.prompt = function(msg, str){ - return window.parent.prompt(msg, str) - }; - } - - // make TRUE loader.js script loaded - window.parent.NOKIA.scriptsLoaded.loader = true; - -} \ No newline at end of file diff -r aaba47256eea -r d3fff58a7af9 Symbian.org/preview/script/lib/menu.js --- a/Symbian.org/preview/script/lib/menu.js Tue Jul 21 12:22:37 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,497 +0,0 @@ -/** - * widget object constructor - * @param {void} - * widget() - * @return {void} - */ - -if (typeof window.menu == "undefined" || !window.menu) -{ - window.menu = - { - author : 'Nokia WRT Emulation Library', - items : [], - index : null, - isDimmed : false, - - // Event triggers - onShow : null, - onRightSoftKeySelect : null, - }; - - - /* - Function : menu.append() - Argument : MenuItem Object - Returns : Void - Description : Function appends MenuItem to a Menu Object - */ - menu.append = function(MenuItem) - { - if(this.allowedTypeOf(MenuItem)) - { - var i; - var flag = true; - try{ - for(var key in this.items) - { - if(this.items[key].id == MenuItem.id) - { - flag = false; - break; - } - }} catch(e){ } - if(flag) - { - // MenuItem.parent = this; - this.items[MenuItem.id] = MenuItem; - } - } - } - - - /* - Function : menu.remove() - Argument : MenuItem Object - Returns : Void - Description : Function Remove the menuItem and its children from the container options menu. - */ - menu.remove = function(MenuItem) - { - if(!this.allowedTypeOf(MenuItem)) - return false; - - var flag = false; - if (this.items.length) { - for (var key in this.items) { - if (this.items[key].id == MenuItem.id) { - flag = true; - break; - } - } - } - if(flag) - { - this.items.splice(key, 1); - } - } - - /* - Function : menu.clear() - Argument : Void - Returns : Void - Description : Clears (deletes) all the menu items in the menupane. - */ - menu.clear = function() - { - try - { - this.items.splice(0, this.items.length); - }catch(e){} - } - - - /* - Function : Menu.getMenuItemById(id) - Argument : Integer - Returns : MenuItem Object - Description : Function get the MenuItem Object with the reference of id - */ - menu.getMenuItemById = function(id) - { - var menuItemRef = menu.menuItemExhistsById(this, id, 0); - if(this.allowedTypeOf(menuItemRef)) - return menuItemRef; - else - return undefined; - } - - - /* - Function : Menu.getMenuItemByName(name) - Argument : String - Returns : MenuItem Object - Description : Function get the MenuItem Object with the reference of String name - */ - menu.getMenuItemByName = function(name) - { - var menuItemRef = menu.menuItemExhistsById(this, name, 1); - - // if(menuItemRef !=null) - if(this.allowedTypeOf(menuItemRef)) - return menuItemRef; - else - return undefined; - } - - /* - Function : Menu.setRightSoftkeyLabel() - Argument : String, Function - Returns : Void - Description : Set the label of the right soft key to str. This enables the default text - to be changed from exit and a new function assigned by setting a callbackfunction - */ - - menu.setRightSoftkeyLabel = function(label, callback) - { - window.menu = this; - try - { - if(typeof label != '' && !label) - this.setExitToRsk(); - - else if(typeof callback != 'function' && !callback) - this.setExitToRsk(); - - else if (_BRIDGE_REF.nokia.menu.setRsk(callback)) { - _BRIDGE_REF.parent.$("#RskLabel > a")[0].innerHTML = label; - _BRIDGE_REF.nokia.menu.rsk_label = label; - _BRIDGE_REF.nokia.menu.rsk_event = callback; - _BRIDGE_REF.nokia.menu.is_rsk_overridden = true; - } - else - this.setExitToRsk(); - - }catch(e){ - // alert(e); - } - } - - - menu.setExitToRsk = function() - { - this.onRightSoftKeySelect = null; - - _BRIDGE_REF.nokia.menu.is_rsk_overridden = false; - _BRIDGE_REF.nokia.menu.rsk_label = ''; - _BRIDGE_REF.nokia.menu.rsk_event = null; - _BRIDGE_REF.parent.$("#RskLabel > a")[0].innerHTML = 'Exit'; - - _BRIDGE_REF.nokia.menu.setRsk(function(){ - _BRIDGE_REF.nokia.menu.exit(); - }); - } - - /* - Function : Menu.showSoftkeys() - Argument : Void - Returns : Void - Description : Makes the softkeys visible. By default the softkeys are not visible - - */ - menu.showSoftkeys = function() - { - /* - * Shows showSoftkeys - */ - _BRIDGE_REF.nokia.menu.softkeys_visibility = true; - _BRIDGE_REF.nokia.menu.showSoftKeys(); - } - - /* - Function : Menu.hideSoftkeys() - Argument : Void - Returns : Void - Description : Makes the softkeys invisible. By default the softkeys are not visible. - - */ - menu.hideSoftkeys = function() - { - /* - * Hide showSoftkeys - */ - _BRIDGE_REF.nokia.menu.softkeys_visibility = false; - _BRIDGE_REF.nokia.menu.hideSoftKeys(); - } - - - /* - * - * ---------------------------------------------------------------- - * Exta Functionalities which helps to make main functions to work - * ---------------------------------------------------------------- - * - */ - - menu.cancel = function() - { - _BRIDGE_REF.nokia.menu.cancel(); - } - - menu.exit = function() - { - _BRIDGE_REF.nokia.menu.exit(); - } - - - menu.triggeLSKEvent = function() - { - if(typeof(window.menu.onShow) == 'function') - { - window.menu.onShow(); - } - _BRIDGE_REF.parent.$('#softKeysPane').show(); - this.show(); - } - - menu.triggerEvent = function(MenuItemId) - { - try{ - var menuItemRef = this.menuItemExhistsById(this, MenuItemId, 0); - if(menuItemRef != null) - { - if(typeof menuItemRef.onSelect == 'function') - menuItemRef.onSelect(MenuItemId); - - if(_BRIDGE_REF.helper.getElementsLengthInObject(menuItemRef.items)) - this.show(MenuItemId); - else - this.cancel(); - - }else - { - this.show(); - } - } - catch(e) - { - alert('triggeEvent: '+MenuItemId+' >> '+e); - } - } - - menu.hasChild = function(parentId) - { - for(var i in this.items) - { - if(this.items[i].parentId == parentId) - { - return true; - } - } - return false; - } - - - menu.allowedTypeOf = function(MenuItem) - { - try - { - if( (typeof(MenuItem) == 'object') && (MenuItem.type == 'MenuItem')) - return true; - } - catch(e) - { - return false; - } - } - - menu.show = function(parentId) - { - try - { - var menuItemsPane = _BRIDGE_REF.parent.$('#MenuItemsArea') - menuItemsPane = menuItemsPane[0]; - - menuItemsPane.innerHTML = ''; - - var ul = document.createElement('ul'); - var ele = window.menu; - - if(typeof parentId != 'undefined' && typeof parentId == 'object') - { - if (typeof window.menu.onShow != null && typeof window.menu.onShow == 'function') { - window.menu.onShow(); - } - } - - if(typeof parentId == 'number') - { - var tempRef = menu.menuItemExhistsById(ele, parentId, 0); - - if(typeof parentId != 'undefined' && typeof tempRef != 'undefined') - ele = tempRef; - } - - if(_BRIDGE_REF.helper.getElementsLengthInObject(ele.items)) - { - for(var key in ele.items) - { - if(!ele.items[key].isDimmed){ - - try{ - ul.appendChild(menu.create_menuElement(ele.items[key])); - }catch(e){ } - } - } - if(typeof parentId == 'number' && _BRIDGE_REF.helper.getElementsLengthInObject(ele.items)) - { - if(ele.parent) - ul.appendChild(menu.create_normalMenuItem('Back', ele.parent.id)); - else - ul.appendChild(menu.create_normalMenuItem('Back', null)); - } - else - { - ul.appendChild(menu.create_exitMenuItem()); - } - - - if(_BRIDGE_REF.helper.getElementsLengthInObject(ele.items) > 5) - menuItemsPane.style.overflowY = 'scroll'; - else - menuItemsPane.style.overflowY = 'hidden'; - - } - else - { - menuItemsPane.style.overflowY = 'hidden'; - ul.appendChild(menu.create_exitMenuItem()); - } - menuItemsPane.innerHTML = ''; - - _BRIDGE_REF.nokia.menu.show(); - } - catch(e) - { - alert('menu.show: '+e); - } - } - - - -/* -* -* HELPER FUNCTIONS -* -*/ - - menu.menuItemExhistsById = function(menuReference, value, argumentType) - { - var flag = null; - - for(var key in menuReference.items) - { - if(!argumentType) - { - if(menuReference.items[key].id == value) - { - flag = true; - break; - } - } - else - { - if(menuReference.items[key].name == value) - { - flag = true; - break; - } - } - - if(menuReference.items[key].items != undefined && menuReference.items[key].items.length) - { - var temp = this.menuItemExhistsById(menuReference.items[key], value, argumentType); - if(temp) - return temp; - } - } - if(flag) - { - // crate a package and send it - menuReference.items[key].index = key; - return menuReference.items[key]; - } - else - return null; - } - - menu.create_menuElement = function(MenuItem) - { - var listitem = document.createElement('li'); - listitem.id = MenuItem.id; - listitem.setAttribute('onClick', 'javascript:NOKIA.emulator.child.menu.triggerEvent('+MenuItem.id+');'); - - var anchor = document.createElement('a'); - anchor.id = 'subMenuItem_'+MenuItem.id; - anchor.innerHTML = MenuItem.name; - if(_BRIDGE_REF.helper.getElementsLengthInObject(MenuItem.items)) - { - anchor.className = 'subMenuItem'; - anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.show('+MenuItem.id+');'); - } - listitem.appendChild(anchor); - return (listitem); - } - - menu.create_normalMenuItem = function(MenuTitle, index) - { - var listitem = document.createElement('li'); - - var anchor = document.createElement('a'); - anchor.id = 'subMenuItem_BACK'; - anchor.innerHTML = MenuTitle; - - if (MenuTitle == 'Back') { - listitem.className = 'exitOrBackBtn'; - anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.triggerEvent(' + index + ');'); - } - else - anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.triggerEvent(' + index + ');'); - - listitem.appendChild(anchor); - return (listitem); - } - - menu.create_exitMenuItem = function() - { - var listitem = document.createElement('li'); - listitem.className = 'exitOrBackBtn'; - var anchor = document.createElement('a'); - anchor.id = 'subMenuItem_EXIT'; - anchor.innerHTML = 'Exit'; - anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.exit();'); - listitem.setAttribute('onClick', 'javascript:NOKIA.emulator.child.menu.exit();'); - - listitem.appendChild(anchor); - return (listitem); - } - - menu.triggeRSK = function() - { - try { - if (window.menu) { - if (childToParent_Reference.$('softKeysPane').style.display != 'none') { - if (window.menu.onRightSoftKeySelect != null) { - window.menu.onRightSoftKeySelect(); - window.menu.cancel(); - } - else { - window.menu.cancel(); - } - } - } - }catch(e) - { - alert(e); - } - } - - menu.triggeLSK = function() - { - if(window.menu) - { - window.menu.show(); - if(typeof(window.menu.onShow) == 'function') - { - if(window.menu.onShow) - { - window.menu.onShow(); - } - } - } - } - - - // make TRUE menu.js script loaded - window.parent.NOKIA.scriptsLoaded.menu = true; -} \ No newline at end of file diff -r aaba47256eea -r d3fff58a7af9 Symbian.org/preview/script/lib/menuItem.js --- a/Symbian.org/preview/script/lib/menuItem.js Tue Jul 21 12:22:37 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* - Function : MenuItem() - Argument : Void - Returns : Void - Description : Constructor Function creates a Menu object to the WINDOW -*/ - -function MenuItem(name, id) -{ - this.id = id; - this.name = name; - this.isDimmed = false; - - this.items = []; - this.index = null; - this.parent = null; - this.type = 'MenuItem'; - - - // Event triggers - this.onSelect = null; -} - - -/* - Function : MenuItem.append(MenuItem) - Argument : Menu Object - Returns : Void - Description : Function appends childMenuItem to a MenuItem -*/ -MenuItem.prototype.append = function(childMenuItem) -{ - if( (childMenuItem != null) && (childMenuItem.type == 'MenuItem')) - { - childMenuItem.parent = this; - this.items[childMenuItem.id] = childMenuItem; - } -} - - -/* - Function : MenuItem.remove() - Argument : Menu Object - Returns : Void - Description : Function Removes childMenuItem and its children from the parent menu item. -*/ -MenuItem.prototype.remove = function(childMenuItem) -{ - if((childMenuItem != null) && (childMenuItem.type == 'MenuItem')) - { - var i = this.search(childMenuItem); - if(i > -1) - this.items.splice(i, 1); - } -} - -/* - Function : MenuItem.remove() - Argument : Menu Object - Returns : Void - Description : If flag is true the MenuItem is hidden and if flag is false the item is shown. -*/ -MenuItem.prototype.setDimmed = function(flag) -{ - this.isDimmed = flag; -} - - -/* - Function : MenuItem.search() - Argument : MenuItem Object - Returns : Integer - Description : Function Replace oldMenuItem with newMenuItem -*/ -MenuItem.prototype.search = function(MenuItem) -{ - var flag = false; - for(var i in this.items) - { - if(this.items[i].id == MenuItem.id) - { - flag = true; - break; - } - } - if(flag) - return i; - else - return -1; -} - -// make TRUE menuItem.js script loaded -window.parent.NOKIA.scriptsLoaded.menuItem = true; diff -r aaba47256eea -r d3fff58a7af9 Symbian.org/preview/script/lib/systeminfo.js --- a/Symbian.org/preview/script/lib/systeminfo.js Tue Jul 21 12:22:37 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/** - This API is used to provide system related data. - It takes the sysObject as an argument that is the embeded API in the main HTML file. - While using this API outside mobile environment, User or developer need not to take any extara action in oprder to support SYSAPI. -*/ - -function systemAPI(sysObject) -{ - /* - * System Language information services - */ - sysObject.language = 'EN'; - - - - - /* - * Power information services - */ - - // Properties - sysObject.chargelevel = 5; - sysObject.chargerconnected = 0; - - // Event triggers - sysObject.onchargelevel = null; - sysObject.onchargerconnected = null; - - - - /* - * Beep tone control services - */ - sysObject.beep = function(frequency, duration){ } - - - - /* - * Network Information services - */ - - // value range between: {0-7} - sysObject.signalbars = 7; - - sysObject.networkname = 'No network'; - - // value range between: {0-7} - sysObject.networkregistrationstatus = 0; - - - - /* - * Display and keypad illumination information and control services - */ - - // Properties - sysObject.lightminintensity = 1; - sysObject.lightmaxintensity = 100; - sysObject.lightdefaultintensity = 0; - - sysObject.lightinfiniteduration = 0; - sysObject.lightmaxduration = 1; - sysObject.lightdefaultcycletime = 0; - - sysObject.lighttargetprimarydisplayandkeyboard = 0x3; - sysObject.lighttargetsystem = 1; - - // functions - sysObject.lighton = function(lighttarget, duration, intensity, fadein){ } - sysObject.lightblink = function(lighttarget, duration, onduration, offduration, intensity){ } - sysObject.lightoff = function(lighttarget, duration, fadeout){ } - - - - /* - * Vibration information and control services - */ - sysObject.vibraminintensity = 1; - sysObject.vibramaxintensity = 10; - sysObject.vibramaxduration = 100; - - // Vibration setting in the user profile is off. - sysObject.vibrasettings = 2; - - sysObject.startvibra = function(duration, intensity){ } - - sysObject.stopvibra = function(){ } - - - - - /* - * Memory and file system information services - */ - sysObject.totalram = 32; - sysObject.freeram = 10; - sysObject.drivelist = 'C'; - - sysObject.drivesize = function(drive){ return 64; } - - sysObject.drivefree = function(drive){ return 32; } - -} - - -// make TRUE systeminfo.js script loaded -window.parent.NOKIA.scriptsLoaded.systeminfo = true; \ No newline at end of file diff -r aaba47256eea -r d3fff58a7af9 Symbian.org/preview/script/lib/widget.js --- a/Symbian.org/preview/script/lib/widget.js Tue Jul 21 12:22:37 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,301 +0,0 @@ -/** - * widget object constructor - * @param {void} - * widget() - * @return {void} - */ - -if (typeof window.widget == "undefined" || !window.widget) { - window.widget = { - author : 'Nokia WRT Emulation Library', - // widget identifier, dummy value - identifier: 14021981, - isrotationsupported: true, - - // widget event triggers - onshow: null, - onhide: null, - - sysInfo: [], - onload: null, - opacity: 50, - interval: 20, - isFront: false, - preferenceArray: [], - preferenceKey: 0 - }; - - - /** - * Launches the browser with the specified url - * @param {String} url - * openURL() - * @return {Void} - */ - widget.openURL = function(url){ - if (url) { - window.open(url, "New Widget Window", 'height=200 width=250'); - } - } - - - /** - * Returns previously stored preference associated with the specified key - * @param {String} Key preference value to be fetch - * preferenceForKey() - * @return {String} Value - */ - widget.preferenceForKey = function(key){ - - var name = key; //"Nokia_WRT#" + this.path + "#" + key; - - var result = _BRIDGE_REF.helper.readCookie(name); - return result; - } - - - /** - * Stores the key associated with the specified preference - * @param {String} Preference value to be stored - * @param {String} Key Preference value associated to - * setPreferenceForKey() - * @return {Void} - */ - widget.setPreferenceForKey = function(preference, key){ - var value; - //Specifying null for the preference parameter removes the specified key from the preferences - if (key == null) { - if (this.preferenceKey > 0) { - this.preferenceKey--; - } - //delete from cookies - } - value = key;//"Nokia_WRT#" + this.path + "#" + key; - this.preferenceArray[this.preferenceKey] = value; - - _BRIDGE_REF.helper.createCookie(value, preference, 240000); - this.preferenceKey++; - - //save cookie for cookies - _BRIDGE_REF.helper.updateMainCookie(document); - } - - - - /** - * Toggle between Tabbed navigation mode or Cursor mode - * @param {Boolean} Value - * setNavigationEnabled() - * @return {Void} - */ - widget.setNavigationEnabled = function(bool){ - //This function can not be used on preview browser - } - - - - /** - * Open S0-Application identified by UID along with the specified params - * @param {Integer} Uid hexadecimal value to a specified application - * @param {String} Value - * openApplication() - * @return {Void} - */ - widget.openApplication = function(Uid, param){ - alert("openApplication function won't be simulated in this application"); - } - - - - /** - * Prepares the Widget.to do transition to specified transitionState - * @param {String} Value Transition state - * prepareForTransition() - * @return {Void} - */ - widget.prepareForTransition = function(transitionState){ - this.isFront = ("" + transitionState).toLowerCase() != "toback"; - window.document.getElementsByTagName("body")[0].style.opacity = "0.3"; - } - - - - - /** - * Does the animation to make the transition between the specified transitionState - * @param {Void} - * performTransition() - * @return {Void} - */ - widget.performTransition = function(){ - var _self = this; - this.opacity = 0; - this.interval = window.setInterval(function(){ - _self.opacity += 0.2; - if (_self.opacity > 1) { - _self.opacity = 1; - } - window.document.getElementsByTagName("body")[0].style.opacity = _self.opacity + ""; - if (_self.opacity >= 1) { - window.clearInterval(_self.interval); - window.document.getElementsByTagName("body")[0].style.opacity = "1"; - } - //do nothing - }, 50); - //do nothing - } - - - - - - /** - * Set the preferred screen orientation to landscape. - * The display will flip if the phone display orientation - * is portrait and the phone supports landscape mode. - * @param {Void} - * setDisplayLandscape() - * @return {Void} - */ - widget.setDisplayLandscape = function(){ - try { - if (this.isrotationsupported && _BRIDGE_REF.nokia.emulator.orientationSupports()) { - _BRIDGE_REF.nokia.emulator.setMode('landscape'); - } - } - catch (e) { - } - } - - - - - /** - * Set the preferred screen orientation to portrait. - * The display will flip if the phone display orientation - * is landscape and the phone supports portrait mode. - * @param {Void} - * setDisplayPortrait() - * @return {Void} - */ - widget.setDisplayPortrait = function(){ - try { - if (this.isrotationsupported && _BRIDGE_REF.nokia.emulator.orientationSupports()) { - _BRIDGE_REF.nokia.emulator.setMode('portrait'); - } - } - catch (e) { - } - } - - /** - * Allows the definition of a function to be called - * when a Widget.is displayed - * @param {Void} - * onshow() - * @return {Void} - */ - widget.onshow = function(){ - // to be implemented - } - - - - - /** - * Allows the definition of a function to be called - * when a Widget.sent into the background (hidden) - * @param {Void} - * onhide() - * @return {Void} - */ - widget.onhide = function(){ - // to be implemented - } - - - - /** - * This function returns the System API if sysinfo is included in document embed - */ - widget.enableSystemApi = function(){ - - // Identify, and Attach System-Info-Object properties - try { - var parentIframeRef = window.parent.frames[0]; - if (typeof parentIframeRef == 'object') { - if (parentIframeRef.document.embeds.length > 0) { - for (var i = 0; i < parentIframeRef.document.embeds.length; i++) { - //match the system Info API embed tag - if (parentIframeRef.document.embeds[i].type == 'application/x-systeminfo-widget') { - new systemAPI(parentIframeRef.document.embeds[i]); -// widget.sysInfo = parentIframeRef.document.embeds[i]; - - // hide the object - parentIframeRef.document.embeds[i].style.display='none'; - - // push the reference object into widget - widget.sysInfo.push(parentIframeRef.document.embeds[i]); - } - } - } - } - } - catch (e) { - alert('Error in attachSysInfo: ' + e); - } - } - - /** - * - */ - - widget.triggerListener = function(provider, eventType, data){ - if(widget.sysInfo.length){ - for(var i=0; i