| author | cavaliet |
| Wed, 19 Dec 2012 13:23:34 +0100 | |
| changeset 139 | ebaf7878c756 |
| parent 115 | e48bb5d43ac2 |
| child 154 | 60ca7678f074 |
| permissions | -rw-r--r-- |
| 15 | 1 |
$(function(){ |
2 |
||
3 |
$(".open-popin").click(function(){ |
|
4 |
var target = $(this).attr("href"); |
|
5 |
if($(target).is(':visible')){ |
|
| 16 | 6 |
$(".popin").hide(); |
| 15 | 7 |
}else{ |
| 16 | 8 |
$(".popin").hide(); |
| 15 | 9 |
$(target).show(); |
10 |
} |
|
11 |
return false; |
|
12 |
}); |
|
13 |
|
|
| 115 | 14 |
$(document).click(function(e) { |
15 |
if(!$(e.target).parents(".popin").length) { |
|
16 |
$(".popin").hide(); |
|
17 |
} |
|
18 |
}); |
|
19 |
|
|
| 15 | 20 |
$(".change-account").click(function() { |
| 91 | 21 |
$(".user-screen").hide(); |
22 |
$(".user-screen.login").show(); |
|
| 15 | 23 |
}); |
24 |
$(".signup-button").click(function() { |
|
| 91 | 25 |
$(".user-screen").hide(); |
26 |
$(".user-screen.signup").show(); |
|
| 15 | 27 |
}); |
| 16 | 28 |
$(".login-form, .signup-form").submit(function() { |
29 |
$(".user").hide(); |
|
| 91 | 30 |
$(".user-screen").hide(); |
31 |
$(".user-screen.info").show(); |
|
| 16 | 32 |
}); |
|
24
1fbf7d835dc2
- update segment and bg video list
Anthony Ly <anthonyly.com@gmail.com>
parents:
16
diff
changeset
|
33 |
|
| 91 | 34 |
}); |
35 |
||
36 |
// Social Plug-in |
|
37 |
||
38 |
(function() { |
|
39 |
||
40 |
var uid = 0; |
|
41 |
||
42 |
window.social = function(opts) { |
|
43 |
|
|
44 |
var opts = opts || {}; |
|
45 |
opts.sel = opts.sel || $(".Ldt-Social"); |
|
| 104 | 46 |
opts.url = opts.url || document.location.href |
47 |
opts.text = opts.text || $("title").text(); |
|
48 |
|
|
49 |
if (!opts.sel.length) { |
|
50 |
return; |
|
51 |
} |
|
52 |
|
|
53 |
opts.sel.addClass("Ldt-Social"); |
|
| 91 | 54 |
|
55 |
if (opts.swf) { |
|
56 |
ZeroClipboard.setMoviePath(opts.swf); |
|
57 |
} |
|
58 |
|
|
| 104 | 59 |
var clipId = "Social-Clip-" + (++uid), |
60 |
clip, |
|
61 |
html = '<div class="Ldt-Social-Url-Container"><a href="#" target="_blank" class="Ldt-Social-Square Ldt-Social-Url" title="' |
|
62 |
+ gettext("Share URL") |
|
63 |
+ '"></a><span class="Ldt-Social-UrlPop"><input class="Ldt-Social-Input"/><div class="Ldt-Social-CopyBtn" id="' |
|
64 |
+ clipId |
|
65 |
+ '">' |
|
66 |
+ gettext("Copy") |
|
67 |
+ '</div></span></div><a href="http://www.facebook.com/share.php?' |
|
68 |
+ $.param({ u: opts.url, t: opts.text }) |
|
69 |
+ '" target="_blank" class="Ldt-Social-Fb Ldt-Social-Ext" title="' |
|
70 |
+ gettext("Share on Facebook") |
|
71 |
+ '"></a><a href="https://twitter.com/intent/tweet?' |
|
72 |
+ $.param({ url: opts.url, text: opts.text }) |
|
73 |
+ '" target="_blank" class="Ldt-Social-Twitter Ldt-Social-Ext" title="' |
|
74 |
+ gettext("Share on Twitter") |
|
75 |
+ '"></a><a href="https://plus.google.com/share?' |
|
76 |
+ $.param({ url: opts.url, title: opts.text }) |
|
77 |
+ '" target="_blank" class="Ldt-Social-Gplus Ldt-Social-Ext" title="' |
|
78 |
+ gettext("Share on Google+") |
|
79 |
+ '"></a><a href="mailto:?' |
|
80 |
+ $.param({ subject: opts.text, body: opts.text + ": " + opts.url }) |
|
81 |
+ '" target="_blank" class="Ldt-Social-Mail" title="' |
|
82 |
+ gettext("Share via E-Mail") |
|
83 |
+ '"></a></div>'; |
|
84 |
|
|
85 |
opts.sel.html(html); |
|
| 91 | 86 |
|
87 |
opts.sel.find(".Ldt-Social-Url").click(function() { |
|
88 |
var _pop = opts.sel.find(".Ldt-Social-UrlPop"); |
|
89 |
_pop.toggle(); |
|
90 |
if (_pop.is(":visible")) { |
|
91 |
if (typeof clip == "undefined") { |
|
92 |
clip = new ZeroClipboard.Client(); |
|
93 |
clip.setHandCursor( true ); |
|
94 |
clip.glue(clipId); |
|
95 |
|
|
96 |
clip.addEventListener( 'onMouseUp', function() { |
|
97 |
_pop.hide(); |
|
98 |
clip.hide(); |
|
99 |
}); |
|
100 |
} |
|
101 |
clip.show(); |
|
102 |
clip.setText( opts.url ); |
|
103 |
opts.sel.find(".Ldt-Social-Input").val(opts.url).focus(); |
|
104 |
} else { |
|
105 |
clip.hide(); |
|
106 |
} |
|
107 |
return false; |
|
108 |
}); |
|
109 |
opts.sel.find(".Ldt-Social-Input").focus(function() { |
|
110 |
this.select(); |
|
111 |
}); |
|
112 |
opts.sel.find(".Ldt-Social-Ext").click(function() { |
|
113 |
window.open( |
|
114 |
opts.sel.find(this).attr("href"), |
|
115 |
"_blank", |
|
116 |
"height=300,width=450,left=100,top=100,toolbar=0,menubar=0,status=0,location=0"); |
|
117 |
return false; |
|
118 |
}); |
|
119 |
} |
|
120 |
}()); |