diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 75d5074f..fe2365e4 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -10,7 +10,7 @@ reinstallBehavior = (context)-> textarea.delayedObserver -> callback = (html)-> $('.preview .content', form).html(html) - $.get('/admin/comments/preview', content: textarea.val(), callback) + $.get('./admin/comments/preview', content: textarea.val(), callback) $(document).ready -> reinstallBehavior() diff --git a/app/views/admin/help/_code.txt.erb b/app/views/admin/help/_code.txt.erb index 1bf3a714..f77a65ce 100644 --- a/app/views/admin/help/_code.txt.erb +++ b/app/views/admin/help/_code.txt.erb @@ -30,7 +30,7 @@ } var result = - '<%= request.protocol %><%= request.host_with_port %>/api/show_topic.js' + + '//<%= request.host_with_port %><%= root_path %>api/show_topic.js' + '?_c=' + window._juviaRequestCounter + '&' + makeQueryString(options); window._juviaRequestCounter++; diff --git a/app/views/api/base.js.erb b/app/views/api/base.js.erb index cfab4730..63b1120e 100644 --- a/app/views/api/base.js.erb +++ b/app/views/api/base.js.erb @@ -228,7 +228,7 @@ if (!Juvia) { var $container = $(form).closest('.juvia-container'); this.setSubmitting($container, true); this.saveCommentBox($container); - this.loadScript('/api/add_comment', { + this.loadScript('<%= root_path %>api/add_comment', { site_key : $container.data('site-key'), topic_key : $container.data('topic-key'), topic_title : $container.data('topic-title'), @@ -242,7 +242,7 @@ if (!Juvia) { Juvia.previewComment = function(formElement) { var $container = $(formElement).closest('.juvia-container'); this.saveCommentBox($container); - this.loadScript('/api/preview_comment', { + this.loadScript('<%= root_path %>api/preview_comment', { site_key : $container.data('site-key'), topic_key: $container.data('topic-key'), content : this.compress($('textarea[name="content"]', $container).val()) diff --git a/app/views/layouts/_custom.html.erb b/app/views/layouts/_custom.html.erb index 8c56749b..ad6c19e5 100644 --- a/app/views/layouts/_custom.html.erb +++ b/app/views/layouts/_custom.html.erb @@ -6,13 +6,14 @@
+