Comparing version 0.0.4 to 0.0.5
57
demo.js
@@ -1,8 +0,53 @@ | ||
function rangeText(start, end) { | ||
var str = ''; | ||
str += start ? start.format('Do MMMM YYYY') + ' to ' : ''; | ||
str += end ? end.format('Do MMMM YYYY') : '...'; | ||
var rangeText = function (start, end) { | ||
var str = ''; | ||
str += start ? start.format('Do MMMM YYYY') + ' to ' : ''; | ||
str += end ? end.format('Do MMMM YYYY') : '...'; | ||
return str; | ||
} | ||
return str; | ||
}, | ||
css = function(url){ | ||
var head = document.getElementsByTagName('head')[0]; | ||
var link = document.createElement('link'); | ||
link.rel = 'stylesheet'; | ||
link.type = 'text/css'; | ||
link.href = url; | ||
head.appendChild(link); | ||
}, | ||
script = function (url) { | ||
var s = document.createElement('script'); | ||
s.type = 'text/javascript'; | ||
s.async = true; | ||
s.src = url; | ||
var head = document.getElementsByTagName('head')[0]; | ||
head.appendChild(s); | ||
} | ||
callbackJson = function(json){ | ||
var id = json.files[0].replace(/\D/g,''); | ||
document.getElementById('gist-' + id).innerHTML = json.div; | ||
if (!document.querySelector('link[href="' + json.stylesheet + '"]')) { | ||
css(json.stylesheet); | ||
} | ||
}; | ||
window.onload = function () { | ||
var gists = [ | ||
'https://gist.github.com/wakirin/c0100ee7e886fe74b3256ddb74f16adf.json?callback=callbackJson', | ||
'https://gist.github.com/wakirin/d4f00465b259590233f0727f01eaba66.json?callback=callbackJson', | ||
'https://gist.github.com/wakirin/c4e84bf9c5546a9656337236491a75f6.json?callback=callbackJson', | ||
'https://gist.github.com/wakirin/cdc9423464346f2de381cb3df0c78860.json?callback=callbackJson', | ||
'https://gist.github.com/wakirin/917c0e596078c1fcf51bff945004a4f2.json?callback=callbackJson', | ||
'https://gist.github.com/wakirin/4b9917aa9bda42f25124875c91385c7f.json?callback=callbackJson', | ||
'https://gist.github.com/wakirin/8782b1f9e3580a26fb70cdc78c4ed6d3.json?callback=callbackJson', | ||
'https://gist.github.com/wakirin/a76eaf1f7860aa0add9ba384bec8e0aa.json?callback=callbackJson', | ||
'https://gist.github.com/wakirin/b526e49275dc02c4ab3f3b72c3f0f3af.json?callback=callbackJson', | ||
'https://gist.github.com/wakirin/8fdf443726f097326d927e0e85dbc5dd.json?callback=callbackJson', | ||
]; | ||
gists.forEach(function(entry, key){ | ||
script(entry); | ||
}); | ||
}; | ||
// demo-1 | ||
@@ -9,0 +54,0 @@ new lightPick({ |
@@ -317,3 +317,3 @@ /** | ||
self.el.className = 'lightpick-container rows-' + opts.numberOfColumns; | ||
self.el.className = 'lightpick-container is-hidden rows-' + opts.numberOfColumns; | ||
@@ -546,3 +546,3 @@ self.el.innerHTML = '<div class="lightpick-inner">' | ||
this.hide(); | ||
self.hide(); | ||
@@ -549,0 +549,0 @@ opts.field.addEventListener('change', self._onInputChange); |
{ | ||
"name": "lightpick", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Javascript date range picker - lightweight, no jQuery", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
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
69025
955