diff options
Diffstat (limited to 'public/assets/js')
| -rw-r--r-- | public/assets/js/index.js | 1 | ||||
| -rw-r--r-- | public/assets/js/lib/views/details/comments.js | 3 | ||||
| -rw-r--r-- | public/assets/js/lib/views/details/files.js | 8 | ||||
| -rw-r--r-- | public/assets/js/lib/views/details/gallery.js | 10 | ||||
| -rw-r--r-- | public/assets/js/lib/views/index/threadbox.js | 15 |
5 files changed, 29 insertions, 8 deletions
diff --git a/public/assets/js/index.js b/public/assets/js/index.js index bbb7fd9..06f2158 100644 --- a/public/assets/js/index.js +++ b/public/assets/js/index.js @@ -2,6 +2,7 @@ var app = (function(){ var app = {} app.init = function(){ + app.debug = !! window.location.search.match('debug') app.router = new SiteRouter () app.view = null diff --git a/public/assets/js/lib/views/details/comments.js b/public/assets/js/lib/views/details/comments.js index 8894676..967204e 100644 --- a/public/assets/js/lib/views/details/comments.js +++ b/public/assets/js/lib/views/details/comments.js @@ -39,6 +39,9 @@ var CommentsView = FormView.extend({ if (auth.user.username !== comment.username) { $t.find(".edit-links").remove() } + if (app.debug) { + $t.find('.date').prepend('#' + comment.id + ' ') + } return $t }, diff --git a/public/assets/js/lib/views/details/files.js b/public/assets/js/lib/views/details/files.js index b68d42c..a074e2a 100644 --- a/public/assets/js/lib/views/details/files.js +++ b/public/assets/js/lib/views/details/files.js @@ -82,7 +82,8 @@ var FilesView = FormView.extend({ var date_class = carbon_date(file.date) var link = make_link(file) - var t = this.template.replace(/{{username}}/g, file.username) + var t = this.template.replace(/{{id}}/g, file.id) + .replace(/{{username}}/g, file.username) .replace(/{{link}}/g, link) .replace(/{{filename}}/g, file.filename) .replace(/{{date_class}}/g, date_class) @@ -91,7 +92,10 @@ var FilesView = FormView.extend({ .replace(/{{size_class}}/g, size[0]) .replace(/{{size}}/g, size[1]) var $t = $(t) - return t + if (app.debug) { + $t.find('.user').append(' #' + file.id) + } + return $t }, prependFile: function(file){ diff --git a/public/assets/js/lib/views/details/gallery.js b/public/assets/js/lib/views/details/gallery.js index da6e97f..de9a6a4 100644 --- a/public/assets/js/lib/views/details/gallery.js +++ b/public/assets/js/lib/views/details/gallery.js @@ -31,16 +31,20 @@ var GalleryView = View.extend({ .replace(/{{thumb}}/g, thumb) .replace(/{{link}}/g, link) .replace(/{{age}}/g, age) - return t + var $t = $(t) + if (app.debug) { + $t.find('.date').append(', #' + file.id) + } + return $t }, prependFile: function(file){ - var $el = $( this.parse(file) ) + var $el = this.parse(file) this.$el.prepend($el) }, appendFile: function(file){ - var $el = $( this.parse(file) ) + var $el = this.parse(file) this.$el.append($el) }, diff --git a/public/assets/js/lib/views/index/threadbox.js b/public/assets/js/lib/views/index/threadbox.js index 70dc961..01d1de4 100644 --- a/public/assets/js/lib/views/index/threadbox.js +++ b/public/assets/js/lib/views/index/threadbox.js @@ -75,7 +75,16 @@ var ThreadBox = View.extend({ .replace(/{{show_files}}/g, thread.file_count == 0 ? "hidden" : "") .replace(/{{size_class}}/g, size[0] ) .replace(/{{color}}/g, thread.color || "blue" ) - return t + var $t = $(t) + if (app.debug) { + var $title = $t.find('.title a') + var href = $title.attr('href') + $title.attr('href', href + '?debug') + } + if (app.debug) { + $t.find('.date').append(' #' + thread.id) + } + return $t }, parseKeyword: function(keyword){ @@ -85,7 +94,7 @@ var ThreadBox = View.extend({ }, prependThread: function(thread){ - var $row = $( this.parse(thread) ) + var $row = this.parse(thread) this.$el.prepend($row) }, @@ -99,7 +108,7 @@ var ThreadBox = View.extend({ appendThread: function(thread){ thread.appended = true - var $row = $( this.parse(thread) ) + var $row = this.parse(thread) if (thread.first) $row.addClass('first') if (thread.last) $row.addClass('last') this.$el.append($row) |
