Commit f61d339e authored by Nick Poulden's avatar Nick Poulden
Browse files

Merge branch 'master' into comments

parents b3357054 a2cec13b
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
@@ -196,6 +196,7 @@ class JsDuckRunner
      "--videos", "#{@sdk_dir}/extjs/docs/videos.json",
      "--examples", "#{@sdk_dir}/extjs/examples/examples.json",
      "--categories", "#{@sdk_dir}/extjs/docs/categories.json",
      "--local-storage-db", "ext-4",
      "--output", "#{@out_dir}",
      "--builtin-classes",
      "--images", "#{@sdk_dir}/extjs/docs/resources",
@@ -217,6 +218,7 @@ class JsDuckRunner
      "--footer", "Ext JS 3.4 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
      "--categories", "#{@sdk_dir}/../ext-3.4.0/src/categories.json",
      "--ignore-global",
      "--local-storage-db", "ext-3",
      "--output", "#{@out_dir}",
      "#{@sdk_dir}/../ext-3.4.0/src/core",
      "#{@sdk_dir}/../ext-3.4.0/src/data",
@@ -236,6 +238,7 @@ class JsDuckRunner
      "--ignore-global",
      "--no-warnings",
      "--images", "#{@ext_dir}/docs/doc-resources",
      "--local-storage-db", "ext-4",
      "--output", "#{@out_dir}",
      "#{@ext_dir}/src",
    ]
@@ -253,6 +256,7 @@ class JsDuckRunner
      "--footer", "Sencha Touch 1.1 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
      "--categories", "#{@sdk_dir}/touch/doc-resources/categories.json",
      "--videos", "#{@sdk_dir}/touch/doc-resources/videos.json",
      "--local-storage-db", "touch-1",
      "--output", "#{@out_dir}",
      "--external=google.maps.Map,google.maps.LatLng",
      "--images", "#{@sdk_dir}/touch/doc-resources",
@@ -279,10 +283,12 @@ class JsDuckRunner
      "--guides", "#{@sdk_dir}/touch/docs/guides.json",
      "--examples", "#{@sdk_dir}/touch/docs/examples.json",
      "--touch-examples-ui",
      "--local-storage-db", "touch-2",
      "--output", "#{@out_dir}",
      "--external=google.maps.Map,google.maps.LatLng",
      "--builtin-classes",
      "--img", "<p class='screenshot'><img src='%u' alt='%a'><span>%a</span></p>",
      "--eg-iframe", "template/touch-iframe.html",
      "#{@sdk_dir}/touch/resources/themes/stylesheets/sencha-touch/default",
    ]

@@ -353,12 +359,33 @@ class JsDuckRunner
      "--categories", "#{@sdk_dir}/charts/docs/categories.json",
      "--guides", "#{@sdk_dir}/charts/docs/guides.json",
      "--images", "#{@sdk_dir}/charts/docs/resources",
      "--local-storage-db", "touch-charts",
      "--output", "#{@out_dir}"
    ]

    @options += extract_jsb_build_files("#{@sdk_dir}/charts/touch-charts.jsb3")
  end

  def add_sencha_io
    head_html = <<-EOHTML
      <link rel="canonical" href="http://docs.sencha.com/sencha-io/1-0/" />
      <meta name="description" content="Sencha.io 1.0 API Documentation. Documentation on how to use the Sencha.io SDK" />
    EOHTML

    @options += [
      "--title", "Sencha Docs - IO 1.0",
      "--head-html", head_html,
      "--footer", "Sencha.io 1.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a>",
      "--guides", "#{@sdk_dir}/../sync/docs/guides.json",
      "--images", "#{@sdk_dir}/../sync/docs/resources",
      "--local-storage-db", "sencha-io",
      "--ignore-global",
      "--output", "#{@out_dir}"
    ]

    @options += extract_jsb_build_files("#{@sdk_dir}/../sync/sencha-io.jsb3")
  end

  def add_animator
    head_html = <<-EOHTML
      <link rel="canonical" href="http://docs.sencha.com/animator/1-0/" />
@@ -372,6 +399,7 @@ class JsDuckRunner
      # "--videos", "#{@animator_dir}/docs/videos.json",
      "--guides", "#{@animator_dir}/docs/guides.json",
      # "--examples", "#{@animator_dir}/docs/examples/examples.json",
      "--local-storage-db", "animator",
      "--output", "#{@out_dir}",
    ]
  end
@@ -644,6 +672,23 @@ task :charts, [:mode] => :sass do |t, args|
  runner.run
end

desc "Run JSDuck on Sencha.IO Sync (for internal use at Sencha)\n" +
     "senchaio         - creates debug/development version\n" +
     "senchaio[export] - create live version for deployment\n"
     "senchaio[live]   - create live version for deployment\n"
task :senchaio, [:mode] => :sass do |t, args|
  mode = args[:mode] || "debug"
  throw "Unknown mode #{mode}" unless ["debug", "export", "live"].include?(mode)
  compress if mode == "live"

  runner = JsDuckRunner.new
  runner.add_sencha_io
  runner.add_debug if mode == "debug"
  runner.add_seo if mode == "debug" || mode == "live"
  runner.add_google_analytics if mode == "live"
  runner.run
end

desc "Run JSDuck JSON Export (for internal use at Sencha)\n" +
     "export[touch]  - creates export for Touch 1\n" +
     "export[touch2] - creates export for Touch 2"
+3 −0
Original line number Diff line number Diff line
@@ -96,6 +96,9 @@ module JsDuck
          FileUtils.rm(@opts.output_dir+"/index.php")
          FileUtils.cp(@opts.output_dir+"/template.html", @opts.output_dir+"/index.html")
        end
        if @opts.eg_iframe
          FileUtils.cp(@opts.eg_iframe, @opts.output_dir+"/eg-iframe.html")
        end
        write_src(parsed_files)
        format_classes
        write_app_data
+8 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ module JsDuck
    attr_accessor :img_tpl
    attr_accessor :export
    attr_accessor :seo
    attr_accessor :eg_iframe

    # Debugging
    attr_accessor :processes
@@ -95,6 +96,7 @@ module JsDuck
      @img_tpl = '<p><img src="%u" alt="%a"></p>'
      @export = nil
      @seo = false
      @eg_iframe = nil

      # Debugging
      # Turn multiprocessing off by default in Windows
@@ -259,6 +261,12 @@ module JsDuck
          @seo = true
        end

        opts.on('--eg-iframe=PATH',
          "An HTML file to use inside an iframe",
          "to display inline examples.", " ") do |path|
          @eg_iframe = canonical(path)
        end

        opts.separator "Debugging:"
        opts.separator ""

+1 −3
Original line number Diff line number Diff line
@@ -163,8 +163,6 @@ module JsDuck
    def render_member(m, is_first)
      # use classname "first-child" when it's first member in its category
      first_child = is_first ? "first-child" : ""
      # use classname "expandable" when member has shortened description
      expandable = m[:shortDoc] ? "expandable" : "not-expandable"
      # shorthand to owner class
      owner = m[:owner]
      # use classname "inherited" when member is not defined in this class
@@ -173,7 +171,7 @@ module JsDuck
      return [
        "<div id='#{m[:id]}' class='member #{first_child} #{inherited}'>",
          # leftmost column: expand button
          "<a href='#' class='side #{expandable}'>",
          "<a href='#' class='side expandable'>",
            "<span>&nbsp;</span>",
          "</a>",
          # member name and type + link to owner class and source
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ Ext.define("Docs.LocalStore", {
    // Removes all extra stuff from localstorage that isn't needed any
    // more. Like old favorites and mistakenly created '{local_storage_db}...' keys.
    cleanup: function() {
        var re = new RegExp("^" + Ext.escapeRe(Docs.localStorageDb + '-settings'));
        var re = /-settings/;
        // remove all entries from localstorage where key doesn't match the regex
        for (var i=0; i<window.localStorage.length; i++) {
            var key = window.localStorage.key(i);
Loading