From e23ad3b0d57c4941dd41a23490cd9d5b103c20ca Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Thu, 21 Dec 2017 00:34:05 -0700 Subject: [PATCH] Minor code formatting adjustments --- www/js/app.js | 266 +++++++++++++++++++------------------- www/js/sidemenu.js | 26 ++-- www/views/addotp.html | 198 ++++++++++++++-------------- www/views/app.html | 198 ++++++++++++++-------------- www/views/appspinner.html | 38 +++--- www/views/credits.html | 180 +++++++++++++------------- www/views/home.html | 56 ++++---- www/views/otp.html | 48 +++---- www/views/setup1.html | 2 +- www/views/setup2.html | 2 +- 10 files changed, 507 insertions(+), 507 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index abb5958..03288a1 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -4,28 +4,30 @@ userinfo = null; -document.addEventListener("deviceready", function () { - if (cordova.platformId == 'android') { - StatusBar.backgroundColorByHexString("#1976d2"); - } - - // Enable/disable jQuery animations depending on user preference - $.fx.off = !(localStorage.getItem("animations") === null || localStorage.getItem("animations") === "true"); - - /* Fade out alerts */ - $(".alert .close").click(function (e) { - $(this).parent().fadeOut("slow"); - }); - - if (localStorage.getItem("setupcomplete")) { - getuserinfo(function () { - openscreen("home"); - }); +/** + * Switches the app to the given screen. + * @param {String} screenname The name of the screen to show. + * @param {String} effect FADE, SLIDE, or nothing + * @returns {undefined} + */ +function openscreen(screenname, effect) { + if (effect === 'FADE') { + $('#content-zone').fadeOut(300, function () { + $('#content-zone').load("views/" + screenname + ".html", function () { + $('#content-zone').fadeIn(300); + }); + }); + } else if (effect === 'SLIDE') { + $('#content-zone').slideToggle('400', function () { + $('#content-zone').load("views/" + screenname + ".html", function () { + $('#content-zone').slideToggle('400'); + }); + }); } else { - openscreen("setup1"); + $('#content-zone').load("views/" + screenname + ".html"); } - setTimeout(navigator.splashscreen.hide, 1000); -}, false); + currentscreen = screenname; +} /** * Fetch user info (name, email, etc) from the server and save to the global @@ -36,67 +38,42 @@ document.addEventListener("deviceready", function () { function getuserinfo(callback) { $(".loading-text").text("Loading account..."); $.post(localStorage.getItem("syncurl"), { - username: localStorage.getItem("username"), - key: localStorage.getItem("key"), - password: localStorage.getItem("password"), - action: "user_info" + username: localStorage.getItem("username"), + key: localStorage.getItem("key"), + password: localStorage.getItem("password"), + action: "user_info" }, function (data) { - if (data.status === 'OK') { - $(".loading-text").text("Loading..."); - userinfo = data.info; - if (typeof callback == 'function') { - callback(); - } - } else { - navigator.notification.alert(data.msg, null, "Error", 'Dismiss'); - openscreen("homeloaderror"); - } + if (data.status === 'OK') { + $(".loading-text").text("Loading..."); + userinfo = data.info; + if (typeof callback == 'function') { + callback(); + } + } else { + navigator.notification.alert(data.msg, null, "Error", 'Dismiss'); + openscreen("homeloaderror"); + } }, "json").fail(function () { - navigator.notification.alert("Could not connect to the server. Try again later.", null, "Error", 'Dismiss'); - openscreen("homeloaderror"); + navigator.notification.alert("Could not connect to the server. Try again later.", null, "Error", 'Dismiss'); + openscreen("homeloaderror"); }); } -/** - * Switches the app to the given screen. - * @param {String} screenname The name of the screen to show. - * @param {String} effect FADE, SLIDE, or nothing - * @returns {undefined} - */ -function openscreen(screenname, effect) { - if (effect === 'FADE') { - $('#content-zone').fadeOut(300, function () { - $('#content-zone').load("views/" + screenname + ".html", function () { - $('#content-zone').fadeIn(300); - }); - }); - } else if (effect === 'SLIDE') { - $('#content-zone').slideToggle('400', function () { - $('#content-zone').load("views/" + screenname + ".html", function () { - $('#content-zone').slideToggle('400'); - }); - }); - } else { - $('#content-zone').load("views/" + screenname + ".html"); - } - currentscreen = screenname; -} - function openfragment(fragment, target, effect) { if (effect === 'FADE') { - $(target).fadeOut('slow', function () { - $(target).load("views/" + fragment + ".html", function () { - $(target).fadeIn('slow'); - }); - }); + $(target).fadeOut('slow', function () { + $(target).load("views/" + fragment + ".html", function () { + $(target).fadeIn('slow'); + }); + }); } else if (effect === 'SLIDE') { - $(target).slideToggle('400', function () { - $(target).load("views/" + fragment + ".html", function () { - $(target).slideToggle('400'); - }); - }); + $(target).slideToggle('400', function () { + $(target).load("views/" + fragment + ".html", function () { + $(target).slideToggle('400'); + }); + }); } else { - $(target).load("views/" + fragment + ".html"); + $(target).load("views/" + fragment + ".html"); } } @@ -112,45 +89,45 @@ function openfragment(fragment, target, effect) { function setnavbar(type, title, returnscreen) { var navbar = $('#navbar-header'); if (type == false) { - $('#navbar').css('display', 'none'); - $('#content-zone').css('margin-top', '0px'); + $('#navbar').css('display', 'none'); + $('#content-zone').css('margin-top', '0px'); } else { - if (cordova.platformId == 'android') { - StatusBar.backgroundColorByHexString("#1976d2"); - window.plugins.headerColor.tint("#2196f3"); - } else { - StatusBar.backgroundColorByHexString("#2196f3"); - } - $('#navbar').css('display', 'initial'); - $('#content-zone').css('margin-top', '75px'); - if (returnscreen === undefined) { - returnscreen = "home"; - _returnscreen = null; - } else { - _returnscreen = returnscreen; - } - navbar.fadeOut(150, function () { - switch (type) { - case "home": - navbar.html('Business     '); - break; - case "setup": - navbar.html('Business   '); - break; - case "settings": - navbar.html('Settings'); - break; - case "otp": - navbar.html('Auth Keys'); - break; - case "app": - navbar.html('' + title + ''); - break; - default: - navbar.html('Business'); - } - navbar.fadeIn(150); - }); + if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#1976d2"); + window.plugins.headerColor.tint("#2196f3"); + } else { + StatusBar.backgroundColorByHexString("#2196f3"); + } + $('#navbar').css('display', 'initial'); + $('#content-zone').css('margin-top', '75px'); + if (returnscreen === undefined) { + returnscreen = "home"; + _returnscreen = null; + } else { + _returnscreen = returnscreen; + } + navbar.fadeOut(150, function () { + switch (type) { + case "home": + navbar.html('Business     '); + break; + case "setup": + navbar.html('Business   '); + break; + case "settings": + navbar.html('Settings'); + break; + case "otp": + navbar.html('Auth Keys'); + break; + case "app": + navbar.html('' + title + ''); + break; + default: + navbar.html('Business'); + } + navbar.fadeIn(150); + }); } } @@ -167,11 +144,11 @@ function setnavbar(type, title, returnscreen) { */ function openapp(id, api, url, icon, title, injectcode, shownavbar) { $('#content-zone').fadeOut(300, function () { - $('#content-zone').load("views/app.html", function () { - $('#content-zone').fadeIn(300, function () { - launchapp(id, api, url, icon, title, injectcode, shownavbar); - }); - }); + $('#content-zone').load("views/app.html", function () { + $('#content-zone').fadeIn(300, function () { + launchapp(id, api, url, icon, title, injectcode, shownavbar); + }); + }); }); } @@ -183,8 +160,8 @@ function openapp(id, api, url, icon, title, injectcode, shownavbar) { */ function openmodal(filename, modalselector) { $('#modal-load-box').load("views/" + filename + ".html", null, function (x) { - $(modalselector).css('z-index', 9999999); - $(modalselector).modal('show'); + $(modalselector).css('z-index', 9999999); + $(modalselector).modal('show'); }); } @@ -201,28 +178,51 @@ function restartApplication() { navigator.splashscreen.show(); // We're doing the timeout so we don't run afoul of server-side rate limiting setTimeout(function () { - window.location = "index.html"; + window.location = "index.html"; }, 3000); } // Handle back button to close things document.addEventListener("backbutton", function (event) { if (localStorage.getItem("setupcomplete")) { - if ($("#appframe").length && historyctr > 0) { - console.log("going back"); - var iframe = document.getElementById("appframe"); - iframe.contentWindow.postMessage("goback", "*"); - historyctr--; - } else if (_returnscreen != null) { - openscreen(_returnscreen, "FADE"); - _returnscreen = null; - } else { - openscreen("home", "FADE"); - } + if ($("#appframe").length && historyctr > 0) { + console.log("going back"); + var iframe = document.getElementById("appframe"); + iframe.contentWindow.postMessage("goback", "*"); + historyctr--; + } else if (_returnscreen != null) { + openscreen(_returnscreen, "FADE"); + _returnscreen = null; + } else { + openscreen("home", "FADE"); + } + } else { + if (_returnscreen != null) { + openscreen(_returnscreen, "FADE"); + _returnscreen = null; + } + } +}, false); + +document.addEventListener("deviceready", function () { + if (cordova.platformId == 'android') { + StatusBar.backgroundColorByHexString("#1976d2"); + } + + // Enable/disable jQuery animations depending on user preference + $.fx.off = !(localStorage.getItem("animations") === null || localStorage.getItem("animations") === "true"); + + /* Fade out alerts */ + $(".alert .close").click(function (e) { + $(this).parent().fadeOut("slow"); + }); + + if (localStorage.getItem("setupcomplete")) { + getuserinfo(function () { + openscreen("home"); + }); } else { - if (_returnscreen != null) { - openscreen(_returnscreen, "FADE"); - _returnscreen = null; - } + openscreen("setup1"); } + setTimeout(navigator.splashscreen.hide, 1000); }, false); \ No newline at end of file diff --git a/www/js/sidemenu.js b/www/js/sidemenu.js index 5013c65..b176b9b 100644 --- a/www/js/sidemenu.js +++ b/www/js/sidemenu.js @@ -9,12 +9,12 @@ // This code from // https://stackoverflow.com/a/6177502 $.cssHooks.backgroundColor = { - get: function(elem) { + get: function (elem) { if (elem.currentStyle) var bg = elem.currentStyle["backgroundColor"]; else if (window.getComputedStyle) var bg = document.defaultView.getComputedStyle(elem, - null).getPropertyValue("background-color"); + null).getPropertyValue("background-color"); if (bg.search("rgb") == -1) return bg; else { @@ -60,11 +60,11 @@ $(document).ready(function () { var logo = "__LOGO__"; $('body').append("
" + username + "
\n
"); $('body').append("
"); - + $(".navbar-brand").attr("href", "#"); - + parent.postMessage("setcolor " + menucolor, "*"); - + $('button.navbar-toggle[data-toggle="collapse"]').click(togglemenu); $('#swipe-shader').click(togglemenu); @@ -77,11 +77,11 @@ $(document).ready(function () { openmenu(); } }); - + Hammer(document.body).on("swipeleft", function (e) { closemenu(); }); - + window.addEventListener('message', function (event) { if (event.data.startsWith("coderesult~|~")) { var data = event.data.split("~|~"); @@ -92,12 +92,12 @@ $(document).ready(function () { $(ref).trigger("change"); console.log("app: received " + event.data); } else if (event.data.startsWith("goback")) { - console.log("app: received " + event.data); - window.history.back(); - parent.postMessage('goneback','*'); - } + console.log("app: received " + event.data); + window.history.back(); + parent.postMessage('goneback', '*'); + } }); - + setInterval(function () { $.getJSON("mobile/index.php", {action: "ping"}, function (d) { console.log("app: keepalive ping " + d.status); @@ -106,7 +106,7 @@ $(document).ready(function () { }); function quitapp() { - parent.postMessage('quit','*'); + parent.postMessage('quit', '*'); } function scancode(refstring) { diff --git a/www/views/addotp.html b/www/views/addotp.html index 7f7a601..540c44c 100644 --- a/www/views/addotp.html +++ b/www/views/addotp.html @@ -25,124 +25,124 @@ \ No newline at end of file diff --git a/www/views/appspinner.html b/www/views/appspinner.html index 10f7edf..4d800e5 100644 --- a/www/views/appspinner.html +++ b/www/views/appspinner.html @@ -122,24 +122,24 @@
Give up
\ No newline at end of file diff --git a/www/views/credits.html b/www/views/credits.html index 63f40c9..b57ed37 100644 --- a/www/views/credits.html +++ b/www/views/credits.html @@ -235,7 +235,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -
+

catfan/medoo

MIT License
 
@@ -258,9 +258,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
-
-
-
+ +
+

twbs/bootstrap

The MIT License (MIT)
 
@@ -283,9 +283,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
-
-
+ +
+

bassjobsen/Bootstrap-3-Typeahead

MIT License
 
@@ -296,8 +296,8 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
+
+

DataTables/DataTables

Copyright (c) 2008-2015 SpryMedia Limited
 http://datatables.net
@@ -319,9 +319,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
-
-
+ +
+

npm/npm

The npm application
 Copyright (c) npm, Inc. and Contributors
@@ -558,9 +558,9 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 --------
-
-
-
+ +
+

FortAwesome/Font-Awesome

SIL OPEN FONT LICENSE
 
@@ -620,9 +620,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRES
 
 =================================
 
-
-
-
+ +
+

thomaspark/bootswatch

The MIT License (MIT)
 
@@ -645,9 +645,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
-
-
+ +
+

composer/composer

Copyright (c) Nils Adermann, Jordi Boggiano
 
@@ -668,9 +668,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
-
-
+ +
+

nwjs/nw.js

Copyright (c) 2012-2015 Intel Corp
 Copyright (c) 2012-2015 The Chromium Authors
@@ -691,9 +691,9 @@ A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYR
 IGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WIT
 H THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
+ +
+

google/material-design-icons

                                  Apache License
@@ -897,8 +897,8 @@ H THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-
-
+
+

guzzle/guzzle

Copyright (c) 2011-2016 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
 
@@ -919,9 +919,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
-
-
+ +
+

ezyang/htmlpurifier

		  GNU LESSER GENERAL PUBLIC LICENSE
 		       Version 2.1, February 1999
@@ -1427,9 +1427,9 @@ necessary.  Here is a sample; alter the names:
 That's all there is to it!
 
     vim: et sw=4 sts=4
-
-
-
+ +
+

endroid/qrcode

Copyright (c) Jeroen van den Enden
 
@@ -1450,9 +1450,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
-
-
+ +
+

ldaptools/ldaptools

Copyright (c) 2015 Chad Sikorra
 
@@ -1473,8 +1473,8 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
-
+
+

phpmailer/phpmailer

                  GNU LESSER GENERAL PUBLIC LICENSE
                        Version 2.1, February 1999
@@ -1978,8 +1978,8 @@ necessary.  Here is a sample; alter the names:
   Ty Coon, President of Vice
 
 That's all there is to it!
-
-
+
+

spomky-labs/otphp

The MIT License (MIT)
 
@@ -2001,9 +2001,9 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
+ +
+

jquery/jquery

Copyright JS Foundation and other contributors, https://js.foundation/
 
@@ -2041,9 +2041,9 @@ All files located in the node_modules and external directories are
 externally maintained libraries used by this software which have their
 own licenses; we recommend you read them, as their terms may differ from
 the terms above.
-
-
-
+ +
+

pawelczak/EasyAutocomplete

The MIT License (MIT)
 
@@ -2066,9 +2066,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
-
-
+ +
+

jquery/jquery-ui

Copyright jQuery Foundation and other contributors, https://jquery.org/
 
@@ -2113,9 +2113,9 @@ All files located in the node_modules and external directories are
 externally maintained libraries used by this software which have their
 own licenses; we recommend you read them, as their terms may differ from
 the terms above.
-
-
-
+ +
+

Eonasdan/bootstrap-datetimepicker

The MIT License (MIT)
 
@@ -2138,9 +2138,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
-
-
-
+ +
+

moment/moment

Copyright (c) JS Foundation and other contributors
 
@@ -2164,9 +2164,9 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
-
-
-
+ +
+

becvert/cordova-plugin-zeroconf

The MIT License (MIT)
 
@@ -2190,9 +2190,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 
-
-
-
+ +
+

tomloprod/cordova-plugin-headercolor

The MIT License (MIT)
 
@@ -2203,9 +2203,9 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
+ +
+

whiteoctober/cordova-plugin-app-version

Copyright (c) 2013 White October
 
@@ -2227,9 +2227,9 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
+ +
+

phonegap/phonegap-plugin-barcodescanner

Copyright 2010 Matt Kane
 Copyright 2011 IBM Corporation
@@ -2253,9 +2253,9 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
+ +
+

apache/cordova-android

                                  Apache License
@@ -2571,9 +2571,9 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 
-
-
-
+ +
+

apache/cordova-ios

                                  Apache License
@@ -2831,9 +2831,9 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
+ +
+

apache/cordova-js

                                  Apache License
@@ -3130,8 +3130,8 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
-
+
+

thephpleague/csv

The MIT License (MIT)
 
@@ -3153,9 +3153,9 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
+ +
+

Lapinator/odsPhpGenerator

GNU LESSER GENERAL PUBLIC LICENSE
 Version 3, 29 June 2007
@@ -3228,8 +3228,8 @@ Each version is given a distinguishing version number. If the Library as you rec
 
 If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall
 apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
-
-
+
+

jiangts/JS-OTP

MIT License
 
@@ -3252,9 +3252,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
-
-
-
+ +
+

hammerjs/hammer.js

The MIT License (MIT)
 
@@ -3277,5 +3277,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
-
-
\ No newline at end of file + +
\ No newline at end of file diff --git a/www/views/home.html b/www/views/home.html index 63c6728..d0e4eca 100644 --- a/www/views/home.html +++ b/www/views/home.html @@ -15,37 +15,37 @@ \ No newline at end of file diff --git a/www/views/otp.html b/www/views/otp.html index 65aab3e..7573dd0 100644 --- a/www/views/otp.html +++ b/www/views/otp.html @@ -26,34 +26,34 @@ var ls_text = localStorage.getItem("otp"); var keys = []; if (ls_text !== null && ls_text != "") { - var keys = JSON.parse(ls_text || "[]"); - if (keys.length > 0) { - $("#nokeys").css("display", "none"); - } - for (var i = 0; i < keys.length; i++) { - var code = totp.getOtp(keys[i]["secret"]); - // Escape HTML characters - var label = $('
').html(keys[i]["label"]).html(); - var issuer = $('
').text(keys[i]["issuer"]).html(); - $("#codelist").append("
" - + "" - + "

" + label + "

" - + "
" + code + "
" - + "

" + issuer + "

" - + "
"); - } + var keys = JSON.parse(ls_text || "[]"); + if (keys.length > 0) { + $("#nokeys").css("display", "none"); + } + for (var i = 0; i < keys.length; i++) { + var code = totp.getOtp(keys[i]["secret"]); + // Escape HTML characters + var label = $('
').html(keys[i]["label"]).html(); + var issuer = $('
').text(keys[i]["issuer"]).html(); + $("#codelist").append("
" + + "" + + "

" + label + "

" + + "
" + code + "
" + + "

" + issuer + "

" + + "
"); + } } function refreshCountdown() { - var percent = ((30 - ((new Date).getSeconds() % 30)) / 30) * 100; - $("#countdown").css("width", percent + "%"); + var percent = ((30 - ((new Date).getSeconds() % 30)) / 30) * 100; + $("#countdown").css("width", percent + "%"); } function refreshCodes() { - for (var i = 0; i < keys.length; i++) { - var code = totp.getOtp(keys[i]["secret"]); - $("#codelist #codeitem_" + i + " .code").text(code); - } + for (var i = 0; i < keys.length; i++) { + var code = totp.getOtp(keys[i]["secret"]); + $("#codelist #codeitem_" + i + " .code").text(code); + } } function deleteCode(index) { @@ -68,8 +68,8 @@ } setInterval(function () { - refreshCountdown(); - refreshCodes(); + refreshCountdown(); + refreshCodes(); }, 1000); refreshCountdown(); diff --git a/www/views/setup1.html b/www/views/setup1.html index bc6b010..4328472 100644 --- a/www/views/setup1.html +++ b/www/views/setup1.html @@ -76,7 +76,7 @@ } $('#key').val(formatted.toUpperCase()); }); - + $('#username').on("keyup", function () { $('#username').val($('#username').val().toLowerCase()); }); diff --git a/www/views/setup2.html b/www/views/setup2.html index 09e1638..980305a 100644 --- a/www/views/setup2.html +++ b/www/views/setup2.html @@ -37,6 +37,6 @@ navigator.notification.alert("Could not connect to the server. Try again later.", null, "Error", 'Dismiss'); }); } - + setnavbar("setup"); \ No newline at end of file