diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index 8702bd8ae..0ed443110 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -54,6 +54,10 @@ define([ infoObj, modalView; + var _slideSizeArr = [ + [254, 190.5], [254, 143] + ]; + return { models: [], collections: [], @@ -74,6 +78,8 @@ define([ setApi: function (api) { this.api = api; + + this.api.asc_registerCallback('asc_onPresentationSize', _.bind(this.onApiPageSize, this)); }, onLaunch: function () { @@ -137,17 +143,35 @@ define([ } }, - onPageShow: function(view) { + onPageShow: function(view, pageId) { var me = this; $('#settings-search').single('click', _.bind(me._onSearch, me)); $('#settings-readermode input:checkbox').single('change', _.bind(me._onReaderMode, me)); $('#settings-edit-presentation').single('click', _.bind(me._onEditPresentation, me)); $(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me)); + $('#page-settings-setup-view li').single('click', _.bind(me._onSlideSize, me)); + + me.initSettings(pageId); }, + initSettings: function (pageId) { + var me = this; + if (pageId == '#settings-setup-view') { + me.onApiPageSize(me.api.get_PresentationWidth(), me.api.get_PresentationHeight()); + } + }, // API handlers + onApiPageSize: function(width, height) { + for (var i = 0; i < _slideSizeArr.length; i++) { + if (Math.abs(_slideSizeArr[i][0] - width) < 0.001 && Math.abs(_slideSizeArr[i][1] - height) < 0.001) { + $('#page-settings-setup-view input').val([i]); + break; + } + } + }, + _onApiDocumentName: function(name) { $('#settings-presentation-title').html(name ? name : '-'); }, @@ -195,6 +219,14 @@ define([ me.hideModal(); }, + _onSlideSize: function(e) { + var $target = $(e.currentTarget).find('input'); + if ($target && this.api) { + var value = parseFloat($target.prop('value')); + this.api.changeSlideSize(_slideSizeArr[value][0], _slideSizeArr[value][1]); + } + }, + txtLoading : 'Loading...', notcriticalErrorTitle : 'Warning', warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?' diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template index 2307f3263..b9d561594 100644 --- a/apps/presentationeditor/mobile/app/template/Settings.template +++ b/apps/presentationeditor/mobile/app/template/Settings.template @@ -235,4 +235,40 @@ + + +
+ +
+
+
+
    +
  • + +
  • +
  • + +
  • +
+
+
+
\ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/view/Settings.js b/apps/presentationeditor/mobile/app/view/Settings.js index 05ae26646..065dc0978 100644 --- a/apps/presentationeditor/mobile/app/view/Settings.js +++ b/apps/presentationeditor/mobile/app/view/Settings.js @@ -74,6 +74,7 @@ define([ $('#settings-history').single('click', _.bind(me.showHistory, me)); $('#settings-help').single('click', _.bind(me.showHelp, me)); $('#settings-about').single('click', _.bind(me.showAbout, me)); + $('#settings-presentation-setup').single('click', _.bind(me.showSetup, me)); me.initControls(); }, @@ -103,6 +104,7 @@ define([ $layour.find('#settings-readermode').hide(); $layour.find('#settings-search .item-title').text(this.textFindAndReplace) } else { + $layour.find('#settings-presentation-setup').hide(); $layour.find('#settings-readermode input:checkbox') .attr('checked', Common.SharedSettings.get('readerMode')) .prop('checked', Common.SharedSettings.get('readerMode')); @@ -133,7 +135,7 @@ define([ content: $content.html() }); - this.fireEvent('page:show', this); + this.fireEvent('page:show', [this, templateId]); } }, @@ -165,6 +167,10 @@ define([ this.showPage('#settings-about-view'); }, + showSetup: function () { + this.showPage('#settings-setup-view'); + }, + loadDocument: function (data) { var permissions = {}; @@ -196,7 +202,10 @@ define([ textVersion: 'Version', textAddress: 'address', textEmail: 'email', - textTel: 'tel' + textTel: 'tel', + textSlideSize: 'Slide Size', + mniSlideStandard: 'Standard (4:3)', + mniSlideWide: 'Widescreen (16:9)' } })(), PE.Views.Settings || {})) }); \ No newline at end of file