Commit 2c04aeec authored by limscoder's avatar limscoder
Browse files

Resolved merge conflicts.

parents d0402d1e f13ab7b2
Loading
Loading
Loading
Loading
+9 −25
Original line number Diff line number Diff line
@@ -177,9 +177,9 @@ class JsDuckRunner
  def add_ext4
    @options += [
      "--title", "Sencha Docs - Ext JS 4.0",
      "--footer", "Ext JS 4.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> VERSION. <a href='http://www.sencha.com/legal/terms-of-use/'>Terms of Use</a>",
      "--footer", "Ext JS 4.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> {VERSION}. <a href='http://www.sencha.com/legal/terms-of-use/'>Terms of Use</a>",
      "--ignore-global",
      "--no-warnings",
      "--warnings", "-all",
      "--images", "#{EXT_BUILD}/docs/doc-resources",
      "--local-storage-db", "ext-4",
      "--output", "#{OUT_DIR}",
@@ -187,19 +187,6 @@ class JsDuckRunner
    ]
  end

  def add_doctest
    @options += [
      "--title", "Sencha Docs - Ext JS 4.0",
      "--footer", "Ext JS 4.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> VERSION. <a href='http://www.sencha.com/legal/terms-of-use/'>Terms of Use</a>",
      "--ignore-global",
      "--images", "#{OUT_DIR}/docs/doc-resources",
      "--local-storage-db", "ext-4",
      "--output", "#{OUT_DIR}",
      "#{EXT_BUILD}/src",
      "--doctests"
    ]
  end

  def add_phone_redirect
    @options += ["--body-html", <<-EOHTML]
      <script type="text/javascript">
@@ -393,19 +380,16 @@ task :ext4, [:mode] => :sass do |t, args|
  runner.run
end

desc "Run JSDuck with example test hacks\n" +
     "doctest             - creates debug/development version\n" +
     "doctest[export]     - creates export/deployable version\n"
task :doctest, [:mode] => :sass do |t, args|
  mode = args[:mode] || "debug"
  throw "Unknown mode #{mode}" unless ["debug", "export"].include?(mode)
  compress if mode == "export"

desc "Run JSDuck with example test hacks"
task :doctests => :sass do |t, args|
  runner = JsDuckRunner.new
  runner.add_doctest
  runner.add_debug if mode == "debug"
  runner.add_ext4
  runner.add_options(["--doctests"])
  runner.add_debug
  runner.add_seo
  runner.run

  runner.copy_extjs_build
end

desc "Run JSDuck on official Ext JS 3.4 build\n" +
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ module JsDuck
          :examples => @assets.examples.to_array,
          :search => SearchData.new.create(@relations.classes, @assets),
          :stats => @opts.stats ? Stats.new.create(@relations.classes) : [],
          :doctests => @opts.doctests ? @relations.classes.collect {|cls| cls[:name]} : [],
          :doctests => @opts.doctests,
          :signatures => MetaTagRegistry.instance.signatures,
          :localStorageDb => @opts.local_storage_db,
          :showPrintButton => @opts.seo,
+13 −21
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
 */
Ext.define('Docs.controller.DocTests', {
    extend: 'Docs.controller.Content',
    requires: ['Ext.data.Store', 'Docs.model.DocTest'],

    /**
     * @cfg
@@ -36,10 +35,6 @@ Ext.define('Docs.controller.DocTests', {
            ref: 'index',
            selector: '#doctestsindex'
        },
        {
            ref: 'docTestGrid',
            selector: '#doctestgrid'
        },
        {
            ref: 'testContainer',
            selector: '#testcontainer'
@@ -50,8 +45,8 @@ Ext.define('Docs.controller.DocTests', {
        this.addEvents('loadIndex');

        this.control({
            '#doctestgrid': {
                afterrender: this.onGridAfterRender,
            '#doctestsgrid': {
                afterrender: this.onGridAfterRender
            }
        });
    },
@@ -77,15 +72,14 @@ Ext.define('Docs.controller.DocTests', {
     * @private
     */
    locateExamples: function(store) {
        this.clssLeft = Docs.data.doctests.length;
        this.classesLeft = Docs.data.classes.length;
        this.getTestContainer().setDisabled(true);
        store.suspendEvents();
        store.removeAll();
        Ext.each(Docs.data.doctests, function(cls) {
        Ext.each(Docs.data.classes, function(cls) {
            var task = new Ext.util.DelayedTask(function() {
                this.locateClsExamples(store, cls);
                this.locateClsExamples(store, cls.name);
            }, this);
            task.delay(0)
            task.delay(0);
        }, this);
    },

@@ -123,10 +117,8 @@ Ext.define('Docs.controller.DocTests', {
                    });
                }, this);

                this.clssLeft--;
                if (this.clssLeft === 0) {
                    store.resumeEvents();
                    store.fireEvent('datachanged', store, {});
                this.classesLeft--;
                if (this.classesLeft === 0) {
                    this.getTestContainer().setDisabled(false);
                }
            },
+13 −12
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 */
Ext.define('Docs.view.doctests.Index', {
    extend: 'Ext.container.Container',
    requires: ['Ext.String.format', 'Ext.data.Store', 'Docs.model.DocTest'],
    requires: ['Docs.model.DocTest'],
    alias: 'widget.doctestsindex',

    layout: {
@@ -51,7 +51,7 @@ Ext.define('Docs.view.doctests.Index', {
                },
                {
                    xtype: 'grid',
                    itemId: 'doctestgrid',
                    itemId: 'doctestsgrid',
                    title: 'Doc Tests',
                    padding: '5 0 5 0',
                    autoScroll: true,
@@ -98,7 +98,7 @@ Ext.define('Docs.view.doctests.Index', {
        var runAllButton = Ext.ComponentQuery.query('#runallbutton', this)[0];
        runAllButton.on('click', this.onRunAllButtonClick, this);

        var testGrid = Ext.ComponentQuery.query('#doctestgrid', this)[0];
        var testGrid = Ext.ComponentQuery.query('#doctestsgrid', this)[0];
        testGrid.on('itemclick', this.onRunLinkClick, this, {
            delegate: '.doc-test-run',
            stopEvent: true
@@ -111,8 +111,7 @@ Ext.define('Docs.view.doctests.Index', {
     * @return {Object}
     */
    getTab: function() {
        var enabled = !Ext.isEmpty(Docs.data.doctests);
        return enabled ? {cls: 'doctests', href: '#!/doctests', tooltip: 'DocTests'} : false;
        return Docs.data.doctests ? {cls: 'doctests', href: '#!/doctests', tooltip: 'DocTests'} : false;
    },

    /**
@@ -137,7 +136,7 @@ Ext.define('Docs.view.doctests.Index', {
        var example = testRunner.add(
            Ext.create('Docs.view.examples.Inline', {
                cls: 'doc-test-preview',
                value: Ext.String.htmlDecode(Ext.util.Format.stripTags(record.get('code'))),
                value: Ext.String.htmlDecode(Ext.util.Format.stripTags(record.get('code')))
            })
        );

@@ -195,7 +194,7 @@ Ext.define('Docs.view.doctests.Index', {
        this.runExample({
            pass: 0,
            fail: 0,
            examples: [record],
            examples: [record]
        });
    },
   
@@ -228,6 +227,7 @@ Ext.define('Docs.view.doctests.Index', {
    onPreviewSuccess: function(preview, options, record, config) {
        this.clearTestRunner();
        record.set('status', '<span class="doc-test-success">pass</span>');
        record.commit();
        config.pass++;
        this.showResult(config);
        
@@ -256,6 +256,7 @@ Ext.define('Docs.view.doctests.Index', {
        }

        record.set('message', '(exception logged to console): ' + e.toString());
        record.commit();
        config.fail++;
        this.showResult(config);

+9 −14
Original line number Diff line number Diff line
// Styles for doc tests
.doc-test-preview {
 display: none;
}
  display: none; }

.doc-test-ready {
  font-weight: bold;
 color: #333;
}
  color: #333; }

.doc-test-error {
  font-weight: bold;
 color: orange;
}
  color: orange; }

.doc-test-failure {
  font-weight: bold;
 color: red;
}
  color: red; }

.doc-test-success {
  font-weight: bold;
 color: green;
}
 No newline at end of file
  color: green; }
+1 −1

File changed.

Contains only whitespace changes.

+3 −3

File changed.

Contains only whitespace changes.

+8 −8

File changed.

Contains only whitespace changes.

Loading