Skip to content

Commit b856c89

Browse files
committed
first comit
0 parents  commit b856c89

9 files changed

Lines changed: 400 additions & 0 deletions

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
#################
2+
## Eclipse
3+
#################
4+
5+
*.pydevproject
6+
.project
7+
.metadata
8+
bin/
9+
tmp/
10+
*.tmp
11+
*.bak
12+
*.swp
13+
*~.nib
14+
local.properties
15+
.classpath
16+
.settings/
17+
.loadpath
18+
19+
# External tool builders
20+
.externalToolBuilders/
21+
22+
# Locally stored "Eclipse launch configurations"
23+
*.launch
24+
25+
# CDT-specific
26+
.cproject
27+
28+
# PDT-specific
29+
.buildpath
30+
31+
32+
#################
33+
## Visual Studio
34+
#################
35+
36+
## Ignore Visual Studio temporary files, build results, and
37+
## files generated by popular Visual Studio add-ons.
38+
39+
# User-specific files
40+
*.suo
41+
*.user
42+
*.sln.docstates
43+
44+
# Build results
45+
[Dd]ebug/
46+
[Rr]elease/
47+
*_i.c
48+
*_p.c
49+
*.ilk
50+
*.meta
51+
*.obj
52+
*.pch
53+
*.pdb
54+
*.pgc
55+
*.pgd
56+
*.rsp
57+
*.sbr
58+
*.tlb
59+
*.tli
60+
*.tlh
61+
*.tmp
62+
*.vspscc
63+
.builds
64+
*.dotCover
65+
66+
## TODO: If you have NuGet Package Restore enabled, uncomment this
67+
#packages/
68+
69+
# Visual C++ cache files
70+
ipch/
71+
*.aps
72+
*.ncb
73+
*.opensdf
74+
*.sdf
75+
76+
# Visual Studio profiler
77+
*.psess
78+
*.vsp
79+
80+
# ReSharper is a .NET coding add-in
81+
_ReSharper*
82+
83+
# Installshield output folder
84+
[Ee]xpress
85+
86+
# DocProject is a documentation generator add-in
87+
DocProject/buildhelp/
88+
DocProject/Help/*.HxT
89+
DocProject/Help/*.HxC
90+
DocProject/Help/*.hhc
91+
DocProject/Help/*.hhk
92+
DocProject/Help/*.hhp
93+
DocProject/Help/Html2
94+
DocProject/Help/html
95+
96+
# Click-Once directory
97+
publish
98+
99+
# Others
100+
[Bb]in
101+
[Oo]bj
102+
sql
103+
TestResults
104+
*.Cache
105+
ClientBin
106+
stylecop.*
107+
~$*
108+
*.dbmdl
109+
Generated_Code #added for RIA/Silverlight projects
110+
111+
# Backup & report files from converting an old project file to a newer
112+
# Visual Studio version. Backup files are not needed, because we have git ;-)
113+
_UpgradeReport_Files/
114+
Backup*/
115+
UpgradeLog*.XML
116+
117+
118+
119+
############
120+
## Windows
121+
############
122+
123+
# Windows image file caches
124+
Thumbs.db
125+
126+
# Folder config file
127+
Desktop.ini
128+
129+
130+
#############
131+
## Python
132+
#############
133+
134+
*.py[co]
135+
136+
# Packages
137+
*.egg
138+
*.egg-info
139+
dist
140+
build
141+
eggs
142+
parts
143+
bin
144+
var
145+
sdist
146+
develop-eggs
147+
.installed.cfg
148+
149+
# Installer logs
150+
pip-log.txt
151+
152+
# Unit test / coverage reports
153+
.coverage
154+
.tox
155+
156+
#Translations
157+
*.mo
158+
159+
#Mr Developer
160+
.mr.developer.cfg
161+
162+
# Mac crap
163+
.DS_Store

LICENSE.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2010-2012 Thorsten Schüller <thorsten@schueller.me>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
jQuery inputFileWidth plugin
2+
============================
3+
4+
Description
5+
-----------
6+
The jQuery.inputFileWidth plugin sets the width of an input file element
7+
(<input type="file"/>). Normally this can done with CSS, but the Firefox
8+
browser don't support this. This plugin used a workaround to set the width
9+
also in Firefox. It used the size attribute from the input element to change
10+
the width. The calculated size is unfortunately only a approximation to the
11+
real size, so there can be a deviation of some pixels to the desired size.
12+
13+
Usage
14+
-----
15+
16+
Set all file input elements to a 100% width:
17+
18+
$("input:file").inputFileWidth("100%");

build.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE project>
3+
<project name="jquery.inputFileWidth" default="all">
4+
5+
<property name="libDir" value="./libs" />
6+
<property name="distDir" value="./dist"/>
7+
8+
<target name="all" depends="inputFileWidth" description="Scrambling all plugin sources">
9+
</target>
10+
11+
12+
<target name="inputFileWidth" description="Scrambling and build inputFileWidth">
13+
<property file="./VERSION.txt" />
14+
<echo message="Scrambling inputFileWidth source" />
15+
<java jar="${libDir}/yuicompressor-2.4.2.jar"
16+
output="./jquery.inputFileWidth-min.js"
17+
logerror="true"
18+
fork="true">
19+
<arg value="-v" />
20+
<arg value="--charset=UTF-8" />
21+
<arg value="--line-break=80" />
22+
<arg value="./jquery.inputFileWidth.js" />
23+
</java>
24+
</target>
25+
26+
</project>

demo/index.html

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<title>jquery.inputFileWidth Demo</title>
4+
5+
<style type="text/css">
6+
7+
.container
8+
{
9+
width: 50%;
10+
border: 1px dashed #ccc;
11+
position: relative;
12+
margin: 10px;
13+
}
14+
15+
input[type="file"]
16+
{
17+
width: 100%;
18+
}
19+
20+
</style>
21+
22+
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
23+
<script type="text/javascript" src="../jquery.inputFileWidth.js"></script>
24+
<script type="text/javascript">
25+
26+
$(document).ready(function()
27+
{
28+
$("#c1 input").inputFileWidth("100%");
29+
$("#c2 input").inputFileWidth("50%");
30+
$("#c3 input").inputFileWidth("200px");
31+
});
32+
33+
</script>
34+
35+
</head>
36+
<body>
37+
38+
<h1>jquery.inputFileWidth Demo</h1>
39+
40+
<form action="#">
41+
42+
<input type="hidden" id="hiddentest" />
43+
44+
<div class="container" id="c0">
45+
without inputFileWidth<br/>
46+
<input type="file" class="fileselect" />
47+
</div>
48+
49+
<div class="container" id="c1">
50+
inputFileWidth("100%")<br/>
51+
<input type="file" class="fileselect" />
52+
</div>
53+
54+
<div class="container" id="c2">
55+
inputFileWidth("50%")<br/>
56+
<input type="file" class="fileselect" />
57+
</div>
58+
59+
<div class="container" id="c3">
60+
inputFileWidth("200px")<br/>
61+
<input type="file" class="fileselect" />
62+
</div>
63+
64+
</form>
65+
66+
<hr/>
67+
68+
<button onclick="$("input").inputFileWidth('100%');">Set all input's to 100%</button>
69+
<button onclick="$("input").inputFileWidth('50%');">Set all input's to 50%</button>
70+
<button onclick="$("input").inputFileWidth('200px');">Set all input's to 200px</button>
71+
72+
</body>
73+
</html>

jquery.inputFileWidth-min.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* jQuery inputFileWidth Plugin v1.0.2
3+
* Sets the width of an input file element.
4+
* Copyright (c) 2010-2012, Thorsten Schüller
5+
* http://schueller.me/projects/
6+
* Licensed under the MIT license.
7+
*/
8+
(function(a){a.fn.inputFileWidth=function(b){if(!b){b="100%"
9+
}return this.filter("input:file").each(function(){var h=a(this),d,e,g=0,f,c,j="jquery-inputFileWidthContainer";
10+
if(a.browser.mozilla){if(h.parent("."+j).length){h.unwrap()}h.css("visibility","hidden").width("100%");
11+
h.attr("size",1);h.wrap('<div class="'+j+'" />');d=h.parent().css("overflow","hidden").width(b);
12+
e=d.prop("scrollWidth");for(f=1,c=500;f<c;f++){h.attr("size",f);g=d.prop("scrollWidth");
13+
if(g>e){h.attr("size",f>1?f-1:1);break}}h.css("visibility","visible")}else{h.width(b)
14+
}})}})(jQuery);

0 commit comments

Comments
 (0)