[se mobile] added application settings (units)
This commit is contained in:
parent
652fafcbed
commit
6e78971810
|
@ -158,6 +158,8 @@ define([
|
||||||
if (pageId == '#settings-about-view') {
|
if (pageId == '#settings-about-view') {
|
||||||
// About
|
// About
|
||||||
me.setLicInfo(_licInfo);
|
me.setLicInfo(_licInfo);
|
||||||
|
} else if ('#settings-application-view' == pageId) {
|
||||||
|
me.initPageApplicationSettings();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -198,6 +200,22 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
initPageApplicationSettings: function() {
|
||||||
|
var me = this,
|
||||||
|
$unitMeasurement = $('.page[data-page=settings-application-view] input:radio[name=unit-of-measurement]');
|
||||||
|
$unitMeasurement.single('change', _.bind(me.unitMeasurementChange, me));
|
||||||
|
var value = Common.localStorage.getItem('se-mobile-settings-unit');
|
||||||
|
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
|
||||||
|
$unitMeasurement.val([value]);
|
||||||
|
},
|
||||||
|
|
||||||
|
unitMeasurementChange: function (e) {
|
||||||
|
var value = $(e.currentTarget).val();
|
||||||
|
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
|
||||||
|
Common.Utils.Metric.setCurrentMetric(value);
|
||||||
|
Common.localStorage.setItem("se-mobile-settings-unit", value);
|
||||||
|
},
|
||||||
|
|
||||||
// API handlers
|
// API handlers
|
||||||
|
|
||||||
_onSearch: function (e) {
|
_onSearch: function (e) {
|
||||||
|
|
|
@ -225,7 +225,7 @@ define([
|
||||||
var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4,
|
var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4,
|
||||||
borderType = shapeProperties.get_stroke().get_type();
|
borderType = shapeProperties.get_stroke().get_type();
|
||||||
$('#edit-chart-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]);
|
$('#edit-chart-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]);
|
||||||
$('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText);
|
$('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
|
|
||||||
$('#edit-chart-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me));
|
$('#edit-chart-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me));
|
||||||
$('#edit-chart-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me));
|
$('#edit-chart-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me));
|
||||||
|
@ -660,7 +660,7 @@ define([
|
||||||
|
|
||||||
onBorderSizeChanging: function (e) {
|
onBorderSizeChanging: function (e) {
|
||||||
var $target = $(e.currentTarget);
|
var $target = $(e.currentTarget);
|
||||||
$('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText);
|
$('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
},
|
},
|
||||||
|
|
||||||
onBorderColor: function (palette, color) {
|
onBorderColor: function (palette, color) {
|
||||||
|
|
|
@ -182,7 +182,7 @@ define([
|
||||||
var borderSize = me._mm2pt(shapeProperties.get_stroke().get_width()),
|
var borderSize = me._mm2pt(shapeProperties.get_stroke().get_width()),
|
||||||
borderType = shapeProperties.get_stroke().get_type();
|
borderType = shapeProperties.get_stroke().get_type();
|
||||||
$('#edit-shape-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]);
|
$('#edit-shape-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]);
|
||||||
$('#edit-shape-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText);
|
$('#edit-shape-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
|
|
||||||
$('#edit-shape-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me));
|
$('#edit-shape-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me));
|
||||||
$('#edit-shape-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me));
|
$('#edit-shape-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me));
|
||||||
|
@ -301,7 +301,7 @@ define([
|
||||||
|
|
||||||
onBorderSizeChanging: function (e) {
|
onBorderSizeChanging: function (e) {
|
||||||
var $target = $(e.currentTarget);
|
var $target = $(e.currentTarget);
|
||||||
$('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText);
|
$('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
},
|
},
|
||||||
|
|
||||||
onOpacity: function (e) {
|
onOpacity: function (e) {
|
||||||
|
|
|
@ -49,6 +49,18 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a id="settings-application" class="item-link">
|
||||||
|
<div class="item-content">
|
||||||
|
<div class="item-media">
|
||||||
|
<i class="icon icon-print"></i>
|
||||||
|
</div>
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title"><%= scope.textApplicationSettings %></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a id="settings-document-info" class="item-link">
|
<a id="settings-document-info" class="item-link">
|
||||||
<div class="item-content">
|
<div class="item-content">
|
||||||
|
@ -329,4 +341,57 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Application settings -->
|
||||||
|
<div id="settings-application-view">
|
||||||
|
<div class="navbar">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="left sliding">
|
||||||
|
<a href="#" class="back link">
|
||||||
|
<i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="center sliding"><%= scope.textApplicationSettings %></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pages">
|
||||||
|
<div class="page" data-page="settings-application-view">
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="content-block-title"><%= scope.textUnitOfMeasurement %></div>
|
||||||
|
<div class="list-block">
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label class="label-radio item-content">
|
||||||
|
<input type="radio" name="unit-of-measurement" value="0">
|
||||||
|
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title"><%= scope.textCentimeter %></div>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label class="label-radio item-content">
|
||||||
|
<input type="radio" name="unit-of-measurement" value="1">
|
||||||
|
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title"><%= scope.textPoint %></div>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label class="label-radio item-content">
|
||||||
|
<input type="radio" name="unit-of-measurement" value="2">
|
||||||
|
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title"><%= scope.textInch %></div>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -79,6 +79,7 @@ define([
|
||||||
$('#settings-history').single('click', _.bind(me.showHistory, me));
|
$('#settings-history').single('click', _.bind(me.showHistory, me));
|
||||||
$('#settings-help').single('click', _.bind(me.showHelp, me));
|
$('#settings-help').single('click', _.bind(me.showHelp, me));
|
||||||
$('#settings-about').single('click', _.bind(me.showAbout, me));
|
$('#settings-about').single('click', _.bind(me.showAbout, me));
|
||||||
|
$('#settings-application').single('click', _.bind(me.showSetApp, me));
|
||||||
|
|
||||||
Common.Utils.addScrollIfNeed('.view[data-page=settings-root-view] .pages', '.view[data-page=settings-root-view] .page');
|
Common.Utils.addScrollIfNeed('.view[data-page=settings-root-view] .pages', '.view[data-page=settings-root-view] .page');
|
||||||
me.initControls();
|
me.initControls();
|
||||||
|
@ -162,6 +163,10 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showSetApp: function() {
|
||||||
|
this.showPage('#settings-application-view');
|
||||||
|
},
|
||||||
|
|
||||||
showDocumentInfo: function() {
|
showDocumentInfo: function() {
|
||||||
this.showPage('#settings-info-view');
|
this.showPage('#settings-info-view');
|
||||||
|
|
||||||
|
@ -225,7 +230,12 @@ define([
|
||||||
textEmail: 'email',
|
textEmail: 'email',
|
||||||
textTel: 'tel',
|
textTel: 'tel',
|
||||||
textPoweredBy: 'Powered by',
|
textPoweredBy: 'Powered by',
|
||||||
textPrint: 'Print'
|
textPrint: 'Print',
|
||||||
|
textApplicationSettings: 'Application Settings',
|
||||||
|
textUnitOfMeasurement: 'Unit of Measurement',
|
||||||
|
textCentimeter: 'Centimeter',
|
||||||
|
textPoint: 'Point',
|
||||||
|
textInch: 'Inch'
|
||||||
}
|
}
|
||||||
})(), SSE.Views.Settings || {}))
|
})(), SSE.Views.Settings || {}))
|
||||||
});
|
});
|
|
@ -512,6 +512,11 @@
|
||||||
"SSE.Views.Settings.textSettings": "Settings",
|
"SSE.Views.Settings.textSettings": "Settings",
|
||||||
"SSE.Views.Settings.textTel": "tel",
|
"SSE.Views.Settings.textTel": "tel",
|
||||||
"SSE.Views.Settings.textVersion": "Version",
|
"SSE.Views.Settings.textVersion": "Version",
|
||||||
|
"DE.Views.Settings.textApplicationSettings": "Application Settings",
|
||||||
|
"DE.Views.Settings.textUnitOfMeasurement": "Unit of Measurement",
|
||||||
|
"DE.Views.Settings.textCentimeter": "Centimeter",
|
||||||
|
"DE.Views.Settings.textPoint": "Point",
|
||||||
|
"DE.Views.Settings.textInch": "Inch",
|
||||||
"SSE.Views.Settings.unknownText": "Unknown",
|
"SSE.Views.Settings.unknownText": "Unknown",
|
||||||
"SSE.Views.Toolbar.textBack": "Back"
|
"SSE.Views.Toolbar.textBack": "Back"
|
||||||
}
|
}
|
Loading…
Reference in a new issue