diff --git a/docs/css/prism.css b/docs/css/prism.css new file mode 100644 index 0000000..6d38dfb --- /dev/null +++ b/docs/css/prism.css @@ -0,0 +1,126 @@ +/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ + +code[class*="language-"], +pre[class*="language-"] { + color: black; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, pre[class*="language-"] ::selection, +code[class*="language-"]::selection, code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.builtin { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string, +.token.variable { + color: #a67f59; + background: hsla(0,0%,100%,.5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + + +.token.regex, +.token.important { + color: #e90; +} + +.token.important { + font-weight: bold; +} + +.token.entity { + cursor: help; +} diff --git a/docs/css/styles.css b/docs/css/styles.css new file mode 100644 index 0000000..9a3fffc --- /dev/null +++ b/docs/css/styles.css @@ -0,0 +1,175 @@ + +@font-face { + font-family: 'Source Code Pro'; + src: url('../fonts/sourcecodepro-regular-webfont.eot'); + src: url('../fonts/sourcecodepro-regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/sourcecodepro-regular-webfont.woff') format('woff'), + url('../fonts/sourcecodepro-regular-webfont.ttf') format('truetype'), + url('../fonts/sourcecodepro-regular-webfont.svg#source_code_proregular') format('svg'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Fira Sans'; + src: url('../fonts/firasans-regular-webfont.eot'); + src: url('../fonts/firasans-regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/firasans-regular-webfont.woff') format('woff'), + url('../fonts/firasans-regular-webfont.ttf') format('truetype'), + url('../fonts/firasans-regular-webfont.svg#fira_sansregular') format('svg'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Fira Sans'; + src: url('../fonts/firasans-bold-webfont.eot'); + src: url('../fonts/firasans-bold-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/firasans-bold-webfont.woff') format('woff'), + url('../fonts/firasans-bold-webfont.ttf') format('truetype'), + url('../fonts/firasans-bold-webfont.svg#fira_sansbold') format('svg'); + font-weight: bold; + font-style: normal; +} + +body { + margin: 0; + padding: 0; + font: 400 14px/1.5 'Fira Sans', 'Arial', sans-serif; + color: #666; +} + +header { + position: fixed; + top: 0; + left: 0; + background: rgba(255, 255, 255, .9); + border-bottom: 1px solid #ddd; + box-shadow: 0 0 4px #eee; + width: 100%; + z-index: 100; + height: 50px; +} + +h1 { + width: 700px; + margin: 0 auto; + line-height: 50px; +} + +h3 { + margin: 0; + padding: 0; +} + +main { + width: 700px; + margin: 0 auto; +} + +code[class*="language-"], +pre[class*="language-"] { + font-family: 'Source Code Pro'; +} + +pre code { + font-size: 12px; +} + +h1, h2, h3, h4 { + color: #353535; + -webkit-font-smoothing: antialiased; +} + +a { + color: #259dff; + text-decoration: none; +} + +/* navigation on right side */ +nav { + position: fixed; + right: 40px; + top: 60px; + text-align: right; +} + +nav ul { + list-style: none; +} + +section { + /* important for absolute positioned links inside */ + position: relative; + margin-bottom: 40px; +} + +/* custom code block styles */ +pre[class*="language-"] { + background: none; + border: 1px solid #e7e7e7; +} + +/* heading hover link */ +.link { + position: absolute; + top: 80px; + left: -20px; + opacity: 0; + width: 22px; + color: #353535; +} + +/* github repo source code link */ +.source-link { + color: #353535; + padding-left: 5px; + opacity: 0; +} + +/* show link symbol on heading and link hover */ +h3:hover .link, +h3:hover .source-link { + opacity: 1; +} + +.link:hover, +.source-link:hover { + opacity: 1; +} + +.repo-link { + color: #353535; + margin-left: 15px; +} + +nav a { + color: #666; +} + +/* scrollspy classes */ +li.active a, +li.active:hover a, +li:focus a { + color: #259dff; +} + +/* put some space between anchors and top */ +h3[id] { + padding-top: 80px; +} + +/* don't indent unordered list in section */ +section ul { + padding-left: 0; + list-style-position: inside; +} + +section ul ul { + padding-left: 30px; +} + +/* decrease space between parameters list */ +section li p { + margin: 10px initial; +} diff --git a/docs/fonts/firasans-bold-webfont.eot b/docs/fonts/firasans-bold-webfont.eot new file mode 100644 index 0000000..87d0eac Binary files /dev/null and b/docs/fonts/firasans-bold-webfont.eot differ diff --git a/docs/fonts/firasans-bold-webfont.svg b/docs/fonts/firasans-bold-webfont.svg new file mode 100644 index 0000000..567d91b --- /dev/null +++ b/docs/fonts/firasans-bold-webfont.svg @@ -0,0 +1,997 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/firasans-bold-webfont.ttf b/docs/fonts/firasans-bold-webfont.ttf new file mode 100644 index 0000000..9bc2b90 Binary files /dev/null and b/docs/fonts/firasans-bold-webfont.ttf differ diff --git a/docs/fonts/firasans-bold-webfont.woff b/docs/fonts/firasans-bold-webfont.woff new file mode 100644 index 0000000..c978b2a Binary files /dev/null and b/docs/fonts/firasans-bold-webfont.woff differ diff --git a/docs/fonts/firasans-regular-webfont.eot b/docs/fonts/firasans-regular-webfont.eot new file mode 100644 index 0000000..3a91314 Binary files /dev/null and b/docs/fonts/firasans-regular-webfont.eot differ diff --git a/docs/fonts/firasans-regular-webfont.svg b/docs/fonts/firasans-regular-webfont.svg new file mode 100644 index 0000000..193b5ea --- /dev/null +++ b/docs/fonts/firasans-regular-webfont.svg @@ -0,0 +1,997 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/firasans-regular-webfont.ttf b/docs/fonts/firasans-regular-webfont.ttf new file mode 100644 index 0000000..e1d6229 Binary files /dev/null and b/docs/fonts/firasans-regular-webfont.ttf differ diff --git a/docs/fonts/firasans-regular-webfont.woff b/docs/fonts/firasans-regular-webfont.woff new file mode 100644 index 0000000..5eb252f Binary files /dev/null and b/docs/fonts/firasans-regular-webfont.woff differ diff --git a/docs/fonts/sourcecodepro-regular-webfont.eot b/docs/fonts/sourcecodepro-regular-webfont.eot new file mode 100644 index 0000000..cdba6e3 Binary files /dev/null and b/docs/fonts/sourcecodepro-regular-webfont.eot differ diff --git a/docs/fonts/sourcecodepro-regular-webfont.svg b/docs/fonts/sourcecodepro-regular-webfont.svg new file mode 100644 index 0000000..901a919 --- /dev/null +++ b/docs/fonts/sourcecodepro-regular-webfont.svg @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/sourcecodepro-regular-webfont.ttf b/docs/fonts/sourcecodepro-regular-webfont.ttf new file mode 100644 index 0000000..fd31e3c Binary files /dev/null and b/docs/fonts/sourcecodepro-regular-webfont.ttf differ diff --git a/docs/fonts/sourcecodepro-regular-webfont.woff b/docs/fonts/sourcecodepro-regular-webfont.woff new file mode 100644 index 0000000..5ac1e31 Binary files /dev/null and b/docs/fonts/sourcecodepro-regular-webfont.woff differ diff --git a/docs/includes/find.md b/docs/includes/find.md new file mode 100644 index 0000000..69db750 --- /dev/null +++ b/docs/includes/find.md @@ -0,0 +1,38 @@ + +### find(match, query, done) + +Find user. Match is either `name`, `email` or `signupToken`. + + +- `match` **String** - Property to find user by. name, email or signupToken + +- `query` **String** - Corresponding value to match + +- `done` **function** - Callback function function(err, user){} + + + + + +#### Example + + +```javascript +adapter.find('name', 'john', function(err, user) { + if (err) console.log(err); + console.log(user); + // { + // name: 'john', + // email: 'john@email.com', + // signupToken: '3a7f0f54-32f0-44f7-97c6-f1470b94c170', + // signupTimestamp: Fri Apr 11 2014 21:31:54 GMT+0200 (CEST), + // signupTokenExpires: Sat Apr 12 2014 21:31:54 GMT+0200 (CEST), + // failedLoginAttempts: 0, + // salt: '753981e8d8e30e8047cf5685d1f0a0d4', + // derived_key: '18ce03eddab6729aeaaf76729c90cb31f16a863c', + // _id: 5348432a98a8a6a4fef1f595 + // } +}); +``` + + diff --git a/docs/includes/remove.md b/docs/includes/remove.md new file mode 100644 index 0000000..2691104 --- /dev/null +++ b/docs/includes/remove.md @@ -0,0 +1,26 @@ + +### remove(name, done) + +Delete existing user. + + +- `name` **String** - User name + +- `done` **function** - Callback function function(err, res){} + + + + + +#### Example + + +```javascript +adapter.remove('john', function(err, res) { + if (err) console.log(err); + console.log(res); + // true +}); +``` + + diff --git a/docs/includes/save.md b/docs/includes/save.md new file mode 100644 index 0000000..d220e2f --- /dev/null +++ b/docs/includes/save.md @@ -0,0 +1,40 @@ + +### save(name, email, pw, done) + +Create new user. + + +- `name` **String** - User name + +- `email` **String** - User email + +- `pw` **String** - Plain text user password + +- `done` **function** - Callback function function(err, user){} + + + + + +#### Example + + +```javascript +adapter.save('john', 'john@email.com', 'secret', function(err, user) { + if (err) console.log(err); + console.log(user); + // { + // name: 'john', + // email: 'john@email.com', + // signupToken: 'ef32a95a-d6ee-405a-8e4b-515b235f7c54', + // signupTimestamp: Wed Jan 15 2014 19:08:27 GMT+0100 (CET), + // signupTokenExpires: Wed Jan 15 2014 19:08:27 GMT+0100 (CET), + // failedLoginAttempts: 0, + // salt: '48cf9da376703199c30ba5c274580c98', + // derived_key: '502967e5a6e55091f4c2c80e7989623f051070fd', + // _id: 52d6ce9b651b4d825351641f + // } +}); +``` + + diff --git a/docs/includes/update.md b/docs/includes/update.md new file mode 100644 index 0000000..204b3da --- /dev/null +++ b/docs/includes/update.md @@ -0,0 +1,35 @@ + +### update(user, done) + +Update existing user. + + +- `user` **Object** - Existing user from db + +- `done` **function** - Callback function function(err, user){} + + + + + +#### Example + + +```javascript +// get user from db +adapter.find('name', 'john', function(err, user) { + if (err) console.log(err); + + // add some new properties + user.newKey = 'and some value'; + user.hasBeenUpdated = true; + + // save updated user to db + adapter.update(user, function(err, user) { + if (err) console.log(err); + // ... + }); +}); +``` + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..a0254d0 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,188 @@ + + + + lockit-mongodb-adapter + + + + + +
+

+ lockit-mongodb-adapter + + + +

+
+ +
+ +
+

save(name, email, pw, done)

+

Create new user.

+ +

Example

+
adapter.save('john', 'john@email.com', 'secret', function(err, user) {
+  if (err) console.log(err);
+  console.log(user);
+  // {
+  //  name: 'john',
+  //  email: 'john@email.com',
+  //  signupToken: 'ef32a95a-d6ee-405a-8e4b-515b235f7c54',
+  //  signupTimestamp: Wed Jan 15 2014 19:08:27 GMT+0100 (CET),
+  //  signupTokenExpires: Wed Jan 15 2014 19:08:27 GMT+0100 (CET),
+  //  failedLoginAttempts: 0,
+  //  salt: '48cf9da376703199c30ba5c274580c98',
+  //  derived_key: '502967e5a6e55091f4c2c80e7989623f051070fd',
+  //  _id: 52d6ce9b651b4d825351641f
+  // }
+});
+
+ +
+ +
+

find(match, query, done)

+

Find user. Match is either name, email or signupToken.

+ +

Example

+
adapter.find('name', 'john', function(err, user) {
+  if (err) console.log(err);
+  console.log(user);
+  // {
+  //   name: 'john',
+  //   email: 'john@email.com',
+  //   signupToken: '3a7f0f54-32f0-44f7-97c6-f1470b94c170',
+  //   signupTimestamp: Fri Apr 11 2014 21:31:54 GMT+0200 (CEST),
+  //   signupTokenExpires: Sat Apr 12 2014 21:31:54 GMT+0200 (CEST),
+  //   failedLoginAttempts: 0,
+  //   salt: '753981e8d8e30e8047cf5685d1f0a0d4',
+  //   derived_key: '18ce03eddab6729aeaaf76729c90cb31f16a863c',
+  //   _id: 5348432a98a8a6a4fef1f595
+  // }
+});
+
+ +
+ +
+

update(user, done)

+

Update existing user.

+ +

Example

+
// get user from db
+adapter.find('name', 'john', function(err, user) {
+  if (err) console.log(err);
+
+  // add some new properties
+  user.newKey = 'and some value';
+  user.hasBeenUpdated = true;
+
+  // save updated user to db
+  adapter.update(user, function(err, user) {
+    if (err) console.log(err);
+    // ...
+  });
+});
+
+ +
+ +
+

remove(name, done)

+

Delete existing user.

+ +

Example

+
adapter.remove('john', function(err, res) {
+  if (err) console.log(err);
+  console.log(res);
+  // true
+});
+
+ +
+ +
+ + + + + + diff --git a/docs/js/bootstrap.min.js b/docs/js/bootstrap.min.js new file mode 100644 index 0000000..42033ae --- /dev/null +++ b/docs/js/bootstrap.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.1.1 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + ++function(a){function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}"use strict",b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this,d=this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.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);if(f&&a<=d[0])return f!=(g=e[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])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f=typeof c=="object"&&c;e||d.data("bs.scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery) \ No newline at end of file diff --git a/docs/js/prism.js b/docs/js/prism.js new file mode 100644 index 0000000..f3d197f --- /dev/null +++ b/docs/js/prism.js @@ -0,0 +1,6 @@ +/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */ +var self=typeof window!="undefined"?window:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&").replace(/e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+""};if(!self.document){if(!self.addEventListener)return self.Prism;self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return self.Prism}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}return self.Prism}();typeof module!="undefined"&&module.exports&&(module.exports=Prism);; +Prism.languages.markup={comment:/<!--[\w\W]*?-->/g,prolog:/<\?.+?\?>/,doctype:/<!DOCTYPE.+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))});; +Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(<|<)style[\w\W]*?(>|>)[\w\W]*?(<|<)\/style(>|>)/ig,inside:{tag:{pattern:/(<|<)style[\w\W]*?(>|>)|(<|<)\/style(>|>)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});; +Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}},number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|(&){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};; +Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|get|set|new|with|typeof|try|throw|catch|finally|null|break|continue|this)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<|<)script[\w\W]*?(>|>)[\w\W]*?(<|<)\/script(>|>)/ig,inside:{tag:{pattern:/(<|<)script[\w\W]*?(>|>)|(<|<)\/script(>|>)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;