' +
'
' +
'
' +
@@ -135,7 +135,7 @@ define([
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-menu-navigation',
lock: [_set.lostConnect, _set.disableOnStart],
- caption: this.textNavigation,
+ caption: this.textOutline,
enableToggle: true,
dataHint: '1',
dataHintDirection: 'bottom',
@@ -305,6 +305,7 @@ define([
},
textNavigation: 'Navigation',
+ textOutline: 'Headings',
textZoom: 'Zoom',
textFitToPage: 'Fit To Page',
textFitToWidth: 'Fit To Width',
diff --git a/apps/documenteditor/main/app_dev.js b/apps/documenteditor/main/app_dev.js
index a43f32677..5c1187311 100644
--- a/apps/documenteditor/main/app_dev.js
+++ b/apps/documenteditor/main/app_dev.js
@@ -166,6 +166,9 @@ require([
Common.Locale.apply(
function() {
require([
+ 'common/main/lib/util/LocalStorage',
+ 'common/main/lib/controller/Themes',
+ 'common/main/lib/controller/Desktop',
'documenteditor/main/app/controller/Viewport',
'documenteditor/main/app/controller/DocumentHolder',
'documenteditor/main/app/controller/Toolbar',
@@ -187,7 +190,6 @@ require([
'documenteditor/main/app/view/TextArtSettings',
'documenteditor/main/app/view/SignatureSettings',
'common/main/lib/util/utils',
- 'common/main/lib/util/LocalStorage',
'common/main/lib/controller/Fonts',
'common/main/lib/controller/History'
/** coauthoring begin **/
@@ -201,8 +203,6 @@ require([
,'common/main/lib/controller/ExternalOleEditor'
,'common/main/lib/controller/ReviewChanges'
,'common/main/lib/controller/Protection'
- ,'common/main/lib/controller/Themes'
- ,'common/main/lib/controller/Desktop'
], function() {
window.compareVersions = true;
app.start();
diff --git a/apps/documenteditor/main/index.html b/apps/documenteditor/main/index.html
index f20c40c65..d5d34d2b4 100644
--- a/apps/documenteditor/main/index.html
+++ b/apps/documenteditor/main/index.html
@@ -255,8 +255,10 @@
window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"];
- if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent))
+ if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
document.write('
diff --git a/apps/documenteditor/main/locale/de.json b/apps/documenteditor/main/locale/de.json
index 7544cff11..a65bcc81f 100644
--- a/apps/documenteditor/main/locale/de.json
+++ b/apps/documenteditor/main/locale/de.json
@@ -1700,6 +1700,7 @@
"DE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Titel",
"DE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Hochgeladen",
"DE.Views.FileMenuPanels.DocumentInfo.txtWords": "Wörter",
+ "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "PDF-Ersteller",
"DE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Zugriffsrechte ändern",
"DE.Views.FileMenuPanels.DocumentRights.txtRights": "Personen mit Berechtigungen",
"DE.Views.FileMenuPanels.ProtectDoc.notcriticalErrorTitle": "Warnung",
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index dd174ddf3..ae4d86cc1 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -183,6 +183,7 @@
"Common.UI.SearchDialog.txtBtnReplaceAll": "Replace All",
"Common.UI.SynchronizeTip.textDontShow": "Don't show this message again",
"Common.UI.SynchronizeTip.textSynchronize": "The document has been changed by another user.
Please click to save your changes and reload the updates.",
+ "Common.UI.ThemeColorPalette.textRecentColors": "Recent Colors",
"Common.UI.ThemeColorPalette.textStandartColors": "Standard Colors",
"Common.UI.ThemeColorPalette.textThemeColors": "Theme Colors",
"Common.UI.Themes.txtThemeClassicLight": "Classic Light",
@@ -621,6 +622,7 @@
"DE.Controllers.Main.textPaidFeature": "Paid feature",
"DE.Controllers.Main.textReconnect": "Connection is restored",
"DE.Controllers.Main.textRemember": "Remember my choice for all files",
+ "DE.Controllers.Main.textRememberMacros": "Remember my choice for all macros",
"DE.Controllers.Main.textRenameError": "User name must not be empty.",
"DE.Controllers.Main.textRenameLabel": "Enter a name to be used for collaboration",
"DE.Controllers.Main.textShape": "Shape",
@@ -895,6 +897,7 @@
"DE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.
Contact %1 sales team for personal upgrade terms.",
"DE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
+ "DE.Controllers.Main.textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?",
"DE.Controllers.Navigation.txtBeginning": "Beginning of document",
"DE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document",
"DE.Controllers.Statusbar.textDisconnect": "
Connection is lostTrying to connect. Please check connection settings.",
@@ -1708,6 +1711,7 @@
"DE.Views.FileMenuPanels.DocumentInfo.txtParagraphs": "Paragraphs",
"DE.Views.FileMenuPanels.DocumentInfo.txtPdfTagged": "Tagged PDF",
"DE.Views.FileMenuPanels.DocumentInfo.txtPdfVer": "PDF Version",
+ "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "PDF Producer",
"DE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Location",
"DE.Views.FileMenuPanels.DocumentInfo.txtRights": "Persons who have rights",
"DE.Views.FileMenuPanels.DocumentInfo.txtSpaces": "Symbols with spaces",
@@ -1783,6 +1787,8 @@
"DE.Views.FileMenuPanels.Settings.txtFitPage": "Fit to Page",
"DE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit to Width",
"DE.Views.FileMenuPanels.Settings.txtHieroglyphs": "Hieroglyphs",
+ "DE.Views.FileMenuPanels.Settings.txtUseAltKey": "Use Alt key to navigate the user interface using the keyboard",
+ "DE.Views.FileMenuPanels.Settings.txtUseOptionKey": "Use Option key to navigate the user interface using the keyboard",
"DE.Views.FileMenuPanels.Settings.txtInch": "Inch",
"DE.Views.FileMenuPanels.Settings.txtInput": "Alternate Input",
"DE.Views.FileMenuPanels.Settings.txtLast": "View Last",
@@ -2020,6 +2026,7 @@
"DE.Views.LeftMenu.tipChat": "Chat",
"DE.Views.LeftMenu.tipComments": "Comments",
"DE.Views.LeftMenu.tipNavigation": "Navigation",
+ "DE.Views.LeftMenu.tipOutline": "Headings",
"DE.Views.LeftMenu.tipPlugins": "Plugins",
"DE.Views.LeftMenu.tipSearch": "Search",
"DE.Views.LeftMenu.tipSupport": "Feedback & Support",
@@ -2144,6 +2151,8 @@
"DE.Views.MailMergeSettings.txtPrev": "To previous record",
"DE.Views.MailMergeSettings.txtUntitled": "Untitled",
"DE.Views.MailMergeSettings.warnProcessMailMerge": "Starting merge failed",
+ "DE.Views.Navigation.strNavigate": "Headings",
+ "DE.Views.Navigation.txtClosePanel": "Close headings",
"DE.Views.Navigation.txtCollapse": "Collapse all",
"DE.Views.Navigation.txtDemote": "Demote",
"DE.Views.Navigation.txtEmpty": "There are no headings in the document.
Apply a heading style to the text so that it appears in the table of contents.",
@@ -2151,11 +2160,17 @@
"DE.Views.Navigation.txtEmptyViewer": "There are no headings in the document.",
"DE.Views.Navigation.txtExpand": "Expand all",
"DE.Views.Navigation.txtExpandToLevel": "Expand to level",
+ "DE.Views.Navigation.txtFontSize": "Font size",
"DE.Views.Navigation.txtHeadingAfter": "New heading after",
"DE.Views.Navigation.txtHeadingBefore": "New heading before",
+ "DE.Views.Navigation.txtLarge":"Large",
+ "DE.Views.Navigation.txtMedium": "Medium",
"DE.Views.Navigation.txtNewHeading": "New subheading",
"DE.Views.Navigation.txtPromote": "Promote",
"DE.Views.Navigation.txtSelect": "Select content",
+ "DE.Views.Navigation.txtSettings": "Headings settings",
+ "DE.Views.Navigation.txtSmall": "Small",
+ "DE.Views.Navigation.txtWrapHeadings": "Wrap long headings",
"DE.Views.NoteSettingsDialog.textApply": "Apply",
"DE.Views.NoteSettingsDialog.textApplyTo": "Apply changes to",
"DE.Views.NoteSettingsDialog.textContinue": "Continuous",
@@ -2849,6 +2864,7 @@
"DE.Views.ViewTab.textFitToWidth": "Fit To Width",
"DE.Views.ViewTab.textInterfaceTheme": "Interface theme",
"DE.Views.ViewTab.textNavigation": "Navigation",
+ "DE.Views.ViewTab.textOutline": "Headings",
"DE.Views.ViewTab.textRulers": "Rulers",
"DE.Views.ViewTab.textStatusBar": "Status Bar",
"DE.Views.ViewTab.textZoom": "Zoom",
diff --git a/apps/documenteditor/main/locale/es.json b/apps/documenteditor/main/locale/es.json
index 2d4ec44eb..7480669bc 100644
--- a/apps/documenteditor/main/locale/es.json
+++ b/apps/documenteditor/main/locale/es.json
@@ -1702,6 +1702,7 @@
"DE.Views.FileMenuPanels.DocumentInfo.txtParagraphs": "Párrafos",
"DE.Views.FileMenuPanels.DocumentInfo.txtPdfTagged": "PDF etiquetado",
"DE.Views.FileMenuPanels.DocumentInfo.txtPdfVer": "Versión PDF",
+ "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "Productor PDF",
"DE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Ubicación",
"DE.Views.FileMenuPanels.DocumentInfo.txtRights": "Personas que tienen derechos",
"DE.Views.FileMenuPanels.DocumentInfo.txtSpaces": "Símbolos con espacios",
diff --git a/apps/documenteditor/main/locale/fr.json b/apps/documenteditor/main/locale/fr.json
index 4322d0030..d397ab29a 100644
--- a/apps/documenteditor/main/locale/fr.json
+++ b/apps/documenteditor/main/locale/fr.json
@@ -1702,6 +1702,7 @@
"DE.Views.FileMenuPanels.DocumentInfo.txtParagraphs": "Paragraphes",
"DE.Views.FileMenuPanels.DocumentInfo.txtPdfTagged": "PDF marqué",
"DE.Views.FileMenuPanels.DocumentInfo.txtPdfVer": "Version PDF",
+ "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "Producteur PDF",
"DE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Emplacement",
"DE.Views.FileMenuPanels.DocumentInfo.txtRights": "Personnes qui ont des droits",
"DE.Views.FileMenuPanels.DocumentInfo.txtSpaces": "Symboles avec des espaces",
diff --git a/apps/documenteditor/main/locale/it.json b/apps/documenteditor/main/locale/it.json
index 10f5b078b..6d0b2d864 100644
--- a/apps/documenteditor/main/locale/it.json
+++ b/apps/documenteditor/main/locale/it.json
@@ -1700,6 +1700,7 @@
"DE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Titolo documento",
"DE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Caricato",
"DE.Views.FileMenuPanels.DocumentInfo.txtWords": "Parole",
+ "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "Produttore PDF",
"DE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Modifica diritti di accesso",
"DE.Views.FileMenuPanels.DocumentRights.txtRights": "Persone che hanno diritti",
"DE.Views.FileMenuPanels.ProtectDoc.notcriticalErrorTitle": "Avviso",
diff --git a/apps/documenteditor/main/locale/ru.json b/apps/documenteditor/main/locale/ru.json
index 065187092..8ede8d475 100644
--- a/apps/documenteditor/main/locale/ru.json
+++ b/apps/documenteditor/main/locale/ru.json
@@ -1703,6 +1703,7 @@
"DE.Views.FileMenuPanels.DocumentInfo.txtParagraphs": "Абзацы",
"DE.Views.FileMenuPanels.DocumentInfo.txtPdfTagged": "PDF с тегами",
"DE.Views.FileMenuPanels.DocumentInfo.txtPdfVer": "Версия PDF",
+ "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "Производитель PDF",
"DE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Размещение",
"DE.Views.FileMenuPanels.DocumentInfo.txtRights": "Люди, имеющие права",
"DE.Views.FileMenuPanels.DocumentInfo.txtSpaces": "Символы с пробелами",
diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less
index 260a36e47..650055751 100644
--- a/apps/documenteditor/main/resources/less/filemenu.less
+++ b/apps/documenteditor/main/resources/less/filemenu.less
@@ -102,46 +102,46 @@
.svg-format- {
&docx {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/docx.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/docx.svg') no-repeat center";
}
&pdf {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/pdf.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/pdf.svg') no-repeat center";
}
&odt {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/odt.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/odt.svg') no-repeat center";
}
&txt {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/txt.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/txt.svg') no-repeat center";
}
&dotx {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/dotx.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/dotx.svg') no-repeat center";
}
&pdfa {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/pdfa.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/pdfa.svg') no-repeat center";
}
&ott {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/ott.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/ott.svg') no-repeat center";
}
&rtf {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/rtf.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/rtf.svg') no-repeat center";
}
&docm {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/docm.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/docm.svg') no-repeat center";
}
&docxf {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/docxf.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/docxf.svg') no-repeat center";
}
&oform {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/oform.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/oform.svg') no-repeat center";
}
&html {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/html.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/html.svg') no-repeat center";
}
&fb2 {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/fb2.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/fb2.svg') no-repeat center";
}
&epub {
- background: ~"url(../../../apps/common/main/resources/img/doc-formats/epub.svg) no-repeat center";
+ background: ~"url('@{common-image-const-path}/doc-formats/epub.svg') no-repeat center";
}
}
@@ -162,10 +162,10 @@
cursor: pointer;
.svg-format-blank {
- background: ~"url(resources/img/blank.svg) no-repeat center" ;
+ background: ~"url(@{app-image-const-path}/blank.svg) no-repeat center" ;
}
.svg-file-template{
- background: ~"url(resources/img/file-template.svg) no-repeat center" ;
+ background: ~"url(@{app-image-const-path}/file-template.svg) no-repeat center" ;
}
div {
@@ -342,7 +342,7 @@
width: 100%;
height: 100%;
.svg-file-recent {
- background: ~"url(resources/img/recent-file.svg) no-repeat top";
+ background: ~"url(@{app-image-const-path}/recent-file.svg) no-repeat top";
}
}
}
diff --git a/apps/documenteditor/main/resources/less/navigation.less b/apps/documenteditor/main/resources/less/navigation.less
index e537517ce..9fd80ddb9 100644
--- a/apps/documenteditor/main/resources/less/navigation.less
+++ b/apps/documenteditor/main/resources/less/navigation.less
@@ -5,17 +5,23 @@
#navigation-header {
position: absolute;
- height: 38px;
+ height: 45px;
left: 0;
top: 0;
width: 100%;
- .font-weight-bold();
- padding: 10px 12px;
+ padding: 12px;
+ overflow: hidden;
border-bottom: @scaled-one-px-value-ie solid @border-toolbar-ie;
border-bottom: @scaled-one-px-value solid @border-toolbar;
+ label {
+ font-size: 12px;
+ .font-weight-bold();
+ margin-top: 2px;
+ }
}
#navigation-list {
+ padding-top: 45px;
height: 100%;
overflow: hidden;
font-size: 12px;
@@ -30,14 +36,34 @@
}
}
}
+ .tree-item {
+ min-height: 25px;
+ .name {
+ padding: 5px 0;
+ }
+ }
+ }
+ &.small{
+ font-size: 10px;
+ }
+ &.medium{
+ font-size: 12px;
+ .name {
+ padding: 4px 0;
+ }
+ }
+ &.large{
+ font-size: 14px;
}
-
.name.not-header {
font-style: italic;
}
- .name {
+ &.wrap .name{
white-space: pre-wrap;
+ }
+
+ .name {
word-break: break-word;
max-height: 350px;
}
diff --git a/apps/documenteditor/mobile/locale/az.json b/apps/documenteditor/mobile/locale/az.json
index 65ac70397..87e44b940 100644
--- a/apps/documenteditor/mobile/locale/az.json
+++ b/apps/documenteditor/mobile/locale/az.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "Bu faylı redaktə etmək icazəniz yoxdur.",
"textNoTextFound": "Text not found",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}"
+ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Qorunan Fayl",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Saxlanmamış dəyişiklikləriniz var. Avtomatik saxlanmanı gözləmək üçün \"Bu Səhifədə Qalın\" üzərinə klikləyin. Bütün saxlanmamış dəyişiklikləri ləğv etmək üçün \"Bu səhifədən Çıxın\" hissəsinin üzərinə klikləyin.",
diff --git a/apps/documenteditor/mobile/locale/be.json b/apps/documenteditor/mobile/locale/be.json
index 1c64fa788..7fcf1ce31 100644
--- a/apps/documenteditor/mobile/locale/be.json
+++ b/apps/documenteditor/mobile/locale/be.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
"warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.",
"warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
- "warnProcessRightsChange": "You don't have permission to edit this file."
+ "warnProcessRightsChange": "You don't have permission to edit this file.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Абаронены файл",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveTitleText": "Вы выходзіце з праграмы",
diff --git a/apps/documenteditor/mobile/locale/bg.json b/apps/documenteditor/mobile/locale/bg.json
index cc3ee0c00..4542b418d 100644
--- a/apps/documenteditor/mobile/locale/bg.json
+++ b/apps/documenteditor/mobile/locale/bg.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "You don't have permission to edit this file.",
"textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textNoTextFound": "Text not found"
+ "textNoTextFound": "Text not found",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Protected File",
@@ -655,7 +656,8 @@
"textPdfTagged": "Tagged PDF",
"textFastWV": "Fast Web View",
"textYes": "Yes",
- "textNo": "No"
+ "textNo": "No",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
diff --git a/apps/documenteditor/mobile/locale/ca.json b/apps/documenteditor/mobile/locale/ca.json
index 0e7d8ec90..365dd6327 100644
--- a/apps/documenteditor/mobile/locale/ca.json
+++ b/apps/documenteditor/mobile/locale/ca.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Has arribat al límit d'usuari per a %1 editors. Contacta amb el teu administrador per a més informació.",
"warnNoLicense": "Has arribat al límit de connexions simultànies a %1 editors. Aquest document només s'obrirà en mode lectura. Contacta amb l'equip de vendes %1 per a les condicions d'una actualització personal.",
"warnNoLicenseUsers": "Has arribat al límit d'usuaris per a %1 editors. Contacta amb l'equip de vendes de %1 per obtenir les condicions de millora personals dels teus serveis.",
- "warnProcessRightsChange": "No tens permís per editar aquest fitxer."
+ "warnProcessRightsChange": "No tens permís per editar aquest fitxer.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "El fitxer està protegit",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Tens canvis sense desar. Fes clic a \"Mantingueu-vos en aquesta pàgina\" per esperar al desament automàtic. Fes clic a \"Deixar aquesta pàgina\" per descartar tots els canvis no desats.",
diff --git a/apps/documenteditor/mobile/locale/cs.json b/apps/documenteditor/mobile/locale/cs.json
index 61e71709d..519778770 100644
--- a/apps/documenteditor/mobile/locale/cs.json
+++ b/apps/documenteditor/mobile/locale/cs.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Došlo dosažení limitu %1 editorů v režimu spolupráce na úpravách. Ohledně podrobností se obraťte na svého správce.",
"warnNoLicense": "Došlo k dosažení limitu souběžného připojení %1 editorů. Tento dokument bude otevřen pouze pro náhled. Pro rozšíření funkcí kontaktujte %1 obchodní oddělení.",
"warnNoLicenseUsers": "Došlo k dosažení limitu %1 editorů. Pro rozšíření funkcí kontaktujte %1 obchodní oddělení.",
- "warnProcessRightsChange": "Nemáte oprávnění pro úpravu tohoto dokumentu."
+ "warnProcessRightsChange": "Nemáte oprávnění pro úpravu tohoto dokumentu.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Zabezpečený soubor",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "V tomto dokumentu máte neuložené změny. Klikněte na 'Zůstat na této stránce'. Klikněte na 'Opustit tuto stránku' pro zahození neuložených změn.",
diff --git a/apps/documenteditor/mobile/locale/da.json b/apps/documenteditor/mobile/locale/da.json
index cc3ee0c00..4542b418d 100644
--- a/apps/documenteditor/mobile/locale/da.json
+++ b/apps/documenteditor/mobile/locale/da.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "You don't have permission to edit this file.",
"textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textNoTextFound": "Text not found"
+ "textNoTextFound": "Text not found",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Protected File",
@@ -655,7 +656,8 @@
"textPdfTagged": "Tagged PDF",
"textFastWV": "Fast Web View",
"textYes": "Yes",
- "textNo": "No"
+ "textNo": "No",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
diff --git a/apps/documenteditor/mobile/locale/de.json b/apps/documenteditor/mobile/locale/de.json
index 5428ce63a..8139f39d5 100644
--- a/apps/documenteditor/mobile/locale/de.json
+++ b/apps/documenteditor/mobile/locale/de.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Sie haben das Benutzerlimit für %1-Editoren erreicht. Bitte wenden Sie sich an Ihren Administrator, um weitere Informationen zu erhalten.",
"warnNoLicense": "Sie haben die maximale Anzahl von gleichzeitigen Verbindungen in %1-Editoren erreicht. Die Bearbeitung ist jetzt in diesem Dokument nicht verfügbar. Bitte kontaktieren Sie unser Verkaufsteam, um persönliche Upgrade-Bedingungen zu erhalten.",
"warnNoLicenseUsers": "Sie haben das Benutzerlimit für %1-Editoren erreicht. Bitte kontaktieren Sie unser Verkaufsteam, um persönliche Upgrade-Bedingungen zu erhalten.",
- "warnProcessRightsChange": "Sie können diese Datei nicht bearbeiten."
+ "warnProcessRightsChange": "Sie können diese Datei nicht bearbeiten.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Geschützte Datei",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF-Ersteller"
},
"Toolbar": {
"dlgLeaveMsgText": "Sie haben nicht gespeicherte Änderungen. Klicken Sie auf \"Auf dieser Seite bleiben\" und warten Sie, bis die Datei automatisch gespeichert wird. Klicken Sie auf \"Die Seite verlassen\", um nicht gespeicherte Änderungen zu verwerfen.",
diff --git a/apps/documenteditor/mobile/locale/el.json b/apps/documenteditor/mobile/locale/el.json
index 4ed3c7ffe..71598ffee 100644
--- a/apps/documenteditor/mobile/locale/el.json
+++ b/apps/documenteditor/mobile/locale/el.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Έχετε φτάσει το όριο χρήστη για συντάκτες %1.
Επικοινωνήστε με τον διαχειριστή σας για περισσότερες πληροφορίες.",
"warnNoLicense": "Φτάσατε το όριο ταυτόχρονων συνδέσεων σε %1 συντάκτες. Το έγγραφο θα ανοίξει μόνο για ανάγνωση. Επικοινωνήστε με την ομάδα πωλήσεων %1 για τους όρους αναβάθμισης.",
"warnNoLicenseUsers": "Έχετε φτάσει το όριο χρήστη για συντάκτες %1.
Επικοινωνήστε με την ομάδα πωλήσεων %1 για προσωπικούς όρους αναβάθμισης.",
- "warnProcessRightsChange": "Δεν έχετε δικαίωμα επεξεργασίας αυτού του αρχείου."
+ "warnProcessRightsChange": "Δεν έχετε δικαίωμα επεξεργασίας αυτού του αρχείου.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Προστατευμένο Αρχείο",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Έχετε μη αποθηκευμένες αλλαγές. Πατήστε 'Παραμονή στη Σελίδα' για να περιμένετε την αυτόματη αποθήκευση. Πατήστε 'Έξοδος από τη Σελίδα' για να απορρίψετε όλες τις μη αποθηκευμένες αλλαγές.",
diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json
index b54df1ffd..964d969d6 100644
--- a/apps/documenteditor/mobile/locale/en.json
+++ b/apps/documenteditor/mobile/locale/en.json
@@ -292,7 +292,14 @@
"textPageBreakBefore": "Page Break Before",
"textPageNumbering": "Page Numbering",
"textParagraph": "Paragraph",
- "textParagraphStyles": "Paragraph Styles",
+ "textCreateTextStyle": "Create new text style",
+ "textDone": "Done",
+ "textTitle": "Title",
+ "textEnterTitleNewStyle": "Enter title of a new style",
+ "textNextParagraphStyle": "Next paragraph style",
+ "textSameCreatedNewStyle": "Same as created new style",
+ "del_textParagraphStyles": "Paragraph Styles",
+ "textParagraphStyle": "Paragraph Style",
"textPictureFromLibrary": "Picture from Library",
"textPictureFromURL": "Picture from URL",
"textPt": "pt",
@@ -532,7 +539,8 @@
"warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
"warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.",
"warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
- "warnProcessRightsChange": "You don't have permission to edit this file."
+ "warnProcessRightsChange": "You don't have permission to edit this file.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Protected File",
@@ -608,6 +616,7 @@
"textParagraphs": "Paragraphs",
"textPdfTagged": "Tagged PDF",
"textPdfVer": "PDF Version",
+ "textPdfProducer": "PDF Producer",
"textPoint": "Point",
"textPortrait": "Portrait",
"textPrint": "Print",
diff --git a/apps/documenteditor/mobile/locale/es.json b/apps/documenteditor/mobile/locale/es.json
index 285376d0e..e6f3fd0b6 100644
--- a/apps/documenteditor/mobile/locale/es.json
+++ b/apps/documenteditor/mobile/locale/es.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Ha alcanzado el límite de usuarios para %1 editores. Póngase en contacto con su administrador para saber más.",
"warnNoLicense": "Ha alcanzado el límite de conexiones simultáneas con %1 editores. Este documento se abrirá sólo para su visualización. Póngase en contacto con el equipo de ventas de %1 para conocer las condiciones de actualización personal.",
"warnNoLicenseUsers": "Ha alcanzado el límite de usuarios para %1 editores. Póngase en contacto con el equipo de ventas de %1 para conocer las condiciones de actualización personal.",
- "warnProcessRightsChange": "No tiene permiso para editar este archivo."
+ "warnProcessRightsChange": "No tiene permiso para editar este archivo.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Archivo protegido",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "Productor PDF"
},
"Toolbar": {
"dlgLeaveMsgText": "Tiene cambios sin guardar. Haga clic en \"Permanecer en esta página\" para esperar a que se guarde automáticamente. Haga clic en \"Salir de esta página\" para descartar todos los cambios no guardados.",
diff --git a/apps/documenteditor/mobile/locale/fi.json b/apps/documenteditor/mobile/locale/fi.json
index cc3ee0c00..4542b418d 100644
--- a/apps/documenteditor/mobile/locale/fi.json
+++ b/apps/documenteditor/mobile/locale/fi.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "You don't have permission to edit this file.",
"textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textNoTextFound": "Text not found"
+ "textNoTextFound": "Text not found",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Protected File",
@@ -655,7 +656,8 @@
"textPdfTagged": "Tagged PDF",
"textFastWV": "Fast Web View",
"textYes": "Yes",
- "textNo": "No"
+ "textNo": "No",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
diff --git a/apps/documenteditor/mobile/locale/fr.json b/apps/documenteditor/mobile/locale/fr.json
index 4bbb151eb..25829e47c 100644
--- a/apps/documenteditor/mobile/locale/fr.json
+++ b/apps/documenteditor/mobile/locale/fr.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Vous avez dépassé le nombre maximal d’utilisateurs des éditeurs %1. Pour en savoir plus, contactez votre administrateur.",
"warnNoLicense": "Vous avez dépassé le nombre maximal de connexions simultanées aux éditeurs %1. Ce document sera ouvert en lecture seule. Contactez l’équipe des ventes %1 pour mettre à jour les termes de la licence.",
"warnNoLicenseUsers": "Vous avez dépassé le nombre maximal d’utilisateurs des éditeurs %1. Contactez l’équipe des ventes %1 pour mettre à jour les termes de la licence.",
- "warnProcessRightsChange": "Vous n'avez pas la permission de modifier ce fichier."
+ "warnProcessRightsChange": "Vous n'avez pas la permission de modifier ce fichier.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Fichier protégé",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "Producteur PDF"
},
"Toolbar": {
"dlgLeaveMsgText": "Vous avez des modifications non enregistrées dans ce document. Cliquez sur Rester sur cette page et attendez l'enregistrement automatique. Cliquez sur Quitter cette page pour annuler toutes les modifications non enregistrées.",
diff --git a/apps/documenteditor/mobile/locale/gl.json b/apps/documenteditor/mobile/locale/gl.json
index 25ac5103a..65b9eed8b 100644
--- a/apps/documenteditor/mobile/locale/gl.json
+++ b/apps/documenteditor/mobile/locale/gl.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Alcanzou o límite de usuarios para os editores de %1. Por favor, contacte co se uadministrador para recibir máis información.",
"warnNoLicense": "Alcanzou o límite de conexións simultáneas con %1 editores. Este documento abrirase para as úa visualización. Póñase en contacto co equipo de vendas de %1 para coñecer as condicións de actualización persoal.",
"warnNoLicenseUsers": "Alcanzou o límite de usuarios para os editores de %1.
Contacte co equipo de vendas de %1 para coñecer os termos de actualización persoal.",
- "warnProcessRightsChange": "Non ten permiso para editar este ficheiro."
+ "warnProcessRightsChange": "Non ten permiso para editar este ficheiro.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Ficheiro protexido",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Ten cambios sen gardar. Prema en \"Permanecer nesta páxina\" para esperar a que se garde automaticamente. Prema en \"Saír desta páxina\" para descartar todos os cambios non gardados.",
diff --git a/apps/documenteditor/mobile/locale/hu.json b/apps/documenteditor/mobile/locale/hu.json
index 5d75465bb..2e800f3a2 100644
--- a/apps/documenteditor/mobile/locale/hu.json
+++ b/apps/documenteditor/mobile/locale/hu.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Elérte a(z) %1 szerkesztőhöz tartozó felhasználói korlátját. További információért forduljon rendszergazdájához.",
"warnNoLicense": "Elérte a(z) %1 szerkesztővel való egyidejű kapcsolódási korlátot. Ez a dokumentum csak megtekintésre nyílik meg. Lépjen kapcsolatba a(z) %1 értékesítési csapattal a személyes frissítés feltételekért.",
"warnNoLicenseUsers": "Elérte a(z) %1 szerkesztőhöz tartozó felhasználói korlátját. Vegye fel a kapcsolatot a(z) %1 értékesítési csapattal a személyes frissítési feltételekért.",
- "warnProcessRightsChange": "Nincs engedélye a fájl szerkesztésére."
+ "warnProcessRightsChange": "Nincs engedélye a fájl szerkesztésére.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Védett fájl",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Nem mentett módosításai vannak. Kattintson a „Maradj ezen az oldalon” gombra az automatikus mentés megvárásához. Kattintson a \"Hagyja el ezt az oldalt\" gombra az összes nem mentett módosítás elvetéséhez.",
diff --git a/apps/documenteditor/mobile/locale/id.json b/apps/documenteditor/mobile/locale/id.json
index 0195441eb..9353166c8 100644
--- a/apps/documenteditor/mobile/locale/id.json
+++ b/apps/documenteditor/mobile/locale/id.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Anda sudah mencapai batas user untuk %1 editor. Hubungi admin Anda untuk mempelajari lebih lanjut.",
"warnNoLicense": "Anda sudah mencapai batas untuk koneksi bersamaan ke %1 editor. Dokumen ini akan dibuka untuk dilihat saja. Hubungi %1 tim sales untuk syarat personal upgrade.",
"warnNoLicenseUsers": "Anda sudah mencapai batas user untuk %1 editor. Hubungi %1 tim sales untuk syarat personal upgrade.",
- "warnProcessRightsChange": "Anda tidak memiliki izin edit file ini."
+ "warnProcessRightsChange": "Anda tidak memiliki izin edit file ini.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "File yang Diproteksi",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Anda memiliki perubahan yang belum tersimpan. Klik 'Tetap di Halaman Ini' untuk menunggu simpan otomatis. Klik ‘Tinggalkan Halaman Ini’ untuk membatalkan semua perubahan yang belum disimpan.",
diff --git a/apps/documenteditor/mobile/locale/it.json b/apps/documenteditor/mobile/locale/it.json
index e2df4e1a8..0862c2453 100644
--- a/apps/documenteditor/mobile/locale/it.json
+++ b/apps/documenteditor/mobile/locale/it.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Hai raggiunto il limite degli utenti per gli editor %1. Ti preghiamo di contattare il tuo amministratore per maggior informazioni.",
"warnNoLicense": "Hai raggiunto il limite delle connessioni simultanee agli editor %1. Questo documento sarà aperto solo in modalità di visualizzazione. Ti preghiamo di contattare il team di vendite di %1 per i termini di aggiornamento personali.",
"warnNoLicenseUsers": "Hai raggiunto il limite degli utenti per gli editor %1. Ti preghiamo di contattare il team di vendite di %1 per i termini di aggiornamento personali.",
- "warnProcessRightsChange": "Non hai il permesso di modificare questo file."
+ "warnProcessRightsChange": "Non hai il permesso di modificare questo file.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "File protetto",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "Produttore PDF"
},
"Toolbar": {
"dlgLeaveMsgText": "Hai dei cambiamenti non salvati. Premi 'Rimanere sulla pagina' per attendere il salvataggio automatico. Premi 'Lasciare la pagina' per eliminare tutte le modifiche non salvate.",
diff --git a/apps/documenteditor/mobile/locale/ja.json b/apps/documenteditor/mobile/locale/ja.json
index 630c72a9e..2d44b48de 100644
--- a/apps/documenteditor/mobile/locale/ja.json
+++ b/apps/documenteditor/mobile/locale/ja.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "%1エディターのユーザー制限に達しました。 詳細についてはアドミニストレータを連絡してください。",
"warnNoLicense": "%1エディター 時接続数の制限に達しました。この文書が見るだけのために開かれる。個人的なアップグレード条件については、%1営業チームを連絡してください。",
"warnNoLicenseUsers": "%1エディターのユーザー制限に達しました。 個人的なアップグレード条件については、%1営業チームを連絡してください。",
- "warnProcessRightsChange": "ファイルを編集する権限がありません!"
+ "warnProcessRightsChange": "ファイルを編集する権限がありません!",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "保護されたファイル",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "保存されていない変更があります。自動保存を待つように「このページから移動しない」をクリックしてください。保存されていない変更を破棄ように「このページから移動する」をクリックしてください。",
diff --git a/apps/documenteditor/mobile/locale/ko.json b/apps/documenteditor/mobile/locale/ko.json
index 25b34b8e3..0be5ed6d5 100644
--- a/apps/documenteditor/mobile/locale/ko.json
+++ b/apps/documenteditor/mobile/locale/ko.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "편집자 사용자 한도인 %1명에 도달했습니다. 자세한 내용은 관리자에게 문의하십시오.",
"warnNoLicense": "% 1 편집 연결 수 제한에 도달했습니다. 이 문서는 보기 모드로 열립니다. 개인적인 업그레이드 사항은 % 1 영업팀에 연락하십시오.",
"warnNoLicenseUsers": "ONLYOFFICE 편집자의이 버전은 동시 사용자에게 일정한 제한이 있습니다.
더 필요한 것이 있으면 현재 라이센스를 업그레이드하거나 상용 라이센스를 구입하십시오.",
- "warnProcessRightsChange": "파일을 편집 할 권한이 없습니다."
+ "warnProcessRightsChange": "파일을 편집 할 권한이 없습니다.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "보호 된 파일",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "저장하지 않은 변경 사항이 있습니다. 자동 저장이 완료될 때까지 기다리려면 \"이 페이지에 머물기\"를 클릭하십시오. \"이 페이지에서 나가기\"를 클릭하면 저장되지 않은 모든 변경 사항이 삭제됩니다.",
diff --git a/apps/documenteditor/mobile/locale/lo.json b/apps/documenteditor/mobile/locale/lo.json
index 19f65ddac..780b73c5f 100644
--- a/apps/documenteditor/mobile/locale/lo.json
+++ b/apps/documenteditor/mobile/locale/lo.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "ຈໍານວນ ການເຊື່ອມຕໍ່ພ້ອມກັນກັບຜູ້ແກ້ໄຂ ແມ່ນເກີນກໍານົດ % 1. ຕິດຕໍ່ທີມບໍລິຫານເພື່ອຂໍ້ມູນເພີ່ມເຕີ່ມ",
"warnNoLicense": "ທ່ານໄດ້ຖືກຈຳກັດສິດພຽງເທົ່ານີ້ສຳຫລັບການເຊື່່ອມພ້ອມກັນກັບເຄື່ອງມືແກ້ໄຂ %1 ແລ້ວເອກະສານນີ້ຈະເປີດໃຫ້ເບີ່ງເທົ່ານັ້ນ ຕິດຕໍ່ທີມຂາຍ %1 ສຳຫລັບເງື່ອນໄຂການອັບເກດສ່ວນບຸກຄົນ",
"warnNoLicenseUsers": "ຈໍານວນການເຊື່ອມຕໍ່ພ້ອມກັນກັບບັນນາທິການ ແມ່ນເກີນກໍານົດ % 1. ຕິດຕໍ່ ທີມຂາຍ %1 ສຳລັບຂໍ້ກຳນົດການຍົກລະດັບສິດ",
- "warnProcessRightsChange": "ທ່ານບໍ່ມີສິດໃນການແກ້ໄຂໄຟລ໌ນີ້."
+ "warnProcessRightsChange": "ທ່ານບໍ່ມີສິດໃນການແກ້ໄຂໄຟລ໌ນີ້.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "ເອກະສານທີ່ໄດ້ຮັບການປົກປ້ອງ",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "ທ່ານມີການປ່ຽນແປງທີ່ຍັງບໍ່ໄດ້ບັນທຶກໄວ້. ຄລິກທີ່ 'ຢູ່ໃນໜ້ານີ້' ເພື່ອລໍຖ້າການບັນທຶກອັດຕະໂນມັດ. ຄລິກ 'ອອກຈາກໜ້ານີ້' ເພື່ອຍົກເລີກການປ່ຽນແປງທີ່ບໍ່ໄດ້ບັນທຶກໄວ້ທັງໝົດ.",
diff --git a/apps/documenteditor/mobile/locale/lv.json b/apps/documenteditor/mobile/locale/lv.json
index cc3ee0c00..4542b418d 100644
--- a/apps/documenteditor/mobile/locale/lv.json
+++ b/apps/documenteditor/mobile/locale/lv.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "You don't have permission to edit this file.",
"textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textNoTextFound": "Text not found"
+ "textNoTextFound": "Text not found",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Protected File",
@@ -655,7 +656,8 @@
"textPdfTagged": "Tagged PDF",
"textFastWV": "Fast Web View",
"textYes": "Yes",
- "textNo": "No"
+ "textNo": "No",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
diff --git a/apps/documenteditor/mobile/locale/nb.json b/apps/documenteditor/mobile/locale/nb.json
index cc3ee0c00..4542b418d 100644
--- a/apps/documenteditor/mobile/locale/nb.json
+++ b/apps/documenteditor/mobile/locale/nb.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "You don't have permission to edit this file.",
"textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textNoTextFound": "Text not found"
+ "textNoTextFound": "Text not found",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Protected File",
@@ -655,7 +656,8 @@
"textPdfTagged": "Tagged PDF",
"textFastWV": "Fast Web View",
"textYes": "Yes",
- "textNo": "No"
+ "textNo": "No",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
diff --git a/apps/documenteditor/mobile/locale/nl.json b/apps/documenteditor/mobile/locale/nl.json
index 20b7f9a82..8557cbda1 100644
--- a/apps/documenteditor/mobile/locale/nl.json
+++ b/apps/documenteditor/mobile/locale/nl.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "Je hebt geen toestemming om dit bestand te bewerken.",
"textNoTextFound": "Text not found",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}"
+ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Beveiligd bestand",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "U heeft nog niet opgeslagen wijzigingen. Klik op 'Blijf op deze pagina' om te wachten op automatisch opslaan. Klik op 'Verlaat deze pagina' om alle niet-opgeslagen wijzigingen te verwijderen.",
diff --git a/apps/documenteditor/mobile/locale/pl.json b/apps/documenteditor/mobile/locale/pl.json
index cc3ee0c00..4542b418d 100644
--- a/apps/documenteditor/mobile/locale/pl.json
+++ b/apps/documenteditor/mobile/locale/pl.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "You don't have permission to edit this file.",
"textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textNoTextFound": "Text not found"
+ "textNoTextFound": "Text not found",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Protected File",
@@ -655,7 +656,8 @@
"textPdfTagged": "Tagged PDF",
"textFastWV": "Fast Web View",
"textYes": "Yes",
- "textNo": "No"
+ "textNo": "No",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
diff --git a/apps/documenteditor/mobile/locale/pt-PT.json b/apps/documenteditor/mobile/locale/pt-PT.json
index c95b65705..0fc936dc4 100644
--- a/apps/documenteditor/mobile/locale/pt-PT.json
+++ b/apps/documenteditor/mobile/locale/pt-PT.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Atingiu o limite de %1 editores. Contacte o seu administrador para obter detalhes.",
"warnNoLicense": "Atingiu o limite de ligações simultâneas a %1 editores. Este documento será aberto apenas para visualização. Contacte a %1 equipa de vendas para consultar os termos de atualização para si.",
"warnNoLicenseUsers": "Atingiu o limite de %1 editores. Contacte a equipa comercial %1 para obter mais informações.",
- "warnProcessRightsChange": "Não tem autorização para editar este ficheiro."
+ "warnProcessRightsChange": "Não tem autorização para editar este ficheiro.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Ficheiro protegido",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Existem alterações não guardadas. Clique 'Ficar na página' para guardar automaticamente. Clique 'Sair da página' para rejeitar todas as alterações.",
diff --git a/apps/documenteditor/mobile/locale/pt.json b/apps/documenteditor/mobile/locale/pt.json
index 5a8fff274..08e5d7ae2 100644
--- a/apps/documenteditor/mobile/locale/pt.json
+++ b/apps/documenteditor/mobile/locale/pt.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Você atingiu o limite de usuários para editores %1. Entre em contato com seu administrador para saber mais.",
"warnNoLicense": "Você atingiu o limite de conexões simultâneas para% 1 editores. Este documento será aberto apenas para visualização. Contate a equipe de vendas% 1 para termos de atualização pessoal.",
"warnNoLicenseUsers": "Você atingiu o limite de usuários para editores %1.
Entre em contato com a equipe de vendas da %1 para obter os termos de atualização pessoais.",
- "warnProcessRightsChange": "Você não tem permissão para editar este arquivo."
+ "warnProcessRightsChange": "Você não tem permissão para editar este arquivo.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Arquivo protegido",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Você tem mudanças não salvas. Clique em 'Ficar nesta página' para esperar pela auto-salvar. Clique em 'Sair desta página' para descartar todas as mudanças não salvas.",
diff --git a/apps/documenteditor/mobile/locale/ro.json b/apps/documenteditor/mobile/locale/ro.json
index 54b830f03..4ea87ed3b 100644
--- a/apps/documenteditor/mobile/locale/ro.json
+++ b/apps/documenteditor/mobile/locale/ro.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Ați atins numărul maxim de utilizatori ai %1 editoare. Pentru detalii, contactați administratorul dvs.",
"warnNoLicense": "Ați atins numărul maxim de conexiuni simultane la %1 de editoare. Documentul este disponibil numai pentru vizualizare. Contactați %1 Departamentul de Vânzări pentru acordarea condițiilor personale de actualizare.",
"warnNoLicenseUsers": "Ați atins numărul maxim de utilizatori ai %1 editoare. Contactați Grup Vânzări %1 pentru acordarea condițiilor personale de licențiere.",
- "warnProcessRightsChange": "Nu aveți permisiunea de editare pentru fișier."
+ "warnProcessRightsChange": "Nu aveți permisiunea de editare pentru fișier.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Fișierul protejat",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Nu ați salvat modificările din documentul. Faceți clic pe Rămâi în pagină și așteptați la salvare automată. Faceți clic pe Părăsește aceasta pagina ca să renunțați la toate modificările nesalvate.",
diff --git a/apps/documenteditor/mobile/locale/ru.json b/apps/documenteditor/mobile/locale/ru.json
index e3f06219a..081d21f17 100644
--- a/apps/documenteditor/mobile/locale/ru.json
+++ b/apps/documenteditor/mobile/locale/ru.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Вы достигли лимита на количество пользователей редакторов %1. Свяжитесь с администратором, чтобы узнать больше.",
"warnNoLicense": "Вы достигли лимита на одновременные подключения к редакторам %1. Этот документ будет открыт на просмотр. Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия обновления.",
"warnNoLicenseUsers": "Вы достигли лимита на количество пользователей редакторов %1. Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия обновления.",
- "warnProcessRightsChange": "У вас нет прав на редактирование этого файла."
+ "warnProcessRightsChange": "У вас нет прав на редактирование этого файла.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Защищенный файл",
@@ -603,6 +604,7 @@
"textParagraphs": "Абзацы",
"textPdfTagged": "PDF с тегами",
"textPdfVer": "Версия PDF",
+ "textPdfProducer": "Производитель PDF",
"textPoint": "Пункт",
"textPortrait": "Книжная",
"textPrint": "Печать",
diff --git a/apps/documenteditor/mobile/locale/sk.json b/apps/documenteditor/mobile/locale/sk.json
index a7d607ae7..f5c4992fc 100644
--- a/apps/documenteditor/mobile/locale/sk.json
+++ b/apps/documenteditor/mobile/locale/sk.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Dosiahli ste limit %1 editora v režime spolupráce na úpravách. Ohľadne podrobnosti sa obráťte na svojho správcu. ",
"warnNoLicense": "Dosiahli ste limit pre simultánne pripojenia k %1 editorom. Tento dokument sa otvorí iba na prezeranie. Kontaktujte predajný tím %1 pre osobné podmienky inovácie.",
"warnNoLicenseUsers": "Dosiahli ste limit %1 editora. Pre rozšírenie funkcií kontaktujte %1 obchodné oddelenie.",
- "warnProcessRightsChange": "Nemáte povolenie na úpravu tohto súboru."
+ "warnProcessRightsChange": "Nemáte povolenie na úpravu tohto súboru.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Chránený súbor",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Máte neuložené zmeny. Kliknite na „Zostať na tejto stránke“ a počkajte na automatické uloženie. Kliknutím na „Opustiť túto stránku“ zahodíte všetky neuložené zmeny.",
diff --git a/apps/documenteditor/mobile/locale/sl.json b/apps/documenteditor/mobile/locale/sl.json
index cc3ee0c00..4542b418d 100644
--- a/apps/documenteditor/mobile/locale/sl.json
+++ b/apps/documenteditor/mobile/locale/sl.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "You don't have permission to edit this file.",
"textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textNoTextFound": "Text not found"
+ "textNoTextFound": "Text not found",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Protected File",
@@ -655,7 +656,8 @@
"textPdfTagged": "Tagged PDF",
"textFastWV": "Fast Web View",
"textYes": "Yes",
- "textNo": "No"
+ "textNo": "No",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
diff --git a/apps/documenteditor/mobile/locale/sv.json b/apps/documenteditor/mobile/locale/sv.json
index cc3ee0c00..4542b418d 100644
--- a/apps/documenteditor/mobile/locale/sv.json
+++ b/apps/documenteditor/mobile/locale/sv.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "You don't have permission to edit this file.",
"textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textNoTextFound": "Text not found"
+ "textNoTextFound": "Text not found",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Protected File",
@@ -655,7 +656,8 @@
"textPdfTagged": "Tagged PDF",
"textFastWV": "Fast Web View",
"textYes": "Yes",
- "textNo": "No"
+ "textNo": "No",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
diff --git a/apps/documenteditor/mobile/locale/tr.json b/apps/documenteditor/mobile/locale/tr.json
index d147a198e..25d15d53f 100644
--- a/apps/documenteditor/mobile/locale/tr.json
+++ b/apps/documenteditor/mobile/locale/tr.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "Bu dosyayı düzenleme izniniz yok.",
"textNoTextFound": "Text not found",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}"
+ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Korumalı dosya",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "Kaydedilmemiş değişiklikleriniz mevcut. Otomatik kaydetmeyi beklemek için 'Bu Sayfada Kal' seçeneğini tıklayın. Kaydedilmemiş tüm değişiklikleri atmak için 'Bu Sayfadan Ayrıl'ı tıklayın.",
diff --git a/apps/documenteditor/mobile/locale/uk.json b/apps/documenteditor/mobile/locale/uk.json
index 11705e78d..98ec8e1d9 100644
--- a/apps/documenteditor/mobile/locale/uk.json
+++ b/apps/documenteditor/mobile/locale/uk.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "Ви досягли ліміту на кількість користувачів редакторів %1.
Зв'яжіться з адміністратором, щоб дізнатися більше.",
"warnNoLicense": "Ви досягли ліміту на одночасне підключення до редакторів %1. Цей документ буде відкрито для перегляду. Напишіть у відділ продажу %1, щоб обговорити індивідуальні умови оновлення.",
"warnNoLicenseUsers": "Ви досягли ліміту на одночасне підключення до редакторів %1.
Напишіть у відділ продаж %1, для обговорення індивідуальних умов ліцензування.",
- "warnProcessRightsChange": "У вас немає прав на редагування цього файлу."
+ "warnProcessRightsChange": "У вас немає прав на редагування цього файлу.",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Захищений файл",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "У документі є незбережені зміни. Натисніть 'Залишитись на сторінці', щоб дочекатися автозбереження. Натисніть 'Піти зі сторінки', щоб скинути всі незбережені зміни.",
diff --git a/apps/documenteditor/mobile/locale/vi.json b/apps/documenteditor/mobile/locale/vi.json
index cc3ee0c00..4542b418d 100644
--- a/apps/documenteditor/mobile/locale/vi.json
+++ b/apps/documenteditor/mobile/locale/vi.json
@@ -532,7 +532,8 @@
"warnProcessRightsChange": "You don't have permission to edit this file.",
"textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
"textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
- "textNoTextFound": "Text not found"
+ "textNoTextFound": "Text not found",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "Protected File",
@@ -655,7 +656,8 @@
"textPdfTagged": "Tagged PDF",
"textFastWV": "Fast Web View",
"textYes": "Yes",
- "textNo": "No"
+ "textNo": "No",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
diff --git a/apps/documenteditor/mobile/locale/zh-TW.json b/apps/documenteditor/mobile/locale/zh-TW.json
index e99160557..fd15d4e75 100644
--- a/apps/documenteditor/mobile/locale/zh-TW.json
+++ b/apps/documenteditor/mobile/locale/zh-TW.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "您已達到%1個編輯器的用戶限制。請與您的管理員聯繫以了解更多信息。",
"warnNoLicense": "您已達到同時連接到 %1 編輯器的限制。此文件將只提供檢視。有關個人升級條款,請聯繫 %1 業務團隊。",
"warnNoLicenseUsers": "您已達到%1個編輯器的用戶限制。與%1銷售團隊聯繫以了解個人升級條款。",
- "warnProcessRightsChange": "您沒有編輯這個文件的權限。"
+ "warnProcessRightsChange": "您沒有編輯這個文件的權限。",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "受保護的檔案",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "您有未儲存的變更。點擊“留在此頁面”以等待自動儲存。點擊“離開此頁面”以放棄所有未儲存的變更。",
diff --git a/apps/documenteditor/mobile/locale/zh.json b/apps/documenteditor/mobile/locale/zh.json
index 12028855c..6b102658c 100644
--- a/apps/documenteditor/mobile/locale/zh.json
+++ b/apps/documenteditor/mobile/locale/zh.json
@@ -532,7 +532,8 @@
"warnLicenseUsersExceeded": "你触发了 %1 编辑器的同时在线数限制。可联系管理员来了解更多信息。",
"warnNoLicense": "你已经触发了 %1 编辑器的同时在线数限制. 该文档打开后,你将只能查看。请联系 %1 的销售团队,获取个人升级条款。",
"warnNoLicenseUsers": "你触发了 %1 编辑器的同时在线数限制。请与 %1 的销售团队联系,以获取个人升级条款。",
- "warnProcessRightsChange": "你没有编辑这个文件的权限。"
+ "warnProcessRightsChange": "你没有编辑这个文件的权限。",
+ "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?"
},
"Settings": {
"advDRMOptions": "受保护的文件",
@@ -655,7 +656,8 @@
"textNavigation": "Navigation",
"textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.",
"textBeginningDocument": "Beginning of document",
- "textEmptyHeading": "Empty Heading"
+ "textEmptyHeading": "Empty Heading",
+ "textPdfProducer": "PDF Producer"
},
"Toolbar": {
"dlgLeaveMsgText": "你有未保存的修改。点击“留在该页”可等待自动保存完成。点击“离开该页”将丢弃全部未经保存的修改。",
diff --git a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx
index bf5727ed7..e92ef2281 100644
--- a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx
+++ b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx
@@ -242,7 +242,7 @@ class ContextMenu extends ContextMenuController {
} else {
const { t } = this.props;
const _t = t("ContextMenu", {returnObjects: true});
- const { canViewComments, canCoAuthoring, canComments, dataDoc } = this.props;
+ const { canViewComments, canCoAuthoring, canComments } = this.props;
const api = Common.EditorApi.get();
const inToc = api.asc_GetTableOfContentsPr(true);
@@ -290,7 +290,7 @@ class ContextMenu extends ContextMenuController {
});
}
- if ( canFillForms && dataDoc.fileType !== 'oform' && !locked ) {
+ if ( canFillForms && canCopy && !locked ) {
itemsIcon.push({
event: 'paste',
icon: 'icon-paste'
diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx
index ce6156a16..534840ae5 100644
--- a/apps/documenteditor/mobile/src/controller/Main.jsx
+++ b/apps/documenteditor/mobile/src/controller/Main.jsx
@@ -49,6 +49,7 @@ class MainController extends Component {
};
this.defaultTitleText = __APP_TITLE_TEXT__;
+ this.stackMacrosRequests = [];
const { t } = this.props;
this._t = t('Main', {returnObjects:true});
@@ -99,6 +100,9 @@ class MainController extends Component {
}
this.props.storeApplicationSettings.changeMacrosSettings(value);
+ value = localStorage.getItem("de-mobile-allow-macros-request");
+ this.props.storeApplicationSettings.changeMacrosRequest((value !== null) ? parseInt(value) : 0);
+
Common.Notifications.trigger('configOptionsFill');
};
@@ -112,6 +116,7 @@ class MainController extends Component {
this.permissions = Object.assign(this.permissions, data.doc.permissions);
const _permissions = Object.assign({}, data.doc.permissions);
+ const _options = Object.assign({}, data.doc.options, this.editorConfig.actionLink || {});
const _userOptions = this.props.storeAppOptions.user;
const _user = new Asc.asc_CUserInfo();
_user.put_Id(_userOptions.id);
@@ -124,7 +129,7 @@ class MainController extends Component {
docInfo.put_Title(data.doc.title);
docInfo.put_Format(data.doc.fileType);
docInfo.put_VKey(data.doc.vkey);
- docInfo.put_Options(data.doc.options);
+ docInfo.put_Options(_options);
docInfo.put_UserInfo(_user);
docInfo.put_CallbackUrl(this.editorConfig.callbackUrl);
docInfo.put_Token(data.doc.token);
@@ -159,6 +164,7 @@ class MainController extends Component {
this.api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions);
this.api.asc_registerCallback('asc_onDocumentContentReady', onDocumentContentReady);
this.api.asc_registerCallback('asc_onLicenseChanged', this.onLicenseChanged.bind(this));
+ this.api.asc_registerCallback('asc_onMacrosPermissionRequest', this.onMacrosPermissionRequest.bind(this));
this.api.asc_registerCallback('asc_onRunAutostartMacroses', this.onRunAutostartMacroses.bind(this));
this.api.asc_setDocInfo(docInfo);
this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId);
@@ -704,7 +710,7 @@ class MainController extends Component {
this.api.asc_registerCallback('asc_onGetDocInfoEnd', () => {
clearTimeout(this.timerLoading);
clearInterval(this.timerDocInfo);
- storeDocumentInfo.switchIsLoaded(true);
+ storeDocumentInfo.changeCount(this.objectInfo);
});
// Color Schemes
@@ -1007,6 +1013,70 @@ class MainController extends Component {
}
}
+ onMacrosPermissionRequest (url, callback) {
+ if (url && callback) {
+ this.stackMacrosRequests.push({url: url, callback: callback});
+ if (this.stackMacrosRequests.length>1) {
+ return;
+ }
+ } else if (this.stackMacrosRequests.length>0) {
+ url = this.stackMacrosRequests[0].url;
+ callback = this.stackMacrosRequests[0].callback;
+ } else
+ return;
+
+ const value = this.props.storeApplicationSettings.macrosRequest;
+ if (value>0) {
+ callback && callback(value === 1);
+ this.stackMacrosRequests.shift();
+ this.onMacrosPermissionRequest();
+ } else {
+ const { t } = this.props;
+ const _t = t('Main', {returnObjects:true});
+ f7.dialog.create({
+ title: _t.notcriticalErrorTitle,
+ text: _t.textRequestMacros.replace('%1', url),
+ cssClass: 'dlg-macros-request',
+ content: `
+
+ ${_t.textRemember}
+
`,
+ buttons: [{
+ text: _t.textYes,
+ onClick: () => {
+ const dontshow = $$('input[name="checkbox-show-macros"]').prop('checked');
+ if (dontshow) {
+ this.props.storeApplicationSettings.changeMacrosRequest(1);
+ LocalStorage.setItem("de-mobile-allow-macros-request", 1);
+ }
+ setTimeout(() => {
+ if (callback) callback(true);
+ this.stackMacrosRequests.shift();
+ this.onMacrosPermissionRequest();
+ }, 1);
+ }},
+ {
+ text: _t.textNo,
+ onClick: () => {
+ const dontshow = $$('input[name="checkbox-show-macros"]').prop('checked');
+ if (dontshow) {
+ this.props.storeApplicationSettings.changeMacrosRequest(2);
+ LocalStorage.setItem("de-mobile-allow-macros-request", 2);
+ }
+ setTimeout(() => {
+ if (callback) callback(false);
+ this.stackMacrosRequests.shift();
+ this.onMacrosPermissionRequest();
+ }, 1);
+ }
+ }]
+ }).open();
+ }
+ }
+
render() {
return (
diff --git a/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx b/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx
index 20aabc0a4..a772d7fc9 100644
--- a/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx
+++ b/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx
@@ -6,7 +6,10 @@ class EditParagraphController extends Component {
constructor (props) {
super(props);
props.storeParagraphSettings.setBackColor(undefined);
+
this.onStyleClick = this.onStyleClick.bind(this);
+ this.onSaveStyle = this.onSaveStyle.bind(this);
+ this.onStyleMenuDelete = this.onStyleMenuDelete.bind(this);
}
onStyleClick (name) {
@@ -17,6 +20,22 @@ class EditParagraphController extends Component {
}
}
+ onSaveStyle(title, nextParagraphStyle) {
+ const api = Common.EditorApi.get();
+ const style = api.asc_GetStyleFromFormatting();
+
+ style.put_Name(title);
+ style.put_Next(nextParagraphStyle ? nextParagraphStyle : null);
+
+ api.asc_AddNewStyle(style);
+ this.props.storeParagraphSettings.changeParaStyleName(title);
+ }
+
+ onStyleMenuDelete(styleName) {
+ const api = Common.EditorApi.get();
+ api.asc_RemoveStyle(styleName);
+ }
+
onDistanceBefore (distance, isDecrement) {
const api = Common.EditorApi.get();
if (api) {
@@ -156,6 +175,8 @@ class EditParagraphController extends Component {
onKeepTogether={this.onKeepTogether}
onKeepNext={this.onKeepNext}
onBackgroundColor={this.onBackgroundColor}
+ onSaveStyle={this.onSaveStyle}
+ onStyleMenuDelete={this.onStyleMenuDelete}
/>
)
}
diff --git a/apps/documenteditor/mobile/src/controller/edit/EditText.jsx b/apps/documenteditor/mobile/src/controller/edit/EditText.jsx
index 4b8e57998..ea74e99dd 100644
--- a/apps/documenteditor/mobile/src/controller/edit/EditText.jsx
+++ b/apps/documenteditor/mobile/src/controller/edit/EditText.jsx
@@ -193,6 +193,14 @@ class EditTextController extends Component {
if (api) api.put_ListType(2, parseInt(type));
}
+ getIconsBulletsAndNumbers(arrayElements, type) {
+ const api = Common.EditorApi.get();
+ const arr = [];
+
+ arrayElements.forEach( item => arr.push(item.id));
+ if (api) api.SetDrawImagePreviewBulletForMenu(arr, type);
+ }
+
onLineSpacing(value) {
const api = Common.EditorApi.get();
if (api) {
@@ -221,6 +229,7 @@ class EditTextController extends Component {
onParagraphMove={this.onParagraphMove}
onBullet={this.onBullet}
onNumber={this.onNumber}
+ getIconsBulletsAndNumbers={this.getIconsBulletsAndNumbers}
onMultiLevelList={this.onMultiLevelList}
onLineSpacing={this.onLineSpacing}
/>
diff --git a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx
index 72ef0f16a..6f859d051 100644
--- a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx
+++ b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx
@@ -88,6 +88,9 @@ class DocumentInfoController extends Component {
value = props.Version;
if(value) this.docInfoObject.version = value;
+ value = props.Producer;
+ if(value) this.docInfoObject.producer = value;
+
value = props.Tagged;
if (value !== undefined)
this.docInfoObject.tagged = (value===true ? _t.textYes : _t.textNo);
@@ -120,7 +123,7 @@ class DocumentInfoController extends Component {
return appName || '';
} else if (this.pdfProps) {
- appName = this.pdfProps ? this.pdfProps.Producer || '' : '';
+ appName = this.pdfProps ? this.pdfProps.Creator || '' : '';
return appName;
}
}
diff --git a/apps/documenteditor/mobile/src/index_dev.html b/apps/documenteditor/mobile/src/index_dev.html
index 05790b92b..939932bab 100644
--- a/apps/documenteditor/mobile/src/index_dev.html
+++ b/apps/documenteditor/mobile/src/index_dev.html
@@ -2,7 +2,7 @@
-
+
diff --git a/apps/documenteditor/mobile/src/less/app.less b/apps/documenteditor/mobile/src/less/app.less
index f78237403..8f9fb566d 100644
--- a/apps/documenteditor/mobile/src/less/app.less
+++ b/apps/documenteditor/mobile/src/less/app.less
@@ -137,14 +137,14 @@
.swiper-pagination-bullet-active{
background: @black;
}
- .multilevels {
- li:not(:first-child){
- border:none;
- .item-content {
- min-height: 70px;
- }
- }
- }
+ // .multilevels {
+ // li:not(:first-child){
+ // border:none;
+ // .item-content {
+ // min-height: 70px;
+ // }
+ // }
+ // }
}
// Skeleton table
@@ -315,3 +315,12 @@
border-top: 1px solid var(--background-menu-divider);
}
}
+
+.create-style-link {
+ .item-link .item-inner:before {
+ display: none;
+ }
+ .item-title {
+ color: @brandColor;
+ }
+}
diff --git a/apps/documenteditor/mobile/src/less/icons-material.less b/apps/documenteditor/mobile/src/less/icons-material.less
index d1dbc3656..88b85795d 100644
--- a/apps/documenteditor/mobile/src/less/icons-material.less
+++ b/apps/documenteditor/mobile/src/less/icons-material.less
@@ -215,6 +215,11 @@
height: 22px;
.encoded-svg-mask('');
}
+ &.icon-create-style {
+ width: 24px;
+ height: 24px;
+ .encoded-svg-mask('')
+ }
// Presets of table borders
&.icon-table-borders-all {
width: 28px;
diff --git a/apps/documenteditor/mobile/src/store/appOptions.js b/apps/documenteditor/mobile/src/store/appOptions.js
index caf9cea01..794e650bd 100644
--- a/apps/documenteditor/mobile/src/store/appOptions.js
+++ b/apps/documenteditor/mobile/src/store/appOptions.js
@@ -114,15 +114,20 @@ export class storeAppOptions {
this.canComments = this.canLicense && (permissions.comment === undefined ? this.isEdit : permissions.comment) && (this.config.mode !== 'view');
this.canComments = this.canComments && !((typeof (this.customization) == 'object') && this.customization.comments===false);
this.canViewComments = this.canComments || !((typeof (this.customization) == 'object') && this.customization.comments===false);
- this.canEditComments = this.isOffline || !(typeof (this.customization) == 'object' && this.customization.commentAuthorOnly);
+ this.canEditComments = this.isOffline || !permissions.editCommentAuthorOnly;
this.canDeleteComments= this.isOffline || !permissions.deleteCommentAuthorOnly;
+ if ((typeof (this.customization) == 'object') && this.customization.commentAuthorOnly===true) {
+ console.log("Obsolete: The 'commentAuthorOnly' parameter of the 'customization' section is deprecated. Please use 'editCommentAuthorOnly' and 'deleteCommentAuthorOnly' parameters in the permissions instead.");
+ if (permissions.editCommentAuthorOnly===undefined && permissions.deleteCommentAuthorOnly===undefined)
+ this.canEditComments = this.canDeleteComments = this.isOffline;
+ }
this.canChat = this.canLicense && !this.isOffline && (permissions.chat !== false);
this.canEditStyles = this.canLicense && this.canEdit;
this.canPrint = (permissions.print !== false);
this.fileKey = document.key;
const typeForm = /^(?:(oform))$/.exec(document.fileType); // can fill forms only in oform format
this.canFillForms = this.canLicense && !!(typeForm && typeof typeForm[1] === 'string') && ((permissions.fillForms===undefined) ? this.isEdit : permissions.fillForms) && (this.config.mode !== 'view');
- this.isRestrictedEdit = !this.isEdit && (this.canComments || this.canFillForms);
+ this.isRestrictedEdit = !this.isEdit && (this.canComments || this.canFillForms) && isSupportEditFeature;
if (this.isRestrictedEdit && this.canComments && this.canFillForms) // must be one restricted mode, priority for filling forms
this.canComments = false;
this.trialMode = params.asc_getLicenseMode();
diff --git a/apps/documenteditor/mobile/src/store/applicationSettings.js b/apps/documenteditor/mobile/src/store/applicationSettings.js
index fb93e9a27..16649d877 100644
--- a/apps/documenteditor/mobile/src/store/applicationSettings.js
+++ b/apps/documenteditor/mobile/src/store/applicationSettings.js
@@ -11,7 +11,8 @@ export class storeApplicationSettings {
isComments: observable,
isResolvedComments: observable,
macrosMode: observable,
- changeSpellCheck: action,
+ macrosRequest: observable,
+ changeSpellCheck: action,
changeUnitMeasurement: action,
changeNoCharacters: action,
changeShowTableEmptyLine: action,
@@ -19,7 +20,8 @@ export class storeApplicationSettings {
changeDisplayResolved: action,
changeMacrosSettings: action,
directionMode: observable,
- changeDirectionMode: action
+ changeDirectionMode: action,
+ changeMacrosRequest: action
})
}
@@ -30,12 +32,15 @@ export class storeApplicationSettings {
isComments = false;
isResolvedComments = false;
macrosMode = 0;
+
directionMode = LocalStorage.getItem('mode-direction') || 'ltr';
changeDirectionMode(value) {
this.directionMode = value;
}
+ macrosRequest = 0;
+
changeUnitMeasurement(value) {
this.unitMeasurement = +value;
}
@@ -64,4 +69,8 @@ export class storeApplicationSettings {
changeMacrosSettings(value) {
this.macrosMode = +value;
}
+
+ changeMacrosRequest(value) {
+ this.macrosRequest = value;
+ }
}
\ No newline at end of file
diff --git a/apps/documenteditor/mobile/src/view/edit/Edit.jsx b/apps/documenteditor/mobile/src/view/edit/Edit.jsx
index 8cce09c6d..c568acec3 100644
--- a/apps/documenteditor/mobile/src/view/edit/Edit.jsx
+++ b/apps/documenteditor/mobile/src/view/edit/Edit.jsx
@@ -16,7 +16,7 @@ import EditHeaderController from "../../controller/edit/EditHeader";
import EditTableContentsController from "../../controller/edit/EditTableContents";
import {PageTextFonts, PageTextAddFormatting, PageTextBulletsAndNumbers, PageTextLineSpacing, PageTextFontColor, PageTextCustomFontColor, PageTextHighlightColor} from "./EditText";
-import {ParagraphAdvSettings, PageParagraphBackColor, PageParagraphCustomColor} from "./EditParagraph";
+import {ParagraphAdvSettings, PageParagraphBackColor, PageParagraphCustomColor, PageParagraphStyle, PageCreateTextStyle, PageChangeNextParagraphStyle} from "./EditParagraph";
import {PageShapeStyleNoFill, PageShapeStyle, PageShapeCustomFillColor, PageShapeBorderColor, PageShapeCustomBorderColor, PageWrap, PageReorder, PageReplace} from "./EditShape";
import {PageImageReorder, PageImageReplace, PageImageWrap, PageLinkSettings} from "./EditImage";
import {PageTableOptions, PageTableWrap, PageTableStyle, PageTableStyleOptions, PageTableCustomFillColor, PageTableBorderColor, PageTableCustomBorderColor} from "./EditTable";
@@ -66,6 +66,18 @@ const routes = [
path: '/edit-paragraph-custom-color/',
component: PageParagraphCustomColor,
},
+ {
+ path: '/edit-paragraph-style/',
+ component: PageParagraphStyle
+ },
+ {
+ path: '/create-text-style/',
+ component: PageCreateTextStyle
+ },
+ {
+ path: '/change-next-paragraph-style/',
+ component: PageChangeNextParagraphStyle
+ },
//Edit shape
{
path: '/edit-shape-style/',
diff --git a/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx b/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx
index e3662f2bd..dd6b5764e 100644
--- a/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx
+++ b/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx
@@ -1,6 +1,6 @@
import React, {Fragment, useState} from 'react';
import {observer, inject} from "mobx-react";
-import {f7, List, ListItem, Icon, Button, Page, Navbar, NavRight, Segmented, BlockTitle, Toggle, Link} from 'framework7-react';
+import {f7, List, ListItem, Icon, Button, Page, Navbar, NavRight, Segmented, BlockTitle, Toggle, Link, NavLeft, NavTitle, ListInput} from 'framework7-react';
import { useTranslation } from 'react-i18next';
import {Device} from '../../../../../common/mobile/utils/device';
import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx';
@@ -191,6 +191,7 @@ const EditParagraph = props => {
const storeParagraphSettings = props.storeParagraphSettings;
const paragraphStyles = storeParagraphSettings.paragraphStyles;
const curStyleName = storeParagraphSettings.styleName;
+ const curStyle = paragraphStyles.find(style => style.name === curStyleName);
const thumbSize = storeParagraphSettings.styleThumbSize;
const paragraph = props.storeFocusObjects.paragraphObject;
@@ -200,6 +201,18 @@ const EditParagraph = props => {
return (
+ {t('Edit.textParagraphStyle')}
+
+
+
+
+
{
onKeepNext: props.onKeepNext
}}>
- {_t.textParagraphStyles}
+
+ )
+};
+
+const EditParagraphStyle = props => {
+ const { t } = useTranslation();
+ const api = Common.EditorApi.get();
+ const _t = t('Edit', {returnObjects: true});
+ const storeParagraphSettings = props.storeParagraphSettings;
+ const paragraphStyles = storeParagraphSettings.paragraphStyles;
+ const curStyleName = storeParagraphSettings.styleName;
+ const thumbSize = storeParagraphSettings.styleThumbSize;
+ const activeStyle = Device.android ? 'link no-active-state' : 'no-active-state';
+
+ return (
+
+
+ {Device.phone &&
+
+
+
+
+
+ }
+
+
+
+ {Device.android && }
+
+
{paragraphStyles.map((style, index) => (
{
if(curStyleName !== style.name) {
@@ -236,21 +281,122 @@ const EditParagraph = props => {
}}
>
+ {!api.asc_IsStyleDefault(style.name) && (
+
+ {
+ await storeParagraphSettings.changeParaStyleName('Normal');
+ await props.onStyleMenuDelete(style.name);
+ }}>
+
+
+
+ )}
+
+ ))}
+
+
+ )
+}
+
+const CreateTextStyle = props => {
+ const { t } = useTranslation();
+ const _t = t('Edit', {returnObjects: true});
+ const [titleNewStyle, setTitle] = useState('');
+ const [nextParagraphStyle, setParagraph] = useState('');
+
+ return (
+
+
+ {
+ let title = titleNewStyle.trim();
+ if(title) {
+ props.onSaveStyle(title, nextParagraphStyle);
+ props.f7router.back();
+ }
+ }}>{t('Edit.textDone')}
+
+
+ {
+ setTitle(event.target.value)
+ }}
+ >
+
+ {t('Edit.textNextParagraphStyle')}
+
+
+
+
+ )
+}
+
+const ChangeNextParagraphStyle = props => {
+ const { t } = useTranslation();
+ const _t = t('Edit', {returnObjects: true});
+ const nextParagraphStyle = props.nextParagraphStyle;
+ const storeParagraphSettings = props.storeParagraphSettings;
+ const paragraphStyles = storeParagraphSettings.paragraphStyles;
+ const thumbSize = storeParagraphSettings.styleThumbSize;
+ const activeStyle = Device.android ? 'link no-active-state' : 'no-active-state';
+ const [newParagraph, setParagraph] = useState(nextParagraphStyle);
+
+ return (
+
+
+
+ {
+ if(newParagraph) {
+ setParagraph('');
+ props.setParagraph('');
+ }
+ }} title={t('Edit.textSameCreatedNewStyle')}>
+ {paragraphStyles.map((style, index) => (
+ {
+ if(newParagraph !== style.name) {
+ setParagraph(style.name);
+ props.setParagraph(style.name);
+ }
+ }}
+ >
+
))}
-
+
)
-};
+
+}
const EditParagraphContainer = inject("storeParagraphSettings", "storeFocusObjects")(observer(EditParagraph));
const ParagraphAdvSettings = inject("storeParagraphSettings", "storeFocusObjects")(observer(PageAdvancedSettings));
const PageParagraphBackColor = inject("storeParagraphSettings", "storePalette")(observer(PageBackgroundColor));
const PageParagraphCustomColor = inject("storeParagraphSettings", "storePalette")(observer(PageCustomBackColor));
+const PageParagraphStyle = inject("storeParagraphSettings")(observer(EditParagraphStyle));
+const PageCreateTextStyle = inject("storeParagraphSettings")(observer(CreateTextStyle));
+const PageChangeNextParagraphStyle = inject("storeParagraphSettings")(observer(ChangeNextParagraphStyle));
-export {EditParagraphContainer as EditParagraph,
+export {
+ EditParagraphContainer as EditParagraph,
ParagraphAdvSettings,
PageParagraphBackColor,
- PageParagraphCustomColor};
\ No newline at end of file
+ PageParagraphCustomColor,
+ PageParagraphStyle,
+ PageCreateTextStyle,
+ PageChangeNextParagraphStyle
+};
\ No newline at end of file
diff --git a/apps/documenteditor/mobile/src/view/edit/EditText.jsx b/apps/documenteditor/mobile/src/view/edit/EditText.jsx
index 3e66e06a7..653bcb67d 100644
--- a/apps/documenteditor/mobile/src/view/edit/EditText.jsx
+++ b/apps/documenteditor/mobile/src/view/edit/EditText.jsx
@@ -181,70 +181,62 @@ const PageAdditionalFormatting = props => {
};
const PageBullets = observer( props => {
- const { t } = useTranslation();
- const bulletArrays = [
- [
- {type: -1, thumb: ''},
- {type: 1, thumb: 'bullet-01.png'},
- {type: 2, thumb: 'bullet-02.png'},
- {type: 3, thumb: 'bullet-03.png'}
- ],
- [
- {type: 4, thumb: 'bullet-04.png'},
- {type: 5, thumb: 'bullet-05.png'},
- {type: 6, thumb: 'bullet-06.png'},
- {type: 7, thumb: 'bullet-07.png'}
- ]
- ];
const storeTextSettings = props.storeTextSettings;
const typeBullets = storeTextSettings.typeBullets;
+ const bulletArrays = [
+ { type: 0, subtype: -1 },
+ { type: 0, subtype: 1 },
+ { type: 0, subtype: 2 },
+ { type: 0, subtype: 3 },
+ { type: 0, subtype: 4 },
+ { type: 0, subtype: 5 },
+ { type: 0, subtype: 6 },
+ { type: 0, subtype: 7 }
+ ];
+
+ useEffect(() => {
+ props.getIconsBulletsAndNumbers($$('.item-marker'), 0);
+ }, []);
return(
- {bulletArrays.map((bullets, index) => (
-
- {bullets.map((bullet) => (
- {
- storeTextSettings.resetBullets(bullet.type);
- props.onBullet(bullet.type);
- }}>
- {bullet.thumb.length < 1 ?
-
-
- :
-
- }
-
- ))}
-
- ))}
+
+ {bulletArrays.map( bullet => (
+ {
+ storeTextSettings.resetBullets(bullet.subtype);
+ props.onBullet(bullet.subtype);
+ }}>
+
+
+
+
+ ))}
+
)
});
const PageNumbers = observer( props => {
- const { t } = useTranslation();
- const numberArrays = [
- [
- {type: -1, thumb: ''},
- {type: 4, thumb: 'number-01.png'},
- {type: 5, thumb: 'number-02.png'},
- {type: 6, thumb: 'number-03.png'}
- ],
- [
- {type: 1, thumb: 'number-04.png'},
- {type: 2, thumb: 'number-05.png'},
- {type: 3, thumb: 'number-06.png'},
- {type: 7, thumb: 'number-07.png'}
- ]
- ];
-
const storeTextSettings = props.storeTextSettings;
const typeNumbers = storeTextSettings.typeNumbers;
+ const numberArrays = [
+ { type: 1, subtype: -1},
+ { type: 1, subtype: 4 },
+ { type: 1, subtype: 5 },
+ { type: 1, subtype: 6 },
+ { type: 1, subtype: 1 },
+ { type: 1, subtype: 2 },
+ { type: 1, subtype: 3 },
+ { type: 1, subtype: 7 }
+ ];
+
+ useEffect(() => {
+ props.getIconsBulletsAndNumbers($$('.item-number'), 1);
+ }, []);
- return(
+ return (
{numberArrays.map((numbers, index) => (
@@ -266,37 +258,35 @@ const PageNumbers = observer( props => {
))}
- )
+ );
});
const PageMultiLevel = observer( props => {
- const { t } = useTranslation();
-
- const arrayMultiLevel = [
- {type: -1, thumb: ''},
- {type: 1, thumb: 'multi-bracket.png'},
- {type: 2, thumb: 'multi-dot.png'},
- {type: 3, thumb: 'multi-bullets.png'},
- ];
-
const storeTextSettings = props.storeTextSettings;
const typeMultiLevel = storeTextSettings.typeMultiLevel;
+ const arrayMultiLevel = [
+ { type: 2, subtype: -1 },
+ { type: 2, subtype: 1 },
+ { type: 2, subtype: 2 },
+ { type: 2, subtype: 3 },
+ ];
+
+ useEffect(() => {
+ props.getIconsBulletsAndNumbers($$('.item-multilevellist'), 2);
+ }, []);
return(
{arrayMultiLevel.map((item) => (
props.onMultiLevelList(item.type)}>
- {item.thumb.length < 1 ?
-
-
- :
-
- }
+ key={'multi-level-' + item.subtype}
+ data-type={item.subtype}
+ className={item.subtype === typeMultiLevel && storeTextSettings.listType === -1 ? 'active' : ''}
+ onClick={() => props.onMultiLevelList(item.subtype)}>
+
+
+
))}
@@ -322,13 +312,25 @@ const PageBulletsAndNumbers = props => {
-
+
-
+
-
+
@@ -604,7 +606,8 @@ const EditText = props => {
{previewList}
{!isAndroid && }
diff --git a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx
index 28fadca2e..03ecb2f8b 100644
--- a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx
+++ b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx
@@ -94,7 +94,7 @@ const PageApplicationSettings = props => {
{Themes.switchDarkTheme(!toggle), setIsThemeDark(!toggle)}}>
+ onToggleChange={() => {Themes.switchDarkTheme(!isThemeDark), setIsThemeDark(!isThemeDark)}}>
diff --git a/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx
index d45a1bf04..b414c41cd 100644
--- a/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx
+++ b/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx
@@ -28,6 +28,7 @@ const PageDocumentInfo = (props) => {
modifyBy,
modifyDate,
author,
+ producer,
version,
tagged,
fastWebView,
@@ -145,9 +146,24 @@ const PageDocumentInfo = (props) => {
) : null}
+ {fileType === 'pdf' && author ? (
+
+ {t('Settings.textAuthor')}
+
+
+
+
+ ) : null}
+ { fileType === 'pdf' && producer ? (
+
+ {t('Settings.textPdfProducer')}
+
+
+
+
+ ) : null}
{ fileType === 'pdf' ? (
-
diff --git a/apps/presentationeditor/main/app.js b/apps/presentationeditor/main/app.js
index 1e11ca2c5..c8f5f8a77 100644
--- a/apps/presentationeditor/main/app.js
+++ b/apps/presentationeditor/main/app.js
@@ -171,6 +171,9 @@ require([
Common.Locale.apply(function(){
require([
+ 'common/main/lib/util/LocalStorage',
+ 'common/main/lib/controller/Themes',
+ 'common/main/lib/controller/Desktop',
'presentationeditor/main/app/controller/Viewport',
'presentationeditor/main/app/controller/DocumentHolder',
'presentationeditor/main/app/controller/Toolbar',
@@ -188,7 +191,6 @@ require([
'presentationeditor/main/app/view/TextArtSettings',
'presentationeditor/main/app/view/SignatureSettings',
'common/main/lib/util/utils',
- 'common/main/lib/util/LocalStorage',
'common/main/lib/controller/Fonts',
'common/main/lib/controller/History'
/** coauthoring begin **/
@@ -201,8 +203,6 @@ require([
,'common/main/lib/controller/ExternalOleEditor'
,'common/main/lib/controller/ReviewChanges'
,'common/main/lib/controller/Protection'
- ,'common/main/lib/controller/Themes'
- ,'common/main/lib/controller/Desktop'
,'presentationeditor/main/app/controller/Transitions'
,'presentationeditor/main/app/controller/Animation'
], function() {
diff --git a/apps/presentationeditor/main/app/controller/Animation.js b/apps/presentationeditor/main/app/controller/Animation.js
index 9e94feb01..eda06eca8 100644
--- a/apps/presentationeditor/main/app/controller/Animation.js
+++ b/apps/presentationeditor/main/app/controller/Animation.js
@@ -174,7 +174,7 @@ define([
handler : function(result, value) {
if (result == 'ok') {
if (me.api) {
- me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined, !Common.Utils.InternalSettings.get("pe-animation-no-preview"));
+ me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined);
}
}
}
@@ -189,7 +189,7 @@ define([
addNewEffect: function (type, group, groupName, replace, parametr, preview) {
var parameter = this.view.setMenuParameters(type, groupName, parametr);
- this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, preview);
+ this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview"));
},
onDurationChange: function(before,combo, record, e) {
diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js
index f6be16df6..7956f8647 100644
--- a/apps/presentationeditor/main/app/controller/DocumentHolder.js
+++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js
@@ -90,21 +90,221 @@ define([
],
initialize: function() {
- //
+ this.addListeners({
+ 'DocumentHolder': {
+ 'createdelayedelements': this.createDelayedElements,
+ 'equation:callback': this.equationCallback,
+ 'layout:change': this.onLayoutChange,
+ 'theme:change': this.onThemeChange
+ }
+ });
+
+ var me = this;
+ me.usertips = [];
+ me._TtHeight = 20;
+ me.fastcoauthtips = [];
+ me._state = {};
+ me.mode = {};
+ me._isDisabled = false;
+
+ me.screenTip = {
+ toolTip: new Common.UI.Tooltip({
+ owner: this,
+ html: true,
+ title: '
Press Ctrl and click link'
+// style: 'word-wrap: break-word;'
+ }),
+ strTip: '',
+ isHidden: true,
+ isVisible: false
+ };
+
+ me.userTooltip = true;
+ me.wrapEvents = {
+ userTipMousover: _.bind(me.userTipMousover, me),
+ userTipMousout: _.bind(me.userTipMousout, me)
+ };
+
+ // Hotkeys
+ // ---------------------
+ var keymap = {};
+ me.hkComments = 'alt+h';
+ keymap[me.hkComments] = function() {
+ if (me.api.can_AddQuotedComment()!==false && me.documentHolder.slidesCount>0) {
+ me.addComment();
+ }
+ };
+
+ me.hkPreview = 'command+f5,ctrl+f5';
+ keymap[me.hkPreview] = function(e) {
+ var isResized = false;
+ e.preventDefault();
+ e.stopPropagation();
+ if (me.documentHolder.slidesCount>0) {
+ Common.NotificationCenter.trigger('preview:start', 0);
+ }
+ };
+ Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap});
},
onLaunch: function() {
this.documentHolder = this.createView('DocumentHolder').render();
this.documentHolder.el.tabIndex = -1;
+ this.onAfterRender();
+
+ var me = this;
+ Common.NotificationCenter.on({
+ 'window:show': function(e){
+ me.screenTip.toolTip.hide();
+ me.screenTip.isVisible = false;
+ /** coauthoring begin **/
+ me.userTipHide();
+ /** coauthoring end **/
+ me.mode && me.mode.isDesktopApp && me.api && me.api.asc_onShowPopupWindow();
+ },
+ 'modal:show': function(e){
+ me.hideTips();
+ },
+ 'layout:changed': function(e){
+ me.screenTip.toolTip.hide();
+ me.screenTip.isVisible = false;
+ /** coauthoring begin **/
+ me.userTipHide();
+ /** coauthoring end **/
+ me.hideTips();
+ me.onDocumentHolderResize();
+ },
+ 'preview:show': function(e){
+ me.isPreviewVisible = true;
+ me.screenTip && (me.screenTip.tipLength = -1); // redraw link tip
+ },
+ 'preview:hide': function(e){
+ me.isPreviewVisible = false;
+ me.screenTip && (me.screenTip.tipLength = -1); // redraw link tip
+ }
+ });
},
setApi: function(api) {
this.api = api;
+
+ var me = this;
+ if (me.api) {
+ me.api.asc_registerCallback('asc_onContextMenu', _.bind(me.onContextMenu, me));
+ me.api.asc_registerCallback('asc_onMouseMoveStart', _.bind(me.onMouseMoveStart, me));
+ me.api.asc_registerCallback('asc_onMouseMoveEnd', _.bind(me.onMouseMoveEnd, me));
+ me.api.asc_registerCallback('asc_onPaintSlideNum', _.bind(me.onPaintSlideNum, me));
+ me.api.asc_registerCallback('asc_onEndPaintSlideNum', _.bind(me.onEndPaintSlideNum, me));
+ me.api.asc_registerCallback('asc_onCountPages', _.bind(me.onApiCountPages, me));
+ me.api.asc_registerCallback('asc_onCurrentPage', _.bind(me.onApiCurrentPages, me));
+ me.documentHolder.slidesCount = me.api.getCountPages();
+
+ //hyperlink
+ me.api.asc_registerCallback('asc_onHyperlinkClick', _.bind(me.onHyperlinkClick, me));
+ me.api.asc_registerCallback('asc_onMouseMove', _.bind(me.onMouseMove, me));
+
+ if (me.mode.isEdit===true) {
+ me.api.asc_registerCallback('asc_onDialogAddHyperlink', _.bind(me.onDialogAddHyperlink, me));
+ me.api.asc_registerCallback('asc_doubleClickOnChart', _.bind(me.editChartClick, me));
+ me.api.asc_registerCallback('asc_doubleClickOnTableOleObject', _.bind(me.onDoubleClickOnTableOleObject, me));
+ me.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(me.onSpellCheckVariantsFound, me));
+ me.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(me.onShowSpecialPasteOptions, me));
+ me.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(me.onHideSpecialPasteOptions, me));
+ me.api.asc_registerCallback('asc_ChangeCropState', _.bind(me.onChangeCropState, me));
+ me.api.asc_registerCallback('asc_onHidePlaceholderActions', _.bind(me.onHidePlaceholderActions, me));
+ me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Image, _.bind(me.onInsertImage, me, true));
+ me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.ImageUrl, _.bind(me.onInsertImageUrl, me, true));
+ me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Chart, _.bind(me.onClickPlaceholderChart, me));
+ me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Table, _.bind(me.onClickPlaceholderTable, me));
+ me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Video, _.bind(me.onClickPlaceholder, me, AscCommon.PlaceholderButtonType.Video));
+ me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Audio, _.bind(me.onClickPlaceholder, me, AscCommon.PlaceholderButtonType.Audio));
+ }
+ me.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(me.onCoAuthoringDisconnect, me));
+ Common.NotificationCenter.on('api:disconnect', _.bind(me.onCoAuthoringDisconnect, me));
+ me.api.asc_registerCallback('asc_onTextLanguage', _.bind(me.onTextLanguage, me));
+
+ me.api.asc_registerCallback('asc_onShowForeignCursorLabel', _.bind(me.onShowForeignCursorLabel, me));
+ me.api.asc_registerCallback('asc_onHideForeignCursorLabel', _.bind(me.onHideForeignCursorLabel, me));
+ me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onFocusObject, me));
+ me.api.asc_registerCallback('asc_onUpdateThemeIndex', _.bind(me.onApiUpdateThemeIndex, me));
+ me.api.asc_registerCallback('asc_onLockDocumentTheme', _.bind(me.onApiLockDocumentTheme, me));
+ me.api.asc_registerCallback('asc_onUnLockDocumentTheme', _.bind(me.onApiUnLockDocumentTheme, me));
+ me.api.asc_registerCallback('asc_onStartDemonstration', _.bind(me.onApiStartDemonstration));
+
+ me.documentHolder.setApi(me.api);
+ }
+
+ return me;
},
- createDelayedElements: function() {
- var diagramEditor = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor');
+ setMode: function(mode) {
+ var me = this;
+ me.mode = mode;
+ /** coauthoring begin **/
+ !(me.mode.canCoAuthoring && me.mode.canComments)
+ ? Common.util.Shortcuts.suspendEvents(me.hkComments)
+ : Common.util.Shortcuts.resumeEvents(me.hkComments);
+ /** coauthoring end **/
+ me.editorConfig = {user: mode.user};
+ me.documentHolder.setMode(mode);
+ },
+
+ onAfterRender: function(ct){
+ var me = this;
+ var meEl = me.documentHolder.cmpEl;
+ if (meEl) {
+ meEl.on('contextmenu', function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ return false;
+ });
+ meEl.on('click', function(e){
+ if (e.target.localName == 'canvas') {
+ if (me._preventClick)
+ me._preventClick = false;
+ else
+ meEl.focus();
+ }
+ });
+ meEl.on('mousedown', function(e){
+ if (e.target.localName == 'canvas')
+ Common.UI.Menu.Manager.hideAll();
+ });
+
+ //NOTE: set mouse wheel handler
+
+ var addEvent = function( elem, type, fn ) {
+ elem.addEventListener ? elem.addEventListener( type, fn, false ) : elem.attachEvent( "on" + type, fn );
+ };
+
+ var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel';
+ addEvent(me.documentHolder.el, eventname, _.bind(me.handleDocumentWheel, me));
+ }
+
+ !Common.Utils.isChrome ? $(document).on('mousewheel', _.bind(me.handleDocumentWheel, me)) :
+ document.addEventListener('mousewheel', _.bind(me.handleDocumentWheel, me), {passive: false});
+ $(document).on('keydown', _.bind(me.handleDocumentKeyDown, me));
+ $(window).on('resize', _.bind(me.onDocumentHolderResize, me));
+ var viewport = me.getApplication().getController('Viewport').getView('Viewport');
+ viewport.hlayout.on('layout:resizedrag', _.bind(me.onDocumentHolderResize, me));
+ },
+
+ createDelayedElements: function(view, type) {
+ var me = this,
+ view = me.documentHolder;
+
+ if (type=='view') {
+ view.menuViewCopy.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuViewAddComment.on('click', _.bind(me.addComment, me));
+ view.menuViewUndo.on('click', _.bind(me.onUndo, me));
+ view.mnuPreview.on('click', _.bind(me.onPreview, me));
+ view.mnuSelectAll.on('click', _.bind(me.onSelectAll, me));
+ view.mnuPrintSelection.on('click', _.bind(me.onPrintSelection, me));
+ return;
+ }
+
+ var diagramEditor = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor');
if (diagramEditor) {
diagramEditor.on('internalmessage', _.bind(function(cmp, message) {
var command = message.data.command;
@@ -122,7 +322,7 @@ define([
}
var me = this;
setTimeout(function(){
- me.documentHolder.fireEvent('editcomplete', me.documentHolder);
+ me.editComplete();
}, 10);
}, this));
}
@@ -143,10 +343,1688 @@ define([
}
var me = this;
setTimeout(function(){
- me.documentHolder.fireEvent('editcomplete', me.documentHolder);
+ me.editComplete();
}, 10);
}, this));
}
+
+ view.menuSlidePaste.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuParaCopy.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuParaPaste.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuParaCut.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuImgCopy.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuImgPaste.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuImgCut.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuTableCopy.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuTablePaste.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuTableCut.on('click', _.bind(me.onCutCopyPaste, me));
+ view.menuAddHyperlinkPara.on('click', _.bind(me.addHyperlink, me));
+ view.menuAddHyperlinkTable.on('click', _.bind(me.addHyperlink, me));
+ view.menuEditHyperlinkPara.on('click', _.bind(me.editHyperlink, me));
+ view.menuEditHyperlinkTable.on('click', _.bind(me.editHyperlink, me));
+ view.menuRemoveHyperlinkPara.on('click', _.bind(me.removeHyperlink, me));
+ view.menuRemoveHyperlinkTable.on('click', _.bind(me.removeHyperlink, me));
+ view.menuChartEdit.on('click', _.bind(me.editChartClick, me, undefined));
+ view.menuAddCommentPara.on('click', _.bind(me.addComment, me));
+ view.menuAddCommentTable.on('click', _.bind(me.addComment, me));
+ view.menuAddCommentImg.on('click', _.bind(me.addComment, me));
+ view.menuAddToLayoutImg.on('click', _.bind(me.addToLayout, me));
+ view.menuAddToLayoutTable.on('click', _.bind(me.addToLayout, me));
+ view.menuImgReplace.menu.on('item:click', _.bind(me.onImgReplace, me));
+ view.langParaMenu.menu.on('item:click', _.bind(me.onLangMenu, me, 'para'));
+ view.langTableMenu.menu.on('item:click', _.bind(me.onLangMenu, me, 'table'));
+ view.mnuPreview.on('click', _.bind(me.onPreview, me));
+ view.mnuSelectAll.on('click', _.bind(me.onSelectAll, me));
+ view.mnuPrintSelection.on('click', _.bind(me.onPrintSelection, me));
+ view.mnuNewSlide.on('click', _.bind(me.onNewSlide, me));
+ view.mnuDuplicateSlide.on('click', _.bind(me.onDuplicateSlide, me));
+ view.mnuDeleteSlide.on('click', _.bind(me.onDeleteSlide, me));
+ view.mnuResetSlide.on('click', _.bind(me.onResetSlide, me));
+ view.mnuMoveSlideToStart.on('click', _.bind(me.onMoveSlideToStart, me));
+ view.mnuMoveSlideToEnd.on('click', _.bind(me.onMoveSlideToEnd, me));
+ view.menuSlideSettings.on('click', _.bind(me.onSlideSettings, me));
+ view.mnuSlideHide.on('click', _.bind(me.onSlideHide, me));
+ view.mnuTableMerge.on('click', _.bind(me.onTableMerge, me));
+ view.mnuTableSplit.on('click', _.bind(me.onTableSplit, me));
+ view.menuTableCellAlign.menu.on('item:click', _.bind(me.tableCellsVAlign, me));
+ view.menuTableDistRows.on('click', _.bind(me.onTableDistRows, me));
+ view.menuTableDistCols.on('click', _.bind(me.onTableDistCols, me));
+ view.menuIgnoreSpellTable.on('click', _.bind(me.onIgnoreSpell, me));
+ view.menuIgnoreSpellPara.on('click', _.bind(me.onIgnoreSpell, me));
+ view.menuIgnoreAllSpellTable.on('click', _.bind(me.onIgnoreSpell, me));
+ view.menuIgnoreAllSpellPara.on('click', _.bind(me.onIgnoreSpell, me));
+ view.menuToDictionaryTable.on('click', _.bind(me.onToDictionary, me));
+ view.menuToDictionaryPara.on('click', _.bind(me.onToDictionary, me));
+ view.menuTableAdvanced.on('click', _.bind(me.onTableAdvanced, me));
+ view.menuImageAdvanced.on('click', _.bind(me.onImageAdvanced, me));
+ view.menuImgOriginalSize.on('click', _.bind(me.onImgOriginalSize, me));
+ view.menuImgShapeRotate.menu.items[0].on('click', _.bind(me.onImgRotate, me));
+ view.menuImgShapeRotate.menu.items[1].on('click', _.bind(me.onImgRotate, me));
+ view.menuImgShapeRotate.menu.items[3].on('click', _.bind(me.onImgFlip, me));
+ view.menuImgShapeRotate.menu.items[4].on('click', _.bind(me.onImgFlip, me));
+ view.menuImgCrop.menu.on('item:click', _.bind(me.onImgCrop, me));
+ view.menuImgEditPoints.on('click', _.bind(me.onImgEditPoints, me));
+ view.menuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me));
+ view.menuParagraphAdvanced.on('click', _.bind(me.onParagraphAdvanced, me));
+ view.mnuGroupImg.on('click', _.bind(me.onGroupImg, me));
+ view.mnuUnGroupImg.on('click', _.bind(me.onUnGroupImg, me));
+ view.mnuArrangeFront.on('click', _.bind(me.onArrangeFront, me));
+ view.mnuArrangeBack.on('click', _.bind(me.onArrangeBack, me));
+ view.mnuArrangeForward.on('click', _.bind(me.onArrangeForward, me));
+ view.mnuArrangeBackward.on('click', _.bind(me.onArrangeBackward, me));
+ view.menuImgShapeAlign.menu.on('item:click', _.bind(me.onImgShapeAlign, me));
+ view.menuParagraphVAlign.menu.on('item:click', _.bind(me.onParagraphVAlign, me));
+ view.menuParagraphDirection.menu.on('item:click', _.bind(me.onParagraphDirection, me));
+ view.menuTableSelectText.menu.on('item:click', _.bind(me.tableSelectText, me));
+ view.menuTableInsertText.menu.on('item:click', _.bind(me.tableInsertText, me));
+ view.menuTableDeleteText.menu.on('item:click', _.bind(me.tableDeleteText, me));
+ },
+
+ getView: function (name) {
+ return !name ?
+ this.documentHolder : Backbone.Controller.prototype.getView.call()
+ },
+
+ showPopupMenu: function(menu, value, event, docElement, eOpts){
+ var me = this;
+ if (!_.isUndefined(menu) && menu !== null){
+ Common.UI.Menu.Manager.hideAll();
+
+ var showPoint = [event.get_X(), event.get_Y()],
+ menuContainer = $(me.documentHolder.el).find(Common.Utils.String.format('#menu-container-{0}', menu.id));
+
+ if (event.get_Type() == Asc.c_oAscContextMenuTypes.Thumbnails) {
+ showPoint[0] -= 3;
+ showPoint[1] -= 3;
+ }
+
+ if (!menu.rendered) {
+ // Prepare menu container
+ if (menuContainer.length < 1) {
+ menuContainer = $(Common.Utils.String.format('', menu.id));
+ $(me.documentHolder.el).append(menuContainer);
+ }
+
+ menu.render(menuContainer);
+ menu.cmpEl.attr({tabindex: "-1"});
+ }
+
+ menuContainer.css({
+ left: showPoint[0],
+ top : showPoint[1]
+ });
+
+ menu.show();
+
+ if (_.isFunction(menu.options.initMenu)) {
+ menu.options.initMenu(value);
+ menu.alignPosition();
+ }
+ _.delay(function() {
+ menu.cmpEl.focus();
+ }, 10);
+
+ me.documentHolder.currentMenu = menu;
+ }
+ },
+
+ fillMenuProps: function(selectedElements) {
+ if (!selectedElements || !_.isArray(selectedElements)) return;
+ var me = this,
+ documentHolder = this.documentHolder;
+ var menu_props = {},
+ menu_to_show = null;
+ _.each(selectedElements, function(element, index) {
+ var elType = element.get_ObjectType(),
+ elValue = element.get_ObjectValue();
+
+ if (Asc.c_oAscTypeSelectElement.Image == elType) {
+ menu_to_show = documentHolder.pictureMenu;
+ menu_props.imgProps = {};
+ menu_props.imgProps.value = elValue;
+ menu_props.imgProps.locked = (elValue) ? elValue.get_Locked() : false;
+ } else if (Asc.c_oAscTypeSelectElement.Table == elType)
+ {
+ menu_to_show = documentHolder.tableMenu;
+ menu_props.tableProps = {};
+ menu_props.tableProps.value = elValue;
+ menu_props.tableProps.locked = (elValue) ? elValue.get_Locked() : false;
+ } else if (Asc.c_oAscTypeSelectElement.Hyperlink == elType) {
+ menu_props.hyperProps = {};
+ menu_props.hyperProps.value = elValue;
+ } else if (Asc.c_oAscTypeSelectElement.Shape == elType) { // shape
+ menu_to_show = documentHolder.pictureMenu;
+ menu_props.shapeProps = {};
+ menu_props.shapeProps.value = elValue;
+ menu_props.shapeProps.locked = (elValue) ? elValue.get_Locked() : false;
+ if (elValue.get_FromChart())
+ menu_props.shapeProps.isChart = true;
+ }
+ else if (Asc.c_oAscTypeSelectElement.Chart == elType) {
+ menu_to_show = documentHolder.pictureMenu;
+ menu_props.chartProps = {};
+ menu_props.chartProps.value = elValue;
+ menu_props.chartProps.locked = (elValue) ? elValue.get_Locked() : false;
+ }
+ else if (Asc.c_oAscTypeSelectElement.Slide == elType) {
+ menu_props.slideProps = {};
+ menu_props.slideProps.value = elValue;
+ menu_props.slideProps.locked = (elValue) ? elValue.get_LockDelete() : false;
+ } else if (Asc.c_oAscTypeSelectElement.Paragraph == elType) {
+ menu_props.paraProps = {};
+ menu_props.paraProps.value = elValue;
+ menu_props.paraProps.locked = (elValue) ? elValue.get_Locked() : false;
+ if ( (menu_props.shapeProps && menu_props.shapeProps.value || menu_props.chartProps && menu_props.chartProps.value)&& // text in shape, need to show paragraph menu with vertical align
+ _.isUndefined(menu_props.tableProps))
+ menu_to_show = documentHolder.textMenu;
+ } else if (Asc.c_oAscTypeSelectElement.SpellCheck == elType) {
+ menu_props.spellProps = {};
+ menu_props.spellProps.value = elValue;
+ documentHolder._currentSpellObj = elValue;
+ } else if (Asc.c_oAscTypeSelectElement.Math == elType) {
+ menu_props.mathProps = {};
+ menu_props.mathProps.value = elValue;
+ documentHolder._currentMathObj = elValue;
+ }
+ });
+ if (menu_to_show === null) {
+ if (!_.isUndefined(menu_props.paraProps))
+ menu_to_show = documentHolder.textMenu;
+ else if (!_.isUndefined(menu_props.slideProps)) {
+ menu_to_show = documentHolder.slideMenu;
+ }
+ }
+
+ return {menu_to_show: menu_to_show, menu_props: menu_props};
+ },
+
+ fillViewMenuProps: function(selectedElements) {
+ if (!selectedElements || !_.isArray(selectedElements)) return;
+
+ var me = this,
+ documentHolder = this.documentHolder;
+ if (!documentHolder.viewModeMenu)
+ documentHolder.createDelayedElementsViewer();
+
+ var menu_props = {},
+ menu_to_show = null;
+ _.each(selectedElements, function(element, index) {
+ var elType = element.get_ObjectType(),
+ elValue = element.get_ObjectValue();
+
+ if (Asc.c_oAscTypeSelectElement.Image == elType || Asc.c_oAscTypeSelectElement.Table == elType || Asc.c_oAscTypeSelectElement.Shape == elType ||
+ Asc.c_oAscTypeSelectElement.Chart == elType || Asc.c_oAscTypeSelectElement.Paragraph == elType) {
+ menu_to_show = documentHolder.viewModeMenu;
+ menu_props.locked = menu_props.locked || ((elValue) ? elValue.get_Locked() : false);
+ if (Asc.c_oAscTypeSelectElement.Chart == elType)
+ menu_props.isChart = true;
+ }
+ else if (Asc.c_oAscTypeSelectElement.Slide == elType) {
+ menu_props.locked = menu_props.locked || ((elValue) ? elValue.get_LockDelete() : false);
+ }
+ });
+
+ return (menu_to_show) ? {menu_to_show: menu_to_show, menu_props: menu_props} : null;
+ },
+
+ showObjectMenu: function(event, docElement, eOpts){
+ var me = this;
+ if (me.api){
+ var obj = (me.mode.isEdit && !me._isDisabled) ? me.fillMenuProps(me.api.getSelectedElements()) : me.fillViewMenuProps(me.api.getSelectedElements());
+ if (obj) me.showPopupMenu(obj.menu_to_show, obj.menu_props, event, docElement, eOpts);
+ }
+ },
+
+ onContextMenu: function(event){
+ if (Common.UI.HintManager.isHintVisible())
+ Common.UI.HintManager.clearHints();
+ var me = this;
+ _.delay(function(){
+ if (event.get_Type() == Asc.c_oAscContextMenuTypes.Thumbnails) {
+ me.showPopupMenu.call(me, (me.mode.isEdit && !me._isDisabled) ? me.documentHolder.slideMenu : me.documentHolder.viewModeMenuSlide, {isSlideSelect: event.get_IsSlideSelect(), isSlideHidden: event.get_IsSlideHidden(), fromThumbs: true}, event);
+ } else {
+ me.showObjectMenu.call(me, event);
+ }
+ },10);
+ },
+
+ onFocusObject: function(selectedElements) {
+ var me = this,
+ currentMenu = me.documentHolder.currentMenu;
+ if (currentMenu && currentMenu.isVisible()){
+ if (me.api.asc_getCurrentFocusObject() === 0 ){ // thumbnails
+ if (me.documentHolder.slideMenu===currentMenu && !me._isDisabled) {
+ var isHidden = false;
+ _.each(selectedElements, function(element, index) {
+ if (Asc.c_oAscTypeSelectElement.Slide == element.get_ObjectType()) {
+ isHidden = element.get_ObjectValue().get_IsHidden();
+ }
+ });
+
+ currentMenu.options.initMenu({isSlideSelect: me.documentHolder.slideMenu.items[2].isVisible(), isSlideHidden: isHidden, fromThumbs: true});
+ currentMenu.alignPosition();
+ }
+ } else {
+ var obj = (me.mode.isEdit && !me._isDisabled) ? me.fillMenuProps(selectedElements) : me.fillViewMenuProps(selectedElements);
+ if (obj) {
+ if (obj.menu_to_show===currentMenu) {
+ currentMenu.options.initMenu(obj.menu_props);
+ currentMenu.alignPosition();
+ }
+ }
+ }
+ }
+ },
+
+ handleDocumentWheel: function(event){
+ var me = this;
+ if (me.api) {
+ var delta = (_.isUndefined(event.originalEvent)) ? event.wheelDelta : event.originalEvent.wheelDelta;
+ if (_.isUndefined(delta)) {
+ delta = event.deltaY;
+ }
+
+ if ((event.ctrlKey || event.metaKey) && !event.altKey){
+ if (delta < 0)
+ me.api.zoomOut();
+ else if (delta > 0)
+ me.api.zoomIn();
+
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ },
+
+ handleDocumentKeyDown: function(event){
+ var me = this;
+ if (me.api){
+ var key = event.keyCode;
+ if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){
+ if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isGecko && key === Common.UI.Keys.EQUALITY_FF) || (Common.Utils.isOpera && key == 43)){
+ me.api.zoomIn();
+ event.preventDefault();
+ event.stopPropagation();
+ return false;
+ }
+ else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isGecko && key === Common.UI.Keys.MINUS_FF) || (Common.Utils.isOpera && key == 45)){
+ me.api.zoomOut();
+ event.preventDefault();
+ event.stopPropagation();
+ return false;
+ } else if (key === 48 || key === 96) {// 0
+ me.api.zoomFitToPage();
+ event.preventDefault();
+ event.stopPropagation();
+ return false;
+ }
+ }
+ if (me.documentHolder.currentMenu && me.documentHolder.currentMenu.isVisible()) {
+ if (key == Common.UI.Keys.UP ||
+ key == Common.UI.Keys.DOWN) {
+ $('ul.dropdown-menu', me.documentHolder.currentMenu.el).focus();
+ }
+ }
+ if (key == Common.UI.Keys.ESC) {
+ Common.UI.Menu.Manager.hideAll();
+ if (!Common.UI.HintManager.isHintVisible())
+ Common.NotificationCenter.trigger('leftmenu:change', 'hide');
+ }
+ }
+ },
+
+ onDocumentHolderResize: function(){
+ var me = this;
+ me._Height = me.documentHolder.cmpEl.height();
+ me._Width = me.documentHolder.cmpEl.width();
+ me._BodyWidth = $('body').width();
+ me._XY = undefined;
+
+ if (me.slideNumDiv) {
+ me.slideNumDiv.remove();
+ me.slideNumDiv = undefined;
+ }
+ },
+
+ getUserName: function(id){
+ var usersStore = PE.getCollection('Common.Collections.Users');
+ if (usersStore){
+ var rec = usersStore.findUser(id);
+ if (rec)
+ return AscCommon.UserInfoParser.getParsedName(rec.get('username'));
+ }
+ return this.documentHolder.guestText;
+ },
+
+ isUserVisible: function(id){
+ var usersStore = PE.getCollection('Common.Collections.Users');
+ if (usersStore){
+ var rec = usersStore.findUser(id);
+ if (rec)
+ return !rec.get('hidden');
+ }
+ return true;
+ },
+
+ userTipMousover: function (evt, el, opt) {
+ var me = this;
+ if (me.userTooltip===true) {
+ me.userTooltip = new Common.UI.Tooltip({
+ owner: evt.currentTarget,
+ title: me.documentHolder.tipIsLocked
+ });
+
+ me.userTooltip.show();
+ }
+ },
+
+ userTipHide: function () {
+ var me = this;
+ if (typeof me.userTooltip == 'object') {
+ me.userTooltip.hide();
+ me.userTooltip = undefined;
+
+ for (var i=0; i0)
+ window.open(url);
+ else
+ Common.UI.warning({
+ msg: me.documentHolder.txtWarnUrl,
+ buttons: ['yes', 'no'],
+ primary: 'yes',
+ callback: function(btn) {
+ (btn == 'yes') && window.open(url);
+ }
+ });
+ }
+ },
+
+ onMouseMoveStart: function() {
+ var me = this;
+ me.screenTip.isHidden = true;
+ /** coauthoring begin **/
+ if (me.usertips.length>0) {
+ if (typeof me.userTooltip == 'object') {
+ me.userTooltip.hide();
+ me.userTooltip = true;
+ }
+ _.each(me.usertips, function(item) {
+ item.remove();
+ });
+ }
+ me.usertips = [];
+ me.usertipcount = 0;
+ /** coauthoring end **/
+ },
+
+ onMouseMoveEnd: function() {
+ if (this.screenTip.isHidden && this.screenTip.isVisible) {
+ this.screenTip.isVisible = false;
+ this.screenTip.toolTip.hide();
+ }
+ },
+
+ onMouseMove: function(moveData) {
+ var me = this,
+ cmpEl = me.documentHolder.cmpEl,
+ screenTip = me.screenTip;
+ if (_.isUndefined(me._XY)) {
+ me._XY = [
+ cmpEl.offset().left - $(window).scrollLeft(),
+ cmpEl.offset().top - $(window).scrollTop()
+ ];
+ me._Width = cmpEl.width();
+ me._Height = cmpEl.height();
+ me._BodyWidth = $('body').width();
+ }
+
+ if (moveData) {
+ var showPoint, ToolTip;
+
+ if (moveData.get_Type()==1) { // 1 - hyperlink
+ var hyperProps = moveData.get_Hyperlink();
+ var recalc = false;
+ if (hyperProps) {
+ screenTip.isHidden = false;
+
+ ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip();
+ ToolTip = Common.Utils.String.htmlEncode(ToolTip);
+ if (ToolTip.length>256)
+ ToolTip = ToolTip.substr(0, 256) + '...';
+
+ if (screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) {
+ screenTip.toolTip.setTitle(ToolTip + (me.isPreviewVisible ? '' : '
' + me.documentHolder.txtPressLink + ''));
+ screenTip.tipLength = ToolTip.length;
+ screenTip.strTip = ToolTip;
+ recalc = true;
+ }
+
+ showPoint = [moveData.get_X(), moveData.get_Y()];
+ showPoint[1] += ((me.isPreviewVisible ? 0 : me._XY[1])-15);
+ showPoint[0] += ((me.isPreviewVisible ? 0 : me._XY[0])+5);
+
+ if (!screenTip.isVisible || recalc) {
+ screenTip.isVisible = true;
+ screenTip.toolTip.show([-10000, -10000]);
+ }
+
+ if ( recalc ) {
+ screenTip.tipHeight = screenTip.toolTip.getBSTip().$tip.height();
+ screenTip.tipWidth = screenTip.toolTip.getBSTip().$tip.width();
+ }
+ showPoint[1] -= screenTip.tipHeight;
+ if (showPoint[1]<0)
+ showPoint[1] = 0;
+ if (showPoint[0] + screenTip.tipWidth > me._BodyWidth )
+ showPoint[0] = me._BodyWidth - screenTip.tipWidth;
+ screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'});
+ }
+ }
+ /** coauthoring begin **/
+ else if (moveData.get_Type()==2 && me.mode.isEdit && me.isUserVisible(moveData.get_UserId())) { // 2 - locked object
+ var src;
+ if (me.usertipcount >= me.usertips.length) {
+ src = $(document.createElement("div"));
+ src.addClass('username-tip');
+ src.css({height: me._TtHeight + 'px', position: 'absolute', zIndex: '900', visibility: 'visible'});
+ $(document.body).append(src);
+ if (me.userTooltip) {
+ src.on('mouseover', me.wrapEvents.userTipMousover);
+ src.on('mouseout', me.wrapEvents.userTipMousout);
+ }
+
+ me.usertips.push(src);
+ }
+ src = me.usertips[me.usertipcount];
+ me.usertipcount++;
+
+ ToolTip = me.getUserName(moveData.get_UserId());
+
+ showPoint = [moveData.get_X()+me._XY[0], moveData.get_Y()+me._XY[1]];
+ var maxwidth = showPoint[0];
+ showPoint[0] = me._BodyWidth - showPoint[0];
+ showPoint[1] -= ((moveData.get_LockedObjectType()==2) ? me._TtHeight : 0);
+
+ if (showPoint[1] > me._XY[1] && showPoint[1]+me._TtHeight < me._XY[1]+me._Height) {
+ src.text(ToolTip);
+ src.css({visibility: 'visible', top: showPoint[1] + 'px', right: showPoint[0] + 'px', 'max-width': maxwidth + 'px'});
+ }
+ }
+ /** coauthoring end **/
+ }
+ },
+
+ onShowForeignCursorLabel: function(UserId, X, Y, color) {
+ if (!this.isUserVisible(UserId)) return;
+
+ /** coauthoring begin **/
+ var me = this;
+ var src;
+ for (var i=0; i0) {
+ Common.NotificationCenter.trigger('preview:start', 0, null, true);
+ }
+ },
+
+ onApiCountPages: function(count) {
+ this.documentHolder.slidesCount = count;
+ },
+
+ onApiCurrentPages: function(number) {
+ var me = this;
+ if (me.documentHolder.currentMenu && me.documentHolder.currentMenu.isVisible() && me._isFromSlideMenu !== true && me._isFromSlideMenu !== number)
+ setTimeout(function() {
+ me.documentHolder.currentMenu && me.documentHolder.currentMenu.hide();
+ }, 1);
+
+ me._isFromSlideMenu = number;
+ },
+
+ onApiUpdateThemeIndex: function(v) {
+ this._state.themeId = v;
+ },
+
+ onApiLockDocumentTheme: function() {
+ this.documentHolder && (this.documentHolder._state.themeLock = true);
+ },
+
+ onApiUnLockDocumentTheme: function() {
+ this.documentHolder && (this.documentHolder._state.themeLock = false);
+ },
+
+ onShowSpecialPasteOptions: function(specialPasteShowOptions) {
+ var me = this,
+ documentHolder = me.documentHolder;
+ var coord = specialPasteShowOptions.asc_getCellCoord(),
+ pasteContainer = documentHolder.cmpEl.find('#special-paste-container'),
+ pasteItems = specialPasteShowOptions.asc_getOptions();
+ if (!pasteItems) return;
+
+ // Prepare menu container
+ if (pasteContainer.length < 1) {
+ me._arrSpecialPaste = [];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.paste] = documentHolder.textPaste;
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.keepTextOnly] = documentHolder.txtKeepTextOnly;
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.picture] = documentHolder.txtPastePicture;
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.sourceformatting] = documentHolder.txtPasteSourceFormat;
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.destinationFormatting] = documentHolder.txtPasteDestFormat;
+
+
+ pasteContainer = $('');
+ documentHolder.cmpEl.append(pasteContainer);
+
+ me.btnSpecialPaste = new Common.UI.Button({
+ parentEl: $('#id-document-holder-btn-special-paste'),
+ cls : 'btn-toolbar',
+ iconCls : 'toolbar__icon btn-paste',
+ menu : new Common.UI.Menu({items: []})
+ });
+ }
+
+ if (pasteItems.length>0) {
+ var menu = me.btnSpecialPaste.menu;
+ for (var i = 0; i < menu.items.length; i++) {
+ menu.removeItem(menu.items[i]);
+ i--;
+ }
+
+ var group_prev = -1;
+ _.each(pasteItems, function(menuItem, index) {
+ var mnu = new Common.UI.MenuItem({
+ caption: me._arrSpecialPaste[menuItem],
+ value: menuItem,
+ checkable: true,
+ toggleGroup : 'specialPasteGroup'
+ }).on('click', function(item, e) {
+ me.api.asc_SpecialPaste(item.value);
+ setTimeout(function(){menu.hide();}, 100);
+ });
+ menu.addItem(mnu);
+ });
+ (menu.items.length>0) && menu.items[0].setChecked(true, true);
+ }
+ if (coord.asc_getX()<0 || coord.asc_getY()<0) {
+ if (pasteContainer.is(':visible')) pasteContainer.hide();
+ } else {
+ var showPoint = [coord.asc_getX() + coord.asc_getWidth() + 3, coord.asc_getY() + coord.asc_getHeight() + 3];
+ pasteContainer.css({left: showPoint[0], top : showPoint[1]});
+ pasteContainer.show();
+ }
+ },
+
+ onHideSpecialPasteOptions: function() {
+ var pasteContainer = this.documentHolder.cmpEl.find('#special-paste-container');
+ if (pasteContainer.is(':visible'))
+ pasteContainer.hide();
+ },
+
+ onChangeCropState: function(state) {
+ this.documentHolder.menuImgCrop.menu.items[0].setChecked(state, true);
+ },
+
+ onDoubleClickOnTableOleObject: function(chart) {
+ if (this.mode.isEdit && !this._isDisabled) {
+ var oleEditor = PE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor');
+ if (oleEditor && chart) {
+ oleEditor.setEditMode(true);
+ oleEditor.show();
+ oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(chart));
+ }
+ }
+ },
+
+ addHyperlink: function(item){
+ var win, me = this;
+ if (me.api) {
+ var _arr = [];
+ for (var i=0; i
')}
+ ]
+ });
+ // Prepare menu container
+ menuContainer = $(Common.Utils.String.format('', menu.id));
+ this.documentHolder.cmpEl.append(menuContainer);
+ menu.render(menuContainer);
+ menu.cmpEl.attr({tabindex: "-1"});
+ menu.on('hide:after', function(){
+ if (!me._fromShowPlaceholder)
+ me.api.asc_uncheckPlaceholders();
+ });
+
+ var picker = new Common.UI.DataView({
+ el: $('#id-placeholder-menu-chart'),
+ parentMenu: menu,
+ showLast: false,
+ // restoreHeight: 421,
+ groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()),
+ store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()),
+ itemTemplate: _.template('
')
+ });
+ picker.on('item:click', function (picker, item, record, e) {
+ me.editChartClick(record.get('type'), me._state.placeholderObj);
+ });
+ }
+ menuContainer.css({left: x, top : y});
+ menuContainer.attr('data-value', 'prevent-canvas-click');
+ this._preventClick = true;
+ menu.show();
+
+ menu.alignPosition();
+ _.delay(function() {
+ menu.cmpEl.find('.dataview').focus();
+ }, 10);
+ this._fromShowPlaceholder = false;
+ },
+
+ onClickPlaceholderTable: function(obj, x, y) {
+ if (!this.api) return;
+
+ this._state.placeholderObj = obj;
+ var menu = this.placeholderMenuTable,
+ menuContainer = menu ? this.documentHolder.cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)) : null,
+ me = this;
+ this._fromShowPlaceholder = true;
+ Common.UI.Menu.Manager.hideAll();
+
+ if (!menu) {
+ this.placeholderMenuTable = menu = new Common.UI.Menu({
+ cls: 'shifted-left',
+ items: [
+ {template: _.template('')},
+ {caption: me.mniCustomTable, value: 'custom'}
+ ]
+ });
+ // Prepare menu container
+ menuContainer = $(Common.Utils.String.format('', menu.id));
+ this.documentHolder.cmpEl.append(menuContainer);
+ menu.render(menuContainer);
+ menu.cmpEl.attr({tabindex: "-1"});
+ menu.on('hide:after', function(){
+ if (!me._fromShowPlaceholder)
+ me.api.asc_uncheckPlaceholders();
+ });
+
+ var picker = new Common.UI.DimensionPicker({
+ el: $('#id-placeholder-menu-tablepicker'),
+ minRows: 8,
+ minColumns: 10,
+ maxRows: 8,
+ maxColumns: 10
+ });
+ picker.on('select', function(picker, columns, rows){
+ me.api.put_Table(columns, rows, me._state.placeholderObj);
+ me.editComplete();
+ });
+ menu.on('item:click', function(menu, item, e){
+ if (item.value === 'custom') {
+ (new Common.Views.InsertTableDialog({
+ handler: function(result, value) {
+ if (result == 'ok')
+ me.api.put_Table(value.columns, value.rows, me._state.placeholderObj);
+ me.editComplete();
+ }
+ })).show();
+ }
+ });
+ }
+ menuContainer.css({left: x, top : y});
+ menuContainer.attr('data-value', 'prevent-canvas-click');
+ this._preventClick = true;
+ menu.show();
+
+ menu.alignPosition();
+ _.delay(function() {
+ menu.cmpEl.focus();
+ }, 10);
+ this._fromShowPlaceholder = false;
+ },
+
+ onHidePlaceholderActions: function() {
+ this.placeholderMenuChart && this.placeholderMenuChart.hide();
+ this.placeholderMenuTable && this.placeholderMenuTable.hide();
+ },
+
+ onClickPlaceholder: function(type, obj, x, y) {
+ if (!this.api) return;
+ if (type == AscCommon.PlaceholderButtonType.Video) {
+ this.api.asc_AddVideo(obj);
+ } else if (type == AscCommon.PlaceholderButtonType.Audio) {
+ this.api.asc_AddAudio(obj);
+ }
+ this.editComplete();
+ },
+
+ onImgReplace: function(menu, item, e) {
+ var me = this;
+ if (item.value==1) {
+ me.onInsertImageUrl(false);
+ } else if (item.value==2) {
+ Common.NotificationCenter.trigger('storage:image-load', 'change');
+ } else {
+ setTimeout(function(){
+ me.onInsertImage();
+ }, 10);
+ }
+ },
+
+ onLangMenu: function(type, menu, item){
+ var me = this;
+ if (me.api){
+ if (!_.isUndefined(item.langid))
+ me.api.put_TextPrLang(item.langid);
+
+ (type==='para') ? (me.documentHolder._currLang.paraid = item.langid) : (me.documentHolder._currLang.tableid = item.langid);
+ me.editComplete();
+ }
+ },
+
+ onUndo: function () {
+ this.api.Undo();
+ },
+
+ onPreview: function () {
+ var current = this.api.getCurrentPage();
+ Common.NotificationCenter.trigger('preview:start', _.isNumber(current) ? current : 0);
+ },
+
+ onSelectAll: function () {
+ if (this.api){
+ this.api.SelectAllSlides();
+
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Select All Slides');
+ }
+ },
+
+ onPrintSelection: function () {
+ if (this.api){
+ var printopt = new Asc.asc_CAdjustPrint();
+ printopt.asc_setPrintType(Asc.c_oAscPrintType.Selection);
+ var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); // if isChrome or isOpera == true use asc_onPrintUrl event
+ opts.asc_setAdvancedOptions(printopt);
+ this.api.asc_Print(opts);
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Print Selection');
+ }
+ },
+
+ onNewSlide: function () {
+ if (this.api){
+ this._isFromSlideMenu = true;
+ this.api.AddSlide();
+
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Add Slide');
+ }
+ },
+
+ onDuplicateSlide: function () {
+ if (this.api){
+ this._isFromSlideMenu = true;
+ this.api.DublicateSlide();
+
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Dublicate Slide');
+ }
+ },
+
+ onDeleteSlide: function () {
+ if (this.api){
+ this._isFromSlideMenu = true;
+ this.api.DeleteSlide();
+
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Delete Slide');
+ }
+ },
+
+ onResetSlide: function () {
+ if (this.api){
+ this.api.ResetSlide();
+
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Reset Slide');
+ }
+ },
+
+ onMoveSlideToStart: function () {
+ if (this.api){
+ this.api.asc_moveSelectedSlidesToStart();
+
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Move Slide to Start');
+ }
+ },
+
+ onMoveSlideToEnd: function () {
+ if (this.api){
+ this.api.asc_moveSelectedSlidesToEnd();
+
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Move Slide to End');
+ }
+ },
+
+ onSlideSettings: function (item) {
+ PE.getController('RightMenu').onDoubleClickOnObject(item.options.value);
+ },
+
+ onSlideHide: function (item) {
+ if (this.api){
+ this.api.asc_HideSlides(item.checked);
+
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Hide Slides');
+ }
+ },
+
+ onLayoutChange: function (record) {
+ if (this.api) {
+ this.api.ChangeLayout(record.get('data').idx);
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Change Layout');
+ }
+ },
+
+ onThemeChange: function (record) {
+ if (this.api) {
+ this.api.ChangeTheme(record.get('themeId'), true);
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Change Layout');
+ }
+ },
+
+ onTableMerge: function () {
+ this.api && this.api.MergeCells();
+ },
+
+ onTableSplit: function () {
+ var me = this;
+ if (me.api) {
+ (new Common.Views.InsertTableDialog({
+ split: true,
+ handler: function(result, value) {
+ if (result == 'ok') {
+ if (me.api) {
+ me.api.SplitCell(value.columns, value.rows);
+ }
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Table Split');
+ }
+ me.editComplete();
+ }
+ })).show();
+ }
+ },
+
+ tableCellsVAlign: function(menu, item, e) {
+ if (this.api) {
+ var properties = new Asc.CTableProp();
+ properties.put_CellsVAlign(item.value);
+ this.api.tblApply(properties);
+ }
+
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Table Cell Align');
+ },
+
+ onTableDistRows: function () {
+ this.api && this.api.asc_DistributeTableCells(false);
+ this.editComplete();
+ },
+
+ onTableDistCols: function () {
+ this.api && this.api.asc_DistributeTableCells(true);
+ this.editComplete();
+ },
+
+ onIgnoreSpell: function(item, e){
+ this.api && this.api.asc_ignoreMisspelledWord(this.documentHolder._currentSpellObj, !!item.value);
+ this.editComplete();
+ },
+
+ onToDictionary: function(item, e){
+ this.api && this.api.asc_spellCheckAddToDictionary(this.documentHolder._currentSpellObj);
+ this.editComplete();
+ },
+
+ onTableAdvanced: function(item, e){
+ var me = this;
+ if (me.api) {
+ var selectedElements = me.api.getSelectedElements();
+
+ if (selectedElements && selectedElements.length > 0){
+ var elType, elValue;
+ for (var i = selectedElements.length - 1; i >= 0; i--) {
+ elType = selectedElements[i].get_ObjectType();
+ elValue = selectedElements[i].get_ObjectValue();
+
+ if (Asc.c_oAscTypeSelectElement.Table == elType) {
+ (new PE.Views.TableSettingsAdvanced(
+ {
+ tableProps: elValue,
+ slideSize: PE.getController('Toolbar').currentPageSize,
+ handler: function(result, value) {
+ if (result == 'ok') {
+ if (me.api) {
+ me.api.tblApply(value.tableProps);
+ }
+ }
+ me.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Table Settings Advanced');
+ }
+ })).show();
+ break;
+ }
+ }
+ }
+ }
+ },
+
+ onImageAdvanced: function(item) {
+ var me = this;
+ if (me.api){
+ var selectedElements = me.api.getSelectedElements();
+ if (selectedElements && selectedElements.length>0){
+ var elType, elValue;
+
+ for (var i = selectedElements.length - 1; i >= 0; i--) {
+ elType = selectedElements[i].get_ObjectType();
+ elValue = selectedElements[i].get_ObjectValue();
+
+ if (Asc.c_oAscTypeSelectElement.Image == elType) {
+ var imgsizeOriginal;
+
+ if (!me.documentHolder.menuImgOriginalSize.isDisabled()) {
+ imgsizeOriginal = me.api.get_OriginalSizeImage();
+ if (imgsizeOriginal)
+ imgsizeOriginal = {width:imgsizeOriginal.get_ImageWidth(), height:imgsizeOriginal.get_ImageHeight()};
+ }
+
+ (new PE.Views.ImageSettingsAdvanced(
+ {
+ imageProps: elValue,
+ sizeOriginal: imgsizeOriginal,
+ slideSize: PE.getController('Toolbar').currentPageSize,
+ handler: function(result, value) {
+ if (result == 'ok') {
+ if (me.api) {
+ me.api.ImgApply(value.imageProps);
+ }
+ }
+ me.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Image Settings Advanced');
+ }
+ })).show();
+ break;
+ }
+ }
+ }
+ }
+ },
+
+ onImgOriginalSize: function(item){
+ var me = this;
+ if (me.api){
+ var originalImageSize = me.api.get_OriginalSizeImage();
+
+ if (originalImageSize) {
+ var properties = new Asc.asc_CImgProperty();
+
+ properties.put_Width(originalImageSize.get_ImageWidth());
+ properties.put_Height(originalImageSize.get_ImageHeight());
+ properties.put_ResetCrop(true);
+ properties.put_Rot(0);
+ me.api.ImgApply(properties);
+ }
+
+ me.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Set Image Original Size');
+ }
+ },
+
+ onImgRotate: function(item) {
+ var properties = new Asc.asc_CShapeProperty();
+ properties.asc_putRotAdd((item.value==1 ? 90 : 270) * 3.14159265358979 / 180);
+ this.api.ShapeApply(properties);
+ this.editComplete();
+ },
+
+ onImgFlip: function(item) {
+ var properties = new Asc.asc_CShapeProperty();
+ if (item.value==1)
+ properties.asc_putFlipHInvert(true);
+ else
+ properties.asc_putFlipVInvert(true);
+ this.api.ShapeApply(properties);
+ this.editComplete();
+ },
+
+ onImgCrop: function(menu, item) {
+ if (item.value == 1) {
+ this.api.asc_cropFill();
+ } else if (item.value == 2) {
+ this.api.asc_cropFit();
+ } else {
+ item.checked ? this.api.asc_startEditCrop() : this.api.asc_endEditCrop();
+ }
+ this.editComplete();
+ },
+
+ onImgEditPoints: function(item) {
+ this.api && this.api.asc_editPointsGeometry();
+ },
+
+ onShapeAdvanced: function(item) {
+ var me = this;
+ if (me.api){
+ var selectedElements = me.api.getSelectedElements();
+ if (selectedElements && selectedElements.length>0){
+ var elType, elValue;
+ for (var i = selectedElements.length - 1; i >= 0; i--) {
+ elType = selectedElements[i].get_ObjectType();
+ elValue = selectedElements[i].get_ObjectValue();
+ if (Asc.c_oAscTypeSelectElement.Shape == elType) {
+ (new PE.Views.ShapeSettingsAdvanced(
+ {
+ shapeProps: elValue,
+ slideSize: PE.getController('Toolbar').currentPageSize,
+ handler: function(result, value) {
+ if (result == 'ok') {
+ if (me.api) {
+ me.api.ShapeApply(value.shapeProps);
+ }
+ }
+ me.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Image Shape Advanced');
+ }
+ })).show();
+ break;
+ }
+ }
+ }
+ }
+ },
+
+ onParagraphAdvanced: function(item) {
+ var me = this;
+ if (me.api){
+ var selectedElements = me.api.getSelectedElements();
+
+ if (selectedElements && selectedElements.length > 0){
+ var elType, elValue;
+ for (var i = selectedElements.length - 1; i >= 0; i--) {
+ elType = selectedElements[i].get_ObjectType();
+ elValue = selectedElements[i].get_ObjectValue();
+
+ if (Asc.c_oAscTypeSelectElement.Paragraph == elType) {
+ (new PE.Views.ParagraphSettingsAdvanced(
+ {
+ paragraphProps: elValue,
+ api: me.api,
+ handler: function(result, value) {
+ if (result == 'ok') {
+ if (me.api) {
+ me.api.paraApply(value.paragraphProps);
+ }
+ }
+ me.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Image Paragraph Advanced');
+ }
+ })).show();
+ break;
+ }
+ }
+ }
+ }
+ },
+
+ onGroupImg: function(item) {
+ this.api && this.api.groupShapes();
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Group Image');
+ },
+
+ onUnGroupImg: function(item) {
+ this.api && this.api.unGroupShapes();
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'UnGroup Image');
+ },
+
+ onArrangeFront: function(item) {
+ this.api && this.api.shapes_bringToFront();
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Bring To Front');
+ },
+
+ onArrangeBack: function(item) {
+ this.api && this.api.shapes_bringToBack();
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Bring To Back');
+ },
+
+ onArrangeForward: function(item) {
+ this.api && this.api.shapes_bringForward();
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Send Forward');
+ },
+
+ onArrangeBackward: function(item) {
+ this.api && this.api.shapes_bringBackward();
+ this.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Send Backward');
+ },
+
+ onImgShapeAlign: function (menu, item) {
+ var me = this;
+ if (me.api) {
+ var value = me.api.asc_getSelectedDrawingObjectsCount()<2 || Common.Utils.InternalSettings.get("pe-align-to-slide");
+ value = value ? Asc.c_oAscObjectsAlignType.Slide : Asc.c_oAscObjectsAlignType.Selected;
+ if (item.value < 6) {
+ me.api.put_ShapesAlign(item.value, value);
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Shape Align');
+ } else if (item.value == 6) {
+ me.api.DistributeHorizontally(value);
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Horizontally');
+ } else if (item.value == 7){
+ me.api.DistributeVertically(value);
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Vertically');
+ }
+ me.editComplete();
+ }
+ },
+
+ onParagraphVAlign: function (menu, item) {
+ var me = this;
+ if (me.api) {
+ var properties = new Asc.asc_CShapeProperty();
+ properties.put_VerticalTextAlign(item.value);
+
+ me.api.ShapeApply(properties);
+ }
+
+ me.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Text Vertical Align');
+ },
+
+ onParagraphDirection: function(menu, item) {
+ var me = this;
+ if (me.api) {
+ var properties = new Asc.asc_CShapeProperty();
+ properties.put_Vert(item.options.direction);
+ me.api.ShapeApply(properties);
+ }
+ me.editComplete();
+ Common.component.Analytics.trackEvent('DocumentHolder', 'Text Direction');
+ },
+
+ tableSelectText: function(menu, item) {
+ if (this.api) {
+ switch (item.value) {
+ case 0:
+ this.api.selectRow();
+ break;
+ case 1:
+ this.api.selectColumn();
+ break;
+ case 2:
+ this.api.selectCell();
+ break;
+ case 3:
+ this.api.selectTable();
+ break;
+ }
+ }
+ },
+
+ tableInsertText: function(menu, item) {
+ if (this.api) {
+ switch (item.value) {
+ case 0:
+ this.api.addColumnLeft();
+ break;
+ case 1:
+ this.api.addColumnRight();
+ break;
+ case 2:
+ this.api.addRowAbove();
+ break;
+ case 3:
+ this.api.addRowBelow();
+ break;
+ }
+ }
+ },
+
+ tableDeleteText: function(menu, item) {
+ if (this.api) {
+ switch (item.value) {
+ case 0:
+ this.api.remRow();
+ break;
+ case 1:
+ this.api.remColumn();
+ break;
+ case 2:
+ this.api.remTable();
+ break;
+ }
+ }
+ },
+
+
+ SetDisabled: function(state) {
+ this._isDisabled = state;
+ this.documentHolder.SetDisabled(state);
+ },
+
+ editComplete: function() {
+ this.documentHolder && this.documentHolder.fireEvent('editcomplete', this.documentHolder);
}
});
});
\ No newline at end of file
diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js
index 9f12663c8..ecb54b58b 100644
--- a/apps/presentationeditor/main/app/controller/Main.js
+++ b/apps/presentationeditor/main/app/controller/Main.js
@@ -152,6 +152,7 @@ define([
strongCompare : function(obj1, obj2){return obj1.type === obj2.type;},
weakCompare : function(obj1, obj2){return obj1.type === obj2.type;}
});
+ this.stackMacrosRequests = [];
// Initialize viewport
if (!Common.Utils.isBrowserSupported()){
@@ -393,6 +394,9 @@ define([
value = parseInt(value);
Common.Utils.InternalSettings.set("pe-macros-mode", value);
+ value = Common.localStorage.getItem("pe-allow-macros-request");
+ Common.Utils.InternalSettings.set("pe-allow-macros-request", (value !== null) ? parseInt(value) : 0);
+
this.appOptions.wopi = this.editorConfig.wopi;
Common.Controllers.Desktop.init(this.appOptions);
@@ -443,6 +447,7 @@ define([
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this));
+ this.api.asc_registerCallback('asc_onMacrosPermissionRequest', _.bind(this.onMacrosPermissionRequest, this));
this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this));
this.api.asc_setDocInfo(docInfo);
this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId);
@@ -586,7 +591,7 @@ define([
toolbarView.btnHighlightColor.toggle(false, false);
}
- application.getController('DocumentHolder').getView('DocumentHolder').focus();
+ application.getController('DocumentHolder').getView().focus();
if (this.api && this.appOptions.isEdit && this.api.asc_isDocumentCanSave) {
var cansave = this.api.asc_isDocumentCanSave(),
forcesave = this.appOptions.forcesave,
@@ -847,6 +852,9 @@ define([
Common.Utils.InternalSettings.set("pe-settings-inputmode", value);
me.api.SetTextBoxInputMode(value);
+ value = Common.localStorage.getBool("pe-settings-use-alt-key", true);
+ Common.Utils.InternalSettings.set("pe-settings-use-alt-key", value);
+
/** coauthoring begin **/
me._state.fastCoauth = Common.Utils.InternalSettings.get("pe-settings-coauthmode");
me.api.asc_SetFastCollaborative(me._state.fastCoauth);
@@ -875,7 +883,7 @@ define([
pluginsController.setApi(me.api);
documentHolderController.setApi(me.api);
- documentHolderController.createDelayedElements();
+ // documentHolderController.createDelayedElements();
statusbarController.createDelayedElements();
leftmenuController.getView('LeftMenu').disableMenu('all',false);
@@ -883,7 +891,7 @@ define([
if (me.appOptions.canBranding)
me.getApplication().getController('LeftMenu').leftMenu.getMenu('about').setLicInfo(me.editorConfig.customization);
- documentHolderController.getView('DocumentHolder').setApi(me.api).on('editcomplete', _.bind(me.onEditComplete, me));
+ documentHolderController.getView().on('editcomplete', _.bind(me.onEditComplete, me));
// if (me.isThumbnailsShow) me.getMainMenu().onThumbnailsShow(me.isThumbnailsShow);
application.getController('Viewport').getView('DocumentPreview').setApi(me.api).setMode(me.appOptions).on('editcomplete', _.bind(me.onEditComplete, me));
@@ -909,7 +917,7 @@ define([
toolbarController.createDelayedElements();
- documentHolderController.getView('DocumentHolder').createDelayedElements();
+ documentHolderController.getView().createDelayedElements();
me.setLanguages();
me.api.asc_registerCallback('asc_onUpdateLayout', _.bind(me.fillLayoutsStore, me)); // slide layouts loading
@@ -931,7 +939,7 @@ define([
}
}, 50);
} else {
- documentHolderController.getView('DocumentHolder').createDelayedElementsViewer();
+ documentHolderController.getView().createDelayedElementsViewer();
Common.NotificationCenter.trigger('document:ready', 'main');
me.applyLicense();
}
@@ -1079,7 +1087,7 @@ define([
app.getController('Toolbar').DisableToolbar(disable, options.viewMode);
}
if (options.documentHolder) {
- app.getController('DocumentHolder').getView('DocumentHolder').SetDisabled(disable);
+ app.getController('DocumentHolder').SetDisabled(disable);
}
if (options.leftMenu) {
if (options.leftMenu.disable)
@@ -1282,7 +1290,7 @@ define([
var app = this.getApplication(),
viewport = app.getController('Viewport').getView('Viewport'),
statusbarView = app.getController('Statusbar').getView('Statusbar'),
- documentHolder = app.getController('DocumentHolder').getView('DocumentHolder'),
+ documentHolder = app.getController('DocumentHolder'),
toolbarController = app.getController('Toolbar');
viewport && viewport.setMode(this.appOptions, true);
@@ -1854,7 +1862,7 @@ define([
synchronizeChanges: function() {
this.getApplication().getController('Statusbar').setStatusCaption('');
- this.getApplication().getController('DocumentHolder').getView('DocumentHolder').hideTips();
+ this.getApplication().getController('DocumentHolder').hideTips();
/** coauthoring begin **/
this.getApplication().getController('Toolbar').getView('Toolbar').synchronizeChanges();
/** coauthoring end **/
@@ -2072,7 +2080,7 @@ define([
this.loadLanguages([]);
}
if (this.languages && this.languages.length>0) {
- this.getApplication().getController('DocumentHolder').getView('DocumentHolder').setLanguages(this.languages);
+ this.getApplication().getController('DocumentHolder').getView().setLanguages(this.languages);
this.getApplication().getController('Statusbar').setLanguages(this.languages);
this.getApplication().getController('Common.Controllers.ReviewChanges').setLanguages(this.languages);
}
@@ -2277,6 +2285,47 @@ define([
}
},
+ onMacrosPermissionRequest: function(url, callback) {
+ if (url && callback) {
+ this.stackMacrosRequests.push({url: url, callback: callback});
+ if (this.stackMacrosRequests.length>1) {
+ return;
+ }
+ } else if (this.stackMacrosRequests.length>0) {
+ url = this.stackMacrosRequests[0].url;
+ callback = this.stackMacrosRequests[0].callback;
+ } else
+ return;
+
+ var me = this;
+ var value = Common.Utils.InternalSettings.get("pe-allow-macros-request");
+ if (value>0) {
+ callback && callback(value === 1);
+ this.stackMacrosRequests.shift();
+ this.onMacrosPermissionRequest();
+ } else {
+ Common.UI.warning({
+ msg: this.textRequestMacros.replace('%1', url),
+ buttons: ['yes', 'no'],
+ primary: 'yes',
+ dontshow: true,
+ textDontShow: this.textRememberMacros,
+ maxwidth: 600,
+ callback: function(btn, dontshow){
+ if (dontshow) {
+ Common.Utils.InternalSettings.set("pe-allow-macros-request", (btn == 'yes') ? 1 : 2);
+ Common.localStorage.setItem("pe-allow-macros-request", (btn == 'yes') ? 1 : 2);
+ }
+ setTimeout(function() {
+ if (callback) callback(btn == 'yes');
+ me.stackMacrosRequests.shift();
+ me.onMacrosPermissionRequest();
+ }, 1);
+ }
+ });
+ }
+ },
+
loadAutoCorrectSettings: function() {
// autocorrection
var me = this;
@@ -2930,7 +2979,9 @@ define([
textConvertEquation: 'This equation was created with an old version of equation editor which is no longer supported. Converting this equation to Office Math ML format will make it editable.
Do you want to convert this equation?',
textApplyAll: 'Apply to all equations',
textLearnMore: 'Learn More',
- textReconnect: 'Connection is restored'
+ textReconnect: 'Connection is restored',
+ textRequestMacros: 'A macro makes a request to URL. Do you want to allow the request to the %1?',
+ textRememberMacros: 'Remember my choice for all macros'
}
})(), PE.Controllers.Main || {}))
});
diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js
index c3c8b631a..a869ff4fb 100644
--- a/apps/presentationeditor/main/app/controller/Toolbar.js
+++ b/apps/presentationeditor/main/app/controller/Toolbar.js
@@ -503,20 +503,63 @@ define([
}
},
+ updateBulletTip: function(view, title) {
+ if (view) {
+ var tip = $(view.el).data('bs.tooltip');
+ if (tip) {
+ tip.options.title = title;
+ tip.$tip.find('.tooltip-inner').text(title);
+ }
+ }
+ },
+
onApiBullets: function(v) {
- if (this._state.bullets.type != v.get_ListType() || this._state.bullets.subtype != v.get_ListSubType()) {
+ if (this._state.bullets.type !== v.get_ListType() || this._state.bullets.subtype !== v.get_ListSubType() || v.get_ListType()===0 && v.get_ListSubType()===0x1000) {
this._state.bullets.type = v.get_ListType();
this._state.bullets.subtype = v.get_ListSubType();
+ var rec = this.toolbar.mnuMarkersPicker.store.at(8),
+ drawDefBullet = (rec.get('data').subtype===0x1000) && (this._state.bullets.type===1 || this._state.bullets.subtype!==0x1000);
+
this._clearBullets();
switch(this._state.bullets.type) {
case 0:
+ var idx;
+ if (this._state.bullets.subtype!==0x1000)
+ idx = this._state.bullets.subtype;
+ else { // custom
+ var bullet = v.asc_getListCustom();
+ if (bullet) {
+ var type = bullet.asc_getType();
+ if (type == Asc.asc_PreviewBulletType.char) {
+ var symbol = bullet.asc_getChar();
+ if (symbol) {
+ rec.get('data').subtype = 0x1000;
+ rec.set('drawdata', {type: type, char: symbol, specialFont: bullet.asc_getSpecialFont()});
+ rec.set('tip', '');
+ this.toolbar.mnuMarkersPicker.dataViewItems && this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], '');
+ drawDefBullet = false;
+ idx = 8;
+ }
+ } else if (type == Asc.asc_PreviewBulletType.image) {
+ var id = bullet.asc_getImageId();
+ if (id) {
+ rec.get('data').subtype = 0x1000;
+ rec.set('drawdata', {type: type, imageId: id});
+ rec.set('tip', '');
+ this.toolbar.mnuMarkersPicker.dataViewItems && this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], '');
+ drawDefBullet = false;
+ idx = 8;
+ }
+ }
+ }
+ }
+ (idx!==undefined) ? this.toolbar.mnuMarkersPicker.selectByIndex(idx, true) :
+ this.toolbar.mnuMarkersPicker.deselectAll(true);
+
this.toolbar.btnMarkers.toggle(true, true);
- if (this._state.bullets.subtype!==undefined)
- this.toolbar.mnuMarkersPicker.selectByIndex(this._state.bullets.subtype, true);
- else
- this.toolbar.mnuMarkersPicker.deselectAll(true);
+ this.toolbar.mnuNumbersPicker.deselectAll(true);
break;
case 1:
var idx = 0;
@@ -545,8 +588,15 @@ define([
}
this.toolbar.btnNumbers.toggle(true, true);
this.toolbar.mnuNumbersPicker.selectByIndex(idx, true);
+ this.toolbar.mnuMarkersPicker.deselectAll(true);
break;
}
+ if (drawDefBullet) {
+ rec.get('data').subtype = 8;
+ rec.set('drawdata', this.toolbar._markersArr[8]);
+ rec.set('tip', this.toolbar.tipMarkersDash);
+ this.toolbar.mnuMarkersPicker.dataViewItems && this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], this.toolbar.tipMarkersDash);
+ }
}
},
@@ -1247,6 +1297,7 @@ define([
api: me.api,
props: props,
type: type,
+ storage: me.mode.canRequestInsertImage || me.mode.fileChoiceUrl && me.mode.fileChoiceUrl.indexOf("{documentType}")>-1,
interfaceLang: me.toolbar.mode.lang,
handler: function(result, value) {
if (result == 'ok') {
@@ -1358,7 +1409,9 @@ define([
var store = picker.store;
var arr = [];
store.each(function(item){
- arr.push(item.get('id'));
+ var data = item.get('drawdata');
+ data['divId'] = item.get('id');
+ arr.push(data);
});
if (this.api && this.api.SetDrawImagePreviewBulletForMenu) {
this.api.SetDrawImagePreviewBulletForMenu(arr, type);
@@ -1381,11 +1434,31 @@ define([
}
if (btn) {
- btn.toggle(rawData.data.subtype > -1, true);
+ btn.toggle(rawData.data.subtype !== -1, true);
}
- if (this.api)
- this.api.put_ListType(rawData.data.type, rawData.data.subtype);
+ if (this.api){
+ if (rawData.data.type===0 && rawData.data.subtype===0x1000) {// custom bullet
+ var bullet = new Asc.asc_CBullet();
+ if (rawData.drawdata.type===Asc.asc_PreviewBulletType.char) {
+ bullet.asc_putSymbol(rawData.drawdata.char);
+ bullet.asc_putFont(rawData.drawdata.specialFont);
+ } else if (rawData.drawdata.type===Asc.asc_PreviewBulletType.image)
+ bullet.asc_fillBulletImage(rawData.drawdata.imageId);
+ var selectedElements = this.api.getSelectedElements();
+ if (selectedElements && _.isArray(selectedElements)) {
+ for (var i = 0; i< selectedElements.length; i++) {
+ if (Asc.c_oAscTypeSelectElement.Paragraph == selectedElements[i].get_ObjectType()) {
+ var props = selectedElements[i].get_ObjectValue();
+ props.asc_putBullet(bullet);
+ this.api.paraApply(props);
+ break;
+ }
+ }
+ }
+ } else
+ this.api.put_ListType(rawData.data.type, rawData.data.subtype);
+ }
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'List Type');
@@ -2000,9 +2073,9 @@ define([
if (this._state.clrhighlight != -1) {
this.toolbar.mnuHighlightTransparent.setChecked(true, true);
- if (this.toolbar.mnuHighlightColorPicker.cmpEl) {
+ if (this.toolbar.mnuHighlightColorPicker) {
this._state.clrhighlight = -1;
- this.toolbar.mnuHighlightColorPicker.select(null, true);
+ this.toolbar.mnuHighlightColorPicker.clearSelection();
}
}
} else if (c !== null) {
@@ -2010,13 +2083,13 @@ define([
this.toolbar.mnuHighlightTransparent.setChecked(false);
this._state.clrhighlight = c.get_hex().toUpperCase();
- if ( _.contains(this.toolbar.mnuHighlightColorPicker.colors, this._state.clrhighlight) )
- this.toolbar.mnuHighlightColorPicker.select(this._state.clrhighlight, true);
+ if ( this.toolbar.mnuHighlightColorPicker && _.contains(this.toolbar.mnuHighlightColorPicker.colors, this._state.clrhighlight) )
+ this.toolbar.mnuHighlightColorPicker.selectByRGB(this._state.clrhighlight, true);
}
} else {
if ( this._state.clrhighlight !== c) {
this.toolbar.mnuHighlightTransparent.setChecked(false, true);
- this.toolbar.mnuHighlightColorPicker.select(null, true);
+ this.toolbar.mnuHighlightColorPicker && this.toolbar.mnuHighlightColorPicker.clearSelection();
this._state.clrhighlight = c;
}
}
diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js
index 04e6e4469..4e2249cf4 100644
--- a/apps/presentationeditor/main/app/controller/ViewTab.js
+++ b/apps/presentationeditor/main/app/controller/ViewTab.js
@@ -85,7 +85,6 @@ define([
mode: mode,
compactToolbar: this.toolbar.toolbar.isCompactView
});
-
this.addListeners({
'ViewTab': {
'zoom:toslide': _.bind(this.onBtnZoomTo, this, 'toslide'),
@@ -152,6 +151,10 @@ define([
})).then(function () {
me.view.setEvents();
+ if (!Common.UI.Themes.available()) {
+ me.view.btnInterfaceTheme.$el.closest('.group').remove();
+ me.view.$el.find('.separator-theme').remove();
+ }
if (config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) {
me.view.chStatusbar.$el.remove();
@@ -173,24 +176,26 @@ define([
.on('combo:blur', _.bind(me.onComboBlur, me, false));
});
- var menuItems = [],
- currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
- for (var t in Common.UI.Themes.map()) {
- menuItems.push({
- value: t,
- caption: Common.UI.Themes.get(t).text,
- checked: t === currentTheme,
- checkable: true,
- toggleGroup: 'interface-theme'
- });
- }
+ if (Common.UI.Themes.available()) {
+ var menuItems = [],
+ currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId();
+ for (var t in Common.UI.Themes.map()) {
+ menuItems.push({
+ value: t,
+ caption: Common.UI.Themes.get(t).text,
+ checked: t === currentTheme,
+ checkable: true,
+ toggleGroup: 'interface-theme'
+ });
+ }
- if (menuItems.length) {
- this.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems}));
- this.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) {
- var value = item.value;
- Common.UI.Themes.setTheme(value);
- }, this));
+ if (menuItems.length) {
+ this.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems}));
+ this.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) {
+ var value = item.value;
+ Common.UI.Themes.setTheme(value);
+ }, this));
+ }
}
}
},
@@ -220,7 +225,7 @@ define([
},
onThemeChanged: function () {
- if (this.view) {
+ if (this.view && Common.UI.Themes.available()) {
var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(),
menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme});
if ( !!menu_item ) {
diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js
index 49092ef33..b17125654 100644
--- a/apps/presentationeditor/main/app/view/Animation.js
+++ b/apps/presentationeditor/main/app/view/Animation.js
@@ -76,6 +76,12 @@ define([
me.btnPreview.on('click', _.bind(function(btn) {
me.fireEvent('animation:preview', [me.btnPreview]);
}, me));
+ me.btnPreview.menu.on('item:click', _.bind(function(menu, item, e) {
+ if (item.value === 'preview')
+ me.fireEvent('animation:preview', [me.btnPreview]);
+ else if (item.value === 'auto')
+ Common.Utils.InternalSettings.set("pe-animation-no-auto-preview", !item.checked);
+ }, me));
}
if(me.cmbTrigger)
@@ -240,7 +246,8 @@ define([
this.btnPreview = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top', // x-huge icon-top',
caption: this.txtPreview,
- split: false,
+ split: true,
+ menu: true,
iconCls: 'toolbar__icon animation-preview-start',
lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview, _set.timingLock],
dataHint: '1',
@@ -350,7 +357,7 @@ define([
width: 55,
value: '',
defaultUnit: this.txtSec,
- maxValue: 300,
+ maxValue: 60,
minValue: 0,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock],
dataHint: '1',
@@ -514,6 +521,15 @@ define([
me.btnAddAnimation.menu.setInnerMenu([{menu: picker, index: 0}]);
};
me.btnAddAnimation.menu.on('show:before', onShowBefore);
+
+ me.btnPreview.setMenu( new Common.UI.Menu({
+ style: "min-width: auto;",
+ items: [
+ {caption: me.txtPreview, value: 'preview'},
+ {caption: me.textAutoPreview, value: 'auto', checkable: true, checked: !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview")}
+ ]
+ }));
+
setEvents.call(me);
});
},
@@ -626,7 +642,8 @@ define([
str3: '3 s (Slow)',
str2: '2 s (Medium)',
str1: '1 s (Fast)',
- str0_5: '0.5 s (Very Fast)'
+ str0_5: '0.5 s (Very Fast)',
+ textAutoPreview: 'AutoPreview'
}
}()), PE.Views.Animation || {}));
diff --git a/apps/presentationeditor/main/app/view/AnimationDialog.js b/apps/presentationeditor/main/app/view/AnimationDialog.js
index d8f051f78..852c1b5b6 100644
--- a/apps/presentationeditor/main/app/view/AnimationDialog.js
+++ b/apps/presentationeditor/main/app/view/AnimationDialog.js
@@ -44,7 +44,7 @@ define([
PE.Views.AnimationDialog = Common.UI.Window.extend(_.extend({
options: {
width: 350,
- height: 426,
+ height: 396,
header: true,
cls: 'animation-dlg',
buttons: ['ok', 'cancel']
@@ -57,8 +57,8 @@ define([
'
',
'
',
'
',
- '
',
- '
',
+ '
',
+ // '
',
'
'
].join('');
this.allEffects = Common.define.effectData.getEffectFullData();
@@ -125,11 +125,11 @@ define([
});
this.lstEffectList.on('item:select', _.bind(this.onEffectListItem,this));
- this.chPreview = new Common.UI.CheckBox({
- el : $('#animation-setpreview'),
- labelText : this.textPreviewEffect,
- value: !Common.Utils.InternalSettings.get("pe-animation-no-preview")
- }).on('change', _.bind(this.onPreviewChange, this));
+ // this.chPreview = new Common.UI.CheckBox({
+ // el : $('#animation-setpreview'),
+ // labelText : this.textPreviewEffect,
+ // value: !Common.Utils.InternalSettings.get("pe-animation-no-preview")
+ // }).on('change', _.bind(this.onPreviewChange, this));
this.cmbGroup.setValue(this._state.activeGroupValue);
this.fillLevel();
@@ -138,7 +138,7 @@ define([
},
getFocusedComponents: function() {
- return [ this.cmbGroup, this.cmbLevel, this.lstEffectList, this.chPreview];
+ return [ this.cmbGroup, this.cmbLevel, this.lstEffectList/*, this.chPreview*/];
},
getDefaultFocusableComponent: function () {
diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js
index dd7c39c9a..ebb431b4a 100644
--- a/apps/presentationeditor/main/app/view/DocumentHolder.js
+++ b/apps/presentationeditor/main/app/view/DocumentHolder.js
@@ -58,1614 +58,13 @@ define([
initialize: function () {
var me = this;
- me.usertips = [];
- me._TtHeight = 20;
me.slidesCount = 0;
- me.fastcoauthtips = [];
me._currentMathObj = undefined;
me._currentParaObjDisabled = false;
me._currentSpellObj = undefined;
me._currLang = {};
me._state = {};
me._isDisabled = false;
-
- /** coauthoring begin **/
- var usersStore = PE.getCollection('Common.Collections.Users');
- /** coauthoring end **/
-
- var showPopupMenu = function(menu, value, event, docElement, eOpts){
- if (!_.isUndefined(menu) && menu !== null){
- Common.UI.Menu.Manager.hideAll();
-
- var showPoint = [event.get_X(), event.get_Y()],
- menuContainer = $(me.el).find(Common.Utils.String.format('#menu-container-{0}', menu.id));
-
- if (event.get_Type() == Asc.c_oAscContextMenuTypes.Thumbnails) {
- showPoint[0] -= 3;
- showPoint[1] -= 3;
- }
-
- if (!menu.rendered) {
- // Prepare menu container
- if (menuContainer.length < 1) {
- menuContainer = $(Common.Utils.String.format('', menu.id));
- $(me.el).append(menuContainer);
- }
-
- menu.render(menuContainer);
- menu.cmpEl.attr({tabindex: "-1"});
- }
-
- menuContainer.css({
- left: showPoint[0],
- top : showPoint[1]
- });
-
- menu.show();
-
- if (_.isFunction(menu.options.initMenu)) {
- menu.options.initMenu(value);
- menu.alignPosition();
- }
- _.delay(function() {
- menu.cmpEl.focus();
- }, 10);
-
- me.currentMenu = menu;
- }
- };
-
- var fillMenuProps = function(selectedElements) {
- if (!selectedElements || !_.isArray(selectedElements)) return;
-
- var menu_props = {},
- menu_to_show = null;
- _.each(selectedElements, function(element, index) {
- var elType = element.get_ObjectType(),
- elValue = element.get_ObjectValue();
-
- if (Asc.c_oAscTypeSelectElement.Image == elType) {
- menu_to_show = me.pictureMenu;
- menu_props.imgProps = {};
- menu_props.imgProps.value = elValue;
- menu_props.imgProps.locked = (elValue) ? elValue.get_Locked() : false;
- } else if (Asc.c_oAscTypeSelectElement.Table == elType)
- {
- menu_to_show = me.tableMenu;
- menu_props.tableProps = {};
- menu_props.tableProps.value = elValue;
- menu_props.tableProps.locked = (elValue) ? elValue.get_Locked() : false;
- } else if (Asc.c_oAscTypeSelectElement.Hyperlink == elType) {
- menu_props.hyperProps = {};
- menu_props.hyperProps.value = elValue;
- } else if (Asc.c_oAscTypeSelectElement.Shape == elType) { // shape
- menu_to_show = me.pictureMenu;
- menu_props.shapeProps = {};
- menu_props.shapeProps.value = elValue;
- menu_props.shapeProps.locked = (elValue) ? elValue.get_Locked() : false;
- if (elValue.get_FromChart())
- menu_props.shapeProps.isChart = true;
- }
- else if (Asc.c_oAscTypeSelectElement.Chart == elType) {
- menu_to_show = me.pictureMenu;
- menu_props.chartProps = {};
- menu_props.chartProps.value = elValue;
- menu_props.chartProps.locked = (elValue) ? elValue.get_Locked() : false;
- }
- else if (Asc.c_oAscTypeSelectElement.Slide == elType) {
- menu_props.slideProps = {};
- menu_props.slideProps.value = elValue;
- menu_props.slideProps.locked = (elValue) ? elValue.get_LockDelete() : false;
- } else if (Asc.c_oAscTypeSelectElement.Paragraph == elType) {
- menu_props.paraProps = {};
- menu_props.paraProps.value = elValue;
- menu_props.paraProps.locked = (elValue) ? elValue.get_Locked() : false;
- if ( (menu_props.shapeProps && menu_props.shapeProps.value || menu_props.chartProps && menu_props.chartProps.value)&& // text in shape, need to show paragraph menu with vertical align
- _.isUndefined(menu_props.tableProps))
- menu_to_show = me.textMenu;
- } else if (Asc.c_oAscTypeSelectElement.SpellCheck == elType) {
- menu_props.spellProps = {};
- menu_props.spellProps.value = elValue;
- me._currentSpellObj = elValue;
- } else if (Asc.c_oAscTypeSelectElement.Math == elType) {
- menu_props.mathProps = {};
- menu_props.mathProps.value = elValue;
- me._currentMathObj = elValue;
- }
- });
- if (menu_to_show === null) {
- if (!_.isUndefined(menu_props.paraProps))
- menu_to_show = me.textMenu;
- else if (!_.isUndefined(menu_props.slideProps)) {
- menu_to_show = me.slideMenu;
- }
- }
-
- return {menu_to_show: menu_to_show, menu_props: menu_props};
- };
-
- var fillViewMenuProps = function(selectedElements) {
- if (!selectedElements || !_.isArray(selectedElements)) return;
-
- if (!me.viewModeMenu)
- me.createDelayedElementsViewer();
-
- var menu_props = {},
- menu_to_show = null;
- _.each(selectedElements, function(element, index) {
- var elType = element.get_ObjectType(),
- elValue = element.get_ObjectValue();
-
- if (Asc.c_oAscTypeSelectElement.Image == elType || Asc.c_oAscTypeSelectElement.Table == elType || Asc.c_oAscTypeSelectElement.Shape == elType ||
- Asc.c_oAscTypeSelectElement.Chart == elType || Asc.c_oAscTypeSelectElement.Paragraph == elType) {
- menu_to_show = me.viewModeMenu;
- menu_props.locked = menu_props.locked || ((elValue) ? elValue.get_Locked() : false);
- if (Asc.c_oAscTypeSelectElement.Chart == elType)
- menu_props.isChart = true;
- }
- else if (Asc.c_oAscTypeSelectElement.Slide == elType) {
- menu_props.locked = menu_props.locked || ((elValue) ? elValue.get_LockDelete() : false);
- }
- });
-
- return (menu_to_show) ? {menu_to_show: menu_to_show, menu_props: menu_props} : null;
- };
-
- var showObjectMenu = function(event, docElement, eOpts){
- if (me.api){
- var obj = (me.mode.isEdit && !me._isDisabled) ? fillMenuProps(me.api.getSelectedElements()) : fillViewMenuProps(me.api.getSelectedElements());
- if (obj) showPopupMenu(obj.menu_to_show, obj.menu_props, event, docElement, eOpts);
- }
- };
-
- var onContextMenu = function(event){
- if (Common.UI.HintManager.isHintVisible())
- Common.UI.HintManager.clearHints();
- _.delay(function(){
- if (event.get_Type() == Asc.c_oAscContextMenuTypes.Thumbnails) {
- showPopupMenu.call(me, (me.mode.isEdit && !me._isDisabled) ? me.slideMenu : me.viewModeMenuSlide, {isSlideSelect: event.get_IsSlideSelect(), isSlideHidden: event.get_IsSlideHidden(), fromThumbs: true}, event);
- } else {
- showObjectMenu.call(me, event);
- }
- },10);
- };
-
- var onFocusObject = function(selectedElements) {
- if (me.currentMenu && me.currentMenu.isVisible()){
- if (me.api.asc_getCurrentFocusObject() === 0 ){ // thumbnails
- if (me.slideMenu===me.currentMenu && !me._isDisabled) {
- var isHidden = false;
- _.each(selectedElements, function(element, index) {
- if (Asc.c_oAscTypeSelectElement.Slide == element.get_ObjectType()) {
- isHidden = element.get_ObjectValue().get_IsHidden();
- }
- });
-
- me.currentMenu.options.initMenu({isSlideSelect: me.slideMenu.items[2].isVisible(), isSlideHidden: isHidden, fromThumbs: true});
- me.currentMenu.alignPosition();
- }
- } else {
- var obj = (me.mode.isEdit && !me._isDisabled) ? fillMenuProps(selectedElements) : fillViewMenuProps(selectedElements);
- if (obj) {
- if (obj.menu_to_show===me.currentMenu) {
- me.currentMenu.options.initMenu(obj.menu_props);
- me.currentMenu.alignPosition();
- }
- }
- }
- }
- };
-
- var handleDocumentWheel = function(event){
- if (me.api) {
- var delta = (_.isUndefined(event.originalEvent)) ? event.wheelDelta : event.originalEvent.wheelDelta;
- if (_.isUndefined(delta)) {
- delta = event.deltaY;
- }
-
- if ((event.ctrlKey || event.metaKey) && !event.altKey){
- if (delta < 0)
- me.api.zoomOut();
- else if (delta > 0)
- me.api.zoomIn();
-
- event.preventDefault();
- event.stopPropagation();
- }
- }
- };
-
- var handleDocumentKeyDown = function(event){
- if (me.api){
- var key = event.keyCode;
- if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){
- if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isGecko && key === Common.UI.Keys.EQUALITY_FF) || (Common.Utils.isOpera && key == 43)){
- me.api.zoomIn();
- event.preventDefault();
- event.stopPropagation();
- return false;
- }
- else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isGecko && key === Common.UI.Keys.MINUS_FF) || (Common.Utils.isOpera && key == 45)){
- me.api.zoomOut();
- event.preventDefault();
- event.stopPropagation();
- return false;
- } else if (key === 48 || key === 96) {// 0
- me.api.zoomFitToPage();
- event.preventDefault();
- event.stopPropagation();
- return false;
- }
- }
- if (me.currentMenu && me.currentMenu.isVisible()) {
- if (key == Common.UI.Keys.UP ||
- key == Common.UI.Keys.DOWN) {
- $('ul.dropdown-menu', me.currentMenu.el).focus();
- }
- }
- if (key == Common.UI.Keys.ESC) {
- Common.UI.Menu.Manager.hideAll();
- if (!Common.UI.HintManager.isHintVisible())
- Common.NotificationCenter.trigger('leftmenu:change', 'hide');
- }
- }
- };
-
- var onDocumentHolderResize = function(){
- me._Height = me.cmpEl.height();
- me._Width = me.cmpEl.width();
- me._BodyWidth = $('body').width();
- me._XY = undefined;
-
- if (me.slideNumDiv) {
- me.slideNumDiv.remove();
- me.slideNumDiv = undefined;
- }
- };
-
- var onAfterRender = function(ct){
- var meEl = me.cmpEl;
- if (meEl) {
- meEl.on('contextmenu', function(e) {
- e.preventDefault();
- e.stopPropagation();
- return false;
- });
- meEl.on('click', function(e){
- if (e.target.localName == 'canvas') {
- if (me._preventClick)
- me._preventClick = false;
- else
- meEl.focus();
- }
- });
- meEl.on('mousedown', function(e){
- if (e.target.localName == 'canvas')
- Common.UI.Menu.Manager.hideAll();
- });
-
- //NOTE: set mouse wheel handler
-
- var addEvent = function( elem, type, fn ) {
- elem.addEventListener ? elem.addEventListener( type, fn, false ) : elem.attachEvent( "on" + type, fn );
- };
-
- var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel';
- addEvent(me.el, eventname, handleDocumentWheel);
- }
-
- !Common.Utils.isChrome ? $(document).on('mousewheel', handleDocumentWheel) :
- document.addEventListener('mousewheel', handleDocumentWheel, {passive: false});
- $(document).on('keydown', handleDocumentKeyDown);
- $(window).on('resize', onDocumentHolderResize);
- var viewport = PE.getController('Viewport').getView('Viewport');
- viewport.hlayout.on('layout:resizedrag', onDocumentHolderResize);
- };
-
- /** coauthoring begin **/
- var getUserName = function(id){
- if (usersStore){
- var rec = usersStore.findUser(id);
- if (rec)
- return AscCommon.UserInfoParser.getParsedName(rec.get('username'));
- }
- return me.guestText;
- };
- var isUserVisible = function(id){
- if (usersStore){
- var rec = usersStore.findUser(id);
- if (rec)
- return !rec.get('hidden');
- }
- return true;
- };
- /** coauthoring end **/
-
- var screenTip = {
- toolTip: new Common.UI.Tooltip({
- owner: this,
- html: true,
- title: '
Press Ctrl and click link'
-// style: 'word-wrap: break-word;'
- }),
- strTip: '',
- isHidden: true,
- isVisible: false
- };
-
- /** coauthoring begin **/
- var userTooltip = true;
-
- var userTipMousover = function (evt, el, opt) {
- if (userTooltip===true) {
- userTooltip = new Common.UI.Tooltip({
- owner: evt.currentTarget,
- title: me.tipIsLocked
- });
-
- userTooltip.show();
- }
- };
-
- var userTipHide = function () {
- if (typeof userTooltip == 'object') {
- userTooltip.hide();
- userTooltip = undefined;
-
- for (var i=0; i
0)
- window.open(url);
- else
- Common.UI.warning({
- msg: me.txtWarnUrl,
- buttons: ['yes', 'no'],
- primary: 'yes',
- callback: function(btn) {
- (btn == 'yes') && window.open(url);
- }
- });
- }
- };
-
- var onMouseMoveStart = function() {
- screenTip.isHidden = true;
- /** coauthoring begin **/
- if (me.usertips.length>0) {
- if (typeof userTooltip == 'object') {
- userTooltip.hide();
- userTooltip = true;
- }
- _.each(me.usertips, function(item) {
- item.remove();
- });
- }
- me.usertips = [];
- me.usertipcount = 0;
- /** coauthoring end **/
- };
-
- var onMouseMoveEnd = function() {
- if (screenTip.isHidden && screenTip.isVisible) {
- screenTip.isVisible = false;
- screenTip.toolTip.hide();
- }
- };
-
- var onMouseMove = function(moveData) {
- if (_.isUndefined(me._XY)) {
- me._XY = [
- me.cmpEl.offset().left - $(window).scrollLeft(),
- me.cmpEl.offset().top - $(window).scrollTop()
- ];
- me._Width = me.cmpEl.width();
- me._Height = me.cmpEl.height();
- me._BodyWidth = $('body').width();
- }
-
- if (moveData) {
- var showPoint, ToolTip;
-
- if (moveData.get_Type()==1) { // 1 - hyperlink
- var hyperProps = moveData.get_Hyperlink();
- var recalc = false;
- if (hyperProps) {
- screenTip.isHidden = false;
-
- ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip();
- ToolTip = Common.Utils.String.htmlEncode(ToolTip);
- if (ToolTip.length>256)
- ToolTip = ToolTip.substr(0, 256) + '...';
-
- if (screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) {
- screenTip.toolTip.setTitle(ToolTip + (me.isPreviewVisible ? '' : '
' + me.txtPressLink + ''));
- screenTip.tipLength = ToolTip.length;
- screenTip.strTip = ToolTip;
- recalc = true;
- }
-
- showPoint = [moveData.get_X(), moveData.get_Y()];
- showPoint[1] += ((me.isPreviewVisible ? 0 : me._XY[1])-15);
- showPoint[0] += ((me.isPreviewVisible ? 0 : me._XY[0])+5);
-
- if (!screenTip.isVisible || recalc) {
- screenTip.isVisible = true;
- screenTip.toolTip.show([-10000, -10000]);
- }
-
- if ( recalc ) {
- screenTip.tipHeight = screenTip.toolTip.getBSTip().$tip.height();
- screenTip.tipWidth = screenTip.toolTip.getBSTip().$tip.width();
- }
- showPoint[1] -= screenTip.tipHeight;
- if (showPoint[1]<0)
- showPoint[1] = 0;
- if (showPoint[0] + screenTip.tipWidth > me._BodyWidth )
- showPoint[0] = me._BodyWidth - screenTip.tipWidth;
- screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'});
- }
- }
- /** coauthoring begin **/
- else if (moveData.get_Type()==2 && me.mode.isEdit && isUserVisible(moveData.get_UserId())) { // 2 - locked object
- var src;
- if (me.usertipcount >= me.usertips.length) {
- src = $(document.createElement("div"));
- src.addClass('username-tip');
- src.css({height: me._TtHeight + 'px', position: 'absolute', zIndex: '900', visibility: 'visible'});
- $(document.body).append(src);
- if (userTooltip) {
- src.on('mouseover', userTipMousover);
- src.on('mouseout', userTipMousout);
- }
-
- me.usertips.push(src);
- }
- src = me.usertips[me.usertipcount];
- me.usertipcount++;
-
- ToolTip = getUserName(moveData.get_UserId());
-
- showPoint = [moveData.get_X()+me._XY[0], moveData.get_Y()+me._XY[1]];
- var maxwidth = showPoint[0];
- showPoint[0] = me._BodyWidth - showPoint[0];
- showPoint[1] -= ((moveData.get_LockedObjectType()==2) ? me._TtHeight : 0);
-
- if (showPoint[1] > me._XY[1] && showPoint[1]+me._TtHeight < me._XY[1]+me._Height) {
- src.text(ToolTip);
- src.css({visibility: 'visible', top: showPoint[1] + 'px', right: showPoint[0] + 'px', 'max-width': maxwidth + 'px'});
- }
- }
- /** coauthoring end **/
- }
- };
-
- var onShowForeignCursorLabel = function(UserId, X, Y, color) {
- if (!isUserVisible(UserId)) return;
-
- /** coauthoring begin **/
- var src;
- for (var i=0; i-1) && !menu.items[index].checked && menu.setChecked(index, true);
- }
- };
-
- var onSpellCheckVariantsFound = function() {
- var selectedElements = me.api.getSelectedElements(true);
- var props;
- if (selectedElements && _.isArray(selectedElements)){
- for (var i = 0; i 0) {
- moreMenu.setVisible(variants.length > 3);
- moreMenu.setDisabled(me._currentParaObjDisabled);
-
- _.each(variants, function(variant, index) {
- var mnu = new Common.UI.MenuItem({
- caption : variant,
- spellword : true,
- disabled : me._currentParaObjDisabled
- }).on('click', function(item, e) {
- if (me.api) {
- me.api.asc_replaceMisspelledWord(item.caption, me._currentSpellObj);
- me.fireEvent('editcomplete', me);
- }
- });
-
- (index < 3) ? arr.push(mnu) : arrMore.push(mnu);
- });
-
- if (arr.length > 0) {
- if (isParagraph) {
- _.each(arr, function(variant, index){
- me.textMenu.insertItem(index, variant);
- })
- } else {
- _.each(arr, function(variant, index){
- me.menuSpellCheckTable.menu.insertItem(index, variant);
- })
- }
- }
-
- if (arrMore.length > 0) {
- _.each(arrMore, function(variant, index){
- moreMenu.menu.addItem(variant);
- });
- }
-
- spellMenu.setVisible(false);
- } else {
- moreMenu.setVisible(false);
- spellMenu.setVisible(true);
- spellMenu.setCaption(me.noSpellVariantsText, true);
- }
- };
-
- this.clearWordVariants = function(isParagraph) {
- var spellMenu = (isParagraph) ? me.textMenu : me.menuSpellCheckTable.menu;
-
- for (var i = 0; i < spellMenu.items.length; i++) {
- if (spellMenu.items[i].options.spellword) {
- if (spellMenu.checkeditem == spellMenu.items[i]) {
- spellMenu.checkeditem = undefined;
- spellMenu.activeItem = undefined;
- }
-
- spellMenu.removeItem(spellMenu.items[i]);
- i--;
- }
- }
- (isParagraph) ? me.menuSpellMorePara.menu.removeAll() : me.menuSpellMoreTable.menu.removeAll();
-
- me.menuSpellMorePara.menu.checkeditem = undefined;
- me.menuSpellMorePara.menu.activeItem = undefined;
- me.menuSpellMoreTable.menu.checkeditem = undefined;
- me.menuSpellMoreTable.menu.activeItem = undefined;
- };
-
- this.initEquationMenu = function() {
- if (!me._currentMathObj) return;
- var type = me._currentMathObj.get_Type(),
- value = me._currentMathObj,
- mnu, arr = [];
-
- switch (type) {
- case Asc.c_oAscMathInterfaceType.Accent:
- mnu = new Common.UI.MenuItem({
- caption : me.txtRemoveAccentChar,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'remove_AccentCharacter'}
- });
- arr.push(mnu);
- break;
- case Asc.c_oAscMathInterfaceType.BorderBox:
- mnu = new Common.UI.MenuItem({
- caption : me.txtBorderProps,
- equation : true,
- disabled : me._currentParaObjDisabled,
- menu : new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items : [
- {
- caption: value.get_HideTop() ? me.txtAddTop : me.txtHideTop,
- equationProps: {type: type, callback: 'put_HideTop', value: !value.get_HideTop()}
- },
- {
- caption: value.get_HideBottom() ? me.txtAddBottom : me.txtHideBottom,
- equationProps: {type: type, callback: 'put_HideBottom', value: !value.get_HideBottom()}
- },
- {
- caption: value.get_HideLeft() ? me.txtAddLeft : me.txtHideLeft,
- equationProps: {type: type, callback: 'put_HideLeft', value: !value.get_HideLeft()}
- },
- {
- caption: value.get_HideRight() ? me.txtAddRight : me.txtHideRight,
- equationProps: {type: type, callback: 'put_HideRight', value: !value.get_HideRight()}
- },
- {
- caption: value.get_HideHor() ? me.txtAddHor : me.txtHideHor,
- equationProps: {type: type, callback: 'put_HideHor', value: !value.get_HideHor()}
- },
- {
- caption: value.get_HideVer() ? me.txtAddVer : me.txtHideVer,
- equationProps: {type: type, callback: 'put_HideVer', value: !value.get_HideVer()}
- },
- {
- caption: value.get_HideTopLTR() ? me.txtAddLT : me.txtHideLT,
- equationProps: {type: type, callback: 'put_HideTopLTR', value: !value.get_HideTopLTR()}
- },
- {
- caption: value.get_HideTopRTL() ? me.txtAddLB : me.txtHideLB,
- equationProps: {type: type, callback: 'put_HideTopRTL', value: !value.get_HideTopRTL()}
- }
- ]
- })
- });
- arr.push(mnu);
- break;
- case Asc.c_oAscMathInterfaceType.Bar:
- mnu = new Common.UI.MenuItem({
- caption : me.txtRemoveBar,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'remove_Bar'}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? me.txtUnderbar : me.txtOverbar,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? Asc.c_oAscMathInterfaceBarPos.Bottom : Asc.c_oAscMathInterfaceBarPos.Top}
- });
- arr.push(mnu);
- break;
- case Asc.c_oAscMathInterfaceType.Script:
- var scripttype = value.get_ScriptType();
- if (scripttype == Asc.c_oAscMathInterfaceScript.PreSubSup) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtScriptsAfter,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.SubSup}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.txtRemScripts,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.None}
- });
- arr.push(mnu);
- } else {
- if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtScriptsBefore,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.PreSubSup}
- });
- arr.push(mnu);
- }
- if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sub ) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtRemSubscript,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sup : Asc.c_oAscMathInterfaceScript.None }
- });
- arr.push(mnu);
- }
- if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sup ) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtRemSuperscript,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sub : Asc.c_oAscMathInterfaceScript.None }
- });
- arr.push(mnu);
- }
- }
- break;
- case Asc.c_oAscMathInterfaceType.Fraction:
- var fraction = value.get_FractionType();
- if (fraction==Asc.c_oAscMathInterfaceFraction.Skewed || fraction==Asc.c_oAscMathInterfaceFraction.Linear) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtFractionStacked,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Bar}
- });
- arr.push(mnu);
- }
- if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Linear) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtFractionSkewed,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Skewed}
- });
- arr.push(mnu);
- }
- if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Skewed) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtFractionLinear,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Linear}
- });
- arr.push(mnu);
- }
- if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.NoBar) {
- mnu = new Common.UI.MenuItem({
- caption : (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? me.txtRemFractionBar : me.txtAddFractionBar,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_FractionType', value: (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? Asc.c_oAscMathInterfaceFraction.NoBar : Asc.c_oAscMathInterfaceFraction.Bar}
- });
- arr.push(mnu);
- }
- break;
- case Asc.c_oAscMathInterfaceType.Limit:
- mnu = new Common.UI.MenuItem({
- caption : (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? me.txtLimitUnder : me.txtLimitOver,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? Asc.c_oAscMathInterfaceLimitPos.Bottom : Asc.c_oAscMathInterfaceLimitPos.Top}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.txtRemLimit,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceLimitPos.None}
- });
- arr.push(mnu);
- break;
- case Asc.c_oAscMathInterfaceType.Matrix:
- mnu = new Common.UI.MenuItem({
- caption : value.get_HidePlaceholder() ? me.txtShowPlaceholder : me.txtHidePlaceholder,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_HidePlaceholder', value: !value.get_HidePlaceholder()}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.insertText,
- equation : true,
- disabled : me._currentParaObjDisabled,
- menu : new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items : [
- {
- caption: me.insertRowAboveText,
- equationProps: {type: type, callback: 'insert_MatrixRow', value: true}
- },
- {
- caption: me.insertRowBelowText,
- equationProps: {type: type, callback: 'insert_MatrixRow', value: false}
- },
- {
- caption: me.insertColumnLeftText,
- equationProps: {type: type, callback: 'insert_MatrixColumn', value: true}
- },
- {
- caption: me.insertColumnRightText,
- equationProps: {type: type, callback: 'insert_MatrixColumn', value: false}
- }
- ]
- })
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.deleteText,
- equation : true,
- disabled : me._currentParaObjDisabled,
- menu : new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items : [
- {
- caption: me.deleteRowText,
- equationProps: {type: type, callback: 'delete_MatrixRow'}
- },
- {
- caption: me.deleteColumnText,
- equationProps: {type: type, callback: 'delete_MatrixColumn'}
- }
- ]
- })
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.txtMatrixAlign,
- equation : true,
- disabled : me._currentParaObjDisabled,
- menu : new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items : [
- {
- caption: me.txtTop,
- checkable : true,
- checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top),
- equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top}
- },
- {
- caption: me.centerText,
- checkable : true,
- checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center),
- equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center}
- },
- {
- caption: me.txtBottom,
- checkable : true,
- checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom),
- equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom}
- }
- ]
- })
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.txtColumnAlign,
- equation : true,
- disabled : me._currentParaObjDisabled,
- menu : new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items : [
- {
- caption: me.leftText,
- checkable : true,
- checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Left),
- equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Left}
- },
- {
- caption: me.centerText,
- checkable : true,
- checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Center),
- equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Center}
- },
- {
- caption: me.rightText,
- checkable : true,
- checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Right),
- equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Right}
- }
- ]
- })
- });
- arr.push(mnu);
- break;
- case Asc.c_oAscMathInterfaceType.EqArray:
- mnu = new Common.UI.MenuItem({
- caption : me.txtInsertEqBefore,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'insert_Equation', value: true}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.txtInsertEqAfter,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'insert_Equation', value: false}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.txtDeleteEq,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'delete_Equation'}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.alignmentText,
- equation : true,
- disabled : me._currentParaObjDisabled,
- menu : new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items : [
- {
- caption: me.txtTop,
- checkable : true,
- checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Top),
- equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Top}
- },
- {
- caption: me.centerText,
- checkable : true,
- checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Center),
- equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Center}
- },
- {
- caption: me.txtBottom,
- checkable : true,
- checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Bottom),
- equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Bottom}
- }
- ]
- })
- });
- arr.push(mnu);
- break;
- case Asc.c_oAscMathInterfaceType.LargeOperator:
- mnu = new Common.UI.MenuItem({
- caption : me.txtLimitChange,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_LimitLocation', value: (value.get_LimitLocation() == Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr) ? Asc.c_oAscMathInterfaceNaryLimitLocation.SubSup : Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr}
- });
- arr.push(mnu);
- if (value.get_HideUpper() !== undefined) {
- mnu = new Common.UI.MenuItem({
- caption : value.get_HideUpper() ? me.txtShowTopLimit : me.txtHideTopLimit,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_HideUpper', value: !value.get_HideUpper()}
- });
- arr.push(mnu);
- }
- if (value.get_HideLower() !== undefined) {
- mnu = new Common.UI.MenuItem({
- caption : value.get_HideLower() ? me.txtShowBottomLimit : me.txtHideBottomLimit,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_HideLower', value: !value.get_HideLower()}
- });
- arr.push(mnu);
- }
- break;
- case Asc.c_oAscMathInterfaceType.Delimiter:
- mnu = new Common.UI.MenuItem({
- caption : me.txtInsertArgBefore,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'insert_DelimiterArgument', value: true}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.txtInsertArgAfter,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'insert_DelimiterArgument', value: false}
- });
- arr.push(mnu);
- if (value.can_DeleteArgument()) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtDeleteArg,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'delete_DelimiterArgument'}
- });
- arr.push(mnu);
- }
- mnu = new Common.UI.MenuItem({
- caption : value.has_Separators() ? me.txtDeleteCharsAndSeparators : me.txtDeleteChars,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'remove_DelimiterCharacters'}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : value.get_HideOpeningBracket() ? me.txtShowOpenBracket : me.txtHideOpenBracket,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_HideOpeningBracket', value: !value.get_HideOpeningBracket()}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : value.get_HideClosingBracket() ? me.txtShowCloseBracket : me.txtHideCloseBracket,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_HideClosingBracket', value: !value.get_HideClosingBracket()}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.txtStretchBrackets,
- equation : true,
- disabled : me._currentParaObjDisabled,
- checkable : true,
- checked : value.get_StretchBrackets(),
- equationProps: {type: type, callback: 'put_StretchBrackets', value: !value.get_StretchBrackets()}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.txtMatchBrackets,
- equation : true,
- disabled : (!value.get_StretchBrackets() || me._currentParaObjDisabled),
- checkable : true,
- checked : value.get_StretchBrackets() && value.get_MatchBrackets(),
- equationProps: {type: type, callback: 'put_MatchBrackets', value: !value.get_MatchBrackets()}
- });
- arr.push(mnu);
- break;
- case Asc.c_oAscMathInterfaceType.GroupChar:
- if (value.can_ChangePos()) {
- mnu = new Common.UI.MenuItem({
- caption : (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? me.txtGroupCharUnder : me.txtGroupCharOver,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? Asc.c_oAscMathInterfaceGroupCharPos.Bottom : Asc.c_oAscMathInterfaceGroupCharPos.Top}
- });
- arr.push(mnu);
- mnu = new Common.UI.MenuItem({
- caption : me.txtDeleteGroupChar,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceGroupCharPos.None}
- });
- arr.push(mnu);
- }
- break;
- case Asc.c_oAscMathInterfaceType.Radical:
- if (value.get_HideDegree() !== undefined) {
- mnu = new Common.UI.MenuItem({
- caption : value.get_HideDegree() ? me.txtShowDegree : me.txtHideDegree,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'put_HideDegree', value: !value.get_HideDegree()}
- });
- arr.push(mnu);
- }
- mnu = new Common.UI.MenuItem({
- caption : me.txtDeleteRadical,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'remove_Radical'}
- });
- arr.push(mnu);
- break;
- }
- if (value.can_IncreaseArgumentSize()) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtIncreaseArg,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'increase_ArgumentSize'}
- });
- arr.push(mnu);
- }
- if (value.can_DecreaseArgumentSize()) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtDecreaseArg,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'decrease_ArgumentSize'}
- });
- arr.push(mnu);
- }
- if (value.can_InsertManualBreak()) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtInsertBreak,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'insert_ManualBreak'}
- });
- arr.push(mnu);
- }
- if (value.can_DeleteManualBreak()) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtDeleteBreak,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'delete_ManualBreak'}
- });
- arr.push(mnu);
- }
- if (value.can_AlignToCharacter()) {
- mnu = new Common.UI.MenuItem({
- caption : me.txtAlignToChar,
- equation : true,
- disabled : me._currentParaObjDisabled,
- equationProps: {type: type, callback: 'align_ToCharacter'}
- });
- arr.push(mnu);
- }
- return arr;
- };
-
- this.addEquationMenu = function(isParagraph, insertIdx) {
- if (_.isUndefined(isParagraph)) {
- isParagraph = me.textMenu.isVisible();
- }
-
- me.clearEquationMenu(isParagraph, insertIdx);
-
- var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu,
- menuItems = me.initEquationMenu();
-
- if (menuItems.length > 0) {
- _.each(menuItems, function(menuItem, index) {
- if (menuItem.menu) {
- _.each(menuItem.menu.items, function(item) {
- item.on('click', _.bind(me.equationCallback, me, item.options.equationProps));
- });
- } else
- menuItem.on('click', _.bind(me.equationCallback, me, menuItem.options.equationProps));
- equationMenu.insertItem(insertIdx, menuItem);
- insertIdx++;
- });
- }
- return menuItems.length;
- };
-
- this.clearEquationMenu = function(isParagraph, insertIdx) {
- var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu;
- for (var i = insertIdx; i < equationMenu.items.length; i++) {
- if (equationMenu.items[i].options.equation) {
- if (equationMenu.items[i].menu) {
- _.each(equationMenu.items[i].menu.items, function(item) {
- item.off('click');
- });
- } else
- equationMenu.items[i].off('click');
- equationMenu.removeItem(equationMenu.items[i]);
- i--;
- } else
- break;
- }
- };
-
- this.equationCallback = function(eqProps) {
- if (eqProps) {
- var eqObj;
- switch (eqProps.type) {
- case Asc.c_oAscMathInterfaceType.Accent:
- eqObj = new CMathMenuAccent();
- break;
- case Asc.c_oAscMathInterfaceType.BorderBox:
- eqObj = new CMathMenuBorderBox();
- break;
- case Asc.c_oAscMathInterfaceType.Box:
- eqObj = new CMathMenuBox();
- break;
- case Asc.c_oAscMathInterfaceType.Bar:
- eqObj = new CMathMenuBar();
- break;
- case Asc.c_oAscMathInterfaceType.Script:
- eqObj = new CMathMenuScript();
- break;
- case Asc.c_oAscMathInterfaceType.Fraction:
- eqObj = new CMathMenuFraction();
- break;
- case Asc.c_oAscMathInterfaceType.Limit:
- eqObj = new CMathMenuLimit();
- break;
- case Asc.c_oAscMathInterfaceType.Matrix:
- eqObj = new CMathMenuMatrix();
- break;
- case Asc.c_oAscMathInterfaceType.EqArray:
- eqObj = new CMathMenuEqArray();
- break;
- case Asc.c_oAscMathInterfaceType.LargeOperator:
- eqObj = new CMathMenuNary();
- break;
- case Asc.c_oAscMathInterfaceType.Delimiter:
- eqObj = new CMathMenuDelimiter();
- break;
- case Asc.c_oAscMathInterfaceType.GroupChar:
- eqObj = new CMathMenuGroupCharacter();
- break;
- case Asc.c_oAscMathInterfaceType.Radical:
- eqObj = new CMathMenuRadical();
- break;
- case Asc.c_oAscMathInterfaceType.Common:
- eqObj = new CMathMenuBase();
- break;
- }
- if (eqObj) {
- eqObj[eqProps.callback](eqProps.value);
- me.api.asc_SetMathProps(eqObj);
- }
- }
- me.fireEvent('editcomplete', me);
- };
-
- this.changePosition = function() {
- me._XY = [
- me.cmpEl.offset().left - $(window).scrollLeft(),
- me.cmpEl.offset().top - $(window).scrollTop()
- ];
- onMouseMoveStart();
- };
-
- this.hideTips = function() {
- /** coauthoring begin **/
- if (typeof userTooltip == 'object') {
- userTooltip.hide();
- userTooltip = true;
- }
- _.each(me.usertips, function(item) {
- item.remove();
- });
- me.usertips = [];
- me.usertipcount = 0;
- /** coauthoring end **/
- };
-
- /** coauthoring begin **/
- // Hotkeys
- // ---------------------
- var keymap = {};
- var hkComments = 'alt+h';
- keymap[hkComments] = function() {
- if (me.api.can_AddQuotedComment()!==false && me.slidesCount>0) {
- me.addComment();
- }
- };
-
- var hkPreview = 'command+f5,ctrl+f5';
- keymap[hkPreview] = function(e) {
- var isResized = false;
- e.preventDefault();
- e.stopPropagation();
- if (me.slidesCount>0) {
- Common.NotificationCenter.trigger('preview:start', 0);
- }
- };
- Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap});
-
- var onApiStartDemonstration = function() {
- if (me.slidesCount>0) {
- Common.NotificationCenter.trigger('preview:start', 0, null, true);
- }
- };
-
- /** coauthoring end **/
-
- var onApiCountPages = function(count) {
- me.slidesCount = count;
- };
-
- var onApiCurrentPages = function(number) {
- if (me.currentMenu && me.currentMenu.isVisible() && me._isFromSlideMenu !== true && me._isFromSlideMenu !== number)
- setTimeout(function() {
- me.currentMenu && me.currentMenu.hide();
- }, 1);
-
- me._isFromSlideMenu = number;
- };
-
- var onApiUpdateThemeIndex = function(v) {
- me._state.themeId = v;
- };
-
- var onApiLockDocumentTheme = function() {
- me._state.themeLock = true;
- };
-
- var onApiUnLockDocumentTheme = function() {
- me._state.themeLock = false;
- };
-
- var onShowSpecialPasteOptions = function(specialPasteShowOptions) {
- var coord = specialPasteShowOptions.asc_getCellCoord(),
- pasteContainer = me.cmpEl.find('#special-paste-container'),
- pasteItems = specialPasteShowOptions.asc_getOptions();
- if (!pasteItems) return;
-
- // Prepare menu container
- if (pasteContainer.length < 1) {
- me._arrSpecialPaste = [];
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.paste] = me.textPaste;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.keepTextOnly] = me.txtKeepTextOnly;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.picture] = me.txtPastePicture;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.sourceformatting] = me.txtPasteSourceFormat;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.destinationFormatting] = me.txtPasteDestFormat;
-
-
- pasteContainer = $('');
- me.cmpEl.append(pasteContainer);
-
- me.btnSpecialPaste = new Common.UI.Button({
- parentEl: $('#id-document-holder-btn-special-paste'),
- cls : 'btn-toolbar',
- iconCls : 'toolbar__icon btn-paste',
- menu : new Common.UI.Menu({items: []})
- });
- }
-
- if (pasteItems.length>0) {
- var menu = me.btnSpecialPaste.menu;
- for (var i = 0; i < menu.items.length; i++) {
- menu.removeItem(menu.items[i]);
- i--;
- }
-
- var group_prev = -1;
- _.each(pasteItems, function(menuItem, index) {
- var mnu = new Common.UI.MenuItem({
- caption: me._arrSpecialPaste[menuItem],
- value: menuItem,
- checkable: true,
- toggleGroup : 'specialPasteGroup'
- }).on('click', function(item, e) {
- me.api.asc_SpecialPaste(item.value);
- setTimeout(function(){menu.hide();}, 100);
- });
- menu.addItem(mnu);
- });
- (menu.items.length>0) && menu.items[0].setChecked(true, true);
- }
- if (coord.asc_getX()<0 || coord.asc_getY()<0) {
- if (pasteContainer.is(':visible')) pasteContainer.hide();
- } else {
- var showPoint = [coord.asc_getX() + coord.asc_getWidth() + 3, coord.asc_getY() + coord.asc_getHeight() + 3];
- pasteContainer.css({left: showPoint[0], top : showPoint[1]});
- pasteContainer.show();
- }
- };
-
- var onHideSpecialPasteOptions = function() {
- var pasteContainer = me.cmpEl.find('#special-paste-container');
- if (pasteContainer.is(':visible'))
- pasteContainer.hide();
- };
-
- var onChangeCropState = function(state) {
- this.menuImgCrop.menu.items[0].setChecked(state, true);
- };
-
- this.setApi = function(o) {
- me.api = o;
-
- if (me.api) {
- me.api.asc_registerCallback('asc_onContextMenu', _.bind(onContextMenu, me));
- me.api.asc_registerCallback('asc_onMouseMoveStart', _.bind(onMouseMoveStart, me));
- me.api.asc_registerCallback('asc_onMouseMoveEnd', _.bind(onMouseMoveEnd, me));
- me.api.asc_registerCallback('asc_onPaintSlideNum', _.bind(onPaintSlideNum, me));
- me.api.asc_registerCallback('asc_onEndPaintSlideNum', _.bind(onEndPaintSlideNum, me));
- me.api.asc_registerCallback('asc_onCountPages', _.bind(onApiCountPages, me));
- me.api.asc_registerCallback('asc_onCurrentPage', _.bind(onApiCurrentPages, me));
- me.slidesCount = me.api.getCountPages();
-
- //hyperlink
- me.api.asc_registerCallback('asc_onHyperlinkClick', _.bind(onHyperlinkClick, me));
- me.api.asc_registerCallback('asc_onMouseMove', _.bind(onMouseMove, me));
-
- if (me.mode.isEdit===true) {
- me.api.asc_registerCallback('asc_onDialogAddHyperlink', _.bind(onDialogAddHyperlink, me));
- me.api.asc_registerCallback('asc_doubleClickOnChart', _.bind(me.editChartClick, me));
- me.api.asc_registerCallback('asc_doubleClickOnTableOleObject', _.bind(me.onDoubleClickOnTableOleObject, me));
- me.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, me));
- me.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(onShowSpecialPasteOptions, me));
- me.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(onHideSpecialPasteOptions, me));
- me.api.asc_registerCallback('asc_ChangeCropState', _.bind(onChangeCropState, me));
- me.api.asc_registerCallback('asc_onHidePlaceholderActions', _.bind(me.onHidePlaceholderActions, me));
- me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Image, _.bind(me.onInsertImage, me, true));
- me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.ImageUrl, _.bind(me.onInsertImageUrl, me, true));
- me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Chart, _.bind(me.onClickPlaceholderChart, me));
- me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Table, _.bind(me.onClickPlaceholderTable, me));
- me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Video, _.bind(me.onClickPlaceholder, me, AscCommon.PlaceholderButtonType.Video));
- me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Audio, _.bind(me.onClickPlaceholder, me, AscCommon.PlaceholderButtonType.Audio));
- }
- me.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(onCoAuthoringDisconnect, me));
- Common.NotificationCenter.on('api:disconnect', _.bind(onCoAuthoringDisconnect, me));
- me.api.asc_registerCallback('asc_onTextLanguage', _.bind(onTextLanguage, me));
-
- me.api.asc_registerCallback('asc_onShowForeignCursorLabel', _.bind(onShowForeignCursorLabel, me));
- me.api.asc_registerCallback('asc_onHideForeignCursorLabel', _.bind(onHideForeignCursorLabel, me));
- me.api.asc_registerCallback('asc_onFocusObject', _.bind(onFocusObject, me));
- me.api.asc_registerCallback('asc_onUpdateThemeIndex', _.bind(onApiUpdateThemeIndex, me));
- me.api.asc_registerCallback('asc_onLockDocumentTheme', _.bind(onApiLockDocumentTheme, me));
- me.api.asc_registerCallback('asc_onUnLockDocumentTheme', _.bind(onApiUnLockDocumentTheme, me));
- me.api.asc_registerCallback('asc_onStartDemonstration', _.bind(onApiStartDemonstration));
- }
-
- return me;
- };
-
- this.mode = {};
-
- this.setMode = function(mode) {
- me.mode = mode;
- /** coauthoring begin **/
- !(me.mode.canCoAuthoring && me.mode.canComments)
- ? Common.util.Shortcuts.suspendEvents(hkComments)
- : Common.util.Shortcuts.resumeEvents(hkComments);
- /** coauthoring end **/
-
- me.editorConfig = {user: mode.user};
- };
-
- me.on('render:after', onAfterRender, me);
},
render: function () {
@@ -1677,125 +76,693 @@ define([
return this;
},
+ setApi: function(o) {
+ this.api = o;
+ return this;
+ },
+
+ setMode: function(m) {
+ this.mode = m;
+ return this;
+ },
+
focus: function() {
var me = this;
_.defer(function(){ me.cmpEl.focus(); }, 50);
},
- addHyperlink: function(item){
- var win, me = this;
- if (me.api) {
- var _arr = [];
- for (var i=0; i-1) && !menu.items[index].checked && menu.setChecked(index, true);
+ }
+ },
+
+ addWordVariants: function(isParagraph) {
+ var me = this;
+ if (!me.textMenu || !me.textMenu.isVisible() && !me.tableMenu.isVisible()) return;
+
+ if (_.isUndefined(isParagraph)) {
+ isParagraph = me.textMenu.isVisible();
+ }
+
+ me.clearWordVariants(isParagraph);
+
+ var moreMenu = (isParagraph) ? me.menuSpellMorePara : me.menuSpellMoreTable;
+ var spellMenu = (isParagraph) ? me.menuSpellPara : me.menuSpellTable;
+ var arr = [],
+ arrMore = [];
+ var variants = me._currentSpellObj.get_Variants();
+
+ if (variants.length > 0) {
+ moreMenu.setVisible(variants.length > 3);
+ moreMenu.setDisabled(me._currentParaObjDisabled);
+
+ _.each(variants, function(variant, index) {
+ var mnu = new Common.UI.MenuItem({
+ caption : variant,
+ spellword : true,
+ disabled : me._currentParaObjDisabled
+ }).on('click', function(item, e) {
+ if (me.api) {
+ me.api.asc_replaceMisspelledWord(item.caption, me._currentSpellObj);
+ me.fireEvent('editcomplete', me);
+ }
+ });
+
+ (index < 3) ? arr.push(mnu) : arrMore.push(mnu);
+ });
+
+ if (arr.length > 0) {
+ if (isParagraph) {
+ _.each(arr, function(variant, index){
+ me.textMenu.insertItem(index, variant);
+ })
+ } else {
+ _.each(arr, function(variant, index){
+ me.menuSpellCheckTable.menu.insertItem(index, variant);
+ })
}
}
+
+ if (arrMore.length > 0) {
+ _.each(arrMore, function(variant, index){
+ moreMenu.menu.addItem(variant);
+ });
+ }
+
+ spellMenu.setVisible(false);
+ } else {
+ moreMenu.setVisible(false);
+ spellMenu.setVisible(true);
+ spellMenu.setCaption(me.noSpellVariantsText, true);
+ }
+ },
+
+ clearWordVariants: function(isParagraph) {
+ var me = this;
+ var spellMenu = (isParagraph) ? me.textMenu : me.menuSpellCheckTable.menu;
+
+ for (var i = 0; i < spellMenu.items.length; i++) {
+ if (spellMenu.items[i].options.spellword) {
+ if (spellMenu.checkeditem == spellMenu.items[i]) {
+ spellMenu.checkeditem = undefined;
+ spellMenu.activeItem = undefined;
+ }
+
+ spellMenu.removeItem(spellMenu.items[i]);
+ i--;
+ }
+ }
+ (isParagraph) ? me.menuSpellMorePara.menu.removeAll() : me.menuSpellMoreTable.menu.removeAll();
+
+ me.menuSpellMorePara.menu.checkeditem = undefined;
+ me.menuSpellMorePara.menu.activeItem = undefined;
+ me.menuSpellMoreTable.menu.checkeditem = undefined;
+ me.menuSpellMoreTable.menu.activeItem = undefined;
+ },
+
+ initEquationMenu: function() {
+ var me = this;
+ if (!me._currentMathObj) return;
+ var type = me._currentMathObj.get_Type(),
+ value = me._currentMathObj,
+ mnu, arr = [];
+
+ switch (type) {
+ case Asc.c_oAscMathInterfaceType.Accent:
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtRemoveAccentChar,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'remove_AccentCharacter'}
+ });
+ arr.push(mnu);
+ break;
+ case Asc.c_oAscMathInterfaceType.BorderBox:
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtBorderProps,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items : [
+ {
+ caption: value.get_HideTop() ? me.txtAddTop : me.txtHideTop,
+ equationProps: {type: type, callback: 'put_HideTop', value: !value.get_HideTop()}
+ },
+ {
+ caption: value.get_HideBottom() ? me.txtAddBottom : me.txtHideBottom,
+ equationProps: {type: type, callback: 'put_HideBottom', value: !value.get_HideBottom()}
+ },
+ {
+ caption: value.get_HideLeft() ? me.txtAddLeft : me.txtHideLeft,
+ equationProps: {type: type, callback: 'put_HideLeft', value: !value.get_HideLeft()}
+ },
+ {
+ caption: value.get_HideRight() ? me.txtAddRight : me.txtHideRight,
+ equationProps: {type: type, callback: 'put_HideRight', value: !value.get_HideRight()}
+ },
+ {
+ caption: value.get_HideHor() ? me.txtAddHor : me.txtHideHor,
+ equationProps: {type: type, callback: 'put_HideHor', value: !value.get_HideHor()}
+ },
+ {
+ caption: value.get_HideVer() ? me.txtAddVer : me.txtHideVer,
+ equationProps: {type: type, callback: 'put_HideVer', value: !value.get_HideVer()}
+ },
+ {
+ caption: value.get_HideTopLTR() ? me.txtAddLT : me.txtHideLT,
+ equationProps: {type: type, callback: 'put_HideTopLTR', value: !value.get_HideTopLTR()}
+ },
+ {
+ caption: value.get_HideTopRTL() ? me.txtAddLB : me.txtHideLB,
+ equationProps: {type: type, callback: 'put_HideTopRTL', value: !value.get_HideTopRTL()}
+ }
+ ]
+ })
+ });
+ arr.push(mnu);
+ break;
+ case Asc.c_oAscMathInterfaceType.Bar:
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtRemoveBar,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'remove_Bar'}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? me.txtUnderbar : me.txtOverbar,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? Asc.c_oAscMathInterfaceBarPos.Bottom : Asc.c_oAscMathInterfaceBarPos.Top}
+ });
+ arr.push(mnu);
+ break;
+ case Asc.c_oAscMathInterfaceType.Script:
+ var scripttype = value.get_ScriptType();
+ if (scripttype == Asc.c_oAscMathInterfaceScript.PreSubSup) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtScriptsAfter,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.SubSup}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtRemScripts,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.None}
+ });
+ arr.push(mnu);
+ } else {
+ if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtScriptsBefore,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.PreSubSup}
+ });
+ arr.push(mnu);
+ }
+ if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sub ) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtRemSubscript,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sup : Asc.c_oAscMathInterfaceScript.None }
+ });
+ arr.push(mnu);
+ }
+ if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sup ) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtRemSuperscript,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sub : Asc.c_oAscMathInterfaceScript.None }
+ });
+ arr.push(mnu);
+ }
+ }
+ break;
+ case Asc.c_oAscMathInterfaceType.Fraction:
+ var fraction = value.get_FractionType();
+ if (fraction==Asc.c_oAscMathInterfaceFraction.Skewed || fraction==Asc.c_oAscMathInterfaceFraction.Linear) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtFractionStacked,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Bar}
+ });
+ arr.push(mnu);
+ }
+ if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Linear) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtFractionSkewed,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Skewed}
+ });
+ arr.push(mnu);
+ }
+ if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Skewed) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtFractionLinear,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Linear}
+ });
+ arr.push(mnu);
+ }
+ if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.NoBar) {
+ mnu = new Common.UI.MenuItem({
+ caption : (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? me.txtRemFractionBar : me.txtAddFractionBar,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_FractionType', value: (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? Asc.c_oAscMathInterfaceFraction.NoBar : Asc.c_oAscMathInterfaceFraction.Bar}
+ });
+ arr.push(mnu);
+ }
+ break;
+ case Asc.c_oAscMathInterfaceType.Limit:
+ mnu = new Common.UI.MenuItem({
+ caption : (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? me.txtLimitUnder : me.txtLimitOver,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? Asc.c_oAscMathInterfaceLimitPos.Bottom : Asc.c_oAscMathInterfaceLimitPos.Top}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtRemLimit,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceLimitPos.None}
+ });
+ arr.push(mnu);
+ break;
+ case Asc.c_oAscMathInterfaceType.Matrix:
+ mnu = new Common.UI.MenuItem({
+ caption : value.get_HidePlaceholder() ? me.txtShowPlaceholder : me.txtHidePlaceholder,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_HidePlaceholder', value: !value.get_HidePlaceholder()}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.insertText,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items : [
+ {
+ caption: me.insertRowAboveText,
+ equationProps: {type: type, callback: 'insert_MatrixRow', value: true}
+ },
+ {
+ caption: me.insertRowBelowText,
+ equationProps: {type: type, callback: 'insert_MatrixRow', value: false}
+ },
+ {
+ caption: me.insertColumnLeftText,
+ equationProps: {type: type, callback: 'insert_MatrixColumn', value: true}
+ },
+ {
+ caption: me.insertColumnRightText,
+ equationProps: {type: type, callback: 'insert_MatrixColumn', value: false}
+ }
+ ]
+ })
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.deleteText,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items : [
+ {
+ caption: me.deleteRowText,
+ equationProps: {type: type, callback: 'delete_MatrixRow'}
+ },
+ {
+ caption: me.deleteColumnText,
+ equationProps: {type: type, callback: 'delete_MatrixColumn'}
+ }
+ ]
+ })
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtMatrixAlign,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items : [
+ {
+ caption: me.txtTop,
+ checkable : true,
+ checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top),
+ equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top}
+ },
+ {
+ caption: me.centerText,
+ checkable : true,
+ checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center),
+ equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center}
+ },
+ {
+ caption: me.txtBottom,
+ checkable : true,
+ checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom),
+ equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom}
+ }
+ ]
+ })
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtColumnAlign,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items : [
+ {
+ caption: me.leftText,
+ checkable : true,
+ checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Left),
+ equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Left}
+ },
+ {
+ caption: me.centerText,
+ checkable : true,
+ checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Center),
+ equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Center}
+ },
+ {
+ caption: me.rightText,
+ checkable : true,
+ checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Right),
+ equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Right}
+ }
+ ]
+ })
+ });
+ arr.push(mnu);
+ break;
+ case Asc.c_oAscMathInterfaceType.EqArray:
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtInsertEqBefore,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'insert_Equation', value: true}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtInsertEqAfter,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'insert_Equation', value: false}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtDeleteEq,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'delete_Equation'}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.alignmentText,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items : [
+ {
+ caption: me.txtTop,
+ checkable : true,
+ checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Top),
+ equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Top}
+ },
+ {
+ caption: me.centerText,
+ checkable : true,
+ checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Center),
+ equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Center}
+ },
+ {
+ caption: me.txtBottom,
+ checkable : true,
+ checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Bottom),
+ equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Bottom}
+ }
+ ]
+ })
+ });
+ arr.push(mnu);
+ break;
+ case Asc.c_oAscMathInterfaceType.LargeOperator:
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtLimitChange,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_LimitLocation', value: (value.get_LimitLocation() == Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr) ? Asc.c_oAscMathInterfaceNaryLimitLocation.SubSup : Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr}
+ });
+ arr.push(mnu);
+ if (value.get_HideUpper() !== undefined) {
+ mnu = new Common.UI.MenuItem({
+ caption : value.get_HideUpper() ? me.txtShowTopLimit : me.txtHideTopLimit,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_HideUpper', value: !value.get_HideUpper()}
+ });
+ arr.push(mnu);
+ }
+ if (value.get_HideLower() !== undefined) {
+ mnu = new Common.UI.MenuItem({
+ caption : value.get_HideLower() ? me.txtShowBottomLimit : me.txtHideBottomLimit,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_HideLower', value: !value.get_HideLower()}
+ });
+ arr.push(mnu);
+ }
+ break;
+ case Asc.c_oAscMathInterfaceType.Delimiter:
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtInsertArgBefore,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'insert_DelimiterArgument', value: true}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtInsertArgAfter,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'insert_DelimiterArgument', value: false}
+ });
+ arr.push(mnu);
+ if (value.can_DeleteArgument()) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtDeleteArg,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'delete_DelimiterArgument'}
+ });
+ arr.push(mnu);
+ }
+ mnu = new Common.UI.MenuItem({
+ caption : value.has_Separators() ? me.txtDeleteCharsAndSeparators : me.txtDeleteChars,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'remove_DelimiterCharacters'}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : value.get_HideOpeningBracket() ? me.txtShowOpenBracket : me.txtHideOpenBracket,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_HideOpeningBracket', value: !value.get_HideOpeningBracket()}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : value.get_HideClosingBracket() ? me.txtShowCloseBracket : me.txtHideCloseBracket,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_HideClosingBracket', value: !value.get_HideClosingBracket()}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtStretchBrackets,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ checkable : true,
+ checked : value.get_StretchBrackets(),
+ equationProps: {type: type, callback: 'put_StretchBrackets', value: !value.get_StretchBrackets()}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtMatchBrackets,
+ equation : true,
+ disabled : (!value.get_StretchBrackets() || me._currentParaObjDisabled),
+ checkable : true,
+ checked : value.get_StretchBrackets() && value.get_MatchBrackets(),
+ equationProps: {type: type, callback: 'put_MatchBrackets', value: !value.get_MatchBrackets()}
+ });
+ arr.push(mnu);
+ break;
+ case Asc.c_oAscMathInterfaceType.GroupChar:
+ if (value.can_ChangePos()) {
+ mnu = new Common.UI.MenuItem({
+ caption : (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? me.txtGroupCharUnder : me.txtGroupCharOver,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? Asc.c_oAscMathInterfaceGroupCharPos.Bottom : Asc.c_oAscMathInterfaceGroupCharPos.Top}
+ });
+ arr.push(mnu);
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtDeleteGroupChar,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceGroupCharPos.None}
+ });
+ arr.push(mnu);
+ }
+ break;
+ case Asc.c_oAscMathInterfaceType.Radical:
+ if (value.get_HideDegree() !== undefined) {
+ mnu = new Common.UI.MenuItem({
+ caption : value.get_HideDegree() ? me.txtShowDegree : me.txtHideDegree,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'put_HideDegree', value: !value.get_HideDegree()}
+ });
+ arr.push(mnu);
+ }
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtDeleteRadical,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'remove_Radical'}
+ });
+ arr.push(mnu);
+ break;
+ }
+ if (value.can_IncreaseArgumentSize()) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtIncreaseArg,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'increase_ArgumentSize'}
+ });
+ arr.push(mnu);
+ }
+ if (value.can_DecreaseArgumentSize()) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtDecreaseArg,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'decrease_ArgumentSize'}
+ });
+ arr.push(mnu);
+ }
+ if (value.can_InsertManualBreak()) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtInsertBreak,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'insert_ManualBreak'}
+ });
+ arr.push(mnu);
+ }
+ if (value.can_DeleteManualBreak()) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtDeleteBreak,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'delete_ManualBreak'}
+ });
+ arr.push(mnu);
+ }
+ if (value.can_AlignToCharacter()) {
+ mnu = new Common.UI.MenuItem({
+ caption : me.txtAlignToChar,
+ equation : true,
+ disabled : me._currentParaObjDisabled,
+ equationProps: {type: type, callback: 'align_ToCharacter'}
+ });
+ arr.push(mnu);
+ }
+ return arr;
+ },
+
+ addEquationMenu: function(isParagraph, insertIdx) {
+ var me = this;
+ if (_.isUndefined(isParagraph)) {
+ isParagraph = me.textMenu.isVisible();
+ }
+
+ me.clearEquationMenu(isParagraph, insertIdx);
+
+ var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu,
+ menuItems = me.initEquationMenu();
+
+ if (menuItems.length > 0) {
+ _.each(menuItems, function(menuItem, index) {
+ if (menuItem.menu) {
+ _.each(menuItem.menu.items, function(item) {
+ item.on('click', _.bind(me.equationCallback, me, item.options.equationProps));
+ });
+ } else
+ menuItem.on('click', _.bind(me.equationCallback, me, menuItem.options.equationProps));
+ equationMenu.insertItem(insertIdx, menuItem);
+ insertIdx++;
+ });
+ }
+ return menuItems.length;
+ },
+
+ equationCallback: function(eqProps) {
+ this.fireEvent('equation:callback', [eqProps]);
+ },
+
+ clearEquationMenu: function(isParagraph, insertIdx) {
+ var me = this;
+ var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu;
+ for (var i = insertIdx; i < equationMenu.items.length; i++) {
+ if (equationMenu.items[i].options.equation) {
+ if (equationMenu.items[i].menu) {
+ _.each(equationMenu.items[i].menu.items, function(item) {
+ item.off('click');
+ });
+ } else
+ equationMenu.items[i].off('click');
+ equationMenu.removeItem(equationMenu.items[i]);
+ i--;
+ } else
+ break;
}
- me.fireEvent('editcomplete', me);
},
onSlidePickerShowAfter: function(picker) {
if (!picker._needRecalcSlideLayout) return;
-
+
if (picker.cmpEl && picker.dataViewItems.length>0) {
var dataViewItems = picker.dataViewItems,
el = $(dataViewItems[0].el),
@@ -1821,50 +788,43 @@ define([
}
},
- addToLayout: function() {
- if (this.api)
- this.api.asc_AddToLayout();
- },
-
createDelayedElementsViewer: function() {
var me = this;
- var menuViewCopy = new Common.UI.MenuItem({
+ me.menuViewCopy = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-copy',
caption: me.textCopy,
value: 'copy'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
- var menuViewUndo = new Common.UI.MenuItem({
+ me.menuViewUndo = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-undo',
caption: me.textUndo
- }).on('click', function () {
- me.api.Undo();
});
var menuViewCopySeparator = new Common.UI.MenuItem({
caption: '--'
});
- var menuViewAddComment = new Common.UI.MenuItem({
+ me.menuViewAddComment = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-menu-comments',
caption: me.addCommentText
- }).on('click', _.bind(me.addComment, me));
+ });
this.viewModeMenu = new Common.UI.Menu({
cls: 'shifted-right',
initMenu: function (value) {
- menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
- menuViewUndo.setDisabled(!me.api.asc_getCanUndo() && !me._isDisabled);
+ me.menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
+ me.menuViewUndo.setDisabled(!me.api.asc_getCanUndo());
menuViewCopySeparator.setVisible(!value.isChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
- menuViewAddComment.setVisible(!value.isChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
- menuViewAddComment.setDisabled(value.locked);
+ me.menuViewAddComment.setVisible(!value.isChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
+ me.menuViewAddComment.setDisabled(value.locked);
},
items: [
- menuViewCopy,
- menuViewUndo,
+ me.menuViewCopy,
+ me.menuViewUndo,
menuViewCopySeparator,
- menuViewAddComment
+ me.menuViewAddComment
]
}).on('hide:after', function (menu, e, isFromInputControl) {
if (me.suppressEditComplete) {
@@ -1876,53 +836,33 @@ define([
me.currentMenu = null;
});
- var mnuPreview = new Common.UI.MenuItem({
+ me.mnuPreview = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-preview',
caption : me.txtPreview
- }).on('click', function(item) {
- var current = me.api.getCurrentPage();
- Common.NotificationCenter.trigger('preview:start', _.isNumber(current) ? current : 0);
});
- var mnuSelectAll = new Common.UI.MenuItem({
+ me.mnuSelectAll = new Common.UI.MenuItem({
caption : me.txtSelectAll
- }).on('click', function(item){
- if (me.api){
- me.api.SelectAllSlides();
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Select All Slides');
- }
});
- var mnuPrintSelection = new Common.UI.MenuItem({
+ me.mnuPrintSelection = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-print',
caption : me.txtPrintSelection
- }).on('click', function(item){
- if (me.api){
- var printopt = new Asc.asc_CAdjustPrint();
- printopt.asc_setPrintType(Asc.c_oAscPrintType.Selection);
- var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); // if isChrome or isOpera == true use asc_onPrintUrl event
- opts.asc_setAdvancedOptions(printopt);
- me.api.asc_Print(opts);
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Print Selection');
- }
});
this.viewModeMenuSlide = new Common.UI.Menu({
cls: 'shifted-right',
initMenu: function (value) {
- mnuSelectAll.setDisabled(me.slidesCount<2);
- mnuPrintSelection.setVisible(me.mode.canPrint && value.fromThumbs===true);
- mnuPrintSelection.setDisabled(me.slidesCount<1);
- mnuPreview.setDisabled(me.slidesCount<1);
+ me.mnuSelectAll.setDisabled(me.slidesCount<2);
+ me.mnuPrintSelection.setVisible(me.mode.canPrint && value.fromThumbs===true);
+ me.mnuPrintSelection.setDisabled(me.slidesCount<1);
+ me.mnuPreview.setDisabled(me.slidesCount<1);
},
items: [
- mnuSelectAll,
- mnuPrintSelection,
+ me.mnuSelectAll,
+ me.mnuPrintSelection,
{caption: '--'},
- mnuPreview
+ me.mnuPreview
]
}).on('hide:after', function (menu, e, isFromInputControl) {
if (me.suppressEditComplete) {
@@ -1933,24 +873,18 @@ define([
if (!isFromInputControl) me.fireEvent('editcomplete', me);
me.currentMenu = null;
});
+
+ this.fireEvent('createdelayedelements', [this, 'view']);
},
createDelayedElements: function(){
var me = this;
- var mnuDeleteSlide = new Common.UI.MenuItem({
+ me.mnuDeleteSlide = new Common.UI.MenuItem({
caption : me.txtDeleteSlide
- }).on('click', function(item) {
- if (me.api){
- me._isFromSlideMenu = true;
- me.api.DeleteSlide();
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Delete Slide');
- }
});
- var mnuChangeSlide = new Common.UI.MenuItem({
+ me.mnuChangeSlide = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-changeslide',
caption : me.txtChangeLayout,
menu : new Common.UI.Menu({
@@ -1961,15 +895,16 @@ define([
})
});
- var mnuResetSlide = new Common.UI.MenuItem({
+ me.mnuResetSlide = new Common.UI.MenuItem({
caption : me.txtResetLayout
- }).on('click', function(item) {
- if (me.api){
- me.api.ResetSlide();
+ });
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Reset Slide');
- }
+ me.mnuNewSlide = new Common.UI.MenuItem({
+ caption : me.txtNewSlide
+ });
+
+ me.mnuDuplicateSlide = new Common.UI.MenuItem({
+ caption : me.txtDuplicateSlide
});
var mnuChangeTheme = new Common.UI.MenuItem({
@@ -1982,112 +917,67 @@ define([
})
});
- var mnuPreview = new Common.UI.MenuItem({
+ me.mnuPreview = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-preview',
caption : me.txtPreview
- }).on('click', function(item) {
- var current = me.api.getCurrentPage();
- Common.NotificationCenter.trigger('preview:start', _.isNumber(current) ? current : 0);
});
- var mnuSelectAll = new Common.UI.MenuItem({
+ me.mnuSelectAll = new Common.UI.MenuItem({
caption : me.txtSelectAll
- }).on('click', function(item){
- if (me.api){
- me.api.SelectAllSlides();
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Select All Slides');
- }
});
- var mnuPrintSelection = new Common.UI.MenuItem({
+ me.mnuPrintSelection = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-print',
caption : me.txtPrintSelection
- }).on('click', function(item){
- if (me.api){
- var printopt = new Asc.asc_CAdjustPrint();
- printopt.asc_setPrintType(Asc.c_oAscPrintType.Selection);
- var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); // if isChrome or isOpera == true use asc_onPrintUrl event
- opts.asc_setAdvancedOptions(printopt);
- me.api.asc_Print(opts);
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Print Selection');
- }
});
- var mnuMoveSlideToStart = new Common.UI.MenuItem({
+ me.mnuMoveSlideToStart = new Common.UI.MenuItem({
caption: me.txtMoveSlidesToStart
- }).on('click', function(item){
- if (me.api) {
- me.api.asc_moveSelectedSlidesToStart();
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Move Slide to Start');
- }
});
- var mnuMoveSlideToEnd = new Common.UI.MenuItem({
+ me.mnuMoveSlideToEnd = new Common.UI.MenuItem({
caption: me.txtMoveSlidesToEnd
- }).on('click', function(item){
- if (me.api) {
- me.api.asc_moveSelectedSlidesToEnd();
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Move Slide to End');
- }
});
- var menuSlidePaste = new Common.UI.MenuItem({
+ me.menuSlidePaste = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-paste',
caption : me.textPaste,
value : 'paste'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
- var menuSlideSettings = new Common.UI.MenuItem({
+ me.menuSlideSettings = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-menu-slide',
caption : me.textSlideSettings,
value : null
- }).on('click', function(item){
- PE.getController('RightMenu').onDoubleClickOnObject(item.options.value);
});
- var mnuSlideHide = new Common.UI.MenuItem({
+ me.mnuSlideHide = new Common.UI.MenuItem({
caption : me.txtSlideHide,
checkable: true,
checked: false
- }).on('click', function(item){
- if (me.api){
- me.api.asc_HideSlides(item.checked);
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Hide Slides');
- }
});
-
-
me.slideMenu = new Common.UI.Menu({
cls: 'shifted-right',
restoreHeightAndTop: true,
initMenu: function(value) {
var selectedLast = me.api.asc_IsLastSlideSelected(),
selectedFirst = me.api.asc_IsFirstSlideSelected();
- menuSlidePaste.setVisible(value.fromThumbs!==true);
+ me.menuSlidePaste.setVisible(value.fromThumbs!==true);
me.slideMenu.items[1].setVisible(value.fromThumbs===true); // New Slide
me.slideMenu.items[2].setVisible(value.isSlideSelect===true); // Duplicate Slide
- mnuDeleteSlide.setVisible(value.isSlideSelect===true);
- mnuSlideHide.setVisible(value.isSlideSelect===true);
- mnuSlideHide.setChecked(value.isSlideHidden===true);
+ me.mnuDeleteSlide.setVisible(value.isSlideSelect===true);
+ me.mnuSlideHide.setVisible(value.isSlideSelect===true);
+ me.mnuSlideHide.setChecked(value.isSlideHidden===true);
me.slideMenu.items[5].setVisible(value.isSlideSelect===true || value.fromThumbs!==true);
- mnuChangeSlide.setVisible(value.isSlideSelect===true || value.fromThumbs!==true);
- mnuResetSlide.setVisible(value.isSlideSelect===true || value.fromThumbs!==true);
+ me.mnuChangeSlide.setVisible(value.isSlideSelect===true || value.fromThumbs!==true);
+ me.mnuResetSlide.setVisible(value.isSlideSelect===true || value.fromThumbs!==true);
mnuChangeTheme.setVisible(value.isSlideSelect===true || value.fromThumbs!==true);
- menuSlideSettings.setVisible(value.isSlideSelect===true || value.fromThumbs!==true);
- menuSlideSettings.options.value = null;
+ me.menuSlideSettings.setVisible(value.isSlideSelect===true || value.fromThumbs!==true);
+ me.menuSlideSettings.options.value = null;
me.slideMenu.items[13].setVisible((!selectedLast || !selectedFirst) && value.isSlideSelect===true);
- mnuMoveSlideToEnd.setVisible(!selectedLast && value.isSlideSelect===true);
- mnuMoveSlideToStart.setVisible(!selectedFirst && value.isSlideSelect===true);
+ me.mnuMoveSlideToEnd.setVisible(!selectedLast && value.isSlideSelect===true);
+ me.mnuMoveSlideToStart.setVisible(!selectedFirst && value.isSlideSelect===true);
me.slideMenu.items[16].setVisible(value.fromThumbs===true);
me.slideMenu.items[17].setVisible(value.fromThumbs===true);
@@ -2095,7 +985,7 @@ define([
me.slideMenu.items[i].setVisible(value.fromThumbs===true);
}
- mnuPrintSelection.setVisible(me.mode.canPrint && value.fromThumbs===true);
+ me.mnuPrintSelection.setVisible(me.mode.canPrint && value.fromThumbs===true);
var selectedElements = me.api.getSelectedElements(),
locked = false,
@@ -2108,7 +998,7 @@ define([
locked = elValue.get_LockDelete();
lockedDeleted = elValue.get_LockRemove();
lockedLayout = elValue.get_LockLayout();
- menuSlideSettings.options.value = element;
+ me.menuSlideSettings.options.value = element;
me.slideLayoutMenu.options.layout_index = elValue.get_LayoutIndex();
return false;
}
@@ -2117,54 +1007,34 @@ define([
for (var i = 0; i < 3; i++) {
me.slideMenu.items[i].setDisabled(locked);
}
- mnuPreview.setDisabled(me.slidesCount<1);
- mnuSelectAll.setDisabled(me.slidesCount<2);
- mnuDeleteSlide.setDisabled(lockedDeleted || locked);
- mnuChangeSlide.setDisabled(lockedLayout || locked);
- mnuResetSlide.setDisabled(lockedLayout || locked);
+ me.mnuPreview.setDisabled(me.slidesCount<1);
+ me.mnuSelectAll.setDisabled(me.slidesCount<2);
+ me.mnuDeleteSlide.setDisabled(lockedDeleted || locked);
+ me.mnuChangeSlide.setDisabled(lockedLayout || locked);
+ me.mnuResetSlide.setDisabled(lockedLayout || locked);
mnuChangeTheme.setDisabled(me._state.themeLock || locked );
- mnuSlideHide.setDisabled(lockedLayout || locked);
- mnuPrintSelection.setDisabled(me.slidesCount<1);
+ me.mnuSlideHide.setDisabled(lockedLayout || locked);
+ me.mnuPrintSelection.setDisabled(me.slidesCount<1);
},
items: [
- menuSlidePaste,
- new Common.UI.MenuItem({
- caption : me.txtNewSlide
- }).on('click', function(item) {
- if (me.api) {
- me._isFromSlideMenu = true;
- me.api.AddSlide();
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Add Slide');
- }
- }),
- new Common.UI.MenuItem({
- caption : me.txtDuplicateSlide
- }).on('click', function(item){
- if (me.api) {
- me._isFromSlideMenu = true;
- me.api.DublicateSlide();
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Dublicate Hyperlink');
- }
- }),
- mnuDeleteSlide,
- mnuSlideHide,
+ me.menuSlidePaste,
+ me.mnuNewSlide,
+ me.mnuDuplicateSlide,
+ me.mnuDeleteSlide,
+ me.mnuSlideHide,
{caption: '--'},
- mnuChangeSlide,
- mnuResetSlide,
+ me.mnuChangeSlide,
+ me.mnuResetSlide,
mnuChangeTheme,
- menuSlideSettings,
+ me.menuSlideSettings,
{caption: '--'},
- mnuSelectAll,
- mnuPrintSelection,
+ me.mnuSelectAll,
+ me.mnuPrintSelection,
{caption: '--'},
- mnuMoveSlideToStart,
- mnuMoveSlideToEnd,
+ me.mnuMoveSlideToStart,
+ me.mnuMoveSlideToEnd,
{caption: '--'},
- mnuPreview
+ me.mnuPreview
]
}).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) {
@@ -2177,7 +1047,7 @@ define([
}).on('render:after', function(cmp) {
me.slideLayoutMenu = new Common.UI.DataView({
el : $('#id-docholder-menu-changeslide'),
- parentMenu : mnuChangeSlide.menu,
+ parentMenu : me.mnuChangeSlide.menu,
style: 'max-height: 300px;',
restoreWidth: 302,
store : PE.getCollection('SlideLayouts'),
@@ -2188,17 +1058,13 @@ define([
' '
].join(''))
}).on('item:click', function(picker, item, record, e) {
- if (me.api) {
- me.api.ChangeLayout(record.get('data').idx);
- if (e.type !== 'click')
- me.slideMenu.hide();
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Change Layout');
- }
+ if (e.type !== 'click')
+ me.slideMenu.hide();
+ me.fireEvent('layout:change', [record]);
});
if (me.slideMenu) {
- mnuChangeSlide.menu.on('show:after', function (menu) {
+ me.mnuChangeSlide.menu.on('show:after', function (menu) {
me.onSlidePickerShowAfter(me.slideLayoutMenu);
me.slideLayoutMenu.scroller.update({alwaysVisibleY: true});
@@ -2226,13 +1092,9 @@ define([
''
].join(''))
}).on('item:click', function(picker, item, record, e) {
- if (me.api) {
- me.api.ChangeTheme(record.get('themeId'), true);
- if (e.type !== 'click')
- me.slideMenu.hide();
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Change Theme');
- }
+ if (e.type !== 'click')
+ me.slideMenu.hide();
+ me.fireEvent('theme:change', [record]);
});
if (me.slideMenu) {
@@ -2246,96 +1108,134 @@ define([
}
});
- var mnuTableMerge = new Common.UI.MenuItem({
+ me.mnuTableMerge = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-merge-cells',
caption : me.mergeCellsText
- }).on('click', function(item) {
- if (me.api)
- me.api.MergeCells();
});
- var mnuTableSplit = new Common.UI.MenuItem({
+ me.mnuTableSplit = new Common.UI.MenuItem({
caption : me.splitCellsText
- }).on('click', function(item) {
- if (me.api) {
- (new Common.Views.InsertTableDialog({
- split: true,
- handler: function(result, value) {
- if (result == 'ok') {
- if (me.api) {
- me.api.SplitCell(value.columns, value.rows);
- }
- Common.component.Analytics.trackEvent('DocumentHolder', 'Table Split');
- }
- me.fireEvent('editcomplete', me);
- }
- })).show();
- }
});
- var menuTableCellAlign = new Common.UI.MenuItem({
+ me.menuTableCellAlign = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-align-top',
- caption : me.cellAlignText,
- menu : (function(){
- function onItemClick(item, e) {
- if (me.api) {
- var properties = new Asc.CTableProp();
- properties.put_CellsVAlign(item.value);
- me.api.tblApply(properties);
- }
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Table Cell Align');
- }
-
- return new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items: [
- me.menuTableCellTop = new Common.UI.MenuItem({
- iconCls: 'menu__icon btn-align-top',
- caption : me.textShapeAlignTop,
- checkable : true,
- checkmark : false,
- toggleGroup : 'popuptablecellalign',
- value : Asc.c_oAscVertAlignJc.Top
- }).on('click', _.bind(onItemClick, me)),
- me.menuTableCellCenter = new Common.UI.MenuItem({
- iconCls: 'menu__icon btn-align-middle',
- caption : me.textShapeAlignMiddle,
- checkable : true,
- checkmark : false,
- toggleGroup : 'popuptablecellalign',
- value : Asc.c_oAscVertAlignJc.Center
- }).on('click', _.bind(onItemClick, me)),
- me.menuTableCellBottom = new Common.UI.MenuItem({
- iconCls: 'menu__icon btn-align-bottom',
- caption : me.textShapeAlignBottom,
- checkable : true,
- checkmark : false,
- toggleGroup : 'popuptablecellalign',
- value : Asc.c_oAscVertAlignJc.Bottom
- }).on('click', _.bind(onItemClick, me))
- ]
- })
- })()
+ caption : me.cellAlignText,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items: [
+ me.menuTableCellTop = new Common.UI.MenuItem({
+ iconCls: 'menu__icon btn-align-top',
+ caption : me.textShapeAlignTop,
+ checkable : true,
+ checkmark : false,
+ toggleGroup : 'popuptablecellalign',
+ value : Asc.c_oAscVertAlignJc.Top
+ }),
+ me.menuTableCellCenter = new Common.UI.MenuItem({
+ iconCls: 'menu__icon btn-align-middle',
+ caption : me.textShapeAlignMiddle,
+ checkable : true,
+ checkmark : false,
+ toggleGroup : 'popuptablecellalign',
+ value : Asc.c_oAscVertAlignJc.Center
+ }),
+ me.menuTableCellBottom = new Common.UI.MenuItem({
+ iconCls: 'menu__icon btn-align-bottom',
+ caption : me.textShapeAlignBottom,
+ checkable : true,
+ checkmark : false,
+ toggleGroup : 'popuptablecellalign',
+ value : Asc.c_oAscVertAlignJc.Bottom
+ })
+ ]
+ })
});
- var menuTableDistRows = new Common.UI.MenuItem({
+ me.menuTableDistRows = new Common.UI.MenuItem({
caption : me.textDistributeRows
- }).on('click', _.bind(function(){
- if (me.api)
- me.api.asc_DistributeTableCells(false);
- me.fireEvent('editcomplete', me);
- }, me));
+ });
- var menuTableDistCols = new Common.UI.MenuItem({
+ me.menuTableDistCols = new Common.UI.MenuItem({
caption : me.textDistributeCols
- }).on('click', _.bind(function(){
- if (me.api)
- me.api.asc_DistributeTableCells(true);
- me.fireEvent('editcomplete', me);
- }, me));
+ });
+
+ me.menuTableSelectText = new Common.UI.MenuItem({
+ caption : me.selectText,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items: [
+ new Common.UI.MenuItem({
+ caption : me.rowText,
+ value: 0
+ }),
+ new Common.UI.MenuItem({
+ caption : me.columnText,
+ value: 1
+ }),
+ new Common.UI.MenuItem({
+ caption : me.cellText,
+ value: 2
+ }),
+ new Common.UI.MenuItem({
+ caption : me.tableText,
+ value: 3
+ })
+ ]
+ })
+ });
+
+ me.menuTableInsertText = new Common.UI.MenuItem({
+ iconCls: 'menu__icon btn-addcell',
+ caption : me.insertText,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ style : 'width: 100px',
+ items : [
+ new Common.UI.MenuItem({
+ caption: me.insertColumnLeftText,
+ value: 0
+ }),
+ new Common.UI.MenuItem({
+ caption: me.insertColumnRightText,
+ value: 1
+ }),
+ new Common.UI.MenuItem({
+ caption: me.insertRowAboveText,
+ value: 2
+ }),
+ new Common.UI.MenuItem({
+ caption: me.insertRowBelowText,
+ value: 3
+ })
+ ]
+ })
+ });
+
+ me.menuTableDeleteText = new Common.UI.MenuItem({
+ iconCls: 'menu__icon btn-delcell',
+ caption : me.deleteText,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items: [
+ new Common.UI.MenuItem({
+ caption : me.rowText,
+ value: 0
+ }),
+ new Common.UI.MenuItem({
+ caption : me.columnText,
+ value: 1
+ }),
+ new Common.UI.MenuItem({
+ caption : me.tableText,
+ value: 2
+ })
+ ]
+ })
+ });
me.menuSpellTable = new Common.UI.MenuItem({
caption : me.loadSpellText,
@@ -2372,29 +1272,18 @@ define([
})
});
- var menuIgnoreSpellTable = new Common.UI.MenuItem({
- caption : me.ignoreSpellText
- }).on('click', function(item) {
- if (me.api) {
- me.api.asc_ignoreMisspelledWord(me._currentSpellObj, false);
- me.fireEvent('editcomplete', me);
- }
+ me.menuIgnoreSpellTable = new Common.UI.MenuItem({
+ caption : me.ignoreSpellText,
+ value: false
});
- var menuIgnoreAllSpellTable = new Common.UI.MenuItem({
- caption : me.ignoreAllSpellText
- }).on('click', function(menu) {
- if (me.api) {
- me.api.asc_ignoreMisspelledWord(me._currentSpellObj, true);
- me.fireEvent('editcomplete', me);
- }
+ me.menuIgnoreAllSpellTable = new Common.UI.MenuItem({
+ caption : me.ignoreAllSpellText,
+ value: true
});
- var menuToDictionaryTable = new Common.UI.MenuItem({
+ me.menuToDictionaryTable = new Common.UI.MenuItem({
caption : me.toDictionaryText
- }).on('click', function(item, e) {
- me.api.asc_spellCheckAddToDictionary(me._currentSpellObj);
- me.fireEvent('editcomplete', me);
});
var menuIgnoreSpellTableSeparator = new Common.UI.MenuItem({
@@ -2415,9 +1304,9 @@ define([
me.menuSpellTable,
me.menuSpellMoreTable,
menuIgnoreSpellTableSeparator,
- menuIgnoreSpellTable,
- menuIgnoreAllSpellTable,
- menuToDictionaryTable,
+ me.menuIgnoreSpellTable,
+ me.menuIgnoreAllSpellTable,
+ me.menuToDictionaryTable,
{ caption: '--' },
me.langTableMenu
]
@@ -2452,25 +1341,18 @@ define([
})
});
- var menuIgnoreSpellPara = new Common.UI.MenuItem({
- caption : me.ignoreSpellText
- }).on('click', function(item, e) {
- me.api.asc_ignoreMisspelledWord(me._currentSpellObj, false);
- me.fireEvent('editcomplete', me);
+ me.menuIgnoreSpellPara = new Common.UI.MenuItem({
+ caption : me.ignoreSpellText,
+ value: false
});
- var menuIgnoreAllSpellPara = new Common.UI.MenuItem({
- caption : me.ignoreAllSpellText
- }).on('click', function(item, e) {
- me.api.asc_ignoreMisspelledWord(me._currentSpellObj, true);
- me.fireEvent('editcomplete', me);
+ me.menuIgnoreAllSpellPara = new Common.UI.MenuItem({
+ caption : me.ignoreAllSpellText,
+ value: true
});
- var menuToDictionaryPara = new Common.UI.MenuItem({
+ me.menuToDictionaryPara = new Common.UI.MenuItem({
caption : me.toDictionaryText
- }).on('click', function(item, e) {
- me.api.asc_spellCheckAddToDictionary(me._currentSpellObj);
- me.fireEvent('editcomplete', me);
});
var menuIgnoreSpellParaSeparator = new Common.UI.MenuItem({
@@ -2481,175 +1363,41 @@ define([
caption : '--'
});
- var menuTableAdvanced = new Common.UI.MenuItem({
+ me.menuTableAdvanced = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-menu-table',
caption : me.advancedTableText
- }).on('click', function(item) {
- if (me.api) {
- var selectedElements = me.api.getSelectedElements();
-
- if (selectedElements && selectedElements.length > 0){
- var elType, elValue;
- for (var i = selectedElements.length - 1; i >= 0; i--) {
- elType = selectedElements[i].get_ObjectType();
- elValue = selectedElements[i].get_ObjectValue();
-
- if (Asc.c_oAscTypeSelectElement.Table == elType) {
- (new PE.Views.TableSettingsAdvanced(
- {
- tableProps: elValue,
- slideSize: PE.getController('Toolbar').currentPageSize,
- handler: function(result, value) {
- if (result == 'ok') {
- if (me.api) {
- me.api.tblApply(value.tableProps);
- }
- }
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Table Settings Advanced');
- }
- })).show();
- break;
- }
- }
- }
- }
});
- var menuImageAdvanced = new Common.UI.MenuItem({
+ me.menuImageAdvanced = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-menu-image',
caption : me.advancedImageText
- }).on('click', function(item) {
- if (me.api){
- var selectedElements = me.api.getSelectedElements();
- if (selectedElements && selectedElements.length>0){
- var elType, elValue;
-
- for (var i = selectedElements.length - 1; i >= 0; i--) {
- elType = selectedElements[i].get_ObjectType();
- elValue = selectedElements[i].get_ObjectValue();
-
- if (Asc.c_oAscTypeSelectElement.Image == elType) {
- var imgsizeOriginal;
-
- if (!menuImgOriginalSize.isDisabled()) {
- imgsizeOriginal = me.api.get_OriginalSizeImage();
- if (imgsizeOriginal)
- imgsizeOriginal = {width:imgsizeOriginal.get_ImageWidth(), height:imgsizeOriginal.get_ImageHeight()};
- }
-
- (new PE.Views.ImageSettingsAdvanced(
- {
- imageProps: elValue,
- sizeOriginal: imgsizeOriginal,
- slideSize: PE.getController('Toolbar').currentPageSize,
- handler: function(result, value) {
- if (result == 'ok') {
- if (me.api) {
- me.api.ImgApply(value.imageProps);
- }
- }
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Image Settings Advanced');
- }
- })).show();
- break;
- }
- }
- }
- }
});
- var menuShapeAdvanced = new Common.UI.MenuItem({
+ me.menuShapeAdvanced = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-menu-shape',
caption : me.advancedShapeText
- }).on('click', function(item) {
- if (me.api){
- var selectedElements = me.api.getSelectedElements();
- if (selectedElements && selectedElements.length>0){
- var elType, elValue;
- for (var i = selectedElements.length - 1; i >= 0; i--) {
- elType = selectedElements[i].get_ObjectType();
- elValue = selectedElements[i].get_ObjectValue();
- if (Asc.c_oAscTypeSelectElement.Shape == elType) {
- (new PE.Views.ShapeSettingsAdvanced(
- {
- shapeProps: elValue,
- slideSize: PE.getController('Toolbar').currentPageSize,
- handler: function(result, value) {
- if (result == 'ok') {
- if (me.api) {
- me.api.ShapeApply(value.shapeProps);
- }
- }
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Image Shape Advanced');
- }
- })).show();
- break;
- }
- }
- }
- }
});
- var menuParagraphAdvanced = new Common.UI.MenuItem({
+ me.menuParagraphAdvanced = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-paragraph',
caption : me.advancedParagraphText
- }).on('click', function(item) {
- if (me.api){
- var selectedElements = me.api.getSelectedElements();
-
- if (selectedElements && selectedElements.length > 0){
- var elType, elValue;
- for (var i = selectedElements.length - 1; i >= 0; i--) {
- elType = selectedElements[i].get_ObjectType();
- elValue = selectedElements[i].get_ObjectValue();
-
- if (Asc.c_oAscTypeSelectElement.Paragraph == elType) {
- (new PE.Views.ParagraphSettingsAdvanced(
- {
- paragraphProps: elValue,
- api: me.api,
- handler: function(result, value) {
- if (result == 'ok') {
- if (me.api) {
- me.api.paraApply(value.paragraphProps);
- }
- }
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Image Paragraph Advanced');
- }
- })).show();
- break;
- }
- }
- }
- }
});
var menuCommentParaSeparator = new Common.UI.MenuItem({
caption : '--'
});
- var menuAddHyperlinkPara = new Common.UI.MenuItem({
+ me.menuAddHyperlinkPara = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-inserthyperlink',
caption : me.hyperlinkText
- }).on('click', _.bind(me.addHyperlink, me));
+ });
- var menuEditHyperlinkPara = new Common.UI.MenuItem({
+ me.menuEditHyperlinkPara = new Common.UI.MenuItem({
caption : me.editHyperlinkText
- }).on('click', _.bind(me.editHyperlink, me));
+ });
- var menuRemoveHyperlinkPara = new Common.UI.MenuItem({
+ me.menuRemoveHyperlinkPara = new Common.UI.MenuItem({
caption : me.removeHyperlinkText
- }).on('click', function(item) {
- if (me.api){
- me.api.remove_Hyperlink();
- }
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Remove Hyperlink');
});
var menuHyperlinkPara = new Common.UI.MenuItem({
@@ -2659,30 +1407,23 @@ define([
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
- menuEditHyperlinkPara,
- menuRemoveHyperlinkPara
+ me.menuEditHyperlinkPara,
+ me.menuRemoveHyperlinkPara
]
})
});
- var menuAddHyperlinkTable = new Common.UI.MenuItem({
+ me.menuAddHyperlinkTable = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-inserthyperlink',
caption : me.hyperlinkText
- }).on('click', _.bind(me.addHyperlink, me));
+ });
- var menuEditHyperlinkTable = new Common.UI.MenuItem({
+ me.menuEditHyperlinkTable = new Common.UI.MenuItem({
caption : me.editHyperlinkText
- }).on('click', _.bind(me.editHyperlink, me));
+ });
- var menuRemoveHyperlinkTable = new Common.UI.MenuItem({
+ me.menuRemoveHyperlinkTable = new Common.UI.MenuItem({
caption : me.removeHyperlinkText
- }).on('click', function(item) {
- if (me.api){
- me.api.remove_Hyperlink();
- }
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Remove Hyperlink Table');
});
var menuHyperlinkTable = new Common.UI.MenuItem({
@@ -2692,8 +1433,8 @@ define([
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
- menuEditHyperlinkTable,
- menuRemoveHyperlinkTable
+ me.menuEditHyperlinkTable,
+ me.menuRemoveHyperlinkTable
]
})
});
@@ -2702,76 +1443,34 @@ define([
caption : '--'
});
- var mnuGroupImg = new Common.UI.MenuItem({
+ me.mnuGroupImg = new Common.UI.MenuItem({
caption : this.txtGroup,
iconCls : 'menu__icon shape-group'
- }).on('click', function(item) {
- if (me.api) {
- me.api.groupShapes();
- }
-
- me.fireEvent('editcomplete', this);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Group Image');
});
- var mnuUnGroupImg = new Common.UI.MenuItem({
+ me.mnuUnGroupImg = new Common.UI.MenuItem({
caption : this.txtUngroup,
iconCls : 'menu__icon shape-ungroup'
- }).on('click', function(item) {
- if (me.api) {
- me.api.unGroupShapes();
- }
-
- me.fireEvent('editcomplete', this);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Ungroup Image');
});
- var mnuArrangeFront = new Common.UI.MenuItem({
+ me.mnuArrangeFront = new Common.UI.MenuItem({
caption : this.textArrangeFront,
iconCls : 'menu__icon arrange-front'
- }).on('click', function(item) {
- if (me.api) {
- me.api.shapes_bringToFront();
- }
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Bring To Front');
});
- var mnuArrangeBack = new Common.UI.MenuItem({
+ me.mnuArrangeBack = new Common.UI.MenuItem({
caption : this.textArrangeBack,
iconCls : 'menu__icon arrange-back'
- }).on('click', function(item) {
- if (me.api) {
- me.api.shapes_bringToBack();
- }
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Bring To Back');
});
- var mnuArrangeForward = new Common.UI.MenuItem({
+ me.mnuArrangeForward = new Common.UI.MenuItem({
caption : this.textArrangeForward,
iconCls : 'menu__icon arrange-forward'
- }).on('click', function(item) {
- if (me.api) {
- me.api.shapes_bringForward();
- }
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Send Forward');
});
- var mnuArrangeBackward = new Common.UI.MenuItem({
+ me.mnuArrangeBackward = new Common.UI.MenuItem({
caption : this.textArrangeBackward,
iconCls : 'menu__icon arrange-backward'
- }).on('click', function(item) {
- if (me.api) {
- me.api.shapes_bringBackward();
- }
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Send Backward');
});
var menuImgShapeArrange = new Common.UI.MenuItem({
@@ -2780,153 +1479,109 @@ define([
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
- mnuArrangeFront,
- mnuArrangeBack,
- mnuArrangeForward,
- mnuArrangeBackward,
+ me.mnuArrangeFront,
+ me.mnuArrangeBack,
+ me.mnuArrangeForward,
+ me.mnuArrangeBackward,
{caption: '--'},
- mnuGroupImg,
- mnuUnGroupImg
+ me.mnuGroupImg,
+ me.mnuUnGroupImg
]
})
});
- var menuImgShapeAlign = new Common.UI.MenuItem({
+ me.menuImgShapeAlign = new Common.UI.MenuItem({
caption : me.txtAlign,
- menu : (function(){
- function onItemClick(item) {
- if (me.api) {
- var value = me.api.asc_getSelectedDrawingObjectsCount()<2 || Common.Utils.InternalSettings.get("pe-align-to-slide");
- value = value ? Asc.c_oAscObjectsAlignType.Slide : Asc.c_oAscObjectsAlignType.Selected;
- if (item.value < 6) {
- me.api.put_ShapesAlign(item.value, value);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Shape Align');
- } else if (item.value == 6) {
- me.api.DistributeHorizontally(value);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Horizontally');
- } else if (item.value == 7){
- me.api.DistributeVertically(value);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Vertically');
- }
- }
- me.fireEvent('editcomplete', me);
- }
-
- return new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items: [
- new Common.UI.MenuItem({
- caption : me.textShapeAlignLeft,
- iconCls : 'menu__icon shape-align-left',
- value : Asc.c_oAscAlignShapeType.ALIGN_LEFT
- }).on('click', _.bind(onItemClick, me)),
- new Common.UI.MenuItem({
- caption : me.textShapeAlignCenter,
- iconCls : 'menu__icon shape-align-center',
- value : Asc.c_oAscAlignShapeType.ALIGN_CENTER
- }).on('click', _.bind(onItemClick, me)),
- new Common.UI.MenuItem({
- caption : me.textShapeAlignRight,
- iconCls : 'menu__icon shape-align-right',
- value : Asc.c_oAscAlignShapeType.ALIGN_RIGHT
- }).on('click', _.bind(onItemClick, me)),
- new Common.UI.MenuItem({
- caption : me.textShapeAlignTop,
- iconCls : 'menu__icon shape-align-top',
- value : Asc.c_oAscAlignShapeType.ALIGN_TOP
- }).on('click', _.bind(onItemClick, me)),
- new Common.UI.MenuItem({
- caption : me.textShapeAlignMiddle,
- iconCls : 'menu__icon shape-align-middle',
- value : Asc.c_oAscAlignShapeType.ALIGN_MIDDLE
- }).on('click', _.bind(onItemClick, me)),
- new Common.UI.MenuItem({
- caption : me.textShapeAlignBottom,
- iconCls : 'menu__icon shape-align-bottom',
- value : Asc.c_oAscAlignShapeType.ALIGN_BOTTOM
- }).on('click', _.bind(onItemClick, me)),
- {caption : '--'},
- new Common.UI.MenuItem({
- caption : me.txtDistribHor,
- iconCls : 'menu__icon shape-distribute-hor',
- value : 6
- }).on('click', _.bind(onItemClick, me)),
- new Common.UI.MenuItem({
- caption : me.txtDistribVert,
- iconCls : 'menu__icon shape-distribute-vert',
- value : 7
- }).on('click', _.bind(onItemClick, me))
- ]
- })
- })()
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items: [
+ new Common.UI.MenuItem({
+ caption : me.textShapeAlignLeft,
+ iconCls : 'menu__icon shape-align-left',
+ value : Asc.c_oAscAlignShapeType.ALIGN_LEFT
+ }),
+ new Common.UI.MenuItem({
+ caption : me.textShapeAlignCenter,
+ iconCls : 'menu__icon shape-align-center',
+ value : Asc.c_oAscAlignShapeType.ALIGN_CENTER
+ }),
+ new Common.UI.MenuItem({
+ caption : me.textShapeAlignRight,
+ iconCls : 'menu__icon shape-align-right',
+ value : Asc.c_oAscAlignShapeType.ALIGN_RIGHT
+ }),
+ new Common.UI.MenuItem({
+ caption : me.textShapeAlignTop,
+ iconCls : 'menu__icon shape-align-top',
+ value : Asc.c_oAscAlignShapeType.ALIGN_TOP
+ }),
+ new Common.UI.MenuItem({
+ caption : me.textShapeAlignMiddle,
+ iconCls : 'menu__icon shape-align-middle',
+ value : Asc.c_oAscAlignShapeType.ALIGN_MIDDLE
+ }),
+ new Common.UI.MenuItem({
+ caption : me.textShapeAlignBottom,
+ iconCls : 'menu__icon shape-align-bottom',
+ value : Asc.c_oAscAlignShapeType.ALIGN_BOTTOM
+ }),
+ {caption : '--'},
+ new Common.UI.MenuItem({
+ caption : me.txtDistribHor,
+ iconCls : 'menu__icon shape-distribute-hor',
+ value : 6
+ }),
+ new Common.UI.MenuItem({
+ caption : me.txtDistribVert,
+ iconCls : 'menu__icon shape-distribute-vert',
+ value : 7
+ })
+ ]
+ })
});
- var menuChartEdit = new Common.UI.MenuItem({
+ me.menuChartEdit = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-menu-chart',
caption : me.editChartText
- }).on('click', _.bind(me.editChartClick, me, undefined));
-
- var menuParagraphVAlign = new Common.UI.MenuItem({
- iconCls: 'menu__icon btn-align-top',
- caption : me.vertAlignText,
- menu : (function(){
- function onItemClick(item) {
- if (me.api) {
- var properties = new Asc.asc_CShapeProperty();
- properties.put_VerticalTextAlign(item.value);
-
- me.api.ShapeApply(properties);
- }
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Text Vertical Align');
- }
-
- return new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items: [
- me.menuParagraphTop = new Common.UI.MenuItem({
- iconCls: 'menu__icon btn-align-top',
- caption : me.textShapeAlignTop,
- checkable : true,
- checkmark : false,
- toggleGroup : 'popupparagraphvalign',
- value : Asc.c_oAscVAlign.Top
- }).on('click', _.bind(onItemClick, me)),
- me.menuParagraphCenter = new Common.UI.MenuItem({
- iconCls: 'menu__icon btn-align-middle',
- caption : me.textShapeAlignMiddle,
- checkable : true,
- checkmark : false,
- toggleGroup : 'popupparagraphvalign',
- value : Asc.c_oAscVAlign.Center
- }).on('click', _.bind(onItemClick, me)),
- me.menuParagraphBottom = new Common.UI.MenuItem({
- iconCls: 'menu__icon btn-align-bottom',
- caption : me.textShapeAlignBottom,
- checkable : true,
- checkmark : false,
- toggleGroup : 'popupparagraphvalign',
- value : Asc.c_oAscVAlign.Bottom
- }).on('click', _.bind(onItemClick, me))
- ]
- })
- })()
});
- var paragraphDirection = function(item, e) {
- if (me.api) {
- var properties = new Asc.asc_CShapeProperty();
- properties.put_Vert(item.options.direction);
- me.api.ShapeApply(properties);
- }
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Text Direction');
- };
+ me.menuParagraphVAlign = new Common.UI.MenuItem({
+ iconCls: 'menu__icon btn-align-top',
+ caption : me.vertAlignText,
+ menu : new Common.UI.Menu({
+ cls: 'shifted-right',
+ menuAlign: 'tl-tr',
+ items: [
+ me.menuParagraphTop = new Common.UI.MenuItem({
+ iconCls: 'menu__icon btn-align-top',
+ caption : me.textShapeAlignTop,
+ checkable : true,
+ checkmark : false,
+ toggleGroup : 'popupparagraphvalign',
+ value : Asc.c_oAscVAlign.Top
+ }),
+ me.menuParagraphCenter = new Common.UI.MenuItem({
+ iconCls: 'menu__icon btn-align-middle',
+ caption : me.textShapeAlignMiddle,
+ checkable : true,
+ checkmark : false,
+ toggleGroup : 'popupparagraphvalign',
+ value : Asc.c_oAscVAlign.Center
+ }),
+ me.menuParagraphBottom = new Common.UI.MenuItem({
+ iconCls: 'menu__icon btn-align-bottom',
+ caption : me.textShapeAlignBottom,
+ checkable : true,
+ checkmark : false,
+ toggleGroup : 'popupparagraphvalign',
+ value : Asc.c_oAscVAlign.Bottom
+ })
+ ]
+ })
+ });
- var menuParagraphDirection = new Common.UI.MenuItem({
+ me.menuParagraphDirection = new Common.UI.MenuItem({
iconCls: 'menu__icon text-orient-hor',
caption : me.directionText,
menu : new Common.UI.Menu({
@@ -2941,7 +1596,7 @@ define([
checked : false,
toggleGroup : 'popupparagraphdirect',
direction : Asc.c_oAscVertDrawingText.normal
- }).on('click', _.bind(paragraphDirection, me)),
+ }),
me.menuParagraphDirect90 = new Common.UI.MenuItem({
caption : me.direct90Text,
iconCls : 'menu__icon text-orient-rdown',
@@ -2950,7 +1605,7 @@ define([
checked : false,
toggleGroup : 'popupparagraphdirect',
direction : Asc.c_oAscVertDrawingText.vert
- }).on('click', _.bind(paragraphDirection, me)),
+ }),
me.menuParagraphDirect270 = new Common.UI.MenuItem({
caption : me.direct270Text,
iconCls : 'menu__icon text-orient-rup',
@@ -2959,7 +1614,7 @@ define([
checked : false,
toggleGroup : 'popupparagraphdirect',
direction : Asc.c_oAscVertDrawingText.vert270
- }).on('click', _.bind(paragraphDirection, me))
+ })
]
})
});
@@ -2968,70 +1623,33 @@ define([
caption : '--'
});
- var menuImgOriginalSize = new Common.UI.MenuItem({
+ me.menuImgOriginalSize = new Common.UI.MenuItem({
caption : me.originalSizeText
- }).on('click', function(item){
- if (me.api){
- var originalImageSize = me.api.get_OriginalSizeImage();
-
- if (originalImageSize) {
- var properties = new Asc.asc_CImgProperty();
-
- properties.put_Width(originalImageSize.get_ImageWidth());
- properties.put_Height(originalImageSize.get_ImageHeight());
- properties.put_ResetCrop(true);
- properties.put_Rot(0);
- me.api.ImgApply(properties);
- }
-
- me.fireEvent('editcomplete', me);
- Common.component.Analytics.trackEvent('DocumentHolder', 'Set Image Original Size');
- }
});
- var menuImgReplace = new Common.UI.MenuItem({
+ me.menuImgReplace = new Common.UI.MenuItem({
caption : me.textReplace,
menu : new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
new Common.UI.MenuItem({
- caption : this.textFromFile
- }).on('click', function(item) {
- setTimeout(function(){
- me.onInsertImage();
- }, 10);
+ caption : this.textFromFile,
+ value: 0
}),
new Common.UI.MenuItem({
- caption : this.textFromUrl
- }).on('click', _.bind(me.onInsertImageUrl, me, false)),
+ caption : this.textFromUrl,
+ value: 1
+ }),
new Common.UI.MenuItem({
- caption : this.textFromStorage
- }).on('click', function(item) {
- Common.NotificationCenter.trigger('storage:image-load', 'change');
+ caption : this.textFromStorage,
+ value: 2
})
]
})
});
- var onImgRotate = function(item) {
- var properties = new Asc.asc_CShapeProperty();
- properties.asc_putRotAdd((item.value==1 ? 90 : 270) * 3.14159265358979 / 180);
- me.api.ShapeApply(properties);
- me.fireEvent('editcomplete', me);
- };
-
- var onImgFlip = function(item) {
- var properties = new Asc.asc_CShapeProperty();
- if (item.value==1)
- properties.asc_putFlipHInvert(true);
- else
- properties.asc_putFlipVInvert(true);
- me.api.ShapeApply(properties);
- me.fireEvent('editcomplete', me);
- };
-
- var menuImgShapeRotate = new Common.UI.MenuItem({
+ me.menuImgShapeRotate = new Common.UI.MenuItem({
caption : me.textRotate,
menu : new Common.UI.Menu({
cls: 'shifted-right',
@@ -3041,38 +1659,27 @@ define([
iconCls: 'menu__icon btn-rotate-90',
caption: me.textRotate90,
value : 1
- }).on('click', _.bind(onImgRotate, me)),
+ }),
new Common.UI.MenuItem({
iconCls: 'menu__icon btn-rotate-270',
caption: me.textRotate270,
value : 0
- }).on('click', _.bind(onImgRotate, me)),
+ }),
{ caption: '--' },
new Common.UI.MenuItem({
iconCls: 'menu__icon btn-flip-hor',
caption: me.textFlipH,
value : 1
- }).on('click', _.bind(onImgFlip, me)),
+ }),
new Common.UI.MenuItem({
iconCls: 'menu__icon btn-flip-vert',
caption: me.textFlipV,
value : 0
- }).on('click', _.bind(onImgFlip, me))
+ })
]
})
});
- var onImgCrop = function(item) {
- if (item.value == 1) {
- me.api.asc_cropFill();
- } else if (item.value == 2) {
- me.api.asc_cropFit();
- } else {
- item.checked ? me.api.asc_startEditCrop() : me.api.asc_endEditCrop();
- }
- me.fireEvent('editcomplete', me);
- };
-
me.menuImgCrop = new Common.UI.MenuItem({
caption : me.textCrop,
menu : new Common.UI.Menu({
@@ -3084,101 +1691,101 @@ define([
checkable: true,
allowDepress: true,
value : 0
- }).on('click', _.bind(onImgCrop, me)),
+ }),
new Common.UI.MenuItem({
caption: me.textCropFill,
value : 1
- }).on('click', _.bind(onImgCrop, me)),
+ }),
new Common.UI.MenuItem({
caption: me.textCropFit,
value : 2
- }).on('click', _.bind(onImgCrop, me))
+ })
]
})
});
/** coauthoring begin **/
- var menuAddCommentPara = new Common.UI.MenuItem({
+ me.menuAddCommentPara = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-menu-comments',
caption : me.addCommentText
- }).on('click', _.bind(me.addComment, me));
- menuAddCommentPara.hide();
+ });
+ me.menuAddCommentPara.hide();
- var menuAddCommentTable = new Common.UI.MenuItem({
+ me.menuAddCommentTable = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-menu-comments',
caption : me.addCommentText
- }).on('click', _.bind(me.addComment, me));
- menuAddCommentTable.hide();
+ });
+ me.menuAddCommentTable.hide();
var menuCommentSeparatorImg = new Common.UI.MenuItem({
caption : '--'
});
menuCommentSeparatorImg.hide();
- var menuAddCommentImg = new Common.UI.MenuItem({
+ me.menuAddCommentImg = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-menu-comments',
caption : me.addCommentText
- }).on('click', _.bind(me.addComment, me));
- menuAddCommentImg.hide();
+ });
+ me.menuAddCommentImg.hide();
/** coauthoring end **/
- var menuAddToLayoutImg = new Common.UI.MenuItem({
+ me.menuAddToLayoutImg = new Common.UI.MenuItem({
caption : me.addToLayoutText
- }).on('click', _.bind(me.addToLayout, me));
+ });
- var menuParaCopy = new Common.UI.MenuItem({
+ me.menuParaCopy = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-copy',
caption : me.textCopy,
value : 'copy'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
- var menuParaPaste = new Common.UI.MenuItem({
+ me.menuParaPaste = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-paste',
caption : me.textPaste,
value : 'paste'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
- var menuParaCut = new Common.UI.MenuItem({
+ me.menuParaCut = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-cut',
caption : me.textCut,
value : 'cut'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
- var menuImgCopy = new Common.UI.MenuItem({
+ me.menuImgCopy = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-copy',
caption : me.textCopy,
value : 'copy'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
- var menuImgPaste = new Common.UI.MenuItem({
+ me.menuImgPaste = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-paste',
caption : me.textPaste,
value : 'paste'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
- var menuImgCut = new Common.UI.MenuItem({
+ me.menuImgCut = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-cut',
caption : me.textCut,
value : 'cut'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
- var menuTableCopy = new Common.UI.MenuItem({
+ me.menuTableCopy = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-copy',
caption : me.textCopy,
value : 'copy'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
- var menuTablePaste = new Common.UI.MenuItem({
+ me.menuTablePaste = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-paste',
caption : me.textPaste,
value : 'paste'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
- var menuTableCut = new Common.UI.MenuItem({
+ me.menuTableCut = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-cut',
caption : me.textCut,
value : 'cut'
- }).on('click', _.bind(me.onCutCopyPaste, me));
+ });
var menuEquationSeparator = new Common.UI.MenuItem({
caption : '--'
@@ -3188,14 +1795,12 @@ define([
caption : '--'
});
- var menuAddToLayoutTable = new Common.UI.MenuItem({
+ me.menuAddToLayoutTable = new Common.UI.MenuItem({
caption : me.addToLayoutText
- }).on('click', _.bind(me.addToLayout, me));
+ });
- var menuImgEditPoints = new Common.UI.MenuItem({
+ me.menuImgEditPoints = new Common.UI.MenuItem({
caption: me.textEditPoints
- }).on('click', function(item) {
- me.api && me.api.asc_editPointsGeometry();
});
var menuImgEditPointsSeparator = new Common.UI.MenuItem({
@@ -3214,8 +1819,8 @@ define([
var isEquation= (value.mathProps && value.mathProps.value);
me._currentParaObjDisabled = disabled;
- menuParagraphVAlign.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
- menuParagraphDirection.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
+ me.menuParagraphVAlign.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
+ me.menuParagraphDirection.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
if (isInShape || isInChart) {
var align = value.shapeProps.value.get_VerticalTextAlign();
var cls = '';
@@ -3230,7 +1835,7 @@ define([
cls = 'menu__icon btn-align-bottom';
break;
}
- menuParagraphVAlign.setIconCls(cls);
+ me.menuParagraphVAlign.setIconCls(cls);
me.menuParagraphTop.setChecked(align == Asc.c_oAscVAlign.Top);
me.menuParagraphCenter.setChecked(align == Asc.c_oAscVAlign.Center);
me.menuParagraphBottom.setChecked(align == Asc.c_oAscVAlign.Bottom);
@@ -3248,16 +1853,16 @@ define([
cls = 'menu__icon text-orient-rup';
break;
}
- menuParagraphDirection.setIconCls(cls);
+ me.menuParagraphDirection.setIconCls(cls);
me.menuParagraphDirectH.setChecked(dir == Asc.c_oAscVertDrawingText.normal);
me.menuParagraphDirect90.setChecked(dir == Asc.c_oAscVertDrawingText.vert);
me.menuParagraphDirect270.setChecked(dir == Asc.c_oAscVertDrawingText.vert270);
} else {
- menuParagraphVAlign.setIconCls('');
- menuParagraphDirection.setIconCls('');
+ me.menuParagraphVAlign.setIconCls('');
+ me.menuParagraphDirection.setIconCls('');
}
- menuParagraphVAlign.setDisabled(disabled);
- menuParagraphDirection.setDisabled(disabled);
+ me.menuParagraphVAlign.setDisabled(disabled);
+ me.menuParagraphDirection.setDisabled(disabled);
var text = null;
@@ -3265,40 +1870,40 @@ define([
text = me.api.can_AddHyperlink();
}
- menuAddHyperlinkPara.setVisible(value.hyperProps===undefined && text!==false);
+ me.menuAddHyperlinkPara.setVisible(value.hyperProps===undefined && text!==false);
menuHyperlinkPara.setVisible(value.hyperProps!==undefined);
- menuEditHyperlinkPara.hyperProps = value.hyperProps;
+ me.menuEditHyperlinkPara.hyperProps = value.hyperProps;
if (text!==false) {
- menuAddHyperlinkPara.hyperProps = {};
- menuAddHyperlinkPara.hyperProps.value = new Asc.CHyperlinkProperty();
- menuAddHyperlinkPara.hyperProps.value.put_Text(text);
+ me.menuAddHyperlinkPara.hyperProps = {};
+ me.menuAddHyperlinkPara.hyperProps.value = new Asc.CHyperlinkProperty();
+ me.menuAddHyperlinkPara.hyperProps.value.put_Text(text);
}
/** coauthoring begin **/
- menuAddCommentPara.setVisible(!isInChart && isInShape && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments);
+ me.menuAddCommentPara.setVisible(!isInChart && isInShape && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments);
/** coauthoring end **/
- menuCommentParaSeparator.setVisible(/** coauthoring begin **/ menuAddCommentPara.isVisible() || /** coauthoring end **/ menuAddHyperlinkPara.isVisible() || menuHyperlinkPara.isVisible());
- menuAddHyperlinkPara.setDisabled(disabled);
+ menuCommentParaSeparator.setVisible(/** coauthoring begin **/ me.menuAddCommentPara.isVisible() || /** coauthoring end **/ me.menuAddHyperlinkPara.isVisible() || menuHyperlinkPara.isVisible());
+ me.menuAddHyperlinkPara.setDisabled(disabled);
menuHyperlinkPara.setDisabled(disabled);
/** coauthoring begin **/
- menuAddCommentPara.setDisabled(disabled);
+ me.menuAddCommentPara.setDisabled(disabled);
/** coauthoring end **/
- menuParagraphAdvanced.setDisabled(disabled);
- menuParaCut.setDisabled(disabled);
- menuParaPaste.setDisabled(disabled);
+ me.menuParagraphAdvanced.setDisabled(disabled);
+ me.menuParaCut.setDisabled(disabled);
+ me.menuParaPaste.setDisabled(disabled);
// spellCheck
var spell = (value.spellProps!==undefined && value.spellProps.value.get_Checked()===false);
me.menuSpellPara.setVisible(spell);
menuSpellcheckParaSeparator.setVisible(spell);
- menuIgnoreSpellPara.setVisible(spell);
- menuIgnoreAllSpellPara.setVisible(spell);
- menuToDictionaryPara.setVisible(spell && me.mode.isDesktopApp);
+ me.menuIgnoreSpellPara.setVisible(spell);
+ me.menuIgnoreAllSpellPara.setVisible(spell);
+ me.menuToDictionaryPara.setVisible(spell && me.mode.isDesktopApp);
me.langParaMenu.setVisible(spell);
me.langParaMenu.setDisabled(disabled);
menuIgnoreSpellParaSeparator.setVisible(spell);
@@ -3327,24 +1932,24 @@ define([
me.menuSpellPara,
me.menuSpellMorePara,
menuSpellcheckParaSeparator,
- menuIgnoreSpellPara,
- menuIgnoreAllSpellPara,
- menuToDictionaryPara,
+ me.menuIgnoreSpellPara,
+ me.menuIgnoreAllSpellPara,
+ me.menuToDictionaryPara,
me.langParaMenu,
menuIgnoreSpellParaSeparator,
- menuParaCut,
- menuParaCopy,
- menuParaPaste,
+ me.menuParaCut,
+ me.menuParaCopy,
+ me.menuParaPaste,
menuEquationSeparator,
{ caption: '--' },
- menuParagraphVAlign,
- menuParagraphDirection,
- menuParagraphAdvanced,
+ me.menuParagraphVAlign,
+ me.menuParagraphDirection,
+ me.menuParagraphAdvanced,
menuCommentParaSeparator,
/** coauthoring begin **/
- menuAddCommentPara,
+ me.menuAddCommentPara,
/** coauthoring end **/
- menuAddHyperlinkPara,
+ me.menuAddHyperlinkPara,
menuHyperlinkPara
]
}).on('hide:after', function(menu, e, isFromInputControl) {
@@ -3385,25 +1990,25 @@ define([
cls = 'menu__icon btn-align-bottom';
break;
}
- menuTableCellAlign.setIconCls(cls);
+ me.menuTableCellAlign.setIconCls(cls);
me.menuTableCellTop.setChecked(align == Asc.c_oAscVertAlignJc.Top);
me.menuTableCellCenter.setChecked(align == Asc.c_oAscVertAlignJc.Center);
me.menuTableCellBottom.setChecked(align == Asc.c_oAscVertAlignJc.Bottom);
if (me.api) {
- mnuTableMerge.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeMergeCells());
- mnuTableSplit.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeSplitCells());
+ me.mnuTableMerge.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeMergeCells());
+ me.mnuTableSplit.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeSplitCells());
}
- menuTableDistRows.setDisabled(value.tableProps.locked || disabled);
- menuTableDistCols.setDisabled(value.tableProps.locked || disabled);
+ me.menuTableDistRows.setDisabled(value.tableProps.locked || disabled);
+ me.menuTableDistCols.setDisabled(value.tableProps.locked || disabled);
me.tableMenu.items[7].setDisabled(value.tableProps.locked || disabled);
me.tableMenu.items[8].setDisabled(value.tableProps.locked || disabled);
- menuTableCellAlign.setDisabled(value.tableProps.locked || disabled);
- menuTableAdvanced.setDisabled(value.tableProps.locked || disabled);
- menuTableCut.setDisabled(value.tableProps.locked || disabled);
- menuTablePaste.setDisabled(value.tableProps.locked || disabled);
+ me.menuTableCellAlign.setDisabled(value.tableProps.locked || disabled);
+ me.menuTableAdvanced.setDisabled(value.tableProps.locked || disabled);
+ me.menuTableCut.setDisabled(value.tableProps.locked || disabled);
+ me.menuTablePaste.setDisabled(value.tableProps.locked || disabled);
// hyperlink properties
var text = null;
@@ -3412,30 +2017,30 @@ define([
text = me.api.can_AddHyperlink();
}
- menuAddHyperlinkTable.setVisible(!_.isUndefined(value.paraProps) && _.isUndefined(value.hyperProps) && text!==false);
+ me.menuAddHyperlinkTable.setVisible(!_.isUndefined(value.paraProps) && _.isUndefined(value.hyperProps) && text!==false);
menuHyperlinkTable.setVisible(!_.isUndefined(value.paraProps) && !_.isUndefined(value.hyperProps));
- menuEditHyperlinkTable.hyperProps = value.hyperProps;
+ me.menuEditHyperlinkTable.hyperProps = value.hyperProps;
if (text!==false) {
- menuAddHyperlinkTable.hyperProps = {};
- menuAddHyperlinkTable.hyperProps.value = new Asc.CHyperlinkProperty();
- menuAddHyperlinkTable.hyperProps.value.put_Text(text);
+ me.menuAddHyperlinkTable.hyperProps = {};
+ me.menuAddHyperlinkTable.hyperProps.value = new Asc.CHyperlinkProperty();
+ me.menuAddHyperlinkTable.hyperProps.value.put_Text(text);
}
if (!_.isUndefined(value.paraProps)) {
- menuAddHyperlinkTable.setDisabled(value.paraProps.locked || disabled);
+ me.menuAddHyperlinkTable.setDisabled(value.paraProps.locked || disabled);
menuHyperlinkTable.setDisabled(value.paraProps.locked || disabled);
me._currentParaObjDisabled = value.paraProps.locked || disabled;
}
/** coauthoring begin **/
- menuAddCommentTable.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments);
- menuAddCommentTable.setDisabled(!_.isUndefined(value.paraProps) && value.paraProps.locked || disabled);
+ me.menuAddCommentTable.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments);
+ me.menuAddCommentTable.setDisabled(!_.isUndefined(value.paraProps) && value.paraProps.locked || disabled);
/** coauthoring end **/
- menuHyperlinkSeparator.setVisible(menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible() /** coauthoring begin **/|| menuAddCommentTable.isVisible()/** coauthoring end **/);
+ menuHyperlinkSeparator.setVisible(me.menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible() /** coauthoring begin **/|| me.menuAddCommentTable.isVisible()/** coauthoring end **/);
me.menuSpellCheckTable.setVisible(value.spellProps!==undefined && value.spellProps.value.get_Checked()===false);
- menuToDictionaryTable.setVisible(me.mode.isDesktopApp);
+ me.menuToDictionaryTable.setVisible(me.mode.isDesktopApp);
menuSpellcheckTableSeparator.setVisible(value.spellProps!==undefined && value.spellProps.value.get_Checked()===false);
me.langTableMenu.setDisabled(disabled);
@@ -3463,103 +2068,31 @@ define([
items: [
me.menuSpellCheckTable,
menuSpellcheckTableSeparator,
- menuTableCut,
- menuTableCopy,
- menuTablePaste,
+ me.menuTableCut,
+ me.menuTableCopy,
+ me.menuTablePaste,
{ caption: '--' },
- new Common.UI.MenuItem({
- caption : me.selectText,
- menu : new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items: [
- new Common.UI.MenuItem({
- caption : me.rowText
- }).on('click', function() {if (me.api) me.api.selectRow()}),
- new Common.UI.MenuItem({
- caption : me.columnText
- }).on('click', function() {if (me.api) me.api.selectColumn()}),
- new Common.UI.MenuItem({
- caption : me.cellText
- }).on('click', function() {if (me.api) me.api.selectCell()}),
- new Common.UI.MenuItem({
- caption : me.tableText
- }).on('click', function() {if (me.api) me.api.selectTable()})
- ]
- })
- }),
- {
- iconCls: 'menu__icon btn-addcell',
- caption : me.insertText,
- menu : new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- style : 'width: 100px',
- items : [
- new Common.UI.MenuItem({
- caption: me.insertColumnLeftText
- }).on('click', function(item) {
- if (me.api)
- me.api.addColumnLeft();
- }),
- new Common.UI.MenuItem({
- caption: me.insertColumnRightText
- }).on('click', function(item) {
- if (me.api)
- me.api.addColumnRight();
- }),
- new Common.UI.MenuItem({
- caption: me.insertRowAboveText
- }).on('click', function(item) {
- if (me.api)
- me.api.addRowAbove();
- }),
- new Common.UI.MenuItem({
- caption: me.insertRowBelowText
- }).on('click', function(item) {
- if (me.api)
- me.api.addRowBelow();
- })
- ]
- })
- },
- new Common.UI.MenuItem({
- iconCls: 'menu__icon btn-delcell',
- caption : me.deleteText,
- menu : new Common.UI.Menu({
- cls: 'shifted-right',
- menuAlign: 'tl-tr',
- items: [
- new Common.UI.MenuItem({
- caption : me.rowText
- }).on('click', function() {if (me.api) me.api.remRow()}),
- new Common.UI.MenuItem({
- caption : me.columnText
- }).on('click', function() {if (me.api) me.api.remColumn()}),
- new Common.UI.MenuItem({
- caption : me.tableText
- }).on('click', function() {if (me.api) me.api.remTable()})
- ]
- })
- }),
+ me.menuTableSelectText,
+ me.menuTableInsertText,
+ me.menuTableDeleteText,
{ caption: '--' },
- mnuTableMerge,
- mnuTableSplit,
+ me.mnuTableMerge,
+ me.mnuTableSplit,
{ caption: '--' },
- menuTableDistRows,
- menuTableDistCols,
+ me.menuTableDistRows,
+ me.menuTableDistCols,
{ caption: '--' },
- menuTableCellAlign,
+ me.menuTableCellAlign,
{ caption: '--' },
- menuTableAdvanced,
+ me.menuTableAdvanced,
menuHyperlinkSeparator,
/** coauthoring begin **/
- menuAddCommentTable,
+ me.menuAddCommentTable,
/** coauthoring end **/
- menuAddHyperlinkTable,
+ me.menuAddHyperlinkTable,
menuHyperlinkTable,
{ caption: '--' },
- menuAddToLayoutTable
+ me.menuAddToLayoutTable
]
}).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) {
@@ -3576,8 +2109,8 @@ define([
restoreHeightAndTop: true,
initMenu: function(value){
if (me.api) {
- mnuUnGroupImg.setDisabled(!me.api.canUnGroup());
- mnuGroupImg.setDisabled(!me.api.canGroup());
+ me.mnuUnGroupImg.setDisabled(!me.api.canUnGroup());
+ me.mnuGroupImg.setDisabled(!me.api.canGroup());
}
var isimage = (_.isUndefined(value.shapeProps) || value.shapeProps.value.get_FromImage()) && _.isUndefined(value.chartProps),
@@ -3588,86 +2121,86 @@ define([
pluginGuid = (value.imgProps) ? value.imgProps.value.asc_getPluginGuid() : null,
inSmartartInternal = value.shapeProps && value.shapeProps.value.get_FromSmartArtInternal();
- mnuArrangeFront.setDisabled(inSmartartInternal);
- mnuArrangeBack.setDisabled(inSmartartInternal);
- mnuArrangeForward.setDisabled(inSmartartInternal);
- mnuArrangeBackward.setDisabled(inSmartartInternal);
+ me.mnuArrangeFront.setDisabled(inSmartartInternal);
+ me.mnuArrangeBack.setDisabled(inSmartartInternal);
+ me.mnuArrangeForward.setDisabled(inSmartartInternal);
+ me.mnuArrangeBackward.setDisabled(inSmartartInternal);
- menuImgShapeRotate.setVisible(_.isUndefined(value.chartProps) && (pluginGuid===null || pluginGuid===undefined));
- if (menuImgShapeRotate.isVisible()) {
- menuImgShapeRotate.setDisabled(disabled || (value.shapeProps && value.shapeProps.value.get_FromSmartArt()));
- menuImgShapeRotate.menu.items[3].setDisabled(inSmartartInternal);
- menuImgShapeRotate.menu.items[4].setDisabled(inSmartartInternal);
+ me.menuImgShapeRotate.setVisible(_.isUndefined(value.chartProps) && (pluginGuid===null || pluginGuid===undefined));
+ if (me.menuImgShapeRotate.isVisible()) {
+ me.menuImgShapeRotate.setDisabled(disabled || (value.shapeProps && value.shapeProps.value.get_FromSmartArt()));
+ me.menuImgShapeRotate.menu.items[3].setDisabled(inSmartartInternal);
+ me.menuImgShapeRotate.menu.items[4].setDisabled(inSmartartInternal);
}
// image properties
- menuImgOriginalSize.setVisible(isimage);
- if (menuImgOriginalSize.isVisible())
- menuImgOriginalSize.setDisabled(disabled || _.isNull(value.imgProps.value.get_ImageUrl()) || _.isUndefined(value.imgProps.value.get_ImageUrl()));
+ me.menuImgOriginalSize.setVisible(isimage);
+ if (me.menuImgOriginalSize.isVisible())
+ me.menuImgOriginalSize.setDisabled(disabled || _.isNull(value.imgProps.value.get_ImageUrl()) || _.isUndefined(value.imgProps.value.get_ImageUrl()));
- menuImgReplace.setVisible(isimage && (pluginGuid===null || pluginGuid===undefined));
- if (menuImgReplace.isVisible())
- menuImgReplace.setDisabled(disabled || pluginGuid===null);
- menuImgReplace.menu.items[2].setVisible(me.mode.canRequestInsertImage || me.mode.fileChoiceUrl && me.mode.fileChoiceUrl.indexOf("{documentType}")>-1);
+ me.menuImgReplace.setVisible(isimage && (pluginGuid===null || pluginGuid===undefined));
+ if (me.menuImgReplace.isVisible())
+ me.menuImgReplace.setDisabled(disabled || pluginGuid===null);
+ me.menuImgReplace.menu.items[2].setVisible(me.mode.canRequestInsertImage || me.mode.fileChoiceUrl && me.mode.fileChoiceUrl.indexOf("{documentType}")>-1);
me.menuImgCrop.setVisible(me.api.asc_canEditCrop());
if (me.menuImgCrop.isVisible())
me.menuImgCrop.setDisabled(disabled);
var canEditPoints = me.api && me.api.asc_canEditGeometry();
- menuImgEditPoints.setVisible(canEditPoints);
+ me.menuImgEditPoints.setVisible(canEditPoints);
menuImgEditPointsSeparator.setVisible(canEditPoints);
- canEditPoints && menuImgEditPoints.setDisabled(disabled);
+ canEditPoints && me.menuImgEditPoints.setDisabled(disabled);
- menuImageAdvanced.setVisible(isimage);
- menuShapeAdvanced.setVisible(_.isUndefined(value.imgProps) && _.isUndefined(value.chartProps));
- menuChartEdit.setVisible(_.isUndefined(value.imgProps) && !_.isUndefined(value.chartProps) && (_.isUndefined(value.shapeProps) || value.shapeProps.isChart));
- menuImgShapeSeparator.setVisible(menuImageAdvanced.isVisible() || menuShapeAdvanced.isVisible() || menuChartEdit.isVisible());
+ me.menuImageAdvanced.setVisible(isimage);
+ me.menuShapeAdvanced.setVisible(_.isUndefined(value.imgProps) && _.isUndefined(value.chartProps));
+ me.menuChartEdit.setVisible(_.isUndefined(value.imgProps) && !_.isUndefined(value.chartProps) && (_.isUndefined(value.shapeProps) || value.shapeProps.isChart));
+ menuImgShapeSeparator.setVisible(me.menuImageAdvanced.isVisible() || me.menuShapeAdvanced.isVisible() || me.menuChartEdit.isVisible());
/** coauthoring begin **/
- menuAddCommentImg.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments);
- menuCommentSeparatorImg.setVisible(menuAddCommentImg.isVisible());
- menuAddCommentImg.setDisabled(disabled);
+ me.menuAddCommentImg.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments);
+ menuCommentSeparatorImg.setVisible(me.menuAddCommentImg.isVisible());
+ me.menuAddCommentImg.setDisabled(disabled);
/** coauthoring end **/
- menuImgShapeAlign.setDisabled(disabled);
+ me.menuImgShapeAlign.setDisabled(disabled);
if (!disabled) {
var objcount = me.api.asc_getSelectedDrawingObjectsCount(),
slide_checked = Common.Utils.InternalSettings.get("pe-align-to-slide") || false;
- menuImgShapeAlign.menu.items[7].setDisabled(objcount==2 && !slide_checked);
- menuImgShapeAlign.menu.items[8].setDisabled(objcount==2 && !slide_checked);
+ me.menuImgShapeAlign.menu.items[7].setDisabled(objcount==2 && !slide_checked);
+ me.menuImgShapeAlign.menu.items[8].setDisabled(objcount==2 && !slide_checked);
}
- menuImageAdvanced.setDisabled(disabled);
- menuShapeAdvanced.setDisabled(disabled);
- if (menuChartEdit.isVisible())
- menuChartEdit.setDisabled(disabled);
+ me.menuImageAdvanced.setDisabled(disabled);
+ me.menuShapeAdvanced.setDisabled(disabled);
+ if (me.menuChartEdit.isVisible())
+ me.menuChartEdit.setDisabled(disabled);
- menuImgCut.setDisabled(disabled);
- menuImgPaste.setDisabled(disabled);
+ me.menuImgCut.setDisabled(disabled);
+ me.menuImgPaste.setDisabled(disabled);
menuImgShapeArrange.setDisabled(disabled);
- menuAddToLayoutImg.setDisabled(disabled);
+ me.menuAddToLayoutImg.setDisabled(disabled);
},
items: [
- menuImgCut,
- menuImgCopy,
- menuImgPaste,
+ me.menuImgCut,
+ me.menuImgCopy,
+ me.menuImgPaste,
{ caption: '--' },
- menuImgEditPoints,
+ me.menuImgEditPoints,
menuImgEditPointsSeparator,
menuImgShapeArrange,
- menuImgShapeAlign,
- menuImgShapeRotate,
+ me.menuImgShapeAlign,
+ me.menuImgShapeRotate,
menuImgShapeSeparator,
me.menuImgCrop,
- menuImgOriginalSize,
- menuImgReplace,
- menuImageAdvanced,
- menuShapeAdvanced
- ,menuChartEdit
+ me.menuImgOriginalSize,
+ me.menuImgReplace,
+ me.menuImageAdvanced,
+ me.menuShapeAdvanced
+ ,me.menuChartEdit
/** coauthoring begin **/
,menuCommentSeparatorImg,
- menuAddCommentImg,
+ me.menuAddCommentImg,
/** coauthoring end **/
{ caption: '--' },
- menuAddToLayoutImg
+ me.menuAddToLayoutImg
]
}).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) {
@@ -3692,6 +2225,8 @@ define([
title : me.textPrevPage + Common.Utils.String.platformKey('PgUp'),
placement : 'top-right'
});
+
+ this.fireEvent('createdelayedelements', [this, 'edit']);
},
setLanguages: function(langs){
@@ -3711,26 +2246,6 @@ define([
});
me.langParaMenu.menu.resetItems(arrPara);
me.langTableMenu.menu.resetItems(arrTable);
-
- me.langParaMenu.menu.on('item:click', function(menu, item){
- if (me.api){
- if (!_.isUndefined(item.langid))
- me.api.put_TextPrLang(item.langid);
-
- me._currLang.paraid = item.langid;
- me.fireEvent('editcomplete', me);
- }
- });
-
- me.langTableMenu.menu.on('item:click', function(menu, item, e){
- if (me.api){
- if (!_.isUndefined(item.langid))
- me.api.put_TextPrLang(item.langid);
-
- me._currLang.tableid = item.langid;
- me.fireEvent('editcomplete', me);
- }
- });
}
},
@@ -3738,165 +2253,6 @@ define([
this._isDisabled = state;
},
- onInsertImage: function(placeholder, obj, x, y) {
- if (this.api)
- (placeholder) ? this.api.asc_addImage(obj) : this.api.ChangeImageFromFile();
- this.fireEvent('editcomplete', this);
- },
-
- onInsertImageUrl: function(placeholder, obj, x, y) {
- var me = this;
- (new Common.Views.ImageFromUrlDialog({
- handler: function(result, value) {
- if (result == 'ok') {
- if (me.api) {
- var checkUrl = value.replace(/ /g, '');
- if (!_.isEmpty(checkUrl)) {
- if (placeholder)
- me.api.AddImageUrl([checkUrl], undefined, undefined, obj);
- else {
- var props = new Asc.asc_CImgProperty();
- props.put_ImageUrl(checkUrl);
- me.api.ImgApply(props, obj);
- }
- }
- }
- }
- me.fireEvent('editcomplete', me);
- }
- })).show();
- },
-
- onClickPlaceholderChart: function(obj, x, y) {
- if (!this.api) return;
-
- this._state.placeholderObj = obj;
- var menu = this.placeholderMenuChart,
- menuContainer = menu ? this.cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)) : null,
- me = this;
- this._fromShowPlaceholder = true;
- Common.UI.Menu.Manager.hideAll();
-
- if (!menu) {
- this.placeholderMenuChart = menu = new Common.UI.Menu({
- style: 'width: 364px;padding-top: 12px;',
- items: [
- {template: _.template('')}
- ]
- });
- // Prepare menu container
- menuContainer = $(Common.Utils.String.format('', menu.id));
- this.cmpEl.append(menuContainer);
- menu.render(menuContainer);
- menu.cmpEl.attr({tabindex: "-1"});
- menu.on('hide:after', function(){
- if (!me._fromShowPlaceholder)
- me.api.asc_uncheckPlaceholders();
- });
-
- var picker = new Common.UI.DataView({
- el: $('#id-placeholder-menu-chart'),
- parentMenu: menu,
- showLast: false,
- // restoreHeight: 421,
- groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()),
- store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()),
- itemTemplate: _.template('