aboutsummaryrefslogtreecommitdiff
path: root/web/scripts3.js
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2012-01-28 14:45:42 +0700
committerGravatar Ugnich Anton2012-01-28 14:45:42 +0700
commitad61ffdbaf004dd3b33adf8f2780500069fa097b (patch)
tree9da75dee30f84c5d244367f5819da04f597de31b /web/scripts3.js
parentc451a7e42560e33238b0c1d39784eeffd29fae67 (diff)
JS, CSS, PNG
Diffstat (limited to 'web/scripts3.js')
-rw-r--r--web/scripts3.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/web/scripts3.js b/web/scripts3.js
new file mode 100644
index 00000000..ec86d39e
--- /dev/null
+++ b/web/scripts3.js
@@ -0,0 +1,48 @@
+function inlinevideo(mid) {
+ var flashvars={
+ file:'http://i.juick.com/video/'+mid+'.mp4',
+ image:'http://i.juick.com/thumbs/'+mid+'.jpg',
+ skin:'http://static.juick.com/glow.zip'
+ };
+ var params={
+ allowfullscreen:'true'
+ };
+ swfobject.embedSWF('http://static.juick.com/player.swf','video-'+mid,'640','390','9.0.115','false',flashvars,params,null);
+}
+
+function postformListener(formEl,ev) {
+ if(ev.ctrlKey && (ev.keyCode==10 || ev.keyCode==13)) formEl.submit();
+}
+
+function showMoreReplies(id) {
+ $('#'+id+' .msg-comments').hide();
+
+ var replies=$('#replies>li');
+ var flagshow=0;
+ for(var i=0; i<replies.length; i++) {
+ if(flagshow==1) {
+ if(replies[i].style.display=="none") {
+ replies[i].style.display="block";
+ } else {
+ break;
+ }
+ }
+ if(replies[i].id==id) {
+ flagshow=1;
+ }
+ }
+ return false;
+}
+
+function showCommentForm(mid,rid) {
+ if($('#replies #'+rid+' textarea').length==0) {
+ var c=$('#replies #'+rid+' .msg-comment');
+ c.wrap('<form action="/post" method="POST" enctype="multipart/form-data"/>');
+ c.before('<input type="hidden" name="mid" value="'+mid+'"/><input type="hidden" name="rid" value="'+rid+'"/>');
+ c.append('<textarea name="body" rows="1" placeholder="Add a comment..." onkeypress="postformListener(this.form,event)"></textarea>');
+ }
+ $('#replies #'+rid+' .msg-links').hide();
+ $('#replies #'+rid+' .msg-comment').show();
+ $('#replies #'+rid+' textarea')[0].focus();
+ return false;
+}