This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setCount(source, target, limit) | |
{ | |
var chars = source.val().length; | |
if (chars > limit) | |
{ | |
// Disable submit button | |
jQuery("input#submit").attr('disabled', 'disabled'); | |
source.css("background", "#fee"); | |
target.css("color", "red"); | |
if ((chars - limit) > 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This script replaces harder words with easier ones for faster reading. | |
jQuery('p,li,blockquote').each(function() { | |
var text = jQuery(this).html(); | |
jQuery(this).html( | |
text.replace(/\baccompanying\b/, 'going with') | |
.replace(/\baccompanied\b/, 'went with') | |
.replace(/\baccompanies\b/, 'goes with') | |
.replace(/\baccompany\b/, 'go with') | |
.replace(/\baccomplishing\b/, 'doing') | |
.replace(/\baccomplished\b/, 'did') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gallery = "div[class*='gallery']"; | |
var prev = jQuery("a[class*='prev'], img[class*='prev'], li[class*='prev'] a, div[class*='prev'] a, li[id*='prev'] a, a[id*='prev'], img[id*='prev'], div[id*='prev'] a"); | |
var next = jQuery("a[class*='next'], img[class*='next'], li[class*='next'] a, div[class*='next'] a, li[id*='next'] a, a[id*='next'], img[id*='next'], div[id*='next'] a"); | |
jQuery("body").keydown(function(e) | |
{ | |
if ( e.keyCode == 37 ) | |
{ | |
prev[prev.length - 1].click(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isToday(d) | |
{ | |
var date_param = new Date(d).toDateString(); | |
var date_today = new Date().toDateString(); | |
var is_today = (date_today == date_param); | |
return is_today; | |
} | |
// Example use: console.log(isToday("01/01/2014")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get URL parameters | |
* @return array of URL parameters | |
*/ | |
function getUrlParams() | |
{ | |
var params = [], hash; | |
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); | |
for(var i = 0; i < hashes.length; i++) | |
{ |
NewerOlder