Commit 074b8d46 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Merge remote branch 'origin/master'

parents d946dfda 1ca7bddb
Loading
Loading
Loading
Loading
+91 −1
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ class JsDuckRunner
    @sdk_dir = SDK_DIR
    @out_dir = OUT_DIR
    @ext_dir = EXT_DIR
    @animator_dir = ANIMATOR_DIR
  end

  def add_options(options)
@@ -204,6 +205,44 @@ class JsDuckRunner
    @options += extract_jsb_build_files("#{@sdk_dir}/touch/sencha-touch.jsb3")
  end

  def add_touch2
    head_html = <<-EOHTML
      <link rel="canonical" href="http://docs.sencha.com/touch/2-0/" />
      <meta name="description" content="Sencha Touch 2.0 API Documentation from Sencha. Documentation on how to create Javascript applications with Sencha Touch">
    EOHTML

    @options += [
      "--title", "Sencha Docs - Touch 2.0",
      "--head-html", head_html,
      "--footer", "Sencha Touch 2.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
      "--categories", "#{@sdk_dir}/touch/docs/categories.json",
      "--videos", "#{@sdk_dir}/touch/docs/videos.json",
      "--output", "#{@out_dir}",
      "--external=google.maps.Map,google.maps.LatLng",
      "#{@sdk_dir}/touch/resources/themes/stylesheets/sencha-touch/default",
    ]

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

  def add_animator
    head_html = <<-EOHTML
      <link rel="canonical" href="http://docs.sencha.com/animator/1-0/" />
      <meta name="description" content="Sencha Animator 1.0 API Documentation from Sencha. Documentation on how to create Javascript applications with Sencha Touch">
    EOHTML

    @options += [
      "--title", "Sencha Docs - Animator 1.0",
      "--head-html", head_html,
      "--footer", "Sencha Animator 1.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
      "--videos", "#{@animator_dir}/docs/videos.json",
      "--guides", "#{@animator_dir}/docs/guides.json",
      "--examples", "#{@animator_dir}/docs/examples/examples.json",
      "--output", "#{@out_dir}",
      "#{@animator_dir}/docs/docs"
    ]
  end

  # Extracts files of first build in jsb file
  def extract_jsb_build_files(jsb_file)
    json = JSON.parse(IO.read(jsb_file))
@@ -308,6 +347,16 @@ class JsDuckRunner
    system "cp -r #{@sdk_dir}/touch/doc-resources #{@out_dir}/doc-resources"
  end

  # Copy over the images that Sencha Touch documentation links to.
  def copy_touch2_images
    system "cp -r #{@sdk_dir}/touch/docs/resources #{@out_dir}/doc-resources"
  end

  # Copy over the images that Animator documentation links to.
  def copy_animator_images
    system "cp -r #{@animator_dir}/docs/resources #{@out_dir}/doc-resources"
  end

  # Copy over SDK examples
  def copy_sdk_examples
    system "mkdir #{@out_dir}/extjs/builds"
@@ -317,6 +366,11 @@ class JsDuckRunner
    system "cp -r #{@ext_dir}/welcome #{@out_dir}/extjs"
  end

  def copy_animator_examples
    system "mkdir -p #{@out_dir}/extjs"
    system "cp -r #{@animator_dir}/docs/examples #{@out_dir}/extjs"
  end

  def run
    # Pass multiple arguments to system, so we'll take advantage of the built-in escaping
    system(*["ruby", "bin/jsduck"].concat(@options))
@@ -347,7 +401,7 @@ task :sdk, [:mode] => :sass do |t, args|
  runner.add_sdk
  runner.add_debug if mode == "debug"
  runner.add_seo if mode == "debug" || mode == "live"
  runner.add_sdk_export_notice if mode == "export"
  runner.add_export_notice if mode == "export"
  runner.add_google_analytics if mode == "live"
  runner.run

@@ -390,6 +444,42 @@ task :touch, [:mode] => :sass do |t, args|
  runner.copy_touch_images
end

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

  runner = JsDuckRunner.new
  runner.add_touch2
  runner.add_debug if mode == "debug"
  runner.add_seo if mode == "debug" || mode == "live"
  runner.run

  runner.copy_touch2_images
end

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

  runner = JsDuckRunner.new
  runner.add_animator
  runner.add_debug if mode == "debug"
  runner.add_seo if mode == "debug" || mode == "live"
  runner.run

  runner.copy_animator_images
  runner.copy_animator_examples
end

desc "Build JSDuck gem"
task :gem => :sass do
  compress
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ Ext.define('Docs.controller.Classes', {
        );

        Ext.getBody().addListener('click', function(event, el) {
            this.handleUrlClick(el.href, event);
            this.handleUrlClick(decodeURI(el.href), event);
        }, this, {
            preventDefault: true,
            delegate: '.docClass'
+2 −0
Original line number Diff line number Diff line
@@ -286,6 +286,7 @@ Ext.define('Docs.view.Tabs', {
        docTab.dom.removed = true;
        if (Ext.isIE) {
            docTab.remove();
            this.createOverflow();
        } else {
            docTab.animate({
                to: { top: 30 },
@@ -297,6 +298,7 @@ Ext.define('Docs.view.Tabs', {
                    afteranimate: function() {
                        docTab.remove();
                        this.shouldResize = true;
                        this.createOverflow();
                    },
                    scope: this
                }