diff --git a/config.xml b/config.xml index 7d8a5899..8a503755 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + Adapt It Mobile An open source application for translating between related languages. diff --git a/package.json b/package.json index ea6cdd3e..02e8b183 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adapt-it-mobile", - "version": "1.17.1", + "version": "1.17.2", "description": "Adapt It Mobile", "repository": { "type": "git", diff --git a/www/js/Application.js b/www/js/Application.js index 2b068106..e36fad5b 100755 --- a/www/js/Application.js +++ b/www/js/Application.js @@ -78,8 +78,8 @@ define(function (require) { searchIndex: 0, currentProject: null, localURLs: [], - version: "1.17.1", // appended with Android / iOS build info - AndroidBuild: "60", // (was milestone release #) + version: "1.17.2", // appended with Android / iOS build info + AndroidBuild: "61", // (was milestone release #) iOSBuild: "1", // iOS uploaded build number for this release (increments from 1 for each release) importingURL: "", // for other apps in Android-land sending us files to import @@ -405,6 +405,15 @@ define(function (require) { window.Application.main.show(new ProjectViews.EditProjectView({model: proj[0]})); } }, + editProjectPage: function (id, page) { + // edit the selected project + var proj = this.ProjectList.where({projectid: id}); + var projView = new ProjectViews.EditProjectView({model: proj[0]}); + if (proj !== null) { + window.Application.main.show(projView); + projView.ShowView(parseInt(page, 10)); + } + }, // Copy project view copyProject: function () { var proj = new projModel.Project(); diff --git a/www/js/router.js b/www/js/router.js index 0bec980d..3e5fe9c3 100755 --- a/www/js/router.js +++ b/www/js/router.js @@ -17,6 +17,7 @@ define(function (require) { "copy": "copyProject", // #copy "project": "newProject", // #project "project/:id": "editProject", // #project/projectID + "project/:id/:page": "editProjectPage", // #project/projectID/page number (detail view for edit project) "search/:id": "lookupChapter", // #search/projectID "kb/:id": "editKB", // #kb/projectID (KB editor) "tu": "newTU", // #tu (create a new TU) diff --git a/www/js/views/ProjectViews.js b/www/js/views/ProjectViews.js index 96f9fc26..37b6c762 100644 --- a/www/js/views/ProjectViews.js +++ b/www/js/views/ProjectViews.js @@ -1123,17 +1123,7 @@ define(function (require) { 'change': 'render' }, events: { - "click #EditorUIPrefs": "OnEditorUIPrefs", - "click #CurrentProject": "OnCurrentProject", "click #KBEditor": "OnKBEditor", - "click #SourceLanguage": "OnEditSourceLanguage", - "click #TargetLanguage": "OnEditTargetLanguage", - "click #sourceFont": "OnEditSourceFont", - "click #targetFont": "OnEditTargetFont", - "click #navFont": "OnEditNavFont", - "click #Punctuation": "OnEditPunctuation", - "click #Cases": "OnEditCases", - "click #Filtering": "OnEditFiltering", "focus #LanguageName": "onFocusLanguageName", "keydown #LanguageName": "onKeydownLanguageName", "focus #LanguageVariant": "onFocusLanguageVariant", @@ -1151,17 +1141,10 @@ define(function (require) { "click #Cancel": "OnCancel", "click #OK": "OnOK" }, - OnEditorUIPrefs: function () { - step = 9; - this.ShowView(step); - }, - OnCurrentProject: function () { - step = 10; - this.ShowView(step); - }, OnKBEditor: function () { // KB editor is on a separate screen; tell the application to display it - window.Application.editKB(window.Application.currentProject.get("projectid")); + // URL is: kb/:projectid + window.Application.router.navigate("kb/" + window.Application.currentProject.get("projectid"), {trigger: true}); }, onFocusLanguageName: function (event) { window.Application.scrollIntoViewCenter(event.currentTarget); @@ -1252,63 +1235,27 @@ define(function (require) { OnClickCustomFilters: function (event) { currentView.onClickCustomFilters(event); }, - OnEditSourceLanguage: function () { - step = 1; - this.ShowView(step); - }, - OnEditTargetLanguage: function () { - step = 2; - this.ShowView(step); - }, - OnEditSourceFont: function () { - step = 3; - this.ShowView(step); - }, - OnEditTargetFont: function () { - step = 4; - this.ShowView(step); - }, - OnEditNavFont: function () { - step = 5; - this.ShowView(step); - }, - OnEditPunctuation: function () { - step = 6; - this.ShowView(step); - }, - OnEditCases: function () { - step = 7; - this.ShowView(step); - }, - OnEditFiltering: function () { - step = 8; - this.ShowView(step); - }, OnCancel: function () { - // just display the project settings list (don't save) - $("#WizStepTitle").hide(); - $("#StepInstructions").addClass("hide"); - $("#tbBottom").addClass("hide"); - $('#ProjectItems').removeClass("hide"); - $("#StepTitle").html(i18n.t('view.lblProjectSettings')); - $(".container").attr("style", "height: calc(100% - 70px);"); - $("#editor").removeClass("scroller-bottom-tb"); - $("#editor").addClass("scroller-notb"); - this.removeRegion("container"); + // just go back (don't save) + if (window.history.length > 1) { + // there actually is a history -- go back + window.history.back(); + } else { + // no history (import link from outside app) -- just go home + window.location.replace(""); + } }, OnOK: function () { // save the info from the current step this.UpdateProject(step); - // show / hide the appropriate UI elements - $("#WizStepTitle").hide(); - $("#StepInstructions").addClass("hide"); - $("#tbBottom").addClass("hide"); - $('#ProjectItems').removeClass("hide"); - $("#StepTitle").html(i18n.t('view.lblProjectSettings')); - $(".container").attr("style", "height: calc(100% - 70px);"); - $("#editor").removeClass("scroller-bottom-tb"); - $("#editor").addClass("scroller-notb"); - this.removeRegion("container"); + // go back + if (window.history.length > 1) { + // there actually is a history -- go back + window.history.back(); + } else { + // no history (import link from outside app) -- just go home + window.location.replace(""); + } }, UpdateProject: function (step) { @@ -1465,6 +1412,8 @@ define(function (require) { this.addRegions({ container: "#StepContainer" }); + // set the current step # + step = number; // hide the project list items $("#WizStepTitle").show(); $("#StepInstructions").removeClass("hide"); diff --git a/www/tpl/EditProject.html b/www/tpl/EditProject.html index 013e52eb..758adfbd 100644 --- a/www/tpl/EditProject.html +++ b/www/tpl/EditProject.html @@ -3,7 +3,7 @@ }}