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

Add --local-storage-db option.

parent 438c1029
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -158,6 +158,12 @@ opts = OptionParser.new do | opts |
    app.extjs_path = path
  end

  opts.on('--local-storage-db=NAME',
    "Prefix for LocalStorage database names.",
    "Defaults to 'docs'.", " ") do |name|
    app.local_storage_db = name
  end

  opts.on('-h', '--help', "Prints this help message", " ") do
    puts opts
    exit
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ module JsDuck
    attr_accessor :title
    attr_accessor :footer
    attr_accessor :extjs_path
    attr_accessor :local_storage_db
    attr_accessor :head_html
    attr_accessor :body_html

@@ -61,6 +62,7 @@ module JsDuck
      @title = "Ext JS API Documentation"
      @footer = 'Generated with <a href="https://github.com/senchalabs/jsduck">JSDuck</a>.'
      @extjs_path = "extjs/ext-all.js"
      @local_storage_db = "docs"
      @head_html = ""
      @body_html = ""
      @timer = Timer.new
@@ -285,6 +287,7 @@ module JsDuck
      html.gsub!("{title}", @title)
      html.gsub!("{footer}", "<div id='footer-content' style='display: none'>#{@footer}</div>")
      html.gsub!("{extjs_path}", @extjs_path)
      html.gsub!("{local_storage_db}", @local_storage_db)
      html.gsub!("{guides}", @guides.to_html)
      html.gsub!("{categories}", @categories.to_html)
      html.gsub!("{head_html}", @head_html)
+1 −1
Original line number Diff line number Diff line
@@ -6,6 +6,6 @@ Ext.define('Docs.model.Favorite', {
    extend: 'Ext.data.Model',
    proxy: {
        type: ('localStorage' in window && window['localStorage'] !== null) ? 'localstorage' : 'memory',
        id  : 'docs-favorites'
        id: Docs.localStorageDb + '-favorites'
    }
});
+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: ('localStorage' in window && window['localStorage'] !== null) ? 'localstorage' : 'memory',
        id  : 'docs-settings'
        id: Docs.localStorageDb + '-settings'
    }
});
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
  <script type="text/javascript" src="{extjs_path}"></script>
  <script type="text/javascript" src="prettify/prettify.js"></script>

  <script type="text/javascript">Docs = {localStorageDb: "{local_storage_db}"};</script>
  <script type="text/javascript" src="app.js"></script>

  <script type="text/javascript" src="output/tree.js"></script>