utopia 2.5.5 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/Gemfile +1 -0
- data/Rakefile +2 -0
- data/docs/code/Utopia.html +439 -433
- data/docs/code/Utopia/Command.html +201 -195
- data/docs/code/Utopia/Command/Environment.html +244 -244
- data/docs/code/Utopia/Command/Server.html +202 -202
- data/docs/code/Utopia/Command/Server/Create.html +192 -192
- data/docs/code/Utopia/Command/Server/Update.html +235 -235
- data/docs/code/Utopia/Command/Site.html +269 -263
- data/docs/code/Utopia/Command/Site/Create.html +192 -192
- data/docs/code/Utopia/Command/Site/Update.html +246 -246
- data/docs/code/Utopia/Command/Top.html +244 -244
- data/docs/code/Utopia/Content.html +636 -630
- data/docs/code/Utopia/Content/Document.html +1411 -1407
- data/docs/code/Utopia/Content/Document/State.html +1048 -1048
- data/docs/code/Utopia/Content/Link.html +1023 -1023
- data/docs/code/Utopia/Content/Links.html +629 -623
- data/docs/code/Utopia/Content/MarkupParser.html +702 -702
- data/docs/code/Utopia/Content/MarkupParser/ParsedTag.html +375 -375
- data/docs/code/Utopia/Content/MarkupParser/UnbalancedTagError.html +523 -523
- data/docs/code/Utopia/Content/Namespace.html +416 -416
- data/docs/code/Utopia/Content/Node.html +952 -952
- data/docs/code/Utopia/Content/Node/Context.html +790 -790
- data/docs/code/Utopia/Content/Response.html +686 -686
- data/docs/code/Utopia/Content/SymbolicHash.html +365 -365
- data/docs/code/Utopia/Content/Tags.html +134 -134
- data/docs/code/Utopia/Content/UnbalancedTagError.html +270 -270
- data/docs/code/Utopia/ContentLength.html +298 -294
- data/docs/code/Utopia/Controller.html +657 -651
- data/docs/code/Utopia/Controller/Actions.html +260 -260
- data/docs/code/Utopia/Controller/Actions/Action.html +785 -779
- data/docs/code/Utopia/Controller/Actions/ClassMethods.html +360 -360
- data/docs/code/Utopia/Controller/Base.html +989 -989
- data/docs/code/Utopia/Controller/Respond.html +264 -254
- data/docs/code/Utopia/Controller/Respond/ClassMethods.html +207 -207
- data/docs/code/Utopia/Controller/Respond/Converter.html +219 -219
- data/docs/code/Utopia/Controller/Respond/Converter/Callback.html +425 -425
- data/docs/code/Utopia/Controller/Respond/Converter/ToJSON.html +323 -317
- data/docs/code/Utopia/Controller/Respond/Passthrough.html +266 -260
- data/docs/code/Utopia/Controller/Respond/Responder.html +449 -443
- data/docs/code/Utopia/Controller/Rewrite.html +260 -260
- data/docs/code/Utopia/Controller/Rewrite/ClassMethods.html +216 -216
- data/docs/code/Utopia/Controller/Rewrite/ExtractPrefixRule.html +303 -303
- data/docs/code/Utopia/Controller/Rewrite/Rewriter.html +402 -402
- data/docs/code/Utopia/Controller/Rewrite/Rule.html +193 -193
- data/docs/code/Utopia/Controller/Variables.html +428 -428
- data/docs/code/Utopia/Controllers.html +216 -216
- data/docs/code/Utopia/Exceptions.html +125 -125
- data/docs/code/Utopia/Exceptions/Handler.html +405 -405
- data/docs/code/Utopia/Exceptions/Mailer.html +400 -394
- data/docs/code/Utopia/Extensions.html +116 -116
- data/docs/code/Utopia/Extensions/ArraySplit.html +164 -164
- data/docs/code/Utopia/Extensions/DateTimeComparison.html +173 -173
- data/docs/code/Utopia/Extensions/TimeDateComparison.html +173 -173
- data/docs/code/Utopia/HTTP.html +193 -187
- data/docs/code/Utopia/HTTP/Status.html +355 -355
- data/docs/code/Utopia/Locale.html +522 -522
- data/docs/code/Utopia/Localization.html +886 -880
- data/docs/code/Utopia/Localization/Wrapper.html +403 -403
- data/docs/code/Utopia/Logger.html +185 -185
- data/docs/code/Utopia/Logger/CompactFormatter.html +290 -290
- data/docs/code/Utopia/Path.html +2562 -2556
- data/docs/code/Utopia/Path/Matcher.html +395 -395
- data/docs/code/Utopia/Path/Matcher/MatchData.html +418 -418
- data/docs/code/Utopia/Redirection.html +148 -142
- data/docs/code/Utopia/Redirection/ClientRedirect.html +594 -594
- data/docs/code/Utopia/Redirection/DirectoryIndex.html +265 -265
- data/docs/code/Utopia/Redirection/Errors.html +391 -385
- data/docs/code/Utopia/Redirection/Moved.html +265 -265
- data/docs/code/Utopia/Redirection/RequestFailure.html +201 -201
- data/docs/code/Utopia/Redirection/Rewrite.html +265 -265
- data/docs/code/Utopia/Session.html +723 -717
- data/docs/code/Utopia/Session/LazyHash.html +709 -709
- data/docs/code/Utopia/Setup.html +783 -777
- data/docs/code/Utopia/Static.html +516 -510
- data/docs/code/Utopia/Static/LocalFile.html +875 -869
- data/docs/code/Utopia/Static/MimeTypeLoader.html +427 -427
- data/docs/code/Utopia/Static/MimeTypeLoader/ExpansionError.html +123 -123
- data/docs/code/_index.html +757 -757
- data/docs/code/class_list.html +51 -51
- data/docs/code/css/full_list.css +58 -58
- data/docs/code/css/style.css +496 -499
- data/docs/code/file.README.html +72 -70
- data/docs/code/file_list.html +56 -56
- data/docs/code/frames.html +17 -17
- data/docs/code/index.html +72 -70
- data/docs/code/js/app.js +292 -248
- data/docs/code/js/full_list.js +216 -216
- data/docs/code/js/jquery.js +3 -3
- data/docs/code/method_list.html +3443 -3443
- data/docs/code/top-level-namespace.html +109 -109
- data/docs/index.html +2 -2
- data/docs/wiki.html +2 -2
- data/docs/wiki/edit.html +1 -1
- data/docs/wiki/javascript.html +153 -0
- data/docs/wiki/javascript/index.html +153 -0
- data/documentation/.yarnrc +1 -0
- data/documentation/Gemfile +1 -0
- data/documentation/config/environment.rb +1 -0
- data/documentation/pages/wiki/content.md +1 -1
- data/documentation/pages/wiki/javascript/content.md +75 -0
- data/documentation/pages/wiki/links.yaml +3 -1
- data/lib/utopia/command/site.rb +4 -4
- data/lib/utopia/version.rb +1 -1
- data/setup/site/.yarnrc +1 -0
- data/setup/site/tasks/yarn.rake +32 -0
- data/spec/utopia/command_spec.rb +2 -2
- metadata +8 -9
- data/docs/wiki/bower-integration.html +0 -74
- data/docs/wiki/bower-integration/index.html +0 -74
- data/documentation/.bowerrc +0 -4
- data/documentation/pages/wiki/bower-integration/content.md +0 -25
- data/setup/.bowerrc +0 -3
- data/setup/site/.bowerrc +0 -4
- data/setup/site/tasks/bower.rake +0 -45
data/docs/code/js/app.js
CHANGED
@@ -1,248 +1,292 @@
|
|
1
|
-
(function() {
|
2
|
-
|
3
|
-
var localStorage = {}, sessionStorage = {};
|
4
|
-
try { localStorage = window.localStorage; } catch (e) { }
|
5
|
-
try { sessionStorage = window.sessionStorage; } catch (e) { }
|
6
|
-
|
7
|
-
function createSourceLinks() {
|
8
|
-
$('.method_details_list .source_code').
|
9
|
-
before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
|
10
|
-
$('.toggleSource').toggle(function() {
|
11
|
-
$(this).parent().nextAll('.source_code').slideDown(100);
|
12
|
-
$(this).text("Hide source");
|
13
|
-
},
|
14
|
-
function() {
|
15
|
-
$(this).parent().nextAll('.source_code').slideUp(100);
|
16
|
-
$(this).text("View source");
|
17
|
-
});
|
18
|
-
}
|
19
|
-
|
20
|
-
function createDefineLinks() {
|
21
|
-
var tHeight = 0;
|
22
|
-
$('.defines').after(" <a href='#' class='toggleDefines'>more...</a>");
|
23
|
-
$('.toggleDefines').toggle(function() {
|
24
|
-
tHeight = $(this).parent().prev().height();
|
25
|
-
$(this).prev().css('display', 'inline');
|
26
|
-
$(this).parent().prev().height($(this).parent().height());
|
27
|
-
$(this).text("(less)");
|
28
|
-
},
|
29
|
-
function() {
|
30
|
-
$(this).prev().hide();
|
31
|
-
$(this).parent().prev().height(tHeight);
|
32
|
-
$(this).text("more...");
|
33
|
-
});
|
34
|
-
}
|
35
|
-
|
36
|
-
function createFullTreeLinks() {
|
37
|
-
var tHeight = 0;
|
38
|
-
$('.inheritanceTree').toggle(function() {
|
39
|
-
tHeight = $(this).parent().prev().height();
|
40
|
-
$(this).parent().toggleClass('showAll');
|
41
|
-
$(this).text("(hide)");
|
42
|
-
$(this).parent().prev().height($(this).parent().height());
|
43
|
-
},
|
44
|
-
function() {
|
45
|
-
$(this).parent().toggleClass('showAll');
|
46
|
-
$(this).parent().prev().height(tHeight);
|
47
|
-
$(this).text("show all");
|
48
|
-
});
|
49
|
-
}
|
50
|
-
|
51
|
-
function searchFrameButtons() {
|
52
|
-
$('.full_list_link').click(function() {
|
53
|
-
toggleSearchFrame(this, $(this).attr('href'));
|
54
|
-
return false;
|
55
|
-
});
|
56
|
-
window.addEventListener('message', function(e) {
|
57
|
-
if (e.data === 'navEscape') {
|
58
|
-
$('#nav').slideUp(100);
|
59
|
-
$('#search a').removeClass('active inactive');
|
60
|
-
$(window).focus();
|
61
|
-
}
|
62
|
-
});
|
63
|
-
|
64
|
-
$(window).resize(function() {
|
65
|
-
if ($('#search:visible').length === 0) {
|
66
|
-
$('#nav').removeAttr('style');
|
67
|
-
$('#search a').removeClass('active inactive');
|
68
|
-
$(window).focus();
|
69
|
-
}
|
70
|
-
});
|
71
|
-
}
|
72
|
-
|
73
|
-
function toggleSearchFrame(id, link) {
|
74
|
-
var frame = $('#nav');
|
75
|
-
$('#search a').removeClass('active').addClass('inactive');
|
76
|
-
if (frame.attr('src') === link && frame.css('display') !== "none") {
|
77
|
-
frame.slideUp(100);
|
78
|
-
$('#search a').removeClass('active inactive');
|
79
|
-
}
|
80
|
-
else {
|
81
|
-
$(id).addClass('active').removeClass('inactive');
|
82
|
-
if (frame.attr('src') !== link) frame.attr('src', link);
|
83
|
-
frame.slideDown(100);
|
84
|
-
}
|
85
|
-
}
|
86
|
-
|
87
|
-
function linkSummaries() {
|
88
|
-
$('.summary_signature').click(function() {
|
89
|
-
document.location = $(this).find('a').attr('href');
|
90
|
-
});
|
91
|
-
}
|
92
|
-
|
93
|
-
function summaryToggle() {
|
94
|
-
$('.summary_toggle').click(function(e) {
|
95
|
-
e.preventDefault();
|
96
|
-
localStorage.summaryCollapsed = $(this).text();
|
97
|
-
$('.summary_toggle').each(function() {
|
98
|
-
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
99
|
-
var next = $(this).parent().parent().nextAll('ul.summary').first();
|
100
|
-
if (next.hasClass('compact')) {
|
101
|
-
next.toggle();
|
102
|
-
next.nextAll('ul.summary').first().toggle();
|
103
|
-
}
|
104
|
-
else if (next.hasClass('summary')) {
|
105
|
-
var list = $('<ul class="summary compact" />');
|
106
|
-
list.html(next.html());
|
107
|
-
list.find('.summary_desc, .note').remove();
|
108
|
-
list.find('a').each(function() {
|
109
|
-
$(this).html($(this).find('strong').html());
|
110
|
-
$(this).parent().html($(this)[0].outerHTML);
|
111
|
-
});
|
112
|
-
next.before(list);
|
113
|
-
next.toggle();
|
114
|
-
}
|
115
|
-
});
|
116
|
-
return false;
|
117
|
-
});
|
118
|
-
if (localStorage.summaryCollapsed == "collapse") {
|
119
|
-
$('.summary_toggle').first().click();
|
120
|
-
} else { localStorage.summaryCollapsed = "expand"; }
|
121
|
-
}
|
122
|
-
|
123
|
-
function
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
});
|
161
|
-
if (
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
return;
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
}
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
}
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
$(
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
function
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
return
|
223
|
-
}
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
}
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
1
|
+
(function() {
|
2
|
+
|
3
|
+
var localStorage = {}, sessionStorage = {};
|
4
|
+
try { localStorage = window.localStorage; } catch (e) { }
|
5
|
+
try { sessionStorage = window.sessionStorage; } catch (e) { }
|
6
|
+
|
7
|
+
function createSourceLinks() {
|
8
|
+
$('.method_details_list .source_code').
|
9
|
+
before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
|
10
|
+
$('.toggleSource').toggle(function() {
|
11
|
+
$(this).parent().nextAll('.source_code').slideDown(100);
|
12
|
+
$(this).text("Hide source");
|
13
|
+
},
|
14
|
+
function() {
|
15
|
+
$(this).parent().nextAll('.source_code').slideUp(100);
|
16
|
+
$(this).text("View source");
|
17
|
+
});
|
18
|
+
}
|
19
|
+
|
20
|
+
function createDefineLinks() {
|
21
|
+
var tHeight = 0;
|
22
|
+
$('.defines').after(" <a href='#' class='toggleDefines'>more...</a>");
|
23
|
+
$('.toggleDefines').toggle(function() {
|
24
|
+
tHeight = $(this).parent().prev().height();
|
25
|
+
$(this).prev().css('display', 'inline');
|
26
|
+
$(this).parent().prev().height($(this).parent().height());
|
27
|
+
$(this).text("(less)");
|
28
|
+
},
|
29
|
+
function() {
|
30
|
+
$(this).prev().hide();
|
31
|
+
$(this).parent().prev().height(tHeight);
|
32
|
+
$(this).text("more...");
|
33
|
+
});
|
34
|
+
}
|
35
|
+
|
36
|
+
function createFullTreeLinks() {
|
37
|
+
var tHeight = 0;
|
38
|
+
$('.inheritanceTree').toggle(function() {
|
39
|
+
tHeight = $(this).parent().prev().height();
|
40
|
+
$(this).parent().toggleClass('showAll');
|
41
|
+
$(this).text("(hide)");
|
42
|
+
$(this).parent().prev().height($(this).parent().height());
|
43
|
+
},
|
44
|
+
function() {
|
45
|
+
$(this).parent().toggleClass('showAll');
|
46
|
+
$(this).parent().prev().height(tHeight);
|
47
|
+
$(this).text("show all");
|
48
|
+
});
|
49
|
+
}
|
50
|
+
|
51
|
+
function searchFrameButtons() {
|
52
|
+
$('.full_list_link').click(function() {
|
53
|
+
toggleSearchFrame(this, $(this).attr('href'));
|
54
|
+
return false;
|
55
|
+
});
|
56
|
+
window.addEventListener('message', function(e) {
|
57
|
+
if (e.data === 'navEscape') {
|
58
|
+
$('#nav').slideUp(100);
|
59
|
+
$('#search a').removeClass('active inactive');
|
60
|
+
$(window).focus();
|
61
|
+
}
|
62
|
+
});
|
63
|
+
|
64
|
+
$(window).resize(function() {
|
65
|
+
if ($('#search:visible').length === 0) {
|
66
|
+
$('#nav').removeAttr('style');
|
67
|
+
$('#search a').removeClass('active inactive');
|
68
|
+
$(window).focus();
|
69
|
+
}
|
70
|
+
});
|
71
|
+
}
|
72
|
+
|
73
|
+
function toggleSearchFrame(id, link) {
|
74
|
+
var frame = $('#nav');
|
75
|
+
$('#search a').removeClass('active').addClass('inactive');
|
76
|
+
if (frame.attr('src') === link && frame.css('display') !== "none") {
|
77
|
+
frame.slideUp(100);
|
78
|
+
$('#search a').removeClass('active inactive');
|
79
|
+
}
|
80
|
+
else {
|
81
|
+
$(id).addClass('active').removeClass('inactive');
|
82
|
+
if (frame.attr('src') !== link) frame.attr('src', link);
|
83
|
+
frame.slideDown(100);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
function linkSummaries() {
|
88
|
+
$('.summary_signature').click(function() {
|
89
|
+
document.location = $(this).find('a').attr('href');
|
90
|
+
});
|
91
|
+
}
|
92
|
+
|
93
|
+
function summaryToggle() {
|
94
|
+
$('.summary_toggle').click(function(e) {
|
95
|
+
e.preventDefault();
|
96
|
+
localStorage.summaryCollapsed = $(this).text();
|
97
|
+
$('.summary_toggle').each(function() {
|
98
|
+
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
99
|
+
var next = $(this).parent().parent().nextAll('ul.summary').first();
|
100
|
+
if (next.hasClass('compact')) {
|
101
|
+
next.toggle();
|
102
|
+
next.nextAll('ul.summary').first().toggle();
|
103
|
+
}
|
104
|
+
else if (next.hasClass('summary')) {
|
105
|
+
var list = $('<ul class="summary compact" />');
|
106
|
+
list.html(next.html());
|
107
|
+
list.find('.summary_desc, .note').remove();
|
108
|
+
list.find('a').each(function() {
|
109
|
+
$(this).html($(this).find('strong').html());
|
110
|
+
$(this).parent().html($(this)[0].outerHTML);
|
111
|
+
});
|
112
|
+
next.before(list);
|
113
|
+
next.toggle();
|
114
|
+
}
|
115
|
+
});
|
116
|
+
return false;
|
117
|
+
});
|
118
|
+
if (localStorage.summaryCollapsed == "collapse") {
|
119
|
+
$('.summary_toggle').first().click();
|
120
|
+
} else { localStorage.summaryCollapsed = "expand"; }
|
121
|
+
}
|
122
|
+
|
123
|
+
function constantSummaryToggle() {
|
124
|
+
$('.constants_summary_toggle').click(function(e) {
|
125
|
+
e.preventDefault();
|
126
|
+
localStorage.summaryCollapsed = $(this).text();
|
127
|
+
$('.constants_summary_toggle').each(function() {
|
128
|
+
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
129
|
+
var next = $(this).parent().parent().nextAll('dl.constants').first();
|
130
|
+
if (next.hasClass('compact')) {
|
131
|
+
next.toggle();
|
132
|
+
next.nextAll('dl.constants').first().toggle();
|
133
|
+
}
|
134
|
+
else if (next.hasClass('constants')) {
|
135
|
+
var list = $('<dl class="constants compact" />');
|
136
|
+
list.html(next.html());
|
137
|
+
list.find('dt').each(function() {
|
138
|
+
$(this).addClass('summary_signature');
|
139
|
+
$(this).text( $(this).text().split('=')[0]);
|
140
|
+
if ($(this).has(".deprecated").length) {
|
141
|
+
$(this).addClass('deprecated');
|
142
|
+
};
|
143
|
+
});
|
144
|
+
// Add the value of the constant as "Tooltip" to the summary object
|
145
|
+
list.find('pre.code').each(function() {
|
146
|
+
console.log($(this).parent());
|
147
|
+
var dt_element = $(this).parent().prev();
|
148
|
+
var tooltip = $(this).text();
|
149
|
+
if (dt_element.hasClass("deprecated")) {
|
150
|
+
tooltip = 'Deprecated. ' + tooltip;
|
151
|
+
};
|
152
|
+
dt_element.attr('title', tooltip);
|
153
|
+
});
|
154
|
+
list.find('.docstring, .tags, dd').remove();
|
155
|
+
next.before(list);
|
156
|
+
next.toggle();
|
157
|
+
}
|
158
|
+
});
|
159
|
+
return false;
|
160
|
+
});
|
161
|
+
if (localStorage.summaryCollapsed == "collapse") {
|
162
|
+
$('.constants_summary_toggle').first().click();
|
163
|
+
} else { localStorage.summaryCollapsed = "expand"; }
|
164
|
+
}
|
165
|
+
|
166
|
+
function generateTOC() {
|
167
|
+
if ($('#filecontents').length === 0) return;
|
168
|
+
var _toc = $('<ol class="top"></ol>');
|
169
|
+
var show = false;
|
170
|
+
var toc = _toc;
|
171
|
+
var counter = 0;
|
172
|
+
var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
173
|
+
var i;
|
174
|
+
if ($('#filecontents h1').length > 1) tags.unshift('h1');
|
175
|
+
for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
|
176
|
+
var lastTag = parseInt(tags[0][1], 10);
|
177
|
+
$(tags.join(', ')).each(function() {
|
178
|
+
if ($(this).parents('.method_details .docstring').length != 0) return;
|
179
|
+
if (this.id == "filecontents") return;
|
180
|
+
show = true;
|
181
|
+
var thisTag = parseInt(this.tagName[1], 10);
|
182
|
+
if (this.id.length === 0) {
|
183
|
+
var proposedId = $(this).attr('toc-id');
|
184
|
+
if (typeof(proposedId) != "undefined") this.id = proposedId;
|
185
|
+
else {
|
186
|
+
var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
|
187
|
+
if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
|
188
|
+
this.id = proposedId;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
if (thisTag > lastTag) {
|
192
|
+
for (i = 0; i < thisTag - lastTag; i++) {
|
193
|
+
var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
|
194
|
+
}
|
195
|
+
}
|
196
|
+
if (thisTag < lastTag) {
|
197
|
+
for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
|
198
|
+
}
|
199
|
+
var title = $(this).attr('toc-title');
|
200
|
+
if (typeof(title) == "undefined") title = $(this).text();
|
201
|
+
toc.append('<li><a href="#' + this.id + '">' + title + '</a></li>');
|
202
|
+
lastTag = thisTag;
|
203
|
+
});
|
204
|
+
if (!show) return;
|
205
|
+
html = '<div id="toc"><p class="title hide_toc"><a href="#"><strong>Table of Contents</strong></a></p></div>';
|
206
|
+
$('#content').prepend(html);
|
207
|
+
$('#toc').append(_toc);
|
208
|
+
$('#toc .hide_toc').toggle(function() {
|
209
|
+
$('#toc .top').slideUp('fast');
|
210
|
+
$('#toc').toggleClass('hidden');
|
211
|
+
$('#toc .title small').toggle();
|
212
|
+
}, function() {
|
213
|
+
$('#toc .top').slideDown('fast');
|
214
|
+
$('#toc').toggleClass('hidden');
|
215
|
+
$('#toc .title small').toggle();
|
216
|
+
});
|
217
|
+
}
|
218
|
+
|
219
|
+
function navResizeFn(e) {
|
220
|
+
if (e.which !== 1) {
|
221
|
+
navResizeFnStop();
|
222
|
+
return;
|
223
|
+
}
|
224
|
+
|
225
|
+
sessionStorage.navWidth = e.pageX.toString();
|
226
|
+
$('.nav_wrap').css('width', e.pageX);
|
227
|
+
$('.nav_wrap').css('-ms-flex', 'inherit');
|
228
|
+
}
|
229
|
+
|
230
|
+
function navResizeFnStop() {
|
231
|
+
$(window).unbind('mousemove', navResizeFn);
|
232
|
+
window.removeEventListener('message', navMessageFn, false);
|
233
|
+
}
|
234
|
+
|
235
|
+
function navMessageFn(e) {
|
236
|
+
if (e.data.action === 'mousemove') navResizeFn(e.data.event);
|
237
|
+
if (e.data.action === 'mouseup') navResizeFnStop();
|
238
|
+
}
|
239
|
+
|
240
|
+
function navResizer() {
|
241
|
+
$('#resizer').mousedown(function(e) {
|
242
|
+
e.preventDefault();
|
243
|
+
$(window).mousemove(navResizeFn);
|
244
|
+
window.addEventListener('message', navMessageFn, false);
|
245
|
+
});
|
246
|
+
$(window).mouseup(navResizeFnStop);
|
247
|
+
|
248
|
+
if (sessionStorage.navWidth) {
|
249
|
+
navResizeFn({which: 1, pageX: parseInt(sessionStorage.navWidth, 10)});
|
250
|
+
}
|
251
|
+
}
|
252
|
+
|
253
|
+
function navExpander() {
|
254
|
+
var done = false, timer = setTimeout(postMessage, 500);
|
255
|
+
function postMessage() {
|
256
|
+
if (done) return;
|
257
|
+
clearTimeout(timer);
|
258
|
+
var opts = { action: 'expand', path: pathId };
|
259
|
+
document.getElementById('nav').contentWindow.postMessage(opts, '*');
|
260
|
+
done = true;
|
261
|
+
}
|
262
|
+
|
263
|
+
window.addEventListener('message', function(event) {
|
264
|
+
if (event.data === 'navReady') postMessage();
|
265
|
+
return false;
|
266
|
+
}, false);
|
267
|
+
}
|
268
|
+
|
269
|
+
function mainFocus() {
|
270
|
+
var hash = window.location.hash;
|
271
|
+
if (hash !== '' && $(hash)[0]) {
|
272
|
+
$(hash)[0].scrollIntoView();
|
273
|
+
}
|
274
|
+
|
275
|
+
setTimeout(function() { $('#main').focus(); }, 10);
|
276
|
+
}
|
277
|
+
|
278
|
+
$(document).ready(function() {
|
279
|
+
navResizer();
|
280
|
+
navExpander();
|
281
|
+
createSourceLinks();
|
282
|
+
createDefineLinks();
|
283
|
+
createFullTreeLinks();
|
284
|
+
searchFrameButtons();
|
285
|
+
linkSummaries();
|
286
|
+
summaryToggle();
|
287
|
+
constantSummaryToggle();
|
288
|
+
generateTOC();
|
289
|
+
mainFocus();
|
290
|
+
});
|
291
|
+
|
292
|
+
})();
|