Comparing version 0.0.21 to 0.0.22
// Generated by CoffeeScript 1.9.2 | ||
/*! Apage 0.0.15 //// MIT Licence //// http://apage.richplastow.com/ */ | ||
/*! Apage 0.0.22 //// MIT Licence //// http://apage.richplastow.com/ */ | ||
@@ -11,3 +11,3 @@ (function() { | ||
ªV = '0.0.15'; | ||
ªV = '0.0.22'; | ||
@@ -288,3 +288,3 @@ ªA = 'array'; | ||
Main.prototype._rules = { | ||
config: [['title', 'Untitled', 'string', /^[^\x00-\x1F]{1,24}$/], ['url', false, 'string', /^[-:.\/a-z0-9]{1,64}$/], ['plugin', '', 'string', /^[^\x00-\x08\x0E-\x1F]{0,10000}$/]] | ||
config: [['title', 'Untitled', 'string', /^[^\x00-\x1F]{1,24}$/], ['url', false, 'string', /^[-:.\/a-z0-9]{1,64}$/], ['plugin', '', 'string', /^[^\x00-\x08\x0E-\x1F]{0,100000}$/]] | ||
}; | ||
@@ -493,5 +493,5 @@ | ||
} | ||
return "\n <script>\n\n//// When the DOM is ready, set up Apage and inject the plugins. \nwindow.addEventListener('load', function () { (function (d) { 'use strict'; \n\n\n//// Declare iterator, length and HTML-reference variables. \nvar i, l, $ref\n\n\n//// Initialize two arrays which are available to all Apage plugins. \n ,arts = []\n ,resolvers = []\n ,updaters = []\n\n\n//// Like jQuery, but native. \n ,$ = d.querySelector.bind(d)\n ,$$ = d.querySelectorAll.bind(d)\n\n\n//// Get a reference to all `<article class=\"apage\">` elements. \n ,$arts = $$('article.apage')\n\n\n//// Convert JavaScript’s native `arguments` object to an array. \n ,getArgs = function (args, offset) {\n return Array.prototype.slice.call(args, offset || 0);\n }\n\n\n//// `unattribute($ref,'data-apage-','opath'...)` removes data attributes. \n ,unattribute = function ($ref, prefix) {\n for ( var i=0, suffs=getArgs(arguments,2), l=suffs.length; i<l; i++ ) {\n $ref.removeAttribute(prefix + suffs[i]);\n }\n }\n\n\n//// Runs each resolver in order. These are added by the plugins, below. \n//// Resolvers are used to map a query to an article. \n ,resolve = function (query) {\n for (var i=0, l=resolvers.length, backstop, result={}; i<l; i++) {\n result = resolvers[i](query);\n if (result.art) { break; } // `query` does resolve to an article\n backstop = result.backstop || backstop; // may return a backstop\n }\n return result.art ? result.art : backstop; //@todo test logic of 'last valid backstop return' with several plugins at once\n }\n\n\n//// Runs each updater in order. These are added by the plugins, below. \n//// Updaters change the current DOM state, eg to show a single article. \n ,update = function (query) {\n for (var i=0, l=updaters.length, current=resolve(query); i<l; i++) {\n updaters[i](current);\n }\n }\n\n\n//// Tidies the URL hash and runs `update()` when the URL hash changes. \n ,onHashchange = function (event) {\n update( window.location.hash.substr(1).replace(/\\//g,'_') );\n if (event) { event.preventDefault(); }\n }\n\n;\n\n\n//// Populate the `arts` array using data from Apage `<ARTICLE>` elements. \nfor (i=0, l=$arts.length; i<l; i++) {\n $ref = $arts[i];\n arts.push({\n id: $ref.getAttribute('id')\n ,opath: $ref.getAttribute('data-apage-opath')\n ,dname: $ref.getAttribute('data-apage-dname')\n ,order: $ref.getAttribute('data-apage-order')\n ,front: JSON.parse( $ref.getAttribute('data-apage-front') )\n ,title: $ref.getAttribute('data-apage-title')\n ,$ref: $ref\n });\n unattribute($ref,'data-apage-','opath','dname','order','front','title');\n}\n\n\n//// Begin injecting plugins. \n\n" + config.plugin + "\n\n//// End injecting plugins. \n\n\n//// Run each updater when the page loads, and when the URL hash changes. \nonHashchange();\nwindow.addEventListener('hashchange', onHashchange);\n\n\n}).call(this, document) });\n\n </script>\n"; | ||
return "\n <script>\n\n//// When the DOM is ready, set up Apage and inject the plugins. \nwindow.addEventListener('load', function () { (function (d) { 'use strict'; \n\n\n//// Declare iterator, length and HTML-reference variables. \nvar i, l, $ref\n\n\n//// Initialize three arrays which are available to all Apage plugins. \n ,arts = []\n ,resolvers = []\n ,updaters = []\n\n\n//// Like jQuery, but native. \n ,$ = d.querySelector.bind(d)\n ,$$ = d.querySelectorAll.bind(d)\n\n\n//// Get a reference to all `<article class=\"apage\">` elements. \n ,$arts = $$('article.apage')\n\n\n//// Convert JavaScript’s native `arguments` object to an array. \n ,getArgs = function (args, offset) {\n return Array.prototype.slice.call(args, offset || 0);\n }\n\n\n//// `unattribute($ref,'data-apage-','opath'...)` removes data attributes. \n ,unattribute = function ($ref, prefix) {\n for ( var i=0, suffs=getArgs(arguments,2), l=suffs.length; i<l; i++ ) {\n $ref.removeAttribute(prefix + suffs[i]);\n }\n }\n\n\n//// Runs each resolver in order. These are added by the plugins, below. \n//// Resolvers are used to map a query to an article. \n ,resolve = function (query) {\n for (var i=0, l=resolvers.length, backstop, result={}; i<l; i++) {\n result = resolvers[i](query);\n if (result.art) { break; } // `query` does resolve to an article\n backstop = result.backstop || backstop; // may return a backstop\n }\n return result.art ? result.art : backstop; //@todo test logic of 'last valid backstop return' with several plugins at once\n }\n\n\n//// Runs each updater in order. These are added by the plugins, below. \n//// Updaters change the current DOM state, eg to show a single article. \n ,update = function (query) {\n for (var i=0, l=updaters.length, current=resolve(query); i<l; i++) {\n updaters[i](current);\n }\n }\n\n\n//// Tidies the URL hash and runs `update()` when the URL hash changes. \n ,onHashchange = function (event) {\n update( window.location.hash.substr(1).replace(/\\//g,'_') );\n if (event) { event.preventDefault(); }\n }\n\n;\n\n\n//// Populate the `arts` array using data from Apage `<ARTICLE>` elements. \n//// Then, remove all 'data-apage-*' attributes except 'data-apage-dname'. \nfor (i=0, l=$arts.length; i<l; i++) {\n $ref = $arts[i];\n arts.push({\n id: $ref.getAttribute('id')\n ,opath: $ref.getAttribute('data-apage-opath')\n ,dname: $ref.getAttribute('data-apage-dname')\n ,order: $ref.getAttribute('data-apage-order')\n ,front: JSON.parse( $ref.getAttribute('data-apage-front') )\n ,title: $ref.getAttribute('data-apage-title')\n ,$ref: $ref\n });\n unattribute($ref,'data-apage-','opath','order','front','title');\n}\n\n\n//// Begin injecting plugins. \n\n" + config.plugin + "\n\n//// End injecting plugins. \n\n\n//// Run each updater when the page loads, and when the URL hash changes. \nonHashchange();\nwindow.addEventListener('hashchange', onHashchange);\n\n\n}).call(this, document) });\n\n </script>\n"; | ||
}; | ||
}).call(this); |
// Generated by CoffeeScript 1.9.2 | ||
/*! Apage 0.0.15 //// MIT Licence //// http://apage.richplastow.com/ | ||
/*! Apage 0.0.22 //// MIT Licence //// http://apage.richplastow.com/ | ||
* plugin/cross-browser.litcoffee | ||
@@ -5,0 +5,0 @@ */ |
// Generated by CoffeeScript 1.9.2 | ||
/*! Apage 0.0.15 //// MIT Licence //// http://apage.richplastow.com/ | ||
/*! Apage 0.0.22 //// MIT Licence //// http://apage.richplastow.com/ | ||
* plugin/pagination.litcoffee | ||
@@ -5,0 +5,0 @@ */ |
{ | ||
"name": "apage", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "homepage": "http://apage.richplastow.com/", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
60574
519