aboutsummaryrefslogtreecommitdiff
path: root/web/scripts3.js
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2012-12-16 12:01:39 +0700
committerGravatar Ugnich Anton2012-12-16 12:01:39 +0700
commit52f88dbb3c2e81e1b658b95ff91236db1a1fe03a (patch)
treef3cde3e04f175fd079416bdfc5d93bd43595c0f4 /web/scripts3.js
parent52c8d049af6c0963b63dd1e70f66128527a7cba5 (diff)
message number dialog
Diffstat (limited to 'web/scripts3.js')
-rw-r--r--web/scripts3.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/web/scripts3.js b/web/scripts3.js
index 1a5ffd66..a1afb433 100644
--- a/web/scripts3.js
+++ b/web/scripts3.js
@@ -63,6 +63,39 @@ function unfoldReply() {
}
}
+function showMessageLinksDialog(mid,rid) {
+ var hlink="http://juick.com/"+mid;
+ var mlink="#"+mid;
+ if(rid>0) {
+ hlink+="#"+rid;
+ mlink+="/"+rid;
+ }
+ $('#dialogl').html(hlink);
+ $('#dialogn').html(mlink);
+
+ $('#dialogw li>a').click(function(event) {
+ event.preventDefault();
+ openSocialWindow($(this).attr('href'));
+ });
+ var hlinkenc=encodeURIComponent(hlink);
+ $('#sharefb').attr('href','https://www.facebook.com/sharer/sharer.php?u='+hlinkenc);
+ $('#sharetw').attr('href','https://twitter.com/intent/tweet?url='+hlinkenc);
+ $('#sharevk').attr('href','https://vk.com/share.php?url='+hlinkenc);
+ $('#sharegp').attr('href','https://plus.google.com/share?url='+hlinkenc);
+
+ var w=$('#dialogw');
+ var b=$('#dialogb');
+ w.css("top", Math.max(0, ((b.height() - w.outerHeight()) / 2) + b.scrollTop()) + "px");
+ w.css("left", Math.max(0, ((b.width() - w.outerWidth()) / 2) + b.scrollLeft()) + "px");
+ b.show();
+ w.show();
+}
+
+function openSocialWindow(url) {
+ var w=window.open(url,'juickshare','width=640,height=400');
+ if(window.focus) w.focus();
+}
+
/*
* jQuery.fn.autoResize 1.14
*/