Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Side by Side Diff: chrome/common/extensions/docs/js/api_page_generator.js

Issue 10198002: Revert 133345 - An extension docs experiment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview This file is the controller for generating extension 6 * @fileoverview This file is the controller for generating extension
7 * doc pages. 7 * doc pages.
8 * 8 *
9 * It expects to have available via XHR (relative path): 9 * It expects to have available via XHR (relative path):
10 * 1) API_TEMPLATE which is the main template for the api pages. 10 * 1) API_TEMPLATE which is the main template for the api pages.
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 var schemas_to_retrieve = []; 179 var schemas_to_retrieve = [];
180 if (!USE_DEVTOOLS_SCHEMA || is_experimental_index) 180 if (!USE_DEVTOOLS_SCHEMA || is_experimental_index)
181 schemas_to_retrieve = schemas_to_retrieve.concat(MODULE_SCHEMAS); 181 schemas_to_retrieve = schemas_to_retrieve.concat(MODULE_SCHEMAS);
182 if (USE_DEVTOOLS_SCHEMA || is_experimental_index) 182 if (USE_DEVTOOLS_SCHEMA || is_experimental_index)
183 schemas_to_retrieve.push(DEVTOOLS_SCHEMA); 183 schemas_to_retrieve.push(DEVTOOLS_SCHEMA);
184 184
185 var schemas_retrieved = 0; 185 var schemas_retrieved = 0;
186 schema = []; 186 schema = [];
187 187
188 function onSchemaContent(content) { 188 function onSchemaContent(content) {
189 if (content) 189 schema = schema.concat(JSON.parse(JSON.minify(content)));
190 schema = schema.concat(JSON.parse(JSON.minify(content)));
191 if (++schemas_retrieved < schemas_to_retrieve.length) 190 if (++schemas_retrieved < schemas_to_retrieve.length)
192 return; 191 return;
193 if (pageName.toLowerCase() == 'samples') { 192 if (pageName.toLowerCase() == 'samples') {
194 fetchSamples(); 193 fetchSamples();
195 } else { 194 } else {
196 renderTemplate(); 195 renderTemplate();
197 } 196 }
198 } 197 }
199 198
200 for (var i = 0; i < schemas_to_retrieve.length; ++i) { 199 for (var i = 0; i < schemas_to_retrieve.length; ++i) {
201 var schema_path = schemas_to_retrieve[i]; 200 var schema_path = schemas_to_retrieve[i];
202 fetchContent(schema_path, onSchemaContent, function(error) { 201 fetchContent(schema_path, onSchemaContent, function(error) {
203 onSchemaContent(""); 202 alert('Failed to load ' + schema_path);
204 }); 203 });
205 } 204 }
206 } 205 }
207 206
208 function fetchSamples() { 207 function fetchSamples() {
209 // If we're rendering the samples directory, fetch the samples manifest. 208 // If we're rendering the samples directory, fetch the samples manifest.
210 fetchContent(SAMPLES, function(sampleManifest) { 209 fetchContent(SAMPLES, function(sampleManifest) {
211 var data = JSON.parse(JSON.minify(sampleManifest)); 210 var data = JSON.parse(JSON.minify(sampleManifest));
212 samples = data.samples; 211 samples = data.samples;
213 apiMapping = data.api; 212 apiMapping = data.api;
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 } 693 }
695 if (a.name > b.name) { 694 if (a.name > b.name) {
696 return 1; 695 return 1;
697 } 696 }
698 return 0; 697 return 0;
699 } 698 }
700 699
701 function disableDocs(obj) { 700 function disableDocs(obj) {
702 return !!obj.nodoc || !!obj.internal; 701 return !!obj.nodoc || !!obj.internal;
703 } 702 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/autoupdate.html ('k') | chrome/common/extensions/docs/static/autoupdate.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698