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/assets/stylesheets/_comment_content.scss b/app/assets/stylesheets/_comment_content.scss index 0cc94773..1820d80c 100644 --- a/app/assets/stylesheets/_comment_content.scss +++ b/app/assets/stylesheets/_comment_content.scss @@ -1,22 +1,21 @@ @mixin CommentContent() { - p { - margin-top: 1em; - margin-bottom: 1em; - } - - pre { - background: #eeeeee; - border: solid 1px #dddddd; - margin-left: 1em; - margin-right: 1em; - margin-top: 1em; - margin-bottom: 1em; - padding: 6px; - font-size: 85%; - overflow: auto; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - } -} + p { + margin-top: 1em; + margin-bottom: 1em; + } + pre { + background: #eeeeee; + border: solid 1px #dddddd; + margin-left: 1em; + margin-right: 1em; + margin-top: 1em; + margin-bottom: 1em; + padding: 6px; + font-size: 85%; + overflow: auto; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + } +} diff --git a/app/assets/stylesheets/api.scss b/app/assets/stylesheets/api.scss index db795f36..15803f7d 100644 --- a/app/assets/stylesheets/api.scss +++ b/app/assets/stylesheets/api.scss @@ -3,10 +3,6 @@ @import "comment_content"; .juvia-container { - font-family: 'Helvetica', 'Arial', 'Sans Serif'; - font-size: 11pt; - line-height: normal; - // Override conflicting styles from some websites. h1, h2, h3, h4 { float: none; @@ -81,7 +77,7 @@ } .juvia-comment-content, -.juvia-preview-conten { +.juvia-preview-content { @include CommentContent; } @@ -156,23 +152,6 @@ border: solid 1px #ffeebb; margin-bottom: 1em; padding: 8px; - - p { - margin-top: 1em; - margin-bottom: 1em; - } - - pre, code { - background: inherit; - font-weight: normal; - border: none; - margin: 0; - padding: 0; - } - - pre { - margin: 1em; - } } .juvia-preview-content > *:first-child { 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 @@
+