diff --git a/.gitignore b/.gitignore index be9aef270..6a964663b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /3rdparty /coverage /src/css +>>>>>>> 3.0beta diff --git a/.jshintrc b/.jshintrc index 4022f296e..fc607d0f2 100644 --- a/.jshintrc +++ b/.jshintrc @@ -31,4 +31,4 @@ "newcap": false, "expr": true, "scripturl": true -} \ No newline at end of file +} diff --git a/.settings/settings.json b/.settings/settings.json new file mode 100644 index 000000000..20af2f68a --- /dev/null +++ b/.settings/settings.json @@ -0,0 +1,3 @@ +// Place your settings in this file to overwrite default and user settings. +{ +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..df63076b8 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + - "0.8" diff --git a/Gruntfile.js b/Gruntfile.js index 45542593f..2c78bf1d9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -49,7 +49,8 @@ module.exports = function (grunt) { "src/af.drawer.js", "src/af.swipereveal.js", "src/af.desktopBrowsers.js", - "src/af.toast.js" + "src/af.toast.js", + "src/af.lockscreen.js" ] } }, @@ -80,7 +81,8 @@ module.exports = function (grunt) { "src/less/forms.less", "src/less/grid.less", "src/less/lists.less", - "src/less/splitview.less" + "src/less/splitview.less", + "src/less/af.lockscreen.less" ] } } @@ -140,7 +142,8 @@ module.exports = function (grunt) { "src/less/forms.less", "src/less/grid.less", "src/less/lists.less", - "src/less/splitview.less" + "src/less/splitview.less", + "src/less/af.lockscreen.less" ] } } @@ -161,8 +164,8 @@ module.exports = function (grunt) { "watch" ]); - grunt.registerTask("rebuild" , ["concat","closure-compiler","usebanner"]); + grunt.registerTask("rebuild" , ["less","concat","closure-compiler","usebanner"]); grunt.registerTask("hint" , ["jshint"]); grunt.registerTask("test" , ["karma"]); -}; +}; \ No newline at end of file diff --git a/README.md b/README.md index ee74bbe3d..bec04a8ac 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ +DISCONTINUATION OF PROJECT. This project will no longer be maintained by Intel. Intel will not provide or guarantee development of or support for this project, including but not limited to, maintenance, bug fixes, new releases or updates. Patches to this project are no longer accepted by Intel. In an effort to support the developer community, Intel has made this project available under the terms of the MIT X11 License. If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the community, please create your own fork of the project. + # App Framework - a HTML5 targeted Javascript Framework App Framework is a UI framework targeted at HTML5 browsers. -Visit for more information, documentation, and support. - - -#3.0 version +# 3.0 version The 3.0 version of App Framework removes the following @@ -14,62 +13,10 @@ The 3.0 version of App Framework removes the following 3. No longer provides a "Touchlayer", use Fastclick (https://github.com/ftlabs/fastclick) instead. 4. Native scrolling is only used. If you need a JS scroller, use an existing one like FTScroller (https://github.com/ftlabs/ftscroller) or iScroll -##Note -You can still use App Framework 2 if you need Android <4 support or the query selector library. The old query selector library *may* work with AF 3.0, but we do not test or support it. - -# Contribute - -You can contribute to the core code by forking it and make a pull request. Please keep in mind we do not want to add functionality that is a one-off case. These are best dealt with via plugins. - -You can make changes to any of the files in the "src" directory - - - -#Building - -We use Grunt to build our compiled files. When you have made a change, run "grunt rebuild" to compile new source and minified files to include in your PR. - -grunt-closure-compiler requires the closure compiler jar file. The path is set in Gruntfile.js, but by default should exist in a directory called "closure" parallel to App Framework - -``` - -- appframework - -- closure - -- build - -- compiler.jar -``` - -# Pull Requests - -Pull requests will not be considered without the following: - -1. Explanation of the bug -2. Test case that proves the current code base is failing -3. Explanation of the fix - -We will pull the code down and test it and then provide feedback. If everything passes, we will merge and rebuild the files. - - -# Bugs - -Please use github issues and file any bugs with the following - -1. Any error messages from the console - -2. Line numbers of offending code - -3. Test cases - -4. Description of the error - -5. Expected result - -6. Browser/Device you are testing on - - # License App Framework is is licensed under the terms of the MIT License, see the included license.txt file. App Framework uses code from the following software: -1) Karma Test Runner - https://github.com/karma-runner/karma (MIT-X11 License) \ No newline at end of file +1) Karma Test Runner - https://github.com/karma-runner/karma (MIT-X11 License) diff --git a/ajax.html b/ajax.html old mode 100644 new mode 100755 diff --git a/animbase.html b/animbase.html new file mode 100644 index 000000000..0980fe979 --- /dev/null +++ b/animbase.html @@ -0,0 +1,205 @@ + + + + + + + App Framework Kitchen Sink + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ App Framework +
+
+ +

Starting app

+ +
+
+
+

What

+
+
+ + +
+
+
+
+
+ Foobar stuff goes here + +
+ One + two + three +
+
+
+
+
+

Card One

+

Card Two

+
+
+

Meeting

+

This is card content

+
+
+ + +
+ +
+ + + +
+ +
+

+
+
+
+
+
+
+
+

Bar

+
+
+
+ About +
+
+ +
+ +
+
+

Bar

+
+ +
+
+ About +
+
+ +
+ +
+
+
+

Login

+
+ +
+
+
+
+ + + diff --git a/build/af.ui.base.css b/build/af.ui.base.css index 8510436d0..a9594b863 100644 --- a/build/af.ui.base.css +++ b/build/af.ui.base.css @@ -2534,3 +2534,148 @@ header .menuButton:after { position: absolute; width: 15px; } + +#lockScreen { + position: absolute; + top: 0px; + bottom: 0px; + width: 100%; + height: 100%; + left: 0px; + z-index: 99999999999999; + background: #ccc; +} +#lockScreen .flexContainer { + display: -webkit-box; + display: -moz-box; + display: box; + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + box-orient: vertical; + -webkit-box-align: center; + -moz-box-align: center; + box-align: center; + -webkit-box-pack: center; + -moz-box-pack: center; + box-pack: center; +} +#lockScreen .keyboard { + width: 100%; + position: absolute; + bottom: 0px; +} +#lockScreen .keyboard .row { + display: block; + width: 100%; + text-align: center; + height: 50px; + line-height: 50px; + font-size: 1.3em; + font-weight: bold; +} +#lockScreen .keyboard .row div { + display: block; + width: 33.33%; + float: left; + border: 1px solid #000; + justify-content: center; + text-align: center; +} +#lockScreen .keyboard .row div.grey { + background: white; +} +#lockScreen .content { + position: absolute; + top: 0px; + bottom: 170px; + width: 100%; + text-align: center; + -moz-box-flex: 0; + -webkit-box-flex: 0; + -ms-box-flex: 0; + box-flex: 0; + -moz-box-ordinal-group: 1; + -webkit-box-ordinal-group: 1; + -ms-box-ordinal-group: 1; + box-ordinal-group: 1; + align-items: center; + justify-content: center; +} +#lockScreen .touched { + background-color: white; +} +#lockScreen input[type="password"] { + height: 50px; + font-size: 40px; + width: 200px; + text-align: center; +} +#lockScreen .icon { + font-size: 50px; + color: white; + margin-bottom: 10px; +} +#lockScreen .error { + padding-top: 10px; + visibility: hidden; + color: red; + font-weight: bold; + font-size: 1.3em; +} +#lockScreen.round .content { + bottom: 250px; +} +#lockScreen.round .keyboard { + bottom: 10px; +} +#lockScreen.round .keyboard .row { + display: -webkit-box; + display: -moz-box; + display: box; + -webkit-box-align: center; + -moz-box-align: center; + box-align: center; + -webkit-box-pack: center; + -moz-box-pack: center; + box-pack: center; + margin-bottom: 20px; +} +#lockScreen.round .keyboard .row div { + -moz-box-flex: 0; + -webkit-box-flex: 0; + -ms-box-flex: 0; + box-flex: 0; + -moz-box-ordinal-group: 1; + -webkit-box-ordinal-group: 1; + -ms-box-ordinal-group: 1; + box-ordinal-group: 1; + float: none; + width: 60px; + height: 60px; + border-radius: 60px; + line-height: 60px; + margin: 10px; + cursor: pointer; +} +#lockScreen.round .keyboard .row div.grey { + background: transparent; + border: none; +} +#lockScreen.round input[type="password"] { + height: 50px; + font-size: 40px; + width: 200px; + text-align: center; + background: transparent; + color: white; +} +#lockScreen.round input[type="password"]::-webkit-input-placeholder { + color: white; +} +#lockScreen.round input[type="password"]::-moz-placeholder { + /* Firefox 19+ */ + color: white; +} +#lockScreen.round input[type="password"]:-ms-input-placeholder { + color: white; +} diff --git a/build/af.ui.base.less b/build/af.ui.base.less index 760b61e64..018649eeb 100644 --- a/build/af.ui.base.less +++ b/build/af.ui.base.less @@ -2297,4 +2297,167 @@ header { position: absolute; width: 15px; } +} + +#lockScreen { + position: absolute; + top:0px; + bottom:0px; + width:100%; + height:100%; + left:0px; + z-index:99999999999999; + background: #ccc; + + .flexContainer { + display: -webkit-box; + display: -moz-box; + display: box; + + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + box-orient: vertical; + + -webkit-box-align: center; + -moz-box-align: center; + box-align: center; + -webkit-box-pack: center; + -moz-box-pack: center; + box-pack: center; + } + + .keyboard { + width:100%; + position:absolute; + bottom:0px; + .row { + display: block; + width:100%; + text-align: center; + height:50px; + line-height:50px; + font-size:1.3em; + font-weight: bold; + div { + display: block; + width:33.33%; + float:left; + border:1px solid #000; + justify-content: center; + text-align: center; + } + div.grey { + background:white; + } + } + } + + .content { + position:absolute; + top:0px; + bottom:170px; + width:100%; + text-align:center; + -moz-box-flex: 0; + -webkit-box-flex: 0; + -ms-box-flex: 0; + box-flex: 0; + -moz-box-ordinal-group: 1; + -webkit-box-ordinal-group: 1; + -ms-box-ordinal-group: 1; + box-ordinal-group: 1; + align-items: center; + justify-content: center; + } + + + .touched { + background-color: white; + } + + input[type="password"] { + height:50px; + font-size:40px; + width:200px; + text-align: center; + } + + .icon { + font-size:50px; + color:white; + margin-bottom: 10px; + } + .error { + padding-top:10px; + visibility: hidden; + color:red; + font-weight:bold; + font-size:1.3em; + } + + &.round{ + .content { + bottom:250px; + } + .keyboard{ + bottom:10px; + .row { + display: -webkit-box; + display: -moz-box; + display: box; + + -webkit-box-align: center; + -moz-box-align: center; + box-align: center; + + -webkit-box-pack: center; + -moz-box-pack: center; + box-pack: center; + margin-bottom:20px; + div { + -moz-box-flex: 0; + -webkit-box-flex: 0; + -ms-box-flex: 0; + box-flex: 0; + -moz-box-ordinal-group: 1; + -webkit-box-ordinal-group: 1; + -ms-box-ordinal-group: 1; + box-ordinal-group: 1; + float:none; + width:60px; + height:60px; + border-radius:60px; + line-height:60px; + margin:10px; + cursor:pointer; + } + div.grey { + background:transparent; + border:none; + } + } + } + input[type="password"] { + height:50px; + font-size:40px; + width:200px; + text-align: center; + background: transparent; + color:white; + } + + + input[type="password"]::-webkit-input-placeholder { + color: white; + } + + + input[type="password"]::-moz-placeholder { /* Firefox 19+ */ + color: white; + } + + input[type="password"]:-ms-input-placeholder { + color: white; + } + } } \ No newline at end of file diff --git a/build/af.ui.css b/build/af.ui.css index 9e8581c28..487488d8a 100644 --- a/build/af.ui.css +++ b/build/af.ui.css @@ -55,6 +55,151 @@ background-color: #ff0000; } +#lockScreen { + position: absolute; + top: 0px; + bottom: 0px; + width: 100%; + height: 100%; + left: 0px; + z-index: 99999999999999; + background: #ccc; +} +#lockScreen .flexContainer { + display: -webkit-box; + display: -moz-box; + display: box; + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + box-orient: vertical; + -webkit-box-align: center; + -moz-box-align: center; + box-align: center; + -webkit-box-pack: center; + -moz-box-pack: center; + box-pack: center; +} +#lockScreen .keyboard { + width: 100%; + position: absolute; + bottom: 0px; +} +#lockScreen .keyboard .row { + display: block; + width: 100%; + text-align: center; + height: 50px; + line-height: 50px; + font-size: 1.3em; + font-weight: bold; +} +#lockScreen .keyboard .row div { + display: block; + width: 33.33%; + float: left; + border: 1px solid #000; + justify-content: center; + text-align: center; +} +#lockScreen .keyboard .row div.grey { + background: white; +} +#lockScreen .content { + position: absolute; + top: 0px; + bottom: 170px; + width: 100%; + text-align: center; + -moz-box-flex: 0; + -webkit-box-flex: 0; + -ms-box-flex: 0; + box-flex: 0; + -moz-box-ordinal-group: 1; + -webkit-box-ordinal-group: 1; + -ms-box-ordinal-group: 1; + box-ordinal-group: 1; + align-items: center; + justify-content: center; +} +#lockScreen .touched { + background-color: white; +} +#lockScreen input[type="password"] { + height: 50px; + font-size: 40px; + width: 200px; + text-align: center; +} +#lockScreen .icon { + font-size: 50px; + color: white; + margin-bottom: 10px; +} +#lockScreen .error { + padding-top: 10px; + visibility: hidden; + color: red; + font-weight: bold; + font-size: 1.3em; +} +#lockScreen.round .content { + bottom: 250px; +} +#lockScreen.round .keyboard { + bottom: 10px; +} +#lockScreen.round .keyboard .row { + display: -webkit-box; + display: -moz-box; + display: box; + -webkit-box-align: center; + -moz-box-align: center; + box-align: center; + -webkit-box-pack: center; + -moz-box-pack: center; + box-pack: center; + margin-bottom: 20px; +} +#lockScreen.round .keyboard .row div { + -moz-box-flex: 0; + -webkit-box-flex: 0; + -ms-box-flex: 0; + box-flex: 0; + -moz-box-ordinal-group: 1; + -webkit-box-ordinal-group: 1; + -ms-box-ordinal-group: 1; + box-ordinal-group: 1; + float: none; + width: 60px; + height: 60px; + border-radius: 60px; + line-height: 60px; + margin: 10px; + cursor: pointer; +} +#lockScreen.round .keyboard .row div.grey { + background: transparent; + border: none; +} +#lockScreen.round input[type="password"] { + height: 50px; + font-size: 40px; + width: 200px; + text-align: center; + background: transparent; + color: white; +} +#lockScreen.round input[type="password"]::-webkit-input-placeholder { + color: white; +} +#lockScreen.round input[type="password"]::-moz-placeholder { + /* Firefox 19+ */ + color: white; +} +#lockScreen.round input[type="password"]:-ms-input-placeholder { + color: white; +} + #mask { display: block; width: 100%; @@ -579,6 +724,10 @@ .android.light #af_actionsheet a { background: #fff; } +.android.light .view header h1 { + color: black; + text-shadow: none; +} .android .view .panel { background: inherit; color: inherit; diff --git a/build/af.ui.less b/build/af.ui.less index 213163ee4..72838077e 100644 --- a/build/af.ui.less +++ b/build/af.ui.less @@ -1153,6 +1153,169 @@ h2 { } } + +#lockScreen { + position: absolute; + top:0px; + bottom:0px; + width:100%; + height:100%; + left:0px; + z-index:99999999999999; + background: #ccc; + + .flexContainer { + display: -webkit-box; + display: -moz-box; + display: box; + + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + box-orient: vertical; + + -webkit-box-align: center; + -moz-box-align: center; + box-align: center; + -webkit-box-pack: center; + -moz-box-pack: center; + box-pack: center; + } + + .keyboard { + width:100%; + position:absolute; + bottom:0px; + .row { + display: block; + width:100%; + text-align: center; + height:50px; + line-height:50px; + font-size:1.3em; + font-weight: bold; + div { + display: block; + width:33.33%; + float:left; + border:1px solid #000; + justify-content: center; + text-align: center; + } + div.grey { + background:white; + } + } + } + + .content { + position:absolute; + top:0px; + bottom:170px; + width:100%; + text-align:center; + -moz-box-flex: 0; + -webkit-box-flex: 0; + -ms-box-flex: 0; + box-flex: 0; + -moz-box-ordinal-group: 1; + -webkit-box-ordinal-group: 1; + -ms-box-ordinal-group: 1; + box-ordinal-group: 1; + align-items: center; + justify-content: center; + } + + + .touched { + background-color: white; + } + + input[type="password"] { + height:50px; + font-size:40px; + width:200px; + text-align: center; + } + + .icon { + font-size:50px; + color:white; + margin-bottom: 10px; + } + .error { + padding-top:10px; + visibility: hidden; + color:red; + font-weight:bold; + font-size:1.3em; + } + + &.round{ + .content { + bottom:250px; + } + .keyboard{ + bottom:10px; + .row { + display: -webkit-box; + display: -moz-box; + display: box; + + -webkit-box-align: center; + -moz-box-align: center; + box-align: center; + + -webkit-box-pack: center; + -moz-box-pack: center; + box-pack: center; + margin-bottom:20px; + div { + -moz-box-flex: 0; + -webkit-box-flex: 0; + -ms-box-flex: 0; + box-flex: 0; + -moz-box-ordinal-group: 1; + -webkit-box-ordinal-group: 1; + -ms-box-ordinal-group: 1; + box-ordinal-group: 1; + float:none; + width:60px; + height:60px; + border-radius:60px; + line-height:60px; + margin:10px; + cursor:pointer; + } + div.grey { + background:transparent; + border:none; + } + } + } + input[type="password"] { + height:50px; + font-size:40px; + width:200px; + text-align: center; + background: transparent; + color:white; + } + + + input[type="password"]::-webkit-input-placeholder { + color: white; + } + + + input[type="password"]::-moz-placeholder { /* Firefox 19+ */ + color: white; + } + + input[type="password"]:-ms-input-placeholder { + color: white; + } + } +} #mask { display:block; width:100%; @@ -1698,6 +1861,10 @@ h2 { background:#fff; } } + .view header h1 { + color:black; + text-shadow:none; + } } .android .view .panel, { background:inherit; diff --git a/build/appframework.ui.js b/build/appframework.ui.js index 407a0abfd..34ab8207c 100644 --- a/build/appframework.ui.js +++ b/build/appframework.ui.js @@ -1,4 +1,4 @@ -/*! intel-appframework - v3.0.0 - 2014-10-16 */ +/*! intel-appframework - v3.0.0 - 2016-03-26 */ /** * af.shim.js @@ -87,12 +87,13 @@ }); function detectUA($, userAgent) { $.os = {}; + $.os.webkit = userAgent.match(/WebKit\/([\d.]+)/) ? true : false; $.os.android = userAgent.match(/(Android)\s+([\d.]+)/) || userAgent.match(/Silk-Accelerated/) ? true : false; $.os.androidICS = $.os.android && userAgent.match(/(Android)\s4/) ? true : false; $.os.ipad = userAgent.match(/(iPad).*OS\s([\d_]+)/) ? true : false; $.os.iphone = !$.os.ipad && userAgent.match(/(iPhone\sOS)\s([\d_]+)/) ? true : false; - $.os.ios7 = ($.os.ipad||$.os.iphone)&&(userAgent.match(/7_/)||userAgent.match(/8_/)) ? true : false; + $.os.ios7 = ($.os.ipad||$.os.iphone); $.os.webos = userAgent.match(/(webOS|hpwOS)[\s\/]([\d.]+)/) ? true : false; $.os.touchpad = $.os.webos && userAgent.match(/TouchPad/) ? true : false; $.os.ios = $.os.ipad || $.os.iphone; @@ -109,13 +110,27 @@ $.os.kindle=userAgent.match(/Silk-Accelerated/)?true:false; //features $.feat = {}; - $.feat.cssPrefix = $.os.webkit ? "Webkit" : $.os.fennec ? "Moz" : $.os.ie ? "ms" : $.os.opera ? "O" : ""; + $.feat.cssTransformStart = !$.os.opera ? "3d(" : "("; $.feat.cssTransformEnd = !$.os.opera ? ",0)" : ")"; - if ($.os.android && !$.os.webkit) $.os.android = false; + + //IE tries to be webkit + if(userAgent.match(/IEMobile/i)){ + $.each($.os,function(ind){ + $.os[ind]=false; + }); + $.os.ie=true; + $.os.ieTouch=true; + } + var items=["Webkit","Moz","ms","O"]; + for(var j=0;j0){ - - var toTarget=hist[hist.length-1].target; - if(!toTarget||item.target===toTarget) return; - this.runTransition(item.transition,item.target,toTarget,true); - this.loadContentData(toTarget,view,true); - + var toTarget = hist[hist.length-1].target; + if(!toTarget) return; + if(isSameView && (item.target===toTarget)) return; + if (!isSameView) { + this.clearHistory(); //Clear current view history + this.runViewTransition(this.transitionType, targetView, currentView, item.target, true); + } + else { + this.runTransition(item.transition, item.target, toTarget, true); + } + this.loadContentData(toTarget, targetView, true); this.updateHash(toTarget.id); } else { @@ -779,7 +817,7 @@ window.af=window.jq=jQuery; * @title $.afui.setBackButtonText(title) */ setBackButtonText:function(text){ - $(this.activeDiv).parent().find("header .backButton").html(text); + $(this.activeDiv).closest(".view").find("header .backButton").html(text); }, /** * Set the title of the active header from @@ -818,13 +856,13 @@ window.af=window.jq=jQuery; /** * Set the visibility of the back button for the current header ``` - $.afui.setBackButtonVisbility(true) + $.afui.setBackButtonVisibility(true) ``` * @param {boolean} Boolean to set the visibility. true show, false hide - * @title $.afui.setBackButtonVisbility + * @title $.afui.setBackButtonVisibility */ setBackButtonVisibility:function(what){ - var visibility=what?"visibile":"hidden"; + var visibility=what?"visible":"hidden"; $(this.activeDiv).closest(".view").children("header").find(".backButton").css("visibility",visibility); }, @@ -840,7 +878,7 @@ window.af=window.jq=jQuery; * @param {string} target * @param {string} value * @param {string=} position - * @param {(string=|object)} color Color or CSS hash + * @param {string=} color Color or CSS hash * @title $.afui.updateBadge(target,value,[position],[color]) */ updateBadge: function(target, value, position, color) { @@ -891,10 +929,20 @@ window.af=window.jq=jQuery; * @param {string=} text * @title $.afui.showMask(text); */ - showMask: function(text) { + showMask: function(text, value) { if (!text) text = this.loadingText || ""; + if (!value || typeof value !== "number") timeout = 15000; $.query("#afui_mask>h1").html(text); $.query("#afui_mask").show(); + this.showingMask = true; + + var self = this; + //set another timeout to auto-hide the mask if something goes wrong, default is 15 sec + setTimeout(function() { + if(self.showingMask) { + self.hideMask(); + } + }, value); }, /** * Hide the loading mask @@ -905,6 +953,7 @@ window.af=window.jq=jQuery; */ hideMask: function() { $.query("#afui_mask").hide(); + this.showingMask = false; }, /** * @api private @@ -937,7 +986,7 @@ window.af=window.jq=jQuery; if (this.doingTransition) { return; } - + anchor = anchor || document.createElement("a"); //Hack to allow passing in no anchor if (target.length === 0) return; if(target.indexOf("#")!==-1){ this.loadDiv(target, newView, back, transition,anchor); @@ -960,15 +1009,19 @@ window.af=window.jq=jQuery; */ loadDiv: function(target, newView, back, transition,anchor) { // load a div - var newDiv = target.replace("#", ""); + var newDiv = target; + var hashIndex = newDiv.indexOf("#"); var slashIndex = newDiv.indexOf("/"); - var hashLink = ""; - if (slashIndex !== -1) { - // Ignore everything after the slash for loading - hashLink = newDiv.substr(slashIndex); - newDiv = newDiv.substr(0, slashIndex); + if ((slashIndex !== -1)&&(hashIndex !== -1)) { + //Ignore everything after the slash in the hash part of a URL + //For example: app.com/#panelid/option1/option2 will become -> app.com/#panelid + //For example: app.com/path/path2/path3 will still be -> app.com/path/path2/path3 + if (slashIndex > hashIndex) { + newDiv = newDiv.substr(0, slashIndex); + } } + newDiv = newDiv.replace("#", ""); newDiv = $.query("#" + newDiv).get(0); if (!newDiv) { @@ -1009,7 +1062,7 @@ window.af=window.jq=jQuery; var isNewView=false; //check nested views if(!isSplitViewParent) - isSplitViewParent=currentView.parent().closest('.view').length===1; + isSplitViewParent=currentView.parent().closest(".view").length===1; if(isSplitViewParent&¤tView&¤tView.get(0)!==view.get(0)) $(currentView).trigger("nestedviewunload"); @@ -1080,11 +1133,26 @@ window.af=window.jq=jQuery; @title $.afui.setActiveTab */ setActiveTab:function(ele,view){ - var hash; + var elementId; if(typeof(ele)!=="string") - hash=$(ele).prop("id"); - hash="#"+hash; - view.find("footer").find("a").removeClass("pressed").attr("data-ignore-pressed","true").filter("[href='"+hash+"']").addClass("pressed"); + elementId=$(ele).prop("id"); + /* + Check if an item exists: + Note that footer hrefs' may point to elements preceded by a # when trying to load a div (f.ex.: