[IMP] website: simplify code share button; wip: fix overlay

bzr revid: chm@openerp.com-20140312093440-4uzrpkguzu0fc5p5
This commit is contained in:
chm@openerp.com 2014-03-12 10:34:40 +01:00
parent 53f59c16d6
commit 4d125a3b52
5 changed files with 20 additions and 19 deletions

View File

@ -344,6 +344,9 @@
-moz-box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7);
box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7);
}
.oe_overlay .oe_handle.readonly {
content: "";
}
.oe_overlay .icon.btn {
display: inline-block;
}

View File

@ -252,6 +252,8 @@
background: rgba(30, 30, 30, .8)
color: #fff
+box-shadow(0 0 5px 3px rgba(255,255,255,.7))
&.readonly
content: ""
.icon.btn
display: inline-block

View File

@ -134,23 +134,18 @@
website.snippet.animationRegistry.share = website.snippet.Animation.extend({
selector: ".oe_share",
start: function () {
var self = this;
var url = encodeURIComponent(window.location.href);
var title = encodeURIComponent($("title").text());
this.$target.find(".oe_share_facebook").attr("href",
"https://www.facebook.com/sharer/sharer.php?u="+url);
this.$target.find(".oe_share_twitter").attr("href",
"https://twitter.com/intent/tweet?text="+title+"&related=&url="+url);
this.$target.find(".oe_share_linkedin").attr("href",
"http://www.linkedin.com/shareArticle?mini=true&url="+url+"&title="+title+"&summary=&source=");
this.$target.find(".oe_share_google").attr("href",
"https://plus.google.com/share?url="+url);
this.$target.find("a").click(function () {
window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=550,width=600');
return false;
this.$target.find("a").each(function () {
var $a = $(this);
$a.attr("href", $(this).attr("href").replace("{url}", url).replace("{title}", title));
if ($a.attr("target") && $a.attr("target").match(/_blank/i)) {
$a.click(function () {
window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=550,width=600');
return false;
});
}
});
this.$target.find(".oe_share_mail").attr("href",
"mailto:?body="+url+"&subject="+title).off("click");
},
});
})();

View File

@ -200,6 +200,7 @@
bind_snippet_click_editor: function () {
var self = this;
var snipped_event_flag;
$("#wrapwrap").on('click', function (event) {
if (snipped_event_flag) {
return;

View File

@ -345,11 +345,11 @@
<div class="oe_snippet_body oe_share">
<h3>
Share
<a target="_Blank" class="oe_share_facebook" href="https://www.facebook.com/OpenERP"><i class="fa fa-facebook-square"></i></a>
<a target="_Blank" class="oe_share_twitter" href="https://twitter.com/openerp"><i class="fa fa-twitter"></i></a>
<a target="_Blank" class="oe_share_linkedin" href="http://www.linkedin.com/company/openerp"><i class="fa fa-linkedin"></i></a>
<a target="_Blank" class="oe_share_google" href="https://plus.google.com/+openerp"><i class="fa fa-google-plus-square"></i></a>
<a class="oe_share_mail" href="#"><i class="fa fa-envelope-o"></i></a>
<a target="_Blank" class="oe_share_facebook" href="https://www.facebook.com/sharer/sharer.php?u={url}"><i class="fa fa-facebook-square"></i></a>
<a target="_Blank" class="oe_share_twitter" href="https://twitter.com/intent/tweet?text={title}&amp;url={url}"><i class="fa fa-twitter"></i></a>
<a target="_Blank" class="oe_share_linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url={url}&amp;title={title}&amp;"><i class="fa fa-linkedin"></i></a>
<a target="_Blank" class="oe_share_google" href="https://plus.google.com/share?url={url}"><i class="fa fa-google-plus-square"></i></a>
<a href="mailto:?body={url}&amp;subject={title}"><i class="fa fa-envelope-o"></i></a>
</h3>
</div>
</div>