Skip to content

Commit

Permalink
Work on adapt-it#507
Browse files Browse the repository at this point in the history
Yet more refactoring... not ready for testing.
  • Loading branch information
eb1 committed Oct 26, 2023
1 parent 1df075a commit 974c71e
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 109 deletions.
16 changes: 1 addition & 15 deletions www/js/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,21 +447,7 @@ define(function (require) {
console.log("newTU");
// update the KB list, then show the view
$.when(window.Application.kbList.fetch({reset: true, data: {projectid: window.Application.currentProject.get("projectid")}})).done(function () {
// create a new / temporary TU to pass in to the TUView
// (this object isn't saved or added to the collection yet)
var newID = window.Application.generateUUID(),
curDate = new Date(),
timestamp = (curDate.getFullYear() + "-" + (curDate.getMonth() + 1) + "-" + curDate.getDay() + "T" + curDate.getUTCHours() + ":" + curDate.getUTCMinutes() + ":" + curDate.getUTCSeconds() + "z"),
theTU = new kbModels.TargetUnit({
tuid: newID,
projectid: window.Application.currentProject.get("projectid"),
source: "",
refstring: [],
timestamp: timestamp,
user: "",
isGloss: 0
});
newTransView = new SearchViews.NewTUView({model: theTU});
newTransView = new SearchViews.NewTUView();
newTransView.delegateEvents();
window.Application.main.show(newTransView);
});
Expand Down
255 changes: 171 additions & 84 deletions www/js/views/SearchViews.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion www/locales/dev/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
"ttlTotalEntries": "Total Entries: __total__",
"lblNewTU": "Add Entry...",
"lblNewRS": "Add Translation...",
"dscNewSP": "Enter a word or phrase in language \"__lang__\".",
"dscNewSP": "Enter a word or phrase in language \"__src__\", and a translation in language \"__tgt__\". You can add more translations by clicking on the \"Add Translation...\" button.",
"dscNewRS": "Enter a translation for \"__source__\".",
"_comment" : "****Add new strings BEFORE this line!****"
},
Expand Down
2 changes: 1 addition & 1 deletion www/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
"ttlTotalEntries": "Total Entries: __total__",
"lblNewTU": "Add Entry...",
"lblNewRS": "Add Translation...",
"dscNewSP": "Enter a word or phrase in language \"__lang__\".",
"dscNewSP": "Enter a word or phrase in language \"__src__\", and a translation in language \"__tgt__\". You can add more translations by clicking on the \"Add Translation...\" button.",
"dscNewRS": "Enter a translation for \"__source__\".",
"_comment" : "****Add new strings BEFORE this line!****"
},
Expand Down
2 changes: 1 addition & 1 deletion www/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
"ttlTotalEntries": "Recuento de elementos: __total__",
"lblNewTU": "Nuevo elemento...",
"lblNewRS": "Nueva Traducción...",
"dscNewSP": "Escriba una palabra o frase en el idioma \"__lang__\".",
"dscNewSP": "Escriba una palabra o frase en el idioma \"__src__\" y una traducción en el idioma \"__tgt__\". Puede agregar más traducciones haciendo clic en el botón \"Nueva traducción...\".",
"dscNewRS": "Escriba una traducción para \"__source__\".",
"_comment" : "****Add new strings BEFORE this line!****"
},
Expand Down
2 changes: 1 addition & 1 deletion www/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
"ttlTotalEntries": "Nombre d'entrées: __total__",
"lblNewTU": "Nouvelle entrée...",
"lblNewRS": "Nouvelle traduction...",
"dscNewSP": "Entrez un mot ou une phrase dans la langue \"__lang__\".",
"dscNewSP": "Entrez un mot ou une expression dans la langue \"__src__\" et une traduction dans la langue \"__tgt__\". Vous pouvez ajouter plus de traductions en cliquant sur le bouton \"Nouvelle traduction...\".",
"dscNewRS": "Entrez une traduction pour \"__source__\".",
"_comment" : "****Add new strings BEFORE this line!****"
},
Expand Down
2 changes: 1 addition & 1 deletion www/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
"ttlTotalEntries": "Contagem de itens: __total__",
"lblNewTU": "Nova iten...",
"lblNewRS": "Nova tradução...",
"dscNewSP": "Digite uma palavra ou frase no idioma \"__lang__\".",
"dscNewSP": "Digite uma palavra ou frase no idioma \"__src__\" e uma tradução no idioma \"__tgt__\". Você pode adicionar mais traduções clicando no botão \"Nova Tradução...\".",
"dscNewRS": "Digite uma tradução para \"__source__\".",
"_comment" : "****Add new strings BEFORE this line!****"
},
Expand Down
13 changes: 8 additions & 5 deletions www/tpl/NewTU.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@
<h2>{{t 'view.lblNewTU'}}</h2>
</div>
</div>
<div id="mobileSelect" class="scroller-notb">
<div id="mobileSelect" class="scroller-bottom-tb">
<div class="chapter-list topcoat-list__container" id="Container" style="width:100%">
<div class="wizard-instructions" id="StepInstructions"></div>
<div class="control-group">
<div class="control-row" id="lblPrompt"></div>
<div class="control-row"><input type="text" id="txtField" class="topcoat-text-input full" value="" required></div>
<div class="control-row"><label id="lblSource" for="txtSource"></label><input type="text" id="txtSource" class="topcoat-text-input full" value="" required></div>
<div class="control-row"><label id="lblTarget" for="txtTarget"></label><input type="text" id="txtTarget" class="topcoat-text-input full" value="" required></div>
</div>
<ul class="topcoat-list__container chapter-list"><li class="topcoat-list__item li-tu"><div class="big-link filter-burnt-orange" id="btnNewRS"><div class="chap-list__item emphasized refstring-list__item"><span class="img-plus-small" style="padding-right: 16px;"></span>{{t 'view.lblNewRS'}}</div></div></li></ul>
<div class="topcoat-list__header hide" id="lblAllTrans">{{t 'view.lblAllTranslations'}} <span class="right">{{t 'view.lblFrequency'}}</span></div>
<ul class="topcoat-list__container chapter-list" id="RefStrings"></ul>
</div>
</div>
</div>
<div class="bottom-tb">
<div id="WizardSteps">
<button class="topcoat-button" id="Cancel"><span id="lblCancel">{{t 'view.lblCancel'}}</span></button>
<button class="topcoat-button" id="Next"><span id="lblNext"></span> <span class="topcoat-icon topcoat-icon--forward" id="imgNext"></span></button>
<button class="topcoat-button" id="Done"><span id="lblDone">{{t 'view.lblDone'}}</span></button>
</div>
</div>

0 comments on commit 974c71e

Please sign in to comment.