diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 82d3639..1f8fdf0 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -11,7 +11,6 @@ //= require underscore-min //= require backbone-min //= require jquery.timeago -//= require backbone/asciinema $(function() { $('abbr.timeago').timeago(); diff --git a/app/assets/javascripts/backbone/asciinema.js.coffee b/app/assets/javascripts/backbone/asciinema.js.coffee deleted file mode 100644 index 093960c..0000000 --- a/app/assets/javascripts/backbone/asciinema.js.coffee +++ /dev/null @@ -1,11 +0,0 @@ -#= require_self -#= require_tree ./templates -#= require_tree ./models -#= require_tree ./views -#= require_tree ./routers - -window.Asciinema = - Models: {} - Collections: {} - Routers: {} - Views: {} diff --git a/app/assets/javascripts/backbone/models/.gitkeep b/app/assets/javascripts/backbone/models/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/javascripts/backbone/models/comment.js.coffee b/app/assets/javascripts/backbone/models/comment.js.coffee deleted file mode 100644 index 9492680..0000000 --- a/app/assets/javascripts/backbone/models/comment.js.coffee +++ /dev/null @@ -1,7 +0,0 @@ -class Asciinema.Models.Comment extends Backbone.Model - - user: -> - this.get('user') - -class Asciinema.Collections.Comments extends Backbone.Collection - model: Asciinema.Models.Comment diff --git a/app/assets/javascripts/backbone/routers/.gitkeep b/app/assets/javascripts/backbone/routers/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/javascripts/backbone/templates/.gitkeep b/app/assets/javascripts/backbone/templates/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/javascripts/backbone/views/.gitkeep b/app/assets/javascripts/backbone/views/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/javascripts/backbone/views/base.js.coffee b/app/assets/javascripts/backbone/views/base.js.coffee deleted file mode 100644 index 45d94bd..0000000 --- a/app/assets/javascripts/backbone/views/base.js.coffee +++ /dev/null @@ -1,4 +0,0 @@ -class Asciinema.Views.Base extends Backbone.View - - current_user: -> - Asciinema.current_user diff --git a/app/assets/javascripts/backbone/views/comments/comments_index.js.coffee b/app/assets/javascripts/backbone/views/comments/comments_index.js.coffee deleted file mode 100644 index 28257b2..0000000 --- a/app/assets/javascripts/backbone/views/comments/comments_index.js.coffee +++ /dev/null @@ -1,33 +0,0 @@ -class Asciinema.Views.CommentsIndex extends Asciinema.Views.Base - - el: '#comments' - - initialize: -> - @collection.on('reset', @addAll, this) - @collection.on('add', @addOne, this) - - $('#new-comment').submit (event) => - @createComment(event) - - addAll: -> - @collection.each (comment) => - @addOne(comment) - - addOne:(comment) -> - view = new Asciinema.Views.CommentEntry({ model: comment, collection: @collection}) - $(this.el).append view.render().el - - createComment: (event) -> - event.preventDefault() - - attrs = body: $('#comment-body').val() - @collection.create attrs, - wait: true - success: -> $('#new-comment')[0].reset() - error: @handleError - - handleError: (comment, response) -> - if response.status == 422 - errors = $.parseJSON(response.responseText).errors - for attribute, messages of errors - alert "#{attribute} #{message}" for message in messages diff --git a/app/views/layouts/_current_user_js.html.erb b/app/views/layouts/_current_user_js.html.erb deleted file mode 100644 index 1cd5903..0000000 --- a/app/views/layouts/_current_user_js.html.erb +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index 93ecc66..4bb125c 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -8,7 +8,6 @@ html[lang="en"] = javascript_include_tag "application" = javascript_include_tag "player" = favicon_link_tag 'favicon.png' - = render :partial => 'layouts/current_user_js' = render :partial => 'layouts/ga' script | window.mainWorkerPath = '#{javascript_path "main_worker"}';