coddoc
Advanced tools
Comparing version 0.0.1 to 0.0.3
@@ -167,2 +167,16 @@ (function () { | ||
*/ | ||
function findFiles(dir, filePattern, fileMap) { | ||
var files = fs.readdirSync(dir); | ||
files.forEach(function (file) { | ||
var filePath = path.resolve(dir, file); | ||
var stat = fs.statSync(filePath); | ||
if (stat.isDirectory()) { | ||
findFiles(filePath, filePattern, fileMap); | ||
} else if (stat.isFile() && filePattern.test(file)) { | ||
fileMap[filePath] = fs.readFileSync(filePath, "utf8"); | ||
} | ||
}); | ||
} | ||
var coddoc = function (options) { | ||
@@ -176,14 +190,3 @@ | ||
if (!files) { | ||
(function findFiles(dir) { | ||
var files = fs.readdirSync(dir); | ||
files.forEach(function (file) { | ||
var filePath = path.resolve(dir, file); | ||
var stat = fs.statSync(filePath); | ||
if (stat.isDirectory()) { | ||
findFiles(filePath); | ||
} else if (stat.isFile() && filePattern.test(file)) { | ||
fileMap[filePath] = fs.readFileSync(filePath, "utf8"); | ||
} | ||
}); | ||
}(baseDir)); | ||
findFiles(baseDir, filePattern, fileMap); | ||
} else { | ||
@@ -194,3 +197,7 @@ var dir = process.cwd(); | ||
stat = fs.statSync(filePath); | ||
fileMap[filePath] = fs.readFileSync(filePath, "utf8"); | ||
if (stat.isDirectory()) { | ||
findFiles(file, filePattern, fileMap); | ||
} else { | ||
fileMap[filePath] = fs.readFileSync(filePath, "utf8"); | ||
} | ||
}); | ||
@@ -197,0 +204,0 @@ } |
@@ -41,3 +41,3 @@ (function () { | ||
} | ||
return {comment:comment, types:typeArr}; | ||
return {comment: comment, types: typeArr}; | ||
}; | ||
@@ -92,3 +92,3 @@ | ||
} | ||
return {comment:comment, name:{name:name, optional:optional, defaultValue:defaultValue}}; | ||
return {comment: comment, name: {name: name, optional: optional, defaultValue: defaultValue}}; | ||
}; | ||
@@ -199,4 +199,4 @@ | ||
tags[tag] = { | ||
parse:parse || function () { | ||
return {tag:tag, props:{}}; | ||
parse: parse || function () { | ||
return {tag: tag, props: {}}; | ||
}}; | ||
@@ -215,5 +215,5 @@ }); | ||
} | ||
var props = {augments:augmented.trim()}; | ||
var props = {augments: augmented.trim()}; | ||
symbol.augments.push(props); | ||
symbol.tags.push({tag:t, props:props}); | ||
symbol.tags.push({tag: t, props: props}); | ||
}); | ||
@@ -229,3 +229,3 @@ | ||
symbol.lends = lends; | ||
symbol.tags.push({tag:t, props:{lends:lends.trim()}}); | ||
symbol.tags.push({tag: t, props: {lends: lends.trim()}}); | ||
}); | ||
@@ -238,3 +238,3 @@ | ||
symbol.description = (symbol.description || "") + descr; | ||
symbol.tags.push({tag:t, props:{description:descr}}); | ||
symbol.tags.push({tag: t, props: {description: descr}}); | ||
}); | ||
@@ -262,3 +262,3 @@ | ||
} | ||
symbol.tags.push({tag:t, props:props}); | ||
symbol.tags.push({tag: t, props: props}); | ||
}); | ||
@@ -274,3 +274,3 @@ | ||
symbol.returns.push(props); | ||
symbol.tags.push({tag:t, props:props}); | ||
symbol.tags.push({tag: t, props: props}); | ||
}); | ||
@@ -285,3 +285,3 @@ | ||
symbol.memberof = descr; | ||
symbol.tags.push({tag:t, props:{of:descr}}); | ||
symbol.tags.push({tag: t, props: {of: descr}}); | ||
}); | ||
@@ -294,3 +294,3 @@ | ||
symbol.name = name; | ||
symbol.tags.push({tag:t, props:{name:name}}); | ||
symbol.tags.push({tag: t, props: {name: name}}); | ||
}); | ||
@@ -306,3 +306,3 @@ | ||
symbol.isConstructor = true; | ||
symbol.tags.push({tag:"constructor", props:{}}); | ||
symbol.tags.push({tag: "constructor", props: {}}); | ||
}); | ||
@@ -319,9 +319,9 @@ | ||
symbol.description += descr; | ||
symbol.tags.push({tag:t, props:{description:descr}}); | ||
symbol.tags.push({tag: t, props: {description: descr}}); | ||
}); | ||
addTagHandler("example", function (comment, symbol) { | ||
var props = {code:comment.replace(/@example\s*/, "").trim()}; | ||
var props = {code: comment.replace(/@example\s*/, "").trim()}; | ||
symbol.examples.push(props); | ||
symbol.tags.push({tag:"example", props:props}); | ||
symbol.tags.push({tag: "example", props: props}); | ||
}); | ||
@@ -331,5 +331,5 @@ | ||
function (comment, symbol) { | ||
var props = {description:comment.replace(/@see\s*/, "").trim()}; | ||
var props = {description: comment.replace(/@see\s*/, "").trim()}; | ||
symbol.see.push(props); | ||
symbol.tags.push({tag:"see", props:props}); | ||
symbol.tags.push({tag: "see", props: props}); | ||
}); | ||
@@ -340,3 +340,3 @@ | ||
symbol.isPrivate = true; | ||
symbol.tags.push({tag:"private", props:{}}); | ||
symbol.tags.push({tag: "private", props: {}}); | ||
}); | ||
@@ -347,3 +347,3 @@ | ||
symbol.isProtected = true; | ||
symbol.tags.push({tag:"protected", props:{}}); | ||
symbol.tags.push({tag: "protected", props: {}}); | ||
}); | ||
@@ -353,3 +353,3 @@ | ||
symbol.isStatic = true; | ||
symbol.tags.push({tag:"static", props:{}}); | ||
symbol.tags.push({tag: "static", props: {}}); | ||
}); | ||
@@ -361,3 +361,3 @@ | ||
symbol.isPublic = true; | ||
symbol.tags.push({tag:"public", props:{}}); | ||
symbol.tags.push({tag: "public", props: {}}); | ||
}); | ||
@@ -367,3 +367,3 @@ | ||
symbol.ignore = true; | ||
symbol.tags.push({tag:"ignore", props:{}}); | ||
symbol.tags.push({tag: "ignore", props: {}}); | ||
}); | ||
@@ -374,3 +374,3 @@ | ||
symbol.code = null; | ||
symbol.tags.push({tag:"ignoreCode", props:{}}); | ||
symbol.tags.push({tag: "ignoreCode", props: {}}); | ||
}); | ||
@@ -380,3 +380,3 @@ | ||
symbol.isFunction = true; | ||
symbol.tags.push({tag:"method", props:{}}); | ||
symbol.tags.push({tag: "method", props: {}}); | ||
}); | ||
@@ -386,9 +386,9 @@ | ||
symbol.isFunction = false; | ||
symbol.tags.push({tag:"field", props:{}}); | ||
symbol.tags.push({tag: "field", props: {}}); | ||
}); | ||
addTagHandler("type", function (comment, symbol) { | ||
var props = {type:comment.replace(/@type\s*/, "").trim()}; | ||
var props = {type: comment.replace(/@type\s*/, "").trim()}; | ||
symbol.type = props.type; | ||
symbol.tags.push({tag:"type", props:props}); | ||
symbol.tags.push({tag: "type", props: props}); | ||
}); | ||
@@ -398,5 +398,5 @@ | ||
addTagHandler("default", function (comment, symbol) { | ||
var props = {defaultValue:comment.replace(/@default\s*/, "")}; | ||
var props = {defaultValue: comment.replace(/@default\s*/, "")}; | ||
symbol.code = props.defaultValue; | ||
symbol.tags.push({tag:"default", props:props}); | ||
symbol.tags.push({tag: "default", props: props}); | ||
}); | ||
@@ -412,3 +412,3 @@ | ||
symbol.throws.push(props); | ||
symbol.tags.push({tag:t, props:props}); | ||
symbol.tags.push({tag: t, props: props}); | ||
}); | ||
@@ -427,4 +427,4 @@ | ||
props.description = comment.trim(); | ||
symbol.properties.push({name:props.name.name, type:types.types, code:props.name.defaultValue, description:props.description, isStatic:false}); | ||
symbol.tags.push({tag:t, props:props}); | ||
symbol.properties.push({name: props.name.name, type: types.types, code: props.name.defaultValue, description: props.description, isStatic: false}); | ||
symbol.tags.push({tag: t, props: props}); | ||
}); | ||
@@ -445,3 +445,3 @@ | ||
symbol.borrows.push(props); | ||
symbol.tags.push({tag:tag, props:props}); | ||
symbol.tags.push({tag: tag, props: props}); | ||
}); | ||
@@ -451,3 +451,3 @@ | ||
symbol.isConstant = true; | ||
symbol.tags.push({tag:"constant", props:{}}); | ||
symbol.tags.push({tag: "constant", props: {}}); | ||
}); | ||
@@ -458,3 +458,3 @@ | ||
symbol.description = (symbol.description || "") + description; | ||
symbol.tags.push({tag:"description", props:{description:description}}); | ||
symbol.tags.push({tag: "description", props: {description: description}}); | ||
}); | ||
@@ -466,3 +466,3 @@ | ||
symbol.projectName = (symbol.projectName || "") + description; | ||
symbol.tags.push({tag:t, props:{description:description}}); | ||
symbol.tags.push({tag: t, props: {description: description}}); | ||
}); | ||
@@ -473,4 +473,10 @@ | ||
symbol.isHeader = true; | ||
symbol.header = (symbol.header || "") + description; | ||
symbol.tags.push({tag:t, props:{description:description}}); | ||
var location = util.getTokensBetween(description, "[").join(""); | ||
if (location && util.isWhiteSpace(description.replace("[" + location + "]", ""))) { | ||
symbol.header = {location: location.trim(), file: symbol.file}; | ||
} else { | ||
symbol.header = {content: (symbol.header || "") + description}; | ||
} | ||
symbol.tags.push({tag: t, props: symbol.header}); | ||
}); | ||
@@ -481,4 +487,9 @@ | ||
symbol.isFooter = true; | ||
symbol.footer = (symbol.footer || "") + description; | ||
symbol.tags.push({tag:t, props:{description:description}}); | ||
var location = util.getTokensBetween(description, "[").join(""); | ||
if (location && util.isWhiteSpace(description.replace("[" + location + "]", ""))) { | ||
symbol.footer = {location: location.trim(), file: symbol.file}; | ||
} else { | ||
symbol.footer = {content: (symbol.footer || "") + description}; | ||
} | ||
symbol.tags.push({tag: t, props: symbol.footer}); | ||
}); | ||
@@ -490,12 +501,16 @@ | ||
symbol.github = description; | ||
symbol.tags.push({tag:t, props:{link:description}}); | ||
symbol.tags.push({tag: t, props: {link: description}}); | ||
}); | ||
addTagHandler("includeDoc", function (comment, symbol) { | ||
var t = "includeDoc", comment = comment.replace(/@includeDoc*\s*/, "").trim(); | ||
var t = "includeDoc", comment = comment.replace(/@includeDoc*\s*/, "").trim(), compile = true; | ||
var docName = util.getTokensBetween(comment, "[").join(""); | ||
var location = comment.replace("[" + docName + "]", "").trim(); | ||
var props = {docName:docName, file : symbol.file, location:location}; | ||
if (location.match(/^\[([^\]]*)\]$/)) { | ||
compile = false; | ||
location = location.replace(/^\[|\]$/ig, ""); | ||
} | ||
var props = {docName: docName, file: symbol.file, location: location, compile: compile}; | ||
symbol.includedDocs.push(props); | ||
symbol.tags.push({tag:t, props:props}); | ||
symbol.tags.push({tag: t, props: props}); | ||
}); | ||
@@ -502,0 +517,0 @@ |
@@ -5,3 +5,8 @@ (function () { | ||
function isWhiteSpace(str) { | ||
return str.replace(/[\s|\n|\r|\t]/g, "") === ""; | ||
} | ||
exports.isWhiteSpace = isWhiteSpace; | ||
exports.isString = function (obj) { | ||
@@ -16,3 +21,8 @@ var undef; | ||
exports.isBoolean = function (obj) { | ||
var undef, type = typeof obj; | ||
return obj != undef && type == "boolean" || type == "Boolean"; | ||
}; | ||
exports.isNumber = function (obj) { | ||
@@ -73,3 +83,3 @@ var undef; | ||
exports.splitName = function (name) { | ||
var parts = name.split("."), ret = {memberof:null, name:name}; | ||
var parts = name.split("."), ret = {memberof: null, name: name}; | ||
if (parts.length > 1) { | ||
@@ -132,3 +142,3 @@ ret.name = parts.pop(); | ||
function (s) { | ||
return {name:{name:s.trim()}}; | ||
return {name: {name: s.trim()}}; | ||
}).filter(function (s) { | ||
@@ -147,7 +157,7 @@ return s.name.name; | ||
var TOKEN_INVERTS = { | ||
"{":"}", | ||
"}":"{", | ||
"(":")", | ||
")":"(", | ||
"[":"]" | ||
"{": "}", | ||
"}": "{", | ||
"(": ")", | ||
")": "(", | ||
"[": "]" | ||
}; | ||
@@ -154,0 +164,0 @@ |
{ | ||
"name":"coddoc", | ||
"description":"Documentation generator", | ||
"version":"0.0.1", | ||
"keywords":["JSDOC", "Documentation", "docs", "doc", "markdown"], | ||
"repository":{ | ||
"type":"git", | ||
"url":"git@github.com:doug-martin/coddoc.git" | ||
}, | ||
"homepage":"http://doug-martin.github.com/coddoc", | ||
"author":"Doug Martin (http://blog.dougamartin.com)", | ||
"main":"index.js", | ||
"dependencies":{ | ||
"handlebars":">=1.0.5beta", | ||
"commander":">=0.5.1" | ||
}, | ||
"devDependencies":{ | ||
"it":">=0.0.2" | ||
}, | ||
"bin":{ | ||
"coddoc":"./bin/coddoc" | ||
}, | ||
"directories":{ | ||
"lib":"lib", | ||
"templates":"templates" | ||
}, | ||
"engines":{ | ||
"node":">= 0.6.1" | ||
} | ||
"name": "coddoc", | ||
"description": "Documentation generator", | ||
"version": "0.0.3", | ||
"keywords": [ | ||
"JSDOC", | ||
"Documentation", | ||
"docs", | ||
"doc", | ||
"markdown" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:doug-martin/coddoc.git" | ||
}, | ||
"homepage": "http://doug-martin.github.com/coddoc", | ||
"author": "Doug Martin (http://blog.dougamartin.com)", | ||
"main": "index.js", | ||
"dependencies": { | ||
"commander": ">=0.5.1", | ||
"marked": "~0.2.8", | ||
"handlebars": "~1.0.10", | ||
"wrench": "~1.4.4" | ||
}, | ||
"devDependencies": { | ||
"it": ">=0.0.2" | ||
}, | ||
"bin": { | ||
"coddoc": "./bin/coddoc" | ||
}, | ||
"directories": { | ||
"lib": "lib", | ||
"templates": "templates" | ||
}, | ||
"engines": { | ||
"node": ">= 0.6.1" | ||
} | ||
} |
/* =================================================== | ||
* bootstrap-transition.js v2.0.3 | ||
* bootstrap-transition.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#transitions | ||
@@ -23,9 +23,9 @@ * =================================================== | ||
$(function () { | ||
"use strict"; // jshint ;_; | ||
"use strict"; // jshint ;_; | ||
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/) | ||
* ======================================================= */ | ||
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/) | ||
* ======================================================= */ | ||
$(function () { | ||
@@ -40,4 +40,3 @@ $.support.transition = (function () { | ||
, 'MozTransition' : 'transitionend' | ||
, 'OTransition' : 'oTransitionEnd' | ||
, 'msTransition' : 'MSTransitionEnd' | ||
, 'OTransition' : 'oTransitionEnd otransitionend' | ||
, 'transition' : 'transitionend' | ||
@@ -64,3 +63,3 @@ } | ||
}(window.jQuery);/* ========================================================== | ||
* bootstrap-alert.js v2.0.3 | ||
* bootstrap-alert.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#alerts | ||
@@ -134,2 +133,4 @@ * ========================================================== | ||
var old = $.fn.alert | ||
$.fn.alert = function (option) { | ||
@@ -147,11 +148,18 @@ return this.each(function () { | ||
/* ALERT NO CONFLICT | ||
* ================= */ | ||
$.fn.alert.noConflict = function () { | ||
$.fn.alert = old | ||
return this | ||
} | ||
/* ALERT DATA-API | ||
* ============== */ | ||
$(function () { | ||
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close) | ||
}) | ||
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close) | ||
}(window.jQuery);/* ============================================================ | ||
* bootstrap-button.js v2.0.3 | ||
* bootstrap-button.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#buttons | ||
@@ -208,3 +216,3 @@ * ============================================================ | ||
Button.prototype.toggle = function () { | ||
var $parent = this.$element.parent('[data-toggle="buttons-radio"]') | ||
var $parent = this.$element.closest('[data-toggle="buttons-radio"]') | ||
@@ -222,2 +230,4 @@ $parent && $parent | ||
var old = $.fn.button | ||
$.fn.button = function (option) { | ||
@@ -241,15 +251,22 @@ return this.each(function () { | ||
/* BUTTON NO CONFLICT | ||
* ================== */ | ||
$.fn.button.noConflict = function () { | ||
$.fn.button = old | ||
return this | ||
} | ||
/* BUTTON DATA-API | ||
* =============== */ | ||
$(function () { | ||
$('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) { | ||
var $btn = $(e.target) | ||
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') | ||
$btn.button('toggle') | ||
}) | ||
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { | ||
var $btn = $(e.target) | ||
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') | ||
$btn.button('toggle') | ||
}) | ||
}(window.jQuery);/* ========================================================== | ||
* bootstrap-carousel.js v2.0.3 | ||
* bootstrap-carousel.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#carousel | ||
@@ -283,4 +300,4 @@ * ========================================================== | ||
this.$element = $(element) | ||
this.$indicators = this.$element.find('.carousel-indicators') | ||
this.options = options | ||
this.options.slide && this.slide(this.options.slide) | ||
this.options.pause == 'hover' && this.$element | ||
@@ -295,2 +312,3 @@ .on('mouseenter', $.proxy(this.pause, this)) | ||
if (!e) this.paused = false | ||
if (this.interval) clearInterval(this.interval); | ||
this.options.interval | ||
@@ -302,9 +320,13 @@ && !this.paused | ||
, getActiveIndex: function () { | ||
this.$active = this.$element.find('.item.active') | ||
this.$items = this.$active.parent().children() | ||
return this.$items.index(this.$active) | ||
} | ||
, to: function (pos) { | ||
var $active = this.$element.find('.active') | ||
, children = $active.parent().children() | ||
, activePos = children.index($active) | ||
var activeIndex = this.getActiveIndex() | ||
, that = this | ||
if (pos > (children.length - 1) || pos < 0) return | ||
if (pos > (this.$items.length - 1) || pos < 0) return | ||
@@ -317,7 +339,7 @@ if (this.sliding) { | ||
if (activePos == pos) { | ||
if (activeIndex == pos) { | ||
return this.pause().cycle() | ||
} | ||
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) | ||
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) | ||
} | ||
@@ -327,2 +349,6 @@ | ||
if (!e) this.paused = true | ||
if (this.$element.find('.next, .prev').length && $.support.transition.end) { | ||
this.$element.trigger($.support.transition.end) | ||
this.cycle() | ||
} | ||
clearInterval(this.interval) | ||
@@ -344,3 +370,3 @@ this.interval = null | ||
, slide: function (type, next) { | ||
var $active = this.$element.find('.active') | ||
var $active = this.$element.find('.item.active') | ||
, $next = next || $active[type]() | ||
@@ -351,3 +377,3 @@ , isCycling = this.interval | ||
, that = this | ||
, e = $.Event('slide') | ||
, e | ||
@@ -360,4 +386,17 @@ this.sliding = true | ||
e = $.Event('slide', { | ||
relatedTarget: $next[0] | ||
, direction: direction | ||
}) | ||
if ($next.hasClass('active')) return | ||
if (this.$indicators.length) { | ||
this.$indicators.find('.active').removeClass('active') | ||
this.$element.one('slid', function () { | ||
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) | ||
$nextIndicator && $nextIndicator.addClass('active') | ||
}) | ||
} | ||
if ($.support.transition && this.$element.hasClass('slide')) { | ||
@@ -396,2 +435,4 @@ this.$element.trigger(e) | ||
var old = $.fn.carousel | ||
$.fn.carousel = function (option) { | ||
@@ -402,6 +443,7 @@ return this.each(function () { | ||
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) | ||
, action = typeof option == 'string' ? option : options.slide | ||
if (!data) $this.data('carousel', (data = new Carousel(this, options))) | ||
if (typeof option == 'number') data.to(option) | ||
else if (typeof option == 'string' || (option = options.slide)) data[option]() | ||
else if (options.interval) data.cycle() | ||
else if (action) data[action]() | ||
else if (options.interval) data.pause().cycle() | ||
}) | ||
@@ -418,17 +460,30 @@ } | ||
/* CAROUSEL NO CONFLICT | ||
* ==================== */ | ||
$.fn.carousel.noConflict = function () { | ||
$.fn.carousel = old | ||
return this | ||
} | ||
/* CAROUSEL DATA-API | ||
* ================= */ | ||
$(function () { | ||
$('body').on('click.carousel.data-api', '[data-slide]', function ( e ) { | ||
var $this = $(this), href | ||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 | ||
, options = !$target.data('modal') && $.extend({}, $target.data(), $this.data()) | ||
$target.carousel(options) | ||
e.preventDefault() | ||
}) | ||
$(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { | ||
var $this = $(this), href | ||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 | ||
, options = $.extend({}, $target.data(), $this.data()) | ||
, slideIndex | ||
$target.carousel(options) | ||
if (slideIndex = $this.attr('data-slide-to')) { | ||
$target.data('carousel').pause().to(slideIndex).cycle() | ||
} | ||
e.preventDefault() | ||
}) | ||
}(window.jQuery);/* ============================================================= | ||
* bootstrap-collapse.js v2.0.3 | ||
* bootstrap-collapse.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#collapse | ||
@@ -486,3 +541,3 @@ * ============================================================= | ||
if (this.transitioning) return | ||
if (this.transitioning || this.$element.hasClass('in')) return | ||
@@ -502,3 +557,3 @@ dimension = this.dimension() | ||
this.transition('addClass', $.Event('show'), 'shown') | ||
this.$element[dimension](this.$element[0][scroll]) | ||
$.support.transition && this.$element[dimension](this.$element[0][scroll]) | ||
} | ||
@@ -508,3 +563,3 @@ | ||
var dimension | ||
if (this.transitioning) return | ||
if (this.transitioning || !this.$element.hasClass('in')) return | ||
dimension = this.dimension() | ||
@@ -557,5 +612,7 @@ this.reset(this.$element[dimension]()) | ||
/* COLLAPSIBLE PLUGIN DEFINITION | ||
* ============================== */ | ||
/* COLLAPSE PLUGIN DEFINITION | ||
* ========================== */ | ||
var old = $.fn.collapse | ||
$.fn.collapse = function (option) { | ||
@@ -565,3 +622,3 @@ return this.each(function () { | ||
, data = $this.data('collapse') | ||
, options = typeof option == 'object' && option | ||
, options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) | ||
if (!data) $this.data('collapse', (data = new Collapse(this, options))) | ||
@@ -579,18 +636,26 @@ if (typeof option == 'string') data[option]() | ||
/* COLLAPSIBLE DATA-API | ||
/* COLLAPSE NO CONFLICT | ||
* ==================== */ | ||
$(function () { | ||
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) { | ||
var $this = $(this), href | ||
, target = $this.attr('data-target') | ||
|| e.preventDefault() | ||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 | ||
, option = $(target).data('collapse') ? 'toggle' : $this.data() | ||
$(target).collapse(option) | ||
}) | ||
$.fn.collapse.noConflict = function () { | ||
$.fn.collapse = old | ||
return this | ||
} | ||
/* COLLAPSE DATA-API | ||
* ================= */ | ||
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { | ||
var $this = $(this), href | ||
, target = $this.attr('data-target') | ||
|| e.preventDefault() | ||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 | ||
, option = $(target).data('collapse') ? 'toggle' : $this.data() | ||
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') | ||
$(target).collapse(option) | ||
}) | ||
}(window.jQuery);/* ============================================================ | ||
* bootstrap-dropdown.js v2.0.3 | ||
* bootstrap-dropdown.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#dropdowns | ||
@@ -622,3 +687,3 @@ * ============================================================ | ||
var toggle = '[data-toggle="dropdown"]' | ||
var toggle = '[data-toggle=dropdown]' | ||
, Dropdown = function (element) { | ||
@@ -638,3 +703,2 @@ var $el = $(element).on('click.dropdown.data-api', this.toggle) | ||
, $parent | ||
, selector | ||
, isActive | ||
@@ -644,19 +708,56 @@ | ||
selector = $this.attr('data-target') | ||
$parent = getParent($this) | ||
if (!selector) { | ||
selector = $this.attr('href') | ||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 | ||
isActive = $parent.hasClass('open') | ||
clearMenus() | ||
if (!isActive) { | ||
$parent.toggleClass('open') | ||
} | ||
$parent = $(selector) | ||
$parent.length || ($parent = $this.parent()) | ||
$this.focus() | ||
return false | ||
} | ||
, keydown: function (e) { | ||
var $this | ||
, $items | ||
, $active | ||
, $parent | ||
, isActive | ||
, index | ||
if (!/(38|40|27)/.test(e.keyCode)) return | ||
$this = $(this) | ||
e.preventDefault() | ||
e.stopPropagation() | ||
if ($this.is('.disabled, :disabled')) return | ||
$parent = getParent($this) | ||
isActive = $parent.hasClass('open') | ||
clearMenus() | ||
if (!isActive || (isActive && e.keyCode == 27)) { | ||
if (e.which == 27) $parent.find(toggle).focus() | ||
return $this.click() | ||
} | ||
if (!isActive) $parent.toggleClass('open') | ||
$items = $('[role=menu] li:not(.divider):visible a', $parent) | ||
return false | ||
if (!$items.length) return | ||
index = $items.index($items.filter(':focus')) | ||
if (e.keyCode == 38 && index > 0) index-- // up | ||
if (e.keyCode == 40 && index < $items.length - 1) index++ // down | ||
if (!~index) index = 0 | ||
$items | ||
.eq(index) | ||
.focus() | ||
} | ||
@@ -667,9 +768,29 @@ | ||
function clearMenus() { | ||
$(toggle).parent().removeClass('open') | ||
$(toggle).each(function () { | ||
getParent($(this)).removeClass('open') | ||
}) | ||
} | ||
function getParent($this) { | ||
var selector = $this.attr('data-target') | ||
, $parent | ||
if (!selector) { | ||
selector = $this.attr('href') | ||
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 | ||
} | ||
$parent = selector && $(selector) | ||
if (!$parent || !$parent.length) $parent = $this.parent() | ||
return $parent | ||
} | ||
/* DROPDOWN PLUGIN DEFINITION | ||
* ========================== */ | ||
var old = $.fn.dropdown | ||
$.fn.dropdown = function (option) { | ||
@@ -687,14 +808,24 @@ return this.each(function () { | ||
/* DROPDOWN NO CONFLICT | ||
* ==================== */ | ||
$.fn.dropdown.noConflict = function () { | ||
$.fn.dropdown = old | ||
return this | ||
} | ||
/* APPLY TO STANDARD DROPDOWN ELEMENTS | ||
* =================================== */ | ||
$(function () { | ||
$('html').on('click.dropdown.data-api', clearMenus) | ||
$('body') | ||
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() }) | ||
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) | ||
}) | ||
$(document) | ||
.on('click.dropdown.data-api', clearMenus) | ||
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) | ||
.on('.dropdown-menu', function (e) { e.stopPropagation() }) | ||
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle) | ||
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) | ||
}(window.jQuery);/* ========================================================= | ||
* bootstrap-modal.js v2.0.3 | ||
}(window.jQuery); | ||
/* ========================================================= | ||
* bootstrap-modal.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#modals | ||
@@ -726,6 +857,7 @@ * ========================================================= | ||
var Modal = function (content, options) { | ||
var Modal = function (element, options) { | ||
this.options = options | ||
this.$element = $(content) | ||
this.$element = $(element) | ||
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) | ||
this.options.remote && this.$element.find('.modal-body').load(this.options.remote) | ||
} | ||
@@ -749,8 +881,7 @@ | ||
$('body').addClass('modal-open') | ||
this.isShown = true | ||
escape.call(this) | ||
backdrop.call(this, function () { | ||
this.escape() | ||
this.backdrop(function () { | ||
var transition = $.support.transition && that.$element.hasClass('fade') | ||
@@ -762,4 +893,3 @@ | ||
that.$element | ||
.show() | ||
that.$element.show() | ||
@@ -770,7 +900,11 @@ if (transition) { | ||
that.$element.addClass('in') | ||
that.$element | ||
.addClass('in') | ||
.attr('aria-hidden', false) | ||
that.enforceFocus() | ||
transition ? | ||
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : | ||
that.$element.trigger('shown') | ||
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : | ||
that.$element.focus().trigger('shown') | ||
@@ -793,94 +927,107 @@ }) | ||
$('body').removeClass('modal-open') | ||
this.escape() | ||
escape.call(this) | ||
$(document).off('focusin.modal') | ||
this.$element.removeClass('in') | ||
this.$element | ||
.removeClass('in') | ||
.attr('aria-hidden', true) | ||
$.support.transition && this.$element.hasClass('fade') ? | ||
hideWithTransition.call(this) : | ||
hideModal.call(this) | ||
this.hideWithTransition() : | ||
this.hideModal() | ||
} | ||
} | ||
, enforceFocus: function () { | ||
var that = this | ||
$(document).on('focusin.modal', function (e) { | ||
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { | ||
that.$element.focus() | ||
} | ||
}) | ||
} | ||
, escape: function () { | ||
var that = this | ||
if (this.isShown && this.options.keyboard) { | ||
this.$element.on('keyup.dismiss.modal', function ( e ) { | ||
e.which == 27 && that.hide() | ||
}) | ||
} else if (!this.isShown) { | ||
this.$element.off('keyup.dismiss.modal') | ||
} | ||
} | ||
/* MODAL PRIVATE METHODS | ||
* ===================== */ | ||
, hideWithTransition: function () { | ||
var that = this | ||
, timeout = setTimeout(function () { | ||
that.$element.off($.support.transition.end) | ||
that.hideModal() | ||
}, 500) | ||
function hideWithTransition() { | ||
var that = this | ||
, timeout = setTimeout(function () { | ||
that.$element.off($.support.transition.end) | ||
hideModal.call(that) | ||
}, 500) | ||
this.$element.one($.support.transition.end, function () { | ||
clearTimeout(timeout) | ||
that.hideModal() | ||
}) | ||
} | ||
this.$element.one($.support.transition.end, function () { | ||
clearTimeout(timeout) | ||
hideModal.call(that) | ||
}) | ||
} | ||
, hideModal: function () { | ||
var that = this | ||
this.$element.hide() | ||
this.backdrop(function () { | ||
that.removeBackdrop() | ||
that.$element.trigger('hidden') | ||
}) | ||
} | ||
function hideModal(that) { | ||
this.$element | ||
.hide() | ||
.trigger('hidden') | ||
, removeBackdrop: function () { | ||
this.$backdrop.remove() | ||
this.$backdrop = null | ||
} | ||
backdrop.call(this) | ||
} | ||
, backdrop: function (callback) { | ||
var that = this | ||
, animate = this.$element.hasClass('fade') ? 'fade' : '' | ||
function backdrop(callback) { | ||
var that = this | ||
, animate = this.$element.hasClass('fade') ? 'fade' : '' | ||
if (this.isShown && this.options.backdrop) { | ||
var doAnimate = $.support.transition && animate | ||
if (this.isShown && this.options.backdrop) { | ||
var doAnimate = $.support.transition && animate | ||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') | ||
.appendTo(document.body) | ||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') | ||
.appendTo(document.body) | ||
this.$backdrop.click( | ||
this.options.backdrop == 'static' ? | ||
$.proxy(this.$element[0].focus, this.$element[0]) | ||
: $.proxy(this.hide, this) | ||
) | ||
if (this.options.backdrop != 'static') { | ||
this.$backdrop.click($.proxy(this.hide, this)) | ||
} | ||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow | ||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow | ||
this.$backdrop.addClass('in') | ||
this.$backdrop.addClass('in') | ||
if (!callback) return | ||
doAnimate ? | ||
this.$backdrop.one($.support.transition.end, callback) : | ||
callback() | ||
doAnimate ? | ||
this.$backdrop.one($.support.transition.end, callback) : | ||
callback() | ||
} else if (!this.isShown && this.$backdrop) { | ||
this.$backdrop.removeClass('in') | ||
} else if (!this.isShown && this.$backdrop) { | ||
this.$backdrop.removeClass('in') | ||
$.support.transition && this.$element.hasClass('fade')? | ||
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) : | ||
removeBackdrop.call(this) | ||
$.support.transition && this.$element.hasClass('fade')? | ||
this.$backdrop.one($.support.transition.end, callback) : | ||
callback() | ||
} else if (callback) { | ||
callback() | ||
} | ||
} else if (callback) { | ||
callback() | ||
} | ||
} | ||
} | ||
function removeBackdrop() { | ||
this.$backdrop.remove() | ||
this.$backdrop = null | ||
} | ||
function escape() { | ||
var that = this | ||
if (this.isShown && this.options.keyboard) { | ||
$(document).on('keyup.dismiss.modal', function ( e ) { | ||
e.which == 27 && that.hide() | ||
}) | ||
} else if (!this.isShown) { | ||
$(document).off('keyup.dismiss.modal') | ||
} | ||
} | ||
/* MODAL PLUGIN DEFINITION | ||
* ======================= */ | ||
var old = $.fn.modal | ||
$.fn.modal = function (option) { | ||
@@ -906,18 +1053,32 @@ return this.each(function () { | ||
/* MODAL NO CONFLICT | ||
* ================= */ | ||
$.fn.modal.noConflict = function () { | ||
$.fn.modal = old | ||
return this | ||
} | ||
/* MODAL DATA-API | ||
* ============== */ | ||
$(function () { | ||
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) { | ||
var $this = $(this), href | ||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 | ||
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data()) | ||
$(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) { | ||
var $this = $(this) | ||
, href = $this.attr('href') | ||
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 | ||
, option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data()) | ||
e.preventDefault() | ||
$target.modal(option) | ||
}) | ||
e.preventDefault() | ||
$target | ||
.modal(option) | ||
.one('hide', function () { | ||
$this.focus() | ||
}) | ||
}) | ||
}(window.jQuery);/* =========================================================== | ||
* bootstrap-tooltip.js v2.0.3 | ||
}(window.jQuery); | ||
/* =========================================================== | ||
* bootstrap-tooltip.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#tooltips | ||
@@ -961,2 +1122,5 @@ * Inspired by the original jQuery.tipsy by Jason Frame | ||
, eventOut | ||
, triggers | ||
, trigger | ||
, i | ||
@@ -968,7 +1132,14 @@ this.type = type | ||
if (this.options.trigger != 'manual') { | ||
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus' | ||
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur' | ||
this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this)) | ||
this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this)) | ||
triggers = this.options.trigger.split(' ') | ||
for (i = triggers.length; i--;) { | ||
trigger = triggers[i] | ||
if (trigger == 'click') { | ||
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) | ||
} else if (trigger != 'manual') { | ||
eventIn = trigger == 'hover' ? 'mouseenter' : 'focus' | ||
eventOut = trigger == 'hover' ? 'mouseleave' : 'blur' | ||
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) | ||
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) | ||
} | ||
} | ||
@@ -982,3 +1153,3 @@ | ||
, getOptions: function (options) { | ||
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data()) | ||
options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options) | ||
@@ -1010,5 +1181,5 @@ if (options.delay && typeof options.delay == 'number') { | ||
if (this.timeout) clearTimeout(this.timeout) | ||
if (!self.options.delay || !self.options.delay.hide) return self.hide() | ||
clearTimeout(this.timeout) | ||
self.hoverState = 'out' | ||
@@ -1022,3 +1193,2 @@ this.timeout = setTimeout(function() { | ||
var $tip | ||
, inside | ||
, pos | ||
@@ -1029,4 +1199,7 @@ , actualWidth | ||
, tp | ||
, e = $.Event('show') | ||
if (this.hasContent() && this.enabled) { | ||
this.$element.trigger(e) | ||
if (e.isDefaultPrevented()) return | ||
$tip = this.tip() | ||
@@ -1043,15 +1216,14 @@ this.setContent() | ||
inside = /in/.test(placement) | ||
$tip | ||
.remove() | ||
.detach() | ||
.css({ top: 0, left: 0, display: 'block' }) | ||
.appendTo(inside ? this.$element : document.body) | ||
pos = this.getPosition(inside) | ||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) | ||
pos = this.getPosition() | ||
actualWidth = $tip[0].offsetWidth | ||
actualHeight = $tip[0].offsetHeight | ||
switch (inside ? placement.split(' ')[1] : placement) { | ||
switch (placement) { | ||
case 'bottom': | ||
@@ -1071,18 +1243,54 @@ tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} | ||
$tip | ||
.css(tp) | ||
.addClass(placement) | ||
.addClass('in') | ||
this.applyPlacement(tp, placement) | ||
this.$element.trigger('shown') | ||
} | ||
} | ||
, isHTML: function(text) { | ||
// html string detection logic adapted from jQuery | ||
return typeof text != 'string' | ||
|| ( text.charAt(0) === "<" | ||
&& text.charAt( text.length - 1 ) === ">" | ||
&& text.length >= 3 | ||
) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text) | ||
, applyPlacement: function(offset, placement){ | ||
var $tip = this.tip() | ||
, width = $tip[0].offsetWidth | ||
, height = $tip[0].offsetHeight | ||
, actualWidth | ||
, actualHeight | ||
, delta | ||
, replace | ||
$tip | ||
.offset(offset) | ||
.addClass(placement) | ||
.addClass('in') | ||
actualWidth = $tip[0].offsetWidth | ||
actualHeight = $tip[0].offsetHeight | ||
if (placement == 'top' && actualHeight != height) { | ||
offset.top = offset.top + height - actualHeight | ||
replace = true | ||
} | ||
if (placement == 'bottom' || placement == 'top') { | ||
delta = 0 | ||
if (offset.left < 0){ | ||
delta = offset.left * -2 | ||
offset.left = 0 | ||
$tip.offset(offset) | ||
actualWidth = $tip[0].offsetWidth | ||
actualHeight = $tip[0].offsetHeight | ||
} | ||
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') | ||
} else { | ||
this.replaceArrow(actualHeight - height, actualHeight, 'top') | ||
} | ||
if (replace) $tip.offset(offset) | ||
} | ||
, replaceArrow: function(delta, dimension, position){ | ||
this | ||
.arrow() | ||
.css(position, delta ? (50 * (1 - delta / dimension) + "%") : '') | ||
} | ||
, setContent: function () { | ||
@@ -1092,3 +1300,3 @@ var $tip = this.tip() | ||
$tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title) | ||
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) | ||
$tip.removeClass('fade in top bottom left right') | ||
@@ -1100,3 +1308,7 @@ } | ||
, $tip = this.tip() | ||
, e = $.Event('hide') | ||
this.$element.trigger(e) | ||
if (e.isDefaultPrevented()) return | ||
$tip.removeClass('in') | ||
@@ -1106,3 +1318,3 @@ | ||
var timeout = setTimeout(function () { | ||
$tip.off($.support.transition.end).remove() | ||
$tip.off($.support.transition.end).detach() | ||
}, 500) | ||
@@ -1112,3 +1324,3 @@ | ||
clearTimeout(timeout) | ||
$tip.remove() | ||
$tip.detach() | ||
}) | ||
@@ -1119,3 +1331,7 @@ } | ||
removeWithAnimation() : | ||
$tip.remove() | ||
$tip.detach() | ||
this.$element.trigger('hidden') | ||
return this | ||
} | ||
@@ -1126,3 +1342,3 @@ | ||
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { | ||
$e.attr('data-original-title', $e.attr('title') || '').removeAttr('title') | ||
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '') | ||
} | ||
@@ -1135,7 +1351,8 @@ } | ||
, getPosition: function (inside) { | ||
return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), { | ||
width: this.$element[0].offsetWidth | ||
, height: this.$element[0].offsetHeight | ||
}) | ||
, getPosition: function () { | ||
var el = this.$element[0] | ||
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { | ||
width: el.offsetWidth | ||
, height: el.offsetHeight | ||
}, this.$element.offset()) | ||
} | ||
@@ -1158,2 +1375,6 @@ | ||
, arrow: function(){ | ||
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") | ||
} | ||
, validate: function () { | ||
@@ -1179,6 +1400,11 @@ if (!this.$element[0].parentNode) { | ||
, toggle: function () { | ||
this[this.tip().hasClass('in') ? 'hide' : 'show']() | ||
, toggle: function (e) { | ||
var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this | ||
self.tip().hasClass('in') ? self.hide() : self.show() | ||
} | ||
, destroy: function () { | ||
this.hide().$element.off('.' + this.type).removeData(this.type) | ||
} | ||
} | ||
@@ -1190,2 +1416,4 @@ | ||
var old = $.fn.tooltip | ||
$.fn.tooltip = function ( option ) { | ||
@@ -1208,9 +1436,21 @@ return this.each(function () { | ||
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' | ||
, trigger: 'hover' | ||
, trigger: 'hover focus' | ||
, title: '' | ||
, delay: 0 | ||
, html: false | ||
, container: false | ||
} | ||
}(window.jQuery);/* =========================================================== | ||
* bootstrap-popover.js v2.0.3 | ||
/* TOOLTIP NO CONFLICT | ||
* =================== */ | ||
$.fn.tooltip.noConflict = function () { | ||
$.fn.tooltip = old | ||
return this | ||
} | ||
}(window.jQuery); | ||
/* =========================================================== | ||
* bootstrap-popover.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#popovers | ||
@@ -1242,3 +1482,3 @@ * =========================================================== | ||
var Popover = function ( element, options ) { | ||
var Popover = function (element, options) { | ||
this.init('popover', element, options) | ||
@@ -1260,4 +1500,4 @@ } | ||
$tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title) | ||
$tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content) | ||
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) | ||
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) | ||
@@ -1276,4 +1516,4 @@ $tip.removeClass('fade top bottom left right in') | ||
content = $e.attr('data-content') | ||
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) | ||
content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) | ||
|| $e.attr('data-content') | ||
@@ -1290,2 +1530,6 @@ return content | ||
, destroy: function () { | ||
this.hide().$element.off('.' + this.type).removeData(this.type) | ||
} | ||
}) | ||
@@ -1297,2 +1541,4 @@ | ||
var old = $.fn.popover | ||
$.fn.popover = function (option) { | ||
@@ -1312,8 +1558,19 @@ return this.each(function () { | ||
placement: 'right' | ||
, trigger: 'click' | ||
, content: '' | ||
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>' | ||
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' | ||
}) | ||
}(window.jQuery);/* ============================================================= | ||
* bootstrap-scrollspy.js v2.0.3 | ||
/* POPOVER NO CONFLICT | ||
* =================== */ | ||
$.fn.popover.noConflict = function () { | ||
$.fn.popover = old | ||
return this | ||
} | ||
}(window.jQuery); | ||
/* ============================================================= | ||
* bootstrap-scrollspy.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#scrollspy | ||
@@ -1342,6 +1599,6 @@ * ============================================================= | ||
/* SCROLLSPY CLASS DEFINITION | ||
* ========================== */ | ||
/* SCROLLSPY CLASS DEFINITION | ||
* ========================== */ | ||
function ScrollSpy( element, options) { | ||
function ScrollSpy(element, options) { | ||
var process = $.proxy(this.process, this) | ||
@@ -1351,3 +1608,3 @@ , $element = $(element).is('body') ? $(window) : $(element) | ||
this.options = $.extend({}, $.fn.scrollspy.defaults, options) | ||
this.$scrollElement = $element.on('scroll.scroll.data-api', process) | ||
this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process) | ||
this.selector = (this.options.target | ||
@@ -1379,4 +1636,4 @@ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 | ||
return ( $href | ||
&& href.length | ||
&& [[ $href.position().top, href ]] ) || null | ||
&& $href.length | ||
&& [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null | ||
}) | ||
@@ -1430,3 +1687,3 @@ .sort(function (a, b) { return a[0] - b[0] }) | ||
if (active.parent('.dropdown-menu')) { | ||
if (active.parent('.dropdown-menu').length) { | ||
active = active.closest('li.dropdown').addClass('active') | ||
@@ -1444,3 +1701,5 @@ } | ||
$.fn.scrollspy = function ( option ) { | ||
var old = $.fn.scrollspy | ||
$.fn.scrollspy = function (option) { | ||
return this.each(function () { | ||
@@ -1462,6 +1721,15 @@ var $this = $(this) | ||
/* SCROLLSPY NO CONFLICT | ||
* ===================== */ | ||
$.fn.scrollspy.noConflict = function () { | ||
$.fn.scrollspy = old | ||
return this | ||
} | ||
/* SCROLLSPY DATA-API | ||
* ================== */ | ||
$(function () { | ||
$(window).on('load', function () { | ||
$('[data-spy="scroll"]').each(function () { | ||
@@ -1474,3 +1742,3 @@ var $spy = $(this) | ||
}(window.jQuery);/* ======================================================== | ||
* bootstrap-tab.js v2.0.3 | ||
* bootstrap-tab.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#tabs | ||
@@ -1502,3 +1770,3 @@ * ======================================================== | ||
var Tab = function ( element ) { | ||
var Tab = function (element) { | ||
this.element = $(element) | ||
@@ -1526,3 +1794,3 @@ } | ||
previous = $ul.find('.active a').last()[0] | ||
previous = $ul.find('.active:last a')[0] | ||
@@ -1588,2 +1856,4 @@ e = $.Event('show', { | ||
var old = $.fn.tab | ||
$.fn.tab = function ( option ) { | ||
@@ -1601,14 +1871,21 @@ return this.each(function () { | ||
/* TAB NO CONFLICT | ||
* =============== */ | ||
$.fn.tab.noConflict = function () { | ||
$.fn.tab = old | ||
return this | ||
} | ||
/* TAB DATA-API | ||
* ============ */ | ||
$(function () { | ||
$('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { | ||
e.preventDefault() | ||
$(this).tab('show') | ||
}) | ||
$(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { | ||
e.preventDefault() | ||
$(this).tab('show') | ||
}) | ||
}(window.jQuery);/* ============================================================= | ||
* bootstrap-typeahead.js v2.0.3 | ||
* bootstrap-typeahead.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#typeahead | ||
@@ -1647,4 +1924,4 @@ * ============================================================= | ||
this.updater = this.options.updater || this.updater | ||
this.$menu = $(this.options.menu).appendTo('body') | ||
this.source = this.options.source | ||
this.$menu = $(this.options.menu) | ||
this.shown = false | ||
@@ -1671,12 +1948,14 @@ this.listen() | ||
, show: function () { | ||
var pos = $.extend({}, this.$element.offset(), { | ||
var pos = $.extend({}, this.$element.position(), { | ||
height: this.$element[0].offsetHeight | ||
}) | ||
this.$menu.css({ | ||
top: pos.top + pos.height | ||
, left: pos.left | ||
}) | ||
this.$menu | ||
.insertAfter(this.$element) | ||
.css({ | ||
top: pos.top + pos.height | ||
, left: pos.left | ||
}) | ||
.show() | ||
this.$menu.show() | ||
this.shown = true | ||
@@ -1693,13 +1972,19 @@ return this | ||
, lookup: function (event) { | ||
var that = this | ||
, items | ||
, q | ||
var items | ||
this.query = this.$element.val() | ||
if (!this.query) { | ||
if (!this.query || this.query.length < this.options.minLength) { | ||
return this.shown ? this.hide() : this | ||
} | ||
items = $.grep(this.source, function (item) { | ||
items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source | ||
return items ? this.process(items) : this | ||
} | ||
, process: function (items) { | ||
var that = this | ||
items = $.grep(items, function (item) { | ||
return that.matcher(item) | ||
@@ -1781,2 +2066,3 @@ }) | ||
this.$element | ||
.on('focus', $.proxy(this.focus, this)) | ||
.on('blur', $.proxy(this.blur, this)) | ||
@@ -1786,4 +2072,4 @@ .on('keypress', $.proxy(this.keypress, this)) | ||
if ($.browser.webkit || $.browser.msie) { | ||
this.$element.on('keydown', $.proxy(this.keypress, this)) | ||
if (this.eventSupported('keydown')) { | ||
this.$element.on('keydown', $.proxy(this.keydown, this)) | ||
} | ||
@@ -1794,4 +2080,48 @@ | ||
.on('mouseenter', 'li', $.proxy(this.mouseenter, this)) | ||
.on('mouseleave', 'li', $.proxy(this.mouseleave, this)) | ||
} | ||
, eventSupported: function(eventName) { | ||
var isSupported = eventName in this.$element | ||
if (!isSupported) { | ||
this.$element.setAttribute(eventName, 'return;') | ||
isSupported = typeof this.$element[eventName] === 'function' | ||
} | ||
return isSupported | ||
} | ||
, move: function (e) { | ||
if (!this.shown) return | ||
switch(e.keyCode) { | ||
case 9: // tab | ||
case 13: // enter | ||
case 27: // escape | ||
e.preventDefault() | ||
break | ||
case 38: // up arrow | ||
e.preventDefault() | ||
this.prev() | ||
break | ||
case 40: // down arrow | ||
e.preventDefault() | ||
this.next() | ||
break | ||
} | ||
e.stopPropagation() | ||
} | ||
, keydown: function (e) { | ||
this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]) | ||
this.move(e) | ||
} | ||
, keypress: function (e) { | ||
if (this.suppressKeyPressRepeat) return | ||
this.move(e) | ||
} | ||
, keyup: function (e) { | ||
@@ -1801,2 +2131,5 @@ switch(e.keyCode) { | ||
case 38: // up arrow | ||
case 16: // shift | ||
case 17: // ctrl | ||
case 18: // alt | ||
break | ||
@@ -1823,31 +2156,9 @@ | ||
, keypress: function (e) { | ||
if (!this.shown) return | ||
switch(e.keyCode) { | ||
case 9: // tab | ||
case 13: // enter | ||
case 27: // escape | ||
e.preventDefault() | ||
break | ||
case 38: // up arrow | ||
if (e.type != 'keydown') break | ||
e.preventDefault() | ||
this.prev() | ||
break | ||
case 40: // down arrow | ||
if (e.type != 'keydown') break | ||
e.preventDefault() | ||
this.next() | ||
break | ||
} | ||
e.stopPropagation() | ||
, focus: function (e) { | ||
this.focused = true | ||
} | ||
, blur: function (e) { | ||
var that = this | ||
setTimeout(function () { that.hide() }, 150) | ||
this.focused = false | ||
if (!this.mousedover && this.shown) this.hide() | ||
} | ||
@@ -1859,5 +2170,7 @@ | ||
this.select() | ||
this.$element.focus() | ||
} | ||
, mouseenter: function (e) { | ||
this.mousedover = true | ||
this.$menu.find('.active').removeClass('active') | ||
@@ -1867,2 +2180,7 @@ $(e.currentTarget).addClass('active') | ||
, mouseleave: function (e) { | ||
this.mousedover = false | ||
if (!this.focused && this.shown) this.hide() | ||
} | ||
} | ||
@@ -1874,2 +2192,4 @@ | ||
var old = $.fn.typeahead | ||
$.fn.typeahead = function (option) { | ||
@@ -1890,2 +2210,3 @@ return this.each(function () { | ||
, item: '<li><a href="#"></a></li>' | ||
, minLength: 1 | ||
} | ||
@@ -1896,14 +2217,137 @@ | ||
/* TYPEAHEAD NO CONFLICT | ||
* =================== */ | ||
$.fn.typeahead.noConflict = function () { | ||
$.fn.typeahead = old | ||
return this | ||
} | ||
/* TYPEAHEAD DATA-API | ||
* ================== */ | ||
$(function () { | ||
$('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { | ||
$(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { | ||
var $this = $(this) | ||
if ($this.data('typeahead')) return | ||
$this.typeahead($this.data()) | ||
}) | ||
}(window.jQuery); | ||
/* ========================================================== | ||
* bootstrap-affix.js v2.3.0 | ||
* http://twitter.github.com/bootstrap/javascript.html#affix | ||
* ========================================================== | ||
* Copyright 2012 Twitter, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* ========================================================== */ | ||
!function ($) { | ||
"use strict"; // jshint ;_; | ||
/* AFFIX CLASS DEFINITION | ||
* ====================== */ | ||
var Affix = function (element, options) { | ||
this.options = $.extend({}, $.fn.affix.defaults, options) | ||
this.$window = $(window) | ||
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) | ||
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this)) | ||
this.$element = $(element) | ||
this.checkPosition() | ||
} | ||
Affix.prototype.checkPosition = function () { | ||
if (!this.$element.is(':visible')) return | ||
var scrollHeight = $(document).height() | ||
, scrollTop = this.$window.scrollTop() | ||
, position = this.$element.offset() | ||
, offset = this.options.offset | ||
, offsetBottom = offset.bottom | ||
, offsetTop = offset.top | ||
, reset = 'affix affix-top affix-bottom' | ||
, affix | ||
if (typeof offset != 'object') offsetBottom = offsetTop = offset | ||
if (typeof offsetTop == 'function') offsetTop = offset.top() | ||
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() | ||
affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? | ||
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? | ||
'bottom' : offsetTop != null && scrollTop <= offsetTop ? | ||
'top' : false | ||
if (this.affixed === affix) return | ||
this.affixed = affix | ||
this.unpin = affix == 'bottom' ? position.top - scrollTop : null | ||
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : '')) | ||
} | ||
/* AFFIX PLUGIN DEFINITION | ||
* ======================= */ | ||
var old = $.fn.affix | ||
$.fn.affix = function (option) { | ||
return this.each(function () { | ||
var $this = $(this) | ||
if ($this.data('typeahead')) return | ||
e.preventDefault() | ||
$this.typeahead($this.data()) | ||
, data = $this.data('affix') | ||
, options = typeof option == 'object' && option | ||
if (!data) $this.data('affix', (data = new Affix(this, options))) | ||
if (typeof option == 'string') data[option]() | ||
}) | ||
} | ||
$.fn.affix.Constructor = Affix | ||
$.fn.affix.defaults = { | ||
offset: 0 | ||
} | ||
/* AFFIX NO CONFLICT | ||
* ================= */ | ||
$.fn.affix.noConflict = function () { | ||
$.fn.affix = old | ||
return this | ||
} | ||
/* AFFIX DATA-API | ||
* ============== */ | ||
$(window).on('load', function () { | ||
$('[data-spy="affix"]').each(function () { | ||
var $spy = $(this) | ||
, data = $spy.data() | ||
data.offset = data.offset || {} | ||
data.offsetBottom && (data.offset.bottom = data.offsetBottom) | ||
data.offsetTop && (data.offset.top = data.offsetTop) | ||
$spy.affix(data) | ||
}) | ||
}) | ||
}(window.jQuery); |
@@ -1,2 +0,2 @@ | ||
/** | ||
/*! | ||
* Bootstrap.js by @fat & @mdo | ||
@@ -6,2 +6,2 @@ * Copyright 2012 Twitter, Inc. | ||
*/ | ||
!function(a){a(function(){"use strict",a.support.transition=function(){var a=function(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},c;for(c in b)if(a.style[c]!==undefined)return b[c]}();return a&&{end:a}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function f(){e.trigger("closed").remove()}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger(b=a.Event("close"));if(b.isDefaultPrevented())return;e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=c,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.prototype={cycle:function(b){return b||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(a){return a||(this.paused=!0),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this,j=a.Event("slide");this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h]();if(e.hasClass("active"))return;if(a.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(j);if(j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})}else{this.$element.trigger(j);if(j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=a.extend({},a.fn.carousel.defaults,typeof c=="object"&&c);e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():f.interval&&e.cycle()})},a.fn.carousel.defaults={interval:5e3,pause:"hover"},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b,c,d,e;if(this.transitioning)return;b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find("> .accordion-group > .in");if(d&&d.length){e=d.data("collapse");if(e&&e.transitioning)return;d.collapse("hide"),e||d.data("collapse",null)}this.$element[b](0),this.transition("addClass",a.Event("show"),"shown"),this.$element[b](this.$element[0][c])},hide:function(){var b;if(this.transitioning)return;b=this.dimension(),this.reset(this.$element[b]()),this.transition("removeClass",a.Event("hide"),"hidden"),this.$element[b](0)},reset:function(a){var b=this.dimension();return this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element[a!==null?"addClass":"removeClass"]("collapse"),this},transition:function(b,c,d){var e=this,f=function(){c.type=="show"&&e.reset(),e.transitioning=0,e.$element.trigger(d)};this.$element.trigger(c);if(c.isDefaultPrevented())return;this.transitioning=1,this.$element[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e,f,g;if(c.is(".disabled, :disabled"))return;return f=c.attr("data-target"),f||(f=c.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,"")),e=a(f),e.length||(e=c.parent()),g=e.hasClass("open"),d(),g||e.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown",".dropdown form",function(a){a.stopPropagation()}).on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,a.proxy(f,this)):f.call(this)):b&&b()}function f(){this.$backdrop.remove(),this.$backdrop=null}function g(){var b=this;this.isShown&&this.options.keyboard?a(document).on("keyup.dismiss.modal",function(a){a.which==27&&b.hide()}):this.isShown||a(document).off("keyup.dismiss.modal")}"use strict";var b=function(b,c){this.options=c,this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this))};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this,c=a.Event("show");this.$element.trigger(c);if(this.isShown||c.isDefaultPrevented())return;a("body").addClass("modal-open"),this.isShown=!0,g.call(this),e.call(this,function(){var c=a.support.transition&&b.$element.hasClass("fade");b.$element.parent().length||b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in"),c?b.$element.one(a.support.transition.end,function(){b.$element.trigger("shown")}):b.$element.trigger("shown")})},hide:function(b){b&&b.preventDefault();var e=this;b=a.Event("hide"),this.$element.trigger(b);if(!this.isShown||b.isDefaultPrevented())return;this.isShown=!1,a("body").removeClass("modal-open"),g.call(this),this.$element.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?c.call(this):d.call(this)}},a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=a.extend({},a.fn.modal.defaults,d.data(),typeof c=="object"&&c);e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():f.show&&e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},a.fn.modal.Constructor=b,a(function(){a("body").on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({},e.data(),c.data());b.preventDefault(),e.modal(f)})})}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,this.options.trigger!="manual"&&(e=this.options.trigger=="hover"?"mouseenter":"focus",f=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(e,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f,this.options.selector,a.proxy(this.leave,this))),this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,b,this.$element.data()),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);if(!c.options.delay||!c.options.delay.show)return c.show();clearTimeout(this.timeout),c.hoverState="in",this.timeout=setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show)},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);if(!c.options.delay||!c.options.delay.hide)return c.hide();clearTimeout(this.timeout),c.hoverState="out",this.timeout=setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide)},show:function(){var a,b,c,d,e,f,g;if(this.hasContent()&&this.enabled){a=this.tip(),this.setContent(),this.options.animation&&a.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,b=/in/.test(f),a.remove().css({top:0,left:0,display:"block"}).appendTo(b?this.$element:document.body),c=this.getPosition(b),d=a[0].offsetWidth,e=a[0].offsetHeight;switch(b?f.split(" ")[1]:f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}a.css(g).addClass(f).addClass("in")}},isHTML:function(a){return typeof a!="string"||a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3||/^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(a)},setContent:function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.isHTML(b)?"html":"text"](b),a.removeClass("fade in top bottom left right")},hide:function(){function d(){var b=setTimeout(function(){c.off(a.support.transition.end).remove()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.remove()})}var b=this,c=this.tip();c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d():c.remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(b){return a.extend({},b?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;e||d.data("tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover",title:"",delay:0}}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.isHTML(b)?"html":"text"](b),a.find(".popover-content > *")[this.isHTML(c)?"html":"text"](c),a.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-content")||(typeof c.content=="function"?c.content.call(b[0]):c.content),a},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip}}),a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;e||d.data("popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),!function(a){function b(b,c){var d=a.proxy(this.process,this),e=a(b).is("body")?a(window):a(b),f;this.options=a.extend({},a.fn.scrollspy.defaults,c),this.$scrollElement=e.on("scroll.scroll.data-api",d),this.selector=(this.options.target||(f=a(b).attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=a("body"),this.refresh(),this.process()}"use strict",b.prototype={constructor:b,refresh:function(){var b=this,c;this.offsets=a([]),this.targets=a([]),c=this.$body.find(this.selector).map(function(){var b=a(this),c=b.data("target")||b.attr("href"),d=/^#\w/.test(c)&&a(c);return d&&c.length&&[[d.position().top,c]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},process:function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,c=b-this.$scrollElement.height(),d=this.offsets,e=this.targets,f=this.activeTarget,g;if(a>=c)return f!=(g=e.last()[0])&&this.activate(g);for(g=d.length;g--;)f!=e[g]&&a>=d[g]&&(!d[g+1]||a<=d[g+1])&&this.activate(e[g])},activate:function(b){var c,d;this.activeTarget=b,a(this.selector).parent(".active").removeClass("active"),d=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',c=a(d).parent("li").addClass("active"),c.parent(".dropdown-menu")&&(c=c.closest("li.dropdown").addClass("active")),c.trigger("activate")}},a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f=typeof c=="object"&&c;e||d.data("scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a(function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target"),e,f,g;d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;e=c.find(".active a").last()[0],g=a.Event("show",{relatedTarget:e}),b.trigger(g);if(g.isDefaultPrevented())return;f=a(d),this.activate(b.parent("li"),c),this.activate(f,f.parent(),function(){b.trigger({type:"shown",relatedTarget:e})})},activate:function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g):g(),e.removeClass("in")}},a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a(function(){a("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=a(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(a)).change(),this.hide()},updater:function(a){return a},show:function(){var b=a.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:b.top+b.height,left:b.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c=this,d,e;return this.query=this.$element.val(),this.query?(d=a.grep(this.source,function(a){return c.matcher(a)}),d=this.sorter(d),d.length?this.render(d.slice(0,this.options.items)).show():this.shown?this.hide():this):this.shown?this.hide():this},matcher:function(a){return~a.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(a){var b=[],c=[],d=[],e;while(e=a.shift())e.toLowerCase().indexOf(this.query.toLowerCase())?~e.indexOf(this.query)?c.push(e):d.push(e):b.push(e);return b.concat(c,d)},highlighter:function(a){var b=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return a.replace(new RegExp("("+b+")","ig"),function(a,b){return"<strong>"+b+"</strong>"})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),(a.browser.webkit||a.browser.msie)&&this.$element.on("keydown",a.proxy(this.keypress,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this))},keyup:function(a){switch(a.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}a.stopPropagation(),a.preventDefault()},keypress:function(a){if(!this.shown)return;switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:if(a.type!="keydown")break;a.preventDefault(),this.prev();break;case 40:if(a.type!="keydown")break;a.preventDefault(),this.next()}a.stopPropagation()},blur:function(a){var b=this;setTimeout(function(){b.hide()},150)},click:function(a){a.stopPropagation(),a.preventDefault(),this.select()},mouseenter:function(b){this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")}},a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f=typeof c=="object"&&c;e||d.data("typeahead",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>'},a.fn.typeahead.Constructor=b,a(function(){a("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);if(c.data("typeahead"))return;b.preventDefault(),c.typeahead(c.data())})})}(window.jQuery); | ||
!function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||s.toggleClass("open"),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f<s.length-1&&f++,~f||(f=0),s.eq(f).focus()}};var s=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.dropdown.data-api",r).on("click.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on(".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle).on("keydown.dropdown.data-api",t+", [role=menu]",n.prototype.keydown)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(n=e.isFunction(this.source)?this.source(this.query,e.proxy(this.process,this)):this.source,n?this.process(n):this)},process:function(t){var n=this;return t=e.grep(t,function(e){return n.matcher(e)}),t=this.sorter(t),t.length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return"<strong>"+t+"</strong>"})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery); |
@@ -8,2 +8,3 @@ (function () { | ||
marked = require("marked"), | ||
wrench = require("wrench"), | ||
path = require("path"); | ||
@@ -99,3 +100,2 @@ | ||
var replaceLinks = function (text) { | ||
@@ -108,3 +108,14 @@ return replaceCode(text ? replaceToken(text, "link", function (link) { | ||
var replaceLinksAndParse = function (text) { | ||
return parseMarkdown(replaceCode(text ? replaceToken(text, "link", function (link) { | ||
link = link.replace(/^\{@link|\}$/g, ""); | ||
return ["<a href='", ["./" + getSymbolName(link).trim() + ".html", getAccessorName(link)].join("#"), "'>", link, "</a>"].join(""); | ||
}) : "")); | ||
}; | ||
var parseMarkdown = function (text) { | ||
return marked(text).replace(/\<pre\>/ig, "<pre class='prettyprint linenums lang-js'>"); | ||
}; | ||
var replaceCode = function (text) { | ||
@@ -139,3 +150,3 @@ return text ? replaceToken(text, "code", function (code) { | ||
var type = p.type || ""; | ||
var description = replaceLinks(p.description) || ""; | ||
var description = replaceLinksAndParse(p.description) || ""; | ||
@@ -152,10 +163,10 @@ ret += ["<tr><td>", name , "</td><td>", type, "</td><td>", value ? "<code>" + value + "</code>" : "", "</td><td>", description, "</td><tr>"].join(""); | ||
return function (file, context, b) { | ||
var fileContent; | ||
context = context || {}; | ||
var fileContent, compile = util.isBoolean(context.compile) ? context.compile : true; | ||
if (!file.match(/\.(tmpl|md|html|css|js)$/)) { | ||
file += ".tmpl"; | ||
} else if (path.extname(file) === ".md") { | ||
fileContent = '{{{import "./header.html"}}}\n' + marked(fs.readFileSync(file, "utf8")).replace(/\<pre\>/ig, "<pre class='prettyprint linenums lang-js'>") + '\n{{{import "./footer.html"}}}'; | ||
fileContent = '{{{import "./header.html"}}}\n' + parseMarkdown(fs.readFileSync(file, "utf8")) + '\n{{{import "./footer.html"}}}'; | ||
} | ||
try { | ||
var filePath = path.resolve(template, file); | ||
@@ -167,3 +178,5 @@ var tmpl = compiledImports[filePath]; | ||
} | ||
tmpl = compiledImports[filePath] = Handlebars.compile(fileContent); | ||
tmpl = compiledImports[filePath] = compile ? Handlebars.compile(fileContent) : function () { | ||
return fileContent; | ||
}; | ||
} | ||
@@ -194,2 +207,3 @@ return tmpl(this); | ||
Handlebars.registerHelper("resolveInclude", resolveInclude); | ||
Handlebars.registerHelper("replaceLinksAndParse", replaceLinksAndParse); | ||
@@ -200,5 +214,22 @@ var objComp = function (n1, n2) { | ||
function resolveLocations(headers, dir, tag) { | ||
return headers.map(function (symbol) { | ||
var header = symbol[tag]; | ||
if (header.location) { | ||
var baseDir = dir ? path.dirname(path.resolve(dir, header.file)) : path.dirname(header.file) | ||
header = fs.readFileSync(path.resolve(baseDir, header.location), "utf8"); | ||
} else { | ||
header = header.content; | ||
} | ||
symbol[tag] = header; | ||
return symbol; | ||
}); | ||
} | ||
exports.generate = function (tree, options) { | ||
var nameSpaces = tree.getNamespaces().sort(objComp); | ||
var dir = path.resolve(process.cwd(), options.dir || "docs"); | ||
if (!fs.existsSync(dir)) { | ||
wrench.mkdirSyncRecursive(dir, "0777"); | ||
} | ||
nameSpaces.forEach(function (n) { | ||
@@ -219,26 +250,19 @@ n.methods.sort(objComp); | ||
includedDocs.forEach(function (id) { | ||
id.location = path.resolve(options.directory, id.location); | ||
var baseDir = dir ? path.dirname(path.resolve(dir, id.file)) : path.dirname(id.file) | ||
id.location = path.resolve(baseDir, id.location); | ||
}); | ||
var base = {namespaces:nameSpaces, includeDocs:includedDocs, headers:tree.getHeaders(), footers:tree.getFooters(), projectName:tree.getProjectName(), github:tree.getGitHub(), classes:classes}; | ||
var base = {namespaces: nameSpaces, includeDocs: includedDocs, headers: resolveLocations(tree.getHeaders(), dir, "header"), footers: resolveLocations(tree.getFooters(), dir, "footer"), projectName: tree.getProjectName(), github: tree.getGitHub(), classes: classes}; | ||
fs.writeFileSync(path.resolve(dir, "index.html"), compileIndexTmpl(base)); | ||
nameSpaces.forEach(function (namespace) { | ||
fs.writeFileSync(path.resolve(dir, normalize(namespace.name) + ".html"), compileNamespacesTmpl(util.merge({namespace:namespace}, base))); | ||
fs.writeFileSync(path.resolve(dir, normalize(namespace.name) + ".html"), compileNamespacesTmpl(util.merge({namespace: namespace}, base))); | ||
}); | ||
classes.forEach(function (clazz) { | ||
fs.writeFileSync(path.resolve(dir, normalize(clazz.name) + ".html"), compileClassesTmpl(util.merge({"class":clazz}, base))); | ||
fs.writeFileSync(path.resolve(dir, normalize(clazz.name) + ".html"), compileClassesTmpl(util.merge({"class": clazz}, base))); | ||
}); | ||
includedDocs.forEach(function (idFile) { | ||
fs.writeFileSync(path.resolve(dir, resolveInclude(idFile.location).toString()), importFile.call(base, idFile.location)); | ||
fs.writeFileSync(path.resolve(dir, resolveInclude(idFile.location).toString()), importFile.call(base, idFile.location, idFile)); | ||
}); | ||
console.log("cp -r " + __dirname + "/assets " + path.resolve(dir, "assets")); | ||
exec("cp -r " + __dirname + "/assets " + path.resolve(dir, "./"), function (err) { | ||
if (err) { | ||
console.log(err.stack); | ||
} | ||
}); | ||
wrench.copyDirSyncRecursive(path.resolve(__dirname + "/assets"), path.resolve(dir, "assets")) | ||
}; | ||
})(); |
@@ -1,395 +0,391 @@ | ||
(function () { | ||
"use strict"; | ||
var it = require("it"), | ||
fs = require("fs"), | ||
path = require("path"), | ||
assert = require("assert"), | ||
Symbol = require("../../lib/symbol.js"), | ||
Context = require("../../lib/context.js"), | ||
coddoc = require("../../lib/index.js"), | ||
code = require("../../lib/parser/code.js"); | ||
"use strict"; | ||
var it = require("it"), | ||
fs = require("fs"), | ||
path = require("path"), | ||
assert = require("assert"), | ||
Symbol = require("../../lib/symbol.js"), | ||
Context = require("../../lib/context.js"), | ||
coddoc = require("../../lib/index.js"), | ||
code = require("../../lib/parser/code.js"); | ||
it.describe("coddoc/parser/tags.js", function (it) { | ||
it.describe("coddoc/parser/tags.js", function (it) { | ||
var context, symbol; | ||
it.beforeEach(function () { | ||
context = new Context(); | ||
symbol = new Symbol(); | ||
}); | ||
var context, symbol; | ||
it.beforeEach(function () { | ||
context = new Context(); | ||
symbol = new Symbol(); | ||
}); | ||
var parseCode = function (src) { | ||
code.parseCode(src, symbol, context); | ||
}; | ||
var parseCode = function (src) { | ||
code.parseCode(src, symbol, context); | ||
}; | ||
it.describe("matching /^function (\\w+) *\\{/", function (it) { | ||
it.describe("matching /^function (\\w+) *\\{/", function (it) { | ||
var code = 'function strFunc(str) {\n return str;}'; | ||
var code = 'function strFunc(str) {\n return str;}'; | ||
it.should("set isFunction to true", function () { | ||
parseCode(code); | ||
assert.isTrue(symbol.isFunction); | ||
}); | ||
it.should("set isFunction to true", function () { | ||
parseCode(code); | ||
assert.isTrue(symbol.isFunction); | ||
}); | ||
it.should("parse code", function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, "function (str){\n return str;\n}"); | ||
}); | ||
it.should("parse code", function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, "function (str){\n return str;\n}"); | ||
}); | ||
it.should("parse name", function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "strFunc"); | ||
}); | ||
it.should("parse name", function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "strFunc"); | ||
}); | ||
it.should("set isConstructor to false", function(){ | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to false", function () { | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to true if name does not begin with capital", function(){ | ||
var code = 'function StrFunc(str1, str2) {};'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to true if name does not begin with capital", function () { | ||
var code = 'function StrFunc(str1, str2) {};'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to false if whole name is all caps", function(){ | ||
var code = 'function STR_FUNC(str1, str2) {};'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to false if whole name is all caps", function () { | ||
var code = 'function STR_FUNC(str1, str2) {};'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("parse params", function () { | ||
parseCode(code); | ||
assert.deepEqual(symbol.params, [ | ||
{name:{name:"str"}} | ||
]); | ||
}); | ||
it.should("parse params", function () { | ||
parseCode(code); | ||
assert.deepEqual(symbol.params, [ | ||
{name: {name: "str"}} | ||
]); | ||
}); | ||
it.should("set private if name starts with _", function () { | ||
var code = 'function _strFunc(str) {\n return str;}'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should("set private if name starts with _", function () { | ||
var code = 'function _strFunc(str) {\n return str;}'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.describe("matching /^var *(\\w+) *= *function/", function (it) { | ||
}); | ||
var code = 'var MyObject = function (str1, str2) {};'; | ||
it.describe("matching /^var *(\\w+) *= *function/", function (it) { | ||
it.should("set isFunction to true", function () { | ||
parseCode(code); | ||
assert.isTrue(symbol.isFunction); | ||
}); | ||
var code = 'var MyObject = function (str1, str2) {};'; | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, "function (str1,str2){\n \n}"); | ||
}); | ||
it.should("set isFunction to true", function () { | ||
parseCode(code); | ||
assert.isTrue(symbol.isFunction); | ||
}); | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "MyObject"); | ||
}); | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, "function (str1,str2){\n \n}"); | ||
}); | ||
it.should("set isConstructor to true", function(){ | ||
parseCode(code); | ||
assert.isTrue(symbol.isConstructor); | ||
}); | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "MyObject"); | ||
}); | ||
it.should("set isConstructor to false if name does not begin with capital", function(){ | ||
var code = 'var myObject = function (str1, str2) {};'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to true", function () { | ||
parseCode(code); | ||
assert.isTrue(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to false if whole name is all caps", function(){ | ||
var code = 'var MY_OBJECT = function (str1, str2) {};'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to false if name does not begin with capital", function () { | ||
var code = 'var myObject = function (str1, str2) {};'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should('parse params', function () { | ||
parseCode(code); | ||
assert.deepEqual(symbol.params, [ | ||
{name:{name:"str1"}}, | ||
{name:{name:"str2"}} | ||
]); | ||
}); | ||
it.should("set isConstructor to false if whole name is all caps", function () { | ||
var code = 'var MY_OBJECT = function (str1, str2) {};'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function(){ | ||
var code = 'var __MyObject = function () {};'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should('parse params', function () { | ||
parseCode(code); | ||
assert.deepEqual(symbol.params, [ | ||
{name: {name: "str1"}}, | ||
{name: {name: "str2"}} | ||
]); | ||
}); | ||
it.describe('matching /^(\\w+(?:\\.\\w+)+) *= *function/', function (it) { | ||
var code = 'MyObject.prototype.testFunction = function (str1, str2) {\n};'; | ||
it.should("set isPrivate to tue if name begins with _", function () { | ||
var code = 'var __MyObject = function () {};'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
}); | ||
it.describe('matching /^(\\w+(?:\\.\\w+)+) *= *function/', function (it) { | ||
it.should('should set isFunction to true', function () { | ||
parseCode(code); | ||
assert.isTrue(symbol.isFunction); | ||
}); | ||
var code = 'MyObject.prototype.testFunction = function (str1, str2) {\n};'; | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "testFunction"); | ||
}); | ||
it.should('should set isFunction to true', function () { | ||
parseCode(code); | ||
assert.isTrue(symbol.isFunction); | ||
}); | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, "function (str1,str2){\n \n}"); | ||
}); | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "testFunction"); | ||
}); | ||
it.should("set isConstructor to false", function(){ | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, "function (str1,str2){\n \n}"); | ||
}); | ||
it.should("set isConstructor if name begins with a capital letter", function(){ | ||
var code = 'MyObject.prototype.TestFunction = function (str1, str2) {\n};'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to false", function () { | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to false if whole name is all caps", function(){ | ||
var code = 'MyObject.prototype.TEST_FUNCTION = function (str1, str2) {\n};'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor if name begins with a capital letter", function () { | ||
var code = 'MyObject.prototype.TestFunction = function (str1, str2) {\n};'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isConstructor); | ||
}); | ||
it.should('parse params', function () { | ||
parseCode(code); | ||
assert.deepEqual(symbol.params, [ | ||
{name:{name:"str1"}}, | ||
{name:{name:"str2"}} | ||
]); | ||
}); | ||
it.should("set isConstructor to false if whole name is all caps", function () { | ||
var code = 'MyObject.prototype.TEST_FUNCTION = function (str1, str2) {\n};'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function(){ | ||
var code = 'MyObject.prototype._testFunction = function () {\n};'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should('parse params', function () { | ||
parseCode(code); | ||
assert.deepEqual(symbol.params, [ | ||
{name: {name: "str1"}}, | ||
{name: {name: "str2"}} | ||
]); | ||
}); | ||
it.should('parse memberof', function () { | ||
parseCode(code); | ||
assert.equal(symbol.memberof, "MyObject.prototype"); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function () { | ||
var code = 'MyObject.prototype._testFunction = function () {\n};'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should('isStatic should be false for prototypes', function () { | ||
parseCode(code); | ||
assert.isFalse(symbol.isStatic); | ||
}); | ||
it.should('parse memberof', function () { | ||
parseCode(code); | ||
assert.equal(symbol.memberof, "MyObject.prototype"); | ||
}); | ||
it.should('isStatic should be true for non prototypes', function () { | ||
var code = 'MyObject.testFunction = function () {\n};'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isStatic); | ||
}); | ||
it.should('isStatic should be false for prototypes', function () { | ||
parseCode(code); | ||
assert.isFalse(symbol.isStatic); | ||
}); | ||
it.describe("matching /^(\\w+(?:\\.\\w+)+) *= *([^\\n;]+)/", function (it) { | ||
it.should('isStatic should be true for non prototypes', function () { | ||
var code = 'MyObject.testFunction = function () {\n};'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isStatic); | ||
}); | ||
}); | ||
var code = 'MyObject.prototype.testProperty = "property";'; | ||
it.should('set isFunction to false', function () { | ||
parseCode(code); | ||
assert.isFalse(symbol.isFunction); | ||
}); | ||
it.describe("matching /^(\\w+(?:\\.\\w+)+) *= *([^\\n;]+)/", function (it) { | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, '"property"'); | ||
}); | ||
var code = 'MyObject.prototype.testProperty = "property";'; | ||
it.should('set isFunction to false', function () { | ||
parseCode(code); | ||
assert.isFalse(symbol.isFunction); | ||
}); | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "testProperty"); | ||
}); | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, '"property"'); | ||
}); | ||
it.should('parse memberof', function () { | ||
parseCode(code); | ||
assert.equal(symbol.memberof, "MyObject.prototype"); | ||
}); | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "testProperty"); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function(){ | ||
var code = 'MyObject.prototype._testProperty = "property";'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should('parse memberof', function () { | ||
parseCode(code); | ||
assert.equal(symbol.memberof, "MyObject.prototype"); | ||
}); | ||
it.should("set isStatic to false for prototype properties", function () { | ||
var code = 'MyObject.prototype.testProperty = "property";'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isStatic); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function () { | ||
var code = 'MyObject.prototype._testProperty = "property";'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should("set isStatic to true for non prototype properties", function () { | ||
var code = 'MyObject.testProperty = "property";'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isStatic); | ||
}); | ||
it.should("set isStatic to false for prototype properties", function () { | ||
var code = 'MyObject.prototype.testProperty = "property";'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isStatic); | ||
}); | ||
it.should('parse code with new lines', function () { | ||
var code = 'MyObject.testProperty = [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
it.should("set isStatic to true for non prototype properties", function () { | ||
var code = 'MyObject.testProperty = "property";'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isStatic); | ||
}); | ||
it.should('parse properties that are objects', function () { | ||
var code = 'MyObject.testProperty = {\n\tx:"y"\n}'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '{\n\tx:"y"\n}'); | ||
}); | ||
it.should('parse code with new lines', function () { | ||
var code = 'MyObject.testProperty = [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
it.should('parse properties that are arrays', function () { | ||
var code = 'MyObject.testProperty = [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
it.should('parse properties that are objects', function () { | ||
var code = 'MyObject.testProperty = {\n\tx:"y"\n}'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '{\n\tx:"y"\n}'); | ||
}); | ||
it.should('parse properties that are arrays', function () { | ||
var code = 'MyObject.testProperty = [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
it.describe("matching /^var +(\\w+) *= *([^\\n;]+)/", function (it) { | ||
}); | ||
var code = 'var testProperty = "property";'; | ||
it.describe("matching /^var +(\\w+) *= *([^\\n;]+)/", function (it) { | ||
it.should('set isFunction to false', function () { | ||
parseCode(code); | ||
assert.isFalse(symbol.isFunction); | ||
}); | ||
var code = 'var testProperty = "property";'; | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, '"property"'); | ||
}); | ||
it.should('set isFunction to false', function () { | ||
parseCode(code); | ||
assert.isFalse(symbol.isFunction); | ||
}); | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "testProperty"); | ||
}); | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, '"property"'); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function(){ | ||
var code = 'var _testProperty = "property";'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "testProperty"); | ||
}); | ||
it.should('parse code with new lines', function () { | ||
var code = 'var testProperty = [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function () { | ||
var code = 'var _testProperty = "property";'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should('parse properties that are objects', function () { | ||
var code = 'var testProperty = {\n\tx:"y"\n}'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '{\n\tx:"y"\n}'); | ||
}); | ||
it.should('parse code with new lines', function () { | ||
var code = 'var testProperty = [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
it.should('parse properties that are arrays', function () { | ||
var code = 'var testProperty = [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
it.should('parse properties that are objects', function () { | ||
var code = 'var testProperty = {\n\tx:"y"\n}'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '{\n\tx:"y"\n}'); | ||
}); | ||
it.describe("matching /^\"?(\\w+)\"? *\\: *function/", function (it) { | ||
var code = 'testFunction:function (str1,str2) {\n },'; | ||
it.should('parse properties that are arrays', function () { | ||
var code = 'var testProperty = [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
}); | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, "function (str1,str2){\n \n}"); | ||
}); | ||
it.describe("matching /^\"?(\\w+)\"? *\\: *function/", function (it) { | ||
var code = 'testFunction:function (str1,str2) {\n },'; | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "testFunction"); | ||
}); | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, "function (str1,str2){\n \n}"); | ||
}); | ||
it.should("set isConstructor to false", function(){ | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "testFunction"); | ||
}); | ||
it.should("set isConstructor if name begins with a capital letter", function(){ | ||
var code = 'TestFunction:function (str1,str2) {\n },'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to false", function () { | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor to false if whole name is all caps", function(){ | ||
var code = 'TEST_FUNCTION:function (str1,str2) {\n },'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("set isConstructor if name begins with a capital letter", function () { | ||
var code = 'TestFunction:function (str1,str2) {\n },'; | ||
parseCode(code); | ||
assert.isTrue(symbol.isConstructor); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function(){ | ||
parseCode('_testFunction:function (str1,str2) {\n },'); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should("set isConstructor to false if whole name is all caps", function () { | ||
var code = 'TEST_FUNCTION:function (str1,str2) {\n },'; | ||
parseCode(code); | ||
assert.isFalse(symbol.isConstructor); | ||
}); | ||
it.should("should set isStatic to true if activeScope does not include prototype", function(){ | ||
parseCode(code); | ||
assert.isTrue(symbol.isStatic); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function () { | ||
parseCode('_testFunction:function (str1,str2) {\n },'); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should("should set isStatic to false if activeScope does include prototype", function(){ | ||
context.activateScope("MyObject.prototype"); | ||
parseCode(code); | ||
assert.isFalse(symbol.isStatic); | ||
}); | ||
it.should("should set isStatic to true if activeScope does not include prototype", function () { | ||
parseCode(code); | ||
assert.isTrue(symbol.isStatic); | ||
}); | ||
it.describe("matching /^\"?(\\w+)\"? *\\: *([^,\\n]+)/", function (it) { | ||
var code = 'testProperty:"some property"\n};'; | ||
it.should("should set isStatic to false if activeScope does include prototype", function () { | ||
context.activateScope("MyObject.prototype"); | ||
parseCode(code); | ||
assert.isFalse(symbol.isStatic); | ||
}); | ||
}); | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, '"some property"'); | ||
}); | ||
it.describe("matching /^\"?(\\w+)\"? *\\: *([^,\\n]+)/", function (it) { | ||
var code = 'testProperty:"some property"\n};'; | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "testProperty"); | ||
}); | ||
it.should('parse code', function () { | ||
parseCode(code); | ||
assert.equal(symbol.code, '"some property"'); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function(){ | ||
parseCode('_testFunction:function (str1,str2) {\n },'); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should('parse name', function () { | ||
parseCode(code); | ||
assert.equal(symbol.name, "testProperty"); | ||
}); | ||
it.should("should set isStatic to true if activeScope does not include prototype", function(){ | ||
parseCode(code); | ||
assert.isTrue(symbol.isStatic); | ||
}); | ||
it.should("set isPrivate to tue if name begins with _", function () { | ||
parseCode('_testFunction:function (str1,str2) {\n },'); | ||
assert.isTrue(symbol.isPrivate); | ||
}); | ||
it.should("should set isStatic to false if activeScope does include prototype", function(){ | ||
context.activateScope("MyObject.prototype"); | ||
parseCode(code); | ||
assert.isFalse(symbol.isStatic); | ||
}); | ||
it.should("should set isStatic to true if activeScope does not include prototype", function () { | ||
parseCode(code); | ||
assert.isTrue(symbol.isStatic); | ||
}); | ||
it.should('parse code with new lines', function () { | ||
var code = 'testProperty : [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
it.should("should set isStatic to false if activeScope does include prototype", function () { | ||
context.activateScope("MyObject.prototype"); | ||
parseCode(code); | ||
assert.isFalse(symbol.isStatic); | ||
}); | ||
it.should('parse properties that are objects', function () { | ||
var code = 'testProperty : {\n\tx:"y"\n}'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '{\n\tx:"y"\n}'); | ||
}); | ||
it.should('parse code with new lines', function () { | ||
var code = 'testProperty : [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
it.should('parse properties that are arrays', function () { | ||
var code = 'testProperty : [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
it.should('parse properties that are objects', function () { | ||
var code = 'testProperty : {\n\tx:"y"\n}'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '{\n\tx:"y"\n}'); | ||
}); | ||
it.should('parse properties that are arrays', function () { | ||
var code = 'testProperty : [\n\t"some", \n\t"property"\n];'; | ||
parseCode(code); | ||
assert.equal(symbol.code, '[\n\t"some", \n\t"property"\n]'); | ||
}); | ||
}); | ||
it.run(); | ||
}); | ||
})(); | ||
}); |
@@ -1,42 +0,38 @@ | ||
(function () { | ||
"use strict"; | ||
var it = require("it"), | ||
fs = require("fs"), | ||
path = require("path"), | ||
assert = require("assert"), | ||
EventEmitter = require("events").EventEmitter, | ||
Tree = require("../../lib/tree.js"), | ||
Context = require("../../lib/context.js"), | ||
parser = require("../../lib/parser"); | ||
"use strict"; | ||
var it = require("it"), | ||
fs = require("fs"), | ||
path = require("path"), | ||
assert = require("assert"), | ||
EventEmitter = require("events").EventEmitter, | ||
Tree = require("../../lib/tree.js"), | ||
Context = require("../../lib/context.js"), | ||
parser = require("../../lib/parser"); | ||
it.describe("coddoc/parser", function (it) { | ||
it.describe("coddoc/parser", function (it) { | ||
var file = fs.readFileSync(path.resolve(__dirname, "./assets/parser.file.js"), "utf8"); | ||
var emitter = new EventEmitter(), | ||
tree = new Tree(); | ||
it.should("parse the file and gather all symbols", function () { | ||
parser.parse(file, "", tree, new Context(), emitter); | ||
console.dir(tree); | ||
var classes = tree.getClasses(), namespaces = tree.getNamespaces(); | ||
assert.lengthOf(classes, 1); | ||
assert.lengthOf(namespaces, 1); | ||
var cls = classes[0]; | ||
assert.equal(cls.name, "test.MyObject"); | ||
assert.equal(cls.memberof, "test"); | ||
assert.isTrue(cls.isConstructor, true); | ||
assert.lengthOf(cls.instanceMethods, 1); | ||
assert.lengthOf(cls.instanceProperties, 2); | ||
assert.lengthOf(cls.staticMethods, 1); | ||
assert.lengthOf(cls.staticProperties, 2); | ||
var namespace = namespaces[0]; | ||
assert.lengthOf(namespace.methods, 1); | ||
assert.lengthOf(namespace.properties, 3); | ||
}); | ||
it.run(); | ||
var file = fs.readFileSync(require.resolve("./assets/parser.file.js"), "utf8"); | ||
var emitter = new EventEmitter(), | ||
tree = new Tree(); | ||
it.should("parse the file and gather all symbols", function () { | ||
parser.parse(file, "", tree, new Context(), emitter); | ||
var classes = tree.getClasses(), namespaces = tree.getNamespaces(); | ||
assert.lengthOf(classes, 1); | ||
assert.lengthOf(namespaces, 1); | ||
var cls = classes[0]; | ||
assert.equal(cls.name, "test.MyObject"); | ||
assert.equal(cls.memberof, "test"); | ||
assert.isTrue(cls.isConstructor, true); | ||
assert.lengthOf(cls.instanceMethods, 1); | ||
assert.lengthOf(cls.instanceProperties, 2); | ||
assert.lengthOf(cls.staticMethods, 1); | ||
assert.lengthOf(cls.staticProperties, 2); | ||
var namespace = namespaces[0]; | ||
assert.lengthOf(namespace.methods, 1); | ||
assert.lengthOf(namespace.properties, 3); | ||
}); | ||
})(); | ||
}); | ||
@@ -1,502 +0,526 @@ | ||
(function () { | ||
"use strict"; | ||
var it = require("it"), | ||
assert = require("assert"), | ||
coddoc = require("../../lib/index.js"), | ||
Symbol = require("../../lib/symbol.js"), | ||
Context = require("../../lib/context.js"), | ||
tags = require("../../lib/parser/tags.js"); | ||
"use strict"; | ||
var it = require("it"), | ||
assert = require("assert"), | ||
coddoc = require("../../lib/index.js"), | ||
Symbol = require("../../lib/symbol.js"), | ||
Context = require("../../lib/context.js"), | ||
tags = require("../../lib/parser/tags.js"); | ||
it.describe("coddoc/parser/tags.js", function (it) { | ||
var context, symbol; | ||
it.beforeEach(function () { | ||
context = new Context(); | ||
symbol = new Symbol(); | ||
it.describe("coddoc/parser/tags.js", function (it) { | ||
var context, symbol; | ||
it.beforeEach(function () { | ||
context = new Context(); | ||
symbol = new Symbol(); | ||
}); | ||
it.should("expose the tags functions", function () { | ||
assert.isFunction(coddoc.parseTag); | ||
assert.isFunction(coddoc.addTagHandler); | ||
assert.isFunction(coddoc.tags.parseTypes); | ||
assert.isFunction(coddoc.tags.parseName); | ||
}); | ||
it.should("create a tagRegexp", function () { | ||
assert.deepEqual(tags.getTagRegexp().toString(), | ||
"/@(augments|extends|lends|namespace|param|parameter|arg|argument|return|returns|memberof|memberOf" + | ||
"|name|constructor|constructs|class|classdesc|example|see|private|protected|static|public|ignore|ignoreCode" + | ||
"|method|function|field|type|default|throws|throw|exception|property|borrows|constant|const|desc" + | ||
"|description|projectName|header|footer|github|includeDoc)/"); | ||
}); | ||
var parseTag = function (comment) { | ||
return tags.parseTag(comment, symbol, context); | ||
}; | ||
it.describe("#parseTag", function (it) { | ||
it.should("parse augments", function () { | ||
parseTag("@augments coddoc.Test"); | ||
assert.deepEqual(symbol.augments, [ | ||
{augments: "coddoc.Test"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "augments", props: {augments: "coddoc.Test"}} | ||
]); | ||
}); | ||
it.should("expose the tags functions", function () { | ||
assert.isFunction(coddoc.parseTag); | ||
assert.isFunction(coddoc.addTagHandler); | ||
assert.isFunction(coddoc.tags.parseTypes); | ||
assert.isFunction(coddoc.tags.parseName); | ||
it.should("parse extends", function () { | ||
parseTag("@extends coddoc.Test"); | ||
assert.deepEqual(symbol.augments, [ | ||
{augments: "coddoc.Test"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "augments", props: {augments: "coddoc.Test"}} | ||
]); | ||
}); | ||
it.should("create a tagRegexp", function () { | ||
assert.deepEqual(tags.getTagRegexp().toString(), | ||
"/@(augments|extends|lends|namespace|param|parameter|arg|argument|return|returns|memberof|memberOf" + | ||
"|name|constructor|constructs|class|classdesc|example|see|private|protected|public|ignore|ignoreCode" + | ||
"|method|function|field|type|default|throws|throw|exception|property|borrows|constant|const|desc" + | ||
"|description|projectName|header|footer)/"); | ||
it.should("parse lends", function () { | ||
parseTag("@lends test.Test.prototype"); | ||
assert.equal(symbol.lends, "test.Test.prototype"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "lends", props: {lends: "test.Test.prototype"}} | ||
]); | ||
assert.equal(context.getActiveScopeName(), "test.Test.prototype"); | ||
}); | ||
var parseTag = function (comment) { | ||
return tags.parseTag(comment, symbol, context); | ||
}; | ||
it.should("parse lends with name paths", function () { | ||
parseTag("@lends test.Test#"); | ||
assert.equal(symbol.lends, "test.Test.prototype"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "lends", props: {lends: "test.Test.prototype"}} | ||
]); | ||
assert.equal(context.getActiveScopeName(), "test.Test.prototype"); | ||
}); | ||
it.describe("#parseTag", function (it) { | ||
it.should("parse augments", function () { | ||
parseTag("@augments coddoc.Test"); | ||
assert.deepEqual(symbol.augments, [ | ||
{augments:"coddoc.Test"} | ||
it.should("parse namespace", function () { | ||
parseTag("@namespace This is some namespace!!!!"); | ||
assert.isTrue(symbol.isNamespace); | ||
assert.equal(symbol.description, "This is some namespace!!!!"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "namespace", props: {description: "This is some namespace!!!!"}} | ||
]); | ||
}); | ||
["param", "parameter", "arg", "argument"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type + " someName some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types: [], name: {name: "someName", optional: false, defaultValue: undefined}, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"augments", props:{augments:"coddoc.Test"}} | ||
{tag: "param", props: {types: [], name: {name: "someName", optional: false, defaultValue: undefined}, description: "some name description"}} | ||
]); | ||
}); | ||
it.should("parse extends", function () { | ||
parseTag("@extends coddoc.Test"); | ||
assert.deepEqual(symbol.augments, [ | ||
{augments:"coddoc.Test"} | ||
it.should("parse " + type + " with types", function () { | ||
parseTag("@" + type + " {Boolean|String} someName some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types: ["Boolean", "String"], name: {name: "someName", optional: false, defaultValue: undefined}, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"augments", props:{augments:"coddoc.Test"}} | ||
{tag: "param", props: {types: ["Boolean", "String"], name: {name: "someName", optional: false, defaultValue: undefined}, description: "some name description"}} | ||
]); | ||
}); | ||
it.should("parse lends", function () { | ||
parseTag("@lends test.Test.prototype"); | ||
assert.equal(symbol.lends, "test.Test.prototype"); | ||
it.should("parse " + type + " as optional without value", function () { | ||
parseTag("@" + type + " [someName] some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types: [], name: {name: "someName", optional: true, defaultValue: undefined}, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"lends", props:{lends:"test.Test.prototype"}} | ||
{tag: "param", props: {types: [], name: {name: "someName", optional: true, defaultValue: undefined}, description: "some name description"}} | ||
]); | ||
assert.equal(context.getActiveScopeName(), "test.Test.prototype"); | ||
}); | ||
it.should("parse lends with name paths", function () { | ||
parseTag("@lends test.Test#"); | ||
assert.equal(symbol.lends, "test.Test.prototype"); | ||
it.should("parse " + type + " as optional with value", function () { | ||
parseTag("@" + type + " [someName=true] some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types: [], name: {name: "someName", optional: true, defaultValue: "true"}, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"lends", props:{lends:"test.Test.prototype"}} | ||
{tag: "param", props: {types: [], name: {name: "someName", optional: true, defaultValue: "true"}, description: "some name description"}} | ||
]); | ||
assert.equal(context.getActiveScopeName(), "test.Test.prototype"); | ||
}); | ||
it.should("parse namespace", function () { | ||
parseTag("@namespace This is some namespace!!!!"); | ||
assert.isTrue(symbol.isNamespace); | ||
assert.equal(symbol.description, "This is some namespace!!!!"); | ||
it.should("parse " + type + " with types as optional without value", function () { | ||
parseTag("@" + type + " {Boolean|String} [someName] some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types: ["Boolean", "String"], name: {name: "someName", optional: true, defaultValue: undefined}, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"namespace", props:{description:"This is some namespace!!!!"}} | ||
{tag: "param", props: {types: ["Boolean", "String"], name: {name: "someName", optional: true, defaultValue: undefined}, description: "some name description"}} | ||
]); | ||
}); | ||
["param", "parameter", "arg", "argument"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type + " someName some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types:[], name:{name:"someName", optional:false, defaultValue:undefined}, description:"some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"param", props:{types:[], name:{name:"someName", optional:false, defaultValue:undefined}, description:"some name description"}} | ||
]); | ||
}); | ||
it.should("parse " + type + " with types", function () { | ||
parseTag("@" + type + " {Boolean|String} someName some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types:["Boolean", "String"], name:{name:"someName", optional:false, defaultValue:undefined}, description:"some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"param", props:{types:["Boolean", "String"], name:{name:"someName", optional:false, defaultValue:undefined}, description:"some name description"}} | ||
]); | ||
}); | ||
it.should("parse " + type + " as optional without value", function () { | ||
parseTag("@" + type + " [someName] some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types:[], name:{name:"someName", optional:true, defaultValue:undefined}, description:"some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"param", props:{types:[], name:{name:"someName", optional:true, defaultValue:undefined}, description:"some name description"}} | ||
]); | ||
}); | ||
it.should("parse " + type + " as optional with value", function () { | ||
parseTag("@" + type + " [someName=true] some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types:[], name:{name:"someName", optional:true, defaultValue:"true"}, description:"some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"param", props:{types:[], name:{name:"someName", optional:true, defaultValue:"true"}, description:"some name description"}} | ||
]); | ||
}); | ||
it.should("parse " + type + " with types as optional without value", function () { | ||
parseTag("@" + type + " {Boolean|String} [someName] some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types:["Boolean", "String"], name:{name:"someName", optional:true, defaultValue:undefined}, description:"some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"param", props:{types:["Boolean", "String"], name:{name:"someName", optional:true, defaultValue:undefined}, description:"some name description"}} | ||
]); | ||
}); | ||
it.should("parse " + type + " with types as optional with value", function () { | ||
parseTag("@" + type + " {Boolean|String} [someName=true] some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types:["Boolean", "String"], name:{name:"someName", optional:true, defaultValue:"true"}, description:"some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"param", props:{types:["Boolean", "String"], name:{name:"someName", optional:true, defaultValue:"true"}, description:"some name description"}} | ||
]); | ||
}); | ||
it.should("parse " + type + " with types as optional with value", function () { | ||
parseTag("@" + type + " {Boolean|String} [someName=true] some name description"); | ||
assert.deepEqual(symbol.params, [ | ||
{types: ["Boolean", "String"], name: {name: "someName", optional: true, defaultValue: "true"}, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "param", props: {types: ["Boolean", "String"], name: {name: "someName", optional: true, defaultValue: "true"}, description: "some name description"}} | ||
]); | ||
}); | ||
}); | ||
["return", "returns"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type + " some description"); | ||
assert.deepEqual(symbol.returns, [ | ||
{types:[], description:"some description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"returns", props:{types:[], description:"some description"}} | ||
]); | ||
}); | ||
it.should("parse " + type + " with types", function () { | ||
parseTag("@" + type + " {Boolean|String} some description"); | ||
assert.deepEqual(symbol.returns, [ | ||
{types:["Boolean", "String"], description:"some description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"returns", props:{types:["Boolean", "String"], description:"some description"}} | ||
]); | ||
}); | ||
["return", "returns"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type + " some description"); | ||
assert.deepEqual(symbol.returns, [ | ||
{types: [], description: "some description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "returns", props: {types: [], description: "some description"}} | ||
]); | ||
}); | ||
it.should("parse " + type + " with types", function () { | ||
parseTag("@" + type + " {Boolean|String} some description"); | ||
assert.deepEqual(symbol.returns, [ | ||
{types: ["Boolean", "String"], description: "some description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "returns", props: {types: ["Boolean", "String"], description: "some description"}} | ||
]); | ||
}); | ||
}); | ||
["memberof", "memberOf"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type + " test.Test"); | ||
assert.deepEqual(symbol.memberof, "test.Test"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"memberof", props:{of:"test.Test"}} | ||
]); | ||
}); | ||
it.should("parse " + type + " with name path", function () { | ||
parseTag("@" + type + " test.Test#"); | ||
assert.deepEqual(symbol.memberof, "test.Test.prototype"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"memberof", props:{of:"test.Test.prototype"}} | ||
]); | ||
}); | ||
["memberof", "memberOf"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type + " test.Test"); | ||
assert.deepEqual(symbol.memberof, "test.Test"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "memberof", props: {of: "test.Test"}} | ||
]); | ||
}); | ||
it.should("parse name", function () { | ||
parseTag("@name SomeName"); | ||
assert.deepEqual(symbol.name, "SomeName"); | ||
it.should("parse " + type + " with name path", function () { | ||
parseTag("@" + type + " test.Test#"); | ||
assert.deepEqual(symbol.memberof, "test.Test.prototype"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"name", props:{name:"SomeName"}} | ||
{tag: "memberof", props: {of: "test.Test.prototype"}} | ||
]); | ||
}); | ||
}); | ||
["constructor", "constructs"].forEach(function (type) { | ||
it.should("parse name", function () { | ||
parseTag("@name SomeName"); | ||
assert.deepEqual(symbol.name, "SomeName"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "name", props: {name: "SomeName"}} | ||
]); | ||
}); | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type); | ||
assert.isTrue(symbol.isConstructor); | ||
assert.equal(symbol.name, ""); | ||
assert.equal(symbol.memberof, ""); | ||
}); | ||
["constructor", "constructs"].forEach(function (type) { | ||
it.should("parse " + type + " and resolve name and memberof", function () { | ||
symbol.name = "constructor"; | ||
symbol.memberof = "some.ObjectType.prototype"; | ||
parseTag("@" + type); | ||
assert.isTrue(symbol.isConstructor); | ||
assert.equal(symbol.name, "ObjectType"); | ||
assert.equal(symbol.memberof, "some"); | ||
}); | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type); | ||
assert.isTrue(symbol.isConstructor); | ||
assert.equal(symbol.name, ""); | ||
assert.equal(symbol.memberof, ""); | ||
}); | ||
["class", "classdesc"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type + " some description of class"); | ||
assert.isTrue(symbol.isConstructor); | ||
assert.equal(symbol.description, "some description of class"); | ||
assert.equal(symbol.name, ""); | ||
assert.equal(symbol.memberof, ""); | ||
}); | ||
it.should("parse " + type + " and resolve name and memberof", function () { | ||
symbol.name = "constructor"; | ||
symbol.memberof = "some.ObjectType.prototype"; | ||
parseTag("@" + type + " some description of class"); | ||
assert.isTrue(symbol.isConstructor); | ||
assert.equal(symbol.description, "some description of class"); | ||
assert.equal(symbol.name, "ObjectType"); | ||
assert.equal(symbol.memberof, "some"); | ||
}); | ||
it.should("parse " + type + " and resolve name and memberof", function () { | ||
symbol.name = "constructor"; | ||
symbol.memberof = "some.ObjectType.prototype"; | ||
parseTag("@" + type); | ||
assert.isTrue(symbol.isConstructor); | ||
assert.equal(symbol.name, "ObjectType"); | ||
assert.equal(symbol.memberof, "some"); | ||
}); | ||
it.should("parse example", function () { | ||
parseTag("@example \n var test = 'Test';\n test.match(/test/ig);\n"); | ||
assert.deepEqual(symbol.examples, [ | ||
{code:"var test = 'Test';\n test.match(/test/ig);"} | ||
]); | ||
}); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"example", props:{code:"var test = 'Test';\n test.match(/test/ig);"}} | ||
]); | ||
}); | ||
["class", "classdesc"].forEach(function (type) { | ||
["private", "protected", "public"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type); | ||
var prop = "is" + type.charAt(0).toUpperCase() + type.substr(1); | ||
assert.isTrue(symbol[prop]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:type, props:{}} | ||
]); | ||
}); | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type + " some description of class"); | ||
assert.isTrue(symbol.isConstructor); | ||
assert.equal(symbol.description, "some description of class"); | ||
assert.equal(symbol.name, ""); | ||
assert.equal(symbol.memberof, ""); | ||
}); | ||
["ignore", "ignoreCode"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
assert.isFalse(symbol[type]); | ||
parseTag("@" + type); | ||
assert.isTrue(symbol[type]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:type, props:{}} | ||
]); | ||
}); | ||
it.should("parse " + type + " and resolve name and memberof", function () { | ||
symbol.name = "constructor"; | ||
symbol.memberof = "some.ObjectType.prototype"; | ||
parseTag("@" + type + " some description of class"); | ||
assert.isTrue(symbol.isConstructor); | ||
assert.equal(symbol.description, "some description of class"); | ||
assert.equal(symbol.name, "ObjectType"); | ||
assert.equal(symbol.memberof, "some"); | ||
}); | ||
}); | ||
["method", "function"].forEach(function (type) { | ||
it.should("parse example", function () { | ||
parseTag("@example \n var test = 'Test';\n test.match(/test/ig);\n"); | ||
assert.deepEqual(symbol.examples, [ | ||
{code: "var test = 'Test';\n test.match(/test/ig);"} | ||
]); | ||
it.should("parse " + type, function () { | ||
assert.isFalse(symbol.isFunction); | ||
parseTag("@" + type); | ||
assert.isTrue(symbol.isFunction); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"method", props:{}} | ||
]); | ||
}); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "example", props: {code: "var test = 'Test';\n test.match(/test/ig);"}} | ||
]); | ||
}); | ||
}); | ||
it.should("parse field", function () { | ||
assert.isFalse(symbol.isFunction); | ||
parseTag("@field"); | ||
assert.isFalse(symbol.isFunction); | ||
["private", "protected", "public"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type); | ||
var prop = "is" + type.charAt(0).toUpperCase() + type.substr(1); | ||
assert.isTrue(symbol[prop]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"field", props:{}} | ||
{tag: type, props: {}} | ||
]); | ||
}); | ||
}); | ||
it.should("parse type", function () { | ||
parseTag("@type Boolean"); | ||
assert.equal(symbol.type, "Boolean"); | ||
["ignore", "ignoreCode"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
assert.isFalse(symbol[type]); | ||
parseTag("@" + type); | ||
assert.isTrue(symbol[type]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"type", props:{type:"Boolean"}} | ||
{tag: type, props: {}} | ||
]); | ||
}); | ||
}); | ||
it.should("parse default", function () { | ||
parseTag("@default 'Some Default Value!'"); | ||
assert.equal(symbol.code, "'Some Default Value!'"); | ||
["method", "function"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
assert.isFalse(symbol.isFunction); | ||
parseTag("@" + type); | ||
assert.isTrue(symbol.isFunction); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"default", props:{defaultValue:"'Some Default Value!'"}} | ||
{tag: "method", props: {}} | ||
]); | ||
}); | ||
["throw", "throws", "exception"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type + " description of exception"); | ||
var props = {types:[], description:"description of exception"}; | ||
assert.deepEqual(symbol.throws, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"throws", props:props} | ||
]); | ||
}); | ||
it.should("parse " + type + " with a type", function () { | ||
parseTag("@" + type + " {Error} description of exception"); | ||
var props = {types:["Error"], description:"description of exception"}; | ||
assert.deepEqual(symbol.throws, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"throws", props:props} | ||
]); | ||
}); | ||
}); | ||
it.should("parse " + type + " with multiple types", function () { | ||
parseTag("@" + type + " {Error|CustomError} description of exception"); | ||
var props = {types:["Error", "CustomError"], description:"description of exception"}; | ||
assert.deepEqual(symbol.throws, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"throws", props:props} | ||
]); | ||
}); | ||
}); | ||
it.should("parse field", function () { | ||
assert.isFalse(symbol.isFunction); | ||
parseTag("@field"); | ||
assert.isFalse(symbol.isFunction); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "field", props: {}} | ||
]); | ||
}); | ||
it.should("parse property", function () { | ||
parseTag("@property someName some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type:[], name:"someName", code:undefined, isStatic:false, description:"some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"property", props:{types:[], name:{name:"someName", optional:false, defaultValue:undefined}, description:"some name description"}} | ||
]); | ||
}); | ||
it.should("parse property with types", function () { | ||
parseTag("@property {Boolean|String} someName some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type:["Boolean", "String"], name:"someName", code:undefined, isStatic:false, description:"some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"property", props:{types:["Boolean", "String"], name:{name:"someName", optional:false, defaultValue:undefined}, description:"some name description"}} | ||
]); | ||
}); | ||
it.should("parse type", function () { | ||
parseTag("@type Boolean"); | ||
assert.equal(symbol.type, "Boolean"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "type", props: {type: "Boolean"}} | ||
]); | ||
}); | ||
it.should("parse property as optional without value", function () { | ||
parseTag("@property [someName] some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type:[], name:"someName", code:undefined, isStatic:false, description:"some name description"} | ||
]); | ||
it.should("parse default", function () { | ||
parseTag("@default 'Some Default Value!'"); | ||
assert.equal(symbol.code, "'Some Default Value!'"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "default", props: {defaultValue: "'Some Default Value!'"}} | ||
]); | ||
}); | ||
["throw", "throws", "exception"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
parseTag("@" + type + " description of exception"); | ||
var props = {types: [], description: "description of exception"}; | ||
assert.deepEqual(symbol.throws, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"property", props:{types:[], name:{name:"someName", optional:true, defaultValue:undefined}, description:"some name description"}} | ||
{tag: "throws", props: props} | ||
]); | ||
}); | ||
it.should("parse property as optional with value", function () { | ||
parseTag("@property [someName=true] some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type:[], name:"someName", code:"true", isStatic:false, description:"some name description"} | ||
]); | ||
it.should("parse " + type + " with a type", function () { | ||
parseTag("@" + type + " {Error} description of exception"); | ||
var props = {types: ["Error"], description: "description of exception"}; | ||
assert.deepEqual(symbol.throws, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"property", props:{types:[], name:{name:"someName", optional:true, defaultValue:"true"}, description:"some name description"}} | ||
{tag: "throws", props: props} | ||
]); | ||
}); | ||
it.should("parse property with types as optional without value", function () { | ||
parseTag("@property {Boolean|String} [someName] some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type:["Boolean", "String"], name:"someName", code:undefined, isStatic:false, description:"some name description"} | ||
]); | ||
it.should("parse " + type + " with multiple types", function () { | ||
parseTag("@" + type + " {Error|CustomError} description of exception"); | ||
var props = {types: ["Error", "CustomError"], description: "description of exception"}; | ||
assert.deepEqual(symbol.throws, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"property", props:{types:["Boolean", "String"], name:{name:"someName", optional:true, defaultValue:undefined}, description:"some name description"}} | ||
{tag: "throws", props: props} | ||
]); | ||
}); | ||
}); | ||
it.should("parse property with types as optional with value", function () { | ||
parseTag("@property {Boolean|String} [someName=true] some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type:["Boolean", "String"], name:"someName", code:"true", isStatic:false, description:"some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"property", props:{types:["Boolean", "String"], name:{name:"someName", optional:true, defaultValue:"true"}, description:"some name description"}} | ||
]); | ||
}); | ||
it.should("parse property", function () { | ||
parseTag("@property someName some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type: [], name: "someName", code: undefined, isStatic: false, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "property", props: {types: [], name: {name: "someName", optional: false, defaultValue: undefined}, description: "some name description"}} | ||
]); | ||
}); | ||
it.should("parse property with types", function () { | ||
parseTag("@property {Boolean|String} someName some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type: ["Boolean", "String"], name: "someName", code: undefined, isStatic: false, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "property", props: {types: ["Boolean", "String"], name: {name: "someName", optional: false, defaultValue: undefined}, description: "some name description"}} | ||
]); | ||
}); | ||
it.should("parse borrows", function () { | ||
parseTag("@borrows test.func as func"); | ||
var props = {borrows:{memberof:"test", name:"func"}, as:"func", isStatic:true}; | ||
assert.deepEqual(symbol.borrows, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"borrows", props:props} | ||
]); | ||
}); | ||
it.should("parse property as optional without value", function () { | ||
parseTag("@property [someName] some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type: [], name: "someName", code: undefined, isStatic: false, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "property", props: {types: [], name: {name: "someName", optional: true, defaultValue: undefined}, description: "some name description"}} | ||
]); | ||
}); | ||
it.should("parse borrows with '.' namepath", function () { | ||
parseTag("@borrows test.func as .func"); | ||
var props = {borrows:{memberof:"test", name:"func"}, as:"func", isStatic:true}; | ||
assert.deepEqual(symbol.borrows, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"borrows", props:props} | ||
]); | ||
}); | ||
it.should("parse property as optional with value", function () { | ||
parseTag("@property [someName=true] some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type: [], name: "someName", code: "true", isStatic: false, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "property", props: {types: [], name: {name: "someName", optional: true, defaultValue: "true"}, description: "some name description"}} | ||
]); | ||
}); | ||
it.should("parse borrows with '#' namepath", function () { | ||
parseTag("@borrows test.func as #func"); | ||
var props = {borrows:{memberof:"test", name:"func"}, as:"func", isStatic:false}; | ||
assert.deepEqual(symbol.borrows, [props]); | ||
it.should("parse property with types as optional without value", function () { | ||
parseTag("@property {Boolean|String} [someName] some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type: ["Boolean", "String"], name: "someName", code: undefined, isStatic: false, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "property", props: {types: ["Boolean", "String"], name: {name: "someName", optional: true, defaultValue: undefined}, description: "some name description"}} | ||
]); | ||
}); | ||
it.should("parse property with types as optional with value", function () { | ||
parseTag("@property {Boolean|String} [someName=true] some name description"); | ||
assert.deepEqual(symbol.properties, [ | ||
{type: ["Boolean", "String"], name: "someName", code: "true", isStatic: false, description: "some name description"} | ||
]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "property", props: {types: ["Boolean", "String"], name: {name: "someName", optional: true, defaultValue: "true"}, description: "some name description"}} | ||
]); | ||
}); | ||
it.should("parse borrows", function () { | ||
parseTag("@borrows test.func as func"); | ||
var props = {borrows: {memberof: "test", name: "func"}, as: "func", isStatic: true}; | ||
assert.deepEqual(symbol.borrows, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "borrows", props: props} | ||
]); | ||
}); | ||
it.should("parse borrows with '.' namepath", function () { | ||
parseTag("@borrows test.func as .func"); | ||
var props = {borrows: {memberof: "test", name: "func"}, as: "func", isStatic: true}; | ||
assert.deepEqual(symbol.borrows, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "borrows", props: props} | ||
]); | ||
}); | ||
it.should("parse borrows with '#' namepath", function () { | ||
parseTag("@borrows test.func as #func"); | ||
var props = {borrows: {memberof: "test", name: "func"}, as: "func", isStatic: false}; | ||
assert.deepEqual(symbol.borrows, [props]); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "borrows", props: props} | ||
]); | ||
}); | ||
["const", "constant"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
assert.isFalse(symbol.isConstant); | ||
parseTag("@" + type); | ||
assert.isTrue(symbol.isConstant); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"borrows", props:props} | ||
{tag: "constant", props: {}} | ||
]); | ||
}); | ||
["const", "constant"].forEach(function (type) { | ||
}); | ||
it.should("parse " + type, function () { | ||
assert.isFalse(symbol.isConstant); | ||
parseTag("@" + type); | ||
assert.isTrue(symbol.isConstant); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"constant", props:{}} | ||
]); | ||
}); | ||
["desc", "description"].forEach(function (type) { | ||
it.should("parse " + type, function () { | ||
assert.equal(symbol.description, ""); | ||
parseTag("@" + type + " some test description"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "description", props: {description: "some test description"}} | ||
]); | ||
}); | ||
["desc", "description"].forEach(function (type) { | ||
}); | ||
it.should("parse " + type, function () { | ||
assert.equal(symbol.description, ""); | ||
parseTag("@" + type + " some test description"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"description", props:{description:"some test description"}} | ||
]); | ||
}); | ||
it.should("parse projectName", function () { | ||
parseTag("@projectName testProject"); | ||
assert.isTrue(symbol.isProjectName); | ||
assert.equal(symbol.projectName, "testProject"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "projectName", props: {description: "testProject"}} | ||
]); | ||
}); | ||
}); | ||
it.describe("@header", function (it) { | ||
it.should("parse projectName", function () { | ||
parseTag("@projectName testProject"); | ||
assert.isTrue(symbol.isProjectName); | ||
assert.equal(symbol.projectName, "testProject"); | ||
it.should("with description", function () { | ||
parseTag("@header \n[this] is a project\ndescription"); | ||
assert.isTrue(symbol.isHeader); | ||
assert.equal(symbol.header.content, "[this] is a project\ndescription"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"projectName", props:{description:"testProject"}} | ||
{tag: "header", props: {content: "[this] is a project\ndescription"}} | ||
]); | ||
}); | ||
it.should("parse header", function () { | ||
parseTag("@header \nthis is a project\ndescription"); | ||
it.should("header with location", function () { | ||
parseTag("@header [../myFile.md]"); | ||
assert.isTrue(symbol.isHeader); | ||
assert.equal(symbol.header, "this is a project\ndescription"); | ||
assert.equal(symbol.header.location, "../myFile.md"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"header", props:{description:"this is a project\ndescription"}} | ||
{tag: "header", props: {location: "../myFile.md", file: symbol.file}} | ||
]); | ||
}); | ||
}); | ||
it.should("parse footer", function () { | ||
parseTag("@footer \nthis is a project\nfooter"); | ||
it.describe("@footer", function (it) { | ||
it.should("with description", function () { | ||
parseTag("@footer \n[this] is a project\nfooter"); | ||
assert.isTrue(symbol.isFooter); | ||
assert.equal(symbol.footer, "this is a project\nfooter"); | ||
assert.equal(symbol.footer.content, "[this] is a project\nfooter"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"footer", props:{description:"this is a project\nfooter"}} | ||
{tag: "footer", props: {content: "[this] is a project\nfooter"}} | ||
]); | ||
}); | ||
it.should("header with location", function () { | ||
parseTag("@footer [../myFile.md]"); | ||
assert.isTrue(symbol.isFooter); | ||
assert.equal(symbol.footer.location, "../myFile.md"); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "footer", props: {location: "../myFile.md", file: symbol.file}} | ||
]); | ||
}); | ||
}); | ||
}); | ||
it.describe("#addTagHandler", function (it) { | ||
var types = ["void", "VOID", "Void"]; | ||
it.beforeAll(function () { | ||
tags.addTagHandler(types.join("|"), function (comment, symbol, context) { | ||
//do something with the tag or add properties to the symbol. | ||
symbol.isVoid = true; | ||
symbol.tags.push({tag:"void", props:{}}); | ||
}); | ||
it.describe("#addTagHandler", function (it) { | ||
var types = ["void", "VOID", "Void"]; | ||
it.beforeAll(function () { | ||
tags.addTagHandler(types.join("|"), function (comment, symbol, context) { | ||
//do something with the tag or add properties to the symbol. | ||
symbol.isVoid = true; | ||
symbol.tags.push({tag: "void", props: {}}); | ||
}); | ||
it.should("add it to the tagRegExp", function () { | ||
assert.deepEqual(tags.getTagRegexp().toString(), | ||
"/@(augments|extends|lends|namespace|param|parameter|arg|argument|return|returns|memberof|memberOf" + | ||
"|name|constructor|constructs|class|classdesc|example|see|private|protected|public|ignore" + | ||
"|ignoreCode|method|function|field|type|default|throws|throw|exception|property|borrows|constant" + | ||
"|const|desc|description|projectName|header|footer|void|VOID|Void)/"); | ||
}); | ||
it.should("add it to the tagRegExp", function () { | ||
assert.deepEqual(tags.getTagRegexp().toString(), | ||
"/@(augments|extends|lends|namespace|param|parameter|arg|argument|return|returns|memberof|memberOf" + | ||
"|name|constructor|constructs|class|classdesc|example|see|private|protected|static|public|ignore|ignoreCode" + | ||
"|method|function|field|type|default|throws|throw|exception|property|borrows|constant|const|desc" + | ||
"|description|projectName|header|footer|github|includeDoc|void|VOID|Void)/"); | ||
}); | ||
types.forEach(function (type) { | ||
it.should("parse the " + type + " added tag", function () { | ||
parseTag("@" + type); | ||
assert.isTrue(symbol.isVoid); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag: "void", props: {}} | ||
]); | ||
}); | ||
types.forEach(function (type) { | ||
it.should("parse the " + type + " added tag", function () { | ||
parseTag("@" + type); | ||
assert.isTrue(symbol.isVoid); | ||
assert.deepEqual(symbol.tags, [ | ||
{tag:"void", props:{}} | ||
]); | ||
}); | ||
}); | ||
}); | ||
it.run(); | ||
}); | ||
})(); | ||
}); | ||
it.run(); | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
0
1935767
4
127
28450
2
+ Addedmarked@~0.2.8
+ Addedwrench@~1.4.4
+ Addedamdefine@1.0.1(transitive)
+ Addedasync@0.2.10(transitive)
+ Addedhandlebars@1.0.12(transitive)
+ Addedmarked@0.2.10(transitive)
+ Addedoptimist@0.3.7(transitive)
+ Addedsource-map@0.1.43(transitive)
+ Addeduglify-js@2.3.6(transitive)
+ Addedwordwrap@0.0.3(transitive)
+ Addedwrench@1.4.4(transitive)
- Removedhandlebars@4.7.8(transitive)
- Removedminimist@1.2.8(transitive)
- Removedneo-async@2.6.2(transitive)
- Removedsource-map@0.6.1(transitive)
- Removeduglify-js@3.18.0(transitive)
- Removedwordwrap@1.0.0(transitive)
Updatedhandlebars@~1.0.10