git-svn-id: https://msi/svn/firstRepo/WebClient/trunk@13 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2014-12-10 14:58:10 +00:00
parent 90e0252f4b
commit 876ee18579
238 changed files with 35068 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTemplate.html', 'modules/base/baseView', 'classes/profile'],
function($, _, Backbone, settingsViewTemplate, BaseView, Profile){
var SettingsView = BaseView.extend({
//initialize template
template:_.template(settingsViewTemplate),
initialize: function () {
SettingsView.__super__.initialize.call(this);
},
events: {
"click #saveBtn": "saveBtn"
},
saveBtn:function(e){
e.preventDefault();
Profile.data.risRic = this.$el.find('#nResult').val();
Profile.data.tema = this.$el.find('#theme').val();
Profile.updateProfile(function(){
Backbone.history.loadUrl();
});
},
//render the content into div of view
render: function(){
SettingsView.__super__.render.call(this);
//this.el is the root element of Backbone.View. By default, it is a div.
//$el is cached jQuery object for the view's element.
//append the compiled template into view div container
this.$el.append(this.header.$el);
this.$el.append(this.template());
this.$el.append(this.footer.$el);
this.$el.find('#nResult').val(Profile.data.risRic);
this.$el.find('#theme').val(Profile.data.tema);
this.$el.find("#moreBtn").addClass("ui-btn-active");
//$("#homeBtn").addClass("ui-btn-active");
//return to enable chained calls
return this;
}
});
return SettingsView;
});
@@ -0,0 +1,23 @@
<div data-role="content">
<h1>Impostazioni</h1>
<div>
<label for="nResult">Numero Risultati Ricerca:</label>
<select name="nResult" id="nResult">
<option value="10" selected="true">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="25">25</option>
<option value="30">30</option>
</select>
<label for="theme">Tema Grafico:</label>
<select name="theme" id="theme">
<option value="a">Blu</option>
<option value="b" selected="true">Nero</option>
<option value="c" selected="true">Chiaro</option>
</select>
<a id="saveBtn" href="" button="true" class="ui-link ui-btn ui-icon-custom ui-btn-icon-left">Save</a>
<br><br>
Impostazione di sincronizzazione
<a id="syncBtn" href="#syncView" button="true" class="ui-link ui-btn ui-icon-custom ui-btn-icon-left">Sincronizzazione</a>
</div>
</div>