Skip to content

Commit 95839f8

Browse files
author
SamWM
committed
Added missing plugin. README listing plugins available
1 parent 3114c26 commit 95839f8

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed

README

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Plugins for jQuery:
2+
3+
checkbox manipulation - working with checkboxes
4+
fix Q tags - wrap q tags with proper quotes in Internet Explorer
5+
focus fields - add an outline and background to text inputs when they are given focus
6+
jQIR - replace text with images
7+
newsticker - a news ticker for sequentially showing each item in a list
8+
numeric - allow only numbers to be typed into a text box
9+
preload images - preload any images that you may use in the future (e.g. for image rollovers)
10+
select box manipulation - add/remove options in select boxes as well as sort them
11+
time picker - display a list of times when you click on an input

fixq/jquery.fixq.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function fixQTags()
2+
{
3+
if($.browser.msie)
4+
{
5+
$("q").prepend("“").append("”");
6+
}
7+
}
8+
// execute fixQTags when page is ready
9+
$(fixQTags);

jQIR/jquery.jqir.js

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
*
3+
* Copyright (c) 2006/2007 Sam Collett (http://www.texotela.co.uk)
4+
* Licensed under the MIT License:
5+
* http://www.opensource.org/licenses/mit-license.php
6+
*
7+
*/
8+
9+
10+
/*
11+
* jQuery Image Replacement. An alternative to using CSS hacks
12+
* The id attribute (or class) is used for the filename
13+
*
14+
* @name jQIR
15+
* @param String format Image format/file extension (e.g. png, gif, jpg) - ignored if specifying the filename in the class
16+
* @param String path (optional) Path to images folder
17+
* @param Function onload (optional) Function to run when image has loaded
18+
* @author Sam Collett (http://www.texotela.co.uk)
19+
* @example $(".jqir").jQIR("png", "images/");
20+
* @before <h1 id="heading1" class="jqir">Heading 1</h1>
21+
* <h2 class="jqir {src:heading2.png}">Heading 2</h2>
22+
* @result <h1 id="heading1" class="jqir"><img alt="Heading 1" src="images/heading1.png"></h1>
23+
* <h2 class="jqir {src:heading2.png}"><img alt="Heading 2" src="images/heading2.png"></h2>
24+
* @example $(".jqir").jQIR("gif"); // use same folder as page
25+
* @before <h1 id="heading1" class="jqir">Heading 1</h1>
26+
* @result <h1 id="heading1" class="jqir"><img alt="Heading 1" src="heading1.gif"></h1>
27+
*
28+
*/
29+
jQuery.fn.jQIR = function(format, path, onload)
30+
{
31+
if(!document.images) return this;
32+
path = path || "";
33+
this.each(
34+
function()
35+
{
36+
var img = $("<img>"), el = jQuery(this);
37+
var file;
38+
var re = /(?:{src\:)(\S+)(?:})/i;
39+
var m = this.className.match(re);
40+
if(m)
41+
{
42+
file = path + m[1];
43+
}
44+
else
45+
{
46+
file = path + this.id + "." + format;
47+
}
48+
49+
jQuery(img).attr(
50+
{
51+
src: file,
52+
alt: el.text()
53+
}).load(typeof onload == "function" ? onload : function(){} );
54+
var a = el.find("a");
55+
var toAppend = a.length ? a.empty().append(img) : img;
56+
el.empty().append(toAppend);
57+
}
58+
)
59+
return this;
60+
}

preload/jquery.preload.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
jQuery.preloadImages = function()
2+
{
3+
for(var i = 0; i<arguments.length; i++)
4+
{
5+
jQuery("<img>").attr("src", arguments[i]);
6+
}
7+
}

0 commit comments

Comments
 (0)