/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var historyctr = -1; /** * Open an app with native Android UI elements * @param String api Path to the mobile API * @param String url Base URL of the app * @param String icon URL to the app icon * @param String title Friendly app name * @returns {undefined} */ function launchapp(api, url, icon, title) { app.dialog.progress("Loading...").setText(title); router.navigate({ name: 'app' }); $.post(url + api, { username: localStorage.getItem("username"), key: localStorage.getItem("key"), password: localStorage.getItem("password"), action: "start_session" }, function (data) { if (data.status === 'OK') { $('#appframe').on("load", function () { app.dialog.close(); historyctr++; // Do this right away so it's a bit harder to glitch $('#appframe').contents().find('.navbar-right').html("
  • Back to Menu
  • "); $.get("js/polyfills.js", function (script) { $('#appframe').contents().find('body').append("