jsduck 2.0.pre2 → 2.0.pre4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -159,13 +159,32 @@ reported bugs, submitted patches, and provided a lot of useful input.
159
159
  Changelog
160
160
  ---------
161
161
 
162
+ * 2.0.pre4 - Fixes for the previous pre-release.
163
+ * Paging of search results.
164
+ * Support opening classes in tree in new tabs in IE and Firefox.
165
+ * Include upgraded version of prettifier, fixing formatting in IE.
166
+ * New --head-html and --body-html command line options.
167
+ * New --local-storage-db command line option.
168
+ * Avoid creating case-insensitively same source file names,
169
+ preventing duplicate file conflicts in Windows.
170
+ * Include missing ExtJS image files.
171
+ * Don't exclude static members from singleton classes, simply print
172
+ warning about using @static in singleton class.
173
+
174
+ * 2.0.pre3 - Bogus release, skipped.
175
+
162
176
  * 2.0.pre2 - Fixes for the previous pre-release.
163
177
  * New --stdout command line option.
164
178
  * Fix opening links in new tabs.
165
179
  * Few other small bugfixes and enhancements.
166
180
 
167
181
  * 2.0.pre - Completely overhauled Ext4-themed version.
168
- * Currently in a pre-release state.
182
+ * A lot of changes since 0.6 releases.
183
+
184
+ * 0.6.1 - Bug fixes.
185
+ * Fix scrolling to class members in Chrome 12.
186
+ * Make JSDuck work with Ruby 1.8.6.
187
+ * Upgrade the embedded ExtJS to 3.4.0.
169
188
 
170
189
  * 0.6 - JsDuck is now used for creating the official ExtJS4 documentation.
171
190
  * Automatic linking of class names found in comments. Instead of writing
data/Rakefile CHANGED
@@ -71,10 +71,15 @@ end
71
71
  def run_jsduck_export(extra_options, ext_dir)
72
72
  load_sdk_vars
73
73
  rev = `git rev-parse HEAD`.slice(0, 7)
74
+ head_html = <<-EOHTML
75
+ <link rel="canonical" href="http://docs.sencha.com/ext-js/4-0/" />
76
+ <meta name="description" content="Ext JS 4.0 API Documentation from Sencha. Class documentation, Guides and Videos on how to create Javascript applications with Ext JS 4">
77
+ EOHTML
74
78
 
75
79
  run_jsduck([
76
80
  "--title", "Ext JS 4.0.2a API Documentation",
77
81
  "--footer", "ExtJS 4.0.2a Documentation from Sencha. Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{rev}",
82
+ "--head-html", head_html,
78
83
  "#{SDK_DIR}/extjs/src",
79
84
  "#{SDK_DIR}/platform/src",
80
85
  "#{SDK_DIR}/platform/core/src",
@@ -92,7 +97,7 @@ desc "Run JSDuck on ExtJS SDK to create release version of docs app"
92
97
  task :export do
93
98
  load_sdk_vars
94
99
  run_jsduck_export([
95
- "--append-html", <<-EOHTML
100
+ "--body-html", <<-EOHTML
96
101
  <div id="notice-text" style="display: none">
97
102
  Use <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a> for up to date documentation and features
98
103
  </div>
@@ -104,7 +109,7 @@ desc "Run JSDuck on ExtJS SDK to create live docs app"
104
109
  task :live_docs do
105
110
  load_sdk_vars
106
111
  run_jsduck_export([
107
- "--append-html", <<-EOHTML
112
+ "--body-html", <<-EOHTML
108
113
  <script type="text/javascript">
109
114
  var _gaq = _gaq || [];
110
115
  _gaq.push(['_setAccount', 'UA-1396058-10']);
data/bin/jsduck CHANGED
@@ -71,8 +71,12 @@ opts = OptionParser.new do | opts |
71
71
  app.footer = text
72
72
  end
73
73
 
74
- opts.on('--append-html=HTML', "Extra code to append to the index.html page.", " ") do |html|
75
- app.append_html = html
74
+ opts.on('--head-html=HTML', "HTML to append to the <head> section of index.html.", " ") do |html|
75
+ app.head_html = html
76
+ end
77
+
78
+ opts.on('--body-html=HTML', "HTML to append to the <body> section index.html.", " ") do |html|
79
+ app.body_html = html
76
80
  end
77
81
 
78
82
  opts.on('--guides=PATH', "Path to guides directory.",
@@ -154,6 +158,12 @@ opts = OptionParser.new do | opts |
154
158
  app.extjs_path = path
155
159
  end
156
160
 
161
+ opts.on('--local-storage-db=NAME',
162
+ "Prefix for LocalStorage database names.",
163
+ "Defaults to 'docs'.", " ") do |name|
164
+ app.local_storage_db = name
165
+ end
166
+
157
167
  opts.on('-h', '--help', "Prints this help message", " ") do
158
168
  puts opts
159
169
  exit
data/jsduck.gemspec CHANGED
@@ -2,8 +2,8 @@ Gem::Specification.new do |s|
2
2
  s.required_rubygems_version = ">= 1.3.7"
3
3
 
4
4
  s.name = 'jsduck'
5
- s.version = '2.0.pre2'
6
- s.date = '2011-07-06'
5
+ s.version = '2.0.pre4'
6
+ s.date = '2011-07-15'
7
7
  s.summary = "Simple JavaScript Duckumentation generator"
8
8
  s.description = "Documentation generator for ExtJS 4"
9
9
  s.homepage = "https://github.com/senchalabs/jsduck"
@@ -16,6 +16,10 @@ Gem::Specification.new do |s|
16
16
  end
17
17
  # Add files not in git
18
18
  s.files += ['template/extjs/ext-all.js']
19
+ s.files += ['template/extjs/resources/themes/images/default/tree/arrows.gif']
20
+ s.files += ['template/extjs/resources/themes/images/default/grid/loading.gif']
21
+ s.files += ['template/extjs/resources/themes/images/default/form/text-bg.gif']
22
+ s.files += ['template/extjs/resources/themes/images/default/form/checkbox.gif']
19
23
  s.files += Dir['template/resources/css/*.css']
20
24
 
21
25
  s.executables = ["jsduck"]
data/lib/jsduck/app.rb CHANGED
@@ -40,7 +40,9 @@ module JsDuck
40
40
  attr_accessor :title
41
41
  attr_accessor :footer
42
42
  attr_accessor :extjs_path
43
- attr_accessor :append_html
43
+ attr_accessor :local_storage_db
44
+ attr_accessor :head_html
45
+ attr_accessor :body_html
44
46
 
45
47
  def initialize
46
48
  @output_dir = nil
@@ -60,7 +62,9 @@ module JsDuck
60
62
  @title = "Ext JS API Documentation"
61
63
  @footer = 'Generated with <a href="https://github.com/senchalabs/jsduck">JSDuck</a>.'
62
64
  @extjs_path = "extjs/ext-all.js"
63
- @append_html = ""
65
+ @local_storage_db = "docs"
66
+ @head_html = ""
67
+ @body_html = ""
64
68
  @timer = Timer.new
65
69
  @parallel = ParallelWrap.new
66
70
  end
@@ -281,11 +285,13 @@ module JsDuck
281
285
  Logger.instance.log("Creating #{dir}/index.html...")
282
286
  html = IO.read(template_dir+"/index.html")
283
287
  html.gsub!("{title}", @title)
284
- html.gsub!("{footer}", @footer)
288
+ html.gsub!("{footer}", "<div id='footer-content' style='display: none'>#{@footer}</div>")
285
289
  html.gsub!("{extjs_path}", @extjs_path)
286
- html.gsub!("{append_html}", @append_html)
290
+ html.gsub!("{local_storage_db}", @local_storage_db)
287
291
  html.gsub!("{guides}", @guides.to_html)
288
292
  html.gsub!("{categories}", @categories.to_html)
293
+ html.gsub!("{head_html}", @head_html)
294
+ html.gsub!("{body_html}", @body_html)
289
295
  FileUtils.rm(dir+"/index.html")
290
296
  File.open(dir+"/index.html", 'w') {|f| f.write(html) }
291
297
  end
data/lib/jsduck/class.rb CHANGED
@@ -120,13 +120,28 @@ module JsDuck
120
120
  all_members.delete_if {|key, member| !member[:inheritable] }
121
121
  end
122
122
 
123
- (@doc[context][type] || []).each do |m|
124
- all_members[m[:name]] = m if !m[:private]
123
+ all_members.merge!(local_members_hash(type, context))
124
+
125
+ # If singleton has static members, include them as if they were
126
+ # instance members. Otherwise they will be completely excluded
127
+ # from the docs, as the static members block is not created for
128
+ # singletons.
129
+ if @doc[:singleton] && @doc[:statics][type].length > 0
130
+ all_members.merge!(local_members_hash(type, :statics))
125
131
  end
126
132
 
127
133
  all_members
128
134
  end
129
135
 
136
+ # Helper method to get the direct members of this class
137
+ def local_members_hash(type, context)
138
+ local_members = {}
139
+ (@doc[context][type] || []).each do |m|
140
+ local_members[m[:name]] = m if !m[:private]
141
+ end
142
+ local_members
143
+ end
144
+
130
145
  # Returns member by name.
131
146
  #
132
147
  # Optionally one can also specify type name to differenciate
@@ -26,7 +26,7 @@ module JsDuck
26
26
  def uniq_html_filename(filename)
27
27
  fname = html_filename(filename)
28
28
  nr = 1
29
- while File.exists?(fname)
29
+ while file_exists?(fname)
30
30
  nr += 1
31
31
  fname = html_filename(filename, nr)
32
32
  end
@@ -37,6 +37,12 @@ module JsDuck
37
37
  @output_dir + "/" + File.basename(filename, ".js") + (nr > 0 ? nr.to_s : "") + ".html"
38
38
  end
39
39
 
40
+ # Case-insensitive check for file existance to avoid conflicts
41
+ # when source files dir is moved to Windows machine.
42
+ def file_exists?(filename)
43
+ Dir.glob(filename, File::FNM_CASEFOLD).length > 0
44
+ end
45
+
40
46
  # Returns source wrapped inside HTML page
41
47
  def wrap_page(source)
42
48
  return <<-EOHTML
@@ -10,11 +10,31 @@ Ext.define('Docs.controller.Search', {
10
10
 
11
11
  stores: ['Search'],
12
12
 
13
+ refs: [
14
+ {
15
+ ref: 'field',
16
+ selector: '#search-field'
17
+ }
18
+ ],
19
+
20
+ // Currentl page in search results and nr of items on one page
21
+ pageIndex: 0,
22
+ pageSize: 10,
23
+
13
24
  init: function() {
14
25
  this.control({
15
26
  '#search-dropdown': {
16
27
  itemclick: function(dropdown, record) {
17
28
  this.loadRecord(record);
29
+ },
30
+ changePage: function(dropdown, delta) {
31
+ // don't hide dropdown
32
+ clearTimeout(this.hideTimeout);
33
+ this.getField().focus();
34
+
35
+ // increment page number and update search results display
36
+ this.pageIndex += delta;
37
+ this.search(this.getField().getValue());
18
38
  }
19
39
  },
20
40
  '#search-field': {
@@ -56,6 +76,8 @@ Ext.define('Docs.controller.Search', {
56
76
  record && this.loadRecord(record);
57
77
  }
58
78
  else {
79
+ // A new search - reset paging back to first page
80
+ this.pageIndex = 0;
59
81
  // Wait a bit before actually performing the search.
60
82
  // When user is typing fast, the value of el.value
61
83
  // might not right away be the final value. For example
@@ -81,7 +103,7 @@ Ext.define('Docs.controller.Search', {
81
103
  // badly when you make a long mouse press on
82
104
  // dropdown item.
83
105
  var dropdown = this.getDropdown();
84
- Ext.Function.defer(dropdown.hide, 500, dropdown);
106
+ this.hideTimeout = Ext.Function.defer(dropdown.hide, 500, dropdown);
85
107
  }
86
108
  }
87
109
  });
@@ -103,10 +125,21 @@ Ext.define('Docs.controller.Search', {
103
125
 
104
126
  search: function(term) {
105
127
  // perform search and load results to store
106
- var limit = 10;
107
128
  var results = this.filterMembers(term);
129
+
130
+ // Don't allow paging before first or after the last page.
131
+ if (this.pageIndex < 0) {
132
+ this.pageIndex = 0;
133
+ }
134
+ else if (this.pageIndex > Math.floor(results.length / this.pageSize)) {
135
+ this.pageIndex = Math.floor(results.length / this.pageSize);
136
+ }
137
+ var start = this.pageIndex * this.pageSize;
138
+ var end = start + this.pageSize;
139
+
108
140
  this.getDropdown().setTotal(results.length);
109
- this.getDropdown().getStore().loadData(results.slice(0, limit));
141
+ this.getDropdown().setStart(start);
142
+ this.getDropdown().getStore().loadData(results.slice(start, end));
110
143
  // position dropdown below search box
111
144
  this.getDropdown().alignTo('search-field', 'bl', [-23, 2]);
112
145
  // hide dropdown when nothing found
@@ -6,6 +6,6 @@ Ext.define('Docs.model.Favorite', {
6
6
  extend: 'Ext.data.Model',
7
7
  proxy: {
8
8
  type: ('localStorage' in window && window['localStorage'] !== null) ? 'localstorage' : 'memory',
9
- id : 'docs-favorites'
9
+ id: Docs.localStorageDb + '-favorites'
10
10
  }
11
11
  });
@@ -6,6 +6,6 @@ Ext.define('Docs.model.Setting', {
6
6
  extend: 'Ext.data.Model',
7
7
  proxy: {
8
8
  type: ('localStorage' in window && window['localStorage'] !== null) ? 'localstorage' : 'memory',
9
- id : 'docs-settings'
9
+ id: Docs.localStorageDb + '-settings'
10
10
  }
11
11
  });
@@ -48,7 +48,10 @@ Ext.define('Docs.view.ClassGrid', {
48
48
  },
49
49
  {
50
50
  dataIndex: 'title',
51
- flex: true
51
+ flex: true,
52
+ renderer: function(title, data, r) {
53
+ return Ext.String.format('<a href="#{0}" rel="{0}" class="docClass">{1}</a>', r.get("url"), title);
54
+ }
52
55
  }
53
56
  ];
54
57
 
@@ -70,8 +73,10 @@ Ext.define('Docs.view.ClassGrid', {
70
73
  this.callParent(arguments);
71
74
 
72
75
  this.on("itemclick", function(view, record, item, index, event) {
73
- // Don't fire urlclick when close button clicked
74
- if (!event.getTarget("img")) {
76
+ // Only fire urlclick when the row background is clicked
77
+ // (that doesn't contain neither the link nor the close
78
+ // button).
79
+ if (!event.getTarget("img") && !event.getTarget("a")) {
75
80
  this.fireEvent("urlclick", record.get("url"), event);
76
81
  }
77
82
  }, this);
@@ -19,7 +19,20 @@ Ext.define('Docs.view.search.Dropdown', {
19
19
  itemSelector:'div.item',
20
20
  singleSelect: true,
21
21
 
22
+ pageStart: 0,
23
+ pageSize: 10,
24
+
22
25
  initComponent: function() {
26
+ this.addEvents(
27
+ /**
28
+ * @event
29
+ * Fired when previous or next page link clicked.
30
+ * @param {Ext.view.View} this
31
+ * @param {Number} delta Either +1 for next page or -1 for previous page
32
+ */
33
+ "changePage"
34
+ );
35
+
23
36
  this.tpl = new Ext.XTemplate(
24
37
  '<tpl for=".">',
25
38
  '<div class="item {type}">',
@@ -27,11 +40,35 @@ Ext.define('Docs.view.search.Dropdown', {
27
40
  '<div class="class">{cls}</div>',
28
41
  '</div>',
29
42
  '</tpl>',
30
- '<div class="total">{[values.length]} of {[this.getTotal()]}</div>',
43
+ '<div class="footer">',
44
+ '<a href="#" class="prev">&lt;</a>',
45
+ '<span class="total">{[this.getStart()+1]}-{[this.getEnd()]} of {[this.getTotal()]}</span>',
46
+ '<a href="#" class="next">&gt;</a>',
47
+ '</div>',
31
48
  {
32
- getTotal: Ext.bind(this.getTotal, this)
49
+ getTotal: Ext.bind(this.getTotal, this),
50
+ getStart: Ext.bind(this.getStart, this),
51
+ getEnd: Ext.bind(this.getEnd, this)
33
52
  }
34
53
  );
54
+
55
+ // Listen for clicks on next and prev links
56
+ this.on("afterrender", function() {
57
+ this.el.addListener('click', function() {
58
+ this.fireEvent("changePage", this, -1);
59
+ }, this, {
60
+ preventDefault: true,
61
+ delegate: '.prev'
62
+ });
63
+
64
+ this.el.addListener('click', function() {
65
+ this.fireEvent("changePage", this, +1);
66
+ }, this, {
67
+ preventDefault: true,
68
+ delegate: '.next'
69
+ });
70
+ }, this);
71
+
35
72
  this.callParent(arguments);
36
73
  },
37
74
 
@@ -49,5 +86,30 @@ Ext.define('Docs.view.search.Dropdown', {
49
86
  */
50
87
  getTotal: function() {
51
88
  return this.total;
89
+ },
90
+
91
+ /**
92
+ * Sets the index of first item in dropdown of total
93
+ * @param {Number} start
94
+ */
95
+ setStart: function(start) {
96
+ this.pageStart = start;
97
+ },
98
+
99
+ /**
100
+ * Returns the index of first item in dropdown of total
101
+ * @return {Number}
102
+ */
103
+ getStart: function(start) {
104
+ return this.pageStart;
105
+ },
106
+
107
+ /**
108
+ * Returns the index of last item in dropdown of total
109
+ * @return {Number}
110
+ */
111
+ getEnd: function(start) {
112
+ var end = this.pageStart + this.pageSize;
113
+ return end > this.total ? this.total : end;
52
114
  }
53
115
  });
@@ -26,6 +26,11 @@ Ext.define('Docs.view.tree.Tree', {
26
26
  "urlclick"
27
27
  );
28
28
 
29
+ this.nodeTpl = new Ext.XTemplate(
30
+ '<a href="#{url}" rel="{url}" class="docClass">{text}</a> ',
31
+ '<a rel="{url}" class="fav {show}"></a>'
32
+ );
33
+
29
34
  // Expand the main tree
30
35
  this.root.expanded = true;
31
36
  this.root.children[0].expanded = true;
@@ -48,8 +53,11 @@ Ext.define('Docs.view.tree.Tree', {
48
53
  addFavIcons: function(node) {
49
54
  if (node.get("leaf")) {
50
55
  var url = node.raw.url;
51
- var show = Docs.Favorites.has(url) ? "show" : "";
52
- node.set("text", node.get("text") + Ext.String.format('<a rel="{0}" class="fav {1}"></a>', url, show));
56
+ node.set("text", this.nodeTpl.apply({
57
+ text: node.get("text"),
58
+ url: url,
59
+ show: Docs.Favorites.has(url) ? "show" : ""
60
+ }));
53
61
  node.commit();
54
62
  }
55
63
  },
@@ -67,7 +75,9 @@ Ext.define('Docs.view.tree.Tree', {
67
75
  Docs.Favorites.add(url, this.getNodeTitle(node));
68
76
  }
69
77
  }
70
- else {
78
+ // Only fire the event when not clicking on a link.
79
+ // Clicking on link is handled by the browser itself.
80
+ else if (!e.getTarget("a")) {
71
81
  this.fireEvent("urlclick", url, e);
72
82
  }
73
83
  }
data/template/index.html CHANGED
@@ -3,16 +3,13 @@
3
3
  <head>
4
4
  <title>{title}</title>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <meta name="Description" content="Ext JS 4.0 API Documentation from Sencha. Class documentation, Guides and Videos on how to create Javascript applications with Ext JS 4">
7
6
 
8
7
  <link rel="shortcut icon" type="image/ico" href="favicon.ico" />
9
- <link rel="canonical" href="http://docs.sencha.com/ext-js/4-0/" />
10
8
  <link rel="stylesheet" href="resources/css/reset.css" type="text/css" />
11
9
  <link rel="stylesheet" href="resources/css/docs-ext.css" type="text/css" />
12
10
  <link rel="stylesheet" href="resources/css/scrollbars.css" type="text/css" />
13
11
  <link rel="stylesheet" href="resources/css/viewport.css" type="text/css" />
14
12
  <link rel="stylesheet" href="prettify/prettify.css" type="text/css" />
15
-
16
13
  <!--[if IE]>
17
14
  <link rel="stylesheet" href="resources/css/ie.css" type="text/css" />
18
15
  <![endif]-->
@@ -23,21 +20,29 @@
23
20
  <script type="text/javascript" src="{extjs_path}"></script>
24
21
  <script type="text/javascript" src="prettify/prettify.js"></script>
25
22
 
23
+ <script type="text/javascript">Docs = {localStorageDb: "{local_storage_db}"};</script>
26
24
  <script type="text/javascript" src="app.js"></script>
27
25
 
28
26
  <script type="text/javascript" src="output/tree.js"></script>
29
27
  <script type="text/javascript" src="output/searchData.js"></script>
30
28
 
29
+ {head_html}
30
+
31
31
  </head>
32
32
  <body id="ext-body" class="iScroll">
33
- <div id="loading"><span class="title"></span><span class="logo"></span></div>
34
- <form id="history-form" class="x-hide-display">
35
- <input type="hidden" id="x-history-field" />
36
- <iframe id="x-history-frame"></iframe>
37
- </form>
38
- {guides}
39
- {categories}
40
- <div id="footer-content" style="display: none">{footer}</div>
41
- {append_html}
33
+
34
+ <div id="loading"><span class="title"></span><span class="logo"></span></div>
35
+
36
+ <form id="history-form" class="x-hide-display">
37
+ <input type="hidden" id="x-history-field" />
38
+ <iframe id="x-history-frame"></iframe>
39
+ </form>
40
+
41
+ {guides}
42
+ {categories}
43
+ {footer}
44
+
45
+ {body_html}
46
+
42
47
  </body>
43
48
  </html>
@@ -1 +1 @@
1
- .str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun{color:#660}.pln{color:#000}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec{color:#606}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}@media print{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun{color:#440}.pln{color:#000}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}
1
+ .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
@@ -1,33 +1,28 @@
1
- window.PR_SHOULD_USE_CONTINUATION=true;window.PR_TAB_WIDTH=8;window.PR_normalizedHtml=window.PR=window.prettyPrintOne=window.prettyPrint=void 0;window._pr_isIE6=function(){var y=navigator&&navigator.userAgent&&navigator.userAgent.match(/\bMSIE ([678])\./);y=y?+y[1]:false;window._pr_isIE6=function(){return y};return y};
2
- (function(){function y(b){return b.replace(L,"&amp;").replace(M,"&lt;").replace(N,"&gt;")}function H(b,f,i){switch(b.nodeType){case 1:var o=b.tagName.toLowerCase();f.push("<",o);var l=b.attributes,n=l.length;if(n){if(i){for(var r=[],j=n;--j>=0;)r[j]=l[j];r.sort(function(q,m){return q.name<m.name?-1:q.name===m.name?0:1});l=r}for(j=0;j<n;++j){r=l[j];r.specified&&f.push(" ",r.name.toLowerCase(),'="',r.value.replace(L,"&amp;").replace(M,"&lt;").replace(N,"&gt;").replace(X,"&quot;"),'"')}}f.push(">");
3
- for(l=b.firstChild;l;l=l.nextSibling)H(l,f,i);if(b.firstChild||!/^(?:br|link|img)$/.test(o))f.push("</",o,">");break;case 3:case 4:f.push(y(b.nodeValue));break}}function O(b){function f(c){if(c.charAt(0)!=="\\")return c.charCodeAt(0);switch(c.charAt(1)){case "b":return 8;case "t":return 9;case "n":return 10;case "v":return 11;case "f":return 12;case "r":return 13;case "u":case "x":return parseInt(c.substring(2),16)||c.charCodeAt(1);case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":return parseInt(c.substring(1),
4
- 8);default:return c.charCodeAt(1)}}function i(c){if(c<32)return(c<16?"\\x0":"\\x")+c.toString(16);c=String.fromCharCode(c);if(c==="\\"||c==="-"||c==="["||c==="]")c="\\"+c;return c}function o(c){var d=c.substring(1,c.length-1).match(RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));c=[];for(var a=[],k=d[0]==="^",e=k?1:0,h=d.length;e<h;++e){var g=d[e];switch(g){case "\\B":case "\\b":case "\\D":case "\\d":case "\\S":case "\\s":case "\\W":case "\\w":c.push(g);
5
- continue}g=f(g);var s;if(e+2<h&&"-"===d[e+1]){s=f(d[e+2]);e+=2}else s=g;a.push([g,s]);if(!(s<65||g>122)){s<65||g>90||a.push([Math.max(65,g)|32,Math.min(s,90)|32]);s<97||g>122||a.push([Math.max(97,g)&-33,Math.min(s,122)&-33])}}a.sort(function(v,w){return v[0]-w[0]||w[1]-v[1]});d=[];g=[NaN,NaN];for(e=0;e<a.length;++e){h=a[e];if(h[0]<=g[1]+1)g[1]=Math.max(g[1],h[1]);else d.push(g=h)}a=["["];k&&a.push("^");a.push.apply(a,c);for(e=0;e<d.length;++e){h=d[e];a.push(i(h[0]));if(h[1]>h[0]){h[1]+1>h[0]&&a.push("-");
6
- a.push(i(h[1]))}}a.push("]");return a.join("")}function l(c){for(var d=c.source.match(RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),a=d.length,k=[],e=0,h=0;e<a;++e){var g=d[e];if(g==="(")++h;else if("\\"===g.charAt(0))if((g=+g.substring(1))&&g<=h)k[g]=-1}for(e=1;e<k.length;++e)if(-1===k[e])k[e]=++n;for(h=e=0;e<a;++e){g=d[e];if(g==="("){++h;if(k[h]===undefined)d[e]="(?:"}else if("\\"===
7
- g.charAt(0))if((g=+g.substring(1))&&g<=h)d[e]="\\"+k[h]}for(h=e=0;e<a;++e)if("^"===d[e]&&"^"!==d[e+1])d[e]="";if(c.ignoreCase&&r)for(e=0;e<a;++e){g=d[e];c=g.charAt(0);if(g.length>=2&&c==="[")d[e]=o(g);else if(c!=="\\")d[e]=g.replace(/[a-zA-Z]/g,function(s){s=s.charCodeAt(0);return"["+String.fromCharCode(s&-33,s|32)+"]"})}return d.join("")}for(var n=0,r=false,j=false,q=0,m=b.length;q<m;++q){var t=b[q];if(t.ignoreCase)j=true;else if(/[a-z]/i.test(t.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,
8
- ""))){r=true;j=false;break}}var p=[];q=0;for(m=b.length;q<m;++q){t=b[q];if(t.global||t.multiline)throw Error(""+t);p.push("(?:"+l(t)+")")}return RegExp(p.join("|"),j?"gi":"g")}function Y(b){var f=0;return function(i){for(var o=null,l=0,n=0,r=i.length;n<r;++n)switch(i.charAt(n)){case "\t":o||(o=[]);o.push(i.substring(l,n));l=b-f%b;for(f+=l;l>=0;l-=16)o.push(" ".substring(0,l));l=n+1;break;case "\n":f=0;break;default:++f}if(!o)return i;o.push(i.substring(l));return o.join("")}}function I(b,
9
- f,i,o){if(f){b={source:f,c:b};i(b);o.push.apply(o,b.d)}}function B(b,f){var i={},o;(function(){for(var r=b.concat(f),j=[],q={},m=0,t=r.length;m<t;++m){var p=r[m],c=p[3];if(c)for(var d=c.length;--d>=0;)i[c.charAt(d)]=p;p=p[1];c=""+p;if(!q.hasOwnProperty(c)){j.push(p);q[c]=null}}j.push(/[\0-\uffff]/);o=O(j)})();var l=f.length;function n(r){for(var j=r.c,q=[j,z],m=0,t=r.source.match(o)||[],p={},c=0,d=t.length;c<d;++c){var a=t[c],k=p[a],e=void 0,h;if(typeof k==="string")h=false;else{var g=i[a.charAt(0)];
10
- if(g){e=a.match(g[1]);k=g[0]}else{for(h=0;h<l;++h){g=f[h];if(e=a.match(g[1])){k=g[0];break}}e||(k=z)}if((h=k.length>=5&&"lang-"===k.substring(0,5))&&!(e&&typeof e[1]==="string")){h=false;k=P}h||(p[a]=k)}g=m;m+=a.length;if(h){h=e[1];var s=a.indexOf(h),v=s+h.length;if(e[2]){v=a.length-e[2].length;s=v-h.length}k=k.substring(5);I(j+g,a.substring(0,s),n,q);I(j+g+s,h,Q(k,h),q);I(j+g+v,a.substring(v),n,q)}else q.push(j+g,k)}r.d=q}return n}function x(b){var f=[],i=[];if(b.tripleQuotedStrings)f.push([A,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
11
- null,"'\""]);else b.multiLineStrings?f.push([A,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):f.push([A,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]);b.verbatimStrings&&i.push([A,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);if(b.hashComments)if(b.cStyleComments){f.push([C,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]);i.push([A,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,
12
- null])}else f.push([C,/^#[^\r\n]*/,null,"#"]);if(b.cStyleComments){i.push([C,/^\/\/[^\r\n]*/,null]);i.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}b.regexLiterals&&i.push(["lang-regex",RegExp("^"+Z+"(/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/)")]);b=b.keywords.replace(/^\s+|\s+$/g,"");b.length&&i.push([R,RegExp("^(?:"+b.replace(/\s+/g,"|")+")\\b"),null]);f.push([z,/^\s+/,null," \r\n\t\u00a0"]);i.push([J,/^@[a-z_$][a-z_$@0-9]*/i,null],[S,/^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/,
13
- null],[z,/^[a-z_$][a-z_$@0-9]*/i,null],[J,/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],[E,/^.[^\s\w\.$@\'\"\`\/\#]*/,null]);return B(f,i)}function $(b){function f(D){if(D>r){if(j&&j!==q){n.push("</span>");j=null}if(!j&&q){j=q;n.push('<span class="',j,'">')}var T=y(p(i.substring(r,D))).replace(e?d:c,"$1&#160;");e=k.test(T);n.push(T.replace(a,s));r=D}}var i=b.source,o=b.g,l=b.d,n=[],r=0,j=null,q=null,m=0,t=0,p=Y(window.PR_TAB_WIDTH),c=/([\r\n ]) /g,
14
- d=/(^| ) /gm,a=/\r\n?|\n/g,k=/[ \r\n]$/,e=true,h=window._pr_isIE6();h=h?b.b.tagName==="PRE"?h===6?"&#160;\r\n":h===7?"&#160;<br>\r":"&#160;\r":"&#160;<br />":"<br />";var g=b.b.className.match(/\blinenums\b(?::(\d+))?/),s;if(g){for(var v=[],w=0;w<10;++w)v[w]=h+'</li><li class="L'+w+'">';var F=g[1]&&g[1].length?g[1]-1:0;n.push('<ol class="linenums"><li class="L',F%10,'"');F&&n.push(' value="',F+1,'"');n.push(">");s=function(){var D=v[++F%10];return j?"</span>"+D+'<span class="'+j+'">':D}}else s=h;
15
- for(;;)if(m<o.length?t<l.length?o[m]<=l[t]:true:false){f(o[m]);if(j){n.push("</span>");j=null}n.push(o[m+1]);m+=2}else if(t<l.length){f(l[t]);q=l[t+1];t+=2}else break;f(i.length);j&&n.push("</span>");g&&n.push("</li></ol>");b.a=n.join("")}function u(b,f){for(var i=f.length;--i>=0;){var o=f[i];if(G.hasOwnProperty(o))"console"in window&&console.warn("cannot override language handler %s",o);else G[o]=b}}function Q(b,f){b&&G.hasOwnProperty(b)||(b=/^\s*</.test(f)?"default-markup":"default-code");return G[b]}
16
- function U(b){var f=b.f,i=b.e;b.a=f;try{var o,l=f.match(aa);f=[];var n=0,r=[];if(l)for(var j=0,q=l.length;j<q;++j){var m=l[j];if(m.length>1&&m.charAt(0)==="<"){if(!ba.test(m))if(ca.test(m)){f.push(m.substring(9,m.length-3));n+=m.length-12}else if(da.test(m)){f.push("\n");++n}else if(m.indexOf(V)>=0&&m.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,' $1="$2$3$4"').match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)){var t=m.match(W)[2],p=1,c;c=j+1;a:for(;c<q;++c){var d=l[c].match(W);if(d&&
17
- d[2]===t)if(d[1]==="/"){if(--p===0)break a}else++p}if(c<q){r.push(n,l.slice(j,c+1).join(""));j=c}else r.push(n,m)}else r.push(n,m)}else{var a;p=m;var k=p.indexOf("&");if(k<0)a=p;else{for(--k;(k=p.indexOf("&#",k+1))>=0;){var e=p.indexOf(";",k);if(e>=0){var h=p.substring(k+3,e),g=10;if(h&&h.charAt(0)==="x"){h=h.substring(1);g=16}var s=parseInt(h,g);isNaN(s)||(p=p.substring(0,k)+String.fromCharCode(s)+p.substring(e+1))}}a=p.replace(ea,"<").replace(fa,">").replace(ga,"'").replace(ha,'"').replace(ia," ").replace(ja,
18
- "&")}f.push(a);n+=a.length}}o={source:f.join(""),h:r};var v=o.source;b.source=v;b.c=0;b.g=o.h;Q(i,v)(b);$(b)}catch(w){if("console"in window)console.log(w&&w.stack?w.stack:w)}}var A="str",R="kwd",C="com",S="typ",J="lit",E="pun",z="pln",P="src",V="nocode",Z=function(){for(var b=["!","!=","!==","#","%","%=","&","&&","&&=","&=","(","*","*=","+=",",","-=","->","/","/=",":","::",";","<","<<","<<=","<=","=","==","===",">",">=",">>",">>=",">>>",">>>=","?","@","[","^","^=","^^","^^=","{","|","|=","||","||=",
19
- "~","break","case","continue","delete","do","else","finally","instanceof","return","throw","try","typeof"],f="(?:^^|[+-]",i=0;i<b.length;++i)f+="|"+b[i].replace(/([^=<>:&a-z])/g,"\\$1");f+=")\\s*";return f}(),L=/&/g,M=/</g,N=/>/g,X=/\"/g,ea=/&lt;/g,fa=/&gt;/g,ga=/&apos;/g,ha=/&quot;/g,ja=/&amp;/g,ia=/&nbsp;/g,ka=/[\r\n]/g,K=null,aa=RegExp("[^<]+|<!--[\\s\\S]*?--\>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|</?[a-zA-Z](?:[^>\"']|'[^']*'|\"[^\"]*\")*>|<","g"),ba=/^<\!--/,ca=/^<!\[CDATA\[/,da=/^<br\b/i,W=/^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/,
20
- la=x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename using virtual wchar_t where break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof debugger eval export function get null set undefined var with Infinity NaN caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END break continue do else for if return while case done elif esac eval fi function in local set then until ",
21
- hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true}),G={};u(la,["default-code"]);u(B([],[[z,/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup",
22
- "htm","html","mxml","xhtml","xml","xsl"]);u(B([[z,/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[E,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],
23
- ["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);u(B([],[["atv",/^[\s\S]+/]]),["uq.val"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename using virtual wchar_t where ",
24
- hashComments:true,cStyleComments:true}),["c","cc","cpp","cxx","cyc","m"]);u(x({keywords:"null true false"}),["json"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ",
25
- hashComments:true,cStyleComments:true,verbatimStrings:true}),["cs"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ",
26
- cStyleComments:true}),["java"]);u(x({keywords:"break continue do else for if return while case done elif esac eval fi function in local set then until ",hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);u(x({keywords:"break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);
27
- u(x({keywords:"caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ",hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);u(x({keywords:"break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",hashComments:true,
28
- multiLineStrings:true,regexLiterals:true}),["rb"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof debugger eval export function get null set undefined var with Infinity NaN ",cStyleComments:true,regexLiterals:true}),["js"]);u(B([],[[A,/^[\s\S]+/]]),
29
- ["regex"]);window.PR_normalizedHtml=H;window.prettyPrintOne=function(b,f){var i={f:b,e:f};U(i);return i.a};window.prettyPrint=function(b){function f(){for(var t=window.PR_SHOULD_USE_CONTINUATION?j.now()+250:Infinity;q<o.length&&j.now()<t;q++){var p=o[q];if(p.className&&p.className.indexOf("prettyprint")>=0){var c=p.className.match(/\blang-(\w+)\b/);if(c)c=c[1];for(var d=false,a=p.parentNode;a;a=a.parentNode)if((a.tagName==="pre"||a.tagName==="code"||a.tagName==="xmp")&&a.className&&a.className.indexOf("prettyprint")>=
30
- 0){d=true;break}if(!d){a=p;if(null===K){d=document.createElement("PRE");d.appendChild(document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));K=!/</.test(d.innerHTML)}if(K){d=a.innerHTML;if("XMP"===a.tagName)d=y(d);else{a=a;if("PRE"===a.tagName)a=true;else if(ka.test(d)){var k="";if(a.currentStyle)k=a.currentStyle.whiteSpace;else if(window.getComputedStyle)k=window.getComputedStyle(a,null).whiteSpace;a=!k||k==="pre"}else a=true;a||(d=d.replace(/(<br\s*\/?>)[\r\n]+/g,"$1").replace(/(?:[\r\n]+[ \t]*)+/g,
31
- " "))}d=d}else{d=[];for(a=a.firstChild;a;a=a.nextSibling)H(a,d);d=d.join("")}d=d.replace(/(?:\r\n?|\n)$/,"");m={f:d,e:c,b:p};U(m);if(p=m.a){c=m.b;if("XMP"===c.tagName){d=document.createElement("PRE");for(a=0;a<c.attributes.length;++a){k=c.attributes[a];if(k.specified)if(k.name.toLowerCase()==="class")d.className=k.value;else d.setAttribute(k.name,k.value)}d.innerHTML=p;c.parentNode.replaceChild(d,c)}else c.innerHTML=p}}}}if(q<o.length)setTimeout(f,250);else b&&b()}for(var i=[document.getElementsByTagName("pre"),
32
- document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],o=[],l=0;l<i.length;++l)for(var n=0,r=i[l].length;n<r;++n)o.push(i[l][n]);i=null;var j=Date;j.now||(j={now:function(){return(new Date).getTime()}});var q=0,m;f()};window.PR={combinePrefixPatterns:O,createSimpleLexer:B,registerLangHandler:u,sourceDecorator:x,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:C,PR_DECLARATION:"dec",PR_KEYWORD:R,PR_LITERAL:J,PR_NOCODE:V,PR_PLAIN:z,PR_PUNCTUATION:E,PR_SOURCE:P,PR_STRING:A,
33
- PR_TAG:"tag",PR_TYPE:S}})()
1
+ var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
2
+ (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
3
+ [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
4
+ f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
5
+ (j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
6
+ {b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
7
+ t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
8
+ "string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
9
+ l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
10
+ q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
11
+ q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
12
+ "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
13
+ a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
14
+ for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
15
+ m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
16
+ a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
17
+ j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
18
+ "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
19
+ H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
20
+ J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
21
+ I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
22
+ ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
23
+ /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
24
+ ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
25
+ hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
26
+ !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
27
+ 250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
28
+ PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsduck
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1876988255
4
+ hash: -1876988225
5
5
  prerelease: true
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - pre2
10
- version: 2.0.pre2
9
+ - pre4
10
+ version: 2.0.pre4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rene Saarsoo
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-07-06 00:00:00 +03:00
19
+ date: 2011-07-15 00:00:00 +03:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -160,10 +160,13 @@ files:
160
160
  - template/resources/images/x.png
161
161
  - template/resources/images/x12.png
162
162
  - template/extjs/ext-all.js
163
+ - template/extjs/resources/themes/images/default/tree/arrows.gif
164
+ - template/extjs/resources/themes/images/default/grid/loading.gif
165
+ - template/extjs/resources/themes/images/default/form/text-bg.gif
166
+ - template/extjs/resources/themes/images/default/form/checkbox.gif
163
167
  - template/resources/css/docs-ext.css
164
168
  - template/resources/css/scrollbars.css
165
169
  - template/resources/css/reset.css
166
- - template/resources/css/style.css
167
170
  - template/resources/css/viewport.css
168
171
  has_rdoc: true
169
172
  homepage: https://github.com/senchalabs/jsduck