Merge develop into new-mobile

This commit is contained in:
Alexander Yuzhin 2016-11-23 19:05:03 +03:00
commit 4189255a21
529 changed files with 93542 additions and 106867 deletions

View file

@ -37,10 +37,12 @@
},
permissions: {
edit: <can edit>, // default = true
download: <can download>,
reader: <can view in readable mode>
review: <can review> // default = edit,
print: <can print> // default = true
download: <can download>, // default = true
reader: <can view in readable mode>,
review: <can review>, // default = edit
print: <can print>, // default = true
rename: <can rename>, // default = false
changeHistory: <can change history>, // default = false
}
},
editorConfig: {
@ -60,8 +62,7 @@
user: {
id: 'user id',
firstname: 'user first name',
lastname: 'user last name'
name: 'user name'
},
recent: [
{
@ -111,7 +112,8 @@
leftMenu: true,
rightMenu: true,
toolbar: true,
header: true
header: true,
autosave: true
},
plugins: {
autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}',
@ -149,6 +151,7 @@
editorConfig: {
licenseUrl: <url for license>,
customerId: <customer id>,
autostart: 'document', // action for app's autostart. for presentations default value is 'player'
embedded: {
embedUrl: 'url',
fullscreenUrl: 'url',

View file

@ -0,0 +1,147 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
+function () {
!window.common && (window.common = {});
!common.controller && (common.controller = {});
common.controller.modals = new(function() {
var $dlgShare, $dlgEmbed;
var appConfig;
var embedCode = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="{embed-url}" width="{width}" height="{height}"></iframe>',
minEmbedWidth = 400,
minEmbedHeight = 600;
function copytext(el, event) {
el.select();
if ( !document.execCommand('copy') ) {
window.alert('Browser\'s error! Use keyboard shortcut [Ctrl] + [C]');
}
}
var createDlgShare = function () {
$dlgShare = common.view.modals.create('share');
var _encoded = encodeURIComponent(appConfig.shareUrl);
var _mailto = 'mailto:?subject=I have shared a document with you: ' + appConfig.docTitle + '&body=I have shared a document with you: ' + _encoded + '"';
$dlgShare.find('#btn-copyshort').on('click', copytext.bind(this, $dlgShare.find('#id-short-url')));
$dlgShare.find('.share-buttons > span').on('click', function(e){
var _url;
switch ($(e.target).attr('data-name')) {
case 'facebook':
_url = 'https://www.facebook.com/sharer/sharer.php?u=' + appConfig.shareUrl + '&t=' + encodeURI(appConfig.docTitle);
window.open(_url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');
break;
case 'twitter':
_url = 'https://twitter.com/share?url='+ _encoded;
!!appConfig.docTitle && (_url += encodeURIComponent('&text=' + appConfig.docTitle));
window.open(_url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');
break;
case 'gplus':
_url = 'https://plus.google.com/share?url=' + appConfig.shareUrl;
window.open(_url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes');
break;
case 'email':
window.open(_mailto, '_self');
break;
}
});
$dlgShare.find('#id-short-url').val(appConfig.shareUrl);
$dlgShare.find('.share-buttons > #email.autotest').attr('data-test', _mailto);
};
var createDlgEmbed =function () {
$dlgEmbed = common.view.modals.create('embed');
var txtembed = $dlgEmbed.find('#txt-embed-url');
txtembed.text(embedCode.replace('{embed-url}', appConfig.embedUrl).replace('{width}', minEmbedWidth).replace('{height}', minEmbedHeight));
$dlgEmbed.find('#btn-copyembed').on('click', copytext.bind(this, txtembed));
$dlgEmbed.find('#txt-embed-width, #txt-embed-height').on({
'keypress': function(e){
if (e.keyCode == 13)
updateEmbedCode();
}
, 'focusout': function(e){
updateEmbedCode();
}
});
};
function updateEmbedCode(){
var $txtwidth = $dlgEmbed.find('#txt-embed-width');
var $txtheight = $dlgEmbed.find('#txt-embed-height');
var newWidth = parseInt($txtwidth.val()),
newHeight = parseInt($txtheight.val());
if (newWidth < minEmbedWidth)
newWidth = minEmbedWidth;
if (newHeight < minEmbedHeight)
newHeight = minEmbedHeight;
$dlgEmbed.find('#txt-embed-url').text(embedCode.replace('{embed-url}', appConfig.embedUrl).replace('{width}', newWidth).replace('{height}', newHeight));
$txtwidth.val(newWidth + 'px');
$txtheight.val(newHeight + 'px');
}
var attachToView = function(config) {
if ( config.share && !!appConfig.shareUrl ) {
if ( !$dlgShare ) {
createDlgShare();
}
$(config.share).on('click', function(e){
$dlgShare.modal('show');
});
}
if ( config.embed && !!appConfig.embedUrl ) {
if ( !$dlgEmbed ) {
createDlgEmbed();
}
$(config.embed).on('click', function(e) {
$dlgEmbed.modal('show');
})
}
};
return {
init: function(config) { appConfig = config; }
, attach: attachToView
};
});
}();

View file

@ -0,0 +1,76 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
+function () {
!window.common && (window.common = {});
!common.utils && (common.utils = {});
common.utils = new(function(){
return {
openLink: function(url) {
if (url) {
var newDocumentPage = window.open(url, '_blank');
if (newDocumentPage)
newDocumentPage.focus();
}
}
, dialogPrint: function(url) {
$('#id-print-frame').remove();
if ( !!url ) {
var iframePrint = document.createElement("iframe");
iframePrint.id = "id-print-frame";
iframePrint.style.display = 'none';
iframePrint.style.visibility = "hidden";
iframePrint.style.position = "fixed";
iframePrint.style.right = "0";
iframePrint.style.bottom = "0";
document.body.appendChild(iframePrint);
iframePrint.onload = function () {
iframePrint.contentWindow.focus();
iframePrint.contentWindow.print();
iframePrint.contentWindow.blur();
window.focus();
};
iframePrint.src = url;
}
},
htmlEncode: function(value) {
return $('<div/>').text(value).html();
}
};
})();
}();

View file

@ -0,0 +1,96 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
!window.common && (window.common = {});
!common.view && (common.view = {});
common.view.modals = new(function() {
var tplDialog = '<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="idm-title" aria-hidden="true">' +
'<div class="modal-dialog" role="document">' +
'<div class="modal-content">' +
'<div class="modal-header">' +
'<button type="button" class="close" data-dismiss="modal" aria-label="Close">' +
'<span aria-hidden="true">&times;</span>' +
'</button>' +
'<h4 id="idm-title" class="modal-title">{title}</h4>'+
'</div>'+
'<div class="modal-body">{body}</div>'+
'<div class="modal-footer">{footer}</div>'+
'</div>' +
'</div>' +
'</div>';
var _tplbody_share = '<div class="share-link">' +
'<input id="id-short-url" class="form-control" type="text" readonly/>' +
'</div>' +
'<div class="share-buttons">' +
'<span class="svg big-facebook" data-name="facebook"></span>' +
'<span class="svg big-twitter" data-name="twitter"></span>' +
'<span class="svg big-gplus" data-name="gplus"></span>' +
'<span class="svg big-email" data-name="email"></span>' +
'<div class="autotest" id="email" style="display: none"></div>' +
'</div>';
var _tplbody_embed = '<div class="size-manual">' +
'<span class="caption">Width:</span>' +
'<input id="txt-embed-width" class="form-control input-xs" type="text" value="400px">' +
'<input id="txt-embed-height" class="form-control input-xs right" type="text" value="600px">' +
'<span class="right caption">Height:</span>' +
'</div>' +
'<textarea id="txt-embed-url" rows="4" class="form-control" readonly></textarea>';
return {
create: function(name, parent) {
!parent && (parent = 'body');
var _$dlg;
if (name == 'share') {
_$dlg = $(tplDialog
.replace(/\{title}/, 'Share Link')
.replace(/\{body}/, _tplbody_share)
.replace(/\{footer}/, '<button id="btn-copyshort" type="button" class="btn">Copy to clipboard</button>'))
.appendTo(parent)
.attr('id', 'dlg-share');
} else
if (name == 'embed') {
_$dlg = $(tplDialog
.replace(/\{title}/, 'Embed')
.replace(/\{body}/, _tplbody_embed)
.replace(/\{footer}/, '<button id="btn-copyembed" type="button" class="btn">Copy to clipboard</button>'))
.appendTo(parent)
.attr('id', 'dlg-embed');
}
return _$dlg;
}
};
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="88 -11 242 44"><style>.st0{fill:#fff;} .st2{fill-rule:evenodd;clip-rule:evenodd;}</style><g id="XMLID_7_"><path id="XMLID_9_" d="M128 6h-14c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z"/><path id="XMLID_8_" d="M120.1 3.6c.1.1.2.2.4.2.1.1.3.1.5.1s.3-.1.5-.1c.1 0 .3-.1.4-.2l3.5-3.5c.4-.4.4-1 0-1.4s-1-.4-1.4 0l-2 2V-7c0-.6-.4-1-1-1s-1 .4-1 1V.7l-2-2c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l3.5 3.5z"/></g><path id="XMLID_14_" d="M147.3 3c-.8 0-1.5.3-2.1.8l-4.7-2.7c.1-.3.2-.7.2-1.1s-.1-.8-.2-1.1l4.7-2.7c.6.5 1.3.8 2.1.8 1.7 0 3.1-1.4 3.1-3.1s-1.4-3.1-3.1-3.1-3.1 1.4-3.1 3.1c0 .3 0 .5.1.8l-4.9 2.8c-.5-.4-1.1-.6-1.8-.6-1.7 0-3.1 1.4-3.1 3.1s1.4 3.1 3.1 3.1c.7 0 1.3-.2 1.8-.6l4.8 2.8c-.1.3-.1.5-.1.8 0 1.7 1.4 3.1 3.1 3.1 1.7 0 3.1-1.4 3.1-3.1.1-1.7-1.3-3.1-3-3.1z"/><path d="M159.3 0l4-4c.5-.5.5-1.2 0-1.7s-1.2-.5-1.7 0l-4.4 4.4c-.2 0-.4.1-.6.3-.3.3-.4.7-.3 1 0 .3.1.7.3 1 .2.2.4.3.6.3l4.4 4.4c.5.5 1.2.5 1.7 0s.5-1.2 0-1.7l-4-4zm14.1-1c-.2-.2-.4-.3-.6-.3l-4.4-4.4c-.5-.5-1.2-.5-1.7 0s-.5 1.2 0 1.7l4 4-4 4c-.5.5-.5 1.2 0 1.7s1.2.5 1.7 0l4.4-4.4c.2 0 .4-.1.6-.3.3-.3.4-.7.3-1 .1-.3 0-.7-.3-1z"/><g id="XMLID_4_"><path id="XMLID_21_" d="M194.9-7.3c0-.1-.1-.2-.2-.3-.1-.1-.2-.2-.3-.2-.2-.2-.3-.2-.4-.2h-4.2c-.5 0-.8.4-.8.8 0 .5 1 1.2 1 1.2l.8.8-2.6 2.6c-.4.4-.4 1 0 1.4s1 .4 1.4 0l2.6-2.6 1.3 1.4c.1.2.4.4.7.4.5 0 .8-.4.8-.8V-7c0-.1 0-.2-.1-.3z"/><path id="XMLID_22_" d="M184.4 1.2l-2.6 2.6-1.3-1.4c-.1-.2-.4-.4-.7-.4-.5 0-.8.4-.8.8V7c0 .1 0 .3.1.4 0 .1.1.2.2.3.1.1.2.2.3.2.2.1.3.1.4.1h4.2c.5 0 .8-.4.8-.8S184 6 184 6l-.8-.8 2.6-2.6c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0z"/></g><path id="imgtools" d="M90-6v2h18v-2H90zm0 7h18v-2H90v2zm0 5h18V4H90v2z"/><path id="imgplus" d="M210-8h-2v7h-7v2h7v7h2V1h7v-2h-7v-7z"/><path id="imgminus" d="M223-1h16v2h-16z"/><path id="play" d="M305 0l-16-7V6.9L305 0z"/><path id="rmove" class="st2" d="M279.9-.2L272.1-8 270-5.9l5.8 5.8-5.8 5.9 2.1 2.1 7.8-7.8.1-.2z"/><path id="lmove" class="st2" d="M258-5.8l-2.1-2.1-7.8 7.8-.1.2.1.1 7.8 7.8 2.1-2.1-5.8-5.8z"/><path d="M313-7h4V7h-4zm8 0h4V7h-4z" id="pause"/><use xlink:href="#imgtools" class="st0" y="22"/><use xlink:href="#imgplus" class="st0" y="22"/><use xlink:href="#imgminus" class="st0" y="22"/><use xlink:href="#play" class="st0" y="22" x="2"/><use xlink:href="#pause" class="st0" y="22"/><use xlink:href="#rmove" class="st0" x="1" y="22"/><use xlink:href="#lmove" class="st0" x="-1" y="22"/></svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 152 76"><defs><path id="a" d="M144.9 0h-23.8c-3.9 0-7.1 3.2-7.1 7.1v23.7c0 3.9 3.2 7.1 7.1 7.1h23.8c3.9 0 7.1-3.2 7.1-7.1V7.1c0-3.9-3.2-7.1-7.1-7.1zm1.8 28.3c0 1.3-1.1 2.4-2.4 2.4h-22.4c-1.3 0-2.4-1.1-2.4-2.4V9.7c0-1.3 1.1-2.4 2.4-2.4h22.4c1.3 0 2.4 1.1 2.4 2.4v18.6zM68.9 0H45.1C41.2 0 38 3.2 38 7.1v23.7c0 3.9 3.2 7.1 7.1 7.1h23.7c3.9 0 7.1-3.2 7.1-7.1V7.1c.1-3.9-3.1-7.1-7-7.1zm-1.8 14.6v.7c0 6.9-5.2 14.8-14.8 14.8-2.9 0-5.7-.9-8-2.3.4 0 .8.1 1.2.1 2.4 0 4.7-.8 6.5-2.2-2.3 0-4.2-1.6-4.8-3.6.3 0 .6.1 1 .1.5 0 .8-.1 1.3-.2-2.4-.5-4.3-2.6-4.3-5.1.8.4 1.6.6 2.5.6-1.4-.9-2.3-2.5-2.3-4.3 0-.9.3-1.9.7-2.6 2.6 3.2 6.4 5.2 10.7 5.4-.1-.4-.1-.8-.1-1.2 0-2.9 2.3-5.2 5.2-5.2 1.5 0 2.8.6 3.8 1.6 1.2-.2 2.3-.7 3.3-1.3-.4 1.2-1.2 2.3-2.3 2.9 1.1-.1 2.1-.4 3-.8-.7 1-1.6 1.9-2.6 2.6zM30.9 0H7.1C3.2 0 0 3.2 0 7.1v23.7c0 4 3.2 7.2 7.1 7.2h11.7V26.8h-5.3v-5.7h5.3V17c0-4.8 3.2-7.5 7.9-7.5 2.2 0 4.2.1 4.7.2v5.1h-3.2c-2.6 0-3.1 1.1-3.1 2.7v3.6h6.1l-.8 5.7h-5.3V38h5.7c3.9 0 7.1-3.2 7.1-7.1V7.1c.1-3.9-3.1-7.1-7-7.1zm105.9 20.6c-1.1.9-2.4 2-3.8 2-1.5 0-2.8-1.1-3.8-2l-6-4.8c-.4-.3-.7-.6-1-.9v12.6c0 .2.2.5.4.5h20.7c.2 0 .4-.2.4-.5V14.9c-.3.3-.6.6-1 .9-1.9 1.6-3.9 3.2-5.9 4.8zM106.9 0H83.1C79.2 0 76 3.2 76 7.1v23.7c0 3.9 3.2 7.1 7.1 7.1h23.8c3.9 0 7.1-3.2 7.1-7.1V7.1c0-3.9-3.2-7.1-7.1-7.1zM89.6 28.5c-5.3 0-9.5-4.3-9.5-9.5s4.2-9.5 9.5-9.5c2.5 0 4.7.9 6.4 2.5l-2.6 2.5c-.7-.7-2-1.5-3.8-1.5-3.3 0-5.9 2.7-5.9 6s2.6 6 5.9 6c3.8 0 5.2-2.7 5.4-4.1h-5.4v-3.3h9c.1.5.1 1 .1 1.6 0 5.4-3.7 9.3-9.1 9.3zm20.3-8.1h-2.7v2.7h-2.7v-2.7h-2.7v-2.7h2.7V15h2.7v2.7h2.7v2.7zM143.3 10h-20.7c-.2 0-.4.2-.4.5 0 1.6.8 3 2.1 4 1.9 1.5 3.8 3 5.6 4.5.7.6 2.1 1.9 3.1 1.9s2.3-1.3 3.1-1.9c1.9-1.5 3.7-3 5.6-4.5.9-.7 2.1-2.3 2.1-3.5 0-.4.1-1-.5-1z"/></defs><use xlink:href="#a" fill="#999"/><use xlink:href="#a" fill="#666" y="38"/></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1 @@
<svg id="Layer_2" xmlns="http://www.w3.org/2000/svg" viewBox="-4 23 100 24"><style>.st0{fill:#5B5B5B;} .st1{fill:#3A3A3A;} .st2{opacity:0.42;fill:#8C8C8C;enable-background:new ;} .st3{opacity:0.72;fill:#9B9B9B;enable-background:new ;} .st4{fill:#9B9B9B;}</style><path class="st0" d="M21.3 35.5c0-1.5.4-2.7 1.3-3.5.9-.8 1.9-1.2 3.1-1.2 1.2 0 2.2.4 3.1 1.2.9.8 1.3 1.9 1.3 3.5 0 1.5-.4 2.7-1.3 3.5-.9.8-1.9 1.2-3.1 1.2-1.2 0-2.2-.4-3.1-1.2-.8-.8-1.3-2-1.3-3.5zm1.9 0c0 1.1.2 1.8.6 2.3.4.5.8.8 1.3.9.1 0 .2 0 .3.1h.6c.1 0 .2 0 .3-.1.5-.1.9-.4 1.3-.9s.6-1.3.6-2.3c0-1-.2-1.8-.6-2.3-.4-.5-.8-.8-1.3-.9-.1 0-.2-.1-.3-.1h-.6c-.1 0-.2 0-.3.1-.5.1-.9.4-1.3.9s-.6 1.2-.6 2.3zm7.8-4.4h2.4l3.1 5.6.5 1.2v-6.8h1.8V40h-2.3l-3.2-5.9-.4-1h-.1l.1 1.6V40H31zm9.3 0h1.9v7.4h3.6V40h-5.5zm4.4 0h2.1l1.8 3 .2.7h.1l.3-.7 1.8-3h2l-3.3 5.2V40H48v-3.7z"/><path class="st1" d="M53.1 35.5c0-1.5.4-2.7 1.3-3.5.9-.8 1.9-1.2 3.1-1.2s2.2.4 3.1 1.2c.9.8 1.3 1.9 1.3 3.5 0 1.5-.4 2.7-1.3 3.5-.9.8-1.9 1.2-3.1 1.2-1.2 0-2.2-.4-3.1-1.2-.9-.8-1.3-2-1.3-3.5zm1.9 0c0 1.1.2 1.8.6 2.3.4.5.8.8 1.3.9.1 0 .2 0 .3.1h.6c.1 0 .2 0 .3-.1.5-.1.9-.4 1.3-.9s.6-1.3.6-2.3c0-1-.2-1.8-.6-2.3s-.8-.8-1.3-.9c-.1 0-.2-.1-.3-.1h-.6s-.2 0-.3.1c-.5.1-.9.4-1.3.9s-.6 1.2-.6 2.3zm7.8-4.4h5v1.5h-3.2v2.1h3.1v1.5h-3.1V40h-1.8zm6.1 0h5v1.5h-3.2v2.1h3v1.5h-3V40h-1.8zm6 8.9v-8.9h1.9V40zM85 31.3v1.6c-.3-.1-.6-.2-1-.3s-.7-.1-1.1-.1c-1 0-1.7.3-2.2.9-.5.6-.8 1.3-.8 2.2s.2 1.6.7 2.2c.5.6 1.2.9 2.1.9.3 0 .7 0 1-.1.4 0 .8-.2 1.2-.3l.1 1.5c-.1 0-.1.1-.2.1s-.2.1-.4.1h-.8c-.3 0-.7.1-1.1.1h-.4c-1-.1-2-.5-2.9-1.2-.9-.7-1.3-1.8-1.3-3.4 0-1.5.4-2.6 1.3-3.5.9-.8 2-1.2 3.4-1.2h1c.3 0 .6.1.9.2.1 0 .1 0 .2.1s.2.1.3.2zm1.1-.2h5.5v1.4H88v2.1h3.2V36H88v2.6h3.6V40h-5.5z"/><path class="st2" d="M7.4 43.1l-7.7-3.7c-.7-.3-.7-.8 0-1.1L2.3 37l5.1 2.4c.7.3 1.7.3 2.4 0l5.1-2.4 2.7 1.3c.7.3.7.8 0 1.1l-7.7 3.7c-.7.3-1.8.3-2.5 0z"/><path class="st3" d="M7.4 38.7L-.3 35c-.7-.3-.7-.8 0-1.1l2.7-1.3L7.5 35c.7.3 1.7.3 2.4 0l5.2-2.4 2.7 1.2c.7.3.7.8 0 1.1L10 38.6c-.8.4-1.9.4-2.6.1z"/><path class="st4" d="M7.4 34.3l-7.7-3.7c-.7-.3-.7-.8 0-1.1l7.7-3.7c.7-.3 1.7-.3 2.4 0l7.7 3.7c.7.3.7.8 0 1.1l-7.7 3.7c-.6.3-1.7.3-2.4 0z"/></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -20,7 +20,7 @@
// Components
@import "../../../../../vendor/bootstrap/less/component-animations.less";
@import "../../../../../vendor/bootstrap/less/glyphicons.less";
//@import "../../../../../vendor/bootstrap/less/glyphicons.less";
//@import "dropdowns.less";
//@import "button-groups.less";
//@import "input-groups.less";
@ -39,12 +39,13 @@
//@import "list-group.less";
//@import "panels.less";
//@import "wells.less";
//@import "close.less";
@import "../../../../../vendor/bootstrap/less/close.less";
// Components w/ JavaScript
@import "../../../../../vendor/bootstrap/less/modals.less";
@import "../../../../../vendor/bootstrap/less/tooltip.less";
@import "../../../../../vendor/bootstrap/less/popovers.less";
//@import "../../../../../vendor/bootstrap/less/popovers.less";
@import "../../../../../vendor/bootstrap/less/dropdowns.less";
//@import "carousel.less";
// Utility classes
@ -52,7 +53,7 @@
@import "../../../../../vendor/bootstrap/less/responsive-utilities.less";
@toolbarBorderColor: #929292;
@toolbarBorderColor: #dbdbdb;
@toolbarBorderShadowColor: #FAFAFA;
@toolbarTopColor: #EBEBEB;
@toolbarBottomColor: #CCCCCC;
@ -60,7 +61,10 @@
@toolbarFontSize: 12px;
@controlBtnHoverTopColor: #6180C4;
@controlBtnHoverBottomColor: #8AACF1;
@btnColor: #d8dadc;
@btnActiveColor: #7d858c;
@iconSpriteCommonPath: "../../../../common/embed/resources/img/glyphicons.png";
@icon-socnet-size: 40px;
.input-xs {
.input-size(@input-height-small - 8px; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
@ -104,7 +108,7 @@
font-size: @toolbarFontSize;
min-width: 340px;
z-index: 100;
#gradient > .vertical(@toolbarTopColor, @toolbarBottomColor);
background-color: @toolbarTopColor;
&.top {
top: 0;
@ -128,20 +132,21 @@
box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor;
}
ul {
.group {
position: absolute;
top: 50%;
transform: translateY(-50%);
list-style-type: none;
margin: 0;
padding: 0;
li {
.item {
input {
display: inline-block;
width: 25px;
width: 35px;
padding: 0;
height: 25px;
margin: 3px;
text-align: center;
text-align: right;
}
.text {
@ -151,99 +156,72 @@
&.left {
left: 0;
padding-left: 10px;
li {
.item {
float: left;
}
}
&.right {
right: 0;
padding-right: 10px;
li {
.item {
float: left;
}
}
&.center {
left: 50%;
transform: translate(-50%, -50%);
}
.separator {
height: 24px;
margin: 4px 9px;
height: 22px;
margin: 0 9px;
border-right: 1px solid @toolbarBorderShadowColor;
border-left: 1px solid @toolbarBorderColor;
}
}
.close {
font-size: 28px;
color: #666666;
opacity: 0.8;
display: block;
line-height: 22px;
&:hover {
opacity: 1;
color: #666666;
}
}
}
// Logo
// -------------------------
a.brand-logo {
.brand-logo {
display: block;
background-image: url("@{iconSpriteCommonPath}");
width: 124px;
height: 20px;
margin: 5px 0 0 10px;
background-position: 0 -100px;
width: 100px;
height: 24px;
background: data-uri('../../../../common/embed/resources/img/logo.svg') no-repeat;
}
// Sprite icons path
// -------------------------
[class^="control-icon-"],
[class*=" control-icon-"] {
display: inline-block;
width: 20px;
height: 20px;
vertical-align: text-top;
background-image: url("@{iconSpriteCommonPath}");
background-repeat: no-repeat;
margin-top: -2px;
}
[class^="overlay-icon-"],
[class*=" overlay-icon-"] {
display: inline-block;
width: 32px;
height: 32px;
vertical-align: text-top;
background-image: url("@{iconSpriteCommonPath}");
background-repeat: no-repeat;
opacity: .3;
}
.control-icon-share { background-position: 0 0; }
.control-icon-embed { background-position: 0 -20px; }
.control-icon-fullscreen { background-position: 0 -40px; }
.control-icon-close { background-position: 0 -60px; }
.control-icon-save { background-position: 0 -80px; }
.overlay-icon-zoom-in { background-position: 0 -120px; }
.overlay-icon-zoom-out { background-position: -32px -120px; }
// Control buttons
// -------------------------
.control-btn {
display: inline-block;
padding: 1px 5px;
font-size: @toolbarFontSize;
line-height: 20px;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-color: transparent;
background-image: none;
border: 1px solid transparent;
border-radius: 2px;
margin: 4px 5px 0 0;
i {
margin-right: 5px;
}
//margin: 0;
&.no-caption {
padding: 1px 2px;
i {
margin-right: 0;
}
}
// Hover state
@ -251,12 +229,6 @@ a.brand-logo {
color: @toolbarHoverColor;
text-decoration: none;
text-shadow: 0 1px 0 @toolbarBorderShadowColor;
.control-icon-share { background-position: -20px 0; }
.control-icon-embed { background-position: -20px -20px; }
.control-icon-fullscreen { background-position: -20px -40px; }
.control-icon-close { background-position: -20px -60px; }
.control-icon-save { background-position: -20px -80px; }
}
// Focus state for keyboard and accessibility
@ -268,17 +240,9 @@ a.brand-logo {
// Active state
&.active,
&:active {
color: #ffffff;
outline: none;
border: 1px solid darken(@controlBtnHoverTopColor, 5%);
#gradient > .vertical(@controlBtnHoverTopColor, @controlBtnHoverBottomColor);
text-shadow: 0 1px 0 darken(@toolbarBorderColor, 20%);
.control-icon-share { background-position: -40px 0; }
.control-icon-embed { background-position: -40px -20px; }
.control-icon-fullscreen { background-position: -40px -40px; }
.control-icon-close { background-position: -40px -60px; }
.control-icon-save { background-position: -40px -80px; }
border: 1px solid @btnActiveColor;
background-color: @btnActiveColor;
}
}
@ -313,32 +277,26 @@ a.brand-logo {
height: 32px;
display: inline-block;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-color: transparent;
background-image: none;
border: none;
padding: 0;
line-height: 0;
background-color: black;
border: 5px solid black;
border-radius: 50%;
outline: none;
opacity: 0.3;
-webkit-box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
-moz-box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
&:hover {
[class^="overlay-icon-"],
[class*=" overlay-icon-"] {
opacity: .6;
}
}
opacity: .6;
}
&.active,
&:active {
[class^="overlay-icon-"],
[class*=" overlay-icon-"] {
opacity: .8;
&.active, &:active {
opacity: .8;
}
}
}
}
}
}
// Error mask
// -------------------------
@ -370,152 +328,282 @@ a.brand-logo {
}
}
// Share popover
// -------------------------
.popover{
.popover-content {
padding: 14px;
}
&.hyperlink {
.popover-content {
padding: 5px 10px;
p {
display: block;
word-wrap: break-word;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
&.share {
width: 280px;
.share-link {
margin-bottom: 5px;
.caption {
margin-top: 3px;
margin-right: 8px;
float: left;
}
input[readonly] {
display: inline-block;
font-size: 1em;
padding: 0 4px;
margin-right: 5px;
border-radius: 0;
cursor: text;
background-color: #fff;
-moz-user-select: text;
-khtml-user-select: text;
-webkit-user-select: text;
-ms-user-select: text;
user-select: text;
}
.input-xs {
width: 130px;
}
.btn {
float: right;
}
}
.share-buttons {
ul {
width: 244px;
height: 25px;
list-style-type: none;
margin: 5px 0 0;
overflow: hidden;
li {
display: inline-block;
float: left;
margin: 1px 5px 0 0;
vertical-align: middle;
&.share-mail {
float: right;
padding-right: 1px;
margin: 0;
a {
min-width: 64px;
}
.glyphicon {
margin-right: 4px;
}
}
&.share-twitter {
max-width: 93px;
}
}
}
}
}
&.embed {
width: 270px;
.size-manual {
margin-bottom: 10px;
}
.right {
float: right;
}
.caption {
margin-top: 2px;
margin-right: 8px;
}
input {
display: inline-block;
font-size: 1em;
padding: 0 4px;
border-radius: 0;
margin: 0;
margin-top: -1px;
&.input-xs {
width: 50px;
}
}
textarea {
width: 238px;
resize: none;
cursor: auto;
font-size: 1em;
border-radius: 0;
}
button {
float: right;
margin: 10px 0 15px;
width: 86px;
}
}
}
// Modals
// -------------------------
.modal {
.modal-header {
padding: 5px 15px;
//padding: 5px 15px;
}
.modal-footer {
border-top: none;
//border-top: none;
}
//&.in .modal-dialog { .translate(0, 100%)}
}
.share-buttons {
ul {
width: 244px;
//height: 25px;
list-style-type: none;
margin: 5px 0 0;
overflow: hidden;
li {
display: inline-block;
float: left;
margin: 1px 5px 0 0;
vertical-align: middle;
&.share-mail {
float: right;
padding-right: 1px;
margin: 0;
a {
min-width: 64px;
}
.glyphicon {
margin-right: 4px;
}
}
&.share-twitter {
max-width: 93px;
}
}
}
}
.size-manual {
margin-bottom: 10px;
.right {
float: right;
}
.caption {
margin-top: 2px;
margin-right: 8px;
}
input {
display: inline-block;
font-size: 1em;
padding: 0 4px;
//border-radius: 0;
margin: 0;
margin-top: -1px;
&.input-xs {
width: 50px;
}
}
}
.socnet-btn(@index) {
background-position: -@icon-socnet-size*@index 0;
&:hover {
background-position: -@icon-socnet-size*@index -@icon-socnet-size;
}
}
.svg {
background: data-uri('../../../../common/embed/resources/img/icon-social-sprite.svg');
width: 40px;
height: 40px;
background-size: @icon-socnet-size*4 @icon-socnet-size*2;
&.big-facebook:hover {
background-position: 0 -@icon-socnet-size;
}
&.big-twitter { .socnet-btn(1); }
&.big-gplus { .socnet-btn(2); }
&.big-email { .socnet-btn(3); }
}
.svg-icon {
background: data-uri('../../../../common/embed/resources/img/icon-menu-sprite.svg') no-repeat;
background-size: 22px*11 22px*2;
&.download {
background-position: -22px 0;
}
&.share {
background-position: -22px*2 0;
}
&.embed {
background-position: -22px*3 0;
}
&.fullscr {
background-position: -22px*4 0;
}
&.zoom-up {
background-position: -22px*5 -22px;
}
&.zoom-down {
background-position: -22px*6 -22px;
}
&.slide-prev {
background-position: -22px*7 -22px;
}
&.slide-next {
background-position: -22px*8 -22px;
}
&.play {
background-position: -22px*9 -22px;
}
&.pause {
background-position: -22px*10 -22px;
}
}
.mi-icon {
width: 22px;
height: 22px;
//display: inline-block;
float: left;
margin: -1px 15px 0 -15px;
}
.btn, button {
&:focus, &:active:focus {
outline: 0 none;
}
background-color: @btnColor;
}
.modal-dialog {
margin-top: 100px;
.share-buttons {
height: 40px;
text-align: center;
span {
display: inline-block;
margin: 0 7px;
cursor: pointer;
}
}
.share-link {
margin: 0 0 15px 0;
}
}
.modal-header {
padding-bottom: 10px;
text-align: center;
.close {
margin-top: 0;
opacity: 0.5;
&:hover {
opacity: 0.7;
}
}
}
.modal-body {
padding: 20px;
}
.modal-footer {
text-align: center;
}
#dlg-share, #dlg-embed {
.modal-dialog {
width: 330px;
}
textarea {
width: 288px;
resize: none;
cursor: auto;
font-size: 1em;
border-radius: 0;
}
}
.dropdown-menu {
> li > a {
padding: 8px 20px 8px 31px;
&:hover, &:focus {
background-color: @btnColor;
outline: 0 none;
}
}
}
.dropdown {
&.open {
> button {
background-color: @btnActiveColor;
background-position: 0 -22px;
}
}
}
#box-tools {
button {
width: 24px;
height: 22px;
&:active {
background-position: 0 -22px;
}
}
}
.masked {
background-color: transparent;
border-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
#pages {
cursor: pointer;
display: inline-block;
line-height: 22px;
padding: 0 0 0 3px;
}
#page-number {
&.masked {
cursor: pointer;
}
}
.tooltip {
.tooltip-inner {
background-color: #fff;
border: 1px solid rgba(0,0,0,0.15);
color: #333;
font-weight: bold;
line-height: 26px;
font-size: 11px;
box-shadow: 0 6px 12px rgba(0,0,0,0.175);
}
.tooltip-arrow {
display: none;
}
}
.form-control {
&:focus {
-webkit-box-shadow: none;
box-shadow: none;
}
}

View file

@ -94,13 +94,8 @@ define([
].join('')),
initialize : function(options) {
var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
Common.UI.ComboBox.prototype.initialize.call(this, _.extend({
editable: false,
store: new Common.UI.BordersStore(),
data: [
{displayValue: this.txtNoBorders, value: 0, pxValue: 0 },
var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt),
data = [
{displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0},
{displayValue: '1 ' + txtPt, value: 1, pxValue: 1, offsety: 20},
{displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, offsety: 40},
@ -108,7 +103,14 @@ define([
{displayValue: '3 ' + txtPt, value: 3, pxValue: 4, offsety: 80},
{displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 5, offsety: 100},
{displayValue: '6 ' + txtPt, value: 6, pxValue: 6, offsety: 120}
],
];
if (options.allowNoBorders !== false)
data.unshift({displayValue: this.txtNoBorders, value: 0, pxValue: 0 });
Common.UI.ComboBox.prototype.initialize.call(this, _.extend({
editable: false,
store: new Common.UI.BordersStore(),
data: data,
menuStyle: 'min-width: 150px;'
}, options));
},
@ -189,13 +191,8 @@ define([
initialize : function(options) {
this.txtNoBorders = options.txtNoBorders || this.txtNoBorders;
var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
Common.UI.ComboBox.prototype.initialize.call(this, _.extend({
editable: true,
store: new Common.UI.BordersStore(),
data: [
{displayValue: this.txtNoBorders, value: 0, pxValue: 0 },
var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt),
data = [
{displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0},
{displayValue: '1 ' + txtPt, value: 1, pxValue: 1, offsety: 20},
{displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, offsety: 40},
@ -203,7 +200,15 @@ define([
{displayValue: '3 ' + txtPt, value: 3, pxValue: 4, offsety: 80},
{displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 5, offsety: 100},
{displayValue: '6 ' + txtPt, value: 6, pxValue: 6, offsety: 120}
],
];
if (options.allowNoBorders !== false)
data.unshift({displayValue: this.txtNoBorders, value: 0, pxValue: 0 });
Common.UI.ComboBox.prototype.initialize.call(this, _.extend({
editable: true,
store: new Common.UI.BordersStore(),
data: data,
menuStyle: 'min-width: 150px;'
}, options));
},

View file

@ -309,7 +309,7 @@ define([
}
},
updateColors: function(effectcolors, standartcolors) {
updateColors: function(effectcolors, standartcolors, value) {
if (effectcolors===undefined || standartcolors===undefined) return;
var me = this,
@ -366,11 +366,14 @@ define([
}
}
var selected = $(this.el).find('a.' + this.selectedCls);
if (selected.length && selected.hasClass('palette-color-effect')) {
this.value = selected[0].className.match(this.colorRe)[1].toUpperCase();
if (value)
this.select(value, true);
else {
var selected = $(this.el).find('a.' + this.selectedCls);
if (selected.length && selected.hasClass('palette-color-effect')) {
this.value = selected[0].className.match(this.colorRe)[1].toUpperCase();
}
}
this.options.updateColorsArr = undefined;
},

View file

@ -1222,12 +1222,14 @@ define([
for (i = 0; i < comments.length; ++i) {
comment = this.findComment(comments[i].asc_getId());
comment.set('editTextInPopover', true);
comment.set('hint', false);
this.popoverComments.push(comment);
if (comment) {
comment.set('editTextInPopover', true);
comment.set('hint', false);
this.popoverComments.push(comment);
}
}
if (this.getPopover()) {
if (this.getPopover() && this.popoverComments.length>0) {
if (this.getPopover().isVisible()) {
this.getPopover().hide();
}

View file

@ -99,8 +99,6 @@ define([
this.setApi(api);
if (data) {
this.currentUserId = data.config.user.id;
this.currentUserName = data.config.user.name;
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
}
},

View file

@ -605,14 +605,16 @@ Common.Utils.applyCustomization = function(config, elmap) {
Common.Utils.fillUserInfo = function(info, lang, defname) {
var _user = info || {};
!_user.id && (_user.id = ('uid-' + Date.now()));
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname) && (_user.firstname = defname);
if (_.isEmpty(_user.firstname))
_user.fullname = _user.lastname;
else if (_.isEmpty(_user.lastname))
_user.fullname = _user.firstname;
else
_user.fullname = /^ru/.test(lang) ? _user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
if (_.isEmpty(_user.name)) {
_.isEmpty(_user.firstname) && _.isEmpty(_user.lastname) && (_user.firstname = defname);
if (_.isEmpty(_user.firstname))
_user.fullname = _user.lastname;
else if (_.isEmpty(_user.lastname))
_user.fullname = _user.firstname;
else
_user.fullname = /^ru/.test(lang) ? _user.lastname + ' ' + _user.firstname : _user.firstname + ' ' + _user.lastname;
} else
_user.fullname = _user.name;
return _user;
};

View file

@ -99,8 +99,8 @@
.button-otherstates-icon(@icon-class, @icon-size) {
button.over > .@{icon-class} {background-position-x: -1*@icon-size; --bgX: -(1*@icon-size);}
button.active > .@{icon-class},
button:active > .@{icon-class} {background-position-x: -2*@icon-size; --bgX: -(2*@icon-size);}
button.disabled > .@{icon-class} {background-position-x: -3*@icon-size; --bgX: -(3*@icon-size);}
button:active > .@{icon-class} {background-position-x: -2*@icon-size !important; --bgX: -(2*@icon-size);}
button.disabled > .@{icon-class} {background-position-x: -3*@icon-size !important; --bgX: -(3*@icon-size);}
}
.button-otherstates-icon2(@icon-class, @icon-size) {
@ -125,13 +125,13 @@
/**/
.background-ximage(@image, @image2x, @w: auto, @h: auto) {
background-image: e(%("url(%s)",@image));
background-image: data-uri(%("%s",@image));
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 2dppx),
only screen and (min-resolution: 192dpi) {
background-image: e(%("url(%s)",@image2x));
background-image: data-uri(%("%s",@image2x));
background-size: @w @h;
}
}
@ -140,14 +140,14 @@
.img-commonctrl,
.theme-colorpalette .color-transparent, .palette-color-ext .color-transparent, .dropdown-menu li .checked:before, .input-error:before,
.btn-toolbar .btn-icon.img-commonctrl {
background-image: e(%("url(%s)",'@{common-image-path}/@{common-controls}'));
background-image: data-uri(%("%s",'@{common-image-path}/@{common-controls}'));
background-repeat: no-repeat;
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 2dppx),
only screen and (min-resolution: 192dpi) {
background-image: e(%("url(%s)",'@{common-image-path}/@{common-controls2x}'));
background-image: data-uri(%("%s",'@{common-image-path}/@{common-controls2x}'));
background-size: @common-controls-width auto;
}
}
@ -155,13 +155,13 @@
@img-toolbarmenu-width: 60px;
.img-toolbarmenu
{
background: e(%("url(%s)",'@{app-image-path}/toolbar-menu.png')) no-repeat;
background: data-uri(%("%s",'@{app-image-path}/toolbar-menu.png')) no-repeat;
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 2dppx),
only screen and (min-resolution: 192dpi) {
background-image: e(%("url(%s)",'@{app-image-path}/toolbar-menu@2x.png'));
background-image: data-uri(%("%s",'@{app-image-path}/toolbar-menu@2x.png'));
background-size: @img-toolbarmenu-width auto;
}
}
@ -169,13 +169,13 @@
@img-colorpicker-width: 205px;
.img-colorpicker,
.color-transparent, .hsb-colorpicker .empty-color:before {
background: e(%("url(%s)",'@{common-image-path}/hsbcolorpicker/hsb-colorpicker.png')) no-repeat;
background: data-uri(%("%s",'@{common-image-path}/hsbcolorpicker/hsb-colorpicker.png')) no-repeat;
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 2dppx),
only screen and (min-resolution: 192dpi) {
background-image: e(%("url(%s)",'@{common-image-path}/hsbcolorpicker/hsb-colorpicker@2x.png'));
background-image: data-uri(%("%s",'@{common-image-path}/hsbcolorpicker/hsb-colorpicker@2x.png'));
background-size: @img-colorpicker-width auto;
}
}

View file

@ -60,6 +60,14 @@
background-position: @arrow-small-offset-x - 7px @arrow-small-offset-y;
}
}
&:active,
&.active {
&:focus,
&.focus {
outline: none;
}
}
}
.btn-toolbar {
@ -79,8 +87,8 @@
display: none;
}
&:hover,
.over {
&:hover:not(.disabled),
.over:not(.disabled) {
background-color: @secondary;
}
@ -141,8 +149,8 @@
background-color: transparent;
font-weight: bold;
&:hover,
.over {
&:hover:not(.disabled),
.over:not(.disabled) {
background-color: @secondary;
}
@ -312,13 +320,13 @@
border: 1px solid @input-border;
.border-radius(@border-radius-small);
&:hover,
.over {
&:hover:not(.disabled),
.over:not(.disabled) {
background-color: @secondary !important;
}
&:active,
&.active {
&:active:not(.disabled),
&.active:not(.disabled) {
background-color: @primary !important;
color: white;
}
@ -346,13 +354,13 @@
margin-top: 5px;
}
&:hover,
.over {
&:hover:not(.disabled),
.over:not(.disabled) {
background-color: @secondary !important;
}
&:active,
&.active {
&:active:not(.disabled),
&.active:not(.disabled) {
background-color: @primary !important;
color: white;
}
@ -379,13 +387,13 @@
background-repeat: no-repeat;
}
&:hover,
.over {
&:hover:not(.disabled),
.over:not(.disabled) {
background-color: @secondary !important;
}
&:active,
&.active {
&:active:not(.disabled),
&.active:not(.disabled) {
background-color: @primary !important;
}

View file

@ -23,6 +23,6 @@
}
img, .image {
background: ~"url(@{common-image-path}/combo-border-size/BorderSize.png) no-repeat 0 0 #fff";
background: ~"url(@{common-image-const-path}/combo-border-size/BorderSize.png) no-repeat 0 0 #fff";
}
}

View file

@ -251,6 +251,10 @@
.combo-textart();
}
.combo-spark-style {
.combo-textart(58px, 2px);
}
.combo-chart-style {
.combo-textart(58px, 2px);

View file

@ -36,9 +36,14 @@
.form-control {
.border-right-radius(0);
border-right: 0;
position: static;
z-index: auto;
float: none;
}
.btn {
.btn,
.btn:hover,
.btn:focus {
.border-left-radius(0);
border-left: 0;
border-color: @input-border;

View file

@ -1,8 +1,5 @@
.dropdown-menu > .disabled > a {
&:hover,
&:focus {
cursor: default;
}
cursor: default;
}
.dropdown-menu {

View file

@ -28,7 +28,7 @@
}
.asc-loadmask-image {
background-image: ~"url(@{common-image-path}/load-mask/loading.gif)";
background-image: ~"url(@{common-image-const-path}/load-mask/loading.gif)";
height: 33px;
width: 33px;
float: left;

View file

@ -5,8 +5,10 @@
// Paths
// -------------------------
@app-image-path: "resources/img";
@common-image-path: "../../common/main/resources/img";
@app-image-path: "../../resources/img"; // use for data-uri(...)
@common-image-path: "../../../../common/main/resources/img"; // use for data-uri(...)
@app-image-const-path: "resources/img"; // use for url(...)
@common-image-const-path: "../../common/main/resources/img"; // use for url(...)
// Grays
// -------------------------
@ -46,6 +48,7 @@
@link-color: @brand-primary;
@link-hover-color: darken(@link-color, 15%);
@link-hover-decoration: underline;
// Typography
// -------------------------
@ -81,7 +84,7 @@
@icon-font-path: "../fonts/";
@icon-font-name: "glyphicons-halflings-regular";
@icon-font-svg-id: "glyphicons_halflingsregular";
// Components
// -------------------------
@ -157,6 +160,10 @@
@btn-link-disabled-color: @gray-light;
// Allows for customizing button radius independently from global border radius
@btn-border-radius-base: @border-radius-base;
@btn-border-radius-large: @border-radius-large;
@btn-border-radius-small: @border-radius-small;
// Forms
// -------------------------
@ -167,20 +174,35 @@
@input-color: #000;
@input-border: @gray;
@input-border-radius: @border-radius-base;
@input-border-radius-large: @border-radius-large;
@input-border-radius-small: @border-radius-small;
@input-border-focus: #66afe9;
// TODO: Rename `@input-border-radius` to `@input-border-radius-base` in v4
//** Default `.form-control` border radius
// This has no effect on `<select>`s in some browsers, due to the limited stylability of `<select>`s in CSS.
@input-border-radius: @border-radius-base;
//** Large `.form-control` border radius
@input-border-radius-large: @border-radius-large;
//** Small `.form-control` border radius
@input-border-radius-small: @border-radius-small;
@input-color-placeholder: @gray;
@input-height-base: (floor(@font-size-base * @line-height-base) + (@padding-base-vertical * 2) + 5);
@input-height-large: (ceil(@font-size-large * @line-height-large) + (@padding-large-vertical * 2) + 2);
@input-height-small: (floor(@font-size-small * @line-height-small) + (@padding-small-vertical * 2) + 2);
@form-group-margin-bottom: 15px;
@legend-color: @gray-dark;
@legend-border-color: #e5e5e5;
@input-group-addon-bg: @input-bg;
@input-group-addon-border-color: @input-border;
// Disabled cursor for form controls and buttons.
@cursor-disabled: default;
// Dropdowns
// -------------------------
@ -277,6 +299,7 @@
@navbar-border-radius: @border-radius-base;
@navbar-padding-horizontal: floor(@grid-gutter-width / 2);
@navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2);
@navbar-collapse-max-height: 340px;
@navbar-default-color: #777;
@navbar-default-bg: #f8f8f8;
@ -360,22 +383,33 @@
// Pagination
// -------------------------
@pagination-color: @link-color;
@pagination-bg: #fff;
@pagination-border: #ddd;
@pagination-hover-color: @link-hover-color;
@pagination-hover-bg: @gray-lighter;
@pagination-hover-border: #ddd;
@pagination-active-bg: @brand-primary;
@pagination-active-color: #fff;
@pagination-active-border: @brand-primary;
@pagination-disabled-color: @gray-light;
@pagination-disabled-bg: #fff;
@pagination-disabled-border: #ddd;
// Pager
// -------------------------
@pager-bg: @pagination-bg;
@pager-border: @pagination-border;
@pager-border-radius: 15px;
@pager-hover-bg: @pagination-hover-bg;
@pager-active-bg: @pagination-active-bg;
@pager-active-color: @pagination-active-color;
@pager-disabled-color: @gray-light;
@ -387,7 +421,7 @@
@jumbotron-bg: @gray-lighter;
@jumbotron-heading-color: inherit;
@jumbotron-font-size: ceil(@font-size-base * 1.5);
@jumbotron-heading-font-size: ceil((@font-size-base * 4.5));
// Form states and alerts
// -------------------------
@ -414,6 +448,7 @@
@tooltip-max-width: 200px;
@tooltip-color: #fff;
@tooltip-bg: #000;
@tooltip-opacity: .9;
@tooltip-arrow-width: 5px;
@tooltip-arrow-color: @tooltip-bg;
@ -462,9 +497,13 @@
@modal-content-fallback-border-color: #999;
@modal-backdrop-bg: #000;
@modal-backdrop-opacity: .5;
@modal-header-border-color: #e5e5e5;
@modal-footer-border-color: @modal-header-border-color;
@modal-lg: 900px;
@modal-md: 600px;
@modal-sm: 300px;
// Alerts
// -------------------------
@ -493,6 +532,7 @@
// -------------------------
@progress-bg: #f5f5f5;
@progress-bar-color: #fff;
@progress-border-radius: @border-radius-base;
@progress-bar-bg: @brand-primary;
@progress-bar-success-bg: @brand-success;
@ -511,14 +551,23 @@
@list-group-active-color: @component-active-color;
@list-group-active-bg: @component-active-bg;
@list-group-active-border: @list-group-active-bg;
@list-group-active-text-color: lighten(@list-group-active-bg, 40%);
@list-group-disabled-color: @gray-light;
@list-group-disabled-bg: @gray-lighter;
@list-group-disabled-text-color: @list-group-disabled-color;
@list-group-link-color: #555;
@list-group-link-hover-color: @list-group-link-color;
@list-group-link-heading-color: #333;
// Panels
// -------------------------
@panel-bg: #fff;
@panel-body-padding: 15px;
@panel-heading-padding: 10px 15px;
@panel-footer-padding: @panel-heading-padding;
@panel-inner-border: #ddd;
@panel-border-radius: @border-radius-base;
@panel-footer-bg: #f5f5f5;
@ -562,7 +611,7 @@
// Wells
// -------------------------
@well-bg: #f5f5f5;
@well-border: darken(@well-bg, 7%);
// Badges
// -------------------------
@ -580,6 +629,8 @@
// Breadcrumbs
// -------------------------
@breadcrumb-padding-vertical: 8px;
@breadcrumb-padding-horizontal: 15px;
@breadcrumb-bg: #f5f5f5;
@breadcrumb-color: #ccc;
@breadcrumb-active-color: @gray-light;
@ -614,6 +665,9 @@
@code-color: #c7254e;
@code-bg: #f9f2f4;
@kbd-color: #fff;
@kbd-bg: #333;
@pre-bg: #f5f5f5;
@pre-color: @gray-dark;
@pre-border-color: #ccc;
@ -625,6 +679,7 @@
@abbr-border-color: @gray-light;
@headings-small-color: @gray-light;
@blockquote-small-color: @gray-light;
@blockquote-font-size: (@font-size-base * 1.25);
@blockquote-border-color: @gray-lighter;
@page-header-border-color: @gray-lighter;
@ -636,6 +691,9 @@
// Horizontal forms & lists
@component-offset-horizontal: 180px;
@blockquote-font-size: (@font-size-base * 1.25);
@dl-horizontal-offset: @component-offset-horizontal;
@dl-horizontal-breakpoint: @grid-float-breakpoint;
// Container sizes
@ -724,3 +782,7 @@
// Plus
@plus-offset-x: -81px;
@plus-offset-y: -184px;
@dl-horizontal-offset: @component-offset-horizontal;
// Point at which .dl-horizontal becomes horizontal
@dl-horizontal-breakpoint: @grid-float-breakpoint;

View file

@ -182,7 +182,7 @@
</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
<![endif]-->
</head>
@ -193,11 +193,6 @@
<script src="../../../vendor/less/dist/less-1.5.1.js" type="text/javascript"></script>
<!-- debug end -->
<!--facebook button-->
<div id="fb-root"></div>
<!--twitter button-->
<script>
var userAgent = navigator.userAgent.toLowerCase(),
check = function(regex){ return regex.test(userAgent); };
@ -269,29 +264,29 @@
'</div>');
</script>
<div id="editor_sdk" class="viewer" style="overflow: hidden;"></div>
<div id="editor_sdk" class="viewer" style="overflow: hidden;" tabindex="-1"></div>
<div class="overlay-controls" style="margin-left: -32px">
<ul class="left">
<li id="id-btn-zoom-in"><button class="overlay"><i class="overlay-icon-zoom-in"></i></button></li>
<li id="id-btn-zoom-out"><button class="overlay"><i class="overlay-icon-zoom-out"></i></button></li>
<li id="id-btn-zoom-in"><button class="overlay svg-icon zoom-up"></button></li>
<li id="id-btn-zoom-out"><button class="overlay svg-icon zoom-down"></button></li>
</ul>
</div>
<div class="toolbar" id="toolbar">
<ul class="left">
<li><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></li>
<li class="separator"></li>
<li id="id-btn-copy"><button class="control-btn"><i class="control-icon-save"></i><span>Save Copy</span></button></li>
<li id="id-btn-share"><button class="control-btn"><i class="control-icon-share"></i><span>Share</span></button></li>
<li id="id-btn-embed"><button class="control-btn"><i class="control-icon-embed"></i><span>Embed</span></button></li>
</ul>
<ul class="right">
<li><input id="page-number" class="form-control input-sm" style="width: 25px;" type="text" value="0"><span class="text" id="pages">of 0</span></li>
<li class="separator"></li>
<li><button id="id-btn-fullscreen" class="control-btn no-caption"><i class="control-icon-fullscreen"></i></button></li>
<li><button id="id-btn-close" class="control-btn no-caption"><i class="control-icon-close"></i></button></li>
</ul>
<div class="group left">
<div id="box-tools" class="dropdown">
<button class="control-btn svg-icon tools"></button>
</div>
</div>
<div class="group center">
<span><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></span>
</div>
<div class="group right">
<div class="item"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
<div class="item separator"></div>
<div class="item"><button id="id-btn-close" class="control-btn close"><span aria-hidden="true">&times;</span></button></div>
</div>
</div>
<div class="modal fade error" id="id-critical-error-dialog" tabindex="-1" role="dialog">
@ -315,11 +310,13 @@
<div class="cmd-loader-title">Please wait...</div>
</div>
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></div>
<!--vendor-->
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/jquery.browser/dist/jquery.browser.min.js"></script>
<script type="text/javascript" src="../../../vendor/bootstrap/dist/js/bootstrap.js"></script>
<script type="text/javascript" src="../../../vendor/ZeroClipboard/ZeroClipboard.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/jszip/jszip.min.js"></script>
@ -336,6 +333,9 @@
<!--application-->
<script type="text/javascript" src="../../common/Gateway.js"></script>
<script type="text/javascript" src="../../common/Analytics.js"></script>
<script type="text/javascript" src="../../common/embed/lib/util/utils.js"></script>
<script type="text/javascript" src="../../common/embed/lib/view/modals.js"></script>
<script type="text/javascript" src="../../common/embed/lib/controller/modals.js"></script>
<script type="text/javascript" src="js/ApplicationView.js"></script>
<script type="text/javascript" src="js/ApplicationController.js"></script>
<script type="text/javascript" src="js/application.js"></script>

View file

@ -7,6 +7,8 @@
<meta name="description" content="">
<meta name="author" content="">
<link href="../../../apps/documenteditor/embed/resources/css/app-all.css" rel="stylesheet">
<!-- splash -->
<style type="text/css">
@ -177,17 +179,12 @@
</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
<![endif]-->
</head>
<body class="embed-body">
<!--facebook button-->
<div id="fb-root"></div>
<!--twitter button-->
<script>
var userAgent = navigator.userAgent.toLowerCase(),
check = function(regex){ return regex.test(userAgent); };
@ -259,29 +256,29 @@
'</div>');
</script>
<div id="editor_sdk" class="viewer" style="overflow: hidden;"></div>
<div id="editor_sdk" class="viewer" style="overflow: hidden;" tabindex="-1"></div>
<div class="overlay-controls" style="margin-left: -32px">
<ul class="left">
<li id="id-btn-zoom-in"><button class="overlay"><i class="overlay-icon-zoom-in"></i></button></li>
<li id="id-btn-zoom-out"><button class="overlay"><i class="overlay-icon-zoom-out"></i></button></li>
<li id="id-btn-zoom-in"><button class="overlay svg-icon zoom-up"></button></li>
<li id="id-btn-zoom-out"><button class="overlay svg-icon zoom-down"></button></li>
</ul>
</div>
<div class="toolbar" id="toolbar">
<ul class="left">
<li><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></li>
<li class="separator"></li>
<li id="id-btn-copy"><button class="control-btn"><i class="control-icon-save"></i><span>Save Copy</span></button></li>
<li id="id-btn-share"><button class="control-btn"><i class="control-icon-share"></i><span>Share</span></button></li>
<li id="id-btn-embed"><button class="control-btn"><i class="control-icon-embed"></i><span>Embed</span></button></li>
</ul>
<ul class="right">
<li><input id="page-number" class="form-control input-sm" style="width: 25px;" type="text" value="0"><span class="text" id="pages">of 0</span></li>
<li class="separator"></li>
<li><button id="id-btn-fullscreen" class="control-btn no-caption"><i class="control-icon-fullscreen"></i></button></li>
<li><button id="id-btn-close" class="control-btn no-caption"><i class="control-icon-close"></i></button></li>
</ul>
<div class="group left">
<div id="box-tools" class="dropdown">
<button class="control-btn svg-icon tools"></button>
</div>
</div>
<div class="group center">
<span><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></span>
</div>
<div class="group right">
<div class="item"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
<div class="item separator"></div>
<div class="item"><button id="id-btn-close" class="control-btn close"><span aria-hidden="true">&times;</span></button></div>
</div>
</div>
<div class="modal fade error" id="id-critical-error-dialog" tabindex="-1" role="dialog">
@ -305,11 +302,12 @@
<div class="cmd-loader-title">Please wait...</div>
</div>
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></div>
<!--vendor-->
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/jquery.browser.min.js"></script>
<script type="text/javascript" src="../../../vendor/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../../vendor/ZeroClipboard/ZeroClipboard.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/jszip/jszip.min.js"></script>
@ -321,7 +319,6 @@
<script type="text/javascript" src="../../../../sdkjs/word/sdk-all-min.js"></script>
<!--application-->
<link href="../../../apps/documenteditor/embed/resources/css/app-all.css" rel="stylesheet">
<script type="text/javascript" src="../../../apps/documenteditor/embed/app-all.js"></script>
<script type="text/javascript">
var isBrowserSupported = function() {

View file

@ -38,13 +38,8 @@ var ApplicationController = new(function(){
embedConfig = {},
permissions = {},
maxPages = 0,
minToolbarWidth = 550,
minEmbedWidth = 400,
minEmbedHeight = 600,
embedCode = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="{embed-url}" width="{width}" height="{height}"></iframe>',
maxZIndex = 9090,
created = false,
iframePrint = null;
ttOffset = [0, -10];
// Initialize analytics
// -------------------------
@ -60,56 +55,6 @@ var ApplicationController = new(function(){
return;
}
// Initialize ZeroClipboard
// -------------------------
ZeroClipboard.setMoviePath('../../../vendor/ZeroClipboard/ZeroClipboard10.swf');
var clipShortUrl = new ZeroClipboard.Client();
var clipEmbedObj = new ZeroClipboard.Client();
clipShortUrl.zIndex = maxZIndex;
clipEmbedObj.zIndex = maxZIndex;
// Utils
// -------------------------
function emptyFn(){}
function htmlEncode(value){
return $('<div/>').text(value).html();
}
function createBuffered(fn, buffer, scope, args) {
return function(){
var timerId;
return function() {
var me = this;
if (timerId) {
clearTimeout(timerId);
timerId = null;
}
timerId = setTimeout(function(){
fn.apply(scope || me, args || arguments);
}, buffer);
};
}();
}
function updateSocial() {
var $socialPanel = $('#id-popover-social-container');
if ($socialPanel.length > 0) {
if ($socialPanel.attr('data-loaded') == 'false') {
typeof FB !== 'undefined' && FB.XFBML && FB.XFBML.parse();
typeof twttr !== 'undefined' && twttr.widgets && twttr.widgets.load();
$socialPanel.attr('data-loaded', 'true');
}
}
}
// Handlers
// -------------------------
@ -117,37 +62,7 @@ var ApplicationController = new(function(){
config = $.extend(config, data.config);
embedConfig = $.extend(embedConfig, data.config.embedded);
$('#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 != ''){
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
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>'); //data-count="none"
$('#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')
$('#id-btn-share').hide();
if (typeof embedConfig.embedUrl === 'undefined')
$('#id-btn-embed').hide();
if (typeof embedConfig.fullscreenUrl === 'undefined')
$('#id-btn-fullscreen').hide();
if (config.canBackToFolder === false || !(config.customization && config.customization.goback && config.customization.goback.url))
$('#id-btn-close').hide();
common.controller.modals.init(embedConfig);
// Docked toolbar
if (embedConfig.toolbarDocked === 'top') {
@ -156,10 +71,14 @@ var ApplicationController = new(function(){
} else {
$('#toolbar').addClass('bottom');
$('#editor_sdk').addClass('bottom');
$('#box-tools').removeClass('dropdown').addClass('dropup');
ttOffset[1] = -40;
}
// Hide last separator
if (!$('#id-btn-fullscreen').is(":visible") && !$('#id-btn-close').is(":visible")) {
if (config.canBackToFolder === false || !(config.customization && config.customization.goback && config.customization.goback.url)) {
$('#id-btn-close').hide();
// Hide last separator
$('#toolbar .right .separator').hide();
$('#pages').css('margin-right', '12px');
}
@ -187,11 +106,9 @@ var ApplicationController = new(function(){
Common.Analytics.trackEvent('Load', 'Start');
}
if (typeof embedConfig.saveUrl === 'undefined' && permissions.print === false)
$('#id-btn-copy').hide();
if (!$('#id-btn-copy').is(":visible") && !$('#id-btn-share').is(":visible") && !$('#id-btn-embed').is(":visible") )
$('#toolbar .left .separator').hide();
embedConfig.docTitle = docConfig.title;
if ( !embedConfig.saveUrl && permissions.print === false)
$('#idt-copy').hide();
}
}
@ -204,14 +121,6 @@ var ApplicationController = new(function(){
$('#page-number').val(number + 1);
}
function onHyperlinkClick(url) {
if (url) {
var newDocumentPage = window.open(url, '_blank');
if (newDocumentPage)
newDocumentPage.focus();
}
}
function onLongActionBegin(type, id) {
var text = '';
switch (id)
@ -240,32 +149,43 @@ var ApplicationController = new(function(){
function onDocMouseMoveEnd() {
if (me.isHideBodyTip) {
var $tipHyperlink = $('#id-tip-hyperlink');
if ($tipHyperlink.length > 0) {
$tipHyperlink.hide();
if ( $tooltip ) {
$tooltip.tooltip('hide');
$tooltip = false;
}
}
}
var $ttEl, $tooltip;
function onDocMouseMove(data) {
if (data) {
if (data.get_Type() == 1) { // hyperlink
me.isHideBodyTip = false;
var $tipHyperlink = $('#id-tip-hyperlink'),
hyperProps = data.get_Hyperlink(),
toolTip = (hyperProps.get_ToolTip()) ? hyperProps.get_ToolTip() : hyperProps.get_Value();
if ( !$ttEl ) {
$ttEl = $('.hyperlink-tooltip');
$ttEl.tooltip({'container':'body', 'trigger':'manual'});
$ttEl.on('shown.bs.tooltip', function(e) {
$tooltip = $ttEl.data('bs.tooltip').tip();
if ($tipHyperlink.length > 0) {
$tipHyperlink.find('.popover-content p').html(htmlEncode(toolTip) + '<br><b>Press Ctrl and click link</b>');
$tipHyperlink.show();
$tooltip.css({
left: $ttEl.ttpos[0] + ttOffset[0],
top: $ttEl.ttpos[1] + ttOffset[1]
});
$tooltip.find('.tooltip-arrow').css({left: 10});
});
}
$tipHyperlink.css({
left: data.get_X() - 10,
top : data.get_Y() - 25
})
if ( !$tooltip ) {
$ttEl.ttpos = [data.get_X(), data.get_Y()];
$ttEl.tooltip('show');
} else {
$tooltip.css({
left:data.get_X() + ttOffset[0],
top:data.get_Y() + ttOffset[1]
});
}
}
}
}
@ -275,32 +195,12 @@ var ApplicationController = new(function(){
}
function onPrint() {
if (api && permissions.print!==false)
if ( permissions.print!==false )
api.asc_Print($.browser.chrome || $.browser.safari || $.browser.opera);
}
function onPrintUrl(url) {
if (iframePrint) {
iframePrint.parentNode.removeChild(iframePrint);
iframePrint = null;
}
if (!iframePrint) {
iframePrint = document.createElement("iframe");
iframePrint.id = "id-print-frame";
iframePrint.style.display = 'none';
iframePrint.style.visibility = "hidden";
iframePrint.style.position = "fixed";
iframePrint.style.right = "0";
iframePrint.style.bottom = "0";
document.body.appendChild(iframePrint);
iframePrint.onload = function() {
iframePrint.contentWindow.focus();
iframePrint.contentWindow.print();
iframePrint.contentWindow.blur();
window.focus();
};
}
if (url) iframePrint.src = url;
common.utils.dialogPrint(url);
}
function hidePreloader() {
@ -308,13 +208,106 @@ var ApplicationController = new(function(){
}
function onDocumentContentReady() {
setVisiblePopover($('#id-popover-share'), false);
setVisiblePopover($('#id-popover-embed'), false);
$('#id-tip-hyperlink').hide();
handlerToolbarSize();
hidePreloader();
if ( !embedConfig.shareUrl )
$('#idt-share').hide();
if ( !embedConfig.embedUrl )
$('#idt-embed').hide();
if ( !embedConfig.fullscreenUrl )
$('#idt-fullscreen').hide();
common.controller.modals.attach({
share: '#idt-share',
embed: '#idt-embed'
});
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
api.asc_registerCallback('asc_onEndAction', onLongActionEnd);
api.asc_registerCallback('asc_onMouseMoveStart', onDocMouseMoveStart);
api.asc_registerCallback('asc_onMouseMoveEnd', onDocMouseMoveEnd);
api.asc_registerCallback('asc_onMouseMove', onDocMouseMove);
api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink);
api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl);
api.asc_registerCallback('asc_onPrint', onPrint);
api.asc_registerCallback('asc_onPrintUrl', onPrintUrl);
Common.Gateway.on('processmouse', onProcessMouse);
Common.Gateway.on('downloadas', onDownloadAs);
ApplicationView.tools.get('#idt-fullscreen')
.on('click', function(){
common.utils.openLink(embedConfig.fullscreenUrl);
});
ApplicationView.tools.get('#idt-download')
.on('click', function(){
if ( !!embedConfig.saveUrl ){
common.utils.openLink(embedConfig.saveUrl);
} else
if (api && permissions.print!==false){
api.asc_Print($.browser.chrome || $.browser.safari || $.browser.opera);
}
Common.Analytics.trackEvent('Save');
});
$('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback && config.customization.goback.url)
window.parent.location.href = config.customization.goback.url;
});
$('#id-btn-zoom-in').on('click', api.zoomIn.bind(this));
$('#id-btn-zoom-out').on('click', api.zoomOut.bind(this));
var $pagenum = $('#page-number');
$pagenum.on({
'keyup': function(e){
if ( e.keyCode == 13 ){
var newPage = parseInt($('#page-number').val());
if ( newPage > maxPages ) newPage = maxPages;
if (newPage < 2 || isNaN(newPage)) newPage = 1;
api.goToPage(newPage-1);
$pagenum.blur();
}
}
, 'focusin' : function(e) {
$pagenum.removeClass('masked');
}
, 'focusout': function(e){
!$pagenum.hasClass('masked') && $pagenum.addClass('masked');
}
});
$('#pages').on('click', function(e) {
$pagenum.focus();
});
var documentMoveTimer;
var ismoved = false;
$(document).mousemove(function(event){
$('#id-btn-zoom-in').fadeIn();
$('#id-btn-zoom-out').fadeIn();
ismoved = true;
if ( !documentMoveTimer ) {
documentMoveTimer = setInterval(function(){
if ( !ismoved ) {
$('#id-btn-zoom-in').fadeOut();
$('#id-btn-zoom-out').fadeOut();
clearInterval(documentMoveTimer);
documentMoveTimer = undefined;
}
ismoved = false;
}, 2000);
}
});
Common.Analytics.trackEvent('Load', 'Complete');
}
@ -439,112 +432,8 @@ var ApplicationController = new(function(){
// Helpers
// -------------------------
var handlerToolbarSize = createBuffered(function(size){
var visibleCaption = function(btn, visible){
if (visible){
$(btn + ' button').addClass('no-caption');
$(btn + ' button span').css('display', 'none');
} else {
$(btn + ' button').removeClass('no-caption');
$(btn + ' button span').css('display', 'inline');
}
};
var isMinimize = $('#toolbar').width() < minToolbarWidth;
visibleCaption('#id-btn-copy', isMinimize);
visibleCaption('#id-btn-share', isMinimize);
visibleCaption('#id-btn-embed', isMinimize);
}, 10);
function onDocumentResize() {
if (api)
api.Resize();
handlerToolbarSize();
}
function isVisiblePopover(popover){
return popover.hasClass('in');
}
function setVisiblePopover(popover, visible, owner){
api && api.asc_enableKeyEvents(!visible);
if (visible){
if (owner){
popover.css('display', 'block');
var popoverData = owner.data('bs.popover'),
$tip = popoverData.tip(),
pos = popoverData.getPosition(false),
actualHeight = $tip[0].offsetHeight,
placement = (embedConfig.toolbarDocked === 'top') ? 'bottom' : 'top',
tp;
$tip.removeClass('fade in top bottom left right');
switch (placement) {
case 'bottom':
tp = {
top : pos.top + pos.height,
left: owner.position().left + (owner.width() - popover.width()) * 0.5
};
break;
default:
case 'top':
tp = {
top : pos.top - actualHeight,
left: owner.position().left + (owner.width() - popover.width()) * 0.5
};
break;
}
$tip
.css(tp)
.addClass(placement)
.addClass('in')
}
if (popover.hasClass('embed')) {
clipEmbedObj.show();
}
if (popover.hasClass('share')) {
clipShortUrl.show();
updateSocial();
}
} else {
popover.removeClass('in');
popover.css('display', 'none');
popover.hasClass('embed') && clipEmbedObj.hide();
popover.hasClass('share') && clipShortUrl.hide();
}
}
function updateEmbedCode(){
var newWidth = parseInt($('#id-input-embed-width').val()),
newHeight = parseInt($('#id-input-embed-height').val());
if (newWidth < minEmbedWidth)
newWidth = minEmbedWidth;
if (newHeight < minEmbedHeight)
newHeight = minEmbedHeight;
$('#id-textarea-embed').text(embedCode.replace('{embed-url}', embedConfig.embedUrl).replace('{width}', newWidth).replace('{height}', newHeight));
$('#id-input-embed-width').val(newWidth + 'px');
$('#id-input-embed-height').val(newHeight + 'px');
}
function openLink(url){
var newDocumentPage = window.open(url);
if (newDocumentPage)
newDocumentPage.focus();
api && api.Resize();
}
function createController(){
@ -554,159 +443,40 @@ var ApplicationController = new(function(){
me = this;
created = true;
var documentMoveTimer;
// Initialize clipboard objects
clipShortUrl.addEventListener('mousedown', function() {
if ($('#id-btn-copy-short').hasClass('copied'))
return;
$('#id-btn-copy-short').button('copied');
$('#id-btn-copy-short').addClass('copied');
clipShortUrl.setText($('#id-short-url').val());
setTimeout(function(){
$('#id-btn-copy-short').button('reset');
$('#id-btn-copy-short').removeClass('copied');
}, 2000);
});
clipEmbedObj.addEventListener('mousedown', function(){
if ($('#id-btn-copy-embed').hasClass('copied'))
return;
$('#id-btn-copy-embed').button('copied');
$('#id-btn-copy-embed').addClass('copied');
clipEmbedObj.setText($('#id-textarea-embed').text());
setTimeout(function(){
$('#id-btn-copy-embed').button('reset');
$('#id-btn-copy-embed').removeClass('copied');
}, 2000);
});
clipShortUrl.glue('id-btn-copy-short');
clipEmbedObj.glue('id-btn-copy-embed');
// popover ui handlers
$('#id-btn-copy').on('click', function(){
var saveUrl = embedConfig.saveUrl;
if (typeof saveUrl !== 'undefined' && saveUrl.length > 0){
openLink(saveUrl);
} else if (api && permissions.print!==false){
api.asc_Print($.browser.chrome || $.browser.safari || $.browser.opera);
}
Common.Analytics.trackEvent('Save');
});
$('#id-btn-share').on('click', function(event){
setVisiblePopover($('#id-popover-share'), !isVisiblePopover($('#id-popover-share')), $('#id-btn-share'));
setVisiblePopover($('#id-popover-embed'), false);
event.preventDefault();
event.stopPropagation();
});
$('#id-btn-embed').on('click', function(event){
setVisiblePopover($('#id-popover-embed'), !isVisiblePopover($('#id-popover-embed')), $('#id-btn-embed'));
setVisiblePopover($('#id-popover-share'), false);
event.preventDefault();
event.stopPropagation();
});
$('#id-input-embed-width').on('keypress', function(e){
if (e.keyCode == 13)
updateEmbedCode();
});
$('#id-input-embed-height').on('keypress', function(e){
if (e.keyCode == 13)
updateEmbedCode();
});
$('#id-input-embed-width').on('focusin', function(e){
api && api.asc_enableKeyEvents(false);
});
$('#id-input-embed-height').on('focusin', function(e){
api && api.asc_enableKeyEvents(false);
});
$('#id-input-embed-width').on('focusout', function(e){
updateEmbedCode();
api && api.asc_enableKeyEvents(true);
});
$('#id-input-embed-height').on('focusout', function(e){
updateEmbedCode();
api && api.asc_enableKeyEvents(true);
});
$('#page-number').on('keyup', function(e){
if (e.keyCode == 13){
var newPage = parseInt($('#page-number').val());
if (newPage > maxPages)
newPage = maxPages;
if (newPage < 2 || isNaN(newPage))
newPage = 1;
if (api)
api.goToPage(newPage-1);
}
});
$('#page-number').on('focusout', function(e){
api && api.asc_enableKeyEvents(true);
});
$('#id-btn-fullscreen').on('click', function(){
openLink(embedConfig.fullscreenUrl);
});
$('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback && config.customization.goback.url)
window.parent.location.href = config.customization.goback.url;
});
$('#id-btn-zoom-in').on('click', function(){
if (api)
api.zoomIn();
});
$('#id-btn-zoom-out').on('click', function(){
if (api)
api.zoomOut();
});
$(window).resize(function(){
onDocumentResize();
});
$(document).click(function(event){
if (event && event.target && $(event.target).closest('.popover').length > 0)
return;
var ismodalshown = false;
$(document.body).on('show.bs.modal', '.modal',
function(e) {
ismodalshown = true;
api.asc_enableKeyEvents(false);
}
).on('hidden.bs.modal', '.modal',
function(e) {
ismodalshown = false;
api.asc_enableKeyEvents(true);
}
).on('hidden.bs.dropdown', '.dropdown',
function(e) {
if ( !ismodalshown )
api.asc_enableKeyEvents(true);
}
).on('blur', 'input, textarea',
function(e) {
if ( !ismodalshown ) {
if (!/area_id/.test(e.target.id) ) {
api.asc_enableKeyEvents(true);
}
}
}
);
setVisiblePopover($('#id-popover-share'), false);
setVisiblePopover($('#id-popover-embed'), false);
});
$(document).mousemove(function(event){
$('#id-btn-zoom-in').fadeIn();
$('#id-btn-zoom-out').fadeIn();
clearTimeout(documentMoveTimer);
documentMoveTimer = setTimeout(function(){
$('#id-btn-zoom-in').fadeOut();
$('#id-btn-zoom-out').fadeOut();
}, 2000);
$('#editor_sdk').on('click', function(e) {
if ( e.target.localName == 'canvas' ) {
e.currentTarget.focus();
}
});
window["flat_desine"] = true;
@ -718,27 +488,15 @@ var ApplicationController = new(function(){
api.asc_registerCallback('asc_onError', onError);
api.asc_registerCallback('asc_onDocumentContentReady', onDocumentContentReady);
api.asc_registerCallback('asc_onOpenDocumentProgress', onOpenDocument);
api.asc_registerCallback('asc_onCountPages', onCountPages);
// api.asc_registerCallback('OnCurrentVisiblePage', onCurrentPage);
api.asc_registerCallback('asc_onCurrentPage', onCurrentPage);
api.asc_registerCallback('asc_onHyperlinkClick', onHyperlinkClick);
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
api.asc_registerCallback('asc_onEndAction', onLongActionEnd);
api.asc_registerCallback('asc_onMouseMoveStart', onDocMouseMoveStart);
api.asc_registerCallback('asc_onMouseMoveEnd', onDocMouseMoveEnd);
api.asc_registerCallback('asc_onMouseMove', onDocMouseMove);
api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl);
api.asc_registerCallback('asc_onPrint', onPrint);
api.asc_registerCallback('asc_onPrintUrl', onPrintUrl);
// Initialize api gateway
Common.Gateway.on('init', loadConfig);
Common.Gateway.on('opendocument', loadDocument);
Common.Gateway.on('showerror', onExternalError);
Common.Gateway.on('processmouse', onProcessMouse);
Common.Gateway.on('downloadas', onDownloadAs);
Common.Gateway.ready();
}

View file

@ -31,50 +31,31 @@
*
*/
var ApplicationView = new(function(){
var $btnTools;
// Initialize view
function createView(){
$('#id-btn-share').popover({
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>' +
'<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');
$btnTools = $('#box-tools button');
$('#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="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>'
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
$btnTools.parent().append(
'<ul class="dropdown-menu">' +
'<li><a id="idt-download" href="#"><span class="mi-icon svg-icon download"></span>Download</a></li>' +
'<li><a id="idt-share" href="#" data-toggle="modal"><span class="mi-icon svg-icon share"></span>Share</a></li>' +
'<li><a id="idt-embed" href="#" data-toggle="modal"><span class="mi-icon svg-icon embed"></span>Embed</a></li>' +
'<li><a id="idt-fullscreen" href="#"><span class="mi-icon svg-icon fullscr"></span>Full Screen</a></li>' +
'</ul>');
}
}).popover('show');
$('body').popover({
trigger : 'manual',
html : true,
animation : false,
template : '<div class="popover hyperlink" id="id-tip-hyperlink"><div class="popover-inner"><div class="popover-content"><p></p></div></div></div>',
content : '<br><b>Press Ctrl and click link</b>'
}).popover('show');
function getTools(name) {
return $btnTools.parent().find(name);
}
return {
create: createView
, tools: {
get: getTools
}
}
})();

View file

@ -30,11 +30,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
(function ($) {
$(function(){
ApplicationView.create();
ApplicationController.create();
})
})(window.jQuery);
+function ($) {
ApplicationView.create();
ApplicationController.create();
}();

View file

@ -275,8 +275,6 @@ define([
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FirstName(this.appOptions.user.firstname);
_user.put_LastName(this.appOptions.user.lastname);
_user.put_FullName(this.appOptions.user.fullname);
docInfo = new Asc.asc_CDocInfo();
@ -825,6 +823,10 @@ define([
/** coauthoring begin **/
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("de-settings-coauthmode");
if (value===null && Common.localStorage.getItem("de-settings-autosave")===null &&
me.appOptions.customization && me.appOptions.customization.autosave===false) {
value = 0; // use customization.autosave only when de-settings-coauthmode and de-settings-autosave are null
}
me._state.fastCoauth = (value===null || parseInt(value) == 1);
me.api.asc_SetFastCollaborative(me._state.fastCoauth);
@ -874,6 +876,8 @@ define([
if (me.appOptions.isEdit) {
value = Common.localStorage.getItem("de-settings-autosave");
if (value===null && me.appOptions.customization && me.appOptions.customization.autosave===false)
value = 0;
value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
me.api.asc_setAutoSaveGap(value);
@ -1318,7 +1322,7 @@ define([
function showNextTip() {
var str_tip = strings.shift();
if (str_tip) {
str_tip += me.textCloseTip;
str_tip += '\n' + me.textCloseTip;
tooltip.setTitle(str_tip);
tooltip.show();
}
@ -1964,7 +1968,7 @@ define([
loadingDocumentTextText: 'Loading document...',
warnProcessRightsChange: 'You have been denied the right to edit the file.',
errorProcessSaveResult: 'Saving is failed.',
textCloseTip: '\nClick to close the tip.',
textCloseTip: 'Click to close the tip.',
textShape: 'Shape',
errorStockChart: 'Incorrect row order. To build a stock chart place the data on the sheet in the following order:<br> opening price, max price, min price, closing price.',
errorDataRange: 'Incorrect data range.',

View file

@ -333,6 +333,9 @@ define([
this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0));
value = Common.localStorage.getItem("de-settings-coauthmode");
if (value===null && Common.localStorage.getItem("de-settings-autosave")===null &&
this.mode.customization && this.mode.customization.autosave===false)
value = 0; // use customization.autosave only when de-settings-coauthmode and de-settings-autosave are null
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
@ -356,6 +359,8 @@ define([
this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("de-settings-autosave");
if (value===null && this.mode.customization && this.mode.customization.autosave===false)
value = 0;
this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("de-settings-spellcheck");

View file

@ -170,7 +170,7 @@ define([
}, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
this.btnEditObject.on('click', _.bind(function(btn){
if (this.api) this.api.asc_pluginRun(this._originalProps.asc_getPluginGuid(), 0, this._originalProps.asc_getPluginData());
if (this.api) this.api.asc_startEditCurrentOleObject();
this.fireEvent('editcomplete', this);
}, this));

View file

@ -314,9 +314,9 @@ define([
return me.txtPageNumInvalid;
}
}).on('keypress:after', function(input, e) {
var box = me.$el.find('#status-goto-box');
if (e.keyCode === Common.UI.Keys.RETURN) {
var edit = box.find('input[type=text]'), page = parseInt(edit.val());
var box = me.$el.find('#status-goto-box'),
edit = box.find('input[type=text]'), page = parseInt(edit.val());
if (!page || page-- > me.pages.get('count') || page < 0) {
edit.select();
return false;
@ -328,6 +328,15 @@ define([
me.api.goToPage(page);
me.api.asc_enableKeyEvents(true);
return false;
}
}
).on('keyup:after', function(input, e) {
if (e.keyCode === Common.UI.Keys.ESC) {
var box = me.$el.find('#status-goto-box');
box.focus(); // for IE
box.parent().removeClass('open');
me.api.asc_enableKeyEvents(true);
return false;
}
}

View file

@ -257,7 +257,7 @@
<!-- debug begin -->
<script type="text/javascript">var less=less||{};less.env='development';</script>
<script src="../../../vendor/less/dist/less-1.5.1.js" type="text/javascript"></script>
<script src="../../../vendor/less/dist/less-2.7.1.js" type="text/javascript"></script>
<!-- debug end -->
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>

View file

@ -255,7 +255,7 @@
"DE.Controllers.Main.splitMaxRowsErrorText": "The number of rows must be less than %1.",
"DE.Controllers.Main.textAnonymous": "Anonymous",
"DE.Controllers.Main.textBuyNow": "Visit website",
"DE.Controllers.Main.textCloseTip": "\nClick to close the tip",
"DE.Controllers.Main.textCloseTip": "Click to close the tip",
"DE.Controllers.Main.textContactUs": "Contact sales",
"DE.Controllers.Main.textLoadingDocument": "Loading document",
"DE.Controllers.Main.textNoLicenseTitle": "ONLYOFFICE open source version",

View file

@ -245,7 +245,7 @@
"DE.Controllers.Main.splitMaxRowsErrorText": "El número de filas debe ser menos que %1.",
"DE.Controllers.Main.textAnonymous": "Anónimo",
"DE.Controllers.Main.textBuyNow": "Visit website",
"DE.Controllers.Main.textCloseTip": "\nPulse para cerrar el consejo",
"DE.Controllers.Main.textCloseTip": "Pulse para cerrar el consejo",
"DE.Controllers.Main.textContactUs": "Contact sales",
"DE.Controllers.Main.textLoadingDocument": "Cargando documento",
"DE.Controllers.Main.textNoLicenseTitle": "ONLYOFFICE open source version",

View file

@ -230,7 +230,7 @@
"DE.Controllers.Main.splitMaxColsErrorText": "O número de colunas deve ser inferior a %1.",
"DE.Controllers.Main.splitMaxRowsErrorText": "O número de linhas deve ser inferior a %1.",
"DE.Controllers.Main.textAnonymous": "Anônimo",
"DE.Controllers.Main.textCloseTip": "\nClique para fechar a dica",
"DE.Controllers.Main.textCloseTip": "Clique para fechar a dica",
"DE.Controllers.Main.textLoadingDocument": "Carregando documento",
"DE.Controllers.Main.textStrict": "Strict mode",
"DE.Controllers.Main.textTryUndoRedo": "The Undo/Redo functions are disabled for the Fast co-editing mode.<br>Click the 'Strict mode' button to switch to the Strict co-editing mode to edit the file without other users interference and send your changes only after you save them. You can switch between the co-editing modes using the editor Advanced settings.",

View file

@ -255,7 +255,7 @@
"DE.Controllers.Main.splitMaxRowsErrorText": "Число строк должно быть меньше, чем %1.",
"DE.Controllers.Main.textAnonymous": "Аноним",
"DE.Controllers.Main.textBuyNow": "Перейти на сайт",
"DE.Controllers.Main.textCloseTip": "\nЩелкните, чтобы закрыть эту подсказку",
"DE.Controllers.Main.textCloseTip": "Щелкните, чтобы закрыть эту подсказку",
"DE.Controllers.Main.textContactUs": "Связаться с отделом продаж",
"DE.Controllers.Main.textLoadingDocument": "Загрузка документа",
"DE.Controllers.Main.textNoLicenseTitle": "Open source версия ONLYOFFICE",

View file

@ -230,7 +230,7 @@
"DE.Controllers.Main.splitMaxColsErrorText": "Število stolpcev mora biti manj kot 1%.",
"DE.Controllers.Main.splitMaxRowsErrorText": "Število vrstic mora biti manj kot %1.",
"DE.Controllers.Main.textAnonymous": "Anonimno",
"DE.Controllers.Main.textCloseTip": "\nPritisni za zapiranje namiga",
"DE.Controllers.Main.textCloseTip": "Pritisni za zapiranje namiga",
"DE.Controllers.Main.textLoadingDocument": "Nalaganje dokumenta",
"DE.Controllers.Main.textStrict": "Strict mode",
"DE.Controllers.Main.textTryUndoRedo": "The Undo/Redo functions are disabled for the Fast co-editing mode.<br>Click the 'Strict mode' button to switch to the Strict co-editing mode to edit the file without other users interference and send your changes only after you save them. You can switch between the co-editing modes using the editor Advanced settings.",

View file

@ -230,7 +230,7 @@
"DE.Controllers.Main.splitMaxColsErrorText": "Sütun sayısı %1'den az olmalıdır.",
"DE.Controllers.Main.splitMaxRowsErrorText": "Satır sayısı %1'den az olmalıdır.",
"DE.Controllers.Main.textAnonymous": "Anonim",
"DE.Controllers.Main.textCloseTip": "\nUcu kapamak için tıklayın",
"DE.Controllers.Main.textCloseTip": "Ucu kapamak için tıklayın",
"DE.Controllers.Main.textLoadingDocument": "Döküman yükleniyor",
"DE.Controllers.Main.textStrict": "Strict mode",
"DE.Controllers.Main.textTryUndoRedo": "The Undo/Redo functions are disabled for the Fast co-editing mode.<br>Click the 'Strict mode' button to switch to the Strict co-editing mode to edit the file without other users interference and send your changes only after you save them. You can switch between the co-editing modes using the editor Advanced settings.",

View file

@ -194,14 +194,14 @@
.btn-edit-table {background-position: 0 0;}
button.over .btn-edit-table {background-position: -28px 0;}
.btn-group.open .btn-edit-table,
button.active .btn-edit-table,
button:active .btn-edit-table {background-position: -56px 0;}
button.active:not(.disabled) .btn-edit-table,
button:active:not(.disabled) .btn-edit-table {background-position: -56px 0;}
.btn-change-shape {background-position: 0 -16px;}
button.over .btn-change-shape {background-position: -28px -16px;}
.btn-group.open .btn-change-shape,
button.active .btn-change-shape,
button:active .btn-change-shape {background-position: -56px -16px;}
button.active:not(.disabled) .btn-change-shape,
button:active:not(.disabled) .btn-change-shape {background-position: -56px -16px;}
.combo-pattern-item {
.background-ximage('@{app-image-path}/right-panels/patterns.png', '@{app-image-path}/right-panels/patterns@2x.png', 112px);

View file

@ -58,6 +58,9 @@
white-space: nowrap;
padding-top: 3px;
vertical-align: top;
&.dropup {
position: static;
}
}
.separator {

View file

@ -181,7 +181,7 @@
</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
<![endif]-->
</head>
@ -192,11 +192,6 @@
<script src="../../../vendor/less/dist/less-1.5.1.js" type="text/javascript"></script>
<!-- debug end -->
<!--facebook button-->
<div id="fb-root"></div>
<!--twitter button-->
<script>
var userAgent = navigator.userAgent.toLowerCase(),
check = function(regex){ return regex.test(userAgent); };
@ -268,29 +263,33 @@
'</div>');
</script>
<div id="editor_sdk" class="viewer" style="overflow: hidden;"></div>
<div id="box-preview">
<div id="id-preview" tabindex="-1"></div>
</div>
<div id="editor_sdk" class="viewer" style="overflow: hidden;" tabindex="-1"></div>
<div class="overlay-controls" style="margin-left: -32px">
<ul class="left">
<li id="id-btn-move-left"><button class="overlay"><i class="overlay-icon-move-left"></i></button></li>
<li id="id-btn-move-right"><button class="overlay"><i class="overlay-icon-move-right"></i></button></li>
<li id="btn-left"><button class="overlay svg-icon slide-prev"></button></li>
<li id="btn-play"><button class="overlay svg-icon play"></button></li>
<li id="btn-right"><button class="overlay svg-icon slide-next"></button></li>
</ul>
</div>
<div class="toolbar" id="toolbar">
<ul class="left">
<li><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></li>
<li class="separator"></li>
<li id="id-btn-copy"><button class="control-btn"><i class="control-icon-save"></i><span>Save Copy</span></button></li>
<li id="id-btn-share"><button class="control-btn"><i class="control-icon-share"></i><span>Share</span></button></li>
<li id="id-btn-embed"><button class="control-btn"><i class="control-icon-embed"></i><span>Embed</span></button></li>
</ul>
<ul class="right">
<li><input id="page-number" class="form-control input-sm" style="width: 25px;" type="text" value="0"><span class="text" id="pages">of 0</span></li>
<li class="separator"></li>
<li><button id="id-btn-fullscreen" class="control-btn no-caption"><i class="control-icon-fullscreen"></i></button></li>
<li><button id="id-btn-close" class="control-btn no-caption"><i class="control-icon-close"></i></button></li>
</ul>
<div class="group left">
<div id="box-tools" class="dropdown">
<button class="control-btn svg-icon tools"></button>
</div>
</div>
<div class="group center">
<span><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></span>
</div>
<div class="group right">
<div class="item"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
<div class="item separator"></div>
<div class="item"><button id="id-btn-close" class="control-btn close"><span aria-hidden="true">&times;</span></button></div>
</div>
</div>
<div class="error modal fade" id="id-critical-error-dialog" tabindex="-1" role="dialog">
@ -314,11 +313,12 @@
<div class="cmd-loader-title">Please wait...</div>
</div>
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></div>
<!--vendor-->
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/jquery.browser/dist/jquery.browser.min.js"></script>
<script type="text/javascript" src="../../../vendor/bootstrap/dist/js/bootstrap.js"></script>
<script type="text/javascript" src="../../../vendor/ZeroClipboard/ZeroClipboard.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/jszip/jszip.min.js"></script>
@ -335,6 +335,9 @@
<!--application-->
<script type="text/javascript" src="../../common/Gateway.js"></script>
<script type="text/javascript" src="../../common/Analytics.js"></script>
<script type="text/javascript" src="../../common/embed/lib/util/utils.js"></script>
<script type="text/javascript" src="../../common/embed/lib/view/modals.js"></script>
<script type="text/javascript" src="../../common/embed/lib/controller/modals.js"></script>
<script type="text/javascript" src="js/ApplicationView.js"></script>
<script type="text/javascript" src="js/ApplicationController.js"></script>
<script type="text/javascript" src="js/application.js"></script>

View file

@ -7,6 +7,8 @@
<meta name="description" content="">
<meta name="author" content="">
<link href="../../../apps/presentationeditor/embed/resources/css/app-all.css" rel="stylesheet">
<!-- splash -->
<style type="text/css">
@ -177,17 +179,12 @@
</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
<![endif]-->
</head>
<body class="embed-body">
<!--facebook button-->
<div id="fb-root"></div>
<!--twitter button-->
<script>
var userAgent = navigator.userAgent.toLowerCase(),
check = function(regex){ return regex.test(userAgent); };
@ -259,29 +256,33 @@
'</div>');
</script>
<div id="editor_sdk" class="viewer" style="overflow: hidden;"></div>
<div id="box-preview">
<div id="id-preview" tabindex="-1"></div>
</div>
<div id="editor_sdk" class="viewer" style="overflow: hidden;" tabindex="-1"></div>
<div class="overlay-controls" style="margin-left: -32px">
<ul class="left">
<li id="id-btn-move-left"><button class="overlay"><i class="overlay-icon-move-left"></i></button></li>
<li id="id-btn-move-right"><button class="overlay"><i class="overlay-icon-move-right"></i></button></li>
<li id="btn-left"><button class="overlay svg-icon slide-prev"></button></li>
<li id="btn-play"><button class="overlay svg-icon play"></button></li>
<li id="btn-right"><button class="overlay svg-icon slide-next"></button></li>
</ul>
</div>
<div class="toolbar" id="toolbar">
<ul class="left">
<li><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></li>
<li class="separator"></li>
<li id="id-btn-copy"><button class="control-btn"><i class="control-icon-save"></i><span>Save Copy</span></button></li>
<li id="id-btn-share"><button class="control-btn"><i class="control-icon-share"></i><span>Share</span></button></li>
<li id="id-btn-embed"><button class="control-btn"><i class="control-icon-embed"></i><span>Embed</span></button></li>
</ul>
<ul class="right">
<li><input id="page-number" class="form-control input-sm" style="width: 25px;" type="text" value="0"><span class="text" id="pages">of 0</span></li>
<li class="separator"></li>
<li><button id="id-btn-fullscreen" class="control-btn no-caption"><i class="control-icon-fullscreen"></i></button></li>
<li><button id="id-btn-close" class="control-btn no-caption"><i class="control-icon-close"></i></button></li>
</ul>
<div class="group left">
<div id="box-tools" class="dropdown">
<button class="control-btn svg-icon tools"></button>
</div>
</div>
<div class="group center">
<span><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></span>
</div>
<div class="group right">
<div class="item"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
<div class="item separator"></div>
<div class="item"><button id="id-btn-close" class="control-btn close"><span aria-hidden="true">&times;</span></button></div>
</div>
</div>
<div class="error modal fade" id="id-critical-error-dialog" tabindex="-1" role="dialog">
@ -305,11 +306,12 @@
<div class="cmd-loader-title">Please wait...</div>
</div>
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></div>
<!--vendor-->
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/jquery.browser.min.js"></script>
<script type="text/javascript" src="../../../vendor/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../../vendor/ZeroClipboard/ZeroClipboard.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/jszip/jszip.min.js"></script>
@ -321,7 +323,6 @@
<script type="text/javascript" src="../../../../sdkjs/slide/sdk-all-min.js"></script>
<!--application-->
<link href="../../../apps/presentationeditor/embed/resources/css/app-all.css" rel="stylesheet">
<script type="text/javascript" src="../../../apps/presentationeditor/embed/app-all.js"></script>
<script type="text/javascript">
var isBrowserSupported = function() {

View file

@ -7,6 +7,8 @@
<meta name="description" content="">
<meta name="author" content="">
<link href="resources/css/application.css" rel="stylesheet">
<!-- splash -->
<style type="text/css">
@ -40,46 +42,45 @@
<link href="../../../3rdparty/bootstrap/css/bootstrap.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
<![endif]-->
</head>
<body class="embed-body">
<!--facebook button-->
<div id="fb-root"></div>
<!--twitter button-->
<div id="loading-mask" class="loadmask">
<div class="loadmask-body" align="center">
<div class="loadmask-logo"></div>
</div>
</div>
<div id="editor_sdk" class="viewer" style="overflow: hidden;"></div>
<div id="box-preview">
<div id="id-preview" tabindex="-1"></div>
</div>
<div id="editor_sdk" class="viewer" style="overflow: hidden;" tabindex="-1"></div>
<div class="overlay-controls" style="margin-left: -32px">
<ul class="left" style="width: 90px;">
<li id="id-btn-move-left"><button class="overlay"><i class="overlay-icon-move-left"></i></button></li>
<li id="id-btn-move-right"><button class="overlay"><i class="overlay-icon-move-right"></i></button></li>
<li id="btn-left"><button class="overlay svg-icon slide-prev"></button></li>
<li id="btn-play"><button class="overlay svg-icon play"></button></li>
<li id="btn-right"><button class="overlay svg-icon slide-next"></button></li>
</ul>
</div>
<div class="toolbar" id="toolbar">
<ul class="left">
<li><a class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></li>
<li class="separator"></li>
<li id="id-btn-copy"><button class="control-btn"><i class="control-icon-save"></i><span>Save Copy</span></button></li>
<li id="id-btn-share"><button class="control-btn"><i class="control-icon-share"></i><span>Share</span></button></li>
<li id="id-btn-embed"><button class="control-btn"><i class="control-icon-embed"></i><span>Embed</span></button></li>
</ul>
<ul class="right">
<li><input id="page-number" style="width: 25px" type="text" value="0"><span class="text" id="pages">of 0</span></li>
<li class="separator"></li>
<li><button id="id-btn-fullscreen" class="control-btn no-caption"><i class="control-icon-fullscreen"></i></button></li>
<li><button id="id-btn-close" class="control-btn no-caption"><i class="control-icon-close"></i></button></li>
</ul>
<div class="group left">
<div id="box-tools" class="dropdown">
<button class="control-btn svg-icon tools"></button>
</div>
</div>
<div class="group center">
<span><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></span>
</div>
<div class="group right">
<div class="item"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
<div class="item separator"></div>
<div class="item"><button id="id-btn-close" class="control-btn close"><span aria-hidden="true">&times;</span></button></div>
</div>
</div>
<div class="error modal hide" id="id-critical-error-dialog" tabindex="-1" role="dialog">
@ -99,10 +100,11 @@
<div class="cmd-loader-title">Please wait...</div>
</div>
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></div>
<!--3td party-->
<script type="text/javascript" src="../../../3rdparty/jquery/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="../../../3rdparty/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="../../../3rdparty/ZeroClipboard/ZeroClipboard.min.js"></script>
<script type="text/javascript" src="../../../3rdparty/sockjs/sockjs-0.3.min.js"></script>
<script type="text/javascript" src="../../../3rdparty/xregexp/xregexp-all-min.js"></script>
@ -203,9 +205,11 @@
<script type="text/javascript" src="../../../sdk/PowerPoint/themes/Themes.js"></script>
<!--application-->
<link href="resources/css/application.css" rel="stylesheet">
<script type="text/javascript" src="../../common/Gateway.js"></script>
<script type="text/javascript" src="../../common/Analytics.js"></script>
<script type="text/javascript" src="../../common/embed/lib/util/utils.js"></script>
<script type="text/javascript" src="../../common/embed/lib/view/modals.js"></script>
<script type="text/javascript" src="../../common/embed/lib/controller/modals.js"></script>
<script type="text/javascript" src="js/ApplicationView.js"></script>
<script type="text/javascript" src="js/ApplicationController.js"></script>
<script type="text/javascript" src="js/application.js"></script>

View file

@ -38,14 +38,9 @@ var ApplicationController = new(function(){
embedConfig = {},
permissions = {},
maxPages = 0,
minToolbarWidth = 550,
minEmbedWidth = 400,
minEmbedHeight = 600,
embedCode = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="{embed-url}" width="{width}" height="{height}"></iframe>',
maxZIndex = 9090,
created = false,
currentPage = 0,
iframePrint = null;
ttOffset = [0, -10];
// Initialize analytics
// -------------------------
@ -61,52 +56,6 @@ var ApplicationController = new(function(){
return;
}
// Initialize ZeroClipboard
// -------------------------
ZeroClipboard.setMoviePath('../../../vendor/ZeroClipboard/ZeroClipboard10.swf');
var clipShortUrl = new ZeroClipboard.Client();
var clipEmbedObj = new ZeroClipboard.Client();
clipShortUrl.zIndex = maxZIndex;
clipEmbedObj.zIndex = maxZIndex;
// Utils
// -------------------------
function emptyFn(){}
function createBuffered(fn, buffer, scope, args) {
return function(){
var timerId;
return function() {
var me = this;
if (timerId) {
clearTimeout(timerId);
timerId = null;
}
timerId = setTimeout(function(){
fn.apply(scope || me, args || arguments);
}, buffer);
};
}();
}
function updateSocial() {
var $socialPanel = $('#id-popover-social-container');
if ($socialPanel.length > 0) {
if ($socialPanel.attr('data-loaded') == 'false') {
typeof FB !== 'undefined' && FB.XFBML && FB.XFBML.parse();
typeof twttr !== 'undefined' && twttr.widgets && twttr.widgets.load();
$socialPanel.attr('data-loaded', 'true');
}
}
}
// Handlers
// -------------------------
@ -114,37 +63,7 @@ var ApplicationController = new(function(){
config = $.extend(config, data.config);
embedConfig = $.extend(embedConfig, data.config.embedded);
$('#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 != ''){
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
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>'); //data-count="none"
$('#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')
$('#id-btn-share').hide();
if (typeof embedConfig.embedUrl === 'undefined')
$('#id-btn-embed').hide();
if (typeof embedConfig.fullscreenUrl === 'undefined')
$('#id-btn-fullscreen').hide();
if (config.canBackToFolder === false || !(config.customization && config.customization.goback && config.customization.goback.url))
$('#id-btn-close').hide();
common.controller.modals.init(embedConfig);
// Docked toolbar
if (embedConfig.toolbarDocked === 'top') {
@ -153,10 +72,14 @@ var ApplicationController = new(function(){
} else {
$('#toolbar').addClass('bottom');
$('#editor_sdk').addClass('bottom');
$('#box-tools').removeClass('dropdown').addClass('dropup');
ttOffset[1] = -40;
}
// Hide last separator
if (!$('#id-btn-fullscreen').is(":visible") && !$('#id-btn-close').is(":visible")) {
if (config.canBackToFolder === false || !(config.customization && config.customization.goback && config.customization.goback.url)) {
$('#id-btn-close').hide();
// Hide last separator
$('#toolbar .right .separator').hide();
$('#pages').css('margin-right', '12px');
}
@ -184,11 +107,9 @@ var ApplicationController = new(function(){
Common.Analytics.trackEvent('Load', 'Start');
}
if (typeof embedConfig.saveUrl === 'undefined' && permissions.print === false)
$('#id-btn-copy').hide();
if (!$('#id-btn-copy').is(":visible") && !$('#id-btn-share').is(":visible") && !$('#id-btn-embed').is(":visible") )
$('#toolbar .left .separator').hide();
embedConfig.docTitle = docConfig.title;
if (!embedConfig.saveUrl && permissions.print === false)
$('#idt-copy').hide();
}
}
@ -202,14 +123,6 @@ var ApplicationController = new(function(){
currentPage = number;
}
function onHyperlinkClick(url) {
if (url) {
var newDocumentPage = window.open(url, '_blank');
if (newDocumentPage)
newDocumentPage.focus();
}
}
function onLongActionBegin(type, id) {
var text = '';
switch (id)
@ -236,12 +149,12 @@ var ApplicationController = new(function(){
me.isHideBodyTip = true;
}
var $ttEl, $tooltip;
function onDocMouseMoveEnd() {
if (me.isHideBodyTip) {
var $tipHyperlink = $('#id-tip-hyperlink');
if ($tipHyperlink.length > 0) {
$tipHyperlink.hide();
if ( $tooltip ) {
$tooltip.tooltip('hide');
$tooltip = false;
}
}
}
@ -251,19 +164,30 @@ var ApplicationController = new(function(){
if (data.get_Type() == 1) { // hyperlink
me.isHideBodyTip = false;
var $tipHyperlink = $('#id-tip-hyperlink'),
hyperProps = data.get_Hyperlink(),
toolTip = (hyperProps.get_ToolTip()) ? hyperProps.get_ToolTip() : hyperProps.get_Value();
if ( !$ttEl ) {
$ttEl = $('.hyperlink-tooltip');
$ttEl.tooltip({'container':'body', 'trigger':'manual'});
$ttEl.on('shown.bs.tooltip', function(e) {
$tooltip = $ttEl.data('bs.tooltip').tip();
if ($tipHyperlink.length > 0) {
$tipHyperlink.find('.popover-content p').html(htmlEncode(toolTip) + '<br><b>Press Ctrl and click link</b>');
$tipHyperlink.show();
$tooltip.css({
left: $ttEl.ttpos[0] + ttOffset[0],
top: $ttEl.ttpos[1] + ttOffset[1]
});
$tooltip.find('.tooltip-arrow').css({left: 10});
});
}
$tipHyperlink.css({
left: data.get_X() - 10,
top : data.get_Y() - 25
})
if ( !$tooltip ) {
$ttEl.ttpos = [data.get_X(), data.get_Y()];
$ttEl.tooltip('show');
} else {
$tooltip.css({
left:data.get_X() + ttOffset[0],
top:data.get_Y() + ttOffset[1]
});
}
}
}
}
@ -273,32 +197,12 @@ var ApplicationController = new(function(){
}
function onPrint() {
if (api && permissions.print!==false)
if (permissions.print!==false)
api.asc_Print($.browser.chrome || $.browser.safari || $.browser.opera);
}
function onPrintUrl(url) {
if (iframePrint) {
iframePrint.parentNode.removeChild(iframePrint);
iframePrint = null;
}
if (!iframePrint) {
iframePrint = document.createElement("iframe");
iframePrint.id = "id-print-frame";
iframePrint.style.display = 'none';
iframePrint.style.visibility = "hidden";
iframePrint.style.position = "fixed";
iframePrint.style.right = "0";
iframePrint.style.bottom = "0";
document.body.appendChild(iframePrint);
iframePrint.onload = function() {
iframePrint.contentWindow.focus();
iframePrint.contentWindow.print();
iframePrint.contentWindow.blur();
window.focus();
};
}
if (url) iframePrint.src = url;
common.utils.dialogPrint(url);
}
function hidePreloader() {
@ -306,19 +210,174 @@ var ApplicationController = new(function(){
}
function onDocumentContentReady() {
setVisiblePopover($('#id-popover-share'), false);
setVisiblePopover($('#id-popover-embed'), false);
$('#id-tip-hyperlink').hide();
api.ShowThumbnails(false);
api.asc_DeleteVerticalScroll();
handlerToolbarSize();
if (api) {
api.ShowThumbnails(false);
api.asc_DeleteVerticalScroll();
if (!embedConfig.autostart || embedConfig.autostart == 'player') {
api.SetDemonstrationModeOnly();
onPlayStart();
}
hidePreloader();
if ( !embedConfig.shareUrl )
$('#idt-share').hide();
if ( !embedConfig.embedUrl )
$('#idt-embed').hide();
if ( !embedConfig.fullscreenUrl )
$('#idt-fullscreen').hide();
common.controller.modals.attach({
share: '#idt-share',
embed: '#idt-embed'
});
api.asc_registerCallback('asc_onMouseMoveStart', onDocMouseMoveStart);
api.asc_registerCallback('asc_onMouseMoveEnd', onDocMouseMoveEnd);
api.asc_registerCallback('asc_onMouseMove', onDocMouseMove);
api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl);
api.asc_registerCallback('asc_onPrint', onPrint);
api.asc_registerCallback('asc_onPrintUrl', onPrintUrl);
api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink);
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
api.asc_registerCallback('asc_onEndAction', onLongActionEnd);
api.asc_registerCallback('asc_onEndDemonstration', onPlayStop);
api.asc_registerCallback('asc_onDemonstrationSlideChanged', onPlaySlideChanged);
Common.Gateway.on('processmouse', onProcessMouse);
Common.Gateway.on('downloadas', onDownloadAs);
ApplicationView.tools.get('#idt-fullscreen')
.on('click', function(){
common.utils.openLink(embedConfig.fullscreenUrl);
});
ApplicationView.tools.get('#idt-download')
.on('click', function(){
if ( !!embedConfig.saveUrl ){
common.utils.openLink(embedConfig.saveUrl);
} else
if (api && permissions.print!==false){
api.asc_Print($.browser.chrome || $.browser.safari || $.browser.opera);
}
Common.Analytics.trackEvent('Save');
});
var $pagenum = $('#page-number');
$pagenum.on({
'keyup': function(e){
if ( e.keyCode == 13 ){
var newPage = parseInt($('#page-number').val());
if ( newPage > maxPages ) newPage = maxPages; else
if ( newPage < 2 || isNaN(newPage) ) newPage = 1;
if ( isplaymode )
api.DemonstrationGoToSlide(newPage-1); else
api.goToPage(newPage-1);
$pagenum.blur();
}
}
, 'focusin' : function(e) {
$pagenum.removeClass('masked');
}
, 'focusout': function(e){
!$pagenum.hasClass('masked') && $pagenum.addClass('masked');
}
});
$('#pages').on('click', function(e) {
$pagenum.focus();
});
$('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback && config.customization.goback.url)
window.parent.location.href = config.customization.goback.url;
});
$('#btn-left').on('click', function(){
if ( isplaymode ) {
api.DemonstrationPrevSlide();
} else
if (currentPage > 0) {
api.goToPage(currentPage - 1);
}
});
$('#btn-right').on('click', function(){
if ( isplaymode ) {
api.DemonstrationNextSlide();
} else
if (currentPage < maxPages - 1) {
api.goToPage(currentPage + 1);
}
});
var documentMoveTimer;
var ismoved = false;
$(document).on({
'click': function(e) {
clearTimeout(documentMoveTimer);
documentMoveTimer = undefined;
},
'mousemove': function (e) {
$('#btn-left').fadeIn();
$('#btn-right').fadeIn();
ismoved = true;
if ( !documentMoveTimer ) {
documentMoveTimer = setInterval(function(){
if ( !ismoved ) {
// $('#btn-left').fadeOut();
// $('#btn-right').fadeOut();
clearInterval(documentMoveTimer);
documentMoveTimer = undefined;
}
ismoved = false;
}, 2000);
}
}
});
var ismodalshown = false;
$(document.body).on('show.bs.modal', '.modal',
function(e) {
ismodalshown = true;
api.asc_enableKeyEvents(false);
}
).on('hidden.bs.modal', '.modal',
function(e) {
ismodalshown = false;
api.asc_enableKeyEvents(true);
}
).on('hidden.bs.dropdown', '.dropdown',
function(e) {
if ( !ismodalshown )
api.asc_enableKeyEvents(true);
}
).on('blur', 'input, textarea',
function(e) {
if ( !ismodalshown ) {
if (!/area_id/.test(e.target.id) ) {
api.asc_enableKeyEvents(true);
}
}
}
);
$('#editor_sdk').on('click', function(e) {
if ( e.target.localName == 'canvas' ) {
e.currentTarget.focus();
}
});
$('#btn-play').on('click', onPlayStart);
Common.Analytics.trackEvent('Load', 'Complete');
}
@ -342,6 +401,37 @@ var ApplicationController = new(function(){
api.zoomFitToPage();
}
function onOpenDocument(progress) {
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
$('#loadmask-text').html('Loading document: ' + Math.min(Math.round(proc * 100), 100) + '%');
}
var isplaymode;
function onPlayStart(e) {
if ( !isplaymode ) {
$('#box-preview').show();
api.StartDemonstration('id-preview', currentPage);
} else {
isplaymode == 'play' ?
api.DemonstrationPause() : api.DemonstrationPlay();
}
isplaymode != 'play' ? ($('#btn-play button').addClass('pause'), isplaymode = 'play') :
($('#btn-play button').removeClass('pause'), isplaymode = 'pause');
}
function onPlayStop() {
isplaymode = undefined;
$('#page-number').val(currentPage + 1);
$('#btn-play button').removeClass('pause');
$('#box-preview').hide();
}
function onPlaySlideChanged(number) {
if ( number++ < maxPages)
$('#page-number').val(number);
}
function showMask() {
$('#id-loadmask').modal({
backdrop: 'static',
@ -353,11 +443,6 @@ var ApplicationController = new(function(){
$('#id-loadmask').modal('hide');
}
function onOpenDocument(progress) {
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());
$('#loadmask-text').html('Loading document: ' + Math.min(Math.round(proc * 100), 100) + '%');
}
function onError(id, level, errData) {
hidePreloader();
@ -442,114 +527,11 @@ var ApplicationController = new(function(){
// Helpers
// -------------------------
var handlerToolbarSize = createBuffered(function(size){
var visibleCaption = function(btn, visible){
if (visible){
$(btn + ' button').addClass('no-caption');
$(btn + ' button span').css('display', 'none');
} else {
$(btn + ' button').removeClass('no-caption');
$(btn + ' button span').css('display', 'inline');
}
};
var isMinimize = $('#toolbar').width() < minToolbarWidth;
visibleCaption('#id-btn-copy', isMinimize);
visibleCaption('#id-btn-share', isMinimize);
visibleCaption('#id-btn-embed', isMinimize);
}, 10);
function onDocumentResize() {
if (api) {
api.Resize();
api.zoomFitToPage();
}
handlerToolbarSize();
}
function isVisiblePopover(popover){
return popover.hasClass('in');
}
function setVisiblePopover(popover, visible, owner){
api && api.asc_enableKeyEvents(!visible);
if (visible){
if (owner){
popover.css('display', 'block');
var popoverData = owner.data('bs.popover'),
$tip = popoverData.tip(),
pos = popoverData.getPosition(false),
actualHeight = $tip[0].offsetHeight,
placement = (embedConfig.toolbarDocked === 'top') ? 'bottom' : 'top',
tp;
$tip.removeClass('fade in top bottom left right');
switch (placement) {
case 'bottom':
tp = {
top : pos.top + pos.height,
left: owner.position().left + (owner.width() - popover.width()) * 0.5
};
break;
default:
case 'top':
tp = {
top : pos.top - actualHeight,
left: owner.position().left + (owner.width() - popover.width()) * 0.5
};
break;
}
$tip
.css(tp)
.addClass(placement)
.addClass('in')
}
if (popover.hasClass('embed')) {
clipEmbedObj.show();
}
if (popover.hasClass('share')) {
clipShortUrl.show();
updateSocial();
}
} else {
popover.removeClass('in');
popover.css('display', 'none');
popover.hasClass('embed') && clipEmbedObj.hide();
popover.hasClass('share') && clipShortUrl.hide();
}
}
function updateEmbedCode(){
var newWidth = parseInt($('#id-input-embed-width').val()),
newHeight = parseInt($('#id-input-embed-height').val());
if (newWidth < minEmbedWidth)
newWidth = minEmbedWidth;
if (newHeight < minEmbedHeight)
newHeight = minEmbedHeight;
$('#id-textarea-embed').text(embedCode.replace('{embed-url}', embedConfig.embedUrl).replace('{width}', newWidth).replace('{height}', newHeight));
$('#id-input-embed-width').val(newWidth + 'px');
$('#id-input-embed-height').val(newHeight + 'px');
}
function openLink(url){
var newDocumentPage = window.open(url);
if (newDocumentPage)
newDocumentPage.focus();
}
function createController(){
@ -559,167 +541,15 @@ var ApplicationController = new(function(){
me = this;
created = true;
var documentMoveTimer;
// Initialize clipboard objects
clipShortUrl.addEventListener('mousedown', function() {
if ($('#id-btn-copy-short').hasClass('copied'))
return;
$('#id-btn-copy-short').button('copied');
$('#id-btn-copy-short').addClass('copied');
clipShortUrl.setText($('#id-short-url').val());
setTimeout(function(){
$('#id-btn-copy-short').button('reset');
$('#id-btn-copy-short').removeClass('copied');
}, 2000);
});
clipEmbedObj.addEventListener('mousedown', function(){
if ($('#id-btn-copy-embed').hasClass('copied'))
return;
$('#id-btn-copy-embed').button('copied');
$('#id-btn-copy-embed').addClass('copied');
clipEmbedObj.setText($('#id-textarea-embed').text());
setTimeout(function(){
$('#id-btn-copy-embed').button('reset');
$('#id-btn-copy-embed').removeClass('copied');
}, 2000);
});
clipShortUrl.glue('id-btn-copy-short');
clipEmbedObj.glue('id-btn-copy-embed');
// popover ui handlers
$('#id-btn-copy').on('click', function(){
var saveUrl = embedConfig.saveUrl;
if (typeof saveUrl !== 'undefined' && saveUrl.length > 0){
openLink(saveUrl);
} else if (api && permissions.print!==false){
api.asc_Print($.browser.chrome || $.browser.safari || $.browser.opera);
}
Common.Analytics.trackEvent('Save');
});
$('#id-btn-share').on('click', function(event){
setVisiblePopover($('#id-popover-share'), !isVisiblePopover($('#id-popover-share')), $('#id-btn-share'));
setVisiblePopover($('#id-popover-embed'), false);
event.preventDefault();
event.stopPropagation();
});
$('#id-btn-embed').on('click', function(event){
setVisiblePopover($('#id-popover-embed'), !isVisiblePopover($('#id-popover-embed')), $('#id-btn-embed'));
setVisiblePopover($('#id-popover-share'), false);
event.preventDefault();
event.stopPropagation();
});
$('#id-input-embed-width').on('keypress', function(e){
if (e.keyCode == 13)
updateEmbedCode();
});
$('#id-input-embed-height').on('keypress', function(e){
if (e.keyCode == 13)
updateEmbedCode();
});
$('#id-input-embed-width').on('focusin', function(e){
api && api.asc_enableKeyEvents(false);
});
$('#id-input-embed-height').on('focusin', function(e){
api && api.asc_enableKeyEvents(false);
});
$('#id-input-embed-width').on('focusout', function(e){
updateEmbedCode();
api && api.asc_enableKeyEvents(true);
});
$('#id-input-embed-height').on('focusout', function(e){
updateEmbedCode();
api && api.asc_enableKeyEvents(true);
});
$('#page-number').on('keypress', function(e){
if (e.keyCode == 13){
var newPage = parseInt($('#page-number').val());
if (newPage > maxPages)
newPage = maxPages;
if (newPage < 2 || isNaN(newPage))
newPage = 1;
if (api)
api.goToPage(newPage-1);
}
});
$('#id-btn-fullscreen').on('click', function(){
openLink(embedConfig.fullscreenUrl);
});
$('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback && config.customization.goback.url)
window.parent.location.href = config.customization.goback.url;
});
$('#id-btn-move-left').on('click', function(){
if (api) {
if (currentPage > 0) {
api.goToPage(currentPage - 1);
}
}
});
$('#id-btn-move-right').on('click', function(){
if (api) {
if (currentPage < maxPages - 1) {
api.goToPage(currentPage + 1);
}
}
});
$(window).resize(function(){
onDocumentResize();
});
$(document).click(function(event){
if (event && event.target && $(event.target).closest('.popover').length > 0)
return;
setVisiblePopover($('#id-popover-share'), false);
setVisiblePopover($('#id-popover-embed'), false);
clearTimeout(documentMoveTimer);
});
$(document).mousemove(function(event){
$('#id-btn-move-left').fadeIn();
$('#id-btn-move-right').fadeIn();
clearTimeout(documentMoveTimer);
documentMoveTimer = setTimeout(function(){
$('#id-btn-move-left').fadeOut();
$('#id-btn-move-right').fadeOut();
}, 2000);
});
api = new Asc.asc_docs_api({
'id-view' : 'editor_sdk'
'id-view' : 'editor_sdk',
'embedded' : true
});
if (api){
@ -729,26 +559,12 @@ var ApplicationController = new(function(){
api.asc_registerCallback('asc_onDocumentContentReady', onDocumentContentReady);
api.asc_registerCallback('asc_onOpenDocumentProgress', onOpenDocument);
api.asc_registerCallback('asc_onCountPages', onCountPages);
// api.asc_registerCallback('OnCurrentVisiblePage', onCurrentPage);
api.asc_registerCallback('asc_onCurrentPage', onCurrentPage);
api.asc_registerCallback('asc_onHyperlinkClick', onHyperlinkClick);
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
api.asc_registerCallback('asc_onEndAction', onLongActionEnd);
api.asc_registerCallback('asc_onMouseMoveStart', onDocMouseMoveStart);
api.asc_registerCallback('asc_onMouseMoveEnd', onDocMouseMoveEnd);
api.asc_registerCallback('asc_onMouseMove', onDocMouseMove);
api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl);
api.asc_registerCallback('asc_onPrint', onPrint);
api.asc_registerCallback('asc_onPrintUrl', onPrintUrl);
// Initialize api gateway
Common.Gateway.on('init', loadConfig);
Common.Gateway.on('opendocument', loadDocument);
Common.Gateway.on('showerror', onExternalError);
Common.Gateway.on('processmouse', onProcessMouse);
Common.Gateway.on('downloadas', onDownloadAs);
Common.Gateway.ready();
}

View file

@ -31,50 +31,31 @@
*
*/
var ApplicationView = new(function(){
var $btnTools;
// Initialize view
function createView(){
$('#id-btn-share').popover({
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>' +
'<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');
$btnTools = $('#box-tools button');
$('#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="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>'
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
$btnTools.parent().append(
'<ul class="dropdown-menu">' +
'<li><a id="idt-download" href="#"><span class="mi-icon svg-icon download"></span>Download</a></li>' +
'<li><a id="idt-share" href="#" data-toggle="modal"><span class="mi-icon svg-icon share"></span>Share</a></li>' +
'<li><a id="idt-embed" href="#" data-toggle="modal"><span class="mi-icon svg-icon embed"></span>Embed</a></li>' +
'<li><a id="idt-fullscreen" href="#"><span class="mi-icon svg-icon fullscr"></span>Full Screen</a></li>' +
'</ul>');
}
}).popover('show');
$('body').popover({
trigger : 'manual',
html : true,
animation : false,
template : '<div class="popover hyperlink" id="id-tip-hyperlink"><div class="popover-inner"><div class="popover-content"><p></p></div></div></div>',
content : '<br><b>Press Ctrl and click link</b>'
}).popover('show');
function getTools(name) {
return $btnTools.parent().find(name);
}
return {
create: createView
, tools: {
get: getTools
}
}
})();

View file

@ -32,9 +32,7 @@
*/
(function ($) {
$(function(){
ApplicationView.create();
ApplicationController.create();
})
ApplicationView.create();
ApplicationController.create();
})(window.jQuery);

View file

@ -2,8 +2,33 @@
@import "../../../../common/embed/resources/less/common.less";
.overlay-controls {
bottom: 15px;
/*bottom: 15px;*/
}
.overlay-icon-move-left { background-position: -64px -120px; }
.overlay-icon-move-right { background-position: -96px -120px; }
.overlay-icon-move-right { background-position: -96px -120px; }
#box-preview {
position:absolute;
left: 0;
top: 0;
display:none;
width:100%;
height:100%;
z-index: 10;
padding: 32px 0 0 0;
}
#id-preview {
width:100%;
height:100%;
position: relative;
}
.svg-icon {
&.play {
&.pause {
background-position: -22px*10 -22px;
}
}
}

View file

@ -262,8 +262,6 @@ define([
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FirstName(this.appOptions.user.firstname);
_user.put_LastName(this.appOptions.user.lastname);
_user.put_FullName(this.appOptions.user.fullname);
docInfo = new Asc.asc_CDocInfo();
@ -612,6 +610,10 @@ define([
/** coauthoring begin **/
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("pe-settings-coauthmode");
if (value===null && Common.localStorage.getItem("pe-settings-autosave")===null &&
me.appOptions.customization && me.appOptions.customization.autosave===false) {
value = 0; // use customization.autosave only when pe-settings-coauthmode and pe-settings-autosave are null
}
me._state.fastCoauth = (value===null || parseInt(value) == 1);
} else
me._state.fastCoauth = false;
@ -654,6 +656,8 @@ define([
if (me.appOptions.isEdit) {
value = Common.localStorage.getItem("pe-settings-autosave");
if (value===null && me.appOptions.customization && me.appOptions.customization.autosave===false)
value = 0;
value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
me.api.asc_setAutoSaveGap(value);
@ -1064,6 +1068,41 @@ define([
// this.getFileMenu().setMode({isDisconnected:true});
},
showTips: function(strings) {
var me = this;
if (!strings.length) return;
if (typeof(strings)!='object') strings = [strings];
// var top_elem = Ext.ComponentQuery.query('petoolbar');
// !top_elem.length && (top_elem = Ext.select('.common-header').first()) || (top_elem = top_elem[0].getEl());
//
function showNextTip() {
var str_tip = strings.shift();
if (str_tip) {
str_tip += '\n' + me.textCloseTip;
tooltip.setTitle(str_tip);
tooltip.show();
}
}
if (!this.tooltip) {
this.tooltip = new Common.UI.Tooltip({
owner: this.getApplication().getController('Toolbar').getView('Toolbar'),
hideonclick: true,
placement: 'bottom',
cls: 'main-info',
offset: 30
});
}
var tooltip = this.tooltip;
tooltip.on('tooltip:hide', function(){
setTimeout(showNextTip, 300);
});
showNextTip();
},
updateWindowTitle: function(force) {
var isModified = this.api.isDocumentModified();
if (this._state.isDocModified !== isModified || force) {
@ -1300,11 +1339,8 @@ define([
},
onFocusObject: function(SelectedObjects) {
if (SelectedObjects.length>0) {
var rightpan = this.getApplication().getController('RightMenu');
// var docPreview = this.getApplication().getController('Viewport').getView('DocumentPreview');
if (rightpan /*&& !docPreview.isVisible()*/) rightpan.onFocusObject.call(rightpan, SelectedObjects);
}
if (rightpan) rightpan.onFocusObject.call(rightpan, SelectedObjects);
},
_onChangeObjectLock: function() {
@ -1748,7 +1784,7 @@ define([
loadingDocumentTextText: 'Loading presentation...',
warnProcessRightsChange: 'You have been denied the right to edit the file.',
errorProcessSaveResult: 'Saving is failed.',
textCloseTip: '\nClick to close the tip.',
textCloseTip: 'Click to close the tip.',
textShape: 'Shape',
errorStockChart: 'Incorrect row order. To build a stock chart place the data on the sheet in the following order:<br> opening price, max price, min price, closing price.',
errorDataRange: 'Incorrect data range.',

View file

@ -114,7 +114,7 @@ define([
this._settings[i].locked = undefined;
}
}
this._settings[Common.Utils.documentSettingsType.Slide].hidden = 0;
this._settings[Common.Utils.documentSettingsType.Slide].hidden = (SelectedObjects.length>0) ? 0 : 1;
for (i=0; i<SelectedObjects.length; i++)
{

View file

@ -133,7 +133,7 @@ define([
Common.component.Analytics.trackEvent('Status Bar', 'Preview');
};
if (!me.statusbar.mode.isDesktopApp) {
if (!me.statusbar.mode.isDesktopApp && !Common.Utils.isIE11) {
Common.NotificationCenter.on('window:resize', onWindowResize);
me.fullScreen(document.documentElement);
} else

View file

@ -771,7 +771,7 @@ define([
me.api.StartDemonstration('presentation-preview', _.isNumber(slidenum) ? slidenum : 0);
Common.component.Analytics.trackEvent('ToolBar', 'Preview');
};
if (!me.toolbar.mode.isDesktopApp) {
if (!me.toolbar.mode.isDesktopApp && !Common.Utils.isIE11) {
Common.NotificationCenter.on('window:resize', onWindowResize);
me.fullScreen(document.documentElement);
} else

View file

@ -1301,7 +1301,7 @@ define([
Common.NotificationCenter.off('window:resize', onWindowResize);
me.api.StartDemonstration('presentation-preview', 0);
};
if (!me.mode.isDesktopApp) {
if (!me.mode.isDesktopApp && !Common.Utils.isIE11) {
Common.NotificationCenter.on('window:resize', onWindowResize);
me.fullScreen(document.documentElement);
} else
@ -1569,7 +1569,7 @@ define([
Common.component.Analytics.trackEvent('DocumentHolder', 'Preview');
};
if (!me.mode.isDesktopApp) {
if (!me.mode.isDesktopApp && !Common.Utils.isIE11) {
Common.NotificationCenter.on('window:resize', onWindowResize);
me.fullScreen(document.documentElement);
} else

View file

@ -176,9 +176,9 @@ define([
return me.txtPageNumInvalid;
}
}).on('keypress:after', function(input, e) {
var box = me.$el.find('#preview-goto-box');
if (e.keyCode === Common.UI.Keys.RETURN) {
var edit = box.find('input[type=text]'), page = parseInt(edit.val());
var box = me.$el.find('#preview-goto-box'),
edit = box.find('input[type=text]'), page = parseInt(edit.val());
if (!page || page-- > me.pages.get('count') || page < 0) {
edit.select();
return false;
@ -190,6 +190,15 @@ define([
me.api.DemonstrationGoToSlide(page);
me.api.asc_enableKeyEvents(true);
return false;
}
}
).on('keyup:after', function(input, e) {
if (e.keyCode === Common.UI.Keys.ESC) {
var box = me.$el.find('#preview-goto-box');
box.focus(); // for IE
box.parent().removeClass('open');
me.api.asc_enableKeyEvents(true);
return false;
}
}
@ -287,7 +296,7 @@ define([
setMode: function(mode) {
this.mode = mode;
if (this.mode.isDesktopApp) {
if (this.mode.isDesktopApp || Common.Utils.isIE11) {
this.btnFullScreen.setVisible(false);
this.separatorFullScreen.hide();
$(document).off("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange");
@ -327,7 +336,7 @@ define([
},
fullScreen: function(element) {
if (this.mode.isDesktopApp) return;
if (this.mode.isDesktopApp || Common.Utils.isIE11) return;
if (element) {
if(element.requestFullscreen) {
element.requestFullscreen();
@ -342,7 +351,7 @@ define([
},
fullScreenCancel: function () {
if (this.mode.isDesktopApp) return;
if (this.mode.isDesktopApp || Common.Utils.isIE11) return;
if(document.cancelFullScreen) {
document.cancelFullScreen();
} else if(document.webkitCancelFullScreen ) {

View file

@ -275,6 +275,9 @@ define([
/** coauthoring begin **/
value = Common.localStorage.getItem("pe-settings-coauthmode");
if (value===null && Common.localStorage.getItem("pe-settings-autosave")===null &&
this.mode.customization && this.mode.customization.autosave===false)
value = 0; // use customization.autosave only when pe-settings-coauthmode and pe-settings-autosave are null
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
@ -288,6 +291,8 @@ define([
this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("pe-settings-autosave");
if (value===null && this.mode.customization && this.mode.customization.autosave===false)
value = 0;
this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("pe-settings-showsnaplines");

View file

@ -132,7 +132,7 @@ define([
}, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
this.btnEditObject.on('click', _.bind(function(btn){
if (this.api) this.api.asc_pluginRun(this._originalProps.asc_getPluginGuid(), 0, this._originalProps.asc_getPluginData());
if (this.api) this.api.asc_startEditCurrentOleObject();
this.fireEvent('editcomplete', this);
}, this));

View file

@ -211,9 +211,9 @@ define([
return me.txtPageNumInvalid;
}
}).on('keypress:after', function(input, e) {
var box = me.$el.find('#status-goto-box');
if (e.keyCode === Common.UI.Keys.RETURN) {
var edit = box.find('input[type=text]'), page = parseInt(edit.val());
var box = me.$el.find('#status-goto-box'),
edit = box.find('input[type=text]'), page = parseInt(edit.val());
if (!page || page-- > me.pages.get('count') || page < 0) {
edit.select();
return false;
@ -225,6 +225,15 @@ define([
me.api.goToPage(page);
me.api.asc_enableKeyEvents(true);
return false;
}
}
).on('keyup:after', function(input, e) {
if (e.keyCode === Common.UI.Keys.ESC) {
var box = me.$el.find('#status-goto-box');
box.focus(); // for IE
box.parent().removeClass('open');
me.api.asc_enableKeyEvents(true);
return false;
}
}

View file

@ -265,7 +265,7 @@
<!-- debug begin -->
<script type="text/javascript">var less=less||{};less.env='development';</script>
<script src="../../../vendor/less/dist/less-1.5.1.js" type="text/javascript"></script>
<script src="../../../vendor/less/dist/less-2.7.1.js" type="text/javascript"></script>
<!-- debug end -->
<script type="text/javascript" src="../sdk_dev_scripts.js"></script>

View file

@ -167,7 +167,7 @@
"PE.Controllers.Main.splitMaxRowsErrorText": "The number of rows must be less than %1.",
"PE.Controllers.Main.textAnonymous": "Anonymous",
"PE.Controllers.Main.textBuyNow": "Visit website",
"PE.Controllers.Main.textCloseTip": "\nClick to close the tip",
"PE.Controllers.Main.textCloseTip": "Click to close the tip",
"PE.Controllers.Main.textContactUs": "Contact sales",
"PE.Controllers.Main.textLoadingDocument": "Loading presentation",
"PE.Controllers.Main.textNoLicenseTitle": "ONLYOFFICE open source version",

View file

@ -143,7 +143,7 @@
"PE.Controllers.Main.splitMaxColsErrorText": "Il numero di colonne deve essere inferiore a %1.",
"PE.Controllers.Main.splitMaxRowsErrorText": "Il numero di righe deve essere inferiore a %1.",
"PE.Controllers.Main.textAnonymous": "Anonimo",
"PE.Controllers.Main.textCloseTip": "\nClicca per chiudere il consiglio",
"PE.Controllers.Main.textCloseTip": "Clicca per chiudere il consiglio",
"PE.Controllers.Main.textLoadingDocument": "Caricamento della presentazione",
"PE.Controllers.Main.textShape": "Forma",
"PE.Controllers.Main.textStrict": "Strict mode",

View file

@ -143,7 +143,7 @@
"PE.Controllers.Main.splitMaxColsErrorText": "O número de colunas deve ser inferior a %1.",
"PE.Controllers.Main.splitMaxRowsErrorText": "O número de linhas deve ser inferior a %1.",
"PE.Controllers.Main.textAnonymous": "Anônimo",
"PE.Controllers.Main.textCloseTip": "\nClique para fechar a dica",
"PE.Controllers.Main.textCloseTip": "Clique para fechar a dica",
"PE.Controllers.Main.textLoadingDocument": "Carregando apresentação",
"PE.Controllers.Main.textShape": "Forma",
"PE.Controllers.Main.textStrict": "Strict mode",

View file

@ -167,7 +167,7 @@
"PE.Controllers.Main.splitMaxRowsErrorText": "Число строк должно быть меньше, чем %1.",
"PE.Controllers.Main.textAnonymous": "Аноним",
"PE.Controllers.Main.textBuyNow": "Перейти на сайт",
"PE.Controllers.Main.textCloseTip": "\nЩелкните, чтобы закрыть эту подсказку",
"PE.Controllers.Main.textCloseTip": "Щелкните, чтобы закрыть эту подсказку",
"PE.Controllers.Main.textContactUs": "Связаться с отделом продаж",
"PE.Controllers.Main.textLoadingDocument": "Загрузка презентации",
"PE.Controllers.Main.textNoLicenseTitle": "Open source версия ONLYOFFICE",

View file

@ -143,7 +143,7 @@
"PE.Controllers.Main.splitMaxColsErrorText": "Število stolpcev mora biti manj kot 1%.",
"PE.Controllers.Main.splitMaxRowsErrorText": "Število vrstic mora biti manj kot %1.",
"PE.Controllers.Main.textAnonymous": "Anonimno",
"PE.Controllers.Main.textCloseTip": "\nPritisni za zapiranje namiga",
"PE.Controllers.Main.textCloseTip": "Pritisni za zapiranje namiga",
"PE.Controllers.Main.textLoadingDocument": "Nalaganje predstavitve",
"PE.Controllers.Main.textShape": "Oblika",
"PE.Controllers.Main.textStrict": "Strict mode",

View file

@ -143,7 +143,7 @@
"PE.Controllers.Main.splitMaxColsErrorText": "Sütun sayısı %1'den az olmalıdır.",
"PE.Controllers.Main.splitMaxRowsErrorText": "Satır sayısı %1'den az olmalıdır.",
"PE.Controllers.Main.textAnonymous": "Anonim",
"PE.Controllers.Main.textCloseTip": "\nUcu kapamak için tıklayın",
"PE.Controllers.Main.textCloseTip": "Ucu kapamak için tıklayın",
"PE.Controllers.Main.textLoadingDocument": "Sunum yükleniyor",
"PE.Controllers.Main.textShape": "Şekil",
"PE.Controllers.Main.textStrict": "Strict mode",

View file

@ -116,14 +116,14 @@
.btn-edit-table {background-position: 0 0;}
button.over .btn-edit-table {background-position: -28px 0;}
.btn-group.open .btn-edit-table,
button.active .btn-edit-table,
button:active .btn-edit-table {background-position: -56px 0;}
button.active:not(.disabled) .btn-edit-table,
button:active:not(.disabled) .btn-edit-table {background-position: -56px 0;}
.btn-change-shape {background-position: 0 -16px;}
button.over .btn-change-shape {background-position: -28px -16px;}
.btn-group.open .btn-change-shape,
button.active .btn-change-shape,
button:active .btn-change-shape {background-position: -56px -16px;}
button.active:not(.disabled) .btn-change-shape,
button:active:not(.disabled) .btn-change-shape {background-position: -56px -16px;}
.combo-pattern-item {
.background-ximage('@{app-image-path}/right-panels/patterns.png', '@{app-image-path}/right-panels/patterns@2x.png', 112px);

View file

@ -65,6 +65,9 @@
white-space: nowrap;
vertical-align: top;
padding-top: 3px;
&.dropup {
position: static;
}
}
.separator {

View file

@ -8,6 +8,7 @@
<meta name="author" content="">
<!-- debug begin -->
<link rel="stylesheet" type="text/css" href="../../../../sdkjs/cell/css/main.css"/>
<link rel="stylesheet/less" type="text/css" href="resources/less/application.less" />
<!-- debug end -->
@ -181,7 +182,7 @@
</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
<![endif]-->
</head>
@ -192,11 +193,6 @@
<script src="../../../vendor/less/dist/less-1.5.1.js" type="text/javascript"></script>
<!-- debug end -->
<!--facebook button-->
<div id="fb-root"></div>
<!--twitter button-->
<script>
var userAgent = navigator.userAgent.toLowerCase(),
check = function(regex){ return regex.test(userAgent); };
@ -269,29 +265,29 @@
</script>
<div class="viewer">
<div id="editor_sdk" class="sdk-view" style="overflow: hidden;"></div>
<div id="editor_sdk" class="sdk-view" style="overflow: hidden;" tabindex="-1"></div>
<ul id="worksheets" class="worksheet-list"></ul>
</div>
<div class="overlay-controls" style="margin-left: -32px">
<ul class="left">
<li id="id-btn-zoom-in"><button class="overlay"><i class="overlay-icon-zoom-in"></i></button></li>
<li id="id-btn-zoom-out"><button class="overlay"><i class="overlay-icon-zoom-out"></i></button></li>
<li id="id-btn-zoom-in"><button class="overlay svg-icon zoom-up"></button></li>
<li id="id-btn-zoom-out"><button class="overlay svg-icon zoom-down"></button></li>
</ul>
</div>
<div class="toolbar" id="toolbar">
<ul class="left">
<li><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></li>
<li class="separator"></li>
<li id="id-btn-copy"><button class="control-btn"><i class="control-icon-save"></i><span>Save Copy</span></button></li>
<li id="id-btn-share"><button class="control-btn"><i class="control-icon-share"></i><span>Share</span></button></li>
<li id="id-btn-embed"><button class="control-btn"><i class="control-icon-embed"></i><span>Embed</span></button></li>
</ul>
<ul class="right">
<li><button id="id-btn-fullscreen" class="control-btn no-caption"><i class="control-icon-fullscreen"></i></button></li>
<li><button id="id-btn-close" class="control-btn no-caption"><i class="control-icon-close"></i></button></li>
</ul>
<div class="group left">
<div id="box-tools" class="dropdown">
<button class="control-btn svg-icon tools"></button>
</div>
</div>
<div class="group center">
<span><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></span>
</div>
<div class="group right">
<div class="item"><button id="id-btn-close" class="control-btn close"><span aria-hidden="true">&times;</span></button></div>
</div>
</div>
<div class="modal fade error" id="id-critical-error-dialog" tabindex="-1" role="dialog">
@ -315,11 +311,12 @@
<div class="cmd-loader-title">Please wait...</div>
</div>
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></div>
<!--vendor-->
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/jquery.browser/dist/jquery.browser.min.js"></script>
<script type="text/javascript" src="../../../vendor/bootstrap/dist/js/bootstrap.js"></script>
<script type="text/javascript" src="../../../vendor/ZeroClipboard/ZeroClipboard.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>
@ -337,6 +334,9 @@
<!--application-->
<script type="text/javascript" src="../../common/Gateway.js"></script>
<script type="text/javascript" src="../../common/Analytics.js"></script>
<script type="text/javascript" src="../../common/embed/lib/util/utils.js"></script>
<script type="text/javascript" src="../../common/embed/lib/view/modals.js"></script>
<script type="text/javascript" src="../../common/embed/lib/controller/modals.js"></script>
<script type="text/javascript" src="js/ApplicationView.js"></script>
<script type="text/javascript" src="js/ApplicationController.js"></script>
<script type="text/javascript" src="js/application.js"></script>

View file

@ -7,6 +7,8 @@
<meta name="description" content="">
<meta name="author" content="">
<link href="../../../apps/spreadsheeteditor/embed/resources/css/app-all.css" rel="stylesheet">
<!-- splash -->
<style type="text/css">
@ -177,17 +179,12 @@
</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
<![endif]-->
</head>
<body class="embed-body">
<!--facebook button-->
<div id="fb-root"></div>
<!--twitter button-->
<script>
var userAgent = navigator.userAgent.toLowerCase(),
check = function(regex){ return regex.test(userAgent); };
@ -260,29 +257,29 @@
</script>
<div class="viewer">
<div id="editor_sdk" class="sdk-view" style="overflow: hidden;"></div>
<div id="editor_sdk" class="sdk-view" style="overflow: hidden;" tabindex="-1"></div>
<ul id="worksheets" class="worksheet-list"></ul>
</div>
<div class="overlay-controls" style="margin-left: -32px">
<ul class="left">
<li id="id-btn-zoom-in"><button class="overlay"><i class="overlay-icon-zoom-in"></i></button></li>
<li id="id-btn-zoom-out"><button class="overlay"><i class="overlay-icon-zoom-out"></i></button></li>
<li id="id-btn-zoom-in"><button class="overlay svg-icon zoom-up"></button></li>
<li id="id-btn-zoom-out"><button class="overlay svg-icon zoom-down"></button></li>
</ul>
</div>
<div class="toolbar" id="toolbar">
<ul class="left">
<li><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></li>
<li class="separator"></li>
<li id="id-btn-copy"><button class="control-btn"><i class="control-icon-save"></i><span>Save Copy</span></button></li>
<li id="id-btn-share"><button class="control-btn"><i class="control-icon-share"></i><span>Share</span></button></li>
<li id="id-btn-embed"><button class="control-btn"><i class="control-icon-embed"></i><span>Embed</span></button></li>
</ul>
<ul class="right">
<li><button id="id-btn-fullscreen" class="control-btn no-caption"><i class="control-icon-fullscreen"></i></button></li>
<li><button id="id-btn-close" class="control-btn no-caption"><i class="control-icon-close"></i></button></li>
</ul>
<div class="group left">
<div id="box-tools" class="dropdown">
<button class="control-btn svg-icon tools"></button>
</div>
</div>
<div class="group center">
<span><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></span>
</div>
<div class="group right">
<div class="item"><button id="id-btn-close" class="control-btn close"><span aria-hidden="true">&times;</span></button></div>
</div>
</div>
<div class="modal fade error" id="id-critical-error-dialog" tabindex="-1" role="dialog">
@ -306,11 +303,12 @@
<div class="cmd-loader-title">Please wait...</div>
</div>
<div class="hyperlink-tooltip" data-toggle="tooltip" title="Press Ctrl and click the link" style="display:none;"></div>
<!--vendor-->
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/jquery.browser.min.js"></script>
<script type="text/javascript" src="../../../vendor/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../../vendor/ZeroClipboard/ZeroClipboard.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>
@ -325,7 +323,6 @@
<script type="text/javascript" src="../../../../sdkjs/cell/sdk-all-min.js"></script>
<!--application-->
<link href="../../../apps/spreadsheeteditor/embed/resources/css/app-all.css" rel="stylesheet">
<script type="text/javascript" src="../../../apps/spreadsheeteditor/embed/app-all.js"></script>
<script type="text/javascript">
var isBrowserSupported = function() {

View file

@ -38,13 +38,11 @@ var ApplicationController = new(function(){
embedConfig = {},
permissions = {},
maxPages = 0,
minToolbarWidth = 550,
minEmbedWidth = 400,
minEmbedHeight = 600,
embedCode = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="{embed-url}" width="{width}" height="{height}"></iframe>',
maxZIndex = 9090,
created = false,
iframePrint = null;
var $ttEl,
$tooltip,
ttOffset = [6, -15];
// Initialize analytics
// -------------------------
@ -61,50 +59,6 @@ var ApplicationController = new(function(){
}
// Initialize ZeroClipboard
// -------------------------
ZeroClipboard.setMoviePath('../../../vendor/ZeroClipboard/ZeroClipboard10.swf');
var clipShortUrl = new ZeroClipboard.Client();
var clipEmbedObj = new ZeroClipboard.Client();
clipShortUrl.zIndex = maxZIndex;
clipEmbedObj.zIndex = maxZIndex;
// Utils
// -------------------------
function emptyFn(){}
function createBuffered(fn, buffer, scope, args) {
return function(){
var timerId;
return function() {
var me = this;
if (timerId) {
clearTimeout(timerId);
timerId = null;
}
timerId = setTimeout(function(){
fn.apply(scope || me, args || arguments);
}, buffer);
};
}();
}
function updateSocial() {
var $socialPanel = $('#id-popover-social-container');
if ($socialPanel.length > 0) {
if ($socialPanel.attr('data-loaded') == 'false') {
typeof FB !== 'undefined' && FB.XFBML && FB.XFBML.parse();
typeof twttr !== 'undefined' && twttr.widgets && twttr.widgets.load();
$socialPanel.attr('data-loaded', 'true');
}
}
}
// Handlers
// -------------------------
@ -112,38 +66,11 @@ var ApplicationController = new(function(){
config = $.extend(config, data.config);
embedConfig = $.extend(embedConfig, data.config.embedded);
$('#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 != ''){
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
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>'); //data-count="none"
$('#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: ' + encodeURIComponent(embedConfig.shareUrl) + '"><span class="glyphicon glyphicon-envelope">Email</a></li>');
}
}
if (typeof embedConfig.shareUrl === 'undefined')
$('#id-btn-share').hide();
if (typeof embedConfig.embedUrl === 'undefined')
$('#id-btn-embed').hide();
if (typeof embedConfig.fullscreenUrl === 'undefined')
$('#id-btn-fullscreen').hide();
common.controller.modals.init(embedConfig);
if (config.canBackToFolder === false || !(config.customization && config.customization.goback && config.customization.goback.url))
$('#id-btn-close').hide();
// Docked toolbar
if (embedConfig.toolbarDocked === 'top') {
$('#toolbar').addClass('top');
@ -151,6 +78,8 @@ var ApplicationController = new(function(){
} else {
$('#toolbar').addClass('bottom');
$('.viewer').addClass('bottom');
$('#box-tools').removeClass('dropdown').addClass('dropup');
ttOffset[1] = -40;
}
}
@ -176,35 +105,26 @@ var ApplicationController = new(function(){
Common.Analytics.trackEvent('Load', 'Start');
}
if (docConfig.title && !embedConfig.docTitle) {
var el = $('#id-popover-social-container ul .share-mail > a');
if (el.length) {
el.attr('href', el.attr('href').replace(/:\sundefined&/, ': ' + docConfig.title + '&'));
}
}
if (typeof embedConfig.saveUrl === 'undefined' && permissions.print === false)
$('#id-btn-copy').hide();
if (!$('#id-btn-copy').is(":visible") && !$('#id-btn-share').is(":visible") && !$('#id-btn-embed').is(":visible") )
$('#toolbar .left .separator').hide();
embedConfig.docTitle = docConfig.title;
if ( !embedConfig.saveUrl && permissions.print === false)
$('#idt-copy').hide();
}
}
function onSheetsChanged(){
if (api){
maxPages = api.asc_getWorksheetsCount();
function setActiveWorkSheet(index) {
var $box = $('#worksheets');
$box.find('> li').removeClass('active');
$box.find('#worksheet' + index).addClass('active');
var setActiveWorkSheet = function(index) {
$.each($('#worksheets').children('li'), function(){
$(this).removeClass('active');
});
$('#worksheet-' + index).addClass('active');
api.asc_showWorksheet(index);
};
api.asc_showWorksheet(index);
}
function onSheetsChanged(){
maxPages = api.asc_getWorksheetsCount();
var handleWorksheet = function(e){
var $worksheet = $(this);
var index = $worksheet.attr('id').match(/\d+/);
var index = $worksheet.attr('id').match(/\d+$/);
if (index.length > 0) {
index = parseInt(index[0]);
@ -214,27 +134,17 @@ var ApplicationController = new(function(){
}
};
$.each($('#worksheets').children('li'), function(){
$(this).unbind('click');
$(this).remove();
});
var $box = $('#worksheets');
$box.find('li').off();
$box.empty();
for (var i = 0; i < maxPages; i++) {
$('#worksheets').append('<li id="worksheet-' + i + '">' + api.asc_getWorksheetName(i).replace(/\s/g,'&nbsp;') + '</li>');
var $worksheet = $('#worksheet-' + i);
$worksheet && $worksheet.bind('click', handleWorksheet)
}
setActiveWorkSheet(api.asc_getActiveWorksheetIndex());
var tpl = '<li id="worksheet{index}">{title}</li>';
for (var i = 0; i < maxPages; i++) {
var item = tpl.replace(/\{index}/, i).replace(/\{title}/,api.asc_getWorksheetName(i).replace(/\s/g,'&nbsp;'));
$(item).appendTo($box).on('click', handleWorksheet);
}
}
function onHyperlinkClick(url) {
if (url) {
var newDocumentPage = window.open(url, '_blank');
if (newDocumentPage)
newDocumentPage.focus();
}
setActiveWorkSheet(api.asc_getActiveWorksheetIndex());
}
function onDownloadUrl(url) {
@ -242,32 +152,12 @@ var ApplicationController = new(function(){
}
function onPrint() {
if (api && permissions.print!==false)
if ( permissions.print!==false )
api.asc_Print(undefined, $.browser.chrome || $.browser.safari || $.browser.opera);
}
function onPrintUrl(url) {
if (iframePrint) {
iframePrint.parentNode.removeChild(iframePrint);
iframePrint = null;
}
if (!iframePrint) {
iframePrint = document.createElement("iframe");
iframePrint.id = "id-print-frame";
iframePrint.style.display = 'none';
iframePrint.style.visibility = "hidden";
iframePrint.style.position = "fixed";
iframePrint.style.right = "0";
iframePrint.style.bottom = "0";
document.body.appendChild(iframePrint);
iframePrint.onload = function() {
iframePrint.contentWindow.focus();
iframePrint.contentWindow.print();
iframePrint.contentWindow.blur();
window.focus();
};
}
if (url) iframePrint.src = url;
common.utils.dialogPrint(url);
}
function hidePreloader() {
@ -275,12 +165,128 @@ var ApplicationController = new(function(){
}
function onDocumentContentReady() {
setVisiblePopover($('#id-popover-share'), false);
setVisiblePopover($('#id-popover-embed'), false);
handlerToolbarSize();
hidePreloader();
if ( !embedConfig.shareUrl )
$('#idt-share').hide();
if ( !embedConfig.embedUrl )
$('#idt-embed').hide();
if ( !embedConfig.fullscreenUrl )
$('#idt-fullscreen').hide();
common.controller.modals.attach({
share: '#idt-share',
embed: '#idt-embed'
});
api.asc_registerCallback('asc_onMouseMove', onApiMouseMove);
api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink);
api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl);
api.asc_registerCallback('asc_onPrint', onPrint);
api.asc_registerCallback('asc_onPrintUrl', onPrintUrl);
Common.Gateway.on('processmouse', onProcessMouse);
Common.Gateway.on('downloadas', onDownloadAs);
ApplicationView.tools.get('#idt-fullscreen')
.on('click', function(){
common.utils.openLink(embedConfig.fullscreenUrl);
});
ApplicationView.tools.get('#idt-download')
.on('click', function(){
if ( !!embedConfig.saveUrl ){
common.utils.openLink(embedConfig.saveUrl);
} else
if (permissions.print!==false){
api.asc_Print(undefined, $.browser.chrome || $.browser.safari || $.browser.opera);
}
Common.Analytics.trackEvent('Save');
});
$('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback && config.customization.goback.url)
window.parent.location.href = config.customization.goback.url;
});
$('#id-btn-zoom-in').on('click', function () {
if (api){
var f = Math.floor(api.asc_getZoom() * 10)/10;
f += .1;
f > 0 && !(f > 2.) && api.asc_setZoom(f);
}
});
$('#id-btn-zoom-out').on('click', function () {
if (api){
var f = Math.ceil(api.asc_getZoom() * 10)/10;
f -= .1;
!(f < .5) && api.asc_setZoom(f);
}
});
var documentMoveTimer;
var ismoved = false;
$(document).mousemove(function(event) {
$('#id-btn-zoom-in').fadeIn();
$('#id-btn-zoom-out').fadeIn();
ismoved = true;
if (!documentMoveTimer) {
documentMoveTimer = setInterval(function () {
if (!ismoved) {
$('#id-btn-zoom-in').fadeOut();
$('#id-btn-zoom-out').fadeOut();
clearInterval(documentMoveTimer);
documentMoveTimer = undefined;
}
ismoved = false;
}, 2000);
}
});
var ismodalshown = false;
$(document.body).on('show.bs.modal', '.modal',
function(e) {
ismodalshown = true;
api.asc_enableKeyEvents(false);
}
).on('hidden.bs.modal', '.modal',
function(e) {
ismodalshown = false;
api.asc_enableKeyEvents(true);
}
).on('hidden.bs.dropdown', '.dropdown',
function(e) {
if ( !ismodalshown )
api.asc_enableKeyEvents(true);
}
).on('blur', 'input, textarea',
function(e) {
if ( !ismodalshown ) {
if (!/area_id/.test(e.target.id) ) {
api.asc_enableKeyEvents(true);
}
}
}
);
$('#editor_sdk').on('click', function(e) {
if ( e.target.localName == 'canvas' ) {
e.currentTarget.focus();
}
});
$(document).on('mousewheel', function (e) {
if ((e.ctrlKey || e.metaKey) && !e.altKey) {
e.preventDefault();
e.stopPropagation();
}
});
Common.Analytics.trackEvent('Load', 'Complete');
}
@ -430,118 +436,58 @@ var ApplicationController = new(function(){
}
function onDownloadAs() {
if (api) api.asc_DownloadAs(Asc.c_oAscFileType.XLSX, true);
api.asc_DownloadAs(Asc.c_oAscFileType.XLSX, true);
}
function onApiMouseMove(array) {
if ( array.length ) {
var ttdata;
for (var i = array.length; i > 0; i--) {
if (array[i-1].asc_getType() == Asc.c_oAscMouseMoveType.Hyperlink) {
ttdata = array[i - 1];
break;
}
}
if ( ttdata ) {
if (!$ttEl) {
$ttEl = $('.hyperlink-tooltip');
$ttEl.tooltip({'container': 'body', 'trigger': 'manual'});
$ttEl.on('shown.bs.tooltip', function(e) {
$tooltip = $ttEl.data('bs.tooltip').tip();
$tooltip.css({
left: $ttEl.ttpos[0] + ttOffset[0],
top: $ttEl.ttpos[1] + ttOffset[1]
});
$tooltip.find('.tooltip-arrow').css({left: 10});
});
}
if (!$tooltip) {
$ttEl.ttpos = [ttdata.asc_getX(), ttdata.asc_getY()];
$ttEl.tooltip('show');
} else {
$tooltip.css({
left: ttdata.asc_getX() + ttOffset[0],
top: ttdata.asc_getY() + ttOffset[1]
});
}
} else {
if ( $tooltip ) {
$tooltip.tooltip('hide');
$tooltip = false;
}
}
}
}
// Helpers
// -------------------------
var handlerToolbarSize = createBuffered(function(size){
var visibleCaption = function(btn, visible){
if (visible){
$(btn + ' button').addClass('no-caption');
$(btn + ' button span').css('display', 'none');
} else {
$(btn + ' button').removeClass('no-caption');
$(btn + ' button span').css('display', 'inline');
}
};
var isMinimize = $('#toolbar').width() < minToolbarWidth;
visibleCaption('#id-btn-copy', isMinimize);
visibleCaption('#id-btn-share', isMinimize);
visibleCaption('#id-btn-embed', isMinimize);
}, 10);
function onDocumentResize() {
if (api)
api.asc_Resize();
handlerToolbarSize();
}
function isVisiblePopover(popover){
return popover.hasClass('in');
}
function setVisiblePopover(popover, visible, owner){
api && api.asc_enableKeyEvents(!visible);
if (visible){
if (owner){
popover.css('display', 'block');
var popoverData = owner.data('bs.popover'),
$tip = popoverData.tip(),
pos = popoverData.getPosition(false),
actualHeight = $tip[0].offsetHeight,
placement = (embedConfig.toolbarDocked === 'top') ? 'bottom' : 'top',
tp;
$tip.removeClass('fade in top bottom left right');
switch (placement) {
case 'bottom':
tp = {
top : pos.top + pos.height,
left: owner.position().left + (owner.width() - popover.width()) * 0.5
};
break;
default:
case 'top':
tp = {
top : pos.top - actualHeight,
left: owner.position().left + (owner.width() - popover.width()) * 0.5
};
break;
}
$tip
.css(tp)
.addClass(placement)
.addClass('in')
}
if (popover.hasClass('embed')) {
clipEmbedObj.show();
}
if (popover.hasClass('share')) {
clipShortUrl.show();
updateSocial();
}
} else {
popover.removeClass('in');
popover.css('display', 'none');
popover.hasClass('embed') && clipEmbedObj.hide();
popover.hasClass('share') && clipShortUrl.hide();
}
}
function updateEmbedCode(){
var newWidth = parseInt($('#id-input-embed-width').val()),
newHeight = parseInt($('#id-input-embed-height').val());
if (newWidth < minEmbedWidth)
newWidth = minEmbedWidth;
if (newHeight < minEmbedHeight)
newHeight = minEmbedHeight;
$('#id-textarea-embed').text(embedCode.replace('{embed-url}', embedConfig.embedUrl).replace('{width}', newWidth).replace('{height}', newHeight));
$('#id-input-embed-width').val(newWidth + 'px');
$('#id-input-embed-height').val(newHeight + 'px');
}
function openLink(url){
var newDocumentPage = window.open(url);
if (newDocumentPage)
newDocumentPage.focus();
if (api) api.asc_Resize();
}
function createController(){
@ -551,149 +497,12 @@ var ApplicationController = new(function(){
me = this;
created = true;
var documentMoveTimer;
// Initialize clipboard objects
clipShortUrl.addEventListener('mousedown', function() {
if ($('#id-btn-copy-short').hasClass('copied'))
return;
$('#id-btn-copy-short').button('copied');
$('#id-btn-copy-short').addClass('copied');
clipShortUrl.setText($('#id-short-url').val());
setTimeout(function(){
$('#id-btn-copy-short').button('reset');
$('#id-btn-copy-short').removeClass('copied');
}, 2000);
});
clipEmbedObj.addEventListener('mousedown', function(){
if ($('#id-btn-copy-embed').hasClass('copied'))
return;
$('#id-btn-copy-embed').button('copied');
$('#id-btn-copy-embed').addClass('copied');
clipEmbedObj.setText($('#id-textarea-embed').text());
setTimeout(function(){
$('#id-btn-copy-embed').button('reset');
$('#id-btn-copy-embed').removeClass('copied');
}, 2000);
});
clipShortUrl.glue('id-btn-copy-short');
clipEmbedObj.glue('id-btn-copy-embed');
// popover ui handlers
$('#id-btn-copy').on('click', function(){
var saveUrl = embedConfig.saveUrl;
if (typeof saveUrl !== 'undefined' && saveUrl.length > 0){
openLink(saveUrl);
} else if (api && permissions.print!==false){
api.asc_Print(undefined, $.browser.chrome || $.browser.safari || $.browser.opera);
}
Common.Analytics.trackEvent('Save');
});
$('#id-btn-share').on('click', function(event){
setVisiblePopover($('#id-popover-share'), !isVisiblePopover($('#id-popover-share')), $('#id-btn-share'));
setVisiblePopover($('#id-popover-embed'), false);
event.preventDefault();
event.stopPropagation();
});
$('#id-btn-embed').on('click', function(event){
setVisiblePopover($('#id-popover-embed'), !isVisiblePopover($('#id-popover-embed')), $('#id-btn-embed'));
setVisiblePopover($('#id-popover-share'), false);
event.preventDefault();
event.stopPropagation();
});
$('#id-input-embed-width').on('keypress', function(e){
if (e.keyCode == 13)
updateEmbedCode();
});
$('#id-input-embed-height').on('keypress', function(e){
if (e.keyCode == 13)
updateEmbedCode();
});
$('#id-input-embed-width').on('focusin', function(e){
api && api.asc_enableKeyEvents(false);
});
$('#id-input-embed-height').on('focusin', function(e){
api && api.asc_enableKeyEvents(false);
});
$('#id-input-embed-width').on('focusout', function(e){
updateEmbedCode();
api && api.asc_enableKeyEvents(true);
});
$('#id-input-embed-height').on('focusout', function(e){
updateEmbedCode();
api && api.asc_enableKeyEvents(true);
});
$('#id-btn-fullscreen').on('click', function(){
openLink(embedConfig.fullscreenUrl);
});
$('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback && config.customization.goback.url)
window.parent.location.href = config.customization.goback.url;
});
$('#id-btn-zoom-in').on('click', function(){
if (api){
var f = Math.floor(api.asc_getZoom() * 10)/10;
f += .1;
f > 0 && !(f > 2.) && api.asc_setZoom(f);
}
});
$('#id-btn-zoom-out').on('click', function(){
if (api){
var f = Math.ceil(api.asc_getZoom() * 10)/10;
f -= .1;
!(f < .5) && api.asc_setZoom(f);
}
});
$(window).resize(function(){
onDocumentResize();
});
$(document).click(function(event){
if (event && event.target && $(event.target).closest('.popover').length > 0)
return;
setVisiblePopover($('#id-popover-share'), false);
setVisiblePopover($('#id-popover-embed'), false);
});
$(document).mousemove(function(event){
$('#id-btn-zoom-in').fadeIn();
$('#id-btn-zoom-out').fadeIn();
clearTimeout(documentMoveTimer);
documentMoveTimer = setTimeout(function(){
$('#id-btn-zoom-in').fadeOut();
$('#id-btn-zoom-out').fadeOut();
}, 2000);
});
api = new Asc.spreadsheet_api({
'id-view': 'editor_sdk'
});
@ -704,17 +513,12 @@ var ApplicationController = new(function(){
api.asc_registerCallback('asc_onError', onError);
api.asc_registerCallback('asc_onOpenDocumentProgress', onOpenDocument);
api.asc_registerCallback('asc_onSheetsChanged', onSheetsChanged);
api.asc_registerCallback('asc_onHyperlinkClick', onHyperlinkClick);
api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl);
api.asc_registerCallback('asc_onPrint', onPrint);
api.asc_registerCallback('asc_onPrintUrl', onPrintUrl);
api.asc_registerCallback('asc_onActiveSheetChanged', setActiveWorkSheet);
// Initialize api gateway
Common.Gateway.on('init', loadConfig);
Common.Gateway.on('opendocument', loadDocument);
Common.Gateway.on('showerror', onExternalError);
Common.Gateway.on('processmouse', onProcessMouse);
Common.Gateway.on('downloadas', onDownloadAs);
Common.Gateway.ready();
}

View file

@ -32,41 +32,31 @@
*/
var ApplicationView = new(function(){
var $btnTools;
// Initialize view
function createView(){
$('#id-btn-share').popover({
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>' +
'<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');
$btnTools = $('#box-tools button');
$('#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="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>'
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
$btnTools.parent().append(
'<ul class="dropdown-menu">' +
'<li><a id="idt-download" href="#"><span class="mi-icon svg-icon download"></span>Download</a></li>' +
'<li><a id="idt-share" href="#" data-toggle="modal"><span class="mi-icon svg-icon share"></span>Share</a></li>' +
'<li><a id="idt-embed" href="#" data-toggle="modal"><span class="mi-icon svg-icon embed"></span>Embed</a></li>' +
'<li><a id="idt-fullscreen" href="#"><span class="mi-icon svg-icon fullscr"></span>Full Screen</a></li>' +
'</ul>');
}
}).popover('show');
function getTools(name) {
return $btnTools.parent().find(name);
}
return {
create: createView
, tools: {
get: getTools
}
}
})();

View file

@ -674,6 +674,7 @@ define([
(new SSE.Views.ChartSettingsDlg(
{
chartSettings: props,
isChart: true,
api: me.api,
handler: function(result, value) {
if (result == 'ok') {
@ -1454,6 +1455,14 @@ define([
}, 10);
} else {
this.documentHolder.entriesMenu.hide();
Common.UI.warning({
title: this.notcriticalErrorTitle,
maxwidth: 600,
msg : this.txtNoChoices,
callback: _.bind(function(btn){
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
}, this)
});
}
},
@ -1546,12 +1555,10 @@ define([
_.delay(function() {
menu.cmpEl.find('li:first a').addClass('focus');
}, 10);
// } else {
// _.delay(function() {
// menu.cmpEl.focus();
// menu.cmpEl.find('li:first a').focus();
// }, 10);
// }
if (!infocus)
_.delay(function() {
menu.cmpEl.focus();
}, 10);
}, 1);
} else {
this.documentHolder.funcMenu.hide();
@ -2282,7 +2289,8 @@ define([
insertColumnRightText : 'Column Right',
deleteText : 'Delete',
deleteRowText : 'Delete Row',
deleteColumnText : 'Delete Column'
deleteColumnText : 'Delete Column',
txtNoChoices: 'There are no choices for filling the cell.<br>Only text values from the column can be selected for replacement.'
}, SSE.Controllers.DocumentHolder || {}));
});

View file

@ -296,8 +296,6 @@ define([
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FirstName(this.appOptions.user.firstname);
_user.put_LastName(this.appOptions.user.lastname);
_user.put_FullName(this.appOptions.user.fullname);
docInfo = new Asc.asc_CDocInfo();
@ -580,6 +578,10 @@ define([
if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("sse-settings-coauthmode");
if (value===null && Common.localStorage.getItem("sse-settings-autosave")===null &&
this.appOptions.customization && this.appOptions.customization.autosave===false) {
value = 0; // use customization.autosave only when sse-settings-coauthmode and sse-settings-autosave are null
}
this._state.fastCoauth = (value===null || parseInt(value) == 1);
} else
this._state.fastCoauth = false;
@ -638,6 +640,8 @@ define([
if (me.appOptions.isEdit) {
if (me.appOptions.canAutosave) {
value = Common.localStorage.getItem("sse-settings-autosave");
if (value===null && me.appOptions.customization && me.appOptions.customization.autosave===false)
value = 0;
value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
} else {
value = 0;
@ -1020,30 +1024,37 @@ define([
case Asc.c_oAscError.ID.FrmlWrongCountParentheses:
config.msg = this.errorWrongBracketsCount;
config.closable = true;
break;
case Asc.c_oAscError.ID.FrmlWrongOperator:
config.msg = this.errorWrongOperator;
config.closable = true;
break;
case Asc.c_oAscError.ID.FrmlWrongMaxArgument:
config.msg = this.errorCountArgExceed;
config.closable = true;
break;
case Asc.c_oAscError.ID.FrmlWrongCountArgument:
config.msg = this.errorCountArg;
config.closable = true;
break;
case Asc.c_oAscError.ID.FrmlWrongFunctionName:
config.msg = this.errorFormulaName;
config.closable = true;
break;
case Asc.c_oAscError.ID.FrmlAnotherParsingError:
config.msg = this.errorFormulaParsing;
config.closable = true;
break;
case Asc.c_oAscError.ID.FrmlWrongArgumentRange:
config.msg = this.errorArgsRange;
config.closable = true;
break;
case Asc.c_oAscError.ID.UnexpectedGuid:
@ -1226,7 +1237,7 @@ define([
function showNextTip() {
var str_tip = strings.shift();
if (str_tip) {
str_tip += me.textCloseTip;
str_tip += '\n' + me.textCloseTip;
tooltip.setTitle(str_tip);
tooltip.show();
}
@ -1419,7 +1430,6 @@ define([
var me = this;
if (id == Asc.c_oAscConfirm.ConfirmReplaceRange) {
Common.UI.warning({
closable: false,
title: this.notcriticalErrorTitle,
msg: this.confirmMoveCellRange,
buttons: ['yes', 'no'],
@ -1980,7 +1990,7 @@ define([
errorAutoFilterChangeFormatTable: 'The operation could not be done for the selected cells as you cannot move a part of the table.<br>Select another data range so that the whole table was shifted and try again.',
errorAutoFilterHiddenRange: 'The operation cannot be performed because the area contains filtered cells.<br>Please unhide the filtered elements and try again.',
errorAutoFilterChange: 'The operation is not allowed, as it is attempting to shift cells in a table on your worksheet.',
textCloseTip: '\nClick to close the tip.',
textCloseTip: 'Click to close the tip.',
textShape: 'Shape',
errorFillRange: 'Could not fill the selected range of cells.<br>All the merged cells need to be the same size.',
errorUpdateVersion: 'The file version has been changed. The page will be reloaded.',

View file

@ -108,21 +108,22 @@ define([
var SelectedObjects = [],
selectType = info.asc_getFlags().asc_getSelectionType(),
formatTableInfo = info.asc_getFormatTableInfo();
formatTableInfo = info.asc_getFormatTableInfo(),
sparkLineInfo = info.asc_getSparklineInfo();
if (selectType == Asc.c_oAscSelectionType.RangeImage || selectType == Asc.c_oAscSelectionType.RangeShape ||
selectType == Asc.c_oAscSelectionType.RangeChart || selectType == Asc.c_oAscSelectionType.RangeChartText || selectType == Asc.c_oAscSelectionType.RangeShapeText) {
SelectedObjects = this.api.asc_getGraphicObjectProps();
}
if (SelectedObjects.length<=0 && !formatTableInfo && !this.rightmenu.minimizedMode) {
if (SelectedObjects.length<=0 && !formatTableInfo && !sparkLineInfo && !this.rightmenu.minimizedMode) {
this.rightmenu.clearSelection();
this._openRightMenu = true;
}
var need_disable = info.asc_getLocked();
this.onFocusObject(SelectedObjects, formatTableInfo, need_disable);
this.onFocusObject(SelectedObjects, formatTableInfo, sparkLineInfo, need_disable);
if (this._state.prevDisabled != need_disable) {
this._state.prevDisabled = need_disable;
@ -132,7 +133,7 @@ define([
}
},
onFocusObject: function(SelectedObjects, formatTableInfo, isCellLocked) {
onFocusObject: function(SelectedObjects, formatTableInfo, sparkLineInfo, isCellLocked) {
if (!this.editMode)
return;
@ -176,7 +177,14 @@ define([
this._settings[settingsType].locked = isCellLocked;
this._settings[settingsType].hidden = 0;
}
if (sparkLineInfo) {
settingsType = Common.Utils.documentSettingsType.Chart;
this._settings[settingsType].props = sparkLineInfo;
this._settings[settingsType].locked = isCellLocked;
this._settings[settingsType].hidden = 0;
}
var lastactive = -1, currentactive, priorityactive = -1,
activePane = this.rightmenu.GetActivePane();
for (i=0; i<this._settings.length; ++i) {
@ -246,6 +254,7 @@ define([
UpdateThemeColors: function() {
this.rightmenu.shapeSettings.UpdateThemeColors();
this.rightmenu.textartSettings.UpdateThemeColors();
this.rightmenu.chartSettings.UpdateThemeColors();
},
updateMetricUnit: function() {

View file

@ -206,6 +206,8 @@ define([
toolbar.btnInsertImage.menu.on('item:click', _.bind(this.onInsertImageMenu, this));
toolbar.btnInsertHyperlink.on('click', _.bind(this.onHyperlink, this));
toolbar.btnInsertChart.on('click', _.bind(this.onInsertChart, this));
// if (toolbar.mnuInsertChartPicker) toolbar.mnuInsertChartPicker.on('item:click', _.bind(this.onSelectChart, this));
// if (toolbar.mnuInsertSparkPicker) toolbar.mnuInsertSparkPicker.on('item:click', _.bind(this.onSelectSpark, this));
toolbar.btnEditChart.on('click', _.bind(this.onInsertChart, this));
toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this));
toolbar.btnInsertText.menu.on('item:click', _.bind(this.onInsertTextClick, this));
@ -754,6 +756,7 @@ define([
(new SSE.Views.ChartSettingsDlg(
{
chartSettings: props,
isChart: true,
api: me.api,
handler: function(result, value) {
if (result == 'ok') {
@ -769,6 +772,47 @@ define([
}
},
onSelectChart: function(picker, item, record, e) {
if (!this.editMode) return;
var me = this, info = me.api.asc_getCellInfo();
if (info.asc_getFlags().asc_getSelectionType()!=Asc.c_oAscSelectionType.RangeImage) {
var win, props;
if (me.api){
var ischartedit = ( info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeChart || info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeChartText);
if (ischartedit) {
} else {
props = me.api.asc_getChartObject();
if (props) {
props.putType(record.get('type'));
me.api.asc_addChartDrawingObject(props);
}
}
}
}
if (e.type !== 'click')
me.toolbar.btnInsertChart.menu.hide();
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
onSelectSpark: function(picker, item, record, e) {
if (!this.editMode) return;
var me = this, info = me.api.asc_getCellInfo(), type = info.asc_getFlags().asc_getSelectionType();
if (type==Asc.c_oAscSelectionType.RangeCells || type==Asc.c_oAscSelectionType.RangeCol ||
type==Asc.c_oAscSelectionType.RangeRow || type==Asc.c_oAscSelectionType.RangeMax) {
var props;
if (me.api){
props = me.api.asc_getChartObject();
if (props) {
props.putType(record.get('type'));
me.api.asc_addChartDrawingObject(props);
}
}
}
if (e.type !== 'click')
me.toolbar.btnInsertChart.menu.hide();
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
onBtnInsertTextClick: function(btn, e) {
if (this.api)
this._addAutoshape(btn.pressed, 'textRect');
@ -1137,6 +1181,7 @@ define([
case 'formula': params.formula = item.checked; option = 'sse-hidden-formula'; break;
case 'headings': params.headings = item.checked; break;
case 'gridlines': params.gridlines = item.checked; break;
case 'freezepanes': params.freezepanes = item.checked; break;
}
this.hideElements(params);
@ -1473,6 +1518,7 @@ define([
var params = this.api.asc_getSheetViewSettings();
this.toolbar.mnuitemHideHeadings.setChecked(!params.asc_getShowRowColHeaders());
this.toolbar.mnuitemHideGridlines.setChecked(!params.asc_getShowGridLines());
this.toolbar.mnuitemFreezePanes.setChecked(params.asc_getIsFreezePane());
}
},
@ -1578,6 +1624,8 @@ define([
this._state.fontsize = str_size;
}
toolbar.lockToolbar(SSE.enumLock.cantHyperlink, (selectionType == Asc.c_oAscSelectionType.RangeShapeText) && (this.api.asc_canAddShapeHyperlink()===false), { array: [toolbar.btnInsertHyperlink]});
if (editOptionsDisabled) return;
/* read font params */
@ -1967,6 +2015,12 @@ define([
}
}
if (!_.isUndefined(opts.freezepanes)) {
if (this.api) {
this.api.asc_freezePane();
}
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},

View file

@ -1,4 +1,4 @@
<table cols="3">
<table cols="3" id="chart-panel-size">
<tr>
<td colspan=3>
<label class="header"><%= scope.textSize %></label>
@ -18,7 +18,7 @@
</td>
</tr>
</table>
<table cols="1">
<table cols="1" id="chart-panel-types">
<tr>
<td class="padding-small">
<div class="separator horizontal"></div>
@ -47,6 +47,84 @@
<button type="button" class="btn btn-text-default" id="chart-btn-select-data" style="min-width: 100px; width: auto; display: block;"><%= scope.textSelectData %></button>
</td>
</tr>
</table>
<table cols="1" id="spark-panel-types">
<tr>
<td>
<label class="header"><%= scope.textType %></label>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="spark-button-type" style=""></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td>
<label class="header"><%= scope.textStyle %></label>
</td>
</tr>
<tr>
<td class="padding-small">
<label class="input-label" style=""><%= scope.strTemplate %></label>
<div class="" id="spark-combo-style" style="width: 100%;"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div style="display:inline-block;vertical-align: middle;width:55px;">
<label class="input-label" style=""><%= scope.strSparkColor %></label>
<div id="spark-color-btn" style=""></div>
</div>
<div style="display:inline-block;vertical-align: middle;">
<label class="input-label" style=""><%= scope.strLineWeight %></label>
<div id="spark-combo-line-type" style="width: 93px;"></div>
</div>
</td>
</tr>
<tr>
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
</table>
<table cols="1" id="spark-panel-points">
<tr>
<td class="padding-small">
<label class="header" style="margin-bottom: 4px;"><%= scope.textShow %></label>
<div style="width: 100%; height: 25px; margin-bottom: 8px;">
<div id="spark-checkbox-high" style="display: inline-block;margin-top: 4px;"></div>
<div id="spark-high-color-btn" style="display: inline-block; float:right;"></div>
</div>
<div style="width: 100%; height: 25px; margin-bottom: 8px;">
<div id="spark-checkbox-low" style="display: inline-block;margin-top: 4px;"></div>
<div id="spark-low-color-btn" style="display: inline-block; float:right;"></div>
</div>
<div style="width: 100%; height: 25px; margin-bottom: 8px;">
<div id="spark-checkbox-negative" style="display: inline-block;margin-top: 4px;"></div>
<div id="spark-negative-color-btn" style="display: inline-block; float:right;"></div>
</div>
<div style="width: 100%; height: 25px; margin-bottom: 8px;">
<div id="spark-checkbox-first" style="display: inline-block;margin-top: 4px;"></div>
<div id="spark-first-color-btn" style="display: inline-block; float:right;"></div>
</div>
<div style="width: 100%; height: 25px; margin-bottom: 8px;">
<div id="spark-checkbox-last" style="display: inline-block;margin-top: 4px;"></div>
<div id="spark-last-color-btn" style="display: inline-block; float:right;"></div>
</div>
<div style="width: 100%; height: 25px;">
<div id="spark-checkbox-markers" style="display: inline-block;margin-top: 4px;"></div>
<div id="spark-markers-color-btn" style="display: inline-block; float:right;"></div>
</div>
</td>
</tr>
</table>
<table cols="1">
<tr>
<td class="padding-small">
<div class="separator horizontal"></div>

View file

@ -312,4 +312,113 @@
</tr>
</table>
</div>
</div>
<div id="id-spark-settings-dlg-style" class="settings-panel">
<div class="inner-content padding-large">
<table cols="2" style="">
<tr>
<td class="padding-large">
<label class="header"><%= scope.textType %></label>
<div id="spark-dlg-button-type" style="margin-right: 15px;"></div>
</td>
<td class="padding-large">
<label class="header"><%= scope.textStyle %></label>
<div id="spark-dlg-combo-style" style="width: 190px;"></div>
</td>
</tr>
</table>
</div>
<div class="inner-content">
<!--<div class="padding-large" >-->
<!--<label class="header padding-small" style="display: block;"><%= scope.textSparkRanges %></label>-->
<!--<div id="spark-dlg-radio-group" class="padding-small" style="display: block;"></div>-->
<!--<div id="spark-dlg-radio-single" style="display: block;"></div>-->
<!--</div>-->
<table cols="2" style="width: 100%;">
<!--<tr>-->
<!--<td colspan=2 >-->
<!--<label class="header"><%= scope.textDataRange %></label>-->
<!--</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="padding-small" width="200">-->
<!--<div id="spark-dlg-txt-range" class="input-row" style="margin-right: 10px;"></div>-->
<!--</td>-->
<!--<td class="padding-small" style="text-align: right;">-->
<!--<button type="button" class="btn btn-text-default" id="spark-dlg-btn-data" style="min-width: 100px;"><%= scope.textSelectData %></button>-->
<!--</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td colspan=2 >-->
<!--<label class="header"><%= scope.textLocationRange %></label>-->
<!--</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="padding-large" width="200">-->
<!--<div id="spark-dlg-txt-location" class="input-row" style="margin-right: 10px;"></div>-->
<!--</td>-->
<!--<td class="padding-large" style="text-align: right;">-->
<!--<button type="button" class="btn btn-text-default" id="spark-dlg-btn-location-data" style="min-width: 100px;"><%= scope.textSelectData %></button>-->
<!--</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td colspan=2 class="padding-large"></td>-->
<!--</tr>-->
<tr>
<td colspan=2 class="padding-small">
<label class="header"><%= scope.textEmptyCells %></label>
</td>
</tr>
<tr>
<td class="padding-small" width="200">
<label class="input-label"><%= scope.textShowEmptyCells %></label>
<div id="spark-dlg-combo-empty" class="input-group-nr" style="margin-right: 10px;"></div>
</td>
<td></td>
</tr>
<tr>
<td colspan=2>
<div id="spark-dlg-check-show-data"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="id-spark-settings-dlg-axis" class="settings-panel">
<div class="inner-content">
<div class="padding-large" >
<label class="header padding-small" style="display: block;"><%= scope.textHorAxis %></label>
<div id="spark-dlg-check-show" class="padding-small" style="display: block;"></div>
<div id="spark-dlg-check-reverse" class="padding-small" style="display: block;"></div>
</div>
<table cols="3" style="width: 100%">
<tr>
<td colspan="3">
<label class="header padding-small"><%= scope.textVertAxis %></label>
</td>
</tr>
<tr>
<td class="padding-small" width="100">
<label class="input-label"><%= scope.textMinValue %></label>
</td>
<td class="padding-small" width="115" style="padding-right: 10px;">
<div id="spark-dlg-combo-mintype"></div>
</td>
<td class="padding-small" width="90">
<div id="spark-dlg-input-min-value"></div>
</td>
</tr>
<tr>
<td class="padding-large" width="100">
<label class="input-label"><%= scope.textMaxValue %></label>
</td>
<td class="padding-large" width="115" style="padding-right: 10px;">
<div id="spark-dlg-combo-maxtype"></div>
</td>
<td class="padding-large" width="90">
<div id="spark-dlg-input-max-value"></div>
</td>
</tr>
</table>
</div>
</div>

File diff suppressed because it is too large Load diff

View file

@ -61,7 +61,9 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{panelId: 'id-chart-settings-dlg-style', panelCaption: this.textTypeData},
{panelId: 'id-chart-settings-dlg-layout', panelCaption: this.textLayout},
{panelId: 'id-chart-settings-dlg-vert', panelCaption: this.textVertAxis},
{panelId: 'id-chart-settings-dlg-hor', panelCaption: this.textHorAxis}
{panelId: 'id-chart-settings-dlg-hor', panelCaption: this.textHorAxis},
{panelId: 'id-spark-settings-dlg-style', panelCaption: this.textTypeData},
{panelId: 'id-spark-settings-dlg-axis', panelCaption: this.textAxisOptions}
],
contentTemplate: _.template(contentTemplate)({
scope: this
@ -79,17 +81,21 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
this._state = {
ChartType: Asc.c_oAscChartTypeSettings.barNormal
ChartType: Asc.c_oAscChartTypeSettings.barNormal,
SparkType: -1
};
this._noApply = true;
this._changedProps = null;
this.api = this.options.api;
this.chartSettings = this.options.chartSettings;
this.isChart = this.options.isChart;
this.vertAxisProps = null;
this.horAxisProps = null;
this.currentAxisProps = null;
this.dataRangeValid = '';
this.currentChartType = this._state.ChartType;
this.storageName = (this.isChart) ? 'sse-chart-settings-adv-category' : 'sse-spark-settings-adv-category';
},
render: function() {
@ -770,12 +776,233 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.btnsCategory[2].on('click', _.bind(this.onVCategoryClick, this));
this.btnsCategory[3].on('click', _.bind(this.onHCategoryClick, this));
// Sparklines
this.btnSparkType = new Common.UI.Button({
cls : 'btn-large-dataview',
iconCls : 'item-chartlist spark-column',
menu : new Common.UI.Menu({
style: 'width: 210px;',
additionalAlign: menuAddAlign,
items: [
{ template: _.template('<div id="id-spark-dlg-menu-type" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>') }
]
})
});
this.btnSparkType.on('render:after', function(btn) {
me.mnuSparkTypePicker = new Common.UI.DataView({
el: $('#id-spark-dlg-menu-type'),
parentMenu: btn.menu,
restoreHeight: 200,
groups: new Common.UI.DataViewGroupStore([
{ id: 'menu-chart-group-sparkcolumn', caption: me.textColumnSpark },
{ id: 'menu-chart-group-sparkline', caption: me.textLineSpark },
{ id: 'menu-chart-group-sparkwin', caption: me.textWinLossSpark }
]),
store: new Common.UI.DataViewStore([
{ group: 'menu-chart-group-sparkcolumn', type: Asc.c_oAscSparklineType.Column, allowSelected: true, iconCls: 'spark-column'},
{ group: 'menu-chart-group-sparkline', type: Asc.c_oAscSparklineType.Line, allowSelected: true, iconCls: 'spark-line'},
{ group: 'menu-chart-group-sparkwin', type: Asc.c_oAscSparklineType.Stacked, allowSelected: true, iconCls: 'spark-win'}
]),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')
});
});
this.btnSparkType.render($('#spark-dlg-button-type'));
this.mnuSparkTypePicker.on('item:click', _.bind(this.onSelectSparkType, this, this.btnSparkType));
this.cmbSparkStyle = new Common.UI.ComboDataView({
itemWidth: 50,
itemHeight: 50,
menuMaxHeight: 272,
enableKeyEvents: true,
cls: 'combo-spark-style'
});
this.cmbSparkStyle.render($('#spark-dlg-combo-style'));
this.cmbSparkStyle.openButton.menu.cmpEl.css({
'min-width': 178,
'max-width': 178
});
this.cmbSparkStyle.on('click', _.bind(this.onSelectSparkStyle, this));
this.cmbSparkStyle.openButton.menu.on('show:after', function () {
me.cmbSparkStyle.menuPicker.scroller.update({alwaysVisibleY: true});
});
/*
this.radioGroup = new Common.UI.RadioBox({
el: $('#spark-dlg-radio-group'),
labelText: this.textGroup,
name: 'asc-radio-sparkline',
checked: true
});
this.radioSingle = new Common.UI.RadioBox({
el: $('#spark-dlg-radio-single'),
labelText: this.textSingle,
name: 'asc-radio-sparkline'
});
this.txtSparkDataRange = new Common.UI.InputField({
el : $('#spark-dlg-txt-range'),
name : 'range',
style : 'width: 100%;',
allowBlank : true,
blankError : this.txtEmpty,
validateOnChange: true
});
this.btnSelectSparkData = new Common.UI.Button({
el: $('#spark-dlg-btn-data')
});
// this.btnSelectSparkData.on('click', _.bind(this.onSelectData, this));
this.txtSparkDataLocation = new Common.UI.InputField({
el : $('#spark-dlg-txt-location'),
name : 'range',
style : 'width: 100%;',
allowBlank : true,
blankError : this.txtEmpty,
validateOnChange: true
});
this.btnSelectLocationData = new Common.UI.Button({
el: $('#spark-dlg-btn-data')
});
// this.btnSelectLocationData.on('click', _.bind(this.onSelectData, this));
*/
this._arrEmptyCells = [
{ value: Asc.c_oAscEDispBlanksAs.Gap, displayValue: this.textGaps },
{ value: Asc.c_oAscEDispBlanksAs.Zero, displayValue: this.textZero },
{ value: Asc.c_oAscEDispBlanksAs.Span, displayValue: this.textEmptyLine }
];
this.cmbEmptyCells = new Common.UI.ComboBox({
el : $('#spark-dlg-combo-empty'),
menuStyle : 'min-width: 188px;',
editable : false,
cls : 'input-group-nr'
});
this.cmbEmptyCells.on('selected', _.bind(function(combo, record){
if (this._changedProps) {
this._changedProps.asc_setDisplayEmpty(record.value);
}
}, this));
this.chShowEmpty = new Common.UI.CheckBox({
el: $('#spark-dlg-check-show-data'),
labelText: this.textShowData
});
this.chShowEmpty.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
this._changedProps.asc_setDisplayHidden(field.getValue()=='checked');
}
}, this));
// Sparkline axis
this.chShowAxis = new Common.UI.CheckBox({
el: $('#spark-dlg-check-show'),
labelText: this.textShowSparkAxis
});
this.chShowAxis.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
this._changedProps.asc_setDisplayXAxis(field.getValue()=='checked');
}
}, this));
this.chReverse = new Common.UI.CheckBox({
el: $('#spark-dlg-check-reverse'),
labelText: this.textReverseOrder
});
this.chReverse.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
this._changedProps.asc_setRightToLeft(field.getValue()=='checked');
}
}, this));
this.cmbSparkMinType = new Common.UI.ComboBox({
el : $('#spark-dlg-combo-mintype'),
cls : 'input-group-nr',
menuStyle : 'min-width: 100px;',
editable : false,
data : [
{displayValue: this.textAutoEach, value: Asc.c_oAscSparklineAxisMinMax.Individual},
{displayValue: this.textSameAll, value: Asc.c_oAscSparklineAxisMinMax.Group},
{displayValue: this.textFixed, value: Asc.c_oAscSparklineAxisMinMax.Custom}
]
}).on('selected', _.bind(function(combo, record) {
this.spnSparkMinValue.setDisabled(record.value!==Asc.c_oAscSparklineAxisMinMax.Custom);
if (this._changedProps) {
this._changedProps.asc_setMinAxisType(record.value);
}
if (record.value==Asc.c_oAscSparklineAxisMinMax.Custom && _.isEmpty(this.spnSparkMinValue.getValue()))
this.spnSparkMinValue.setValue(0);
}, this));
this.spnSparkMinValue = new Common.UI.MetricSpinner({
el : $('#spark-dlg-input-min-value'),
maxValue : 1000000,
minValue : -1000000,
step : 0.1,
defaultUnit : "",
defaultValue : 0,
value : ''
}).on('change', _.bind(function(field, newValue, oldValue) {
if (this._changedProps) {
this._changedProps.asc_setManualMin(field.getNumberValue());
}
}, this));
this.cmbSparkMaxType = new Common.UI.ComboBox({
el : $('#spark-dlg-combo-maxtype'),
cls : 'input-group-nr',
menuStyle : 'min-width: 100px;',
editable : false,
data : [
{displayValue: this.textAutoEach, value: Asc.c_oAscSparklineAxisMinMax.Individual},
{displayValue: this.textSameAll, value: Asc.c_oAscSparklineAxisMinMax.Group},
{displayValue: this.textFixed, value: Asc.c_oAscSparklineAxisMinMax.Custom}
]
}).on('selected', _.bind(function(combo, record) {
this.spnSparkMaxValue.setDisabled(record.value!==Asc.c_oAscSparklineAxisMinMax.Custom);
if (this._changedProps) {
this._changedProps.asc_setMaxAxisType(record.value);
}
if (record.value==Asc.c_oAscSparklineAxisMinMax.Custom && _.isEmpty(this.spnSparkMaxValue.getValue()))
this.spnSparkMaxValue.setValue(0);
}, this));
this.spnSparkMaxValue = new Common.UI.MetricSpinner({
el : $('#spark-dlg-input-max-value'),
maxValue : 1000000,
minValue : -1000000,
step : 0.1,
defaultUnit : "",
defaultValue : 0,
value : ''
}).on('change', _.bind(function(field, newValue, oldValue) {
if (this._changedProps) {
this._changedProps.asc_setManualMax(field.getNumberValue());
}
}, this));
this.afterRender();
},
afterRender: function() {
this._setDefaults(this.chartSettings);
this.setTitle((this.isChart) ? this.textTitle : this.textTitleSparkline);
if (this.isChart) {
this.btnsCategory[4].setVisible(false);
this.btnsCategory[5].setVisible(false);
} else {
this.btnsCategory[0].setVisible(false);
this.btnsCategory[1].setVisible(false);
this.btnsCategory[2].setVisible(false);
this.btnsCategory[3].setVisible(false);
}
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
@ -985,64 +1212,170 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.currentAxisProps = props;
},
updateSparkStyles: function(styles) {
if (styles && styles.length>1){
var picker = this.cmbSparkStyle.menuPicker,
stylesStore = picker.store;
if (stylesStore.length == styles.length-1) {
var data = stylesStore.models;
for (var i=0; i<styles.length-1; i++) {
data[i].set('imageUrl', styles[i]);
}
} else {
var stylearray = [],
selectedIdx = styles[styles.length-1];
for (var i=0; i<styles.length-1; i++) {
stylearray.push({
imageUrl: styles[i],
data : i
});
}
stylesStore.reset(stylearray, {silent: false});
this.cmbSparkStyle.fillComboView(stylesStore.at(selectedIdx<0 ? 0 : selectedIdx), selectedIdx>-1);
}
}
},
onSelectSparkType: function(btn, picker, itemView, record) {
if (this._noApply) return;
var rawData = {},
isPickerSelect = _.isFunction(record.toJSON);
if (isPickerSelect){
if (record.get('selected')) {
rawData = record.toJSON();
} else {
// record deselected
return;
}
} else {
rawData = record;
}
this.btnSparkType.setIconCls('item-chartlist ' + rawData.iconCls);
if (this._changedProps) {
this._changedProps.asc_setType(rawData.type);
}
this.chartSettings.asc_setType(rawData.type);
this._state.SparkType = rawData.type;
var changed = false,
value = this.cmbEmptyCells.getValue();
if (rawData.type !== Asc.c_oAscSparklineType.Line && this._arrEmptyCells.length>2) {
if (value == Asc.c_oAscEDispBlanksAs.Span)
value = Asc.c_oAscEDispBlanksAs.Gap;
this._arrEmptyCells.pop();
changed = true;
} else if (rawData.type == Asc.c_oAscSparklineType.Line && this._arrEmptyCells.length<3) {
this._arrEmptyCells.push({ value: Asc.c_oAscEDispBlanksAs.Span, displayValue: this.textEmptyLine });
changed = true;
}
if (changed) {
this.cmbEmptyCells.setData(this._arrEmptyCells);
this.cmbEmptyCells.setValue(value);
if (this._changedProps)
this._changedProps.asc_setDisplayEmpty(value);
}
this.updateSparkStyles(this.chartSettings.asc_getStyles());
},
onSelectSparkStyle: function(combo, record) {
if (this._noApply) return;
if (this._changedProps) {
this._changedProps.asc_setStyle(record.get('data'));
}
},
_setDefaults: function(props) {
var me = this;
if (props ){
this.chartSettings = props;
if (this.isChart) {
this._state.ChartType = props.getType();
this._state.ChartType = props.getType();
this._noApply = true;
this._noApply = true;
// Layout
// Layout
var record = this.mnuChartTypePicker.store.findWhere({type: this._state.ChartType});
this.mnuChartTypePicker.selectRecord(record, true);
if (record) {
this.btnChartType.setIconCls('item-chartlist ' + record.get('iconCls'));
}
this._noApply = false;
var value = props.getRange();
this.txtDataRange.setValue((value) ? value : '');
this.dataRangeValid = value;
this.txtDataRange.validation = function(value) {
if (_.isEmpty(value)) {
if (!me.cmbDataDirect.isDisabled()) me.cmbDataDirect.setDisabled(true);
return true;
var record = this.mnuChartTypePicker.store.findWhere({type: this._state.ChartType});
this.mnuChartTypePicker.selectRecord(record, true);
if (record) {
this.btnChartType.setIconCls('item-chartlist ' + record.get('iconCls'));
}
if (me.cmbDataDirect.isDisabled()) me.cmbDataDirect.setDisabled(false);
this._noApply = false;
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
};
var value = props.getRange();
this.txtDataRange.setValue((value) ? value : '');
this.dataRangeValid = value;
this.cmbDataDirect.setDisabled(value===null);
this.cmbDataDirect.setValue(props.getInColumns() ? 1 : 0);
this.txtDataRange.validation = function(value) {
if (_.isEmpty(value)) {
if (!me.cmbDataDirect.isDisabled()) me.cmbDataDirect.setDisabled(true);
return true;
}
this.cmbChartTitle.setValue(props.getTitle());
this.cmbLegendPos.setValue(props.getLegendPos());
if (me.cmbDataDirect.isDisabled()) me.cmbDataDirect.setDisabled(false);
this.updateDataLabels(this._state.ChartType, props.getDataLabelsPos());
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
};
this.chSeriesName.setValue(this.chartSettings.getShowSerName(), true);
this.chCategoryName.setValue(this.chartSettings.getShowCatName(), true);
this.chValue.setValue(this.chartSettings.getShowVal(), true);
this.cmbDataDirect.setDisabled(value===null);
this.cmbDataDirect.setValue(props.getInColumns() ? 1 : 0);
value = props.getSeparator();
this.txtSeparator.setValue((value) ? value : '');
this.cmbChartTitle.setValue(props.getTitle());
this.cmbLegendPos.setValue(props.getLegendPos());
// Vertical Axis
this.vertAxisProps = props.getVertAxisProps();
this.updateDataLabels(this._state.ChartType, props.getDataLabelsPos());
// Horizontal Axis
this.horAxisProps = props.getHorAxisProps();
this.chSeriesName.setValue(this.chartSettings.getShowSerName(), true);
this.chCategoryName.setValue(this.chartSettings.getShowCatName(), true);
this.chValue.setValue(this.chartSettings.getShowVal(), true);
this.updateAxisProps(this._state.ChartType);
this.currentChartType = this._state.ChartType;
value = props.getSeparator();
this.txtSeparator.setValue((value) ? value : '');
// Vertical Axis
this.vertAxisProps = props.getVertAxisProps();
// Horizontal Axis
this.horAxisProps = props.getHorAxisProps();
this.updateAxisProps(this._state.ChartType);
this.currentChartType = this._state.ChartType;
} else { // sparkline
this._state.SparkType = props.asc_getType();
var record = this.mnuSparkTypePicker.store.findWhere({type: this._state.SparkType});
this.mnuSparkTypePicker.selectRecord(record, true);
if (record)
this.btnSparkType.setIconCls('item-chartlist ' + record.get('iconCls'));
this.updateSparkStyles(props.asc_getStyles());
if (this._state.SparkType !== Asc.c_oAscSparklineType.Line)
this._arrEmptyCells.pop();
this.cmbEmptyCells.setData(this._arrEmptyCells);
this.cmbEmptyCells.setValue(props.asc_getDisplayEmpty());
this.chShowEmpty.setValue(props.asc_getDisplayHidden(), true);
this.chShowAxis.setValue(props.asc_getDisplayXAxis(), true);
this.chReverse.setValue(props.asc_getRightToLeft(), true);
this.cmbSparkMinType.setValue(props.asc_getMinAxisType(), true);
this.cmbSparkMaxType.setValue(props.asc_getMaxAxisType(), true);
this.spnSparkMinValue.setDisabled(props.asc_getMinAxisType()!==Asc.c_oAscSparklineAxisMinMax.Custom);
this.spnSparkMaxValue.setDisabled(props.asc_getMaxAxisType()!==Asc.c_oAscSparklineAxisMinMax.Custom);
this.spnSparkMinValue.setValue((props.asc_getManualMin() !== null) ? props.asc_getManualMin() : '', true);
this.spnSparkMaxValue.setValue((props.asc_getManualMax() !== null) ? props.asc_getManualMax() : '', true);
this._changedProps = new Asc.sparklineGroup();
this._noApply = false;
}
}
},
@ -1050,67 +1383,72 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
var value,
type = this.mnuChartTypePicker.getSelectedRec()[0].get('type');
// Layout
if (this.isChart) {
this.chartSettings.putType(type);
this.chartSettings.putType(type);
this.chartSettings.putInColumns(this.cmbDataDirect.getValue()==1);
this.chartSettings.putRange(this.txtDataRange.getValue());
this.chartSettings.putInColumns(this.cmbDataDirect.getValue()==1);
this.chartSettings.putRange(this.txtDataRange.getValue());
this.chartSettings.putTitle(this.cmbChartTitle.getValue());
this.chartSettings.putLegendPos(this.cmbLegendPos.getValue());
this.chartSettings.putTitle(this.cmbChartTitle.getValue());
this.chartSettings.putLegendPos(this.cmbLegendPos.getValue());
this.chartSettings.putShowHorAxis(this.cmbHorShow.getValue());
this.chartSettings.putShowVerAxis(this.cmbVertShow.getValue());
this.chartSettings.putShowHorAxis(this.cmbHorShow.getValue());
this.chartSettings.putShowVerAxis(this.cmbVertShow.getValue());
this.chartSettings.putHorAxisLabel(this.cmbHorTitle.getValue());
this.chartSettings.putVertAxisLabel(this.cmbVertTitle.getValue());
this.chartSettings.putHorAxisLabel(this.cmbHorTitle.getValue());
this.chartSettings.putVertAxisLabel(this.cmbVertTitle.getValue());
this.chartSettings.putHorGridLines(this.cmbHorGrid.getValue());
this.chartSettings.putVertGridLines(this.cmbVertGrid.getValue());
this.chartSettings.putHorGridLines(this.cmbHorGrid.getValue());
this.chartSettings.putVertGridLines(this.cmbVertGrid.getValue());
this.chartSettings.putDataLabelsPos(this.cmbDataLabels.getValue());
this.chartSettings.putDataLabelsPos(this.cmbDataLabels.getValue());
this.chartSettings.putShowSerName(this.chSeriesName.getValue()=='checked');
this.chartSettings.putShowCatName(this.chCategoryName.getValue()=='checked');
this.chartSettings.putShowVal(this.chValue.getValue()=='checked');
this.chartSettings.putShowSerName(this.chSeriesName.getValue()=='checked');
this.chartSettings.putShowCatName(this.chCategoryName.getValue()=='checked');
this.chartSettings.putShowVal(this.chValue.getValue()=='checked');
this.chartSettings.putSeparator(_.isEmpty(this.txtSeparator.getValue()) ? ' ' : this.txtSeparator.getValue());
this.chartSettings.putSeparator(_.isEmpty(this.txtSeparator.getValue()) ? ' ' : this.txtSeparator.getValue());
this.chartSettings.putShowMarker(this.chMarkers.getValue()=='checked');
this.chartSettings.putShowMarker(this.chMarkers.getValue()=='checked');
value = (type == Asc.c_oAscChartTypeSettings.lineNormal || type == Asc.c_oAscChartTypeSettings.lineStacked ||
type == Asc.c_oAscChartTypeSettings.lineStackedPer || type == Asc.c_oAscChartTypeSettings.scatter);
if (value) {
value = this.cmbLines.getValue();
this.chartSettings.putLine(value!==0);
if (value>0)
this.chartSettings.putSmooth(value==2);
}
value = (type == Asc.c_oAscChartTypeSettings.lineNormal || type == Asc.c_oAscChartTypeSettings.lineStacked ||
type == Asc.c_oAscChartTypeSettings.lineStackedPer || type == Asc.c_oAscChartTypeSettings.scatter);
if (value) {
value = this.cmbLines.getValue();
this.chartSettings.putLine(value!==0);
if (value>0)
this.chartSettings.putSmooth(value==2);
this.chartSettings.putVertAxisProps(this.vertAxisProps);
this.chartSettings.putHorAxisProps(this.horAxisProps);
return { chartSettings: this.chartSettings };
} else {
return { chartSettings: this._changedProps };
}
this.chartSettings.putVertAxisProps(this.vertAxisProps);
this.chartSettings.putHorAxisProps(this.horAxisProps);
return { chartSettings: this.chartSettings };
},
isRangeValid: function() {
var isvalid;
if (!_.isEmpty(this.txtDataRange.getValue())) {
isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, this.txtDataRange.getValue(), true, this.cmbDataDirect.getValue()==0, this.mnuChartTypePicker.getSelectedRec()[0].get('type'));
if (isvalid == Asc.c_oAscError.ID.No)
return true;
} else
this.txtDataRange.showError([this.txtEmpty]);
if (this.isChart) {
var isvalid;
if (!_.isEmpty(this.txtDataRange.getValue())) {
isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, this.txtDataRange.getValue(), true, this.cmbDataDirect.getValue()==0, this.mnuChartTypePicker.getSelectedRec()[0].get('type'));
if (isvalid == Asc.c_oAscError.ID.No)
return true;
} else
this.txtDataRange.showError([this.txtEmpty]);
this.setActiveCategory(0);
if (isvalid == Asc.c_oAscError.ID.StockChartError) {
Common.UI.warning({msg: this.errorStockChart});
} else if (isvalid == Asc.c_oAscError.ID.MaxDataSeriesError) {
Common.UI.warning({msg: this.errorMaxRows});
this.setActiveCategory(0);
if (isvalid == Asc.c_oAscError.ID.StockChartError) {
Common.UI.warning({msg: this.errorStockChart});
} else if (isvalid == Asc.c_oAscError.ID.MaxDataSeriesError) {
Common.UI.warning({msg: this.errorMaxRows});
} else
this.txtDataRange.cmpEl.find('input').focus();
return false;
} else
this.txtDataRange.cmpEl.find('input').focus();
return false;
return true;
},
onSelectData: function() {
@ -1277,6 +1615,24 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
textRight: 'Right',
textTop: 'Top',
textBottom: 'Bottom',
textFit: 'Fit Width'
textFit: 'Fit Width',
textSparkRanges: 'Sparkline Ranges',
textLocationRange: 'Location Range',
textEmptyCells: 'Hidden and Empty cells',
textShowEmptyCells: 'Show empty cells as',
textShowData: 'Show data in hidden rows and columns',
textGroup: 'Group Sparkline',
textSingle: 'Single Sparkline',
textGaps: 'Gaps',
textZero: 'Zero',
textEmptyLine: 'Connect data points with line',
textLineSpark: 'Line',
textColumnSpark: 'Column',
textWinLossSpark: 'Win/Loss',
textShowSparkAxis: 'Show Axis',
textReverseOrder: 'Reverse order',
textAutoEach: 'Auto for Each',
textSameAll: 'Same for All',
textTitleSparkline: 'Sparkline - Advanced Settings'
}, SSE.Views.ChartSettingsDlg || {}));
});

View file

@ -670,6 +670,9 @@ define([
this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0));
value = Common.localStorage.getItem("sse-settings-coauthmode");
if (value===null && Common.localStorage.getItem("sse-settings-autosave")===null &&
this.mode.customization && this.mode.customization.autosave===false)
value = 0; // use customization.autosave only when sse-settings-coauthmode and sse-settings-autosave are null
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
@ -687,6 +690,8 @@ define([
this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("sse-settings-autosave");
if (value===null && this.mode.customization && this.mode.customization.autosave===false)
value = 0;
this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("sse-settings-func-locale");

View file

@ -182,7 +182,7 @@ define([
Common.NotificationCenter.trigger('edit:complete', this);
}, this));
this.btnEditObject.on('click', _.bind(function(btn){
if (this.api) this.api.asc_pluginRun(this._originalProps.asc_getPluginGuid(), 0, this._originalProps.asc_getPluginData());
if (this.api) this.api.asc_startEditCurrentOleObject();
Common.NotificationCenter.trigger('edit:complete', this);
}, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));

View file

@ -310,8 +310,9 @@ define([
});
});
this.tabbar.$el.append('<div class="menu-backdrop dropdown-toggle" data-toggle="dropdown" style="width:0; height:0;"/>');
this.tabbar.$el.append('<div class="dropdown-toggle" data-toggle="dropdown" style="width:0; height:0;"/>');
this.tabMenu.render(this.tabbar.$el);
this.tabMenu.cmpEl.attr({tabindex: -1});
this.tabMenu.on('show:after', _.bind(this.onTabMenuAfterShow, this));
this.tabMenu.on('hide:after', _.bind(this.onTabMenuAfterHide, this));
this.tabMenu.on('item:click', _.bind(this.onTabMenuClick, this));
@ -544,6 +545,10 @@ define([
this.tabMenu.hide();
this.tabMenu.show();
var menu = this.tabMenu;
_.defer(function(){
menu.cmpEl.focus();
}, 10);
}
}
},

View file

@ -76,7 +76,8 @@ define([
ruleDelFilter: 'rule-clear-filter',
menuFileOpen: 'menu-file-open',
cantPrint: 'cant-print',
multiselect: 'is-multiselect'
multiselect: 'is-multiselect',
cantHyperlink: 'cant-hyperlink'
};
SSE.Views.Toolbar = Backbone.View.extend(_.extend({
@ -496,7 +497,7 @@ define([
id : 'id-toolbar-btn-inserthyperlink',
cls : 'btn-toolbar',
iconCls : 'btn-inserthyperlink',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.selShape, _set.multiselect, _set.lostConnect, _set.coAuth]
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.selShape, _set.cantHyperlink, _set.multiselect, _set.lostConnect, _set.coAuth]
});
me.btnInsertChart = new Common.UI.Button({
@ -504,6 +505,32 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-insertchart',
lock : [_set.editCell, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth]
/*,menu : new Common.UI.Menu({
items : [
this.mnuInsertChart = new Common.UI.MenuItem({
caption: this.textInsCharts,
value: 'chart',
menu: new Common.UI.Menu({
menuAlign: 'tl-tr',
style: 'width: 560px;',
items: [
{ template: _.template('<div id="id-toolbar-menu-insertchart" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>') }
]
})
}),
this.mnuInsertSparkline = new Common.UI.MenuItem({
caption: this.textInsSparklines,
value: 'chart',
menu: new Common.UI.Menu({
menuAlign: 'tl-tr',
style: 'width: 210px;',
items: [
{ template: _.template('<div id="id-toolbar-menu-insertspark" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>') }
]
})
})
]
})*/
});
me.btnEditChart = new Common.UI.Button({
@ -908,6 +935,7 @@ define([
isChecked: function () { return this.conf.checked; }
};
this.mnuitemHideGridlines = clone(this.mnuitemHideHeadings);
this.mnuitemFreezePanes = clone(this.mnuitemHideHeadings);
this.mnuZoom = {
options: {value: 100}
};
@ -1323,6 +1351,7 @@ define([
checkable : true,
value : 'formula'
}),
{caption: '--'},
this.mnuitemHideHeadings = new Common.UI.MenuItem({
caption : this.textHideHeadings,
checkable : true,
@ -1336,6 +1365,13 @@ define([
value : 'gridlines'
}),
{caption: '--'},
this.mnuitemFreezePanes = new Common.UI.MenuItem({
caption : this.textFreezePanes,
checkable : true,
checked : this.mnuitemFreezePanes.isChecked(),
value : 'freezepanes'
}),
{caption: '--'},
this.mnuZoom = new Common.UI.MenuItem({
template: _.template([
'<div id="id-toolbar-menu-zoom" class="menu-zoom" style="height: 25px;" ',
@ -1676,6 +1712,70 @@ define([
}
]
}));
/*
this.mnuInsertChartPicker = new Common.UI.DataView({
el: $('#id-toolbar-menu-insertchart'),
parentMenu: this.mnuInsertChart.menu,
showLast: false,
restoreHeight: 411,
groups: new Common.UI.DataViewGroupStore([
{ id: 'menu-chart-group-bar', caption: this.textColumn },
{ id: 'menu-chart-group-line', caption: this.textLine },
{ id: 'menu-chart-group-pie', caption: this.textPie },
{ id: 'menu-chart-group-hbar', caption: this.textBar },
{ id: 'menu-chart-group-area', caption: this.textArea },
{ id: 'menu-chart-group-scatter', caption: this.textPoint },
{ id: 'menu-chart-group-stock', caption: this.textStock }
]),
store: new Common.UI.DataViewStore([
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, allowSelected: true, iconCls: 'column-normal', selected: true},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked, allowSelected: true, iconCls: 'column-stack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer, allowSelected: true, iconCls: 'column-pstack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3d, allowSelected: true, iconCls: 'column-3d-normal'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked3d, allowSelected: true, iconCls: 'column-3d-stack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer3d, allowSelected: true, iconCls: 'column-3d-pstack'},
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, allowSelected: true, iconCls: 'column-3d-normal-per'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineNormal, allowSelected: true, iconCls: 'line-normal'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStacked, allowSelected: true, iconCls: 'line-stack'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPer, allowSelected: true, iconCls: 'line-pstack'},
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.line3d, allowSelected: true, iconCls: 'line-3d'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie, allowSelected: true, iconCls: 'pie-normal'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.doughnut, allowSelected: true, iconCls: 'pie-doughnut'},
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie3d, allowSelected: true, iconCls: 'pie-3d-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal, allowSelected: true, iconCls: 'bar-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked, allowSelected: true, iconCls: 'bar-stack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer, allowSelected: true, iconCls: 'bar-pstack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal3d, allowSelected: true, iconCls: 'bar-3d-normal'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked3d, allowSelected: true, iconCls: 'bar-3d-stack'},
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, allowSelected: true, iconCls: 'bar-3d-pstack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaNormal, allowSelected: true, iconCls: 'area-normal'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, allowSelected: true, iconCls: 'area-stack'},
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, allowSelected: true, iconCls: 'area-pstack'},
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, allowSelected: true, iconCls: 'point-normal'},
{ group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, allowSelected: true, iconCls: 'stock-normal'}
]),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')
});
this.mnuInsertSparkPicker = new Common.UI.DataView({
el: $('#id-toolbar-menu-insertspark'),
parentMenu: this.mnuInsertSparkline.menu,
showLast: false,
restoreHeight: 200,
allowScrollbar: false,
groups: new Common.UI.DataViewGroupStore([
{ id: 'menu-chart-group-sparkcolumn', caption: this.textColumnSpark },
{ id: 'menu-chart-group-sparkline', caption: this.textLineSpark },
{ id: 'menu-chart-group-sparkwin', caption: this.textWinLossSpark }
]),
store: new Common.UI.DataViewStore([
{ group: 'menu-chart-group-sparkcolumn', type: Asc.c_oAscSparklineType.Column, allowSelected: true, iconCls: 'spark-column'},
{ group: 'menu-chart-group-sparkline', type: Asc.c_oAscSparklineType.Line, allowSelected: true, iconCls: 'spark-line'},
{ group: 'menu-chart-group-sparkwin', type: Asc.c_oAscSparklineType.Stacked, allowSelected: true, iconCls: 'spark-win'}
]),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')
})
*/
},
setApi: function(api) {
@ -1991,6 +2091,7 @@ define([
textHideFBar: 'Hide Formula Bar',
textHideHeadings: 'Hide Headings',
textHideGridlines: 'Hide Gridlines',
textFreezePanes: 'Freeze Panes',
txtScheme1: 'Office',
txtScheme2: 'Grayscale',
txtScheme3: 'Apex',
@ -2021,6 +2122,18 @@ define([
txtPasteRange: 'Paste name',
textInsText: 'Insert text box',
textInsTextArt: 'Insert Text Art',
textInsCharts: 'Charts',
textLine: 'Line Chart',
textColumn: 'Column Chart',
textBar: 'Bar Chart',
textArea: 'Area Chart',
textPie: 'Pie Chart',
textPoint: 'Point Chart',
textStock: 'Stock Chart',
textInsSparklines: 'Sparklines',
textLineSpark: 'Line',
textColumnSpark: 'Column',
textWinLossSpark: 'Win/Loss',
tipInsertEquation: 'Insert Equation'
}, SSE.Views.Toolbar || {}));
});

View file

@ -264,7 +264,7 @@
<!-- debug begin -->
<script type="text/javascript">var less=less||{};less.env='development';</script>
<script src="../../../vendor/less/dist/less-1.5.1.js" type="text/javascript"></script>
<script src="../../../vendor/less/dist/less-2.7.1.js" type="text/javascript"></script>
<!-- debug end -->
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>

View file

@ -872,6 +872,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "Ohraničení diagonálně nahoru",
"SSE.Views.Toolbar.textEntireCol": "Celý sloupec",
"SSE.Views.Toolbar.textEntireRow": "Celý řádek",
"SSE.Views.Toolbar.textFreezePanes": "Ukotvit příčky",
"SSE.Views.Toolbar.textHideFBar": "Skrýt řádek vzorců",
"SSE.Views.Toolbar.textHideGridlines": "Skrýt mřížku",
"SSE.Views.Toolbar.textHideHeadings": "Skrýt nadpisy",

View file

@ -989,6 +989,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "Rahmenlinien diagonal nach oben",
"SSE.Views.Toolbar.textEntireCol": "Ganze Spalte",
"SSE.Views.Toolbar.textEntireRow": "Ganze Zeile",
"SSE.Views.Toolbar.textFreezePanes": "Fensterausschnitten fixieren",
"SSE.Views.Toolbar.textHideFBar": "Formelleiste vergeben",
"SSE.Views.Toolbar.textHideGridlines": "Gitternetzlinien vergeben",
"SSE.Views.Toolbar.textHideHeadings": "Überschriften vergeben",

View file

@ -172,6 +172,7 @@
"SSE.Controllers.DocumentHolder.txtLimitUnder": "Limit under text",
"SSE.Controllers.DocumentHolder.txtMatchBrackets": "Match brackets to argument height",
"SSE.Controllers.DocumentHolder.txtMatrixAlign": "Matrix alignment",
"SSE.Controllers.DocumentHolder.txtNoChoices": "There are no choices for filling the cell.<br>Only text values from the column can be selected for replacement.",
"SSE.Controllers.DocumentHolder.txtOverbar": "Bar over text",
"SSE.Controllers.DocumentHolder.txtRemFractionBar": "Remove fraction bar",
"SSE.Controllers.DocumentHolder.txtRemLimit": "Remove limit",
@ -286,7 +287,7 @@
"SSE.Controllers.Main.saveTitleText": "Saving Spreadsheet",
"SSE.Controllers.Main.textAnonymous": "Anonymous",
"SSE.Controllers.Main.textBuyNow": "Visit website",
"SSE.Controllers.Main.textCloseTip": "\nClick to close the tip",
"SSE.Controllers.Main.textCloseTip": "Click to close the tip",
"SSE.Controllers.Main.textConfirm": "Confirmation",
"SSE.Controllers.Main.textContactUs": "Contact sales",
"SSE.Controllers.Main.textLoadingDocument": "Loading spreadsheet",
@ -718,7 +719,7 @@
"SSE.Views.ChartSettings.textBar": "Bar Chart",
"SSE.Views.ChartSettings.textChartType": "Change Chart Type",
"SSE.Views.ChartSettings.textColumn": "Column Chart",
"SSE.Views.ChartSettings.textEditData": "Edit Data",
"SSE.Views.ChartSettings.textEditData": "Edit Data and Location",
"SSE.Views.ChartSettings.textHeight": "Height",
"SSE.Views.ChartSettings.textKeepRatio": "Constant Proportions",
"SSE.Views.ChartSettings.textLine": "Line Chart",
@ -1423,6 +1424,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "Diagonal Up Border",
"SSE.Views.Toolbar.textEntireCol": "Entire Column",
"SSE.Views.Toolbar.textEntireRow": "Entire Row",
"SSE.Views.Toolbar.textFreezePanes": "Freeze Panes",
"SSE.Views.Toolbar.textHideFBar": "Hide Formula Bar",
"SSE.Views.Toolbar.textHideGridlines": "Hide Gridlines",
"SSE.Views.Toolbar.textHideHeadings": "Hide Headings",

View file

@ -197,7 +197,7 @@
"SSE.Controllers.Main.saveTitleText": "Guardando hoja de cálculo",
"SSE.Controllers.Main.textAnonymous": "Anónimo",
"SSE.Controllers.Main.textBuyNow": "Visit website",
"SSE.Controllers.Main.textCloseTip": "\nPulse para cerrar el consejo",
"SSE.Controllers.Main.textCloseTip": "Pulse para cerrar el consejo",
"SSE.Controllers.Main.textConfirm": "Confirmación",
"SSE.Controllers.Main.textContactUs": "Contact sales",
"SSE.Controllers.Main.textLoadingDocument": "Cargando hoja de cálculo",
@ -999,6 +999,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "Borde diagonal ascendente",
"SSE.Views.Toolbar.textEntireCol": "Toda la columna",
"SSE.Views.Toolbar.textEntireRow": "Toda la fila",
"SSE.Views.Toolbar.textFreezePanes": "Inmovilizar paneles",
"SSE.Views.Toolbar.textHideFBar": "Ocultar barra de fórmulas",
"SSE.Views.Toolbar.textHideGridlines": "Ocultar cuadrícula",
"SSE.Views.Toolbar.textHideHeadings": "Ocultar títulos",

View file

@ -1422,6 +1422,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "Bordure diagonale haut",
"SSE.Views.Toolbar.textEntireCol": "Colonne entière",
"SSE.Views.Toolbar.textEntireRow": "Ligne entière",
"SSE.Views.Toolbar.textFreezePanes": "Verrouiller les volets",
"SSE.Views.Toolbar.textHideFBar": "Masquer la barre de formule",
"SSE.Views.Toolbar.textHideGridlines": "Masquer le quadrillage",
"SSE.Views.Toolbar.textHideHeadings": "Masquer les en-têtes",

View file

@ -177,7 +177,7 @@
"SSE.Controllers.Main.saveTextText": "Salvataggio del foglio elettronico in corso...",
"SSE.Controllers.Main.saveTitleText": "Salvataggio del foglio elettronico",
"SSE.Controllers.Main.textAnonymous": "Anonimo",
"SSE.Controllers.Main.textCloseTip": "\nClicca per chiudere il consiglio",
"SSE.Controllers.Main.textCloseTip": "Clicca per chiudere il consiglio",
"SSE.Controllers.Main.textConfirm": "Conferma",
"SSE.Controllers.Main.textLoadingDocument": "Caricamento del foglio elettronico",
"SSE.Controllers.Main.textNo": "No",
@ -872,6 +872,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "Bordo diagonale superiore",
"SSE.Views.Toolbar.textEntireCol": "Colonna intera",
"SSE.Views.Toolbar.textEntireRow": "Riga intera",
"SSE.Views.Toolbar.textFreezePanes": "Blocca riquadri",
"SSE.Views.Toolbar.textHideFBar": "Nascondi barra di formula",
"SSE.Views.Toolbar.textHideGridlines": "Nascondi griglia",
"SSE.Views.Toolbar.textHideHeadings": "Nascondi titoli",

View file

@ -976,6 +976,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "斜め罫線 (右上がり)",
"SSE.Views.Toolbar.textEntireCol": "列全体",
"SSE.Views.Toolbar.textEntireRow": "行全体",
"SSE.Views.Toolbar.textFreezePanes": "枠の固定",
"SSE.Views.Toolbar.textHideFBar": "数式バーの非表示",
"SSE.Views.Toolbar.textHideGridlines": "表のグリッド線を表示しない",
"SSE.Views.Toolbar.textHideHeadings": "ヘッダー情報を表示しない",

View file

@ -177,7 +177,7 @@
"SSE.Controllers.Main.saveTextText": "Saglabā Izklājlapu...",
"SSE.Controllers.Main.saveTitleText": "Saglabā Izklājlapu",
"SSE.Controllers.Main.textAnonymous": "Anonymous",
"SSE.Controllers.Main.textCloseTip": "\nClick to close the tip",
"SSE.Controllers.Main.textCloseTip": "Click to close the tip",
"SSE.Controllers.Main.textConfirm": "Confirmation",
"SSE.Controllers.Main.textLoadingDocument": "Ielādē Dokumentu",
"SSE.Controllers.Main.textNo": "No",

View file

@ -177,7 +177,7 @@
"SSE.Controllers.Main.saveTextText": "Salvando planilha...",
"SSE.Controllers.Main.saveTitleText": "Salvando planilha",
"SSE.Controllers.Main.textAnonymous": "Anônimo",
"SSE.Controllers.Main.textCloseTip": "\nClique para fechar a dica",
"SSE.Controllers.Main.textCloseTip": "Clique para fechar a dica",
"SSE.Controllers.Main.textConfirm": "Confirmação",
"SSE.Controllers.Main.textLoadingDocument": "Carregando planilha",
"SSE.Controllers.Main.textNo": "Não",
@ -872,6 +872,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "Borda superior diagonal",
"SSE.Views.Toolbar.textEntireCol": "Coluna inteira",
"SSE.Views.Toolbar.textEntireRow": "Linha inteira",
"SSE.Views.Toolbar.textFreezePanes": "Congelar painéis",
"SSE.Views.Toolbar.textHideFBar": "Ocultar barra de fórmulas",
"SSE.Views.Toolbar.textHideGridlines": "Ocultar linhas de grade",
"SSE.Views.Toolbar.textHideHeadings": "Ocultar títulos",

View file

@ -285,7 +285,7 @@
"SSE.Controllers.Main.saveTitleText": "Сохранение электронной таблицы",
"SSE.Controllers.Main.textAnonymous": "Аноним",
"SSE.Controllers.Main.textBuyNow": "Перейти на сайт",
"SSE.Controllers.Main.textCloseTip": "\nЩелкните, чтобы закрыть эту подсказку",
"SSE.Controllers.Main.textCloseTip": "Щелкните, чтобы закрыть эту подсказку",
"SSE.Controllers.Main.textConfirm": "Подтверждение",
"SSE.Controllers.Main.textContactUs": "Связаться с отделом продаж",
"SSE.Controllers.Main.textLoadingDocument": "Загрузка таблицы",
@ -1422,6 +1422,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "Диагональная граница снизу вверх",
"SSE.Views.Toolbar.textEntireCol": "Столбец",
"SSE.Views.Toolbar.textEntireRow": "Строку",
"SSE.Views.Toolbar.textFreezePanes": "Закрепить области",
"SSE.Views.Toolbar.textHideFBar": "Скрыть строку формул",
"SSE.Views.Toolbar.textHideGridlines": "Скрыть линии сетки",
"SSE.Views.Toolbar.textHideHeadings": "Скрыть заголовки",

View file

@ -177,7 +177,7 @@
"SSE.Controllers.Main.saveTextText": "Shranjevanje razpredelnice...",
"SSE.Controllers.Main.saveTitleText": "Shranjevanje razpredelnice",
"SSE.Controllers.Main.textAnonymous": "Anonimno",
"SSE.Controllers.Main.textCloseTip": "\nPritisni za zapiranje namiga",
"SSE.Controllers.Main.textCloseTip": "Pritisni za zapiranje namiga",
"SSE.Controllers.Main.textConfirm": "Potrditev",
"SSE.Controllers.Main.textLoadingDocument": "Nalaganje razpredelnice",
"SSE.Controllers.Main.textNo": "Ne",
@ -872,6 +872,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "Diagonalna zgornja meja",
"SSE.Views.Toolbar.textEntireCol": "Cel stolpec",
"SSE.Views.Toolbar.textEntireRow": "Cela vrstica",
"SSE.Views.Toolbar.textFreezePanes": "Zamrzni plošče",
"SSE.Views.Toolbar.textHideFBar": "Skrij vrsto formule",
"SSE.Views.Toolbar.textHideGridlines": "Skrij mrežne črte",
"SSE.Views.Toolbar.textHideHeadings": "Skrij naslove",

View file

@ -177,7 +177,7 @@
"SSE.Controllers.Main.saveTextText": "Spreadsheet kaydediliyor...",
"SSE.Controllers.Main.saveTitleText": "Spreadsheet Kaydediliyor",
"SSE.Controllers.Main.textAnonymous": "Anonim",
"SSE.Controllers.Main.textCloseTip": "\nUcu kapamak için tıklayın",
"SSE.Controllers.Main.textCloseTip": "Ucu kapamak için tıklayın",
"SSE.Controllers.Main.textConfirm": "Konfirmasyon",
"SSE.Controllers.Main.textLoadingDocument": "Spreadsheet yükleniyor",
"SSE.Controllers.Main.textNo": "Hayır",
@ -872,6 +872,7 @@
"SSE.Views.Toolbar.textDiagUpBorder": "Diagonal Up Border",
"SSE.Views.Toolbar.textEntireCol": "Tüm sütun",
"SSE.Views.Toolbar.textEntireRow": "Tüm satır",
"SSE.Views.Toolbar.textFreezePanes": "Parçaları Dondur",
"SSE.Views.Toolbar.textHideFBar": "Formül Çubuğunu Gizle",
"SSE.Views.Toolbar.textHideGridlines": "Kılavuz Çizgileri Gizle",
"SSE.Views.Toolbar.textHideHeadings": "Başlıkları Gizle",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -92,14 +92,14 @@
.btn-edit-table {background-position: 0 0;}
button.over .btn-edit-table {background-position: -28px 0;}
.btn-group.open .btn-edit-table,
button.active .btn-edit-table,
button:active .btn-edit-table {background-position: -56px 0;}
button.active:not(.disabled) .btn-edit-table,
button:active:not(.disabled) .btn-edit-table {background-position: -56px 0;}
.btn-change-shape {background-position: 0 -16px;}
button.over .btn-change-shape {background-position: -28px -16px;}
.btn-group.open .btn-change-shape,
button.active .btn-change-shape,
button:active .btn-change-shape {background-position: -56px -16px;}
button.active:not(.disabled) .btn-change-shape,
button:active:not(.disabled) .btn-change-shape {background-position: -56px -16px;}
.combo-pattern-item {
.background-ximage('@{app-image-path}/right-panels/patterns.png', '@{app-image-path}/right-panels/patterns@2x.png', 112px);
@ -295,6 +295,18 @@ button:active .btn-change-shape {background-position: -56px -16px;}
background-position: -200px 0;
}
.spark-line{
background-position: 0px -250px;
}
.spark-column{
background-position: -50px -250px;
}
.spark-win{
background-position: -100px -250px;
}
#table-combo-template .combo-dataview{
.combo-template(60px);
}

View file

@ -266,6 +266,9 @@
.status-group {
white-space: nowrap;
&.dropup {
position: static;
}
}
.cnt-zoom {
@ -302,11 +305,6 @@
}
}
.nav-tabs.bottom {
margin-bottom: 6px;
height: 18px;
}
&.masked #status-addtabs-box{
button.disabled .btn-icon {
background-position-x: 0px !important;

View file

@ -246,7 +246,7 @@
#id-toolbar-mnu-item-border-width {
.border-size-item {
background: ~"url(@{app-image-path}/toolbar/BorderSize.png) repeat-x scroll 0 0";
background: ~"url(@{app-image-const-path}/toolbar/BorderSize.png) repeat-x scroll 0 0";
width: 80px;
height: 20px;
margin-top: -3px;

View file

@ -141,8 +141,10 @@ module.exports = function(grunt) {
production: {
options: {
compress: true,
ieCompat: false,
modifyVars: packageFile['main']['less']['vars'],
plugins: [
// new (require('less-plugin-clean-css'))()
new (require('less-plugin-clean-css'))()
]
},
files: {
@ -158,10 +160,16 @@ module.exports = function(grunt) {
},
replace: {
fixLessUrl: {
src: ['<%= pkg.main.less.files.dest %>'],
writeVersion: {
src: ['<%= pkg.api.copy.script.dest %>' + '/documents/api.js'],
overwrite: true,
replacements: packageFile['main']['less']['replacements']
replacements: [{
from: /(\#{2}BN\#)/,
to: function(matchedWord, index, fullText, regexMatches) {
// return content.replace(/(\#{2}BN\#)/, "." + (process.env['BUILD_NUMBER'] || packageFile.build));
return "." + (process.env['BUILD_NUMBER'] || packageFile.build);
}
}]
}
},
@ -207,52 +215,6 @@ module.exports = function(grunt) {
});
});
grunt.registerTask('lessPostFix', function(){
if (packageFile.main.less.embedImages) {
grunt.config('replace.urlToUri', {
src: ['<%= pkg.main.less.files.dest %>'],
overwrite: true,
replacements: [{
from: /url\(\'?(?!data\:image)([^\)\'\"]+)\'?/g,
to: function(matchedWord, index, fullText, regexMatches) {
return 'data-uri(\'' + regexMatches + '\'';
}
},{
from: /filter\:\s?alpha\(opacity\s?=\s?[0-9]{1,3}\)\;/g,
to: ''
}]
});
grunt.config('less.uriPostfix', {
options: {
compress: true,
ieCompat: false
},
files: {
"<%= pkg.main.less.files.dest %>": "<%= pkg.main.less.files.dest %>"
}
});
grunt.config('clean.files', '<%= pkg.main.clean %>/resources/img');
grunt.task.run('replace:urlToUri', 'less:uriPostfix', 'clean');
}
grunt.config('replace.writeVersion', {
src: ['<%= pkg.api.copy.script.dest %>' + '/documents/api.js'],
overwrite: true,
replacements: [{
from: /(\#{2}BN\#)/,
to: function(matchedWord, index, fullText, regexMatches) {
// return content.replace(/(\#{2}BN\#)/, "." + (process.env['BUILD_NUMBER'] || packageFile.build));
return "." + (process.env['BUILD_NUMBER'] || packageFile.build);
}
}]
});
grunt.task.run('replace:writeVersion');
});
grunt.registerTask('mobile-app-init', function() {
grunt.initConfig({
pkg: grunt.file.readJSON(defaultConfig),
@ -334,7 +296,8 @@ module.exports = function(grunt) {
options: {
force: true
},
files: packageFile['embed']['clean']
postbuild: packageFile['embed']['clean']['postbuild'],
prebuild: packageFile['embed']['clean']['prebuild']
},
uglify: {
@ -356,7 +319,8 @@ module.exports = function(grunt) {
less: {
production: {
options: {
cleancss: true
compress: true,
ieCompat: false
},
files: {
"<%= pkg.embed.less.files.dist %>": packageFile['embed']['less']['files']['src']
@ -364,14 +328,6 @@ module.exports = function(grunt) {
}
},
replace: {
fixLessUrl: {
src: ['<%= pkg.embed.less.files.dist %>'],
overwrite: true,
replacements: packageFile['embed']['less']['replacements']
}
},
copy: {
'index-page': {
files: packageFile['embed']['copy']['index-page']
@ -399,16 +355,15 @@ module.exports = function(grunt) {
grunt.registerTask('deploy-megapixel', ['megapixel-init', 'clean', 'copy']);
grunt.registerTask('deploy-jquery', ['jquery-init', 'clean', 'copy']);
grunt.registerTask('deploy-underscore', ['underscore-init', 'clean', 'copy']);
grunt.registerTask('deploy-zeroclipboard', ['zeroclipboard-init', 'clean', 'copy']);
grunt.registerTask('deploy-bootstrap', ['bootstrap-init', 'clean', 'copy']);
grunt.registerTask('deploy-jszip', ['jszip-init', 'clean', 'copy']);
grunt.registerTask('deploy-jsziputils', ['jsziputils-init', 'clean', 'copy']);
grunt.registerTask('deploy-jsrsasign', ['jsrsasign-init', 'clean', 'copy']);
grunt.registerTask('deploy-requirejs', ['requirejs-init', 'clean', 'uglify']);
grunt.registerTask('deploy-app-main', ['main-app-init', 'clean', 'less', 'replace:fixLessUrl', 'requirejs', 'concat', 'imagemin', 'copy', 'lessPostFix']);
grunt.registerTask('deploy-app-main', ['main-app-init', 'clean', 'imagemin', 'less', 'requirejs', 'concat', 'copy', 'replace:writeVersion']);
grunt.registerTask('deploy-app-mobile', ['mobile-app-init', 'clean:deploy', 'cssmin:styles', 'copy:template-backup', 'htmlmin', 'requirejs', 'copy:template-restore', 'clean:template-backup', 'copy:localization', 'copy:index-page', 'copy:images-app']);
grunt.registerTask('deploy-app-embed', ['embed-app-init', 'clean', 'uglify', 'less', 'replace:fixLessUrl', 'copy']);
grunt.registerTask('deploy-app-embed', ['embed-app-init', 'clean:prebuild', 'uglify', 'less', 'copy', 'clean:postbuild']);
doRegisterInitializeAppTask('documenteditor', 'DocumentEditor', 'documenteditor.json');

Some files were not shown because too many files have changed in this diff Show more