Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/javascripts/application.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
39 changes: 19 additions & 20 deletions app/assets/stylesheets/_comment_content.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
23 changes: 1 addition & 22 deletions app/assets/stylesheets/api.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -81,7 +77,7 @@
}

.juvia-comment-content,
.juvia-preview-conten {
.juvia-preview-content {
@include CommentContent;
}

Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/help/_code.txt.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
4 changes: 2 additions & 2 deletions app/views/api/base.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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())
Expand Down
11 changes: 6 additions & 5 deletions app/views/layouts/_custom.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->

<head>
<base href="<%= root_path %>">
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" />
<meta charset="utf-8" />

<title><% if @title %><%= @title %> - <% end %>Juvia</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="shortcut icon" href="<%= root_path %>favicon.ico" />

<!-- The Columnal Grid (1140px wide base, load first), Type and image presets, and mobile stylesheet -->
<%= stylesheet_link_tag 'columnal' %>
Expand Down Expand Up @@ -50,9 +51,9 @@
<div class="row">
<div id="site_logo" class="col_5 clearleft">
<a href="http://www.phusion.nl/" class="product_creator">Phusion</a>
<a href="/" class="product_logo"><%= image_tag 'logo-96.png', :width => 96, :height => 61, :alt => "Logo" %></a>
<a href="/" class="product_name">Juvia</a>
<a href="/" class="product_desc">commenting system</a>
<a href="<%= root_path %>" class="product_logo"><%= image_tag 'logo-96.png', :width => 96, :height => 61, :alt => "Logo" %></a>
<a href="<%= root_path %>" class="product_name">Juvia</a>
<a href="<%= root_path %>" class="product_desc">commenting system</a>
</div>
<nav class="col_7 omega">
<% if user_signed_in? %>
Expand All @@ -61,7 +62,7 @@
<% else %>
<div><%= link_to 'Login', new_user_session_path %></div>
<% end %>
<div><a href="/admin/help" class="<%= maybe_active(:help) %>">Help</a></div>
<div><a href="<%= admin_help_path %>" class="<%= maybe_active(:help) %>">Help</a></div>
<% if user_signed_in? %>
<div><%= link_to 'Logout', destroy_user_session_path, :method => :delete %></div>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
put 'admin/dashboard/create_admin', :to => 'admin/dashboard#create_admin'
get 'admin/dashboard/new_site', :to => 'admin/dashboard#new_site'
put 'admin/dashboard/create_site', :to => 'admin/dashboard#create_site'
get 'admin/help(/:action)', :to => 'admin/help'
get 'admin/help(/:action)', :to => 'admin/help', :as => :admin_help

match 'test/:action', :to => 'test' if Rails.env.test?

Expand Down