diff --git a/package-lock.json b/package-lock.json index 27c62def3a..13d325b054 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9821,17 +9821,17 @@ "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", "dev": true, "requires": { - "globule": "1.2.0" + "globule": "1.2.1" } }, "globule": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz", - "integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", + "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", "dev": true, "requires": { "glob": "7.1.2", - "lodash": "4.17.5", + "lodash": "4.17.10", "minimatch": "3.0.4" } }, @@ -9876,6 +9876,12 @@ "sshpk": "1.13.1" } }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, "lru-cache": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", diff --git a/src/angular-app/bellows/core/offline/editor-data.service.ts b/src/angular-app/bellows/core/offline/editor-data.service.ts index efea426df0..77b2cf8924 100644 --- a/src/angular-app/bellows/core/offline/editor-data.service.ts +++ b/src/angular-app/bellows/core/offline/editor-data.service.ts @@ -34,7 +34,7 @@ class EntryListModifiers { } export class EditorDataService { - readonly browserInstanceId = Math.floor(Math.random() * 1000000); + readonly browserInstanceId: string = Math.floor(Math.random() * 1000000).toString(); entries: any[] = []; visibleEntries: any[] = []; @@ -80,7 +80,7 @@ export class EditorDataService { /** * Called when loading the controller */ - loadEditorData = (lexiconScope?: any): angular.IPromise => { + loadEditorData = (): angular.IPromise => { const deferred = this.$q.defer(); if (this.entries.length === 0) { // first page load if (this.cache.canCache()) { @@ -88,7 +88,6 @@ export class EditorDataService { this.loadDataFromOfflineCache().then((projectObj: any) => { if (projectObj.isComplete) { this.showInitialEntries().then(() => { - lexiconScope.finishedLoading = true; this.notice.cancelLoading(); this.refreshEditorData(projectObj.timestamp).then((result: any) => { deferred.resolve(result); @@ -256,7 +255,7 @@ export class EditorDataService { UtilityService.arrayCopyRetainingReferences(entriesSorted, this.entries); const filteredEntriesSorted = this.sortList(config, this.filteredEntries); UtilityService.arrayCopyRetainingReferences(filteredEntriesSorted, this.filteredEntries); - const visibleEntriesSorted = this.sortList(config, this.visibleEntries); + this.sortList(config, this.visibleEntries); if (shouldResetVisibleEntriesList) { // TODO: Magic number "50" below should become a constant somewhere UtilityService.arrayCopyRetainingReferences(filteredEntriesSorted.slice(0, 50), this.visibleEntries); diff --git a/src/angular-app/languageforge/lexicon/core/lexicon-core.module.ts b/src/angular-app/languageforge/lexicon/core/lexicon-core.module.ts index d9ef050266..9c56e6e5f1 100644 --- a/src/angular-app/languageforge/lexicon/core/lexicon-core.module.ts +++ b/src/angular-app/languageforge/lexicon/core/lexicon-core.module.ts @@ -1,17 +1,22 @@ import * as angular from 'angular'; -import { LexiconConfigService } from './lexicon-config.service'; -import { LexiconEditorDataService } from './lexicon-editor-data.service'; -import { LexiconEntryApiService } from './lexicon-entry-api.service'; -import { LexiconLinkService } from './lexicon-link.service'; -import { LexiconProjectService } from './lexicon-project.service'; -import { LexiconRightsService } from './lexicon-rights.service'; -import { LexiconSendReceiveApiService } from './lexicon-send-receive-api.service'; -import { LexiconSendReceiveService } from './lexicon-send-receive.service'; -import { LexiconUtilityService } from './lexicon-utility.service'; +import {BreadcrumbModule} from '../../../bellows/core/breadcrumbs/breadcrumb.module'; +import {CoreModule} from '../../../bellows/core/core.module'; +import {LexiconConfigService} from './lexicon-config.service'; +import {LexiconEditorDataService} from './lexicon-editor-data.service'; +import {LexiconEntryApiService} from './lexicon-entry-api.service'; +import {LexiconLinkService} from './lexicon-link.service'; +import {LexiconProjectService} from './lexicon-project.service'; +import {LexiconRightsService} from './lexicon-rights.service'; +import {LexiconSendReceiveApiService} from './lexicon-send-receive-api.service'; +import {LexiconSendReceiveService} from './lexicon-send-receive.service'; +import {LexiconUtilityService} from './lexicon-utility.service'; export const LexiconCoreModule = angular - .module('lexiconCoreModule', []) + .module('lexiconCoreModule', [ + BreadcrumbModule, + CoreModule + ]) .service('lexProjectService', LexiconProjectService) .service('lexLinkService', LexiconLinkService) .service('lexConfigService', LexiconConfigService) diff --git a/src/angular-app/languageforge/lexicon/editor/comment/comment.module.ts b/src/angular-app/languageforge/lexicon/editor/comment/comment.module.ts index e9d92ca300..592fe49d05 100644 --- a/src/angular-app/languageforge/lexicon/editor/comment/comment.module.ts +++ b/src/angular-app/languageforge/lexicon/editor/comment/comment.module.ts @@ -1,5 +1,6 @@ import * as angular from 'angular'; +import {LexiconCoreModule} from '../../core/lexicon-core.module'; import {CommentBubbleComponent} from './comment-bubble.component'; import {CommentsRightPanelComponent} from './comments-right-panel.component'; import {CurrentEntryCommentCountComponent} from './current-entry-comment-count.component'; @@ -8,7 +9,9 @@ import {LexCommentsViewComponent} from './lex-comments-view.component'; import {RegardingFieldComponent} from './regarding-field.component'; export const EditorCommentsModule = angular - .module('lexCommentsModule', []) + .module('lexCommentsModule', [ + LexiconCoreModule + ]) .component('commentBubble', CommentBubbleComponent) .component('commentsRightPanel', CommentsRightPanelComponent) .component('currentEntryCommentCount', CurrentEntryCommentCountComponent) diff --git a/src/angular-app/languageforge/lexicon/editor/editor.module.ts b/src/angular-app/languageforge/lexicon/editor/editor.module.ts index 94475392bf..12f7f48565 100644 --- a/src/angular-app/languageforge/lexicon/editor/editor.module.ts +++ b/src/angular-app/languageforge/lexicon/editor/editor.module.ts @@ -5,6 +5,7 @@ import {ActivityAppModule} from '../../../bellows/apps/activity/activity-app.mod import {CoreModule} from '../../../bellows/core/core.module'; import {NoticeModule} from '../../../bellows/core/notice/notice.module'; import {PuiUtilityModule} from '../../../bellows/shared/utils/pui-utils.module'; +import {LexiconCoreModule} from '../core/lexicon-core.module'; import {EditorCommentsModule} from './comment/comment.module'; import {LexiconEditorComponent, LexiconEditorEntryController, LexiconEditorListController} from './editor.component'; import {EditorFieldModule} from './field/field.module'; @@ -17,6 +18,8 @@ export const LexiconEditorModule = angular CoreModule, NoticeModule, PuiUtilityModule, + 'palaso.ui.typeahead', + LexiconCoreModule, EditorCommentsModule, EditorFieldModule ]) @@ -31,11 +34,11 @@ export const LexiconEditorModule = angular abstract: true, url: '/editor', template: ` - ` + ` }) .state('editor.list', { url: '/list', diff --git a/src/angular-app/languageforge/lexicon/editor/field/field.module.ts b/src/angular-app/languageforge/lexicon/editor/field/field.module.ts index 8811a174bf..9da013feac 100644 --- a/src/angular-app/languageforge/lexicon/editor/field/field.module.ts +++ b/src/angular-app/languageforge/lexicon/editor/field/field.module.ts @@ -3,6 +3,7 @@ import * as angular from 'angular'; import {NoticeModule} from '../../../../bellows/core/notice/notice.module'; import {MockModule} from '../../../../bellows/shared/mock.module'; import {SoundModule} from '../../../../bellows/shared/sound.module'; +import {LexiconCoreModule} from '../../core/lexicon-core.module'; import {EditorCommentsModule} from '../comment/comment.module'; import {FieldAudioComponent} from './dc-audio.component'; import {FieldEntryComponent} from './dc-entry.component'; @@ -21,10 +22,11 @@ import {FieldTextComponent} from './dc-text.component'; export const EditorFieldModule = angular .module('editorFieldModule', [ 'ngFileUpload', - EditorCommentsModule, MockModule, NoticeModule, - SoundModule + SoundModule, + LexiconCoreModule, + EditorCommentsModule ]) .component('dcAudio', FieldAudioComponent) .component('dcEntry', FieldEntryComponent) diff --git a/src/angular-app/languageforge/lexicon/lang/en.json b/src/angular-app/languageforge/lexicon/lang/en.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/angular-app/languageforge/lexicon/lang/en.po b/src/angular-app/languageforge/lexicon/lang/en.po deleted file mode 100644 index b1f000a474..0000000000 --- a/src/angular-app/languageforge/lexicon/lang/en.po +++ /dev/null @@ -1,311 +0,0 @@ -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: LanguageForge - lexicon\n" -"POT-Creation-Date: 2014-04-01T20:29:49\n" -"PO-Revision-Date: 2014-04-01 09:23+0000\n" -"Last-Translator: palaso_admin \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: en\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -msgid "Abbreviation" -msgstr "Abbreviation" - -msgid "About Language 639-1 Codes" -msgstr "About Language 639-1 Codes" - -msgid "About Language 639-3 Codes" -msgstr "About Language 639-3 Codes" - -msgid "Add a variant of {languageName}" -msgstr "Add a variant of {languageName}" - -msgid "Add Existing User" -msgstr "Add Existing User" - -msgid "Add IPA for {languageName}" -msgstr "Add IPA for {languageName}" - -msgid "Add {languageName}" -msgstr "Add {languageName}" - -msgid "Add Members" -msgstr "Add Members" - -msgid "Add Voice for {languageName}" -msgstr "Add Voice for {languageName}" - -msgid "Apply" -msgstr "Apply" - -msgid "Archive" -msgstr "Archive" - -msgid "Are you sure you want to delete '{lexeme}'?" -msgstr "Are you sure you want to delete '{lexeme}'?" - -msgid "Browse..." -msgstr "Browse..." - -msgid "Comment" -msgstr "Comment" - -msgid "Configuration" -msgstr "Configuration" - -msgid "Configuration updated successfully" -msgstr "Configuration updated successfully" - -msgid "Create New User" -msgstr "Create New User" - -msgid "Default Interface Language" -msgstr "Default Interface Language" - -msgid "Delete matching entry if deleted in import." -msgstr "Delete matching entry if deleted in import." - -msgid "Delete" -msgstr "Delete" - -msgid "Delete Word" -msgstr "Delete Word" - -msgid "Dictionary Browse and Edit" -msgstr "Dictionary Browse and Edit" - -msgid "Display Name" -msgstr "Display Name" - -msgid "Do not import the conflicting data (keep Language Forge data)." -msgstr "Do not import the conflicting data (keep Language Forge data)." - -msgid "Drop a LIFT file here" -msgstr "Drop a LIFT file here" - -msgid "Edit" -msgstr "Edit" - -msgid "Edit input systems" -msgstr "Edit input systems" - -msgid "Email From (reply-to) Address" -msgstr "Email From (reply-to) Address" - -msgid "Email Name" -msgstr "Email Name" - -msgid "Emic (uses the phonology of the language)" -msgstr "Emic (uses the phonology of the language)" - -msgid "Entry Level Fields" -msgstr "Entry Level Fields" - -msgid "Etic (raw phonetic transcription)" -msgstr "Etic (raw phonetic transcription)" - -msgid "Example Level Fields" -msgstr "Example Level Fields" - -msgid "Featured On Website" -msgstr "Featured On Website" - -msgid "Full Name" -msgstr "Full Name" - -msgid "Hidden if empty" -msgstr "Hidden if empty" - -msgid "Hide Hidden Fields" -msgstr "Hide Hidden Fields" - -msgid "Import" -msgstr "Import" - -msgid "Import a LIFT File" -msgstr "Import a LIFT File" - -msgid "Import/Export" -msgstr "Import/Export" - -msgid "" -"Import the conflicting data and overwrite the current data (the importing " -"data overrules the Language Forge data)." -msgstr "Import the conflicting data and overwrite the current data (the importing data overrules the Language Forge data)." - -msgid "" -"Import the conflicting data into a new lexical entry or sense and I will " -"make decisions myself later." -msgstr "Import the conflicting data into a new lexical entry or sense and I will make decisions myself later." - -msgid "" -"In applications which support this option, fields with this input system " -"will able to play and record voice." -msgstr "In applications which support this option, fields with this input system will able to play and record voice." - -msgid "Input Systems" -msgstr "Input Systems" - -msgid "IPA transcription" -msgstr "IPA transcription" - -msgid "LIFT Export" -msgstr "LIFT Export" - -msgid "LIFT Import" -msgstr "LIFT Import" - -msgid "LIFT import completed successfully" -msgstr "LIFT import completed successfully" - -msgid "Manager" -msgstr "Manager" - -msgid "Member" -msgstr "Member" - -msgid "More" -msgstr "More" - -msgid "New" -msgstr "New" - -msgid "New Word" -msgstr "New Word" - -msgid "{num} entries" -msgstr "{num} entries" - -msgid "{numOfUsers} users were removed from this project" -msgstr "{numOfUsers} users were removed from this project" - -msgid "or if you prefer..." -msgstr "or if you prefer..." - -msgid "Project Code" -msgstr "Project Code" - -msgid "Project Name" -msgstr "Project Name" - -msgid "{projectName} Settings" -msgstr "{projectName} Settings" - -msgid "{projectName} settings updated successfully" -msgstr "{projectName} settings updated successfully" - -msgid "{projectName} SMS settings updated successfully" -msgstr "{projectName} SMS settings updated successfully" - -msgid "{projectName} User Management" -msgstr "{projectName} User Management" - -msgid "Project Properties" -msgstr "Project Properties" - -msgid "Purpose" -msgstr "Purpose" - -msgid "Read more about IPA transcriptions" -msgstr "Read more about IPA transcriptions" - -msgid "Read more about language identifiers" -msgstr "Read more about language identifiers" - -msgid "Region" -msgstr "Region" - -msgid "Remove {languageName}" -msgstr "Remove {languageName}" - -msgid "Remove Members" -msgstr "Remove Members" - -msgid "Reports" -msgstr "Reports" - -msgid "Right to left language" -msgstr "Right to left language" - -msgid "Role" -msgstr "Role" - -msgid "Save" -msgstr "Save" - -msgid "Script" -msgstr "Script" - -msgid "Script / Region / Variant" -msgstr "Script / Region / Variant" - -msgid "Select a New Input System Language" -msgstr "Select a New Input System Language" - -msgid "Send Email Invite" -msgstr "Send Email Invite" - -msgid "Sense Level Fields" -msgstr "Sense Level Fields" - -msgid "Settings Import" -msgstr "Settings Import" - -msgid "Show Hidden Fields" -msgstr "Show Hidden Fields" - -msgid "Skip importing entries with identical modification times." -msgstr "Skip importing entries with identical modification times." - -msgid "SMS From Number" -msgstr "SMS From Number" - -msgid "Special" -msgstr "Special" - -msgid "The user was removed from this project" -msgstr "The user was removed from this project" - -msgid "Twilio Account Username" -msgstr "Twilio Account Username" - -msgid "Twillio Auth Token" -msgstr "Twillio Auth Token" - -msgid "User created. Username: {userName} Password: {password}" -msgstr "User created. Username: {userName} Password: {password}" - -msgid "Username" -msgstr "Username" - -msgid "{userName}'s role was changed to {role}" -msgstr "{userName}'s role was changed to {role}" - -msgid "{userName} was added to {projectName} successfully." -msgstr "{userName} was added to {projectName} successfully." - -msgid "{userName} was invited to join the project {projectName}" -msgstr "{userName} was invited to join the project {projectName}" - -msgid "Variant" -msgstr "Variant" - -msgid "Voice" -msgstr "Voice" - -msgid "Whenever there is a conflict:" -msgstr "Whenever there is a conflict:" - -msgid "Word" -msgstr "Word" - -msgid "You have unsaved changes." -msgstr "You have unsaved changes." - -msgid "You have unsaved changes. Leave the page?" -msgstr "You have unsaved changes. Leave the page?" diff --git a/src/angular-app/languageforge/lexicon/lang/fa.json b/src/angular-app/languageforge/lexicon/lang/fa.json deleted file mode 100644 index aa357c3f34..0000000000 --- a/src/angular-app/languageforge/lexicon/lang/fa.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "Abbreviation": "مخفف", - "About Language 639-1 Codes": "درباره زبان 639-1 کد", - "About Language 639-3 Codes": "درباره زبان 639-3 کد", - "Add a variant of {languageName}": "اضافه کردن یک نوع از {languageName}", - "Add Existing User": "اضافه کردن کاربر موجود", - "Add IPA for {languageName}": "اضافه کردن IPA برای {languageName}", - "Add {languageName}": "اضافه کردن {languageName}", - "Add Members": "اضافه کردن کاربران", - "Add Voice for {languageName}": "اضافه کردن صدا برای {languageName}", - "Apply": "درخواست", - "Are you sure you want to delete '{lexeme}'?": "آیا مطمئن هستید که می خواهید حذف کنید: ' {lexeme}'؟", - "Browse...": "مرور ...", - "Comment": "توضیح", - "Create New User": "ایجاد کاربر جدید", - "Default Interface Language": "به طور پیش فرض رابط زبان", - "Delete matching entry if deleted in import.": "حذف تطبیق ورود اگر در واردات حذف شده است.", - "Delete Word": "حذف کلمه", - "Dictionary Browse and Edit": "فرهنگ لغت جستجو و ویرایش", - "Dictionary Configuration": "تنظیمات فرهنگ لغت", - "Dictionary configuration updated successfully": "پیکربندی دیکشنری موفقیت به روز رسانی", - "Display Name": "نمایش نام", - "Do not import the conflicting data (keep Language Forge data).": "آیا داده های ضد و نقیضی وارد نشده ( نگه داشتن اطلاعات زبان فورج ) .", - "Drop a LIFT file here": "رها کردن یک فایل LIFT اینجا", - "Edit": "ویرایش", - "Edit input systems": "ویرایش سیستم های ورودی", - "Email From (reply-to) Address": "ارسال از ( پاسخ به ) آدرس", - "Email Name": "نام ایمیل", - "Emic (uses the phonology of the language)": "امیک ( با استفاده از واج شناسی زبان)", - "Entry Level Fields": "زمینه صعود به سطح ورودی", - "Etic (raw phonetic transcription)": "Etic (آوایی خام رونویسی )", - "Example Level Fields": "زمینه به عنوان مثال سطح", - "Featured On Website": "برجسته در وب سایت", - "Full Name": "نام و نام خانوادگی", - "Hidden if empty": "پنهان اگر خالی", - "Import": "واردات", - "Import a LIFT File": "وارداتفایل LIFT", - "Import/Export": "واردات / صادرات", - "Import the conflicting data and overwrite the current data (the importing data overrules the Language Forge data).": "وارد کردن داده ها متناقض و بازنویسی داده های فعلی ( که داده ها وارد overrules داده ها زبان فورج ) .", - "Import the conflicting data into a new lexical entry or sense and I will make decisions myself later.": "وارد کردن داده ها متناقض به ورود واژگان جدید و یا احساس و من تصمیم خودم را بعد از آن را .", - "In applications which support this option, fields with this input system will able to play and record voice.": "در برنامه های کاربردی که در حمایت از این گزینه ، با این سیستم ورودی را قادر به پخش و ضبط صدا زمینه .", - "Input Systems": "سیستم های ورودی", - "IPA transcription": "IPA نسخه برداری", - "LIFT Export": "LIFT صادرات", - "LIFT Import": "واردات LIFT", - "LIFT import completed successfully": "واردات LIFT با موفقیت انجام شد", - "Manager": "مدیر", - "Meaning": "یعنی", - "Member": "عضو", - "More": "بیشتر", - "New": "جدید", - "New Word": "جدید ورد", - "{num} entries": " {num} نوشته های", - "{numOfUsers} users were removed from this project": "{numOfUsers} کاربران از این پروژه حذف شد", - "or if you prefer...": "و یا اگر شما ترجیح می دهند ...", - "Project Code": "کد پروژه", - "Project Name": "نام پروژه", - "{projectName} Settings": "{projectName} تنظیمات", - "{projectName} settings updated successfully": "{projectName} تنظیمات با موفقیت به روز شده", - "{projectName} SMS settings updated successfully": "{projectName} تنظیمات SMS با موفقیت به روز شده", - "{projectName} User Management": "{projectName} مدیریت کاربر", - "Project Properties": "خواص پروژه", - "Purpose": "هدف", - "Read more about IPA transcriptions": "اطلاعات بیشتر در مورد رونوشت IPA", - "Read more about language identifiers": "اطلاعات بیشتر در مورد شناسه های زبان", - "Region": "منطقه", - "Remove {languageName}": "حذف {languageName}", - "Remove Members": "حذف کاربران", - "Right to left language": "از راست به چپ زبان", - "Role": "نقش", - "Save": "جویی در هزینه", - "Script": "خط", - "Script / Region / Variant": "اسکریپت / منطقه / نوع", - "Select a New Input System Language": "انتخاب سیستم ورودی جدید زبان", - "Send Email Invite": "ارسال ایمیل دعوت از دوستان", - "Sense Level Fields": "زمینه رسیدن به سطح حس", - "Settings Import": "تنظیمات واردات", - "Skip importing entries with identical modification times.": "پرش واردات نوشته های با زمان تغییر یکسان .", - "SMS From Number": "SMS از شماره", - "Special": "ویژه", - "The user was removed from this project": "کاربر از این پروژه حذف شد", - "Twilio Account Username": "حساب Twilio نام کاربری", - "Twillio Auth Token": "Twillio تایید رمز", - "User created. Username: {userName} Password: {password}": "کاربر ایجاد شده است. نام کاربری{userName} رمز عبور : {password}", - "Username": "نام کاربری", - "{userName}'s role was changed to {role}": "{userName} نقش به {role} تغییر یافت", - "{userName} was added to {projectName} successfully.": "{userName} به {projectName} با موفقیت اضافه شد .", - "{userName} was invited to join the project {projectName}": "{userName} برای پیوستن به این پروژه {projectName} دعوت شد", - "Variant": "نوع دیگر", - "Voice": "صدا", - "Whenever there is a conflict:": "هر گاه یک درگیری وجود دارد :", - "word": "کلمه", - "Word": "حرف", - "You have unsaved changes.": "شما تغییرات ذخیره نشده .", - "You have unsaved changes. Leave the page?": "شما تغییرات ذخیره نشده . ترک صفحه ؟" -} diff --git a/src/angular-app/languageforge/lexicon/lang/fa.po b/src/angular-app/languageforge/lexicon/lang/fa.po deleted file mode 100644 index 690dcdd246..0000000000 --- a/src/angular-app/languageforge/lexicon/lang/fa.po +++ /dev/null @@ -1,297 +0,0 @@ -# -# Translators: -# palaso_admin , 2014 -msgid "" -msgstr "" -"Project-Id-Version: LanguageForge - lexicon\n" -"POT-Creation-Date: 2014-04-01T20:29:49\n" -"PO-Revision-Date: 2014-04-01 09:54+0000\n" -"Last-Translator: palaso_admin \n" -"Language-Team: Persian (http://www.transifex.com/projects/p/languageforge-lexicon/language/fa/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: fa\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -msgid "Abbreviation" -msgstr "مخفف" - -msgid "About Language 639-1 Codes" -msgstr "درباره زبان 639-1 کد" - -msgid "About Language 639-3 Codes" -msgstr "درباره زبان 639-3 کد" - -msgid "Add a variant of {languageName}" -msgstr "اضافه کردن یک نوع از {languageName}" - -msgid "Add Existing User" -msgstr "اضافه کردن کاربر موجود" - -msgid "Add IPA for {languageName}" -msgstr "اضافه کردن IPA برای {languageName}" - -msgid "Add {languageName}" -msgstr "اضافه کردن {languageName}" - -msgid "Add Members" -msgstr "اضافه کردن کاربران" - -msgid "Add Voice for {languageName}" -msgstr "اضافه کردن صدا برای {languageName}" - -msgid "Apply" -msgstr "درخواست" - -msgid "Are you sure you want to delete '{lexeme}'?" -msgstr "آیا مطمئن هستید که می خواهید حذف کنید: ' {lexeme}'؟" - -msgid "Browse..." -msgstr "مرور ..." - -msgid "Comment" -msgstr "توضیح" - -msgid "Create New User" -msgstr "ایجاد کاربر جدید" - -msgid "Default Interface Language" -msgstr "به طور پیش فرض رابط زبان" - -msgid "Delete matching entry if deleted in import." -msgstr "حذف تطبیق ورود اگر در واردات حذف شده است." - -msgid "Delete Word" -msgstr "حذف کلمه" - -msgid "Dictionary Browse and Edit" -msgstr "فرهنگ لغت جستجو و ویرایش" - -msgid "Dictionary Configuration" -msgstr "تنظیمات فرهنگ لغت" - -msgid "Dictionary configuration updated successfully" -msgstr "پیکربندی دیکشنری موفقیت به روز رسانی" - -msgid "Display Name" -msgstr "نمایش نام" - -msgid "Do not import the conflicting data (keep Language Forge data)." -msgstr "آیا داده های ضد و نقیضی وارد نشده ( نگه داشتن اطلاعات زبان فورج ) ." - -msgid "Drop a LIFT file here" -msgstr "رها کردن یک فایل LIFT اینجا" - -msgid "Edit" -msgstr "ویرایش" - -msgid "Edit input systems" -msgstr "ویرایش سیستم های ورودی" - -msgid "Email From (reply-to) Address" -msgstr "ارسال از ( پاسخ به ) آدرس" - -msgid "Email Name" -msgstr "نام ایمیل" - -msgid "Emic (uses the phonology of the language)" -msgstr "امیک ( با استفاده از واج شناسی زبان)" - -msgid "Entry Level Fields" -msgstr "زمینه صعود به سطح ورودی" - -msgid "Etic (raw phonetic transcription)" -msgstr "Etic (آوایی خام رونویسی )" - -msgid "Example Level Fields" -msgstr "زمینه به عنوان مثال سطح" - -msgid "Featured On Website" -msgstr "برجسته در وب سایت" - -msgid "Full Name" -msgstr "نام و نام خانوادگی" - -msgid "Hidden if empty" -msgstr "پنهان اگر خالی" - -msgid "Import" -msgstr "واردات" - -msgid "Import a LIFT File" -msgstr "وارداتفایل LIFT" - -msgid "Import/Export" -msgstr "واردات / صادرات" - -msgid "" -"Import the conflicting data and overwrite the current data (the importing " -"data overrules the Language Forge data)." -msgstr "وارد کردن داده ها متناقض و بازنویسی داده های فعلی ( که داده ها وارد overrules داده ها زبان فورج ) ." - -msgid "" -"Import the conflicting data into a new lexical entry or sense and I will " -"make decisions myself later." -msgstr "وارد کردن داده ها متناقض به ورود واژگان جدید و یا احساس و من تصمیم خودم را بعد از آن را ." - -msgid "" -"In applications which support this option, fields with this input system " -"will able to play and record voice." -msgstr "در برنامه های کاربردی که در حمایت از این گزینه ، با این سیستم ورودی را قادر به پخش و ضبط صدا زمینه ." - -msgid "Input Systems" -msgstr "سیستم های ورودی" - -msgid "IPA transcription" -msgstr "IPA نسخه برداری" - -msgid "LIFT Export" -msgstr "LIFT صادرات" - -msgid "LIFT Import" -msgstr "واردات LIFT" - -msgid "LIFT import completed successfully" -msgstr "واردات LIFT با موفقیت انجام شد" - -msgid "Manager" -msgstr "مدیر" - -msgid "Member" -msgstr "عضو" - -msgid "More" -msgstr "بیشتر" - -msgid "New" -msgstr "جدید" - -msgid "New Word" -msgstr "جدید ورد" - -msgid "{num} entries" -msgstr " {num} نوشته های" - -msgid "{numOfUsers} users were removed from this project" -msgstr "{numOfUsers} کاربران از این پروژه حذف شد" - -msgid "or if you prefer..." -msgstr "و یا اگر شما ترجیح می دهند ..." - -msgid "Project Code" -msgstr "کد پروژه" - -msgid "Project Name" -msgstr "نام پروژه" - -msgid "{projectName} Settings" -msgstr "{projectName} تنظیمات" - -msgid "{projectName} settings updated successfully" -msgstr "{projectName} تنظیمات با موفقیت به روز شده" - -msgid "{projectName} SMS settings updated successfully" -msgstr "{projectName} تنظیمات SMS با موفقیت به روز شده" - -msgid "{projectName} User Management" -msgstr "{projectName} مدیریت کاربر" - -msgid "Project Properties" -msgstr "خواص پروژه" - -msgid "Purpose" -msgstr "هدف" - -msgid "Read more about IPA transcriptions" -msgstr "اطلاعات بیشتر در مورد رونوشت IPA" - -msgid "Read more about language identifiers" -msgstr "اطلاعات بیشتر در مورد شناسه های زبان" - -msgid "Region" -msgstr "منطقه" - -msgid "Remove {languageName}" -msgstr "حذف {languageName}" - -msgid "Remove Members" -msgstr "حذف کاربران" - -msgid "Right to left language" -msgstr "از راست به چپ زبان" - -msgid "Role" -msgstr "نقش" - -msgid "Save" -msgstr "جویی در هزینه" - -msgid "Script" -msgstr "خط" - -msgid "Script / Region / Variant" -msgstr "اسکریپت / منطقه / نوع" - -msgid "Select a New Input System Language" -msgstr "انتخاب سیستم ورودی جدید زبان" - -msgid "Send Email Invite" -msgstr "ارسال ایمیل دعوت از دوستان" - -msgid "Sense Level Fields" -msgstr "زمینه رسیدن به سطح حس" - -msgid "Settings Import" -msgstr "تنظیمات واردات" - -msgid "Skip importing entries with identical modification times." -msgstr "پرش واردات نوشته های با زمان تغییر یکسان ." - -msgid "SMS From Number" -msgstr "SMS از شماره" - -msgid "Special" -msgstr "ویژه" - -msgid "The user was removed from this project" -msgstr "کاربر از این پروژه حذف شد" - -msgid "Twilio Account Username" -msgstr "حساب Twilio نام کاربری" - -msgid "Twillio Auth Token" -msgstr "Twillio تایید رمز" - -msgid "User created. Username: {userName} Password: {password}" -msgstr "کاربر ایجاد شده است. نام کاربری{userName} رمز عبور : {password}" - -msgid "Username" -msgstr "نام کاربری" - -msgid "{userName}'s role was changed to {role}" -msgstr "{userName} نقش به {role} تغییر یافت" - -msgid "{userName} was added to {projectName} successfully." -msgstr "{userName} به {projectName} با موفقیت اضافه شد ." - -msgid "{userName} was invited to join the project {projectName}" -msgstr "{userName} برای پیوستن به این پروژه {projectName} دعوت شد" - -msgid "Variant" -msgstr "نوع دیگر" - -msgid "Voice" -msgstr "صدا" - -msgid "Whenever there is a conflict:" -msgstr "هر گاه یک درگیری وجود دارد :" - -msgid "Word" -msgstr "کلمه" - -msgid "You have unsaved changes." -msgstr "شما تغییرات ذخیره نشده ." - -msgid "You have unsaved changes. Leave the page?" -msgstr "شما تغییرات ذخیره نشده . ترک صفحه ؟" diff --git a/src/angular-app/languageforge/lexicon/lexicon-app.component.html b/src/angular-app/languageforge/lexicon/lexicon-app.component.html new file mode 100644 index 0000000000..b29090c1ab --- /dev/null +++ b/src/angular-app/languageforge/lexicon/lexicon-app.component.html @@ -0,0 +1,8 @@ +
+
+
+
+ + +
+
diff --git a/src/angular-app/languageforge/lexicon/lexicon-app.component.ts b/src/angular-app/languageforge/lexicon/lexicon-app.component.ts new file mode 100644 index 0000000000..b708cdff17 --- /dev/null +++ b/src/angular-app/languageforge/lexicon/lexicon-app.component.ts @@ -0,0 +1,188 @@ +import * as angular from 'angular'; + +import {InputSystemsService} from '../../bellows/core/input-systems/input-systems.service'; +import {NoticeService} from '../../bellows/core/notice/notice.service'; +import {InterfaceConfig} from '../../bellows/shared/model/interface-config.model'; +import {User} from '../../bellows/shared/model/user.model'; +import {LexiconConfigService} from './core/lexicon-config.service'; +import {LexiconEditorDataService} from './core/lexicon-editor-data.service'; +import {LexiconProjectService} from './core/lexicon-project.service'; +import {LexiconRightsService, Rights} from './core/lexicon-rights.service'; +import {LexiconSendReceiveService} from './core/lexicon-send-receive.service'; +import {LexiconConfig} from './shared/model/lexicon-config.model'; +import {LexiconProjectSettings} from './shared/model/lexicon-project-settings.model'; +import {LexiconProject} from './shared/model/lexicon-project.model'; +import {LexOptionList} from './shared/model/option-list.model'; + +export class LexiconAppController implements angular.IController { + finishedLoading: boolean = false; + config: LexiconConfig; + editorConfig: LexiconConfig; + interfaceConfig: InterfaceConfig; + optionLists: LexOptionList[]; + project: LexiconProject; + rights: Rights; + users: { [userId: string]: User }; + + private online: boolean; + private pristineLanguageCode: string; + + static $inject = ['$scope', '$location', + '$q', 'silNoticeService', + 'lexConfigService', + 'lexProjectService', + 'lexEditorDataService', + 'lexRightsService', + 'lexSendReceive' + ]; + constructor(private readonly $scope: angular.IScope, private readonly $location: angular.ILocationService, + private readonly $q: angular.IQService, private readonly notice: NoticeService, + private readonly configService: LexiconConfigService, + private readonly lexProjectService: LexiconProjectService, + private readonly editorService: LexiconEditorDataService, + private readonly rightsService: LexiconRightsService, + private readonly sendReceive: LexiconSendReceiveService) { } + + $onInit(): void { + this.editorService.loadEditorData().then(() => { + this.finishedLoading = true; + this.sendReceive.checkInitialState(); + }); + + this.$q.all([this.rightsService.getRights(), this.configService.getEditorConfig()]) + .then(([rights, editorConfig]) => { + if (rights.canEditProject()) { + this.lexProjectService.users().then(result => { + if (result.ok) { + const users = {}; + for (const user of (result.data.users as User[])) { + users[user.id] = user; + } + + this.users = users; + } + }); + } + + this.editorConfig = editorConfig; + this.project = rights.session.project(); + this.config = rights.session.projectSettings().config; + this.optionLists = rights.session.projectSettings().optionlists; + this.interfaceConfig = rights.session.projectSettings().interfaceConfig; + this.rights = rights; + this.pristineLanguageCode = angular.copy(this.interfaceConfig.userLanguageCode); + this.changeInterfaceLanguage(this.interfaceConfig.userLanguageCode); + + this.$scope.$watch(() => this.interfaceConfig.userLanguageCode, (newVal: string) => { + if (newVal && newVal !== this.pristineLanguageCode) { + const user = { interfaceLanguageCode: '' }; + user.interfaceLanguageCode = newVal; + this.lexProjectService.updateUserProfile(user); + this.changeInterfaceLanguage(newVal); + } + }); + } + ); + + this.setupOffline(); + } + + $onDestroy(): void { + this.sendReceive.cancelAllStatusTimers(); + } + + onUpdate = ( + $event: { + project?: LexiconProject, + config?: LexiconConfig, + optionLists?: LexOptionList[] + } + ): void => { + if ($event.project) { + this.project = $event.project; + } + + if ($event.config) { + this.config = $event.config; + } + + if ($event.optionLists) { + this.optionLists = $event.optionLists; + } + + if ($event.config || $event.optionLists) { + this.configService.getEditorConfig(this.config, this.optionLists).then(configEditor => { + this.editorConfig = configEditor; + }); + } + } + + private changeInterfaceLanguage(code: string): void { + this.pristineLanguageCode = angular.copy(code); + if (InputSystemsService.isRightToLeft(code)) { + this.interfaceConfig.direction = 'rtl'; + this.interfaceConfig.pullToSide = 'float-left'; + this.interfaceConfig.pullNormal = 'float-right'; + this.interfaceConfig.placementToSide = 'right'; + this.interfaceConfig.placementNormal = 'left'; + } else { + this.interfaceConfig.direction = 'ltr'; + this.interfaceConfig.pullToSide = 'float-right'; + this.interfaceConfig.pullNormal = 'float-left'; + this.interfaceConfig.placementToSide = 'left'; + this.interfaceConfig.placementNormal = 'right'; + } + } + + private setupOffline(): void { + // setup offline.js options + // see https://github.com/hubspot/offline for all options + // we tell offline.js to NOT store and remake requests while the connection is down + Offline.options.requests = false; + Offline.options.checkOnLoad = true; + Offline.options.checks = { xhr: { url: '/offlineCheck.txt' } }; + + // Set the page's Language Forge title, font size, and nav's background color + function setTitle(text: string, fontSize: string, backgroundColor: string): void { + const title = document.querySelector('nav .mobile-title a') as HTMLElement; + title.textContent = text; + title.style.fontSize = fontSize; + + document.querySelector('nav a.navbar-brand').textContent = text; + (document.querySelector('nav.navbar') as HTMLElement).style.backgroundColor = backgroundColor; + } + + let offlineMessageId: string; + Offline.on('up', () => { + setTitle('Language Forge', '', ''); + + if (this.online === false) { + this.notice.removeById(offlineMessageId); + this.notice.push(this.notice.SUCCESS, 'You are back online!'); + } + + this.online = true; + this.$scope.$digest(); + }); + + Offline.on('down', () => { + setTitle('Language Forge Offline', '0.8em', '#555'); + offlineMessageId = this.notice.push(this.notice.ERROR, 'You are offline. Some features are not available', null, + true, 5 * 1000); + this.online = false; + if (!/^\/editor\//.test(this.$location.path())) { + // redirect to the editor + this.$location.path('/editor'); + this.notice.push(this.notice.SUCCESS, 'The dictionary editor is available offline. Settings are not.'); + } + + this.$scope.$digest(); + }); + } + +} + +export const LexiconAppComponent: angular.IComponentOptions = { + controller: LexiconAppController, + templateUrl: '/angular-app/languageforge/lexicon/lexicon-app.component.html' +}; diff --git a/src/angular-app/languageforge/lexicon/lexicon-app.module.ts b/src/angular-app/languageforge/lexicon/lexicon-app.module.ts new file mode 100644 index 0000000000..df8421563c --- /dev/null +++ b/src/angular-app/languageforge/lexicon/lexicon-app.module.ts @@ -0,0 +1,65 @@ +import * as angular from 'angular'; +import 'angular-sanitize'; +import uiRouter from 'angular-ui-router'; + +import {ApiService} from '../../bellows/core/api/api.service'; +import {CoreModule} from '../../bellows/core/core.module'; +import {LexiconCoreModule} from './core/lexicon-core.module'; +import {LexiconEditorModule} from './editor/editor.module'; +import {LexiconAppComponent} from './lexicon-app.component'; +import './new-project/lexicon-new-project.module'; +import {LexiconSettingsModule} from './settings/settings.module'; + +export const LexiconAppModule = angular + .module('lexicon', [ + 'ui.bootstrap', + uiRouter, + 'ngSanitize', + CoreModule, + LexiconCoreModule, + LexiconEditorModule, + LexiconSettingsModule + ]) + .component('lexiconApp', LexiconAppComponent) + .config(['$stateProvider', '$urlRouterProvider', + '$compileProvider', '$sanitizeProvider', 'apiServiceProvider', + ($stateProvider: angular.ui.IStateProvider, $urlRouterProvider: angular.ui.IUrlRouterProvider, + $compileProvider: angular.ICompileProvider, $sanitizeProvider: any, apiService: ApiService) => { + + $compileProvider.debugInfoEnabled(apiService.isProduction); + $compileProvider.commentDirectivesEnabled(apiService.isProduction); + + // this is needed to allow style="font-family" on ng-bind-html elements + $sanitizeProvider.addValidAttrs(['style']); + + $urlRouterProvider.otherwise('/editor/list'); + + // State machine from ui.router + $stateProvider + .state('configuration', { + url: '/configuration', + template: `` + }) + .state('importExport', { + url: '/importExport', + template: `` + }) + .state('settings', { + url: '/settings', + template: `` + }) + .state('sync', { + url: '/sync', + template: `` + }) + ; + + } + ]) + .name; diff --git a/src/angular-app/languageforge/lexicon/lexicon.html b/src/angular-app/languageforge/lexicon/lexicon.html index 889ba806ed..631d05c957 100644 --- a/src/angular-app/languageforge/lexicon/lexicon.html +++ b/src/angular-app/languageforge/lexicon/lexicon.html @@ -1,11 +1,3 @@ {% verbatim %} -
-
-
-
- - -
-
+ {% endverbatim %} diff --git a/src/angular-app/languageforge/lexicon/lexicon.js b/src/angular-app/languageforge/lexicon/lexicon.js deleted file mode 100644 index 1fd324097e..0000000000 --- a/src/angular-app/languageforge/lexicon/lexicon.js +++ /dev/null @@ -1,234 +0,0 @@ -'use strict'; - -// Declare app level module which depends on filters, and services -angular.module('lexicon', - [ - 'ui.bootstrap', - 'ui.router', - 'ngSanitize', - 'palaso.ui.typeahead', - 'coreModule', - 'sgw.ui.breadcrumb', - 'lexiconModule', - 'pascalprecht.translate' - ]) - .config(['$stateProvider', '$urlRouterProvider', '$translateProvider', '$compileProvider', - '$sanitizeProvider', 'apiServiceProvider', - function ($stateProvider, $urlRouterProvider, $translateProvider, $compileProvider, - $sanitizeProvider, apiService) { - $compileProvider.debugInfoEnabled(apiService.isProduction); - $compileProvider.commentDirectivesEnabled(apiService.isProduction); - - // this is needed to allow style="font-family" on ng-bind-html elements - $sanitizeProvider.addValidAttrs(['style']); - - $urlRouterProvider.otherwise('/editor/list'); - - // State machine from ui.router - $stateProvider - .state('configuration', { - url: '/configuration', - template: '' - }) - .state('importExport', { - url: '/importExport', - template: '' - }) - .state('settings', { - url: '/settings', - template: '' - }) - .state('sync', { - url: '/sync', - template: '' - }) - ; - - // configure interface language file path - $translateProvider.useStaticFilesLoader({ - prefix: '/angular-app/languageforge/lexicon/lang/', - suffix: '.json' - }); - $translateProvider.preferredLanguage('en'); - $translateProvider.useSanitizeValueStrategy('escape'); - }]) - .controller('LexiconCtrl', ['$scope', '$interval', '$location', '$q', '$translate', - 'inputSystems', 'silNoticeService', 'sessionService', 'lexConfigService', 'lexProjectService', - 'lexEditorDataService', 'lexRightsService', 'lexSendReceiveApi', 'lexSendReceive', - function ($scope, $interval, $location, $q, $translate, - inputSystemsService, notice, sessionService, configService, lexProjectService, - editorService, rightsService, sendReceiveApi, sendReceive) { - var pristineLanguageCode; - - $scope.finishedLoading = false; - editorService.loadEditorData($scope).then(function () { - $scope.finishedLoading = true; - sendReceive.checkInitialState(); - }); - - $q.all([rightsService.getRights(), configService.getEditorConfig()]).then(function (data) { - var rights = data[0]; - var editorConfig = data[1]; - - if (rights.canEditProject()) { - lexProjectService.users().then(function (result) { - if (result.ok) { - var users = {}; - - // for (const user of (users.data.users as User[])) { // use when TS - angular.forEach(result.data.users, function (user) { - users[user.id] = user; - }); - - $scope.users = users; - } - }); - } - - $scope.editorConfig = editorConfig; - $scope.project = rights.session.project(); - $scope.config = rights.session.projectSettings().config; - $scope.optionLists = rights.session.projectSettings().optionlists; - $scope.rights = rights; - $scope.rights.showControlBar = function showControlBar() { - return $scope.rights.canRemoveUsers() || $scope.rights.canCreateUsers() || - $scope.rights.canEditUsers(); - }; - - $scope.currentUserRole = rights.session.projectSettings().currentUserRole; - $scope.interfaceConfig = rights.session.projectSettings().interfaceConfig; - pristineLanguageCode = angular.copy($scope.interfaceConfig.userLanguageCode); - changeInterfaceLanguage($scope.interfaceConfig.userLanguageCode); - - $scope.showSync = function showSync() { - return !$scope.project.isArchived && rights.canEditUsers() && - rights.session.projectSettings().hasSendReceive; - }; - - $scope.gotoDictionary = function gotoDictionary() { - $location.path('/editor/list'); - }; - - $scope.showDictionaryButton = function showDictionaryButton() { - return !($location.path().indexOf('/editor') === 0); - }; - - $scope.onUpdate = function onUpdate($event) { - if ($event.project) { - $scope.project = $event.project; - } - - if ($event.config) { - $scope.config = $event.config; - } - - if ($event.optionLists) { - $scope.optionLists = $event.optionLists; - } - - if ($event.config || $event.optionLists) { - configService.getEditorConfig($scope.config, $scope.optionLists) - .then(function (editorConfig) { - $scope.editorConfig = editorConfig; - }); - } - }; - - function changeInterfaceLanguage(code) { - $translate.use(code); - pristineLanguageCode = angular.copy(code); - - if (inputSystemsService.constructor.isRightToLeft(code)) { - $scope.interfaceConfig.direction = 'rtl'; - $scope.interfaceConfig.pullToSide = 'float-left'; - $scope.interfaceConfig.pullNormal = 'float-right'; - $scope.interfaceConfig.placementToSide = 'right'; - $scope.interfaceConfig.placementNormal = 'left'; - } else { - $scope.interfaceConfig.direction = 'ltr'; - $scope.interfaceConfig.pullToSide = 'float-right'; - $scope.interfaceConfig.pullNormal = 'float-left'; - $scope.interfaceConfig.placementToSide = 'left'; - $scope.interfaceConfig.placementNormal = 'right'; - } - } - - $scope.$watch('interfaceConfig.userLanguageCode', function (newVal) { - if (newVal && newVal !== pristineLanguageCode) { - var user = {}; - user.interfaceLanguageCode = newVal; - - lexProjectService.updateUserProfile(user); - - changeInterfaceLanguage(newVal); - } - }); - - $scope.$on('$destroy', sendReceive.cancelAllStatusTimers); - - // setup offline.js options - // see https://github.com/hubspot/offline for all options - // we tell offline.js to NOT store and remake requests while the connection is down - Offline.options.requests = false; - Offline.options.checkOnLoad = true; - Offline.options.checks = { xhr: { url: '/offlineCheck.txt' } }; - - // Set the page's Language Forge title, font size, and nav's background color - function setTitle(text, fontSize, backgroundColor) { - var title = document.querySelector('nav .mobile-title a'); - title.textContent = text; - title.style.fontSize = fontSize; - - document.querySelector('nav a.navbar-brand').textContent = text; - - document.querySelector('nav.navbar').style.backgroundColor = backgroundColor; - } - - var offlineMessageId; - Offline.on('up', function () { - setTitle('Language Forge', '', ''); - - if ($scope.online === false) { - notice.removeById(offlineMessageId); - notice.push(notice.SUCCESS, 'You are back online!'); - } - - $scope.online = true; - $scope.$digest(); - }); - - Offline.on('down', function () { - setTitle('Language Forge Offline', '0.8em', '#555'); - offlineMessageId = notice.push(notice.ERROR, - 'You are offline. Some features are not available', null, true, 5 * 1000); - $scope.online = false; - if (!/^\/editor\//.test($location.path())) { - // redirect to the editor - $location.path('/editor'); - notice.push(notice.SUCCESS, - 'The dictionary editor is available offline. Settings are not.'); - } - - $scope.$digest(); - }); - }); - }]) - .controller('BreadcrumbCtrl', ['$scope', '$rootScope', 'breadcrumbService', - function ($scope, $rootScope, breadcrumbService) { - $scope.idmap = breadcrumbService.idmap; - $rootScope.$on('$routeChangeSuccess', function () { - $scope.breadcrumbs = breadcrumbService.read(); - }); - - $scope.$watch('idmap', function () { - $scope.breadcrumbs = breadcrumbService.read(); - }, true); - }]) - - ; diff --git a/src/angular-app/languageforge/lexicon/lexicon.module.ts b/src/angular-app/languageforge/lexicon/lexicon.module.ts deleted file mode 100644 index 3268744b33..0000000000 --- a/src/angular-app/languageforge/lexicon/lexicon.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as angular from 'angular'; -import 'angular-sanitize'; - -import {LexiconCoreModule} from './core/lexicon-core.module'; -import {LexiconEditorModule} from './editor/editor.module'; -import './new-project/lexicon-new-project.module'; -import {LexiconSettingsModule} from './settings/settings.module'; - -export const LexiconModule = angular - .module('lexiconModule', [ - LexiconCoreModule, - LexiconEditorModule, - LexiconSettingsModule - ]) - .name; diff --git a/src/angular-app/languageforge/lexicon/settings/configuration/configuration.module.ts b/src/angular-app/languageforge/lexicon/settings/configuration/configuration.module.ts index a983c9e0b6..dd336620d3 100644 --- a/src/angular-app/languageforge/lexicon/settings/configuration/configuration.module.ts +++ b/src/angular-app/languageforge/lexicon/settings/configuration/configuration.module.ts @@ -5,14 +5,25 @@ import {CoreModule} from '../../../../bellows/core/core.module'; import {InputSystemsModule} from '../../../../bellows/core/input-systems/input-systems.service'; import {NoticeModule} from '../../../../bellows/core/notice/notice.module'; import {SelectLanguageModule} from '../../../../bellows/shared/select-language.component'; +import {LexiconCoreModule} from '../../core/lexicon-core.module'; import {InputSystemsConfigurationComponent} from './configuration-input-systems.component'; import {OptionListConfigurationComponent} from './configuration-option-lists.component'; import {UnifiedConfigurationComponent} from './configuration-unified.component'; export const LexiconConfigurationModule = angular - .module('lexiconConfigurationModule', ['ui.bootstrap', 'ngDragToReorder', CoreModule, NoticeModule, - SelectLanguageModule, 'palaso.ui.tabset', 'palaso.ui.picklistEditor', 'palaso.util.model.transform', - InputSystemsModule]) + .module('lexiconConfigurationModule', [ + 'ui.bootstrap', + 'ngDragToReorder', + CoreModule, + InputSystemsModule, + NoticeModule, + SelectLanguageModule, + 'palaso.ui.tabset', + 'palaso.ui.typeahead', + 'palaso.ui.picklistEditor', + 'palaso.util.model.transform', + LexiconCoreModule + ]) .component('lscUnified', UnifiedConfigurationComponent) .component('lscInputSystems', InputSystemsConfigurationComponent) .component('lscOptionLists', OptionListConfigurationComponent) diff --git a/src/angular-app/languageforge/lexicon/settings/settings.module.ts b/src/angular-app/languageforge/lexicon/settings/settings.module.ts index 98ff79bcad..ed4902b8b1 100644 --- a/src/angular-app/languageforge/lexicon/settings/settings.module.ts +++ b/src/angular-app/languageforge/lexicon/settings/settings.module.ts @@ -3,6 +3,7 @@ import * as angular from 'angular'; import {CoreModule} from '../../../bellows/core/core.module'; import {NoticeModule} from '../../../bellows/core/notice/notice.module'; import {SelectLanguageModule} from '../../../bellows/shared/select-language.component'; +import {LexiconCoreModule} from '../core/lexicon-core.module'; import {LexiconConfigurationComponent} from './configuration/configuration.component'; import {LexiconConfigurationModule} from './configuration/configuration.module'; import {LexiconImportComponent} from './import.component'; @@ -10,9 +11,19 @@ import {LexiconProjectSettingsComponent} from './project-settings.component'; import {LexiconSyncComponent} from './sync.component'; export const LexiconSettingsModule = angular - .module('lexiconSettingsModule', ['ui.bootstrap', 'ngFileUpload', CoreModule, NoticeModule, - LexiconConfigurationModule, 'palaso.ui.archiveProject', 'palaso.ui.deleteProject', SelectLanguageModule, - 'palaso.ui.listview', 'palaso.ui.notice', 'palaso.ui.textdrop', 'palaso.ui.typeahead']) + .module('lexiconSettingsModule', [ + 'ui.bootstrap', + 'ngFileUpload', + CoreModule, + NoticeModule, + SelectLanguageModule, + 'palaso.ui.archiveProject', + 'palaso.ui.deleteProject', + 'palaso.ui.listview', + 'palaso.ui.textdrop', + LexiconCoreModule, + LexiconConfigurationModule + ]) .component('lexiconConfig', LexiconConfigurationComponent) .component('lexiconImport', LexiconImportComponent) .component('lexiconProjectSettings', LexiconProjectSettingsComponent) diff --git a/src/angular-app/languageforge/main.ts b/src/angular-app/languageforge/main.ts index f04f6ccf37..894cec3acd 100644 --- a/src/angular-app/languageforge/main.ts +++ b/src/angular-app/languageforge/main.ts @@ -1,2 +1,2 @@ import '../bellows/main.common'; -import './lexicon/lexicon.module'; +import './lexicon/lexicon-app.module';