Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Video.dom_id on front side

  • Loading branch information...
commit 6ecf9a5bf1128ecb8cf2b722801b9353a6f6e843 1 parent 0a44386
@Evangenieur authored
View
6 public/javascripts/hvidio.js
@@ -168,7 +168,6 @@
.on("video.new", function() {
var pos;
this.msg = this.msgs[0];
- this.id = hvidio.convertId(this.id);
this.score = _.reduce(this.msgs, function(memo, num) {
return (memo + (parseInt(num.votes) + 1)) || 1;
}, 0);
@@ -201,9 +200,8 @@
}
}).on("video.update", function() {
-
- var id = hvidio.convertId(this.id),
- $tip = $('#' + id + ' .tip'),
+ console.log("update", this.dom_id);
+ var $tip = $('#' + this.dom_id + ' .tip'),
score = parseInt($tip.text()) || 1,
newScore = score + 1; //(this.msgs[this.msgs.length - 1].votes || 1);
View
2  public/javascripts/live-search.coffee
@@ -14,6 +14,7 @@ window.Search = class Search
clearInterval(my_timer) if my_timer
finished = _(@events).filter((e) -> e.finished?).pop().finished
Search.socket.emit "search", @search_term, finished
+
_.defer search_me
#instances[search_term] = @
@@ -23,6 +24,7 @@ window.Search = class Search
video_reduce: (video) ->
msg = video.msg
delete video.msg
+ video.dom_id = video.id.replace "/", "-"
video.msgs = []
(@videos[video.id] or= video).msgs.push msg
console.log "videos ", Object.keys(@videos).length
View
1  public/javascripts/live-search.js
@@ -41,6 +41,7 @@
var msg, _base, _name;
msg = video.msg;
delete video.msg;
+ video.dom_id = video.id.replace("/", "-");
video.msgs = [];
((_base = this.videos)[_name = video.id] || (_base[_name] = video)).msgs.push(msg);
console.log("videos ", Object.keys(this.videos).length);
View
2  views/index.jade
@@ -30,7 +30,7 @@ block content
| </ul>
script#videoTemplate(type='text/template')
- | <li class="video" id="<%= video.id %>">
+ | <li class="video" id="<%= video.dom_id %>">
| <div class="video-cell">
| <div class="video-wrapper">
| <img class="preview" title="<%= video.title %>" src="<%= video.thumbnail %>">
View
2  workers/twitter_search_worker.coffee
@@ -14,7 +14,7 @@ tc = new ntwitter
video_search = (search, opts = {}) ->
_(opts).defaults
include_entities: on
- rpp: 20
+ rpp: 50
result_type: "recent"
#lang: "fr"
Please sign in to comment.
Something went wrong with that request. Please try again.