Updated application.

This commit is contained in:
agolybev
2015-08-17 17:19:04 +03:00
parent cd34405d7e
commit a7b9b3a979
330 changed files with 81139 additions and 172701 deletions

View File

@@ -69,8 +69,11 @@
...
],
customization: {
logoUrl: 'header logo url', // default size 88 x 30
logoUrlEmbedded: 'header logo url', // default size 88 x 30
logo: {
image: url,
imageEmbedded: url,
url: http://...
},
backgroundColor: 'header background color',
textColor: 'header text color',
customer: {

View File

@@ -317,13 +317,13 @@ define(["common/main/lib/component/ComboBox"], function () {
} else {
Common.UI.ComboBox.prototype.onAfterShowMenu.apply(this, arguments);
}
this.flushVisibleFontsTiles();
this.updateVisibleFontsTiles(null, 0);
},
onAfterHideMenu: function (e) {
if (this.lastValue !== this._input.val()) {
this._input.val(this.lastValue);
}
this.flushVisibleFontsTiles();
Common.UI.ComboBox.prototype.onAfterHideMenu.apply(this, arguments);
},
addItemToRecent: function (record) {

View File

@@ -57,12 +57,13 @@
},
onSelectRevision: function (picker, item, record) {
var url = record.get("url"),
rev = record.get("revision");
rev = record.get("revision"),
urlGetTime = new Date();
this.currentChangeId = record.get("changeid");
this.currentArrColors = record.get("arrColors");
this.currentDocId = record.get("docId");
this.currentDocIdPrev = record.get("docIdPrev");
if (_.isEmpty(url)) {
if (_.isEmpty(url) || (urlGetTime - record.get("urlGetTime") > 5 * 60000)) {
_.delay(function () {
Common.Gateway.requestHistoryData(rev);
},
@@ -76,6 +77,10 @@
hist.asc_setCurrentChangeId(this.currentChangeId);
hist.asc_setArrColors(this.currentArrColors);
this.api.asc_showRevision(hist);
var commentsController = this.getApplication().getController("Common.Controllers.Comments");
if (commentsController) {
commentsController.onApiHideComment();
}
}
},
onSetHistoryData: function (opts) {
@@ -92,12 +97,14 @@
var data = opts.data;
var historyStore = this.getApplication().getCollection("Common.Collections.HistoryVersions");
if (historyStore && data !== null) {
var rev, revisions = historyStore.findRevisions(data.version);
var rev, revisions = historyStore.findRevisions(data.version),
urlGetTime = new Date();
if (revisions && revisions.length > 0) {
for (var i = 0; i < revisions.length; i++) {
rev = revisions[i];
rev.set("url", opts.data.url);
rev.set("urlDiff", opts.data.urlDiff);
rev.set("urlGetTime", urlGetTime);
}
}
var hist = new Asc.asc_CVersionHistory();
@@ -107,6 +114,10 @@
hist.asc_setCurrentChangeId(this.currentChangeId);
hist.asc_setArrColors(this.currentArrColors);
this.api.asc_showRevision(hist);
var commentsController = this.getApplication().getController("Common.Controllers.Comments");
if (commentsController) {
commentsController.onApiHideComment();
}
}
}
},

View File

@@ -47,6 +47,7 @@ define(["underscore", "backbone", "common/main/lib/component/BaseView"], functio
id: Common.UI.getId(),
url: "",
urlDiff: "",
urlGetTime: "",
docId: "",
docIdPrev: "",
arrColors: [],

View File

@@ -80,8 +80,12 @@
value = customer.address;
value && value.length ? this.lblCompanyAddress.text(value) : this.lblCompanyAddress.parents("tr").addClass("hidden");
(value = customer.mail) && value.length ? this.lblCompanyMail.attr("href", "mailto:" + value).text(value) : this.lblCompanyMail.parents("tr").addClass("hidden");
(value = customer.www) && value.length ? this.lblCompanyUrl.attr("href", "http://" + value).text(value) : this.lblCompanyUrl.parents("tr").addClass("hidden");
(value = customer.info) && value.length ? this.lblCompanyLic.text(value) : this.lblCompanyLic.parents("tr").addClass("hidden");
if ((value = customer.www) && value.length) {
var http = !/^https?:\/{2}/i.test(value) ? "http://": "";
this.lblCompanyUrl.attr("href", http + value).text(value);
} else {
this.lblCompanyUrl.parents("tr").addClass("hidden");
} (value = customer.info) && value.length ? this.lblCompanyLic.text(value) : this.lblCompanyLic.parents("tr").addClass("hidden");
(value = customer.logo) && value.length ? this.divCompanyLogo.html('<img src="' + value + '" />') : this.divCompanyLogo.parents("tr").addClass("hidden");
} else {
this.cntLicenseeInfo.addClass("hidden");

View File

@@ -45,7 +45,8 @@ define(["backbone", "text!common/main/lib/template/Header.template", "core"], fu
template: _.template(headerTemplate),
events: {
"click #header-logo": function (e) {
var newDocumentPage = window.open("http://www.onlyoffice.com");
var _url = !!this.branding && !!this.branding.logo && !!this.branding.logo.url ? this.branding.logo.url : "http://www.onlyoffice.com";
var newDocumentPage = window.open(_url);
newDocumentPage && newDocumentPage.focus();
}
},
@@ -70,10 +71,10 @@ define(["backbone", "text!common/main/lib/template/Header.template", "core"], fu
setBranding: function (value) {
var element;
this.branding = value;
if (value && value.logoUrl) {
if (value && value.logo && value.logo.image) {
element = $("#header-logo");
if (element) {
element.css("background-image", 'url("' + value.logoUrl + '")');
element.css("background-image", 'url("' + value.logo.image + '")');
}
}
},

View File

@@ -213,12 +213,18 @@
Common.Analytics.trackEvent("Load", "Complete");
}
function onEditorPermissions(params) {
if (params.asc_getCanBranding() && (typeof config.customization == "object") && config.customization && config.customization.logoUrlEmbedded) {
$("#header-logo").css({
"background-image": 'url("' + config.customization.logoUrlEmbedded + '")',
"background-position": "0 center",
"background-repeat": "no-repeat"
});
if (params.asc_getCanBranding() && (typeof config.customization == "object") && config.customization && config.customization.logo) {
var logo = $("#header-logo");
if (config.customization.logo.imageEmbedded) {
logo.css({
"background-image": 'url("' + config.customization.logo.imageEmbedded + '")',
"background-position": "0 center",
"background-repeat": "no-repeat"
});
}
if (config.customization.logo.url) {
logo.attr("href", config.customization.logo.url);
}
}
}
function showMask() {
@@ -450,7 +456,7 @@
updateEmbedCode();
api && api.asc_enableKeyEvents(true);
});
$("#page-number").on("keypress", function (e) {
$("#page-number").on("keyup", function (e) {
if (e.keyCode == 13) {
var newPage = parseInt($("#page-number").val());
if (newPage > maxPages) {
@@ -464,6 +470,9 @@
}
}
});
$("#page-number").on("focusout", function (e) {
api && api.asc_enableKeyEvents(true);
});
$("#id-btn-fullscreen").on("click", function () {
openLink(embedConfig.fullscreenUrl);
});

View File

@@ -95,6 +95,9 @@
if (this.mode.canCoAuthoring && this.mode.canChat) {
this.api.asc_registerCallback("asc_onCoAuthoringChatReceiveMessage", _.bind(this.onApiChatMessage, this));
}
if (!this.mode.canLicense) {
this.api.SetCollaborativeMarksShowType(c_oAscCollaborativeMarksShowType.None);
}
this.leftMenu.getMenu("file").setApi(api);
if (this.mode.canUseHistory) {
this.getApplication().getController("Common.Controllers.History").setApi(this.api);
@@ -202,7 +205,7 @@
default:
value = c_oAscCollaborativeMarksShowType.LastChanges;
}
this.api.SetCollaborativeMarksShowType(value);
this.api.SetCollaborativeMarksShowType(this.mode.canLicense ? value : c_oAscCollaborativeMarksShowType.None);
value = window.localStorage.getItem("de-settings-livecomment");
(!(value !== null && parseInt(value) == 0)) ? this.api.asc_showComments() : this.api.asc_hideComments();
value = window.localStorage.getItem("de-settings-fontrender");

View File

@@ -307,11 +307,9 @@
arrColors.push(user.get("colorval"));
var changes = version.changes,
change, i;
if (changes) {
if (changes.length > 0) {
arrVersions[arrVersions.length - 1].set("changeid", changes.length - 1);
arrVersions[arrVersions.length - 1].set("docIdPrev", docIdPrev);
}
if (changes && changes.length > 0) {
arrVersions[arrVersions.length - 1].set("changeid", changes.length - 1);
arrVersions[arrVersions.length - 1].set("docIdPrev", docIdPrev);
for (i = changes.length - 2; i >= 0; i--) {
change = changes[i];
user = usersStore.findUser(change.user.id);
@@ -338,6 +336,10 @@
}));
arrColors.push(user.get("colorval"));
}
} else {
if (ver == 0 && versions.length == 1) {
arrVersions[arrVersions.length - 1].set("docId", version.key + "1");
}
}
}
}

View File

@@ -92,7 +92,7 @@
DE.Views.FileMenuPanels.Settings = Common.UI.BaseView.extend(_.extend({
el: "#panel-settings",
menu: undefined,
template: _.template(["<table><tbody>", '<tr class="edit">', '<td class="left"><label><%= scope.txtInput %></label></td>', '<td class="right"><div id="fms-chb-input-mode"/></td>', "</tr>", '<tr class="divider edit"></tr>', '<tr class="coauth">', '<td class="left"><label><%= scope.txtLiveComment %></label></td>', '<td class="right"><div id="fms-chb-live-comment"/></td>', "</tr>", '<tr class="divider coauth"></tr>', '<tr class="edit">', '<td class="left"><label><%= scope.txtSpellCheck %></label></td>', '<td class="right"><div id="fms-chb-spell-check"/></td>', "</tr>", '<tr class="divider edit"></tr>', '<tr class="autosave">', '<td class="left"><label><%= scope.textAutoSave %></label></td>', '<td class="right"><span id="fms-chb-autosave" /></td>', "</tr>", '<tr class="divider autosave"></tr>', "<tr>", '<td class="left"><label><%= scope.textAlignGuides %></label></td>', '<td class="right"><span id="fms-chb-align-guides" /></td>', "</tr>", '<tr class="divider"></tr>', "<tr>", '<td class="left"><label><%= scope.strZoom %></label></td>', '<td class="right"><div id="fms-cmb-zoom" class="input-group-nr" /></td>', "</tr>", '<tr class="divider"></tr>', '<tr class="coauth">', '<td class="left"><label><%= scope.strShowChanges %></label></td>', '<td class="right"><span id="fms-cmb-show-changes" /></td>', "</tr>", '<tr class="divider coauth"></tr>', "<tr>", '<td class="left"><label><%= scope.strFontRender %></label></td>', '<td class="right"><span id="fms-cmb-font-render" /></td>', "</tr>", '<tr class="divider"></tr>', '<tr class="edit">', '<td class="left"><label><%= scope.strUnit %></label></td>', '<td class="right"><span id="fms-cmb-unit" /></td>', "</tr>", '<tr class="divider edit"></tr>', "<tr>", '<td class="left"></td>', '<td class="right"><button id="fms-btn-apply" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>', "</tr>", "</tbody></table>"].join("")),
template: _.template(["<table><tbody>", '<tr class="edit">', '<td class="left"><label><%= scope.txtInput %></label></td>', '<td class="right"><div id="fms-chb-input-mode"/></td>', "</tr>", '<tr class="divider edit"></tr>', '<tr class="coauth">', '<td class="left"><label><%= scope.txtLiveComment %></label></td>', '<td class="right"><div id="fms-chb-live-comment"/></td>', "</tr>", '<tr class="divider coauth"></tr>', '<tr class="edit">', '<td class="left"><label><%= scope.txtSpellCheck %></label></td>', '<td class="right"><div id="fms-chb-spell-check"/></td>', "</tr>", '<tr class="divider edit"></tr>', '<tr class="autosave">', '<td class="left"><label><%= scope.textAutoSave %></label></td>', '<td class="right"><span id="fms-chb-autosave" /></td>', "</tr>", '<tr class="divider autosave"></tr>', "<tr>", '<td class="left"><label><%= scope.textAlignGuides %></label></td>', '<td class="right"><span id="fms-chb-align-guides" /></td>', "</tr>", '<tr class="divider"></tr>', "<tr>", '<td class="left"><label><%= scope.strZoom %></label></td>', '<td class="right"><div id="fms-cmb-zoom" class="input-group-nr" /></td>', "</tr>", '<tr class="divider"></tr>', '<tr class="coauth changes">', '<td class="left"><label><%= scope.strShowChanges %></label></td>', '<td class="right"><span id="fms-cmb-show-changes" /></td>', "</tr>", '<tr class="divider coauth changes"></tr>', "<tr>", '<td class="left"><label><%= scope.strFontRender %></label></td>', '<td class="right"><span id="fms-cmb-font-render" /></td>', "</tr>", '<tr class="divider"></tr>', '<tr class="edit">', '<td class="left"><label><%= scope.strUnit %></label></td>', '<td class="right"><span id="fms-cmb-unit" /></td>', "</tr>", '<tr class="divider edit"></tr>', "<tr>", '<td class="left"></td>', '<td class="right"><button id="fms-btn-apply" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>', "</tr>", "</tbody></table>"].join("")),
initialize: function (options) {
Common.UI.BaseView.prototype.initialize.call(this, arguments);
this.menu = options.menu;
@@ -240,7 +240,8 @@
setMode: function (mode) {
$("tr.edit", this.el)[mode.isEdit ? "show" : "hide"]();
$("tr.autosave", this.el)[mode.isEdit && mode.canAutosave ? "show" : "hide"]();
$("tr.coauth", this.el)[mode.canCoAuthoring && mode.isEdit ? "show" : "hide"]();
$("tr.coauth", this.el)[mode.isEdit && mode.canCoAuthoring ? "show" : "hide"]();
$("tr.coauth.changes", this.el)[mode.isEdit && mode.canLicense ? "show" : "hide"]();
},
updateSettings: function () {
var value = window.localStorage.getItem("de-settings-inputmode");

View File

@@ -37,11 +37,12 @@
template: _.template(menuTemplate),
events: function () {
return {
"click #left-btn-support": function () {
window.open("http://feedback.onlyoffice.com/");
},
"click #left-btn-comments": _.bind(this.onCoauthOptions, this),
"click #left-btn-chat": _.bind(this.onCoauthOptions, this)
"click #left-btn-chat": _.bind(this.onCoauthOptions, this),
"click #left-btn-support": function () {
var config = this.mode.customization;
config && !!config.feedback && !!config.feedback.url ? window.open(config.feedback.url) : window.open("http://feedback.onlyoffice.com/");
}
};
},
initialize: function () {

View File

@@ -101,7 +101,7 @@
"DE.Controllers.LeftMenu.newDocumentTitle": "Unbetiteltes Dokument",
"DE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning",
"DE.Controllers.LeftMenu.requestEditRightsText": "Anfrage betreffend die Bearbeitungsberechtigung...",
"DE.Controllers.LeftMenu.textLoadHistory": "Loading versions history...",
"DE.Controllers.LeftMenu.textLoadHistory": "Versionen-Historie wird geladen...",
"DE.Controllers.LeftMenu.textNoTextFound": "Die Daten, nach denen Sie gesucht haben, können nicht gefunden werden. Bitte ändern Sie die Suchparameter.",
"DE.Controllers.LeftMenu.textReplaceSkipped": "Der Ersatzvorgang wurde durchgeführt. {0} Vorkommen wurden ausgelassen.",
"DE.Controllers.LeftMenu.textReplaceSuccess": "Der Suchvorgang wurde durchgeführt. Vorkommen wurden ersetzt:{0}",
@@ -699,7 +699,7 @@
"DE.Views.FileMenu.btnPrintCaption": "Drucken",
"DE.Views.FileMenu.btnRecentFilesCaption": "Zuletzt benutztes öffnen...",
"DE.Views.FileMenu.btnReturnCaption": "Zurück zum Dokument",
"DE.Views.FileMenu.btnRightsCaption": "Access Rights...",
"DE.Views.FileMenu.btnRightsCaption": "Zugriffsrechte...",
"DE.Views.FileMenu.btnSaveCaption": "Speichern",
"DE.Views.FileMenu.btnSettingsCaption": "Erweiterte Einstellungen...",
"DE.Views.FileMenu.btnToEditCaption": "Dokument bearbeiten",

View File

@@ -101,7 +101,7 @@
"DE.Controllers.LeftMenu.newDocumentTitle": "Document sans nom",
"DE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning",
"DE.Controllers.LeftMenu.requestEditRightsText": "Demande des droits de modification...",
"DE.Controllers.LeftMenu.textLoadHistory": "Loading versions history...",
"DE.Controllers.LeftMenu.textLoadHistory": "Chargement de l'histoire des versions...",
"DE.Controllers.LeftMenu.textNoTextFound": "Votre recherche n'a donné aucun résultat.S'il vous plaît, modifiez vos critères de recherche.",
"DE.Controllers.LeftMenu.textReplaceSkipped": "Le remplacement est fait. {0} occurrences ont été ignorées.",
"DE.Controllers.LeftMenu.textReplaceSuccess": "La recherche est effectuée. Occurrences ont été remplacées:{0}",
@@ -694,12 +694,12 @@
"DE.Views.FileMenu.btnCreateNewCaption": "Nouvel objet",
"DE.Views.FileMenu.btnDownloadCaption": "Télécharger comme...",
"DE.Views.FileMenu.btnHelpCaption": "Aide...",
"DE.Views.FileMenu.btnHistoryCaption": "Version History",
"DE.Views.FileMenu.btnHistoryCaption": "Historique des versions",
"DE.Views.FileMenu.btnInfoCaption": "Descriptif du document...",
"DE.Views.FileMenu.btnPrintCaption": "Imprimer",
"DE.Views.FileMenu.btnRecentFilesCaption": "Ouvrir récent...",
"DE.Views.FileMenu.btnReturnCaption": "Retour au Document",
"DE.Views.FileMenu.btnRightsCaption": "Access Rights...",
"DE.Views.FileMenu.btnRightsCaption": "Droits d'accès...",
"DE.Views.FileMenu.btnSaveCaption": "Enregistrer",
"DE.Views.FileMenu.btnSettingsCaption": "Paramètres avancés...",
"DE.Views.FileMenu.btnToEditCaption": "Modifier le document",
@@ -874,7 +874,7 @@
"DE.Views.MailMergeEmailDlg.textTo": "To",
"DE.Views.MailMergeEmailDlg.textWarning": "Warning!",
"DE.Views.MailMergeEmailDlg.textWarningMsg": "Please note that mailing cannot be stopped once your click the 'Send' button.",
"DE.Views.MailMergeRecepients.textLoading": "Loading",
"DE.Views.MailMergeRecepients.textLoading": "Chargement",
"DE.Views.MailMergeRecepients.textTitle": "Select Data Source",
"DE.Views.MailMergeSaveDlg.textLoading": "Loading",
"DE.Views.MailMergeSaveDlg.textTitle": "Folder for save",

View File

@@ -83,7 +83,7 @@
"Common.Views.ExternalMergeEditor.textTitle": "Mail Merge Recipients",
"Common.Views.Header.openNewTabText": "Open in New Tab",
"Common.Views.Header.textBack": "Va' ai Documenti",
"Common.Views.History.textHistoryHeader": "Back to Document",
"Common.Views.History.textHistoryHeader": "Torna al documento",
"Common.Views.ImageFromUrlDialog.cancelButtonText": "Annulla",
"Common.Views.ImageFromUrlDialog.okButtonText": "OK",
"Common.Views.ImageFromUrlDialog.textUrl": "Incolla URL immagine:",
@@ -694,12 +694,12 @@
"DE.Views.FileMenu.btnCreateNewCaption": "Crea nuovo oggetto",
"DE.Views.FileMenu.btnDownloadCaption": "Scarica in...",
"DE.Views.FileMenu.btnHelpCaption": "Guida...",
"DE.Views.FileMenu.btnHistoryCaption": "Version History",
"DE.Views.FileMenu.btnHistoryCaption": "Cronologia delle versioni",
"DE.Views.FileMenu.btnInfoCaption": "Informazioni documento...",
"DE.Views.FileMenu.btnPrintCaption": "Stampa",
"DE.Views.FileMenu.btnRecentFilesCaption": "Apri recenti...",
"DE.Views.FileMenu.btnReturnCaption": "Torna al documento",
"DE.Views.FileMenu.btnRightsCaption": "Access Rights...",
"DE.Views.FileMenu.btnRightsCaption": "Diritti di accesso...",
"DE.Views.FileMenu.btnSaveCaption": "Salva",
"DE.Views.FileMenu.btnSettingsCaption": "Impostazioni avanzate...",
"DE.Views.FileMenu.btnToEditCaption": "Modifica documento",

View File

@@ -699,7 +699,7 @@
"DE.Views.FileMenu.btnPrintCaption": "Imprimir",
"DE.Views.FileMenu.btnRecentFilesCaption": "Abrir recente...",
"DE.Views.FileMenu.btnReturnCaption": "Voltar para documento",
"DE.Views.FileMenu.btnRightsCaption": "Access Rights...",
"DE.Views.FileMenu.btnRightsCaption": "Direitos de Acesso...",
"DE.Views.FileMenu.btnSaveCaption": "Salvar",
"DE.Views.FileMenu.btnSettingsCaption": "Configurações avançadas...",
"DE.Views.FileMenu.btnToEditCaption": "Editar documento",

View File

@@ -699,7 +699,7 @@
"DE.Views.FileMenu.btnPrintCaption": "Natisni",
"DE.Views.FileMenu.btnRecentFilesCaption": "Odpri nedavno...",
"DE.Views.FileMenu.btnReturnCaption": "Nazaj v dokument",
"DE.Views.FileMenu.btnRightsCaption": "Access Rights...",
"DE.Views.FileMenu.btnRightsCaption": "Uporabniške pravice...",
"DE.Views.FileMenu.btnSaveCaption": "Shrani",
"DE.Views.FileMenu.btnSettingsCaption": "Napredne nastavitve...",
"DE.Views.FileMenu.btnToEditCaption": "Uredi dokument",

View File

@@ -81,13 +81,13 @@
function loadConfig(data) {
config = $.extend(config, data.config);
embedConfig = $.extend(embedConfig, data.config.embedded);
$("#id-short-url").text(embedConfig.shareUrl || "Unavailable");
$("#id-short-url").val(embedConfig.shareUrl || "Unavailable");
$("#id-textarea-embed").text(embedCode.replace("{embed-url}", embedConfig.embedUrl).replace("{width}", minEmbedWidth).replace("{height}", minEmbedHeight));
if (typeof embedConfig.shareUrl !== "undefined" && embedConfig.shareUrl != "") {
if ($("#id-popover-social-container ul")) {
$("#id-popover-social-container ul").append('<li><div class="fb-like" data-href="' + embedConfig.shareUrl + '" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div></li>');
$("#id-popover-social-container ul").append('<li class="share-twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="' + embedConfig.shareUrl + '">Tweet</a></li>');
$("#id-popover-social-container ul").append('<li class="share-mail"><a class="btn btn-mini" href="mailto:?subject=I have shared a document with you: ' + embedConfig.docTitle + "&body=I have shared a document with you: " + embedConfig.shareUrl + '"><i class="icon-envelope"></i>Email</a></li>');
$("#id-popover-social-container ul").append('<li class="share-mail"><a class="btn btn-xs btn-default" href="mailto:?subject=I have shared a document with you: ' + embedConfig.docTitle + "&body=I have shared a document with you: " + embedConfig.shareUrl + '"><span class="glyphicon glyphicon-envelope"></span>Email</a></li>');
}
}
if (typeof embedConfig.shareUrl === "undefined") {
@@ -210,12 +210,18 @@
Common.Analytics.trackEvent("Load", "Complete");
}
function onEditorPermissions(params) {
if (params.asc_getCanBranding() && (typeof config.customization == "object") && config.customization && config.customization.logoUrlEmbedded) {
$("#header-logo").css({
"background-image": 'url("' + config.customization.logoUrlEmbedded + '")',
"background-position": "0 center",
"background-repeat": "no-repeat"
});
if (params.asc_getCanBranding() && (typeof config.customization == "object") && config.customization && config.customization.logo) {
var logo = $("#header-logo");
if (config.customization.logo.imageEmbedded) {
logo.css({
"background-image": 'url("' + config.customization.logo.imageEmbedded + '")',
"background-position": "0 center",
"background-repeat": "no-repeat"
});
}
if (config.customization.logo.url) {
logo.attr("href", config.customization.logo.url);
}
}
}
function showMask() {
@@ -308,7 +314,7 @@
if (visible) {
if (owner) {
popover.css("display", "block");
var popoverData = owner.data("popover"),
var popoverData = owner.data("bs.popover"),
$tip = popoverData.tip(),
pos = popoverData.getPosition(false),
actualHeight = $tip[0].offsetHeight,
@@ -378,7 +384,7 @@
}
$("#id-btn-copy-short").button("copied");
$("#id-btn-copy-short").addClass("copied");
clipShortUrl.setText($("#id-short-url").text());
clipShortUrl.setText($("#id-short-url").val());
setTimeout(function () {
$("#id-btn-copy-short").button("reset");
$("#id-btn-copy-short").removeClass("copied");

View File

@@ -35,13 +35,13 @@
trigger: "manual",
html: true,
template: '<div class="popover share" id="id-popover-share"><div class="arrow"></div><div class="popover-inner"><div class="popover-content"><p></p></div></div></div>',
content: '<div class="share-link">' + '<span class="caption">Link:</span>' + '<span id="id-short-url" class="input-medium uneditable-input"></span>' + '<button id="id-btn-copy-short" type="button" class="btn btn-mini btn-primary" style="width: 65px;" data-copied-text="Copied">Copy</button>' + "</div> " + '<div class="share-buttons" style="height: 25px" id="id-popover-social-container" data-loaded="false">' + "<ul></ul>" + "</div>"
content: '<div class="share-link">' + '<span class="caption">Link:</span>' + '<input id="id-short-url" class="input-xs form-control" readonly/>' + '<button id="id-btn-copy-short" type="button" class="btn btn-xs btn-primary" style="width: 65px;" data-copied-text="Copied">Copy</button>' + "</div> " + '<div class="share-buttons" style="height: 25px" id="id-popover-social-container" data-loaded="false">' + "<ul></ul>" + "</div>"
}).popover("show");
$("#id-btn-embed").popover({
trigger: "manual",
html: true,
template: '<div class="popover embed" id="id-popover-embed"><div class="arrow"></div><div class="popover-inner"><div class="popover-content"><p></p></div></div></div>',
content: '<div class="size-manual">' + '<span class="caption">Width:</span>' + '<input id="id-input-embed-width" class="input-mini" type="text" value="400px">' + '<input id="id-input-embed-height" class="right input-mini" type="text" value="600px">' + '<span class="right caption">Height:</span>' + "</div>" + '<textarea id="id-textarea-embed" rows="4" readonly></textarea>' + '<button id="id-btn-copy-embed" type="button" class="btn btn-mini btn-primary" data-copied-text="Copied">Copy</button>'
content: '<div class="size-manual">' + '<span class="caption">Width:</span>' + '<input id="id-input-embed-width" class="form-control input-xs" type="text" value="400px">' + '<input id="id-input-embed-height" class="form-control input-xs right" type="text" value="600px">' + '<span class="right caption">Height:</span>' + "</div>" + '<textarea id="id-textarea-embed" rows="4" class="form-control" readonly></textarea>' + '<button id="id-btn-copy-embed" type="button" class="btn btn-xs btn-primary" data-copied-text="Copied">Copy</button>'
}).popover("show");
$("body").popover({
trigger: "manual",

View File

@@ -68,9 +68,6 @@
font-size: 12px;
overflow: hidden;
}
.popover.top {
margin-top: -10px;
}
.viewer {
position: absolute;
margin: 0;
@@ -345,114 +342,6 @@ a.brand-logo {
font-size: 1.6em;
padding-bottom: 10px;
}
.popover .popover-content {
padding: 14px;
}
.popover .btn {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.popover.hyperlink .popover-content {
padding: 5px 10px;
}
.popover.hyperlink .popover-content p {
display: block;
word-wrap: break-word;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.popover.share {
width: 280px;
}
.popover.share .share-link .caption {
margin-right: 8px;
float: left;
}
.popover.share .share-link .uneditable-input {
font-size: 1em;
padding: 0 4px;
margin-right: 5px;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
cursor: auto;
-moz-user-select: text;
-khtml-user-select: text;
-webkit-user-select: text;
-ms-user-select: text;
user-select: text;
}
.popover.share .share-link .input-medium {
width: 130px;
}
.popover.share .share-link .btn {
float: right;
}
.popover.share .share-buttons ul {
height: 25px;
list-style-type: none;
margin: 5px 0 0;
overflow: hidden;
}
.popover.share .share-buttons ul li {
display: inline-block;
float: left;
margin: 1px 5px 0 0;
vertical-align: middle;
}
.popover.share .share-buttons ul li.share-mail {
float: right;
margin: 0;
}
.popover.share .share-buttons ul li.share-mail a {
padding: 2px 8px;
}
.popover.share .share-buttons ul li.share-mail i {
margin-right: 5px;
}
.popover.share .share-buttons ul li.share-twitter {
max-width: 100px;
}
.popover.embed {
width: 270px;
}
.popover.embed .size-manual {
margin-bottom: 10px;
}
.popover.embed .right {
float: right;
}
.popover.embed .caption {
margin-right: 8px;
}
.popover.embed input {
font-size: 1em;
padding: 0 4px;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
margin: 0;
margin-top: -1px;
}
.popover.embed input.input-mini {
width: 40px;
}
.popover.embed textarea {
width: 228px;
resize: none;
cursor: auto;
font-size: 1em;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.popover.embed button {
float: right;
margin: 5px 0 15px;
width: 86px;
}
.modal.error .modal-footer {
text-align: center;
}

View File

@@ -37,11 +37,12 @@
template: _.template(menuTemplate),
events: function () {
return {
"click #left-btn-support": function () {
window.open("http://feedback.onlyoffice.com/");
},
"click #left-btn-comments": _.bind(this.onCoauthOptions, this),
"click #left-btn-chat": _.bind(this.onCoauthOptions, this)
"click #left-btn-chat": _.bind(this.onCoauthOptions, this),
"click #left-btn-support": function () {
var config = this.mode.customization;
config && !!config.feedback && !!config.feedback.url ? window.open(config.feedback.url) : window.open("http://feedback.onlyoffice.com/");
}
};
},
initialize: function () {

View File

@@ -149,8 +149,8 @@
<!-- vendors -->
<script type="text/javascript" src="../../../vendor/touch/sencha-touch-all.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../../../vendor/sockjs/sockjs-0.3.min.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/sockjs/sockjs.min.js"></script>
<script type="text/javascript" src="../../../vendor/underscore/underscore-min.js"></script>
<script type="text/javascript" src="../../../vendor/xregexp/xregexp-all-min.js"></script>

View File

@@ -40,8 +40,8 @@
<!-- vendors -->
<script type="text/javascript" src="../../../vendor/touch/sencha-touch-debug.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../../../vendor/sockjs/sockjs-0.3.min.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/sockjs/sockjs.min.js"></script>
<script type="text/javascript" src="../../../vendor/xregexp/xregexp-all-min.js"></script>
<script type="text/javascript" src="../../../vendor/underscore/underscore-min.js"></script>

View File

@@ -188,12 +188,18 @@
Common.Analytics.trackEvent("Load", "Complete");
}
function onEditorPermissions(params) {
if (params.asc_getCanBranding() && (typeof config.customization == "object") && config.customization && config.customization.logoUrlEmbedded) {
$("#header-logo").css({
"background-image": 'url("' + config.customization.logoUrlEmbedded + '")',
"background-position": "0 center",
"background-repeat": "no-repeat"
});
if (params.asc_getCanBranding() && (typeof config.customization == "object") && config.customization && config.customization.logo) {
var logo = $("#header-logo");
if (config.customization.logo.imageEmbedded) {
logo.css({
"background-image": 'url("' + config.customization.logo.imageEmbedded + '")',
"background-position": "0 center",
"background-repeat": "no-repeat"
});
}
if (config.customization.logo.url) {
logo.attr("href", config.customization.logo.url);
}
}
}
function showMask() {

View File

@@ -37,11 +37,12 @@
template: _.template(menuTemplate),
events: function () {
return {
"click #left-btn-support": function () {
window.open("http://feedback.onlyoffice.com/");
},
"click #left-btn-comments": _.bind(this.onCoauthOptions, this),
"click #left-btn-chat": _.bind(this.onCoauthOptions, this)
"click #left-btn-chat": _.bind(this.onCoauthOptions, this),
"click #left-btn-support": function () {
var config = this.mode.customization;
config && !!config.feedback && !!config.feedback.url ? window.open(config.feedback.url) : window.open("http://feedback.onlyoffice.com/");
}
};
},
initialize: function () {

View File

@@ -2746,6 +2746,12 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
}
}
};
spreadsheet_api.prototype.asc_stopSaving = function () {
this.waitSave = true;
};
spreadsheet_api.prototype.asc_continueSaving = function () {
this.waitSave = false;
};
spreadsheet_api.prototype.offlineModeInit = function () {
var t = this;
if (window["scriptBridge"]) {
@@ -3225,6 +3231,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
prot["asc_coAuthoringGetUsers"] = prot.asc_coAuthoringGetUsers;
prot["asc_coAuthoringChatGetMessages"] = prot.asc_coAuthoringChatGetMessages;
prot["asc_coAuthoringDisconnect"] = prot.asc_coAuthoringDisconnect;
prot["asc_stopSaving"] = prot.asc_stopSaving;
prot["asc_continueSaving"] = prot.asc_continueSaving;
prot["asc_openNewDocument"] = prot.asc_openNewDocument;
prot["asc_loadDocumentFromDisk"] = prot.asc_loadDocumentFromDisk;
prot["asc_nativeOpenFile"] = prot.asc_nativeOpenFile;

View File

@@ -1272,24 +1272,30 @@ asc_docs_api.prototype.sync_DownloadAsCallBack = function () {
asc_docs_api.prototype.sync_StartAction = function (type, id) {
this.asc_fireCallback("asc_onStartAction", type, id);
if (c_oAscAsyncActionType.BlockInteraction == type) {
this.IsLongActionCurrent++;
this.asc_IncrementCounterLongAction();
}
};
asc_docs_api.prototype.sync_EndAction = function (type, id) {
this.asc_fireCallback("asc_onEndAction", type, id);
if (c_oAscAsyncActionType.BlockInteraction == type) {
this.IsLongActionCurrent--;
if (this.IsLongActionCurrent < 0) {
this.IsLongActionCurrent = 0;
}
if (!this.asc_IsLongAction()) {
var _length = this.LongActionCallbacks.length;
for (var i = 0; i < _length; i++) {
this.LongActionCallbacks[i](this.LongActionCallbacksParams[i]);
}
this.LongActionCallbacks.splice(0, _length);
this.LongActionCallbacksParams.splice(0, _length);
this.asc_DecrementCounterLongAction();
}
};
asc_docs_api.prototype.asc_IncrementCounterLongAction = function () {
this.IsLongActionCurrent++;
};
asc_docs_api.prototype.asc_DecrementCounterLongAction = function () {
this.IsLongActionCurrent--;
if (this.IsLongActionCurrent < 0) {
this.IsLongActionCurrent = 0;
}
if (!this.asc_IsLongAction()) {
var _length = this.LongActionCallbacks.length;
for (var i = 0; i < _length; i++) {
this.LongActionCallbacks[i](this.LongActionCallbacksParams[i]);
}
this.LongActionCallbacks.splice(0, _length);
this.LongActionCallbacksParams.splice(0, _length);
}
};
asc_docs_api.prototype.asc_IsLongAction = function () {
@@ -3575,6 +3581,12 @@ asc_docs_api.prototype.asc_getChartPreviews = function (chartType) {
asc_docs_api.prototype.sync_closeChartEditor = function () {
this.asc_fireCallback("asc_onCloseChartEditor");
};
asc_docs_api.prototype.asc_stopSaving = function () {
this.asc_IncrementCounterLongAction();
};
asc_docs_api.prototype.asc_continueSaving = function () {
this.asc_DecrementCounterLongAction();
};
function CContextMenuData() {
this.Type = c_oAscContextMenuTypes.Main;
this.X_abs = 0;

View File

@@ -3820,8 +3820,9 @@ function CDrawingDocument() {
}
} else {
this.GuiCanvasTextProps = document.createElement("canvas");
this.GuiCanvasTextProps.style = "position:absolute;left:0;top:0;";
this.GuiCanvasTextProps.id = this.GuiCanvasTextPropsId;
this.GuiCanvasTextProps.style.position = "absolute";
this.GuiCanvasTextProps.style.left = "0px";
this.GuiCanvasTextProps.style.top = "0px";
var _width = parseInt(_div_elem.offsetWidth);
var _height = parseInt(_div_elem.offsetHeight);
if (0 == _width) {

View File

@@ -749,6 +749,19 @@ function CCollaborativeEditing() {
this.m_aChangedClasses = {};
this.m_oMemory = new CMemory();
var oThis = this;
this.Clear = function () {
this.m_nUseType = 1;
this.m_aUsers = [];
this.m_aChanges = [];
this.m_aNeedUnlock = [];
this.m_aNeedUnlock2 = [];
this.m_aNeedLock = [];
this.m_aLinkData = [];
this.m_aEndActions = [];
this.m_aCheckLocks = [];
this.m_aNewObjects = [];
this.m_aNewImages = [];
};
this.Start_CollaborationEditing = function () {
this.m_nUseType = -1;
};

View File

@@ -913,7 +913,7 @@ asc_docs_api.prototype.LoadFontsFromServer = function (_fonts) {
this.FontLoader.LoadFontsFromServer(_fonts);
};
asc_docs_api.prototype.SetCollaborativeMarksShowType = function (Type) {
if (c_oAscCollaborativeMarksShowType.None !== this.CollaborativeMarksShowType && c_oAscCollaborativeMarksShowType.None === Type) {
if (c_oAscCollaborativeMarksShowType.None !== this.CollaborativeMarksShowType && c_oAscCollaborativeMarksShowType.None === Type && this.WordControl && this.WordControl.m_oLogicDocument) {
this.CollaborativeMarksShowType = Type;
CollaborativeEditing.Clear_CollaborativeMarks(true);
} else {
@@ -2847,24 +2847,30 @@ asc_docs_api.prototype.sync_DownloadAsCallBack = function () {
asc_docs_api.prototype.sync_StartAction = function (type, id) {
this.asc_fireCallback("asc_onStartAction", type, id);
if (c_oAscAsyncActionType.BlockInteraction == type) {
this.IsLongActionCurrent++;
this.asc_IncrementCounterLongAction();
}
};
asc_docs_api.prototype.sync_EndAction = function (type, id) {
this.asc_fireCallback("asc_onEndAction", type, id);
if (c_oAscAsyncActionType.BlockInteraction == type) {
this.IsLongActionCurrent--;
if (this.IsLongActionCurrent < 0) {
this.IsLongActionCurrent = 0;
}
if (!this.asc_IsLongAction()) {
var _length = this.LongActionCallbacks.length;
for (var i = 0; i < _length; i++) {
this.LongActionCallbacks[i](this.LongActionCallbacksParams[i]);
}
this.LongActionCallbacks.splice(0, _length);
this.LongActionCallbacksParams.splice(0, _length);
this.asc_DecrementCounterLongAction();
}
};
asc_docs_api.prototype.asc_IncrementCounterLongAction = function () {
this.IsLongActionCurrent++;
};
asc_docs_api.prototype.asc_DecrementCounterLongAction = function () {
this.IsLongActionCurrent--;
if (this.IsLongActionCurrent < 0) {
this.IsLongActionCurrent = 0;
}
if (!this.asc_IsLongAction()) {
var _length = this.LongActionCallbacks.length;
for (var i = 0; i < _length; i++) {
this.LongActionCallbacks[i](this.LongActionCallbacksParams[i]);
}
this.LongActionCallbacks.splice(0, _length);
this.LongActionCallbacksParams.splice(0, _length);
}
};
asc_docs_api.prototype.asc_IsLongAction = function () {
@@ -6689,6 +6695,12 @@ asc_docs_api.prototype.asc_AddMath2 = function (Type) {
this.WordControl.m_oLogicDocument.Paragraph_Add(MathElement);
}
};
asc_docs_api.prototype.asc_stopSaving = function () {
this.asc_IncrementCounterLongAction();
};
asc_docs_api.prototype.asc_continueSaving = function () {
this.asc_DecrementCounterLongAction();
};
asc_docs_api.prototype.asc_showRevision = function (newObj) {
if (!newObj.docId) {
return;
@@ -6725,6 +6737,7 @@ asc_docs_api.prototype.asc_CloseFile = function () {
History.Clear();
g_oIdCounter.Clear();
g_oTableId.Clear();
CollaborativeEditing.Clear();
this.isApplyChangesOnOpenEnabled = true;
var oLogicDocument = this.WordControl.m_oLogicDocument;
oLogicDocument.Stop_Recalculate();
@@ -6963,6 +6976,7 @@ function CSpellCheckApi_desktop() {
this.onSpellCheck = function (spellData) {
SpellCheck_CallBack(spellData);
};
this.disconnect = function () {};
}
window["AscDesktopEditor_Save"] = function () {
return editor.asc_Save();

View File

@@ -90,4 +90,4 @@
});
grunt.registerTask("compile_sdk", ["compile_sdk_init", "uglify"]);
grunt.registerTask("default", "build_all");
};
};