Inkd « visit
This is my Source Code and I don't want to show it here
View Source Code only (as overlay)
// That code snippet belongs to Inkd - http://inkd.com
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
// default for search box
var DEFAULT_SEARCH_TEXT = 'Search for Design Templates';
// global page setup
$(function() {
// search default text
$('#layout_search_input').emptyVal(DEFAULT_SEARCH_TEXT);
// localize any dates
$('.utc_date').localizeDate();
var submenu_showing = null;
$('.layout_header_nav_main_item').each(function() {
$('a.menu_arrow', this).mouseover(function() {
$(this).siblings('div.layout_header_nav_sub_wrapper:hidden').slideDown('fast');
})
$(this).hover(function() {
},
function() {
$('div.layout_header_nav_sub_wrapper:visible', this)
.slideUp('fast');
})
});
// focus first form field
$(function() {
$('#layout_content INPUT[type="text"]:first').focus();
});
})
// validation - any failing validator sets formValid = false; validators has the invalid validator functions to rerun.
var validators = {};
var formValid;
// sets up the target (textbox or textarea) to show a string when no other value has been typed in
jQuery.fn.emptyVal = function(emptyVal) {
var target = this;
this.parents('form').submit(function() {
if (target.val() == emptyVal) {
target.val('');
}
})
if ((this.val() == '') || (this.val() == emptyVal)) {
this.val(emptyVal).addClass('empty');
}
return this
.focus(function(){
if (target.val() == emptyVal) {
target
.val('')
.removeClass('empty');
}
})
.blur(function() {
if (target.val() == '') {
target
.val(emptyVal)
.addClass('empty');
}
})
}
// change utc dates on page to local browser date
jQuery.fn.localizeDate = function() {
this.each(function() {
dateString = $(this);
var dt = Date.parse(dateString.text());
dateString.text(dt.toString('h:mmtt') + ' on ' + dt.format('%x'));
})
}
// "Remaining" support
function enforce_remaining(field, count) {
var input = $('#' + field);
var text = input.val();
if (text.length >= count) {
input.val(text.substr(0, count));
update_remaining(field, count);
return false;
}
update_remaining(field, count);
return true;
}
function update_remaining(field, count) {
var text = $('#' + field).val();
$('#' + field + '_remaining_count').text(count - text.length);
}
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}
Syndicate
Categories
Statistics
There are 330 Sites with 745 Links of Interest in 18 Categories. The latest Site was added 4 months ago.
About
This is a project by Sebastian Senf, for his part jQuery user and lover too. Follow me.