diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 67764cd4e..542d51928 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -502,8 +502,7 @@ define([ me.hidePreloader(); me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); - if (me.appOptions.isReviewOnly) - me.api.asc_SetTrackRevisions(true); + me.api.asc_SetTrackRevisions(me.appOptions.isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (me.appOptions.fileKey || ''))); /** coauthoring begin **/ this.isLiveCommenting = Common.localStorage.getBool("de-settings-livecomment", true); @@ -689,6 +688,7 @@ define([ me.appOptions.canChat = me.appOptions.canLicense && !me.appOptions.isOffline && !((typeof (me.editorConfig.customization) == 'object') && me.editorConfig.customization.chat===false); me.appOptions.canEditStyles = me.appOptions.canLicense && me.appOptions.canEdit; me.appOptions.canPrint = (me.permissions.print !== false); + me.appOptions.fileKey = me.document.key; var type = /^(?:(pdf|djvu|xps))$/.exec(me.document.fileType); me.appOptions.canDownloadOrigin = me.permissions.download !== false && (type && typeof type[1] === 'string'); @@ -698,6 +698,10 @@ define([ me.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof me.editorConfig.customization == 'object'); me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object'); + if ( me.appOptions.isLightVersion ) { + me.appOptions.canUseHistory = me.appOptions.canReview = me.appOptions.isReviewOnly = false; + } + me.applyModeCommonElements(); me.applyModeEditorElements(); diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 75fe52c80..e30fcf45b 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -79,7 +79,10 @@ define([ { caption: 'A2', subtitle: Common.Utils.String.format('42{0} x 59,4{0}', txtCm), value: [420, 594] }, { caption: 'A6', subtitle: Common.Utils.String.format('10,5{0} x 14,8{0}', txtCm), value: [105, 148] } ], - _licInfo; + _licInfo, + _canReview = false, + _isReviewOnly = false, + _fileKey; return { models: [], @@ -120,6 +123,9 @@ define([ this.getView('Settings').setMode(mode); if (mode.canBranding) _licInfo = mode.customization; + _canReview = mode.canReview; + _isReviewOnly = mode.isReviewOnly; + _fileKey = mode.fileKey; }, initEvents: function () { @@ -196,9 +202,11 @@ define([ } else { $('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode')); $('#settings-spellcheck input:checkbox').attr('checked', Common.localStorage.getBool("de-mobile-spellcheck", false)); + $('#settings-review input:checkbox').attr('checked', _isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || ''))); $('#settings-search').single('click', _.bind(me.onSearch, me)); $('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me)); $('#settings-spellcheck input:checkbox').single('change', _.bind(me.onSpellcheck, me)); + $('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me)); $('#settings-help').single('click', _.bind(me.onShowHelp, me)); $('#settings-download').single('click', _.bind(me.onDownloadOrigin, me)); $('#settings-print').single('click', _.bind(me.onPrint, me)); @@ -306,6 +314,17 @@ define([ this.api && this.api.asc_setSpellCheck(state); }, + onTrackChanges: function(e) { + var $checkbox = $(e.currentTarget), + state = $checkbox.is(':checked'); + if ( _isReviewOnly ) { + $checkbox.attr('checked', true); + } else if ( _canReview ) { + this.api.asc_SetTrackRevisions(state); + Common.localStorage.setItem("de-mobile-track-changes-" + (_fileKey || ''), state ? 1 : 0); + } + }, + onShowHelp: function () { window.open('http://support.onlyoffice.com/', "_blank"); this.hideModal(); diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index cb9a715dc..8fa7b5cf6 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -57,6 +57,22 @@ +
  • +
    +
    + +
    +
    +
    <%= scope.textReview %>
    +
    + +
    +
    +
    +
  • diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index f120a87b4..1eef246b7 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -57,7 +57,9 @@ define([ _canReader = false, _canAbout = true, _canHelp = true, - _canPrint = false; + _canPrint = false, + _canReview = false, + _isReviewOnly = false; return { // el: '.view-main', @@ -99,6 +101,8 @@ define([ _canDownloadOrigin = mode.canDownloadOrigin; _canReader = !mode.isEdit && mode.canReader; _canPrint = mode.canPrint; + _canReview = mode.canReview; + _isReviewOnly = mode.isReviewOnly; if (mode.customization && mode.canBrandingExt) { _canAbout = (mode.customization.about!==false); @@ -131,6 +135,8 @@ define([ if (!_canAbout) $layour.find('#settings-about').hide(); if (!_canHelp) $layour.find('#settings-help').hide(); if (!_canPrint) $layour.find('#settings-print').hide(); + if (!_canReview) $layour.find('#settings-review').hide(); + if (_isReviewOnly) $layour.find('#settings-review').addClass('disabled'); return $layour.html(); } @@ -261,7 +267,8 @@ define([ textOrientation: 'Orientation', textPoweredBy: 'Powered by', textSpellcheck: 'Spell Checking', - textPrint: 'Print' + textPrint: 'Print', + textReview: 'Review' } })(), DE.Views.Settings || {})) diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index c7f5bafa2..349f5379b 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -387,5 +387,6 @@ "DE.Views.Settings.unknownText": "Unknown", "DE.Views.Settings.textSpellcheck": "Spell Checking", "DE.Views.Settings.textPrint": "Print", + "DE.Views.Settings.textReview": "Track Changes", "DE.Views.Toolbar.textBack": "Back" } \ No newline at end of file diff --git a/apps/documenteditor/mobile/resources/css/app-ios.css b/apps/documenteditor/mobile/resources/css/app-ios.css index 3e97850d0..41f1227fa 100644 --- a/apps/documenteditor/mobile/resources/css/app-ios.css +++ b/apps/documenteditor/mobile/resources/css/app-ios.css @@ -6348,12 +6348,12 @@ i.icon.icon-reader { } i.icon.icon-download { width: 22px; - height: 28px; + height: 22px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewBox%3D%220%200%2022%2022%22%20y%3D%220px%22%20x%3D%220px%22%20fill%3D%22%23446995%22%3E%3Cpath%20d%3D%22M12%200H11L11%2014L7.39999%2010.3L6.69999%2011.1L11.5%2016L16.3%2011.1L15.6%2010.3L12%2014L12%200Z%22%2F%3E%3Cpath%20d%3D%22M14%205V6H19V20H4V6H9V5H3V21H20V5H14Z%22%2F%3E%3C%2Fsvg%3E"); } i.icon.icon-print { width: 22px; - height: 28px; + height: 22px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewBox%3D%22-0%200%2022%2022%22%20y%3D%220px%22%20x%3D%220px%22%20fill%3D%22%23446995%22%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%201H17V6H21V17H17V21H5V17H1V6H5V1ZM6%206H16V2H6V6ZM5%2016V13H2V16H5ZM2%2012H20V7H2V12ZM20%2013H17V16H20V13ZM16%2013H6V20H16V13ZM14%2016H8V15H14V16ZM14%2018H8V17H14V18Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); } i.icon.icon-spellcheck { @@ -6361,6 +6361,11 @@ i.icon.icon-spellcheck { height: 22px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewBox%3D%220%200%2022%2022%22%20fill%3D%22%23446995%22%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8%201L3%2015H4.2L5.97686%2010H11.0231L11.6768%2011.8394C11.955%2011.5504%2012.262%2011.2892%2012.593%2011.0605L9%201H8ZM8.5%202.9L10.6678%209H6.33223L8.5%202.9Z%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M16%2021C18.7614%2021%2021%2018.7614%2021%2016C21%2013.2386%2018.7614%2011%2016%2011C13.2386%2011%2011%2013.2386%2011%2016C11%2018.7614%2013.2386%2021%2016%2021ZM15.3536%2018.3536L19.3536%2014.3536L18.6464%2013.6464L15%2017.2929L13.3536%2015.6464L12.6464%2016.3536L14.6464%2018.3536L15%2018.7071L15.3536%2018.3536Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); } +i.icon.icon-review { + width: 22px; + height: 28px; + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewBox%3D%22-0%200%2022%2022%22%20y%3D%220px%22%20x%3D%220px%22%20fill%3D%22%23446995%22%3E%3Cg%3E%3Cpath%20d%3D%22M2%202H19V6H18V3H3V19H18V13H19V20H2V2Z%22%2F%3E%3Cpath%20d%3D%22M15%207H6V6H15V7Z%22%2F%3E%3Cpath%20d%3D%22M6%209H15V8H6V9Z%22%2F%3E%3Cpath%20d%3D%22M13%2011H6V10H13V11Z%22%2F%3E%3Cpath%20d%3D%22M6%2013H11V12H6V13Z%22%2F%3E%3Cpath%20d%3D%22M10%2015H6V14H10V15Z%22%2F%3E%3Cpath%20d%3D%22M12%2014.5V16H13.5L21.5%208L20%206.5L12%2014.5Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); +} i.icon.icon-doc-setup { width: 22px; height: 22px; diff --git a/apps/documenteditor/mobile/resources/css/app-material.css b/apps/documenteditor/mobile/resources/css/app-material.css index 2c4bab90d..11363683c 100644 --- a/apps/documenteditor/mobile/resources/css/app-material.css +++ b/apps/documenteditor/mobile/resources/css/app-material.css @@ -5937,12 +5937,12 @@ i.icon.icon-reader { } i.icon.icon-download { width: 22px; - height: 28px; + height: 22px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewBox%3D%22-0%200%2022%2022%22%20y%3D%220px%22%20x%3D%220px%22%20fill%3D%22%23446995%22%3E%3Cg%3E%3Cpath%20d%3D%22M12%200H11L11%2014L7.39999%2010.3L6.69999%2011.1L11.5%2016L16.3%2011.1L15.6%2010.3L12%2014L12%200Z%22%2F%3E%3Cpath%20d%3D%22M14%205V6H19V20H4V6H9V5H3V21H20V5H14Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); } i.icon.icon-print { width: 22px; - height: 28px; + height: 22px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewBox%3D%22-0%200%2022%2022%22%20y%3D%220px%22%20x%3D%220px%22%20fill%3D%22%23446995%22%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%201H17V6H21V17H17V21H5V17H1V6H5V1ZM6%206H16V2H6V6ZM5%2016V13H2V16H5ZM2%2012H20V7H2V12ZM20%2013H17V16H20V13ZM16%2013H6V20H16V13ZM14%2016H8V15H14V16ZM14%2018H8V17H14V18Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); } i.icon.icon-spellcheck { @@ -5950,6 +5950,11 @@ i.icon.icon-spellcheck { height: 22px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewBox%3D%220%200%2022%2022%22%20fill%3D%22%23446995%22%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8%201L3%2015H4.2L5.97686%2010H11.0231L11.6768%2011.8394C11.955%2011.5504%2012.262%2011.2892%2012.593%2011.0605L9%201H8ZM8.5%202.9L10.6678%209H6.33223L8.5%202.9Z%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M16%2021C18.7614%2021%2021%2018.7614%2021%2016C21%2013.2386%2018.7614%2011%2016%2011C13.2386%2011%2011%2013.2386%2011%2016C11%2018.7614%2013.2386%2021%2016%2021ZM15.3536%2018.3536L19.3536%2014.3536L18.6464%2013.6464L15%2017.2929L13.3536%2015.6464L12.6464%2016.3536L14.6464%2018.3536L15%2018.7071L15.3536%2018.3536Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); } +i.icon.icon-review { + width: 22px; + height: 28px; + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewBox%3D%22-0%200%2022%2022%22%20y%3D%220px%22%20x%3D%220px%22%20fill%3D%22%23446995%22%3E%3Cg%3E%3Cpath%20d%3D%22M2%202H19V6H18V3H3V19H18V13H19V20H2V2Z%22%2F%3E%3Cpath%20d%3D%22M15%207H6V6H15V7Z%22%2F%3E%3Cpath%20d%3D%22M6%209H15V8H6V9Z%22%2F%3E%3Cpath%20d%3D%22M13%2011H6V10H13V11Z%22%2F%3E%3Cpath%20d%3D%22M6%2013H11V12H6V13Z%22%2F%3E%3Cpath%20d%3D%22M10%2015H6V14H10V15Z%22%2F%3E%3Cpath%20d%3D%22M12%2014.5V16H13.5L21.5%208L20%206.5L12%2014.5Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); +} i.icon.icon-doc-setup { width: 22px; height: 22px; diff --git a/apps/documenteditor/mobile/resources/less/ios/_icons.less b/apps/documenteditor/mobile/resources/less/ios/_icons.less index ed8c44678..3341da57e 100644 --- a/apps/documenteditor/mobile/resources/less/ios/_icons.less +++ b/apps/documenteditor/mobile/resources/less/ios/_icons.less @@ -37,12 +37,12 @@ i.icon { } &.icon-download { width: 22px; - height: 28px; + height: 22px; .encoded-svg-background(''); } &.icon-print { width: 22px; - height: 28px; + height: 22px; .encoded-svg-background(''); } &.icon-spellcheck { @@ -50,6 +50,11 @@ i.icon { height: 22px; .encoded-svg-background(''); } + &.icon-review { + width: 22px; + height: 28px; + .encoded-svg-background(''); + } &.icon-doc-setup { width: 22px; height: 22px; diff --git a/apps/documenteditor/mobile/resources/less/material/_icons.less b/apps/documenteditor/mobile/resources/less/material/_icons.less index 95ca9f990..d4cd281a6 100644 --- a/apps/documenteditor/mobile/resources/less/material/_icons.less +++ b/apps/documenteditor/mobile/resources/less/material/_icons.less @@ -32,12 +32,12 @@ i.icon { } &.icon-download { width: 22px; - height: 28px; + height: 22px; .encoded-svg-background(''); } &.icon-print { width: 22px; - height: 28px; + height: 22px; .encoded-svg-background(''); } &.icon-spellcheck { @@ -45,6 +45,11 @@ i.icon { height: 22px; .encoded-svg-background(''); } + &.icon-review { + width: 22px; + height: 28px; + .encoded-svg-background(''); + } &.icon-doc-setup { width: 22px; height: 22px;