diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 412eeda..0000000 --- a/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.fsproj merge=union -*.dbproj merge=union - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b9d6bd9..0000000 --- a/.gitignore +++ /dev/null @@ -1,215 +0,0 @@ -################# -## Eclipse -################# - -*.pydevproject -.project -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# PDT-specific -.buildpath - - -################# -## Visual Studio -################# - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results - -[Dd]ebug/ -[Rr]elease/ -x64/ -build/ -[Bb]in/ -[Oo]bj/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.log -*.scc - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -.*crunch*.local.xml - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.Publish.xml -*.pubxml - -# NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ - -# Windows Azure Build Output -csx -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.[Pp]ublish.xml -*.pfx -*.publishsettings - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -App_Data/*.mdf -App_Data/*.ldf - -############# -## Windows detritus -############# - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Mac crap -.DS_Store - - -############# -## Python -############# - -*.py[co] - -# Packages -*.egg -*.egg-info -dist/ -build/ -eggs/ -parts/ -var/ -sdist/ -develop-eggs/ -.installed.cfg - -# Installer logs -pip-log.txt - -# Unit test / coverage reports -.coverage -.tox - -#Translations -*.mo - -#Mr Developer -.mr.developer.cfg diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt deleted file mode 100644 index 6e7ddcf..0000000 --- a/MIT-LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2013 Noah Cooper -https://github.com/noahcooper - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 92d53ac..0000000 --- a/README.md +++ /dev/null @@ -1,154 +0,0 @@ -jQuery.thermometer -================== - -**Version: 1.0 (11-AUG-2013)** -**Requires: jQuery v1.6.4+** - -jQuery.thermometer is a jQuery plugin which can be used to create thermometers and progress meters. - -Basic Thermometer ------------------ - -At its simplest, the markup for a thermometer looks like this: - -``` html -
-``` - -The `data-percent` attribute indicates the thermometer's percent to goal, in this case 75%. While this attribute is not required, if it is not defined, the default is 0%. - -Of course, using the plugin on this element will prove much easier if it can be identified with some meaningful selector, like: - -``` html -
-``` - -With this className added, calling the plugin is a piece of cake: - -``` js -$('.thermometer').thermometer(); -``` - -Once `jQuery.thermometer()` has been called, a thermometer will be inserted into the element. (Note: The thermometer will completely replace the element's existing innerHTML.) - -``` html -
-
-
-
-
-``` - -Styling the thermometer is simple: - -``` css -.thermometer-outer { - background: #c4f0ff; - border: 1px solid #c4c4c4; - border-radius: 3px; - height: 20px; - width: 100%; -} -.thermometer-inner { - background: #3f83f7; - height: 20px; -} -``` - -As the thermometer is animated, the plugin will automatically adjust `.thermometer-inner` to set its width (for horizontal thermometers) or height (for vertical thermometers). For this reason, you should not set these properties within your CSS. - -Slow Animation --------------- - -The plugin animates thermometers using [jQuery.animate()](http://api.jquery.com/animate/). By default, the plugin will use an animation duration of 1 second. The `data-speed` attribute can be used to adjust this. Setting the speed to "slow" will result in a duration of 1.5 seconds instead. - -``` html -
-``` - -Fast Animation --------------- - -Setting the speed to "fast" will result in an animation duration of 200 milliseconds. - -``` html -
-``` - -Explicit Animation Speed ------------------------- - -Alternatively, the speed can be adjusted using an explicitly defined number of milliseconds. - -``` html -
-``` - -No Animation ------------- - -Animation can be completely disabled using the `data-animate` attribute. - -``` html -
-``` - -Vertical Thermometer --------------------- - -By default, thermometers will be displayed horizontally. The `data-orientation` attribute can be used to instead render a vertical thermometer. - -``` html -
-``` - -Horizontal and vertical thermometers use distinct classNames, "thermometer-outer-h" and "thermometer-inner-h" and "thermometer-outer-v" and "thermometer-inner-v" respectively. - -``` html -
-
-
-
-
-``` - -This allows for styles to be defined differently for each orientation. - -``` css -.thermometer-outer { - background: #c4f0ff; - border: 1px solid #c4c4c4; - border-radius: 3px; -} -.thermometer-outer-h { - height: 20px; - width: 100%; -} -.thermometer-outer-v { - height: 200px; - width: 20px; -} -.thermometer-inner { - background: #3f83f7; -} -.thermometer-inner-h { - height: 20px; -} -.thermometer-inner-v { - width: 20px; -} -``` - -Configuration Options ---------------------- - -When `jQuery.thermometer()` is called, it optionally accepts a configuration object which will override the default plugin settings. - -``` js -$('.thermometer').thermometer({ - percent: 75, - speed: 'slow' -}); -``` - -Even if a configuration object is provided, inline `data-` attributes will always take precedence. \ No newline at end of file diff --git a/index.html b/index.html index 82aeb1b..e8c2f98 100644 --- a/index.html +++ b/index.html @@ -1,158 +1,159 @@ - - - - - - jQuery Thermometer Demos - - - - -

jQuery Thermometer Demos

- - - -
-
-

Basic Thermometer

-
-

At its simplest, the markup for a thermometer looks like this:

-
<div data-percent="75"></div>
-

The data-percent attribute indicates the thermometer's percent to goal, in this case 75%. While this attribute is not required, if it is not defined, the default is 0%.

-

Of course, using the plugin on this element will prove much easier if it can be identified with some meaningful selector, like:

-
<div class="thermometer" data-percent="75"></div>
-

With this className added, calling the plugin is a piece of cake:

-
$('.thermometer').thermometer();
-

Once $.thermometer() has been called, a thermometer will be inserted into the element. (Note: The thermometer will completely replace the element's existing innerHTML.)

-
<div class="thermometer" data-percent="75">
  <div class="thermometer-outer">
    <div class="thermometer-inner"></div>
  </div>
</div>
-

Styling the thermometer is simple:

-
.thermometer-outer {
  background: #c4f0ff;
  border: 1px solid #c4c4c4;
  border-radius: 3px;
  height: 20px;
  width: 100%;
}
.thermometer-inner {
  background: #3f83f7;
  height: 20px;
}
-

As the thermometer is animated, the plugin will automatically adjust .thermometer-inner to set its width (for horizontal thermometers) or height (for vertical thermometers). For this reason, you should not set these properties within your CSS.

-
-
- -
-
-

Slow Animation

-
-

The plugin animates thermometers using jQuery.animate(). By default, the plugin will use an animation duration of 1 second. The data-speed attribute can be used to adjust this. Setting the speed to "slow" will result in a duration of 1.5 seconds instead.

-
<div class="thermometer" data-percent="75" data-speed="slow"></div>
-
- -
-

Fast Animation

-
-

Setting the speed to "fast" will result in an animation duration of 200 milliseconds.

-
<div class="thermometer" data-percent="75" data-speed="fast"></div>
-
- -
-

Explicit Animation Speed

-
-

Alternatively, the speed can be adjusted using an explicitly defined number of milliseconds.

-
<div class="thermometer" data-percent="75" data-speed="600"></div>
-
- -
-

No Animation

-
-

Animation can be completely disabled using the data-animate attribute.

-
<div class="thermometer" data-percent="75" data-animate="false"></div>
-
-
- -
-
-

Vertical Thermometer

-
-

By default, thermometers will be displayed horizontally. The data-orientation attribute can be used to instead render a vertical thermometer.

-
<div class="thermometer" data-percent="75" data-orientation="vertical"></div>
-

Horizontal and vertical thermometers use distinct classNames, "thermometer-outer-h" and "thermometer-inner-h" and "thermometer-outer-v" and "thermometer-inner-v" respectively.

-
<div class="thermometer" data-percent="75" data-orientation="vertical">
  <div class="thermometer-outer thermometer-outer-v">
    <div class="thermometer-inner thermometer-inner-v"></div>
  </div>
</div>
-

This allows for styles to be defined differently for each orientation.

-
.thermometer-outer {
  background: #c4f0ff;
  border: 1px solid #c4c4c4;
  border-radius: 3px;
}
.thermometer-outer-h {
  height: 20px;
  width: 100%;
}
.thermometer-outer-v {
  height: 200px;
  width: 20px;
}
.thermometer-inner {
  background: #3f83f7;
}
.thermometer-inner-h {
  height: 20px;
}
.thermometer-inner-v {
  width: 20px;
}
-
-
- -
-
-

Configuration Options

-
-

When $.thermometer() is called, it optionally accepts a configuration object which will override the default plugin settings.

-
$('.thermometer').thermometer({
  percent: 75,
  speed: 'slow'
});
-

Even if a configuration object is provided, inline data- attributes will always take precedence.

-
-
- - - - - + + + + + + + jQuery Thermometer Demos + + + + +

jQuery Thermometer Demos

+ + + +
+
+

Basic Thermometer

+
+

At its simplest, the markup for a thermometer looks like this:

+
<div data-percent="75"></div>
+

The data-percent attribute indicates the thermometer's percent to goal, in this case 75%. While this attribute is not required, if it is not defined, the default is 0%.

+

Of course, using the plugin on this element will prove much easier if it can be identified with some meaningful selector, like:

+
<div class="thermometer" data-percent="75"></div>
+

With this className added, calling the plugin is a piece of cake:

+
$('.thermometer').thermometer();
+

Once $.thermometer() has been called, a thermometer will be inserted into the element. (Note: The thermometer will completely replace the element's existing innerHTML.)

+
<div class="thermometer" data-percent="75">
  <div class="thermometer-outer">
    <div class="thermometer-inner"></div>
  </div>
</div>
+

Styling the thermometer is simple:

+
.thermometer-outer {
  background: #c4f0ff;
  border: 1px solid #c4c4c4;
  border-radius: 3px;
  height: 20px;
  width: 100%;
}
.thermometer-inner {
  background: #3f83f7;
  height: 20px;
}
+

As the thermometer is animated, the plugin will automatically adjust .thermometer-inner to set its width (for horizontal thermometers) or height (for vertical thermometers). For this reason, you should not set these properties within your CSS.

+
+
+ +
+
+

Slow Animation

+
+

The plugin animates thermometers using jQuery.animate(). By default, the plugin will use an animation duration of 1 second. The data-speed attribute can be used to adjust this. Setting the speed to "slow" will result in a duration of 1.5 seconds instead.

+
<div class="thermometer" data-percent="75" data-speed="slow"></div>
+
+ +
+

Fast Animation

+
+

Setting the speed to "fast" will result in an animation duration of 200 milliseconds.

+
<div class="thermometer" data-percent="75" data-speed="fast"></div>
+
+ +
+

Explicit Animation Speed

+
+

Alternatively, the speed can be adjusted using an explicitly defined number of milliseconds.

+
<div class="thermometer" data-percent="75" data-speed="600"></div>
+
+ +
+

No Animation

+
+

Animation can be completely disabled using the data-animate attribute.

+
<div class="thermometer" data-percent="75" data-animate="false"></div>
+
+
+ +
+
+

Vertical Thermometer

+
+

By default, thermometers will be displayed horizontally. The data-orientation attribute can be used to instead render a vertical thermometer.

+
<div class="thermometer" data-percent="75" data-orientation="vertical"></div>
+

Horizontal and vertical thermometers use distinct classNames, "thermometer-outer-h" and "thermometer-inner-h" and "thermometer-outer-v" and "thermometer-inner-v" respectively.

+
<div class="thermometer" data-percent="75" data-orientation="vertical">
  <div class="thermometer-outer thermometer-outer-v">
    <div class="thermometer-inner thermometer-inner-v"></div>
  </div>
</div>
+

This allows for styles to be defined differently for each orientation.

+
.thermometer-outer {
  background: #c4f0ff;
  border: 1px solid #c4c4c4;
  border-radius: 3px;
}
.thermometer-outer-h {
  height: 20px;
  width: 100%;
}
.thermometer-outer-v {
  height: 200px;
  width: 20px;
}
.thermometer-inner {
  background: #3f83f7;
}
.thermometer-inner-h {
  height: 20px;
}
.thermometer-inner-v {
  width: 20px;
}
+
+
+ +
+
+

Configuration Options

+
+

When $.thermometer() is called, it optionally accepts a configuration object which will override the default plugin settings.

+
$('.thermometer').thermometer({
  percent: 75,
  speed: 'slow'
});
+

Even if a configuration object is provided, inline data- attributes will always take precedence.

+
+
+ + + + + \ No newline at end of file diff --git a/src/jquery.thermometer.js b/src/jquery.thermometer.js deleted file mode 100644 index ba1f749..0000000 --- a/src/jquery.thermometer.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * jQuery.thermometer - https://github.com/noahcooper/jQuery.thermometer - * Version: 1.0 (11-AUG-2013) - * Requires: jQuery v1.6.4+ - * - * Released under the MIT license. - * https://github.com/noahcooper/jQuery.thermometer/blob/master/MIT-LICENSE.txt - */ - -(function($) { - $.fn.thermometer = function(options) { - var settings = $.extend({ - percent: 0, - orientation: 'horizontal', - animate: true, - speed: 1000 - }, options || {}); - - return this.each(function() { - var _percent = $(this).data('percent') || settings.percent, - _orientation = $(this).data('orientation') || settings.orientation, - _animate = $(this).data('animate') === false ? false : settings.animate, - _speed = $(this).data('speed') || settings.speed; - - /* set the orientation */ - _orientation = _orientation.toLowerCase() === 'vertical' ? 'v' : 'h'; - - /* set min and max percentage */ - if(isNaN(_percent) || _percent < 0) { - _percent = 0; - } - else if(_percent > 100) { - _percent = 100; - } - - /* override the default "slow" duration used by jQuery.animate() */ - if($.type(_speed) === 'string' && _speed.toLowerCase() === 'slow') { - _speed = 1500; - } - - $(this).html('
' + - '
' + - '
' + - '
'); - - var initialInnerSize = _animate ? 0 : (_percent + '%'); - if(_orientation === 'v') { - $(this).find('.thermometer-outer').css('position', 'relative'); - $(this).find('.thermometer-inner').css({ - position: 'absolute', - bottom: '0', - height: initialInnerSize - }); - } - else { - $(this).find('.thermometer-inner').css('width', initialInnerSize); - } - - if(_animate) { - var animateProperties = {}; - if(_orientation === 'v') { - animateProperties.height = _percent + '%'; - } - else { - animateProperties.width = _percent + '%'; - } - $(this).find('.thermometer-inner').animate(animateProperties, _speed); - } - }); - }; -})(jQuery); \ No newline at end of file diff --git a/thermometer.jquery.json b/thermometer.jquery.json deleted file mode 100644 index 7bd10e5..0000000 --- a/thermometer.jquery.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "thermometer", - "title": "jQuery Thermometer", - "description": "jQuery plugin for creating thermometers and progress meters.", - "keywords": [ - "thermometer" - ], - "version": "1.0.0", - "author": { - "name": "Noah Cooper", - "url": "https://github.com/noahcooper" - }, - "maintainers": [ - { - "name": "Noah Cooper", - "email": "noah.cooper@hotmail.com", - "url": "https://github.com/noahcooper" - } - ], - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/noahcooper/jQuery.thermometer/blob/master/MIT-LICENSE.txt" - } - ], - "bugs": "https://github.com/noahcooper/jQuery.thermometer/issues", - "homepage": "https://github.com/noahcooper/jQuery.thermometer", - "docs": "https://github.com/noahcooper/jQuery.thermometer", - "dependencies": { - "jquery": ">=1.6.4" - } -} \ No newline at end of file