| author | veltr |
| Mon, 03 Dec 2012 13:06:28 +0100 | |
| changeset 91 | a94f5c62e4d7 |
| parent 24 | 1fbf7d835dc2 |
| child 104 | 1b84c7b2aeee |
| 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 |
|
|
14 |
$(".change-account").click(function() { |
|
| 91 | 15 |
$(".user-screen").hide(); |
16 |
$(".user-screen.login").show(); |
|
| 15 | 17 |
}); |
18 |
$(".signup-button").click(function() { |
|
| 91 | 19 |
$(".user-screen").hide(); |
20 |
$(".user-screen.signup").show(); |
|
| 15 | 21 |
}); |
| 16 | 22 |
$(".login-form, .signup-form").submit(function() { |
23 |
$(".user").hide(); |
|
| 91 | 24 |
$(".user-screen").hide(); |
25 |
$(".user-screen.info").show(); |
|
| 16 | 26 |
}); |
|
24
1fbf7d835dc2
- update segment and bg video list
Anthony Ly <anthonyly.com@gmail.com>
parents:
16
diff
changeset
|
27 |
|
| 91 | 28 |
}); |
29 |
||
30 |
// Social Plug-in |
|
31 |
||
32 |
(function() { |
|
33 |
||
34 |
var uid = 0; |
|
35 |
||
36 |
window.social = function(opts) { |
|
37 |
|
|
38 |
var opts = opts || {}; |
|
39 |
opts.sel = opts.sel || $(".Ldt-Social"); |
|
40 |
opts.url = opts.url || document.location.href; |
|
41 |
|
|
42 |
if (opts.swf) { |
|
43 |
ZeroClipboard.setMoviePath(opts.swf); |
|
44 |
} |
|
45 |
|
|
46 |
var text = opts.sel.find("title").text(), |
|
47 |
clipId = "Social-Clip-" + (++uid), |
|
48 |
clip; |
|
49 |
||
50 |
opts.sel.find(".Ldt-Social-CopyBtn").attr("id", clipId); |
|
51 |
||
52 |
opts.sel.find(".Ldt-Social-Url").click(function() { |
|
53 |
var _pop = opts.sel.find(".Ldt-Social-UrlPop"); |
|
54 |
_pop.toggle(); |
|
55 |
if (_pop.is(":visible")) { |
|
56 |
if (typeof clip == "undefined") { |
|
57 |
clip = new ZeroClipboard.Client(); |
|
58 |
clip.setHandCursor( true ); |
|
59 |
clip.glue(clipId); |
|
60 |
|
|
61 |
clip.addEventListener( 'onMouseUp', function() { |
|
62 |
_pop.hide(); |
|
63 |
clip.hide(); |
|
64 |
}); |
|
65 |
} |
|
66 |
clip.show(); |
|
67 |
clip.setText( opts.url ); |
|
68 |
opts.sel.find(".Ldt-Social-Input").val(opts.url).focus(); |
|
69 |
} else { |
|
70 |
clip.hide(); |
|
71 |
} |
|
72 |
return false; |
|
73 |
}); |
|
74 |
opts.sel.find(".Ldt-Social-Input").focus(function() { |
|
75 |
this.select(); |
|
76 |
}); |
|
77 |
opts.sel.find(".Ldt-Social-Ext").click(function() { |
|
78 |
window.open( |
|
79 |
opts.sel.find(this).attr("href"), |
|
80 |
"_blank", |
|
81 |
"height=300,width=450,left=100,top=100,toolbar=0,menubar=0,status=0,location=0"); |
|
82 |
return false; |
|
83 |
}); |
|
84 |
|
|
85 |
opts.sel.find(".Ldt-Social-Fb").attr("href", "http://www.facebook.com/share.php?" + $.param({ u: opts.url, t: text })); |
|
86 |
opts.sel.find(".Ldt-Social-Twitter").attr("href", "https://twitter.com/intent/tweet?" + $.param({ url: opts.url, text: text })); |
|
87 |
opts.sel.find(".Ldt-Social-Gplus").attr("href", "https://plus.google.com/share?" + $.param({ url: opts.url, title: text })); |
|
88 |
opts.sel.find(".Ldt-Social-Mail").attr("href", "mailto:?" + $.param({ subject: text, body: text + ": " + opts.url })); |
|
89 |
} |
|
90 |
}()); |