Skip to content

Instantly share code, notes, and snippets.

View cloudxero's full-sized avatar

Jorge Chavez cloudxero

View GitHub Profile
@cloudxero
cloudxero / reorder-vrs-tabs.js
Created December 23, 2011 00:16
DealerTrend API - Reorder VRS tabs
jQuery(document).ready(function() {
if (jQuery('body.home').length) {
// Only put as many variables as there are tabs
var first_tab;
var second_tab;
var third_tab;
var fourth_tab;
jQuery('.vrs-widget-item-wrapper').tabs('destroy');
jQuery('.vrs-widget-item-wrapper ul li').each(function(index) {
var tab = jQuery(this);
@cloudxero
cloudxero / gist:1535985
Created December 29, 2011 20:11
Staff Listings - Body class home error correction
if (jQuery('#staff-listing').length){
jQuery('body').attr('class', jQuery('body').attr('class').replace('home','')); // removes home class from body
jQuery('#inner-wrap').attr('style','margin-top: 0px;'); // fix for background style
jQuery('#staff-listing').attr('style','background: none;'); // removes white background from staff listing
}
@cloudxero
cloudxero / gist:1981650
Created March 5, 2012 22:36
Dynamic loading of JS with mobile API.
(function () {
'use strict';
var head, script, siteid, domain, internal, mobilesite;
siteid = 20755;
domain = new RegExp('jimmcnatttoyota.com', 'i');
mobilesite = 'http://m.jimmcnatttoyota.com';
head = document.getElementsByTagName('head')[0];
@cloudxero
cloudxero / gist:2161222
Created March 22, 2012 18:05
DealerTrend API - Change phone number on vehicle detail page
if (jQuery('#dealertrend-inventory-api #armadillo-detail').length){
var new_phone_number = '(###) ###-####'
jQuery('.armadillo-contact-information p').each(function(){
if (jQuery(this).text().match(/phone/i) != null){
jQuery(this).children('strong').text(new_phone_number);
}
});
}
@cloudxero
cloudxero / gist:2306026
Created April 4, 2012 22:03
DealerTrend VMS Carousel Style
/* VMS STYLE START Carousel */
#inner .vms-widget.small, #inner .vms-widget.medium, #inner .vms-widget.large{
width: 950px;
height: 121px;
}
.vms-widget.small .widget-area, .vms-widget.medium .widget-area, .vms-widget.large .widget-area{
width: 950px;
height: 121px;
}
.vms-widget.small .widget-area .vms-widget-content, .vms-widget.medium .widget-area .vms-widget-content, .vms-widget.large .widget-area .vms-widget-content{
@cloudxero
cloudxero / gist:2362924
Created April 11, 2012 21:44
Mobile Detect
/**
* jQuery.browser.mobile (http://detectmobilebrowser.com/)
*
* jQuery.browser.mobile will be true if the browser is a mobile device
*
**/
(function(a){jQuery.browser.mobile=/android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go
@cloudxero
cloudxero / gist:2369301
Created April 12, 2012 17:21
IE7 Polyfill for JSON.parse
(function(a,b){typeof define=="function"&&define.amd?define("json",["exports"],b):b(typeof exports=="object"&&exports||this.JSON||(this.JSON={}))})(this,function(a){var b={}.toString,c={}.hasOwnProperty,d,e,f;return e=typeof a.stringify=="function",f=typeof a.parse=="function",function(){var c='{"result":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}',d,g,h;if(e){d=function(){return 1},d.toJSON=d;try{switch(!1){case a.stringify(0)==="0":case a.stringify(new 0..constructor)==="0":case a.stringify(new"".constructor)=='""':case a.stringify(b)===void 0:case a.stringify(void 0)===void 0:case a.stringify()===void 0:case a.stringify(d)==="1":case a.stringify([d])=="[1]":case a.stringify([void 0])=="[null]":case a.stringify(null)=="null":case a.stringify([void 0,b,null])=="[null,null,null]":case a.stringify({result:[d,true,false,null,"\0\b\n\f\r "]})==c:case a.stringify(null,d)==="1":case a.stringify([1,2],null,1)=="[\n 1,\n 2\n]":case(d=new Date(-864e13)).getUTCFullYear()!=-271821||a.stringify(d)=='"-271821-04-20T00:
@cloudxero
cloudxero / gist:2369313
Created April 12, 2012 17:22
IE8/IE7 forEach Compatibility
// Production steps of ECMA-262, Edition 5, 15.4.4.18
// Reference: http://es5.github.com/#x15.4.4.18
if ( !Array.prototype.forEach ) {
Array.prototype.forEach = function( callback, thisArg ) {
var T, k;
if ( this == null ) {
throw new TypeError( " this is null or not defined" );
@cloudxero
cloudxero / gist:2590322
Created May 3, 2012 23:14
Remove New/Used Quick Link on Vehicle List Page
/* Removes New quick link on VLP */
if (jQuery('#armadillo-listing').length){
jQuery('#armadillo-quick-links .armadillo-expanded li').each(function(){
if (jQuery(this).find('a').text().match(/new/i) != null){
jQuery(this).css({'display':'none'});
}
});
}
@cloudxero
cloudxero / gist:2661669
Created May 11, 2012 18:52
Move VDP Armadillo Columns
// Move VDP Armadillo Columns
if (jQuery('#dealertrend-inventory-api #armadillo-detail').length){
jQuery('#armadillo-detail').append(jQuery('.armadillo-column-middle'));
jQuery('#armadillo-detail').append(jQuery('.armadillo-column-left'));
jQuery('#armadillo-detail').append(jQuery('.armadillo-disclaimer'));
jQuery('.armadillo-column-left').attr('style','width:202px !important');
jQuery('.armadillo-column-right').css({'margin-right': '18px'});
}