Code cleanup

bzr revid: ddm@openerp.com-20130827074816-1kuvpbz6vubhel68
This commit is contained in:
ddm
2013-08-27 09:48:16 +02:00
parent 5787f089d3
commit f880ce9ae7
4 changed files with 32 additions and 16 deletions
+5 -5
View File
@@ -221,7 +221,7 @@
overflow: hidden;
}
#mobile-preview.modal {
.oe_mobile_preview.modal {
height: 660px;
background-color: black;
border: 2px solid;
@@ -234,22 +234,22 @@
right: 0;
max-width: 330px;
}
#mobile-preview.modal .modal-header {
.oe_mobile_preview.modal .modal-header {
background-color: black;
border-bottom: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#mobile-preview.modal .modal-header .oe_mobile_preview_title {
.oe_mobile_preview.modal .modal-header .oe_mobile_preview_title {
color: #1a1a1a;
}
#mobile-preview.modal .modal-body {
.oe_mobile_preview.modal .modal-body {
background-color: black;
max-height: 600px;
padding: 0;
margin: 0;
}
#mobile-preview.modal .modal-footer {
.oe_mobile_preview.modal .modal-footer {
background-color: black;
}
+1 -1
View File
@@ -195,7 +195,7 @@
$mobile_preview_background: #000000
$mobile_preview_border: #1A1A1A
$icon_close: #E00101
#mobile-preview.modal
.oe_mobile_preview.modal
height: 660px
background-color: $mobile_preview_background
border: 2px solid
+21 -6
View File
@@ -76,9 +76,6 @@
window.location.reload();
});
});
$('#mobile-preview').on('hidden', function () {
$('body').removeClass('oe_stop_scrolling');
});
},
start: function() {
var self = this;
@@ -198,14 +195,31 @@
this.snippets.toggle();
},
mobilePreview: function () {
$('body').addClass('oe_stop_scrolling');
document.getElementById("mobile-viewport").src = window.location.href + "?mobile-preview=true";
(new website.MobilePreview()).appendTo($('body'));
},
promotePage: function () {
(new website.seo.Configurator()).appendTo($('body'));
},
});
/* ----- MOBILE PREVIEW ---- */
website.MobilePreview = openerp.Widget.extend({
template: 'website.mobile_preview',
events: {
'hidden': 'close'
},
start: function () {
$('body').addClass('oe_stop_scrolling');
document.getElementById("mobile-viewport").src = window.location.href + "?mobile-preview=true";
this.$el.modal();
},
close: function () {
$('body').removeClass('oe_stop_scrolling');
this.destroy();
}
});
/* ----- SEO TOOLS ---- */
website.seo = {};
website.seo.Keyword = openerp.Widget.extend({
@@ -223,6 +237,7 @@
events: {
'click button[data-action=add]': 'add',
'click a[data-action=update]': 'update',
'hidden': 'destroy'
},
start: function () {
$('input[name=seo_page_url]').val(window.location.href);
@@ -233,7 +248,7 @@
addKeyword: function (word) {
new website.seo.Keyword({
keyword: word
}).appendTo(this.$el.find('.seo-keywords-list'));
}).appendTo(this.$el.find('.js_seo_keywords_list'));
},
add: function () {
var word = this.$el.find('input[name=seo_page_keywords]').val();
+5 -4
View File
@@ -10,7 +10,7 @@
<button data-action="edit" class="btn btn-primary">Edit</button>
</form>
<ul class="nav pull-right">
<li><a data-action="show-mobile-preview" href="#mobile-preview" data-toggle="modal" role="button"><span title="Mobile preview" class="icon-mobile-phone"/></a></li>
<li><a data-action="show-mobile-preview" href="#"><span title="Mobile preview" class="icon-mobile-phone"/></a></li>
<li class="divider-vertical"></li>
<li><a data-action="promote-current-page" href="#"><span title="Promote page on the web">Promote</span></a></li>
<li><a href="#">Translate</a></li>
@@ -38,8 +38,10 @@
</ul>
</div>
</div>
</t>
<div id="mobile-preview" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="mobile-preview-title" aria-hidden="true">
<t t-name="website.mobile_preview">
<div id="mobile-preview" class="modal hide fade oe_mobile_preview" tabindex="-1" role="dialog" aria-labelledby="mobile-preview-title" aria-hidden="true">
<div class="modal-header oe_mobile_preview_header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="mobile-preview-title" class="oe_mobile_preview_title">Mobile preview</h3>
@@ -50,7 +52,6 @@
</div>
</div>
</div>
</t>
<t t-name="website.seo_configuration">
@@ -85,7 +86,7 @@
<input type="text" name="seo_page_keywords" required="True" size="30" placeholder="New keyword"/>
<button data-action="add" class="btn" type="button">Add</button>
</div>
<ul class="seo-keywords-list">
<ul class="js_seo_keywords_list">
<!-- filled in JS -->
</ul>
</div>