Wed, 31 Jul 2013 19:48:00 +0200
Introduce port to the Tizen OS.
michael@14 | 1 | /* |
michael@14 | 2 | * OTPWCalc - One time password challenge response calculator client |
michael@14 | 3 | * Copyright © 2013 Michael Schloh von Bennewitz <michael@schloh.com> |
michael@14 | 4 | * |
michael@14 | 5 | * OTPWCalc is free software: you can redistribute it and/or modify |
michael@14 | 6 | * it under the terms of the European Union Public Licence, either |
michael@14 | 7 | * version 1.1 of the license, or (at your option) any later version. |
michael@14 | 8 | * |
michael@14 | 9 | * OTPWCalc is distributed in the hope that it will be useful, |
michael@14 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty |
michael@14 | 11 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
michael@14 | 12 | * the European Union Public License for more details. |
michael@14 | 13 | * |
michael@14 | 14 | * You should have received a copy of the European Union Public |
michael@14 | 15 | * Licence along with OTPWCalc. If not, please refer to |
michael@14 | 16 | * <http://joinup.ec.europa.eu/software/page/eupl/>. |
michael@14 | 17 | * |
michael@14 | 18 | * This file is part of project OTWPCalc, a one time password challenge |
michael@14 | 19 | * response calculator client and is found at http://otpwcalc.europalab.com/ |
michael@14 | 20 | * |
michael@14 | 21 | * help.js: ECMA JavaScript implementation |
michael@14 | 22 | */ |
michael@14 | 23 | |
michael@14 | 24 | // <![CDATA[ |
michael@14 | 25 | //// This doesn't work with AJAX (use pageinit instead) |
michael@14 | 26 | //// That means JavaScript in the head of any other HTML |
michael@14 | 27 | //// will be ignored, only the data-role="page" is parsed |
michael@14 | 28 | //$(document).ready(function() { |
michael@14 | 29 | //$.mobile.ajaxLinksEnabled = false; |
michael@14 | 30 | //}); |
michael@14 | 31 | $(document).on("mobileinit", function() { |
michael@14 | 32 | $.extend( $.mobile , { |
michael@14 | 33 | pageLoadErrorMessage: 'Either the page cannot be found or it cannot be loaded.' |
michael@14 | 34 | }); |
michael@14 | 35 | //$("#pageid").on("pagebeforeshow", function(event, data) { |
michael@14 | 36 | // alert("the previous page was: " + data.prevPage.attr("id")); |
michael@14 | 37 | //}); |
michael@14 | 38 | }); |
michael@14 | 39 | $(document).on("pageinit", "[data-role='page'].type-interior", function() { |
michael@14 | 40 | $(".ui-collapsible[data-allow-collapse=false]").off("expand collapse"); |
michael@14 | 41 | }); |
michael@14 | 42 | $(document).on("pageinit", "[data-role='page'].oc-swipage", function() { |
michael@14 | 43 | var makepage = "#" + $(this).attr("id"), |
michael@14 | 44 | next = $(this).jqmData("next"), // Next page stored in data-next |
michael@14 | 45 | prev = $(this).jqmData("prev"); // Previous page stored in data-prev |
michael@14 | 46 | |
michael@14 | 47 | if (next) { // Check if data-next attribute is indeed set |
michael@14 | 48 | //// Prefetch next page |
michael@14 | 49 | //$.mobile.loadPage(next); |
michael@14 | 50 | // Navigate to next page on swipe left |
michael@14 | 51 | $(document).on("swipeleft", makepage, function(inev) { |
michael@14 | 52 | inev.stopImmediatePropagation(); |
michael@14 | 53 | $.mobile.changePage(next, {transition: "slide"}); |
michael@14 | 54 | }); |
michael@14 | 55 | } |
michael@14 | 56 | else { // If data-next not set then default to history |
michael@14 | 57 | $(document).on("swipeleft", makepage, function(inev) { |
michael@14 | 58 | inev.stopImmediatePropagation(); |
michael@14 | 59 | window.history.forward({transition: "slide"}); |
michael@14 | 60 | }); |
michael@14 | 61 | } |
michael@14 | 62 | if (prev) { // Check if data-prev attribute is set |
michael@14 | 63 | $(document).on("swiperight", makepage, function(inev) { |
michael@14 | 64 | inev.stopImmediatePropagation(); |
michael@14 | 65 | $.mobile.changePage(prev, {transition: "slide", reverse: true}); |
michael@14 | 66 | }); |
michael@14 | 67 | } |
michael@14 | 68 | else { // If data-prev not set then default to history |
michael@14 | 69 | $(document).on("swiperight", makepage, function(inev) { |
michael@14 | 70 | inev.stopImmediatePropagation(); |
michael@14 | 71 | //history.back(); // or window.history.back(); |
michael@14 | 72 | $.mobile.back({transition: "slide", reverse: true}); |
michael@14 | 73 | }); |
michael@14 | 74 | } |
michael@14 | 75 | }); |