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

This commit is contained in:
2015-05-07 13:16:11 +00:00
parent d0d55ee8e5
commit 282ad76c48
79 changed files with 2416 additions and 1824 deletions
+92 -44
View File
@@ -1,47 +1,95 @@
define(['jquery', 'underscore', 'backbone','text!modules/home/homeViewTemplate.html', 'modules/base/baseView', 'classes/profile'],
function($, _, Backbone, homeViewTemplate, BaseView, Profile){
define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.html',
'modules/base/baseView', 'classes/profile', 'classes/debug', 'jQueryPlugins'],
function ($, _, Backbone, homeViewTemplate, BaseView, Profile, Debug) {
var HomeView = BaseView.extend({
var HomeView = BaseView.extend({
//initialize template
template: _.template(homeViewTemplate),
initialize: function () {
var self = this;
this.id = "HomeView";
HomeView.__super__.initialize.call(this);
if (Profile.data.picture === null)
{
Profile.setPictureEvent = this.changePicture;
}
},
changePicture: function (val) {
var item = $('.itemMenuHomeMetro a[href="#settingsView"]');
if (item.length > 0)
{
$('.profileClass').removeClass("profileClass");
item.css('background', 'url(' + val + ') 50% 50% no-repeat');
}
},
events: {
//"click #goFbGroup": "goFbGroup"
},
//goFbGroup: function () {
// window.localStorage.setItem("goFbGroup", 1);
// window.location.href = "https://www.facebook.com/groups/732844273469518/";
//},
freeWall: null,
onShowed: function ()
{
var self = this;
//initialize template
template:_.template(homeViewTemplate),
var size = $('.itemMenuHomeMetro').first().css("width").replace("px", "");
if (parseInt(size) === 0)
{
size = $('.itemMenuHomeMetro').first().attr("lastSize");
}
$('.itemMenuHomeMetro').first().attr("lastSize", size);
if (this.freeWall === null) {
this.freeWall = new freewall("#menuHomeMetro");
}
this.freeWall.reset({
selector: '.itemMenuHomeMetro',
animate: true,
cellW: size,
cellH: size,
onResize: function () {
this.refresh();
Debug.writeMessage("onResize");
}
});
this.freeWall.fitWidth();
if (Profile.data.picture !== null)
{
this.changePicture(Profile.data.picture);
}
initialize: function () {
HomeView.__super__.initialize.call(this);
//this.header.title = "pippo";
},
events: {
"click #goFbGroup": "goFbGroup"
},
goFbGroup: function(){
window.localStorage.setItem("goFbGroup", 1);
window.location.href = "https://www.facebook.com/groups/732844273469518/";
},
onShowed: function()
{
if(window.localStorage.getItem("goFbGroup") !== "1")
this.$el.find("#nuovoGruppo").popup("open");
},
//render the content into div of view
render: function(){
//this.header.title = "pippo";
HomeView.__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({ profile: Profile}));
this.$el.append(this.footer.$el);
this.$el.find("#homeBtn").addClass("ui-btn-active");
//$("#homeBtn").addClass("ui-btn-active");
//return to enable chained calls
return this;
}
});
return HomeView;
});
Debug.writeMessage(myManifest.Agent.ua);
//if (window.localStorage.getItem("goFbGroup") !== "1")
// this.$el.find("#nuovoGruppo").popup("open");
},
onClosing: function () {
if (this.freeWall !== null)
this.freeWall.reset({
selector: '.itemMenuHomeMetro',
onResize: function(){}
});
},
//render the content into div of view
render: function () {
if (this.created === true)
{
//this.header.title = "pippo";
HomeView.__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({profile: Profile}));
this.$el.append(this.footer.$el);
}
this.$el.find("#homeBtn").addClass("ui-btn-active");
//$("#homeBtn").addClass("ui-btn-active");
//return to enable chained calls
return this;
}
});
return HomeView;
});
+48 -15
View File
@@ -4,22 +4,55 @@
<h2 id="benvenuto">Bentornat<% if(profile.data.gender=="male"){%>o<%}else{%>a<%}%>
<br><%=profile.data.name %></h2>
<% } %>
<img id="sfondo" src="https://dl.dropboxusercontent.com/s/6qrdp9mbi1rb92k/sfondo.png">
</div>
<div>
<% var customClassTheme = "itemMenuHomeMetro-" + profile.data.tema;%>
<div id="menuHomeMetro">
<div class="itemMenuHomeMetro <%= customClassTheme %><% if(!profile.isConnected()){ %> loginClass<% }else{ %> profileClass<%}%>">
<div>
<% if(profile.isConnected()){ %>
<a href="#settingsView" data-role="none" style=""></a>
<span>Profilo</span>
<% }else{ %>
<a href="#syncView" data-role="none"></a>
<span>Login</span>
<% } %>
</div>
</div>
<div class="itemMenuHomeMetro <%= customClassTheme %> indexClass">
<div>
<a href="#indexView" data-role="none"></a>
<span>Indice</span>
</div>
</div>
<div class="itemMenuHomeMetro <%= customClassTheme %> searchClass">
<div>
<a href="#searchView" data-role="none"></a>
<span>Ricerca</span>
</div>
</div>
<div class="itemMenuHomeMetro <%= customClassTheme %> blogClass">
<div>
<a href="http://blog.gruppolapastamadre.it" data-role="none"></a>
<span>Blog</span>
</div>
</div>
</div>
</div>
</div>
<div data-role="popup" id="nuovoGruppo" data-history="false" data-dismissible="false">
<!--<div data-role="popup" id="nuovoGruppo" data-history="false" data-dismissible="false">
<div data-role="header"><h1>IMPORTANTE</h1></div>
    <div role="main" class="ui-content">
<p style="text-align: center;font-style: italic;">
<img src="https://dl.dropboxusercontent.com/s/xnbrbbe7eejkfv2/festa.png"><br><br>
Le admin <br><br><b>Alessia, Elena e Francesca</b><br><br>hanno RIFONDATO IL GRUPPO!!<br>
<br>"<b>Gruppo La Pasta Madre</b>"<br>
<br>vuoi chiedere di diventare membro?
<br>Se sei già membro premi si e poi torna indietro con il browser
</p>
<p style="text-align: center;">
<a id="goFbGroup" href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back">Si</a>
<a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back" data-transition="flow">No</a>
</p>
    <div role="main" class="ui-content">
<p style="text-align: center;font-style: italic;">
<img src="https://dl.dropboxusercontent.com/s/xnbrbbe7eejkfv2/festa.png"><br><br>
Le admin <br><br><b>Alessia, Elena e Francesca</b><br><br>hanno RIFONDATO IL GRUPPO!!<br>
<br>"<b>Gruppo La Pasta Madre</b>"<br>
<br>vuoi chiedere di diventare membro?
<br>Se sei già membro premi si e poi torna indietro con il browser
</p>
<p style="text-align: center;">
<a id="goFbGroup" href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back">Si</a>
<a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back" data-transition="flow">No</a>
</p>
</div>
</div>
</div>-->