-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override breaks javascript load order #5
Comments
Related to #4.
|
Could you tell me the commit hashes for both monologue and monologue-markdown where both projects are working correctly? Perhaps you could have a look on your blog's Gemfile.lock ? I'd like to use this as the basis of my diff/patch, and figure out what went wrong from there. |
monologue-markdown -> b1bad45 (in |
Thanks for your time on this @International, I really appreciate it! |
@jipiboily using the version you specified does not perform any syntax highlighting. I was however able to get some colouring by doing the following modification in the monologue-markdown gem ( based on b1bad45 ): Deface::Override.new(:virtual_path => "layouts/monologue/application",
:name => "insert_coderay_assets_in_layout",
:insert_bottom => "head",
:partial => "monologue-markdown/overrides/assets") where the assets partial has the following: <%= stylesheet_link_tag "monologue-markdown/code-highlighting" %> But I seem to be getting into the same problem with leading spaces. I may be doing something extremely moronic, but I can't see to figure out what that is. No matter what I do, I keep getting some leading spaces, which get syntax highlighted as some kind of errors. A sample code that could reproduce the leading spaces problem is this, taken from http://datatables.net/plug-ins/sorting jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"date-eu-pre": function ( date ) {
var date = date.replace(" ", "");
if (date.indexOf('.') > 0) {
/*date a, format dd.mn.(yyyy) ; (year is optional)*/
var eu_date = date.split('.');
} else {
/*date a, format dd/mn/(yyyy) ; (year is optional)*/
var eu_date = date.split('/');
}
/*year (optional)*/
if (eu_date[2]) {
var year = eu_date[2];
} else {
var year = 0;
}
/*month*/
var month = eu_date[1];
if (month.length == 1) {
month = 0+month;
}
/*day*/
var day = eu_date[0];
if (day.length == 1) {
day = 0+day;
}
return (year + month + day) * 1;
},
"date-eu-asc": function ( a, b ) {
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
},
"date-eu-desc": function ( a, b ) {
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
}); Could you give any hints as to why this is? |
I can't get the first issue reproduced. For the second one, I might just be not still be awaken enough, but I really don't understand the problem with dates and monologue-markdown :S |
FYI, Monologue 0.3.0 is about to be released (https://github.com/jipiboily/monologue/tree/0-3-stable) and works with monologue-markdown's master...:) |
Mmmm ... are you sure? If I use the following: 0-3-stable and monologue-markdown master ( 5cc4f ), I receive a migration error: == AddIsMarkownToPostsRevision: migrating ====================================
-- add_column(:monologue_posts_revisions, :is_markdown, :boolean)
rake aborted!
An error has occurred, this and all later migrations canceled:
PG::Error: ERROR: relation "monologue_posts_revisions" does not exist 20130916182947_create_monologue_posts_revisions.monologue.rb If I remove 20130916184101_merge_markdown_revisions_into_posts.monologue_markdown.rb, and modify the other migration to this: class AddIsMarkownToPostsRevision < ActiveRecord::Migration
def up
add_column :monologue_posts, :is_markdown, :boolean
::Monologue::Post.update_all(:is_markdown => false)
end
def down
remove_column :monologue_posts, :is_markdown
end
end then I can get them to pass. |
Using the latest version of monologue-markdown does not load the markdown editor. The error is:
ReferenceError: $ is not defined
After an investigation, I found the following being generated in the view:
Due to some parsing errors ( see spree/deface#84 and spree/deface#105 ), deface considers this to be it's DOM:
With this internal representation:
By bumping the version of deface to 1.0.0.rc4 the editor appears, and preview works, and the JS error disappears. However, after creating a post, the markdown isn't preserved. I will continue looking into that, and update once I've found the issue.
The text was updated successfully, but these errors were encountered: