Skip to content

Commit

Permalink
0.2.3 Minor Bugfixes. Add compare=1 url-parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
rottmann committed Aug 8, 2013
1 parent 9c632cf commit 9fa9ff4
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# apiDoc Changelog

#### 0.2.3
Extend Template with url-param "compare=1" to show the compare version on page view.
Bugfix: Minor fix with double structure examples.

#### 0.2.2
Bugfix: Template not show @apiSuccessExample @apiErrorExample.

Expand Down
2 changes: 1 addition & 1 deletion lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Parser.prototype._parseBlockElements = function(indexApiBlocks, detectedElements
"\" block number " + (blockIndex + 1) + ", only one definition per block allowed."
);
}

if(preventGlobal === true)
{
throw new Error("Can't set \"@" + element.sourceName + "\" in file \"" + self.filename +
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/worker_error_title.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ function postProcess(parsedFiles, filenames, preProcessResults)
*/
module.exports = {
preProcess: preProcess,
postProcess: postProcess,
postProcess: postProcess
};
2 changes: 1 addition & 1 deletion lib/plugins/worker_info_title.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ function postProcess(parsedFiles, filenames, preProcessResults)
*/
module.exports = {
preProcess: preProcess,
postProcess: postProcess,
postProcess: postProcess
};
2 changes: 1 addition & 1 deletion lib/plugins/worker_param_title.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@ function postProcess(parsedFiles, filenames, preProcessResults, structureName, d
*/
module.exports = {
preProcess: preProcess,
postProcess: postProcess,
postProcess: postProcess
};
2 changes: 1 addition & 1 deletion lib/plugins/worker_success_title.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ function postProcess(parsedFiles, filenames, preProcessResults)
*/
module.exports = {
preProcess: preProcess,
postProcess: postProcess,
postProcess: postProcess
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apidoc",
"version": "0.2.2",
"version": "0.2.3",
"description": "RESTful web API Documentation Generator",
"author": "Peter Rottmann <[email protected]>",
"license": "MIT",
Expand Down
19 changes: 18 additions & 1 deletion template/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,24 @@ require([

// On change the Version of an article.
$("article .versions li.version a").on("click", changeVersionCompareTo);


$.urlParam = function(name) {
var results = new RegExp('[\\?&amp;]' + name + '=([^&amp;#]*)').exec(window.location.href);
return (results && results[1]) ? results[1] : null;
};

if($.urlParam("compare"))
{
// URL Paramter ?compare=1 is set.
$("#compareAllWithPredecessor").trigger("click");

if(window.location.hash)
{
var id = window.location.hash;
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) - 18 }, 0);
}
}

/**
*
*/
Expand Down

0 comments on commit 9fa9ff4

Please sign in to comment.