MCPcopy
hub / github.com/writefreely/writefreely / getPageNum

Function getPageNum

static/js/posts.js:248–263  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

246 } catch (e) {}
247};
248var getPageNum = function(url) {
249 var hash;
250 if (url) {
251 hash = url.substr(url.indexOf('#')+1);
252 } else {
253 hash = window.location.hash.substr(1);
254 }
255
256 var page = hash || 1;
257 page = parseInt(page);
258 if (isNaN(page)) {
259 page = 1;
260 }
261
262 return page;
263};
264
265var postsPerPage = 10;
266var pages = 0;

Callers 1

posts.jsFile · 0.85

Calls 1

parseIntFunction · 0.85

Tested by

no test coverage detected