Commit 231f0c10 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Move all settings to Docs.data inside data.js file.

Previously some settings were directly on Docs object, others in
Docs.data - a bit messy.
parent 57cb235a
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -19,7 +19,8 @@ module JsDuck

    # Writes classes, guides, videos, and search data to one big .js file
    def write(filename)
      js = "Docs.data = " + JsonDuck.generate({
      js = "Docs = " + JsonDuck.generate({
        :data => {
          :classes => Icons.new.create(@relations.classes),
          :guides => @guides.to_array,
          :videos => @videos.to_array,
@@ -27,6 +28,10 @@ module JsDuck
          :search => SearchData.new.create(@relations.classes),
          :stats => @opts.stats ? Stats.new.create(@relations.classes) : [],
          :signatureAttributes => Class.signature_attributes,
          :localStorageDb => @opts.local_storage_db,
          :showPrintButton => @opts.seo,
          :touchExamplesUi => @opts.touch_examples_ui,
        }
      }) + ";\n"
      File.open(filename, 'w') {|f| f.write(js) }
    end
+0 −3
Original line number Diff line number Diff line
@@ -34,9 +34,6 @@ module JsDuck
        "{header}" => @opts.header,
        "{footer}" => "<div id='footer-content' style='display: none'>#{@opts.footer}</div>",
        "{extjs_path}" => @opts.extjs_path,
        "{local_storage_db}" => @opts.local_storage_db,
        "{show_print_button}" => @opts.seo ? "true" : "false",
        "{touch_examples_ui}" => @opts.touch_examples_ui ? "true" : "false",
        "{welcome}" => @welcome.to_html,
        "{categories}" => @categories.to_html,
        "{guides}" => @guides.to_html,
+1 −1
Original line number Diff line number Diff line
@@ -6,6 +6,6 @@ Ext.define('Docs.model.Setting', {
    extend: 'Ext.data.Model',
    proxy: {
        type: window['localStorage'] ? 'localstorage' : 'memory',
        id: Docs.localStorageDb + '-settings'
        id: Docs.data.localStorageDb + '-settings'
    }
});
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ Ext.define('Docs.view.Viewport', {
                                    id: 'exampleindex'
                                },
                                {
                                    xtype: Docs.touchExamplesUi ? 'touchexamplecontainer' : 'examplecontainer',
                                    xtype: Docs.data.touchExamplesUi ? 'touchexamplecontainer' : 'examplecontainer',
                                    id: 'example'
                                },
                                {
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ Ext.define('Docs.view.cls.Header', {
                '</a>',
                '{[this.renderAliases(values.aliases)]}',
            '</h1>',
            Docs.showPrintButton ? '<a class="print" href="?print=/api/{name}" target="_blank">Print</a>' : '',
            Docs.data.showPrintButton ? '<a class="print" href="?print=/api/{name}" target="_blank">Print</a>' : '',
            {
                getClass: function(cls) {
                    if (cls.component) {
Loading