Commit ec72e3cb authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Merge branch 'master' into comments-refactor

parents 1af6d26d 0b5eaec0
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -94,6 +94,14 @@ def combine_js(html, dir)
  html.sub(js_section_re, '<script type="text/javascript" src="app.js"></script>')
end

# Modifies HTML to link app.css.
# Doesn't modify the linked CSS files.
def rewrite_css_links(dir, filename)
  html = IO.read(dir + "/" + filename);
  html = combine_css(html, dir, :replace_html_only)
  File.open(dir + "/" + filename, 'w') {|f| f.write(html) }
end

# Compress JavaScript and CSS files of JSDuck
def compress
  load_sdk_vars
@@ -118,12 +126,9 @@ def compress
  # Remove the entire app/ dir
  system("rm", "-r", "#{dir}/app")

  # Concatenate CSS in print-template.html file
  print_template = "#{dir}/print-template.html";
  html = IO.read(print_template);
  # Just modify HTML to link app.css, don't write files.
  html = combine_css(html, dir, :replace_html_only)
  File.open(print_template, 'w') {|f| f.write(html) }
  # Change CSS links in print-template.html and index-template.html files
  rewrite_css_links(dir, "print-template.html")
  rewrite_css_links(dir, "index-template.html")

  # Concatenate CSS and JS files referenced in template.html file
  template_html = "#{dir}/template.html"
+2 −1
Original line number Diff line number Diff line
@@ -198,7 +198,8 @@ app.post('/auth/:sdk/:version/comments/:commentId/delete', Auth.isLoggedIn, Auth

// Restores a deleted comment
app.post('/auth/:sdk/:version/comments/:commentId/undo_delete', Auth.isLoggedIn, Auth.canModify, function(req, res) {
    new Request(req).setDeleted(req.params.commentId, false, function() {
    var r = new Request(req);
    r.setDeleted(req.params.commentId, false, function() {
        r.getComment(req.params.commentId, function(comment) {
            res.send({ success: true, comment: comment });
        });
+2 −2
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@ Gem::Specification.new do |s|
  s.required_rubygems_version = ">= 1.3.5"

  s.name = 'jsduck'
  s.version = '4.1.1'
  s.date = '2012-09-14'
  s.version = '4.2.0'
  s.date = '2012-10-01'
  s.summary = "Simple JavaScript Duckumentation generator"
  s.description = "Documentation generator for Sencha JS frameworks"
  s.homepage = "https://github.com/senchalabs/jsduck"
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ module JsDuck
        end

        # remember properties that have changed to configs
        if m[:tagname] != parent[:tagname]
        if m[:autodetected] && m[:tagname] != parent[:tagname]
          new_cfgs << m
        end
      end
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ module JsDuck
      @ext4_events = nil
      @meta_tag_paths = []

      @version = "4.1.1"
      @version = "4.2.0"

      # Customizing output
      @title = "Documentation - JSDuck"
Loading