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 throttle(delay, callback) { | |
var previousTime = new Date().getTime(); | |
return function() { | |
var newTime = new Date().getTime(); | |
if ((newTime - previousTime) > delay) { | |
previousTime = newTime; | |
callback.apply(null, arguments); | |
} | |
}; | |
} |
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 parseURL(url) { | |
var a = document.createElement('a'); | |
a.href = url; | |
return { | |
source: url, | |
protocol: a.protocol.replace(':',''), | |
host: a.hostname, | |
port: a.port, | |
query: a.search, | |
params: (function(){ |
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 UpdateQueryString(key, value, url) { | |
if (!url) url = window.location.href; | |
var re = new RegExp("([?&])" + key + "=.*?(&|#|$)(.*)", "gi"); | |
if (re.test(url)) { | |
if (typeof value !== 'undefined' && value !== null) | |
return url.replace(re, '$1' + key + "=" + value + '$2$3'); | |
else { | |
var hash = url.split('#'); | |
url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, ''); |
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 addUtmParams(source, medium, campaign) { | |
$("a").each(function () { | |
var $this = $(this); | |
var linkHref = $this.attr("href"); | |
if (linkHref.indexOf(window.location.hostname) < 0) { | |
var updateLink = updateQueryString({ | |
utm_source: source, | |
utm_medium: medium, | |
utm_campaign: campaign | |
}, linkHref); |
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
window.onbeforeunload = function (e) { | |
e = e || window.event; | |
// For IE and Firefox prior to version 4 | |
if (e) { | |
e.returnValue = 'Sure?'; | |
} | |
// For Safari | |
return 'Sure?'; |
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
MyApp.run(function($rootScope, $location, $routeParams, $window){ | |
$rootScope.$on('$routeChangeSuccess', function() { | |
var output=$location.path()+"?"; | |
angular.forEach($routeParams,function(value,key){ | |
output+=key+"="+value+"&"; | |
}) | |
output=output.substr(0,output.length-1); | |
$window._gaq.push(['_trackPageView', output]); | |
}); | |
}) |
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
<FilesMatch "^(wp-config\.php|wp-cache-config\.php|advanced-cache\.php|php\.ini|php5\.ini|config\.php|db\.php|db-config\.ini)"> | |
Order Deny,Allow | |
Deny from all | |
</FilesMatch> | |
### If you have one or more dedicated IP addresses, uncomment the below | |
### from <FilesMatch to </FilesMatch then replace the IP addresess with | |
### your own; and completely remove any IP address line not necessary. | |
### | |
### For example, if you only have one dedicated IP address, there |
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
@media (min-width: 768px) { | |
.seven-cols .col-md-1, | |
.seven-cols .col-sm-1, | |
.seven-cols .col-lg-1 { | |
width: 100%; | |
} | |
} | |
@media (min-width: 992px) { | |
.seven-cols .col-md-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
// CUSTOM ADMIN MENU LINK FOR ALL SETTINGS | |
function all_settings_link() { | |
add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php'); | |
} | |
add_action('admin_menu', 'all_settings_link'); | |
add_filter( 'login_headerurl', 'namespace_login_headerurl' ); | |
/** | |
* Replaces the login header logo URL | |
* |
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
console.log("SHOPS: {% if shop.customer_accounts_enabled %}"); |