Remove some unneeded libraries
@ -1,161 +0,0 @@
|
||||
.colorpicker {
|
||||
width: 356px;
|
||||
height: 176px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
background: url(../images/colorpicker_background.png);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
display: none;
|
||||
}
|
||||
.colorpicker_color {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
left: 14px;
|
||||
top: 13px;
|
||||
position: absolute;
|
||||
background: #f00;
|
||||
overflow: hidden;
|
||||
cursor: crosshair;
|
||||
}
|
||||
.colorpicker_color div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
background: url(../images/colorpicker_overlay.png);
|
||||
}
|
||||
.colorpicker_color div div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
overflow: hidden;
|
||||
background: url(../images/colorpicker_select.gif);
|
||||
margin: -5px 0 0 -5px;
|
||||
}
|
||||
.colorpicker_hue {
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
left: 171px;
|
||||
width: 35px;
|
||||
height: 150px;
|
||||
cursor: n-resize;
|
||||
}
|
||||
.colorpicker_hue div {
|
||||
position: absolute;
|
||||
width: 35px;
|
||||
height: 9px;
|
||||
overflow: hidden;
|
||||
background: url(../images/colorpicker_indic.gif) left top;
|
||||
margin: -4px 0 0 0;
|
||||
left: 0px;
|
||||
}
|
||||
.colorpicker_new_color {
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
left: 213px;
|
||||
top: 13px;
|
||||
background: #f00;
|
||||
}
|
||||
.colorpicker_current_color {
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
left: 283px;
|
||||
top: 13px;
|
||||
background: #f00;
|
||||
}
|
||||
.colorpicker input {
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
position: absolute;
|
||||
font-size: 10px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: #898989;
|
||||
top: 4px;
|
||||
right: 11px;
|
||||
text-align: right;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 11px;
|
||||
}
|
||||
.colorpicker_hex {
|
||||
position: absolute;
|
||||
width: 72px;
|
||||
height: 22px;
|
||||
background: url(../images/colorpicker_hex.png) top;
|
||||
left: 212px;
|
||||
top: 142px;
|
||||
}
|
||||
.colorpicker_hex input {
|
||||
right: 6px;
|
||||
}
|
||||
.colorpicker_field {
|
||||
height: 22px;
|
||||
width: 62px;
|
||||
background-position: top;
|
||||
position: absolute;
|
||||
}
|
||||
.colorpicker_field span {
|
||||
position: absolute;
|
||||
width: 12px;
|
||||
height: 22px;
|
||||
overflow: hidden;
|
||||
top: 0;
|
||||
right: 0;
|
||||
cursor: n-resize;
|
||||
}
|
||||
.colorpicker_rgb_r {
|
||||
background-image: url(../images/colorpicker_rgb_r.png);
|
||||
top: 52px;
|
||||
left: 212px;
|
||||
}
|
||||
.colorpicker_rgb_g {
|
||||
background-image: url(../images/colorpicker_rgb_g.png);
|
||||
top: 82px;
|
||||
left: 212px;
|
||||
}
|
||||
.colorpicker_rgb_b {
|
||||
background-image: url(../images/colorpicker_rgb_b.png);
|
||||
top: 112px;
|
||||
left: 212px;
|
||||
}
|
||||
.colorpicker_hsb_h {
|
||||
background-image: url(../images/colorpicker_hsb_h.png);
|
||||
top: 52px;
|
||||
left: 282px;
|
||||
}
|
||||
.colorpicker_hsb_s {
|
||||
background-image: url(../images/colorpicker_hsb_s.png);
|
||||
top: 82px;
|
||||
left: 282px;
|
||||
}
|
||||
.colorpicker_hsb_b {
|
||||
background-image: url(../images/colorpicker_hsb_b.png);
|
||||
top: 112px;
|
||||
left: 282px;
|
||||
}
|
||||
.colorpicker_submit {
|
||||
position: absolute;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
background: url(../images/colorpicker_submit.png) top;
|
||||
left: 322px;
|
||||
top: 142px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.colorpicker_focus {
|
||||
background-position: center;
|
||||
}
|
||||
.colorpicker_hex.colorpicker_focus {
|
||||
background-position: bottom;
|
||||
}
|
||||
.colorpicker_submit.colorpicker_focus {
|
||||
background-position: bottom;
|
||||
}
|
||||
.colorpicker_slider {
|
||||
background-position: bottom;
|
||||
}
|
@ -1,218 +0,0 @@
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
table {
|
||||
border-collapse:collapse;
|
||||
border-spacing:0;
|
||||
}
|
||||
fieldset,img {
|
||||
border:0;
|
||||
}
|
||||
address,caption,cite,code,dfn,em,strong,th,var {
|
||||
font-style:normal;
|
||||
font-weight:normal;
|
||||
}
|
||||
ol,ul {
|
||||
list-style:none;
|
||||
}
|
||||
caption,th {
|
||||
text-align:left;
|
||||
}
|
||||
h1,h2,h3,h4,h5,h6 {
|
||||
font-size:100%;
|
||||
font-weight:normal;
|
||||
}
|
||||
q:before,q:after {
|
||||
content:'';
|
||||
}
|
||||
abbr,acronym { border:0;
|
||||
}
|
||||
html, body {
|
||||
background-color: #fff;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: #52697E;
|
||||
}
|
||||
body {
|
||||
text-align: center;
|
||||
overflow: auto;
|
||||
}
|
||||
.wrapper {
|
||||
width: 700px;
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
}
|
||||
h1 {
|
||||
font-size: 21px;
|
||||
height: 47px;
|
||||
line-height: 47px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.navigationTabs {
|
||||
height: 23px;
|
||||
line-height: 23px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.navigationTabs li {
|
||||
float: left;
|
||||
height: 23px;
|
||||
line-height: 23px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
.navigationTabs li a{
|
||||
float: left;
|
||||
dispaly: block;
|
||||
height: 23px;
|
||||
line-height: 23px;
|
||||
padding: 0 10px;
|
||||
overflow: hidden;
|
||||
color: #52697E;
|
||||
background-color: #eee;
|
||||
position: relative;
|
||||
text-decoration: none;
|
||||
}
|
||||
.navigationTabs li a:hover {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
.navigationTabs li a.active {
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
border-bottom: 0px solid;
|
||||
}
|
||||
.tabsContent {
|
||||
border: 1px solid #ccc;
|
||||
border-top: 0px solid;
|
||||
width: 698px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tab {
|
||||
padding: 16px;
|
||||
display: none;
|
||||
}
|
||||
.tab h2 {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
.tab h3 {
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.tab p {
|
||||
margin-top: 16px;
|
||||
clear: both;
|
||||
}
|
||||
.tab ul {
|
||||
margin-top: 16px;
|
||||
list-style: disc;
|
||||
}
|
||||
.tab li {
|
||||
margin: 10px 0 0 35px;
|
||||
}
|
||||
.tab a {
|
||||
color: #8FB0CF;
|
||||
}
|
||||
.tab strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
.tab pre {
|
||||
font-size: 11px;
|
||||
margin-top: 20px;
|
||||
width: 668px;
|
||||
overflow: auto;
|
||||
clear: both;
|
||||
}
|
||||
.tab table {
|
||||
width: 100%;
|
||||
}
|
||||
.tab table td {
|
||||
padding: 6px 10px 6px 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
.tab dt {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
#colorSelector {
|
||||
position: relative;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
background: url(../images/select.png);
|
||||
}
|
||||
#colorSelector div {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 3px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: url(../images/select.png) center;
|
||||
}
|
||||
#colorSelector2 {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
background: url(../images/select2.png);
|
||||
}
|
||||
#colorSelector2 div {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 4px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
background: url(../images/select2.png) center;
|
||||
}
|
||||
#colorpickerHolder2 {
|
||||
top: 32px;
|
||||
left: 0;
|
||||
width: 356px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker {
|
||||
background-image: url(../images/custom_background.png);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker_hue div {
|
||||
background-image: url(../images/custom_indic.gif);
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker_hex {
|
||||
background-image: url(../images/custom_hex.png);
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker_rgb_r {
|
||||
background-image: url(../images/custom_rgb_r.png);
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker_rgb_g {
|
||||
background-image: url(../images/custom_rgb_g.png);
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker_rgb_b {
|
||||
background-image: url(../images/custom_rgb_b.png);
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker_hsb_s {
|
||||
background-image: url(../images/custom_hsb_s.png);
|
||||
display: none;
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker_hsb_h {
|
||||
background-image: url(../images/custom_hsb_h.png);
|
||||
display: none;
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker_hsb_b {
|
||||
background-image: url(../images/custom_hsb_b.png);
|
||||
display: none;
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker_submit {
|
||||
background-image: url(../images/custom_submit.png);
|
||||
}
|
||||
#colorpickerHolder2 .colorpicker input {
|
||||
color: #778398;
|
||||
}
|
||||
#customWidget {
|
||||
position: relative;
|
||||
height: 36px;
|
||||
}
|
Before Width: | Height: | Size: 49 B |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 532 B |
Before Width: | Height: | Size: 970 B |
Before Width: | Height: | Size: 1012 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 86 B |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 970 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 78 B |
Before Width: | Height: | Size: 984 B |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 562 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 970 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 86 B |
Before Width: | Height: | Size: 1008 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1018 B |
Before Width: | Height: | Size: 997 B |
Before Width: | Height: | Size: 506 B |
Before Width: | Height: | Size: 518 B |
Before Width: | Height: | Size: 315 B |
@ -1,184 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="css/colorpicker.css" type="text/css" />
|
||||
<link rel="stylesheet" media="screen" type="text/css" href="css/layout.css" />
|
||||
<title>ColorPicker - jQuery plugin</title>
|
||||
<script type="text/javascript" src="js/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/colorpicker.js"></script>
|
||||
<script type="text/javascript" src="js/eye.js"></script>
|
||||
<script type="text/javascript" src="js/utils.js"></script>
|
||||
<script type="text/javascript" src="js/layout.js?ver=1.0.2"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<h1>Color Picker - jQuery plugin</h1>
|
||||
<ul class="navigationTabs">
|
||||
<li><a href="#about" rel="about">About</a></li>
|
||||
<li><a href="#download" rel="download">Download</a></li>
|
||||
<li><a href="#implement" rel="implement">Implement</a></li>
|
||||
</ul>
|
||||
<div class="tabsContent">
|
||||
<div class="tab">
|
||||
<h2>About</h2>
|
||||
<p>A simple component to select color in the same way you select color in Adobe Photoshop</p>
|
||||
<h3>Last update</h3>
|
||||
<p>23.05.2009 - Check Download tab</p>
|
||||
<h3>Features</h3>
|
||||
<ul>
|
||||
<li>Flat mode - as element in page</li>
|
||||
<li>Powerful controls for color selection</li>
|
||||
<li>Easy to customize the look by changing some images</li>
|
||||
<li>Fits into the viewport</li>
|
||||
</ul>
|
||||
<h3>License</h3>
|
||||
<p>Dual licensed under the MIT and GPL licenses.</p>
|
||||
<h3>Examples</h3>
|
||||
<p>Flat mode.</p>
|
||||
<p id="colorpickerHolder">
|
||||
</p>
|
||||
<pre>
|
||||
$('#colorpickerHolder').ColorPicker({flat: true});
|
||||
</pre>
|
||||
<p>Custom skin and using flat mode to display the color picker in a custom widget.</p>
|
||||
<div id="customWidget">
|
||||
<div id="colorSelector2"><div style="background-color: #00ff00"></div></div>
|
||||
<div id="colorpickerHolder2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Attached to an text field and using callback functions to update the color with field's value and set the value back in the field by submiting the color.</p>
|
||||
<p><input type="text" maxlength="6" size="6" id="colorpickerField1" value="00ff00" /></p>
|
||||
<p><input type="text" maxlength="6" size="6" id="colorpickerField3" value="0000ff" /></p>
|
||||
<p><input type="text" maxlength="6" size="6" id="colorpickerField2" value="ff0000" /></p>
|
||||
<pre>$('#colorpickerField1, #colorpickerField2, #colorpickerField3').ColorPicker({
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
$(el).val(hex);
|
||||
$(el).ColorPickerHide();
|
||||
},
|
||||
onBeforeShow: function () {
|
||||
$(this).ColorPickerSetColor(this.value);
|
||||
}
|
||||
})
|
||||
.bind('keyup', function(){
|
||||
$(this).ColorPickerSetColor(this.value);
|
||||
});
|
||||
</pre>
|
||||
<p>Attached to DOMElement and using callbacks to live preview the color and adding animation.</p>
|
||||
<p>
|
||||
<div id="colorSelector"><div style="background-color: #0000ff"></div></div>
|
||||
</p>
|
||||
<pre>
|
||||
$('#colorSelector').ColorPicker({
|
||||
color: '#0000ff',
|
||||
onShow: function (colpkr) {
|
||||
$(colpkr).fadeIn(500);
|
||||
return false;
|
||||
},
|
||||
onHide: function (colpkr) {
|
||||
$(colpkr).fadeOut(500);
|
||||
return false;
|
||||
},
|
||||
onChange: function (hsb, hex, rgb) {
|
||||
$('#colorSelector div').css('backgroundColor', '#' + hex);
|
||||
}
|
||||
});
|
||||
</pre>
|
||||
</div>
|
||||
<div class="tab">
|
||||
<h2>Download</h2>
|
||||
<p><a href="colorpicker.zip">colorpicker.zip (73 kb)</a>: jQuery, Javscript files, CSS files, images, examples and instructions.</p>
|
||||
<h3>Changelog</h3>
|
||||
<dl>
|
||||
<dt>23.05.2009</dt>
|
||||
<dd>Added: close on color selection example</dd>
|
||||
<dd>Added: restore original color option</dd>
|
||||
<dd>Changed: color update on key up event</dd>
|
||||
<dd>Fixed: colorpicker hide and show methods</dd>
|
||||
<dd>Fixed: reference to options. Multiple fields with colorpickers is possible now.</dd>
|
||||
<dd>Fixed: RGB to HSB convertion</dd>
|
||||
<dt>22.08.2008</dt>
|
||||
<dd>Fixed bug: where some events were not canceled right on Safari</dd>
|
||||
<dd>Fixed bug: where teh view port was not detected right on Safari</dd>
|
||||
<dt>16-07-2008</dt>
|
||||
<dd>Fixed bug where the letter 'F' could not be typed in the Hex field</dd>
|
||||
<dd>Fixed bug where the changes on Hex field where not parsed</dd>
|
||||
<dd>Added new option 'livePreview'</dd>
|
||||
<dt>08-07-2008</dt>
|
||||
<dd>Fixed typo in the code, both JavaScript and CSS</dd>
|
||||
<dd>Changed the cursor for some elements</dd>
|
||||
<dd>Added new demo explaining how to implement custom skin</dd>
|
||||
<dt>07.07.2008</dt>
|
||||
<dd>The first release.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="tab">
|
||||
<h2>Implement</h2>
|
||||
<p>Attach the Javascript and CSS files to your document. Edit CSS file and fix the paths to images and change colors to fit your site theme.</p>
|
||||
<pre>
|
||||
<link rel="stylesheet" media="screen" type="text/css" href="css/colorpicker.css" />
|
||||
<script type="text/javascript" src="js/colorpicker.js"></script>
|
||||
</pre>
|
||||
<h3>Invocation code</h3>
|
||||
<p>All you have to do is to select the elements in a jQuery way and call the plugin.</p>
|
||||
<pre>
|
||||
$('input').ColorPicker(options);
|
||||
</pre>
|
||||
<h3>Options</h3>
|
||||
<p>A hash of parameters. All parameters are optional.</p>
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>eventName</strong></td>
|
||||
<td>string</td>
|
||||
<td>The desired event to trigger the colorpicker. Default: 'click'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>color</strong></td>
|
||||
<td>string or hash</td>
|
||||
<td>The default color. String for hex color or hash for RGB and HSB ({r:255, r:0, b:0}) . Default: 'ff0000'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>flat</strong></td>
|
||||
<td>boolean</td>
|
||||
<td>Whatever if the color picker is appended to the element or triggered by an event. Default false</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>livePreview</strong></td>
|
||||
<td>boolean</td>
|
||||
<td>Whatever if the color values are filled in the fields while changing values on selector or a field. If false it may improve speed. Default true</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>onShow</strong></td>
|
||||
<td>function</td>
|
||||
<td>Callback function triggered when the color picker is shown</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>onBeforeShow</strong></td>
|
||||
<td>function</td>
|
||||
<td>Callback function triggered before the color picker is shown</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>onHide</strong></td>
|
||||
<td>function</td>
|
||||
<td>Callback function triggered when the color picker is hidden</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>onChange</strong></td>
|
||||
<td>function</td>
|
||||
<td>Callback function triggered when the color is changed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>onSubmit</strong></td>
|
||||
<td>function</td>
|
||||
<td>Callback function triggered when the color it is chosen</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>Set color</h3>
|
||||
<p>If you want to set a new color.</p>
|
||||
<pre>$('input').ColorPickerSetColor(color);</pre>
|
||||
<p>The 'color' argument is the same format as the option color, string for hex color or hash for RGB and HSB ({r:255, r:0, b:0}).</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,484 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* Color picker
|
||||
* Author: Stefan Petre www.eyecon.ro
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
var ColorPicker = function () {
|
||||
var
|
||||
ids = {},
|
||||
inAction,
|
||||
charMin = 65,
|
||||
visible,
|
||||
tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
|
||||
defaults = {
|
||||
eventName: 'click',
|
||||
onShow: function () {},
|
||||
onBeforeShow: function(){},
|
||||
onHide: function () {},
|
||||
onChange: function () {},
|
||||
onSubmit: function () {},
|
||||
color: 'ff0000',
|
||||
livePreview: true,
|
||||
flat: false
|
||||
},
|
||||
fillRGBFields = function (hsb, cal) {
|
||||
var rgb = HSBToRGB(hsb);
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(1).val(rgb.r).end()
|
||||
.eq(2).val(rgb.g).end()
|
||||
.eq(3).val(rgb.b).end();
|
||||
},
|
||||
fillHSBFields = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(4).val(hsb.h).end()
|
||||
.eq(5).val(hsb.s).end()
|
||||
.eq(6).val(hsb.b).end();
|
||||
},
|
||||
fillHexFields = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(0).val(HSBToHex(hsb)).end();
|
||||
},
|
||||
setSelector = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
|
||||
$(cal).data('colorpicker').selectorIndic.css({
|
||||
left: parseInt(150 * hsb.s/100, 10),
|
||||
top: parseInt(150 * (100-hsb.b)/100, 10)
|
||||
});
|
||||
},
|
||||
setHue = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
|
||||
},
|
||||
setCurrentColor = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
||||
},
|
||||
setNewColor = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
||||
},
|
||||
keyDown = function (ev) {
|
||||
var pressedKey = ev.charCode || ev.keyCode || -1;
|
||||
if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
|
||||
return false;
|
||||
}
|
||||
var cal = $(this).parent().parent();
|
||||
if (cal.data('colorpicker').livePreview === true) {
|
||||
change.apply(this);
|
||||
}
|
||||
},
|
||||
change = function (ev) {
|
||||
var cal = $(this).parent().parent(), col;
|
||||
if (this.parentNode.className.indexOf('_hex') > 0) {
|
||||
cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
|
||||
} else if (this.parentNode.className.indexOf('_hsb') > 0) {
|
||||
cal.data('colorpicker').color = col = fixHSB({
|
||||
h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
|
||||
s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
|
||||
b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
|
||||
});
|
||||
} else {
|
||||
cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
|
||||
r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
|
||||
g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
|
||||
b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
|
||||
}));
|
||||
}
|
||||
if (ev) {
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
}
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
|
||||
},
|
||||
blur = function (ev) {
|
||||
var cal = $(this).parent().parent();
|
||||
cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
||||
},
|
||||
focus = function () {
|
||||
charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
|
||||
$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
||||
$(this).parent().addClass('colorpicker_focus');
|
||||
},
|
||||
downIncrement = function (ev) {
|
||||
var field = $(this).parent().find('input').focus();
|
||||
var current = {
|
||||
el: $(this).parent().addClass('colorpicker_slider'),
|
||||
max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
|
||||
y: ev.pageY,
|
||||
field: field,
|
||||
val: parseInt(field.val(), 10),
|
||||
preview: $(this).parent().parent().data('colorpicker').livePreview
|
||||
};
|
||||
$(document).bind('mouseup', current, upIncrement);
|
||||
$(document).bind('mousemove', current, moveIncrement);
|
||||
},
|
||||
moveIncrement = function (ev) {
|
||||
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
|
||||
if (ev.data.preview) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
upIncrement = function (ev) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
ev.data.el.removeClass('colorpicker_slider').find('input').focus();
|
||||
$(document).unbind('mouseup', upIncrement);
|
||||
$(document).unbind('mousemove', moveIncrement);
|
||||
return false;
|
||||
},
|
||||
downHue = function (ev) {
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
y: $(this).offset().top
|
||||
};
|
||||
current.preview = current.cal.data('colorpicker').livePreview;
|
||||
$(document).bind('mouseup', current, upHue);
|
||||
$(document).bind('mousemove', current, moveHue);
|
||||
},
|
||||
moveHue = function (ev) {
|
||||
change.apply(
|
||||
ev.data.cal.data('colorpicker')
|
||||
.fields
|
||||
.eq(4)
|
||||
.val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upHue = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
$(document).unbind('mouseup', upHue);
|
||||
$(document).unbind('mousemove', moveHue);
|
||||
return false;
|
||||
},
|
||||
downSelector = function (ev) {
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
pos: $(this).offset()
|
||||
};
|
||||
current.preview = current.cal.data('colorpicker').livePreview;
|
||||
$(document).bind('mouseup', current, upSelector);
|
||||
$(document).bind('mousemove', current, moveSelector);
|
||||
},
|
||||
moveSelector = function (ev) {
|
||||
change.apply(
|
||||
ev.data.cal.data('colorpicker')
|
||||
.fields
|
||||
.eq(6)
|
||||
.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
|
||||
.end()
|
||||
.eq(5)
|
||||
.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upSelector = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
$(document).unbind('mouseup', upSelector);
|
||||
$(document).unbind('mousemove', moveSelector);
|
||||
return false;
|
||||
},
|
||||
enterSubmit = function (ev) {
|
||||
$(this).addClass('colorpicker_focus');
|
||||
},
|
||||
leaveSubmit = function (ev) {
|
||||
$(this).removeClass('colorpicker_focus');
|
||||
},
|
||||
clickSubmit = function (ev) {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colorpicker').color;
|
||||
cal.data('colorpicker').origColor = col;
|
||||
setCurrentColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
|
||||
},
|
||||
show = function (ev) {
|
||||
var cal = $('#' + $(this).data('colorpickerId'));
|
||||
cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
|
||||
var pos = $(this).offset();
|
||||
var viewPort = getViewport();
|
||||
var top = pos.top + this.offsetHeight;
|
||||
var left = pos.left;
|
||||
if (top + 176 > viewPort.t + viewPort.h) {
|
||||
top -= this.offsetHeight + 176;
|
||||
}
|
||||
if (left + 356 > viewPort.l + viewPort.w) {
|
||||
left -= 356;
|
||||
}
|
||||
cal.css({left: left + 'px', top: top + 'px'});
|
||||
if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
|
||||
cal.show();
|
||||
}
|
||||
$(document).bind('mousedown', {cal: cal}, hide);
|
||||
return false;
|
||||
},
|
||||
hide = function (ev) {
|
||||
if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
|
||||
if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
|
||||
ev.data.cal.hide();
|
||||
}
|
||||
$(document).unbind('mousedown', hide);
|
||||
}
|
||||
},
|
||||
isChildOf = function(parentEl, el, container) {
|
||||
if (parentEl == el) {
|
||||
return true;
|
||||
}
|
||||
if (parentEl.contains) {
|
||||
return parentEl.contains(el);
|
||||
}
|
||||
if ( parentEl.compareDocumentPosition ) {
|
||||
return !!(parentEl.compareDocumentPosition(el) & 16);
|
||||
}
|
||||
var prEl = el.parentNode;
|
||||
while(prEl && prEl != container) {
|
||||
if (prEl == parentEl)
|
||||
return true;
|
||||
prEl = prEl.parentNode;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getViewport = function () {
|
||||
var m = document.compatMode == 'CSS1Compat';
|
||||
return {
|
||||
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
|
||||
t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
|
||||
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
|
||||
h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
|
||||
};
|
||||
},
|
||||
fixHSB = function (hsb) {
|
||||
return {
|
||||
h: Math.min(360, Math.max(0, hsb.h)),
|
||||
s: Math.min(100, Math.max(0, hsb.s)),
|
||||
b: Math.min(100, Math.max(0, hsb.b))
|
||||
};
|
||||
},
|
||||
fixRGB = function (rgb) {
|
||||
return {
|
||||
r: Math.min(255, Math.max(0, rgb.r)),
|
||||
g: Math.min(255, Math.max(0, rgb.g)),
|
||||
b: Math.min(255, Math.max(0, rgb.b))
|
||||
};
|
||||
},
|
||||
fixHex = function (hex) {
|
||||
var len = 6 - hex.length;
|
||||
if (len > 0) {
|
||||
var o = [];
|
||||
for (var i=0; i<len; i++) {
|
||||
o.push('0');
|
||||
}
|
||||
o.push(hex);
|
||||
hex = o.join('');
|
||||
}
|
||||
return hex;
|
||||
},
|
||||
HexToRGB = function (hex) {
|
||||
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
||||
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
||||
},
|
||||
HexToHSB = function (hex) {
|
||||
return RGBToHSB(HexToRGB(hex));
|
||||
},
|
||||
RGBToHSB = function (rgb) {
|
||||
var hsb = {
|
||||
h: 0,
|
||||
s: 0,
|
||||
b: 0
|
||||
};
|
||||
var min = Math.min(rgb.r, rgb.g, rgb.b);
|
||||
var max = Math.max(rgb.r, rgb.g, rgb.b);
|
||||
var delta = max - min;
|
||||
hsb.b = max;
|
||||
if (max != 0) {
|
||||
|
||||
}
|
||||
hsb.s = max != 0 ? 255 * delta / max : 0;
|
||||
if (hsb.s != 0) {
|
||||
if (rgb.r == max) {
|
||||
hsb.h = (rgb.g - rgb.b) / delta;
|
||||
} else if (rgb.g == max) {
|
||||
hsb.h = 2 + (rgb.b - rgb.r) / delta;
|
||||
} else {
|
||||
hsb.h = 4 + (rgb.r - rgb.g) / delta;
|
||||
}
|
||||
} else {
|
||||
hsb.h = -1;
|
||||
}
|
||||
hsb.h *= 60;
|
||||
if (hsb.h < 0) {
|
||||
hsb.h += 360;
|
||||
}
|
||||
hsb.s *= 100/255;
|
||||
hsb.b *= 100/255;
|
||||
return hsb;
|
||||
},
|
||||
HSBToRGB = function (hsb) {
|
||||
var rgb = {};
|
||||
var h = Math.round(hsb.h);
|
||||
var s = Math.round(hsb.s*255/100);
|
||||
var v = Math.round(hsb.b*255/100);
|
||||
if(s == 0) {
|
||||
rgb.r = rgb.g = rgb.b = v;
|
||||
} else {
|
||||
var t1 = v;
|
||||
var t2 = (255-s)*v/255;
|
||||
var t3 = (t1-t2)*(h%60)/60;
|
||||
if(h==360) h = 0;
|
||||
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
|
||||
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
|
||||
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
|
||||
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
|
||||
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
|
||||
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
|
||||
else {rgb.r=0; rgb.g=0; rgb.b=0}
|
||||
}
|
||||
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
|
||||
},
|
||||
RGBToHex = function (rgb) {
|
||||
var hex = [
|
||||
rgb.r.toString(16),
|
||||
rgb.g.toString(16),
|
||||
rgb.b.toString(16)
|
||||
];
|
||||
$.each(hex, function (nr, val) {
|
||||
if (val.length == 1) {
|
||||
hex[nr] = '0' + val;
|
||||
}
|
||||
});
|
||||
return hex.join('');
|
||||
},
|
||||
HSBToHex = function (hsb) {
|
||||
return RGBToHex(HSBToRGB(hsb));
|
||||
},
|
||||
restoreOriginal = function () {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colorpicker').origColor;
|
||||
cal.data('colorpicker').color = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
};
|
||||
return {
|
||||
init: function (opt) {
|
||||
opt = $.extend({}, defaults, opt||{});
|
||||
if (typeof opt.color == 'string') {
|
||||
opt.color = HexToHSB(opt.color);
|
||||
} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
|
||||
opt.color = RGBToHSB(opt.color);
|
||||
} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
|
||||
opt.color = fixHSB(opt.color);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return this.each(function () {
|
||||
if (!$(this).data('colorpickerId')) {
|
||||
var options = $.extend({}, opt);
|
||||
options.origColor = opt.color;
|
||||
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
|
||||
$(this).data('colorpickerId', id);
|
||||
var cal = $(tpl).attr('id', id);
|
||||
if (options.flat) {
|
||||
cal.appendTo(this).show();
|
||||
} else {
|
||||
cal.appendTo(document.body);
|
||||
}
|
||||
options.fields = cal
|
||||
.find('input')
|
||||
.bind('keyup', keyDown)
|
||||
.bind('change', change)
|
||||
.bind('blur', blur)
|
||||
.bind('focus', focus);
|
||||
cal
|
||||
.find('span').bind('mousedown', downIncrement).end()
|
||||
.find('>div.colorpicker_current_color').bind('click', restoreOriginal);
|
||||
options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
|
||||
options.selectorIndic = options.selector.find('div div');
|
||||
options.el = this;
|
||||
options.hue = cal.find('div.colorpicker_hue div');
|
||||
cal.find('div.colorpicker_hue').bind('mousedown', downHue);
|
||||
options.newColor = cal.find('div.colorpicker_new_color');
|
||||
options.currentColor = cal.find('div.colorpicker_current_color');
|
||||
cal.data('colorpicker', options);
|
||||
cal.find('div.colorpicker_submit')
|
||||
.bind('mouseenter', enterSubmit)
|
||||
.bind('mouseleave', leaveSubmit)
|
||||
.bind('click', clickSubmit);
|
||||
fillRGBFields(options.color, cal.get(0));
|
||||
fillHSBFields(options.color, cal.get(0));
|
||||
fillHexFields(options.color, cal.get(0));
|
||||
setHue(options.color, cal.get(0));
|
||||
setSelector(options.color, cal.get(0));
|
||||
setCurrentColor(options.color, cal.get(0));
|
||||
setNewColor(options.color, cal.get(0));
|
||||
if (options.flat) {
|
||||
cal.css({
|
||||
position: 'relative',
|
||||
display: 'block'
|
||||
});
|
||||
} else {
|
||||
$(this).bind(options.eventName, show);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
showPicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colorpickerId')) {
|
||||
show.apply(this);
|
||||
}
|
||||
});
|
||||
},
|
||||
hidePicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colorpickerId')) {
|
||||
$('#' + $(this).data('colorpickerId')).hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
setColor: function(col) {
|
||||
if (typeof col == 'string') {
|
||||
col = HexToHSB(col);
|
||||
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
||||
col = RGBToHSB(col);
|
||||
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
||||
col = fixHSB(col);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return this.each(function(){
|
||||
if ($(this).data('colorpickerId')) {
|
||||
var cal = $('#' + $(this).data('colorpickerId'));
|
||||
cal.data('colorpicker').color = col;
|
||||
cal.data('colorpicker').origColor = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
setCurrentColor(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}();
|
||||
$.fn.extend({
|
||||
ColorPicker: ColorPicker.init,
|
||||
ColorPickerHide: ColorPicker.hidePicker,
|
||||
ColorPickerShow: ColorPicker.showPicker,
|
||||
ColorPickerSetColor: ColorPicker.setColor
|
||||
});
|
||||
})(jQuery)
|
@ -1,34 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* Zoomimage
|
||||
* Author: Stefan Petre www.eyecon.ro
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
var EYE = window.EYE = function() {
|
||||
var _registered = {
|
||||
init: []
|
||||
};
|
||||
return {
|
||||
init: function() {
|
||||
$.each(_registered.init, function(nr, fn){
|
||||
fn.call();
|
||||
});
|
||||
},
|
||||
extend: function(prop) {
|
||||
for (var i in prop) {
|
||||
if (prop[i] != undefined) {
|
||||
this[i] = prop[i];
|
||||
}
|
||||
}
|
||||
},
|
||||
register: function(fn, type) {
|
||||
if (!_registered[type]) {
|
||||
_registered[type] = [];
|
||||
}
|
||||
_registered[type].push(fn);
|
||||
}
|
||||
};
|
||||
}();
|
||||
$(EYE.init);
|
||||
})(jQuery);
|
@ -1,67 +0,0 @@
|
||||
(function($){
|
||||
var initLayout = function() {
|
||||
var hash = window.location.hash.replace('#', '');
|
||||
var currentTab = $('ul.navigationTabs a')
|
||||
.bind('click', showTab)
|
||||
.filter('a[rel=' + hash + ']');
|
||||
if (currentTab.size() == 0) {
|
||||
currentTab = $('ul.navigationTabs a:first');
|
||||
}
|
||||
showTab.apply(currentTab.get(0));
|
||||
$('#colorpickerHolder').ColorPicker({flat: true});
|
||||
$('#colorpickerHolder2').ColorPicker({
|
||||
flat: true,
|
||||
color: '#00ff00',
|
||||
onSubmit: function(hsb, hex, rgb) {
|
||||
$('#colorSelector2 div').css('backgroundColor', '#' + hex);
|
||||
}
|
||||
});
|
||||
$('#colorpickerHolder2>div').css('position', 'absolute');
|
||||
var widt = false;
|
||||
$('#colorSelector2').bind('click', function() {
|
||||
$('#colorpickerHolder2').stop().animate({height: widt ? 0 : 173}, 500);
|
||||
widt = !widt;
|
||||
});
|
||||
$('#colorpickerField1, #colorpickerField2, #colorpickerField3').ColorPicker({
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
$(el).val(hex);
|
||||
$(el).ColorPickerHide();
|
||||
},
|
||||
onBeforeShow: function () {
|
||||
$(this).ColorPickerSetColor(this.value);
|
||||
}
|
||||
})
|
||||
.bind('keyup', function(){
|
||||
$(this).ColorPickerSetColor(this.value);
|
||||
});
|
||||
$('#colorSelector').ColorPicker({
|
||||
color: '#0000ff',
|
||||
onShow: function (colpkr) {
|
||||
$(colpkr).fadeIn(500);
|
||||
return false;
|
||||
},
|
||||
onHide: function (colpkr) {
|
||||
$(colpkr).fadeOut(500);
|
||||
return false;
|
||||
},
|
||||
onChange: function (hsb, hex, rgb) {
|
||||
$('#colorSelector div').css('backgroundColor', '#' + hex);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var showTab = function(e) {
|
||||
var tabIndex = $('ul.navigationTabs a')
|
||||
.removeClass('active')
|
||||
.index(this);
|
||||
$(this)
|
||||
.addClass('active')
|
||||
.blur();
|
||||
$('div.tab')
|
||||
.hide()
|
||||
.eq(tabIndex)
|
||||
.show();
|
||||
};
|
||||
|
||||
EYE.register(initLayout, 'init');
|
||||
})(jQuery)
|
@ -1,252 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* Utilities
|
||||
* Author: Stefan Petre www.eyecon.ro
|
||||
*
|
||||
*/
|
||||
(function($) {
|
||||
EYE.extend({
|
||||
getPosition : function(e, forceIt)
|
||||
{
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
var es = e.style;
|
||||
var restoreStyles = false;
|
||||
if (forceIt && jQuery.curCSS(e,'display') == 'none') {
|
||||
var oldVisibility = es.visibility;
|
||||
var oldPosition = es.position;
|
||||
restoreStyles = true;
|
||||
es.visibility = 'hidden';
|
||||
es.display = 'block';
|
||||
es.position = 'absolute';
|
||||
}
|
||||
var el = e;
|
||||
if (el.getBoundingClientRect) { // IE
|
||||
var box = el.getBoundingClientRect();
|
||||
x = box.left + Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) - 2;
|
||||
y = box.top + Math.max(document.documentElement.scrollTop, document.body.scrollTop) - 2;
|
||||
} else {
|
||||
x = el.offsetLeft;
|
||||
y = el.offsetTop;
|
||||
el = el.offsetParent;
|
||||
if (e != el) {
|
||||
while (el) {
|
||||
x += el.offsetLeft;
|
||||
y += el.offsetTop;
|
||||
el = el.offsetParent;
|
||||
}
|
||||
}
|
||||
if (jQuery.browser.safari && jQuery.curCSS(e, 'position') == 'absolute' ) {
|
||||
x -= document.body.offsetLeft;
|
||||
y -= document.body.offsetTop;
|
||||
}
|
||||
el = e.parentNode;
|
||||
while (el && el.tagName.toUpperCase() != 'BODY' && el.tagName.toUpperCase() != 'HTML')
|
||||
{
|
||||
if (jQuery.curCSS(el, 'display') != 'inline') {
|
||||
x -= el.scrollLeft;
|
||||
y -= el.scrollTop;
|
||||
}
|
||||
el = el.parentNode;
|
||||
}
|
||||
}
|
||||
if (restoreStyles == true) {
|
||||
es.display = 'none';
|
||||
es.position = oldPosition;
|
||||
es.visibility = oldVisibility;
|
||||
}
|
||||
return {x:x, y:y};
|
||||
},
|
||||
getSize : function(e)
|
||||
{
|
||||
var w = parseInt(jQuery.curCSS(e,'width'), 10);
|
||||
var h = parseInt(jQuery.curCSS(e,'height'), 10);
|
||||
var wb = 0;
|
||||
var hb = 0;
|
||||
if (jQuery.curCSS(e, 'display') != 'none') {
|
||||
wb = e.offsetWidth;
|
||||
hb = e.offsetHeight;
|
||||
} else {
|
||||
var es = e.style;
|
||||
var oldVisibility = es.visibility;
|
||||
var oldPosition = es.position;
|
||||
es.visibility = 'hidden';
|
||||
es.display = 'block';
|
||||
es.position = 'absolute';
|
||||
wb = e.offsetWidth;
|
||||
hb = e.offsetHeight;
|
||||
es.display = 'none';
|
||||
es.position = oldPosition;
|
||||
es.visibility = oldVisibility;
|
||||
}
|
||||
return {w:w, h:h, wb:wb, hb:hb};
|
||||
},
|
||||
getClient : function(e)
|
||||
{
|
||||
var h, w;
|
||||
if (e) {
|
||||
w = e.clientWidth;
|
||||
h = e.clientHeight;
|
||||
} else {
|
||||
var de = document.documentElement;
|
||||
w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
|
||||
h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
|
||||
}
|
||||
return {w:w,h:h};
|
||||
},
|
||||
getScroll : function (e)
|
||||
{
|
||||
var t=0, l=0, w=0, h=0, iw=0, ih=0;
|
||||
if (e && e.nodeName.toLowerCase() != 'body') {
|
||||
t = e.scrollTop;
|
||||
l = e.scrollLeft;
|
||||
w = e.scrollWidth;
|
||||
h = e.scrollHeight;
|
||||
} else {
|
||||
if (document.documentElement) {
|
||||
t = document.documentElement.scrollTop;
|
||||
l = document.documentElement.scrollLeft;
|
||||
w = document.documentElement.scrollWidth;
|
||||
h = document.documentElement.scrollHeight;
|
||||
} else if (document.body) {
|
||||
t = document.body.scrollTop;
|
||||
l = document.body.scrollLeft;
|
||||
w = document.body.scrollWidth;
|
||||
h = document.body.scrollHeight;
|
||||
}
|
||||
if (typeof pageYOffset != 'undefined') {
|
||||
t = pageYOffset;
|
||||
l = pageXOffset;
|
||||
}
|
||||
iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
|
||||
ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
|
||||
}
|
||||
return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
|
||||
},
|
||||
getMargins : function(e, toInteger)
|
||||
{
|
||||
var t = jQuery.curCSS(e,'marginTop') || '';
|
||||
var r = jQuery.curCSS(e,'marginRight') || '';
|
||||
var b = jQuery.curCSS(e,'marginBottom') || '';
|
||||
var l = jQuery.curCSS(e,'marginLeft') || '';
|
||||
if (toInteger)
|
||||
return {
|
||||
t: parseInt(t, 10)||0,
|
||||
r: parseInt(r, 10)||0,
|
||||
b: parseInt(b, 10)||0,
|
||||
l: parseInt(l, 10)
|
||||
};
|
||||
else
|
||||
return {t: t, r: r, b: b, l: l};
|
||||
},
|
||||
getPadding : function(e, toInteger)
|
||||
{
|
||||
var t = jQuery.curCSS(e,'paddingTop') || '';
|
||||
var r = jQuery.curCSS(e,'paddingRight') || '';
|
||||
var b = jQuery.curCSS(e,'paddingBottom') || '';
|
||||
var l = jQuery.curCSS(e,'paddingLeft') || '';
|
||||
if (toInteger)
|
||||
return {
|
||||
t: parseInt(t, 10)||0,
|
||||
r: parseInt(r, 10)||0,
|
||||
b: parseInt(b, 10)||0,
|
||||
l: parseInt(l, 10)
|
||||
};
|
||||
else
|
||||
return {t: t, r: r, b: b, l: l};
|
||||
},
|
||||
getBorder : function(e, toInteger)
|
||||
{
|
||||
var t = jQuery.curCSS(e,'borderTopWidth') || '';
|
||||
var r = jQuery.curCSS(e,'borderRightWidth') || '';
|
||||
var b = jQuery.curCSS(e,'borderBottomWidth') || '';
|
||||
var l = jQuery.curCSS(e,'borderLeftWidth') || '';
|
||||
if (toInteger)
|
||||
return {
|
||||
t: parseInt(t, 10)||0,
|
||||
r: parseInt(r, 10)||0,
|
||||
b: parseInt(b, 10)||0,
|
||||
l: parseInt(l, 10)||0
|
||||
};
|
||||
else
|
||||
return {t: t, r: r, b: b, l: l};
|
||||
},
|
||||
traverseDOM : function(nodeEl, func)
|
||||
{
|
||||
func(nodeEl);
|
||||
nodeEl = nodeEl.firstChild;
|
||||
while(nodeEl){
|
||||
EYE.traverseDOM(nodeEl, func);
|
||||
nodeEl = nodeEl.nextSibling;
|
||||
}
|
||||
},
|
||||
getInnerWidth : function(el, scroll) {
|
||||
var offsetW = el.offsetWidth;
|
||||
return scroll ? Math.max(el.scrollWidth,offsetW) - offsetW + el.clientWidth:el.clientWidth;
|
||||
},
|
||||
getInnerHeight : function(el, scroll) {
|
||||
var offsetH = el.offsetHeight;
|
||||
return scroll ? Math.max(el.scrollHeight,offsetH) - offsetH + el.clientHeight:el.clientHeight;
|
||||
},
|
||||
getExtraWidth : function(el) {
|
||||
if($.boxModel)
|
||||
return (parseInt($.curCSS(el, 'paddingLeft'))||0)
|
||||
+ (parseInt($.curCSS(el, 'paddingRight'))||0)
|
||||
+ (parseInt($.curCSS(el, 'borderLeftWidth'))||0)
|
||||
+ (parseInt($.curCSS(el, 'borderRightWidth'))||0);
|
||||
return 0;
|
||||
},
|
||||
getExtraHeight : function(el) {
|
||||
if($.boxModel)
|
||||
return (parseInt($.curCSS(el, 'paddingTop'))||0)
|
||||
+ (parseInt($.curCSS(el, 'paddingBottom'))||0)
|
||||
+ (parseInt($.curCSS(el, 'borderTopWidth'))||0)
|
||||
+ (parseInt($.curCSS(el, 'borderBottomWidth'))||0);
|
||||
return 0;
|
||||
},
|
||||
isChildOf: function(parentEl, el, container) {
|
||||
if (parentEl == el) {
|
||||
return true;
|
||||
}
|
||||
if (!el || !el.nodeType || el.nodeType != 1) {
|
||||
return false;
|
||||
}
|
||||
if (parentEl.contains && !$.browser.safari) {
|
||||
return parentEl.contains(el);
|
||||
}
|
||||
if ( parentEl.compareDocumentPosition ) {
|
||||
return !!(parentEl.compareDocumentPosition(el) & 16);
|
||||
}
|
||||
var prEl = el.parentNode;
|
||||
while(prEl && prEl != container) {
|
||||
if (prEl == parentEl)
|
||||
return true;
|
||||
prEl = prEl.parentNode;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
centerEl : function(el, axis)
|
||||
{
|
||||
var clientScroll = EYE.getScroll();
|
||||
var size = EYE.getSize(el);
|
||||
if (!axis || axis == 'vertically')
|
||||
$(el).css(
|
||||
{
|
||||
top: clientScroll.t + ((Math.min(clientScroll.h,clientScroll.ih) - size.hb)/2) + 'px'
|
||||
}
|
||||
);
|
||||
if (!axis || axis == 'horizontally')
|
||||
$(el).css(
|
||||
{
|
||||
left: clientScroll.l + ((Math.min(clientScroll.w,clientScroll.iw) - size.wb)/2) + 'px'
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
if (!$.easing.easeout) {
|
||||
$.easing.easeout = function(p, n, firstNum, delta, duration) {
|
||||
return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum;
|
||||
};
|
||||
}
|
||||
|
||||
})(jQuery);
|
Before Width: | Height: | Size: 43 B |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 107 B |
Before Width: | Height: | Size: 106 B |
Before Width: | Height: | Size: 347 B |
Before Width: | Height: | Size: 324 B |
Before Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 103 B |
Before Width: | Height: | Size: 503 B |
Before Width: | Height: | Size: 96 B |
Before Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 506 B |
Before Width: | Height: | Size: 203 B |
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 15 KiB |
@ -1,72 +0,0 @@
|
||||
/*
|
||||
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
*
|
||||
* Uses the built in easing capabilities added In jQuery 1.1
|
||||
* to offer multiple easing options
|
||||
*
|
||||
* TERMS OF USE - jQuery Easing
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2008 George McGinley Smith
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
|
||||
|
||||
/*
|
||||
*
|
||||
* TERMS OF USE - EASING EQUATIONS
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2001 Robert Penner
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
@ -1,359 +0,0 @@
|
||||
/*
|
||||
* FancyBox - jQuery Plugin
|
||||
* Simple and fancy lightbox alternative
|
||||
*
|
||||
* Examples and documentation at: http://fancybox.net
|
||||
*
|
||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
||||
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
||||
*
|
||||
* Version: 1.3.4 (11/11/2010)
|
||||
* Requires: jQuery v1.3+
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
#fancybox-loading {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-top: -20px;
|
||||
margin-left: -20px;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
z-index: 1104;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 40px;
|
||||
height: 480px;
|
||||
background-image: url('fancybox.png');
|
||||
}
|
||||
|
||||
#fancybox-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 1100;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-tmp {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-wrap {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: 20px;
|
||||
z-index: 1101;
|
||||
outline: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-outer {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#fancybox-content {
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
outline: none;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
z-index: 1102;
|
||||
border: 0px solid #fff;
|
||||
}
|
||||
|
||||
#fancybox-hide-sel-frame {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
z-index: 1101;
|
||||
}
|
||||
|
||||
#fancybox-close {
|
||||
position: absolute;
|
||||
top: -15px;
|
||||
right: -15px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: transparent url('fancybox.png') -40px 0px;
|
||||
cursor: pointer;
|
||||
z-index: 1103;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-error {
|
||||
color: #444;
|
||||
font: normal 12px/20px Arial;
|
||||
padding: 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#fancybox-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
outline: none;
|
||||
line-height: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#fancybox-frame {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#fancybox-left, #fancybox-right {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
height: 100%;
|
||||
width: 35%;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
background: transparent url('blank.gif');
|
||||
z-index: 1102;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-left {
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
#fancybox-right {
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
#fancybox-left-ico, #fancybox-right-ico {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -9999px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin-top: -15px;
|
||||
cursor: pointer;
|
||||
z-index: 1102;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#fancybox-left-ico {
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -30px;
|
||||
}
|
||||
|
||||
#fancybox-right-ico {
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -60px;
|
||||
}
|
||||
|
||||
#fancybox-left:hover, #fancybox-right:hover {
|
||||
visibility: visible; /* IE6 */
|
||||
}
|
||||
|
||||
#fancybox-left:hover span {
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
#fancybox-right:hover span {
|
||||
left: auto;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.fancybox-bg {
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
#fancybox-bg-n {
|
||||
top: -20px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-image: url('fancybox-x.png');
|
||||
}
|
||||
|
||||
#fancybox-bg-ne {
|
||||
top: -20px;
|
||||
right: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -162px;
|
||||
}
|
||||
|
||||
#fancybox-bg-e {
|
||||
top: 0;
|
||||
right: -20px;
|
||||
height: 100%;
|
||||
background-image: url('fancybox-y.png');
|
||||
background-position: -20px 0px;
|
||||
}
|
||||
|
||||
#fancybox-bg-se {
|
||||
bottom: -20px;
|
||||
right: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -182px;
|
||||
}
|
||||
|
||||
#fancybox-bg-s {
|
||||
bottom: -20px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-image: url('fancybox-x.png');
|
||||
background-position: 0px -20px;
|
||||
}
|
||||
|
||||
#fancybox-bg-sw {
|
||||
bottom: -20px;
|
||||
left: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -142px;
|
||||
}
|
||||
|
||||
#fancybox-bg-w {
|
||||
top: 0;
|
||||
left: -20px;
|
||||
height: 100%;
|
||||
background-image: url('fancybox-y.png');
|
||||
}
|
||||
|
||||
#fancybox-bg-nw {
|
||||
top: -20px;
|
||||
left: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -122px;
|
||||
}
|
||||
|
||||
#fancybox-title {
|
||||
font-family: Helvetica;
|
||||
font-size: 12px;
|
||||
z-index: 1102;
|
||||
}
|
||||
|
||||
.fancybox-title-inside {
|
||||
padding-bottom: 10px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fancybox-title-outside {
|
||||
padding-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fancybox-title-over {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #FFF;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#fancybox-title-over {
|
||||
padding: 10px;
|
||||
background-image: url('fancy_title_over.png');
|
||||
display: block;
|
||||
}
|
||||
|
||||
.fancybox-title-float {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -20px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
#fancybox-title-float-wrap {
|
||||
border: none;
|
||||
border-collapse: collapse;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#fancybox-title-float-wrap td {
|
||||
border: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#fancybox-title-float-left {
|
||||
padding: 0 0 0 15px;
|
||||
background: url('fancybox.png') -40px -90px no-repeat;
|
||||
}
|
||||
|
||||
#fancybox-title-float-main {
|
||||
color: #FFF;
|
||||
line-height: 29px;
|
||||
font-weight: bold;
|
||||
padding: 0 0 3px 0;
|
||||
background: url('fancybox-x.png') 0px -40px;
|
||||
}
|
||||
|
||||
#fancybox-title-float-right {
|
||||
padding: 0 0 0 15px;
|
||||
background: url('fancybox.png') -55px -90px no-repeat;
|
||||
}
|
||||
|
||||
/* IE6 */
|
||||
|
||||
.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
|
||||
.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
|
||||
height: expression(this.parentNode.clientHeight + "px");
|
||||
}
|
||||
|
||||
#fancybox-loading.fancybox-ie6 {
|
||||
position: absolute; margin-top: 0;
|
||||
top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
|
||||
}
|
||||
|
||||
#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
|
||||
|
||||
/* IE6, IE7, IE8 */
|
||||
|
||||
.fancybox-ie .fancybox-bg { background: transparent !important; }
|
||||
|
||||
.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* FancyBox - jQuery Plugin
|
||||
* Simple and fancy lightbox alternative
|
||||
*
|
||||
* Examples and documentation at: http://fancybox.net
|
||||
*
|
||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
||||
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
||||
*
|
||||
* Version: 1.3.4 (11/11/2010)
|
||||
* Requires: jQuery v1.3+
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
|
||||
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
|
||||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
|
||||
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
|
||||
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
|
||||
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
|
||||
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
|
||||
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
|
||||
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
|
||||
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
|
||||
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
|
||||
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
|
||||
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
|
||||
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
|
||||
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
|
||||
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
|
||||
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
|
||||
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
|
||||
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
|
||||
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
|
||||
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
|
||||
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
|
||||
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
|
||||
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
|
||||
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
|
||||
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
|
||||
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
|
||||
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
|
||||
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
|
@ -1,14 +0,0 @@
|
||||
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
||||
*
|
||||
* Version: 3.0.4
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
|
||||
(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
|
||||
f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
|
2
library/jslider/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
*/.DS_Store
|
||||
.DS_Store
|
@ -1,20 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
Copyright (c) 2012 Egor Khmelev
|
||||
|
||||
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.
|
@ -1,15 +0,0 @@
|
||||
|
||||
css_compiler: js_compiler
|
||||
mkdir -p bin
|
||||
cat css/jslider.css css/jslider.blue.css css/jslider.plastic.css css/jslider.round.css css/jslider.round.plastic.css > bin/jquery.slider.all.css
|
||||
java -jar tools/yuicompressor-2.4.7.jar --type=css bin/jquery.slider.all.css > bin/jquery.slider.min.css
|
||||
rm -f bin/jquery.slider.all.css
|
||||
|
||||
js_compiler:
|
||||
mkdir -p bin
|
||||
rm -f bin/jquery.slider.all.js bin/jquery.slider.min.js
|
||||
cat js/jshashtable-2.1_src.js js/jquery.numberformatter-1.2.3.js js/tmpl.js js/jquery.dependClass-0.1.js js/draggable-0.1.js js/jquery.slider.js > bin/jquery.slider.all.js
|
||||
uglifyjs -nc bin/jquery.slider.all.js > bin/jquery.slider.min.js
|
||||
rm -f bin/jquery.slider.all.js
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
# jQuery Slider plugin
|
||||
|
||||
jQuery Slider is easy to use and multifunctional jQuery plugin.
|
||||
|
||||
[Check out demos and documentations here](http://egorkhmelev.github.com/jslider/)
|
||||
|
||||
## License
|
||||
|
||||
(MIT License) — Copyright © 2012 Egor Khmelev
|
1
library/jslider/bin/jquery.slider.min.css
vendored
@ -1 +0,0 @@
|
||||
.jslider .jslider-bg i,.jslider .jslider-pointer{background:url(../img/jslider.png) no-repeat 0 0}.jslider{display:block;width:100%;height:1em;position:relative;top:.6em;font-family:Arial,sans-serif}.jslider table{width:100%;border-collapse:collapse;border:0}.jslider td,.jslider th{padding:0;vertical-align:top;text-align:left;border:0}.jslider table,.jslider table tr,.jslider table tr td{width:100%;vertical-align:top}.jslider .jslider-bg{position:relative}.jslider .jslider-bg i{height:5px;position:absolute;font-size:0;top:0}.jslider .jslider-bg .l{width:50%;background-position:0 0;left:0}.jslider .jslider-bg .r{width:50%;left:50%;background-position:right 0}.jslider .jslider-bg .v{position:absolute;width:60%;left:20%;top:0;height:5px;background-position:0 -20px}.jslider .jslider-pointer{width:13px;height:15px;background-position:0 -40px;position:absolute;left:20%;top:-4px;margin-left:-6px;cursor:pointer;cursor:hand}.jslider .jslider-pointer-hover{background-position:-20px -40px}.jslider .jslider-pointer-to{left:80%}.jslider .jslider-label{font-size:9px;line-height:12px;color:black;opacity:.4;white-space:nowrap;padding:0 2px;position:absolute;top:-18px;left:0}.jslider .jslider-label-to{left:auto;right:0}.jslider .jslider-value{font-size:9px;white-space:nowrap;padding:1px 2px 0;position:absolute;top:-19px;left:20%;background:white;line-height:12px;-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;border-radius:2px}.jslider .jslider-value-to{left:80%}.jslider .jslider-label small,.jslider .jslider-value small{position:relative;top:-0.4em}.jslider .jslider-scale{position:relative;top:9px}.jslider .jslider-scale span{position:absolute;height:5px;border-left:1px solid #999;font-size:0}.jslider .jslider-scale ins{font-size:9px;text-decoration:none;position:absolute;left:0;top:5px;color:#999}.jslider-single .jslider-pointer-to,.jslider-single .jslider-value-to,.jslider-single .jslider-bg .v,.jslider-limitless .jslider-label{display:none}.jslider_blue .jslider-bg i,.jslider_blue .jslider-pointer{background-image:url(../img/jslider.blue.png)}.jslider_plastic .jslider-bg i,.jslider_plastic .jslider-pointer{background-image:url(../img/jslider.plastic.png)}.jslider_round .jslider-bg i,.jslider_round .jslider-pointer{background-image:url(../img/jslider.round.png)}.jslider_round .jslider-pointer{width:17px;height:17px;top:-6px;margin-left:-8px}.jslider_round_plastic .jslider-bg i,.jslider_round_plastic .jslider-pointer{background-image:url(../img/jslider.round.plastic.png)}.jslider_round_plastic .jslider-pointer{width:18px;height:18px;top:-7px;margin-left:-8px}
|
1
library/jslider/bin/jquery.slider.min.js
vendored
@ -1,4 +0,0 @@
|
||||
|
||||
.jslider_blue .jslider-bg i,
|
||||
.jslider_blue .jslider-pointer { background-image: url(../img/jslider.blue.png); }
|
||||
|
@ -1,39 +0,0 @@
|
||||
|
||||
.jslider .jslider-bg i,
|
||||
.jslider .jslider-pointer { background: url(../img/jslider.png) no-repeat 0 0; }
|
||||
|
||||
.jslider { display: block; width: 100%; height: 1em; position: relative; top: 0.6em; font-family: Arial, sans-serif; }
|
||||
.jslider table { width: 100%; border-collapse: collapse; border: 0; }
|
||||
.jslider td, .jslider th { padding: 0; vertical-align: top; text-align: left; border: 0; }
|
||||
|
||||
.jslider table,
|
||||
.jslider table tr,
|
||||
.jslider table tr td { width: 100%; vertical-align: top; }
|
||||
|
||||
.jslider .jslider-bg { position: relative; }
|
||||
.jslider .jslider-bg i { height: 5px; position: absolute; font-size: 0; top: 0; }
|
||||
.jslider .jslider-bg .l { width: 50%; background-position: 0 0; left: 0; background: #888; }
|
||||
.jslider .jslider-bg .r { width: 50%; left: 50%; background-position: right 0; background: #888;}
|
||||
.jslider .jslider-bg .v { position: absolute; background: url(../img/jslider.png) repeat-x 0 0; width: 60%; left: 20%; top: 0; height: 5px; background-position: 0 -20px; }
|
||||
|
||||
.jslider .jslider-pointer { width: 13px; height: 15px; background-position: 0 -40px; position: absolute; left: 20%; top: -4px; margin-left: -6px; cursor: pointer; cursor: hand; }
|
||||
.jslider .jslider-pointer-hover { background-position: -20px -40px; }
|
||||
.jslider .jslider-pointer-to { left: 80%; }
|
||||
|
||||
.jslider .jslider-label { font-size: 9px; line-height: 12px; color: black; opacity: 0.4; white-space: nowrap; padding: 0px 2px; position: absolute; top: -18px; left: 0px; }
|
||||
.jslider .jslider-label-to { left: auto; right: 0; }
|
||||
|
||||
.jslider .jslider-value { font-size: 9px; white-space: nowrap; padding: 1px 2px 0; position: absolute; top: -19px; left: 20%; line-height: 12px; }
|
||||
.jslider .jslider-value-to { left: 80%; }
|
||||
|
||||
.jslider .jslider-label small,
|
||||
.jslider .jslider-value small { position: relative; top: -0.4em; }
|
||||
|
||||
.jslider .jslider-scale { position: relative; top: 9px; }
|
||||
.jslider .jslider-scale span { position: absolute; height: 5px; border-left: 1px solid #999; font-size: 0; }
|
||||
.jslider .jslider-scale ins { font-size: 9px; text-decoration: none; position: absolute; left: 0px; top: 5px; color: #999; }
|
||||
|
||||
.jslider-single .jslider-pointer-to,
|
||||
.jslider-single .jslider-value-to,
|
||||
.jslider-single .jslider-bg .v,
|
||||
.jslider-limitless .jslider-label { display: none; }
|
@ -1,3 +0,0 @@
|
||||
|
||||
.jslider_plastic .jslider-bg i,
|
||||
.jslider_plastic .jslider-pointer { background-image: url(../img/jslider.plastic.png); }
|
@ -1,5 +0,0 @@
|
||||
|
||||
.jslider_round .jslider-bg i,
|
||||
.jslider_round .jslider-pointer { background-image: url(../img/jslider.round.png); }
|
||||
|
||||
.jslider_round .jslider-pointer { width: 17px; height: 17px; top: -6px; margin-left: -8px; }
|
@ -1,5 +0,0 @@
|
||||
|
||||
.jslider_round_plastic .jslider-bg i,
|
||||
.jslider_round_plastic .jslider-pointer { background-image: url(../img/jslider.round.plastic.png); }
|
||||
|
||||
.jslider_round_plastic .jslider-pointer { width: 18px; height: 18px; top: -7px; margin-left: -8px; }
|
Before Width: | Height: | Size: 1001 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 832 B |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.8 KiB |
@ -1,152 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>jSlider</title>
|
||||
|
||||
<!-- bin/jquery.slider.min.css -->
|
||||
<link rel="stylesheet" href="css/jslider.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/jslider.blue.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/jslider.plastic.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/jslider.round.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/jslider.round.plastic.css" type="text/css">
|
||||
<!-- end -->
|
||||
|
||||
<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
|
||||
|
||||
<!-- bin/jquery.slider.min.js -->
|
||||
<script type="text/javascript" src="js/jshashtable-2.1_src.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.numberformatter-1.2.3.js"></script>
|
||||
<script type="text/javascript" src="js/tmpl.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.dependClass-0.1.js"></script>
|
||||
<script type="text/javascript" src="js/draggable-0.1.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.slider.js"></script>
|
||||
<!-- end -->
|
||||
|
||||
<style type="text/css" media="screen">
|
||||
body { background: #EEF0F7; }
|
||||
.layout { padding: 50px; font-family: Georgia, serif; }
|
||||
.layout-slider { margin-bottom: 60px; width: 50%; }
|
||||
.layout-slider-settings { font-size: 12px; padding-bottom: 10px; }
|
||||
.layout-slider-settings pre { font-family: Courier; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="layout">
|
||||
|
||||
<div class="layout-slider" style="width: 100%">
|
||||
Slider <span style="display: inline-block; width: 400px; padding: 0 5px;"><input id="Slider1" type="slider" name="price" value="30000.5;60000" /></span> in string
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
jQuery("#Slider1").slider({ from: 1000, to: 100000, step: 500, smooth: true, round: 0, dimension: " $", skin: "plastic" });
|
||||
</script>
|
||||
|
||||
<div class="layout-slider-settings">
|
||||
<pre>{
|
||||
from: 5,
|
||||
to: 50,
|
||||
step: 2.5,
|
||||
round: 1,
|
||||
format: { format: '##.0', locale: 'de' },
|
||||
dimension: '&nbsp;€'
|
||||
}</pre>
|
||||
</div>
|
||||
<div class="layout-slider">
|
||||
<input id="SliderSingle" type="slider" name="price" value="20" />
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
jQuery("#SliderSingle").slider({ from: 5, to: 50, step: 2.5, round: 1, format: { format: '##.0', locale: 'de' }, dimension: ' €', skin: "round" });
|
||||
</script>
|
||||
|
||||
<div class="layout-slider-settings">
|
||||
<pre>{
|
||||
from: 5000,
|
||||
to: 150000,
|
||||
heterogeneity: ['50/50000'],
|
||||
step: 1000,
|
||||
dimension: '&nbsp;$'
|
||||
}</pre>
|
||||
</div>
|
||||
<div class="layout-slider">
|
||||
<input id="Slider2" type="slider" name="price" value="5000;50000" />
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
jQuery("#Slider2").slider({ from: 5000, to: 150000, heterogeneity: ['50/50000'], step: 1000, dimension: ' $' });
|
||||
</script>
|
||||
|
||||
<div class="layout-slider-settings">
|
||||
<pre>{
|
||||
from: 0,
|
||||
to: 500,
|
||||
heterogeneity: ['50/100', '75/250'],
|
||||
scale: [0, '|', 50, '|' , '100', '|', 250, '|', 500],
|
||||
limits: false,
|
||||
step: 1,
|
||||
dimension: '&nbsp;m<small>2</small>'
|
||||
}</pre>
|
||||
</div>
|
||||
<div class="layout-slider">
|
||||
<input id="Slider3" type="slider" name="area" value="25;75" />
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
jQuery("#Slider3").slider({ from: 0, to: 500, heterogeneity: ['50/100', '75/250'], scale: [0, '|', 50, '|', '100', '|', 250, '|', 500], limits: false, step: 1, dimension: ' m<small>2</small>', skin: "round_plastic" });
|
||||
</script>
|
||||
|
||||
<div class="layout-slider-settings">
|
||||
<pre>{
|
||||
from: 1,
|
||||
to: 30,
|
||||
heterogeneity: ['50/5', '75/15'],
|
||||
scale: [1, '|', 3, '|', '5', '|', 15, '|', 30],
|
||||
limits: false,
|
||||
step: 1,
|
||||
dimension: '',
|
||||
skin: "blue"
|
||||
}</pre>
|
||||
</div>
|
||||
<div class="layout-slider">
|
||||
<input id="Slider4" type="slider" name="area" value="2;10" />
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
jQuery("#Slider4").slider({ from: 1, to: 30, heterogeneity: ['50/5', '75/15'], scale: [1, '|', 3, '|', '5', '|', 15, '|', 30], limits: false, step: 1, dimension: '', skin: "blue", callback: function( value ){ console.dir( this ); } });
|
||||
</script>
|
||||
|
||||
|
||||
<div class="layout-slider-settings">
|
||||
<pre>{
|
||||
from: 480,
|
||||
to: 1020,
|
||||
step: 15,
|
||||
dimension: '',
|
||||
scale: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00'],
|
||||
limits: false,
|
||||
calculate: function( value ){
|
||||
var hours = Math.floor( value / 60 );
|
||||
var mins = ( value - hours*60 );
|
||||
return (hours < 10 ? "0"+hours : hours) + ":" + ( mins == 0 ? "00" : mins );
|
||||
},
|
||||
onstatechange: function( value ){
|
||||
console.dir( this );
|
||||
}
|
||||
}</pre>
|
||||
</div>
|
||||
<div class="layout-slider">
|
||||
<input id="Slider5" type="slider" name="area" value="600;720" />
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
|
||||
jQuery("#Slider5").slider({ from: 480, to: 1020, step: 15, dimension: '', scale: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00'], limits: false, calculate: function( value ){
|
||||
var hours = Math.floor( value / 60 );
|
||||
var mins = ( value - hours*60 );
|
||||
return (hours < 10 ? "0"+hours : hours) + ":" + ( mins == 0 ? "00" : mins );
|
||||
}})
|
||||
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,196 +0,0 @@
|
||||
/**
|
||||
* draggable - Class allows to make any element draggable
|
||||
*
|
||||
* Written by
|
||||
* Egor Khmelev (hmelyoff@gmail.com)
|
||||
*
|
||||
* Licensed under the MIT (MIT-LICENSE.txt).
|
||||
*
|
||||
* @author Egor Khmelev
|
||||
* @version 0.1.0-BETA ($Id$)
|
||||
*
|
||||
**/
|
||||
|
||||
(function( $ ){
|
||||
|
||||
function Draggable(){
|
||||
this._init.apply( this, arguments );
|
||||
};
|
||||
|
||||
Draggable.prototype.oninit = function(){
|
||||
|
||||
};
|
||||
|
||||
Draggable.prototype.events = function(){
|
||||
|
||||
};
|
||||
|
||||
Draggable.prototype.onmousedown = function(){
|
||||
this.ptr.css({ position: "absolute" });
|
||||
};
|
||||
|
||||
Draggable.prototype.onmousemove = function( evt, x, y ){
|
||||
this.ptr.css({ left: x, top: y });
|
||||
};
|
||||
|
||||
Draggable.prototype.onmouseup = function(){
|
||||
|
||||
};
|
||||
|
||||
Draggable.prototype.isDefault = {
|
||||
drag: false,
|
||||
clicked: false,
|
||||
toclick: true,
|
||||
mouseup: false
|
||||
};
|
||||
|
||||
Draggable.prototype._init = function(){
|
||||
if( arguments.length > 0 ){
|
||||
this.ptr = $(arguments[0]);
|
||||
this.outer = $(".draggable-outer");
|
||||
|
||||
this.is = {};
|
||||
$.extend( this.is, this.isDefault );
|
||||
|
||||
var _offset = this.ptr.offset();
|
||||
this.d = {
|
||||
left: _offset.left,
|
||||
top: _offset.top,
|
||||
width: this.ptr.width(),
|
||||
height: this.ptr.height()
|
||||
};
|
||||
|
||||
this.oninit.apply( this, arguments );
|
||||
|
||||
this._events();
|
||||
}
|
||||
};
|
||||
|
||||
Draggable.prototype._getPageCoords = function( event ){
|
||||
if( event.targetTouches && event.targetTouches[0] ){
|
||||
return { x: event.targetTouches[0].pageX, y: event.targetTouches[0].pageY };
|
||||
} else
|
||||
return { x: event.pageX, y: event.pageY };
|
||||
};
|
||||
|
||||
Draggable.prototype._bindEvent = function( ptr, eventType, handler ){
|
||||
var self = this;
|
||||
|
||||
if( this.supportTouches_ )
|
||||
ptr.get(0).addEventListener( this.events_[ eventType ], handler, false );
|
||||
|
||||
else
|
||||
ptr.bind( this.events_[ eventType ], handler );
|
||||
};
|
||||
|
||||
Draggable.prototype._events = function(){
|
||||
var self = this;
|
||||
|
||||
this.supportTouches_ = ( $.browser.webkit && navigator.userAgent.indexOf("Mobile") != -1 );
|
||||
this.events_ = {
|
||||
"click": this.supportTouches_ ? "touchstart" : "click",
|
||||
"down": this.supportTouches_ ? "touchstart" : "mousedown",
|
||||
"move": this.supportTouches_ ? "touchmove" : "mousemove",
|
||||
"up" : this.supportTouches_ ? "touchend" : "mouseup"
|
||||
};
|
||||
|
||||
this._bindEvent( $( document ), "move", function( event ){
|
||||
if( self.is.drag ){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
self._mousemove( event );
|
||||
}
|
||||
});
|
||||
this._bindEvent( $( document ), "down", function( event ){
|
||||
if( self.is.drag ){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
this._bindEvent( $( document ), "up", function( event ){
|
||||
self._mouseup( event );
|
||||
});
|
||||
|
||||
this._bindEvent( this.ptr, "down", function( event ){
|
||||
self._mousedown( event );
|
||||
return false;
|
||||
});
|
||||
this._bindEvent( this.ptr, "up", function( event ){
|
||||
self._mouseup( event );
|
||||
});
|
||||
|
||||
this.ptr.find("a")
|
||||
.click(function(){
|
||||
self.is.clicked = true;
|
||||
|
||||
if( !self.is.toclick ){
|
||||
self.is.toclick = true;
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.mousedown(function( event ){
|
||||
self._mousedown( event );
|
||||
return false;
|
||||
});
|
||||
|
||||
this.events();
|
||||
};
|
||||
|
||||
Draggable.prototype._mousedown = function( evt ){
|
||||
this.is.drag = true;
|
||||
this.is.clicked = false;
|
||||
this.is.mouseup = false;
|
||||
|
||||
var _offset = this.ptr.offset();
|
||||
var coords = this._getPageCoords( evt );
|
||||
this.cx = coords.x - _offset.left;
|
||||
this.cy = coords.y - _offset.top;
|
||||
|
||||
$.extend(this.d, {
|
||||
left: _offset.left,
|
||||
top: _offset.top,
|
||||
width: this.ptr.width(),
|
||||
height: this.ptr.height()
|
||||
});
|
||||
|
||||
if( this.outer && this.outer.get(0) ){
|
||||
this.outer.css({ height: Math.max(this.outer.height(), $(document.body).height()), overflow: "hidden" });
|
||||
}
|
||||
|
||||
this.onmousedown( evt );
|
||||
};
|
||||
|
||||
Draggable.prototype._mousemove = function( evt ){
|
||||
this.is.toclick = false;
|
||||
var coords = this._getPageCoords( evt );
|
||||
this.onmousemove( evt, coords.x - this.cx, coords.y - this.cy );
|
||||
};
|
||||
|
||||
Draggable.prototype._mouseup = function( evt ){
|
||||
var oThis = this;
|
||||
|
||||
if( this.is.drag ){
|
||||
this.is.drag = false;
|
||||
|
||||
if( this.outer && this.outer.get(0) ){
|
||||
|
||||
if( $.browser.mozilla ){
|
||||
this.outer.css({ overflow: "hidden" });
|
||||
} else {
|
||||
this.outer.css({ overflow: "visible" });
|
||||
}
|
||||
|
||||
if( $.browser.msie && $.browser.version == '6.0' ){
|
||||
this.outer.css({ height: "100%" });
|
||||
} else {
|
||||
this.outer.css({ height: "auto" });
|
||||
}
|
||||
}
|
||||
|
||||
this.onmouseup( evt );
|
||||
}
|
||||
};
|
||||
|
||||
window.Draggable = Draggable;
|
||||
|
||||
})( jQuery );
|
9266
library/jslider/js/jquery-1.7.1.js
vendored
@ -1,56 +0,0 @@
|
||||
/**
|
||||
* jquery.dependClass - Attach class based on first class in list of current element
|
||||
*
|
||||
* Written by
|
||||
* Egor Khmelev (hmelyoff@gmail.com)
|
||||
*
|
||||
* Licensed under the MIT (MIT-LICENSE.txt).
|
||||
*
|
||||
* @author Egor Khmelev
|
||||
* @version 0.1.0-BETA ($Id$)
|
||||
*
|
||||
**/
|
||||
|
||||
(function($) {
|
||||
$.baseClass = function(obj){
|
||||
obj = $(obj);
|
||||
return obj.get(0).className.match(/([^ ]+)/)[1];
|
||||
};
|
||||
|
||||
$.fn.addDependClass = function(className, delimiter){
|
||||
var options = {
|
||||
delimiter: delimiter ? delimiter : '-'
|
||||
}
|
||||
return this.each(function(){
|
||||
var baseClass = $.baseClass(this);
|
||||
if(baseClass)
|
||||
$(this).addClass(baseClass + options.delimiter + className);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.removeDependClass = function(className, delimiter){
|
||||
var options = {
|
||||
delimiter: delimiter ? delimiter : '-'
|
||||
}
|
||||
return this.each(function(){
|
||||
var baseClass = $.baseClass(this);
|
||||
if(baseClass)
|
||||
$(this).removeClass(baseClass + options.delimiter + className);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.toggleDependClass = function(className, delimiter){
|
||||
var options = {
|
||||
delimiter: delimiter ? delimiter : '-'
|
||||
}
|
||||
return this.each(function(){
|
||||
var baseClass = $.baseClass(this);
|
||||
if(baseClass)
|
||||
if($(this).is("." + baseClass + options.delimiter + className))
|
||||
$(this).removeClass(baseClass + options.delimiter + className);
|
||||
else
|
||||
$(this).addClass(baseClass + options.delimiter + className);
|
||||
});
|
||||
};
|
||||
|
||||
})(jQuery);
|
@ -1,510 +0,0 @@
|
||||
/**
|
||||
* jquery.numberformatter - Formatting/Parsing Numbers in jQuery
|
||||
*
|
||||
* Written by
|
||||
* Michael Abernethy (mike@abernethysoft.com),
|
||||
* Andrew Parry (aparry0@gmail.com)
|
||||
*
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* @author Michael Abernethy, Andrew Parry
|
||||
* @version 1.2.3-SNAPSHOT ($Id$)
|
||||
*
|
||||
* Dependencies
|
||||
*
|
||||
* jQuery (http://jquery.com)
|
||||
* jshashtable (http://www.timdown.co.uk/jshashtable)
|
||||
*
|
||||
* Notes & Thanks
|
||||
*
|
||||
* many thanks to advweb.nanasi.jp for his bug fixes
|
||||
* jsHashtable is now used also, so thanks to the author for that excellent little class.
|
||||
*
|
||||
* This plugin can be used to format numbers as text and parse text as Numbers
|
||||
* Because we live in an international world, we cannot assume that everyone
|
||||
* uses "," to divide thousands, and "." as a decimal point.
|
||||
*
|
||||
* As of 1.2 the way this plugin works has changed slightly, parsing text to a number
|
||||
* has 1 set of functions, formatting a number to text has it's own. Before things
|
||||
* were a little confusing, so I wanted to separate the 2 out more.
|
||||
*
|
||||
*
|
||||
* jQuery extension functions:
|
||||
*
|
||||
* formatNumber(options, writeBack, giveReturnValue) - Reads the value from the subject, parses to
|
||||
* a Javascript Number object, then formats back to text using the passed options and write back to
|
||||
* the subject.
|
||||
*
|
||||
* parseNumber(options) - Parses the value in the subject to a Number object using the passed options
|
||||
* to decipher the actual number from the text, then writes the value as text back to the subject.
|
||||
*
|
||||
*
|
||||
* Generic functions:
|
||||
*
|
||||
* formatNumber(numberString, options) - Takes a plain number as a string (e.g. '1002.0123') and returns
|
||||
* a string of the given format options.
|
||||
*
|
||||
* parseNumber(numberString, options) - Takes a number as text that is formatted the same as the given
|
||||
* options then and returns it as a plain Number object.
|
||||
*
|
||||
* To achieve the old way of combining parsing and formatting to keep say a input field always formatted
|
||||
* to a given format after it has lost focus you'd simply use a combination of the functions.
|
||||
*
|
||||
* e.g.
|
||||
* $("#salary").blur(function(){
|
||||
* $(this).parseNumber({format:"#,###.00", locale:"us"});
|
||||
* $(this).formatNumber({format:"#,###.00", locale:"us"});
|
||||
* });
|
||||
*
|
||||
* The syntax for the formatting is:
|
||||
* 0 = Digit
|
||||
* # = Digit, zero shows as absent
|
||||
* . = Decimal separator
|
||||
* - = Negative sign
|
||||
* , = Grouping Separator
|
||||
* % = Percent (multiplies the number by 100)
|
||||
*
|
||||
* For example, a format of "#,###.00" and text of 4500.20 will
|
||||
* display as "4.500,20" with a locale of "de", and "4,500.20" with a locale of "us"
|
||||
*
|
||||
*
|
||||
* As of now, the only acceptable locales are
|
||||
* Arab Emirates -> "ae"
|
||||
* Australia -> "au"
|
||||
* Austria -> "at"
|
||||
* Brazil -> "br"
|
||||
* Canada -> "ca"
|
||||
* China -> "cn"
|
||||
* Czech -> "cz"
|
||||
* Denmark -> "dk"
|
||||
* Egypt -> "eg"
|
||||
* Finland -> "fi"
|
||||
* France -> "fr"
|
||||
* Germany -> "de"
|
||||
* Greece -> "gr"
|
||||
* Great Britain -> "gb"
|
||||
* Hong Kong -> "hk"
|
||||
* India -> "in"
|
||||
* Israel -> "il"
|
||||
* Japan -> "jp"
|
||||
* Russia -> "ru"
|
||||
* South Korea -> "kr"
|
||||
* Spain -> "es"
|
||||
* Sweden -> "se"
|
||||
* Switzerland -> "ch"
|
||||
* Taiwan -> "tw"
|
||||
* Thailand -> "th"
|
||||
* United States -> "us"
|
||||
* Vietnam -> "vn"
|
||||
**/
|
||||
|
||||
(function(jQuery) {
|
||||
|
||||
var nfLocales = new Hashtable();
|
||||
|
||||
var nfLocalesLikeUS = [ 'ae','au','ca','cn','eg','gb','hk','il','in','jp','sk','th','tw','us' ];
|
||||
var nfLocalesLikeDE = [ 'at','br','de','dk','es','gr','it','nl','pt','tr','vn' ];
|
||||
var nfLocalesLikeFR = [ 'cz','fi','fr','ru','se','pl' ];
|
||||
var nfLocalesLikeCH = [ 'ch' ];
|
||||
|
||||
var nfLocaleFormatting = [ [".", ","], [",", "."], [",", " "], [".", "'"] ];
|
||||
var nfAllLocales = [ nfLocalesLikeUS, nfLocalesLikeDE, nfLocalesLikeFR, nfLocalesLikeCH ]
|
||||
|
||||
function FormatData(dec, group, neg) {
|
||||
this.dec = dec;
|
||||
this.group = group;
|
||||
this.neg = neg;
|
||||
};
|
||||
|
||||
function init() {
|
||||
// write the arrays into the hashtable
|
||||
for (var localeGroupIdx = 0; localeGroupIdx < nfAllLocales.length; localeGroupIdx++) {
|
||||
localeGroup = nfAllLocales[localeGroupIdx];
|
||||
for (var i = 0; i < localeGroup.length; i++) {
|
||||
nfLocales.put(localeGroup[i], localeGroupIdx);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function formatCodes(locale, isFullLocale) {
|
||||
if (nfLocales.size() == 0)
|
||||
init();
|
||||
|
||||
// default values
|
||||
var dec = ".";
|
||||
var group = ",";
|
||||
var neg = "-";
|
||||
|
||||
if (isFullLocale == false) {
|
||||
// Extract and convert to lower-case any language code from a real 'locale' formatted string, if not use as-is
|
||||
// (To prevent locale format like : "fr_FR", "en_US", "de_DE", "fr_FR", "en-US", "de-DE")
|
||||
if (locale.indexOf('_') != -1)
|
||||
locale = locale.split('_')[1].toLowerCase();
|
||||
else if (locale.indexOf('-') != -1)
|
||||
locale = locale.split('-')[1].toLowerCase();
|
||||
}
|
||||
|
||||
// hashtable lookup to match locale with codes
|
||||
var codesIndex = nfLocales.get(locale);
|
||||
if (codesIndex) {
|
||||
var codes = nfLocaleFormatting[codesIndex];
|
||||
if (codes) {
|
||||
dec = codes[0];
|
||||
group = codes[1];
|
||||
}
|
||||
}
|
||||
return new FormatData(dec, group, neg);
|
||||
};
|
||||
|
||||
|
||||
/* Formatting Methods */
|
||||
|
||||
|
||||
/**
|
||||
* Formats anything containing a number in standard js number notation.
|
||||
*
|
||||
* @param {Object} options The formatting options to use
|
||||
* @param {Boolean} writeBack (true) If the output value should be written back to the subject
|
||||
* @param {Boolean} giveReturnValue (true) If the function should return the output string
|
||||
*/
|
||||
jQuery.fn.formatNumber = function(options, writeBack, giveReturnValue) {
|
||||
|
||||
return this.each(function() {
|
||||
// enforce defaults
|
||||
if (writeBack == null)
|
||||
writeBack = true;
|
||||
if (giveReturnValue == null)
|
||||
giveReturnValue = true;
|
||||
|
||||
// get text
|
||||
var text;
|
||||
if (jQuery(this).is(":input"))
|
||||
text = new String(jQuery(this).val());
|
||||
else
|
||||
text = new String(jQuery(this).text());
|
||||
|
||||
// format
|
||||
var returnString = jQuery.formatNumber(text, options);
|
||||
|
||||
// set formatted string back, only if a success
|
||||
// if (returnString) {
|
||||
if (writeBack) {
|
||||
if (jQuery(this).is(":input"))
|
||||
jQuery(this).val(returnString);
|
||||
else
|
||||
jQuery(this).text(returnString);
|
||||
}
|
||||
if (giveReturnValue)
|
||||
return returnString;
|
||||
// }
|
||||
// return '';
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* First parses a string and reformats it with the given options.
|
||||
*
|
||||
* @param {Object} numberString
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery.formatNumber = function(numberString, options){
|
||||
var options = jQuery.extend({}, jQuery.fn.formatNumber.defaults, options);
|
||||
var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
|
||||
|
||||
var dec = formatData.dec;
|
||||
var group = formatData.group;
|
||||
var neg = formatData.neg;
|
||||
|
||||
var validFormat = "0#-,.";
|
||||
|
||||
// strip all the invalid characters at the beginning and the end
|
||||
// of the format, and we'll stick them back on at the end
|
||||
// make a special case for the negative sign "-" though, so
|
||||
// we can have formats like -$23.32
|
||||
var prefix = "";
|
||||
var negativeInFront = false;
|
||||
for (var i = 0; i < options.format.length; i++) {
|
||||
if (validFormat.indexOf(options.format.charAt(i)) == -1)
|
||||
prefix = prefix + options.format.charAt(i);
|
||||
else
|
||||
if (i == 0 && options.format.charAt(i) == '-') {
|
||||
negativeInFront = true;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
var suffix = "";
|
||||
for (var i = options.format.length - 1; i >= 0; i--) {
|
||||
if (validFormat.indexOf(options.format.charAt(i)) == -1)
|
||||
suffix = options.format.charAt(i) + suffix;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
options.format = options.format.substring(prefix.length);
|
||||
options.format = options.format.substring(0, options.format.length - suffix.length);
|
||||
|
||||
// now we need to convert it into a number
|
||||
//while (numberString.indexOf(group) > -1)
|
||||
// numberString = numberString.replace(group, '');
|
||||
//var number = new Number(numberString.replace(dec, ".").replace(neg, "-"));
|
||||
var number = new Number(numberString);
|
||||
|
||||
return jQuery._formatNumber(number, options, suffix, prefix, negativeInFront);
|
||||
};
|
||||
|
||||
/**
|
||||
* Formats a Number object into a string, using the given formatting options
|
||||
*
|
||||
* @param {Object} numberString
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery._formatNumber = function(number, options, suffix, prefix, negativeInFront) {
|
||||
var options = jQuery.extend({}, jQuery.fn.formatNumber.defaults, options);
|
||||
var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
|
||||
|
||||
var dec = formatData.dec;
|
||||
var group = formatData.group;
|
||||
var neg = formatData.neg;
|
||||
|
||||
var forcedToZero = false;
|
||||
if (isNaN(number)) {
|
||||
if (options.nanForceZero == true) {
|
||||
number = 0;
|
||||
forcedToZero = true;
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
// special case for percentages
|
||||
if (suffix == "%")
|
||||
number = number * 100;
|
||||
|
||||
var returnString = "";
|
||||
if (options.format.indexOf(".") > -1) {
|
||||
var decimalPortion = dec;
|
||||
var decimalFormat = options.format.substring(options.format.lastIndexOf(".") + 1);
|
||||
|
||||
// round or truncate number as needed
|
||||
if (options.round == true)
|
||||
number = new Number(number.toFixed(decimalFormat.length));
|
||||
else {
|
||||
var numStr = number.toString();
|
||||
numStr = numStr.substring(0, numStr.lastIndexOf('.') + decimalFormat.length + 1);
|
||||
number = new Number(numStr);
|
||||
}
|
||||
|
||||
var decimalValue = number % 1;
|
||||
var decimalString = new String(decimalValue.toFixed(decimalFormat.length));
|
||||
decimalString = decimalString.substring(decimalString.lastIndexOf(".") + 1);
|
||||
|
||||
for (var i = 0; i < decimalFormat.length; i++) {
|
||||
if (decimalFormat.charAt(i) == '#' && decimalString.charAt(i) != '0') {
|
||||
decimalPortion += decimalString.charAt(i);
|
||||
continue;
|
||||
} else if (decimalFormat.charAt(i) == '#' && decimalString.charAt(i) == '0') {
|
||||
var notParsed = decimalString.substring(i);
|
||||
if (notParsed.match('[1-9]')) {
|
||||
decimalPortion += decimalString.charAt(i);
|
||||
continue;
|
||||
} else
|
||||
break;
|
||||
} else if (decimalFormat.charAt(i) == "0")
|
||||
decimalPortion += decimalString.charAt(i);
|
||||
}
|
||||
returnString += decimalPortion
|
||||
} else
|
||||
number = Math.round(number);
|
||||
|
||||
var ones = Math.floor(number);
|
||||
if (number < 0)
|
||||
ones = Math.ceil(number);
|
||||
|
||||
var onesFormat = "";
|
||||
if (options.format.indexOf(".") == -1)
|
||||
onesFormat = options.format;
|
||||
else
|
||||
onesFormat = options.format.substring(0, options.format.indexOf("."));
|
||||
|
||||
var onePortion = "";
|
||||
if (!(ones == 0 && onesFormat.substr(onesFormat.length - 1) == '#') || forcedToZero) {
|
||||
// find how many digits are in the group
|
||||
var oneText = new String(Math.abs(ones));
|
||||
var groupLength = 9999;
|
||||
if (onesFormat.lastIndexOf(",") != -1)
|
||||
groupLength = onesFormat.length - onesFormat.lastIndexOf(",") - 1;
|
||||
var groupCount = 0;
|
||||
for (var i = oneText.length - 1; i > -1; i--) {
|
||||
onePortion = oneText.charAt(i) + onePortion;
|
||||
groupCount++;
|
||||
if (groupCount == groupLength && i != 0) {
|
||||
onePortion = group + onePortion;
|
||||
groupCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// account for any pre-data padding
|
||||
if (onesFormat.length > onePortion.length) {
|
||||
var padStart = onesFormat.indexOf('0');
|
||||
if (padStart != -1) {
|
||||
var padLen = onesFormat.length - padStart;
|
||||
|
||||
// pad to left with 0's or group char
|
||||
var pos = onesFormat.length - onePortion.length - 1;
|
||||
while (onePortion.length < padLen) {
|
||||
var padChar = onesFormat.charAt(pos);
|
||||
// replace with real group char if needed
|
||||
if (padChar == ',')
|
||||
padChar = group;
|
||||
onePortion = padChar + onePortion;
|
||||
pos--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!onePortion && onesFormat.indexOf('0', onesFormat.length - 1) !== -1)
|
||||
onePortion = '0';
|
||||
|
||||
returnString = onePortion + returnString;
|
||||
|
||||
// handle special case where negative is in front of the invalid characters
|
||||
if (number < 0 && negativeInFront && prefix.length > 0)
|
||||
prefix = neg + prefix;
|
||||
else if (number < 0)
|
||||
returnString = neg + returnString;
|
||||
|
||||
if (!options.decimalSeparatorAlwaysShown) {
|
||||
if (returnString.lastIndexOf(dec) == returnString.length - 1) {
|
||||
returnString = returnString.substring(0, returnString.length - 1);
|
||||
}
|
||||
}
|
||||
returnString = prefix + returnString + suffix;
|
||||
return returnString;
|
||||
};
|
||||
|
||||
|
||||
/* Parsing Methods */
|
||||
|
||||
|
||||
/**
|
||||
* Parses a number of given format from the element and returns a Number object.
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery.fn.parseNumber = function(options, writeBack, giveReturnValue) {
|
||||
// enforce defaults
|
||||
if (writeBack == null)
|
||||
writeBack = true;
|
||||
if (giveReturnValue == null)
|
||||
giveReturnValue = true;
|
||||
|
||||
// get text
|
||||
var text;
|
||||
if (jQuery(this).is(":input"))
|
||||
text = new String(jQuery(this).val());
|
||||
else
|
||||
text = new String(jQuery(this).text());
|
||||
|
||||
// parse text
|
||||
var number = jQuery.parseNumber(text, options);
|
||||
|
||||
if (number) {
|
||||
if (writeBack) {
|
||||
if (jQuery(this).is(":input"))
|
||||
jQuery(this).val(number.toString());
|
||||
else
|
||||
jQuery(this).text(number.toString());
|
||||
}
|
||||
if (giveReturnValue)
|
||||
return number;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Parses a string of given format into a Number object.
|
||||
*
|
||||
* @param {Object} string
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery.parseNumber = function(numberString, options) {
|
||||
var options = jQuery.extend({}, jQuery.fn.parseNumber.defaults, options);
|
||||
var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
|
||||
|
||||
var dec = formatData.dec;
|
||||
var group = formatData.group;
|
||||
var neg = formatData.neg;
|
||||
|
||||
var valid = "1234567890.-";
|
||||
|
||||
// now we need to convert it into a number
|
||||
while (numberString.indexOf(group)>-1)
|
||||
numberString = numberString.replace(group,'');
|
||||
numberString = numberString.replace(dec,".").replace(neg,"-");
|
||||
var validText = "";
|
||||
var hasPercent = false;
|
||||
if (numberString.charAt(numberString.length - 1) == "%" || options.isPercentage == true)
|
||||
hasPercent = true;
|
||||
for (var i=0; i<numberString.length; i++) {
|
||||
if (valid.indexOf(numberString.charAt(i))>-1)
|
||||
validText = validText + numberString.charAt(i);
|
||||
}
|
||||
var number = new Number(validText);
|
||||
if (hasPercent) {
|
||||
number = number / 100;
|
||||
var decimalPos = validText.indexOf('.');
|
||||
if (decimalPos != -1) {
|
||||
var decimalPoints = validText.length - decimalPos - 1;
|
||||
number = number.toFixed(decimalPoints + 2);
|
||||
} else {
|
||||
number = number.toFixed(validText.length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return number;
|
||||
};
|
||||
|
||||
jQuery.fn.parseNumber.defaults = {
|
||||
locale: "us",
|
||||
decimalSeparatorAlwaysShown: false,
|
||||
isPercentage: false,
|
||||
isFullLocale: false
|
||||
};
|
||||
|
||||
jQuery.fn.formatNumber.defaults = {
|
||||
format: "#,###.00",
|
||||
locale: "us",
|
||||
decimalSeparatorAlwaysShown: false,
|
||||
nanForceZero: true,
|
||||
round: true,
|
||||
isFullLocale: false
|
||||
};
|
||||
|
||||
Number.prototype.toFixed = function(precision) {
|
||||
return jQuery._roundNumber(this, precision);
|
||||
};
|
||||
|
||||
jQuery._roundNumber = function(number, decimalPlaces) {
|
||||
var power = Math.pow(10, decimalPlaces || 0);
|
||||
var value = String(Math.round(number * power) / power);
|
||||
|
||||
// ensure the decimal places are there
|
||||
if (decimalPlaces > 0) {
|
||||
var dp = value.indexOf(".");
|
||||
if (dp == -1) {
|
||||
value += '.';
|
||||
dp = 0;
|
||||
} else {
|
||||
dp = value.length - (dp + 1);
|
||||
}
|
||||
|
||||
while (dp < decimalPlaces) {
|
||||
value += '0';
|
||||
dp++;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
})(jQuery);
|
@ -1,700 +0,0 @@
|
||||
/**
|
||||
* jquery.slider - Slider ui control in jQuery
|
||||
*
|
||||
* Written by
|
||||
* Egor Khmelev (hmelyoff@gmail.com)
|
||||
*
|
||||
* Licensed under the MIT (MIT-LICENSE.txt).
|
||||
*
|
||||
* @author Egor Khmelev
|
||||
* @version 1.1.0-RELEASE ($Id$)
|
||||
*
|
||||
* Dependencies
|
||||
*
|
||||
* jQuery (http://jquery.com)
|
||||
* jquery.numberformatter (http://code.google.com/p/jquery-numberformatter/)
|
||||
* tmpl (http://ejohn.org/blog/javascript-micro-templating/)
|
||||
* jquery.dependClass
|
||||
* draggable
|
||||
*
|
||||
**/
|
||||
|
||||
(function( $ ) {
|
||||
|
||||
function isArray( value ){
|
||||
if( typeof value == "undefined" ) return false;
|
||||
|
||||
if (value instanceof Array || (!(value instanceof Object) &&
|
||||
(Object.prototype.toString.call((value)) == '[object Array]') ||
|
||||
typeof value.length == 'number' &&
|
||||
typeof value.splice != 'undefined' &&
|
||||
typeof value.propertyIsEnumerable != 'undefined' &&
|
||||
!value.propertyIsEnumerable('splice')
|
||||
)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$.slider = function( node, settings ){
|
||||
var jNode = $(node);
|
||||
if( !jNode.data( "jslider" ) )
|
||||
jNode.data( "jslider", new jSlider( node, settings ) );
|
||||
|
||||
return jNode.data( "jslider" );
|
||||
};
|
||||
|
||||
$.fn.slider = function( action, opt_value ){
|
||||
var returnValue, args = arguments;
|
||||
|
||||
function isDef( val ){
|
||||
return val !== undefined;
|
||||
};
|
||||
|
||||
function isDefAndNotNull( val ){
|
||||
return val != null;
|
||||
};
|
||||
|
||||
this.each(function(){
|
||||
var self = $.slider( this, action );
|
||||
|
||||
// do actions
|
||||
if( typeof action == "string" ){
|
||||
switch( action ){
|
||||
case "value":
|
||||
if( isDef( args[ 1 ] ) && isDef( args[ 2 ] ) ){
|
||||
var pointers = self.getPointers();
|
||||
if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){
|
||||
pointers[0].set( args[ 1 ] );
|
||||
pointers[0].setIndexOver();
|
||||
}
|
||||
|
||||
if( isDefAndNotNull( pointers[1] ) && isDefAndNotNull( args[2] ) ){
|
||||
pointers[1].set( args[ 2 ] );
|
||||
pointers[1].setIndexOver();
|
||||
}
|
||||
}
|
||||
|
||||
else if( isDef( args[ 1 ] ) ){
|
||||
var pointers = self.getPointers();
|
||||
if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){
|
||||
pointers[0].set( args[ 1 ] );
|
||||
pointers[0].setIndexOver();
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
returnValue = self.getValue();
|
||||
|
||||
break;
|
||||
|
||||
case "prc":
|
||||
if( isDef( args[ 1 ] ) && isDef( args[ 2 ] ) ){
|
||||
var pointers = self.getPointers();
|
||||
if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){
|
||||
pointers[0]._set( args[ 1 ] );
|
||||
pointers[0].setIndexOver();
|
||||
}
|
||||
|
||||
if( isDefAndNotNull( pointers[1] ) && isDefAndNotNull( args[2] ) ){
|
||||
pointers[1]._set( args[ 2 ] );
|
||||
pointers[1].setIndexOver();
|
||||
}
|
||||
}
|
||||
|
||||
else if( isDef( args[ 1 ] ) ){
|
||||
var pointers = self.getPointers();
|
||||
if( isDefAndNotNull( pointers[0] ) && isDefAndNotNull( args[1] ) ){
|
||||
pointers[0]._set( args[ 1 ] );
|
||||
pointers[0].setIndexOver();
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
returnValue = self.getPrcValue();
|
||||
|
||||
break;
|
||||
|
||||
case "calculatedValue":
|
||||
var value = self.getValue().split(";");
|
||||
returnValue = "";
|
||||
for (var i=0; i < value.length; i++) {
|
||||
returnValue += (i > 0 ? ";" : "") + self.nice( value[i] );
|
||||
};
|
||||
|
||||
break;
|
||||
|
||||
case "skin":
|
||||
self.setSkin( args[1] );
|
||||
|
||||
break;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// return actual object
|
||||
else if( !action && !opt_value ){
|
||||
if( !isArray( returnValue ) )
|
||||
returnValue = [];
|
||||
|
||||
returnValue.push( self );
|
||||
}
|
||||
});
|
||||
|
||||
// flatten array just with one slider
|
||||
if( isArray( returnValue ) && returnValue.length == 1 )
|
||||
returnValue = returnValue[ 0 ];
|
||||
|
||||
return returnValue || this;
|
||||
};
|
||||
|
||||
var OPTIONS = {
|
||||
|
||||
settings: {
|
||||
from: 1,
|
||||
to: 10,
|
||||
step: 1,
|
||||
smooth: true,
|
||||
limits: true,
|
||||
round: 0,
|
||||
format: { format: "#,##0.##" },
|
||||
value: "5;7",
|
||||
dimension: ""
|
||||
},
|
||||
|
||||
className: "jslider",
|
||||
selector: ".jslider-",
|
||||
|
||||
template: tmpl(
|
||||
'<span class="<%=className%>">' +
|
||||
'<table><tr><td>' +
|
||||
'<div class="<%=className%>-bg">' +
|
||||
'<i class="l"></i><i class="r"></i>' +
|
||||
'<i class="v"></i>' +
|
||||
'</div>' +
|
||||
|
||||
'<div class="<%=className%>-pointer"></div>' +
|
||||
'<div class="<%=className%>-pointer <%=className%>-pointer-to"></div>' +
|
||||
|
||||
'<div class="<%=className%>-label"><span><%=settings.from%></span></div>' +
|
||||
'<div class="<%=className%>-label <%=className%>-label-to"><span><%=settings.to%></span><%=settings.dimension%></div>' +
|
||||
|
||||
'<div class="<%=className%>-value"><span></span><%=settings.dimension%></div>' +
|
||||
'<div class="<%=className%>-value <%=className%>-value-to"><span></span><%=settings.dimension%></div>' +
|
||||
|
||||
'<div class="<%=className%>-scale"><%=scale%></div>'+
|
||||
|
||||
'</td></tr></table>' +
|
||||
'</span>'
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
function jSlider(){
|
||||
return this.init.apply( this, arguments );
|
||||
};
|
||||
|
||||
jSlider.prototype.init = function( node, settings ){
|
||||
this.settings = $.extend(true, {}, OPTIONS.settings, settings ? settings : {});
|
||||
|
||||
// obj.sliderHandler = this;
|
||||
this.inputNode = $( node ).hide();
|
||||
|
||||
this.settings.interval = this.settings.to-this.settings.from;
|
||||
this.settings.value = this.inputNode.attr("value");
|
||||
|
||||
if( this.settings.calculate && $.isFunction( this.settings.calculate ) )
|
||||
this.nice = this.settings.calculate;
|
||||
|
||||
if( this.settings.onstatechange && $.isFunction( this.settings.onstatechange ) )
|
||||
this.onstatechange = this.settings.onstatechange;
|
||||
|
||||
this.is = {
|
||||
init: false
|
||||
};
|
||||
this.o = {};
|
||||
|
||||
this.create();
|
||||
};
|
||||
|
||||
jSlider.prototype.onstatechange = function(){
|
||||
|
||||
};
|
||||
|
||||
jSlider.prototype.create = function(){
|
||||
var $this = this;
|
||||
|
||||
this.domNode = $( OPTIONS.template({
|
||||
className: OPTIONS.className,
|
||||
settings: {
|
||||
from: this.nice( this.settings.from ),
|
||||
to: this.nice( this.settings.to ),
|
||||
dimension: this.settings.dimension
|
||||
},
|
||||
scale: this.generateScale()
|
||||
}) );
|
||||
|
||||
this.inputNode.after( this.domNode );
|
||||
this.drawScale();
|
||||
|
||||
// set skin class
|
||||
if( this.settings.skin && this.settings.skin.length > 0 )
|
||||
this.setSkin( this.settings.skin );
|
||||
|
||||
this.sizes = {
|
||||
domWidth: this.domNode.width(),
|
||||
domOffset: this.domNode.offset()
|
||||
};
|
||||
|
||||
// find some objects
|
||||
$.extend(this.o, {
|
||||
pointers: {},
|
||||
labels: {
|
||||
0: {
|
||||
o: this.domNode.find(OPTIONS.selector + "value").not(OPTIONS.selector + "value-to")
|
||||
},
|
||||
1: {
|
||||
o: this.domNode.find(OPTIONS.selector + "value").filter(OPTIONS.selector + "value-to")
|
||||
}
|
||||
},
|
||||
limits: {
|
||||
0: this.domNode.find(OPTIONS.selector + "label").not(OPTIONS.selector + "label-to"),
|
||||
1: this.domNode.find(OPTIONS.selector + "label").filter(OPTIONS.selector + "label-to")
|
||||
}
|
||||
});
|
||||
|
||||
$.extend(this.o.labels[0], {
|
||||
value: this.o.labels[0].o.find("span")
|
||||
});
|
||||
|
||||
$.extend(this.o.labels[1], {
|
||||
value: this.o.labels[1].o.find("span")
|
||||
});
|
||||
|
||||
|
||||
if( !$this.settings.value.split(";")[1] ){
|
||||
this.settings.single = true;
|
||||
this.domNode.addDependClass("single");
|
||||
}
|
||||
|
||||
if( !$this.settings.limits )
|
||||
this.domNode.addDependClass("limitless");
|
||||
|
||||
this.domNode.find(OPTIONS.selector + "pointer").each(function( i ){
|
||||
var value = $this.settings.value.split(";")[i];
|
||||
if( value ){
|
||||
$this.o.pointers[i] = new jSliderPointer( this, i, $this );
|
||||
|
||||
var prev = $this.settings.value.split(";")[i-1];
|
||||
if( prev && new Number(value) < new Number(prev) ) value = prev;
|
||||
|
||||
value = value < $this.settings.from ? $this.settings.from : value;
|
||||
value = value > $this.settings.to ? $this.settings.to : value;
|
||||
|
||||
$this.o.pointers[i].set( value, true );
|
||||
}
|
||||
});
|
||||
|
||||
this.o.value = this.domNode.find(".v");
|
||||
this.is.init = true;
|
||||
|
||||
$.each(this.o.pointers, function(i){
|
||||
$this.redraw(this);
|
||||
});
|
||||
|
||||
(function(self){
|
||||
$(window).resize(function(){
|
||||
self.onresize();
|
||||
});
|
||||
})(this);
|
||||
|
||||
};
|
||||
|
||||
jSlider.prototype.setSkin = function( skin ){
|
||||
if( this.skin_ )
|
||||
this.domNode.removeDependClass( this.skin_, "_" );
|
||||
|
||||
this.domNode.addDependClass( this.skin_ = skin, "_" );
|
||||
};
|
||||
|
||||
jSlider.prototype.setPointersIndex = function( i ){
|
||||
$.each(this.getPointers(), function(i){
|
||||
this.index( i );
|
||||
});
|
||||
};
|
||||
|
||||
jSlider.prototype.getPointers = function(){
|
||||
return this.o.pointers;
|
||||
};
|
||||
|
||||
jSlider.prototype.generateScale = function(){
|
||||
if( this.settings.scale && this.settings.scale.length > 0 ){
|
||||
var str = "";
|
||||
var s = this.settings.scale;
|
||||
var prc = Math.round((100/(s.length-1))*10)/10;
|
||||
for( var i=0; i < s.length; i++ ){
|
||||
str += '<span style="left: ' + i*prc + '%">' + ( s[i] != '|' ? '<ins>' + s[i] + '</ins>' : '' ) + '</span>';
|
||||
};
|
||||
return str;
|
||||
} else return "";
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
jSlider.prototype.drawScale = function(){
|
||||
this.domNode.find(OPTIONS.selector + "scale span ins").each(function(){
|
||||
$(this).css({ marginLeft: -$(this).outerWidth()/2 });
|
||||
});
|
||||
};
|
||||
|
||||
jSlider.prototype.onresize = function(){
|
||||
var self = this;
|
||||
this.sizes = {
|
||||
domWidth: this.domNode.width(),
|
||||
domOffset: this.domNode.offset()
|
||||
};
|
||||
|
||||
$.each(this.o.pointers, function(i){
|
||||
self.redraw(this);
|
||||
});
|
||||
};
|
||||
|
||||
jSlider.prototype.update = function(){
|
||||
this.onresize();
|
||||
this.drawScale();
|
||||
};
|
||||
|
||||
jSlider.prototype.limits = function( x, pointer ){
|
||||
// smooth
|
||||
if( !this.settings.smooth ){
|
||||
var step = this.settings.step*100 / ( this.settings.interval );
|
||||
x = Math.round( x/step ) * step;
|
||||
}
|
||||
|
||||
var another = this.o.pointers[1-pointer.uid];
|
||||
if( another && pointer.uid && x < another.value.prc ) x = another.value.prc;
|
||||
if( another && !pointer.uid && x > another.value.prc ) x = another.value.prc;
|
||||
|
||||
// base limit
|
||||
if( x < 0 ) x = 0;
|
||||
if( x > 100 ) x = 100;
|
||||
|
||||
return Math.round( x*10 ) / 10;
|
||||
};
|
||||
|
||||
jSlider.prototype.redraw = function( pointer ){
|
||||
if( !this.is.init ) return false;
|
||||
|
||||
this.setValue();
|
||||
|
||||
// redraw range line
|
||||
if( this.o.pointers[0] && this.o.pointers[1] )
|
||||
this.o.value.css({ left: this.o.pointers[0].value.prc + "%", width: ( this.o.pointers[1].value.prc - this.o.pointers[0].value.prc ) + "%" });
|
||||
|
||||
this.o.labels[pointer.uid].value.html(
|
||||
this.nice(
|
||||
pointer.value.origin
|
||||
)
|
||||
);
|
||||
|
||||
// redraw position of labels
|
||||
this.redrawLabels( pointer );
|
||||
|
||||
};
|
||||
|
||||
jSlider.prototype.redrawLabels = function( pointer ){
|
||||
|
||||
function setPosition( label, sizes, prc ){
|
||||
sizes.margin = -sizes.label/2;
|
||||
|
||||
// left limit
|
||||
label_left = sizes.border + sizes.margin;
|
||||
if( label_left < 0 )
|
||||
sizes.margin -= label_left;
|
||||
|
||||
// right limit
|
||||
if( sizes.border+sizes.label / 2 > self.sizes.domWidth ){
|
||||
sizes.margin = 0;
|
||||
sizes.right = true;
|
||||
} else
|
||||
sizes.right = false;
|
||||
|
||||
label.o.css({ left: prc + "%", marginLeft: sizes.margin, right: "auto" });
|
||||
if( sizes.right ) label.o.css({ left: "auto", right: 0 });
|
||||
return sizes;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
var label = this.o.labels[pointer.uid];
|
||||
var prc = pointer.value.prc;
|
||||
|
||||
var sizes = {
|
||||
label: label.o.outerWidth(),
|
||||
right: false,
|
||||
border: ( prc * this.sizes.domWidth ) / 100
|
||||
};
|
||||
|
||||
if( !this.settings.single ){
|
||||
// glue if near;
|
||||
var another = this.o.pointers[1-pointer.uid];
|
||||
var another_label = this.o.labels[another.uid];
|
||||
|
||||
switch( pointer.uid ){
|
||||
case 0:
|
||||
if( sizes.border+sizes.label / 2 > another_label.o.offset().left-this.sizes.domOffset.left ){
|
||||
another_label.o.css({ visibility: "hidden" });
|
||||
another_label.value.html( this.nice( another.value.origin ) );
|
||||
|
||||
label.o.css({ visibility: "visible" });
|
||||
|
||||
prc = ( another.value.prc - prc ) / 2 + prc;
|
||||
if( another.value.prc != pointer.value.prc ){
|
||||
label.value.html( this.nice(pointer.value.origin) + " – " + this.nice(another.value.origin) );
|
||||
sizes.label = label.o.outerWidth();
|
||||
sizes.border = ( prc * this.sizes.domWidth ) / 100;
|
||||
}
|
||||
} else {
|
||||
another_label.o.css({ visibility: "visible" });
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if( sizes.border - sizes.label / 2 < another_label.o.offset().left - this.sizes.domOffset.left + another_label.o.outerWidth() ){
|
||||
another_label.o.css({ visibility: "hidden" });
|
||||
another_label.value.html( this.nice(another.value.origin) );
|
||||
|
||||
label.o.css({ visibility: "visible" });
|
||||
|
||||
prc = ( prc - another.value.prc ) / 2 + another.value.prc;
|
||||
if( another.value.prc != pointer.value.prc ){
|
||||
label.value.html( this.nice(another.value.origin) + " – " + this.nice(pointer.value.origin) );
|
||||
sizes.label = label.o.outerWidth();
|
||||
sizes.border = ( prc * this.sizes.domWidth ) / 100;
|
||||
}
|
||||
} else {
|
||||
another_label.o.css({ visibility: "visible" });
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sizes = setPosition( label, sizes, prc );
|
||||
|
||||
/* draw second label */
|
||||
if( another_label ){
|
||||
var sizes = {
|
||||
label: another_label.o.outerWidth(),
|
||||
right: false,
|
||||
border: ( another.value.prc * this.sizes.domWidth ) / 100
|
||||
};
|
||||
sizes = setPosition( another_label, sizes, another.value.prc );
|
||||
}
|
||||
|
||||
this.redrawLimits();
|
||||
};
|
||||
|
||||
jSlider.prototype.redrawLimits = function(){
|
||||
if( this.settings.limits ){
|
||||
|
||||
var limits = [ true, true ];
|
||||
|
||||
for( key in this.o.pointers ){
|
||||
|
||||
if( !this.settings.single || key == 0 ){
|
||||
|
||||
var pointer = this.o.pointers[key];
|
||||
var label = this.o.labels[pointer.uid];
|
||||
var label_left = label.o.offset().left - this.sizes.domOffset.left;
|
||||
|
||||
var limit = this.o.limits[0];
|
||||
if( label_left < limit.outerWidth() )
|
||||
limits[0] = false;
|
||||
|
||||
var limit = this.o.limits[1];
|
||||
if( label_left + label.o.outerWidth() > this.sizes.domWidth - limit.outerWidth() )
|
||||
limits[1] = false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
for( var i=0; i < limits.length; i++ ){
|
||||
if( limits[i] )
|
||||
this.o.limits[i].fadeIn("fast");
|
||||
else
|
||||
this.o.limits[i].fadeOut("fast");
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
jSlider.prototype.setValue = function(){
|
||||
var value = this.getValue();
|
||||
this.inputNode.attr( "value", value );
|
||||
this.onstatechange.call( this, value );
|
||||
};
|
||||
|
||||
jSlider.prototype.getValue = function(){
|
||||
if(!this.is.init) return false;
|
||||
var $this = this;
|
||||
|
||||
var value = "";
|
||||
$.each( this.o.pointers, function(i){
|
||||
if( this.value.prc != undefined && !isNaN(this.value.prc) ) value += (i > 0 ? ";" : "") + $this.prcToValue( this.value.prc );
|
||||
});
|
||||
return value;
|
||||
};
|
||||
|
||||
jSlider.prototype.getPrcValue = function(){
|
||||
if(!this.is.init) return false;
|
||||
var $this = this;
|
||||
|
||||
var value = "";
|
||||
$.each( this.o.pointers, function(i){
|
||||
if( this.value.prc != undefined && !isNaN(this.value.prc) ) value += (i > 0 ? ";" : "") + this.value.prc;
|
||||
});
|
||||
return value;
|
||||
};
|
||||
|
||||
jSlider.prototype.prcToValue = function( prc ){
|
||||
|
||||
if( this.settings.heterogeneity && this.settings.heterogeneity.length > 0 ){
|
||||
var h = this.settings.heterogeneity;
|
||||
|
||||
var _start = 0;
|
||||
var _from = this.settings.from;
|
||||
|
||||
for( var i=0; i <= h.length; i++ ){
|
||||
if( h[i] ) var v = h[i].split("/");
|
||||
else var v = [100, this.settings.to];
|
||||
|
||||
v[0] = new Number(v[0]);
|
||||
v[1] = new Number(v[1]);
|
||||
|
||||
if( prc >= _start && prc <= v[0] ) {
|
||||
var value = _from + ( (prc-_start) * (v[1]-_from) ) / (v[0]-_start);
|
||||
}
|
||||
|
||||
_start = v[0];
|
||||
_from = v[1];
|
||||
};
|
||||
|
||||
} else {
|
||||
var value = this.settings.from + ( prc * this.settings.interval ) / 100;
|
||||
}
|
||||
|
||||
return this.round( value );
|
||||
};
|
||||
|
||||
jSlider.prototype.valueToPrc = function( value, pointer ){
|
||||
if( this.settings.heterogeneity && this.settings.heterogeneity.length > 0 ){
|
||||
var h = this.settings.heterogeneity;
|
||||
|
||||
var _start = 0;
|
||||
var _from = this.settings.from;
|
||||
|
||||
for (var i=0; i <= h.length; i++) {
|
||||
if(h[i]) var v = h[i].split("/");
|
||||
else var v = [100, this.settings.to];
|
||||
v[0] = new Number(v[0]); v[1] = new Number(v[1]);
|
||||
|
||||
if(value >= _from && value <= v[1]){
|
||||
var prc = pointer.limits(_start + (value-_from)*(v[0]-_start)/(v[1]-_from));
|
||||
}
|
||||
|
||||
_start = v[0]; _from = v[1];
|
||||
};
|
||||
|
||||
} else {
|
||||
var prc = pointer.limits((value-this.settings.from)*100/this.settings.interval);
|
||||
}
|
||||
|
||||
return prc;
|
||||
};
|
||||
|
||||
jSlider.prototype.round = function( value ){
|
||||
value = Math.round( value / this.settings.step ) * this.settings.step;
|
||||
if( this.settings.round ) value = Math.round( value * Math.pow(10, this.settings.round) ) / Math.pow(10, this.settings.round);
|
||||
else value = Math.round( value );
|
||||
return value;
|
||||
};
|
||||
|
||||
jSlider.prototype.nice = function( value ){
|
||||
value = value.toString().replace(/,/gi, ".").replace(/ /gi, "");;
|
||||
|
||||
if( $.formatNumber ){
|
||||
return $.formatNumber( new Number(value), this.settings.format || {} ).replace( /-/gi, "−" );
|
||||
}
|
||||
|
||||
else {
|
||||
return new Number(value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function jSliderPointer(){
|
||||
Draggable.apply( this, arguments );
|
||||
}
|
||||
jSliderPointer.prototype = new Draggable();
|
||||
|
||||
jSliderPointer.prototype.oninit = function( ptr, id, _constructor ){
|
||||
this.uid = id;
|
||||
this.parent = _constructor;
|
||||
this.value = {};
|
||||
this.settings = this.parent.settings;
|
||||
};
|
||||
|
||||
jSliderPointer.prototype.onmousedown = function(evt){
|
||||
this._parent = {
|
||||
offset: this.parent.domNode.offset(),
|
||||
width: this.parent.domNode.width()
|
||||
};
|
||||
this.ptr.addDependClass("hover");
|
||||
this.setIndexOver();
|
||||
};
|
||||
|
||||
jSliderPointer.prototype.onmousemove = function( evt, x ){
|
||||
var coords = this._getPageCoords( evt );
|
||||
this._set( this.calc( coords.x ) );
|
||||
};
|
||||
|
||||
jSliderPointer.prototype.onmouseup = function( evt ){
|
||||
if( this.parent.settings.callback && $.isFunction(this.parent.settings.callback) )
|
||||
this.parent.settings.callback.call( this.parent, this.parent.getValue() );
|
||||
|
||||
this.ptr.removeDependClass("hover");
|
||||
};
|
||||
|
||||
jSliderPointer.prototype.setIndexOver = function(){
|
||||
this.parent.setPointersIndex( 1 );
|
||||
this.index( 2 );
|
||||
};
|
||||
|
||||
jSliderPointer.prototype.index = function( i ){
|
||||
this.ptr.css({ zIndex: i });
|
||||
};
|
||||
|
||||
jSliderPointer.prototype.limits = function( x ){
|
||||
return this.parent.limits( x, this );
|
||||
};
|
||||
|
||||
jSliderPointer.prototype.calc = function(coords){
|
||||
var x = this.limits(((coords-this._parent.offset.left)*100)/this._parent.width);
|
||||
return x;
|
||||
};
|
||||
|
||||
jSliderPointer.prototype.set = function( value, opt_origin ){
|
||||
this.value.origin = this.parent.round(value);
|
||||
this._set( this.parent.valueToPrc( value, this ), opt_origin );
|
||||
};
|
||||
|
||||
jSliderPointer.prototype._set = function( prc, opt_origin ){
|
||||
if( !opt_origin )
|
||||
this.value.origin = this.parent.prcToValue(prc);
|
||||
|
||||
this.value.prc = prc;
|
||||
this.ptr.css({ left: prc + "%" });
|
||||
this.parent.redraw(this);
|
||||
};
|
||||
|
||||
})(jQuery);
|
@ -1,370 +0,0 @@
|
||||
/**
|
||||
* Copyright 2010 Tim Down.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* jshashtable
|
||||
*
|
||||
* jshashtable is a JavaScript implementation of a hash table. It creates a single constructor function called Hashtable
|
||||
* in the global scope.
|
||||
*
|
||||
* Author: Tim Down <tim@timdown.co.uk>
|
||||
* Version: 2.1
|
||||
* Build date: 21 March 2010
|
||||
* Website: http://www.timdown.co.uk/jshashtable
|
||||
*/
|
||||
|
||||
var Hashtable = (function() {
|
||||
var FUNCTION = "function";
|
||||
|
||||
var arrayRemoveAt = (typeof Array.prototype.splice == FUNCTION) ?
|
||||
function(arr, idx) {
|
||||
arr.splice(idx, 1);
|
||||
} :
|
||||
|
||||
function(arr, idx) {
|
||||
var itemsAfterDeleted, i, len;
|
||||
if (idx === arr.length - 1) {
|
||||
arr.length = idx;
|
||||
} else {
|
||||
itemsAfterDeleted = arr.slice(idx + 1);
|
||||
arr.length = idx;
|
||||
for (i = 0, len = itemsAfterDeleted.length; i < len; ++i) {
|
||||
arr[idx + i] = itemsAfterDeleted[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function hashObject(obj) {
|
||||
var hashCode;
|
||||
if (typeof obj == "string") {
|
||||
return obj;
|
||||
} else if (typeof obj.hashCode == FUNCTION) {
|
||||
// Check the hashCode method really has returned a string
|
||||
hashCode = obj.hashCode();
|
||||
return (typeof hashCode == "string") ? hashCode : hashObject(hashCode);
|
||||
} else if (typeof obj.toString == FUNCTION) {
|
||||
return obj.toString();
|
||||
} else {
|
||||
try {
|
||||
return String(obj);
|
||||
} catch (ex) {
|
||||
// For host objects (such as ActiveObjects in IE) that have no toString() method and throw an error when
|
||||
// passed to String()
|
||||
return Object.prototype.toString.call(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function equals_fixedValueHasEquals(fixedValue, variableValue) {
|
||||
return fixedValue.equals(variableValue);
|
||||
}
|
||||
|
||||
function equals_fixedValueNoEquals(fixedValue, variableValue) {
|
||||
return (typeof variableValue.equals == FUNCTION) ?
|
||||
variableValue.equals(fixedValue) : (fixedValue === variableValue);
|
||||
}
|
||||
|
||||
function createKeyValCheck(kvStr) {
|
||||
return function(kv) {
|
||||
if (kv === null) {
|
||||
throw new Error("null is not a valid " + kvStr);
|
||||
} else if (typeof kv == "undefined") {
|
||||
throw new Error(kvStr + " must not be undefined");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var checkKey = createKeyValCheck("key"), checkValue = createKeyValCheck("value");
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
function Bucket(hash, firstKey, firstValue, equalityFunction) {
|
||||
this[0] = hash;
|
||||
this.entries = [];
|
||||
this.addEntry(firstKey, firstValue);
|
||||
|
||||
if (equalityFunction !== null) {
|
||||
this.getEqualityFunction = function() {
|
||||
return equalityFunction;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
var EXISTENCE = 0, ENTRY = 1, ENTRY_INDEX_AND_VALUE = 2;
|
||||
|
||||
function createBucketSearcher(mode) {
|
||||
return function(key) {
|
||||
var i = this.entries.length, entry, equals = this.getEqualityFunction(key);
|
||||
while (i--) {
|
||||
entry = this.entries[i];
|
||||
if ( equals(key, entry[0]) ) {
|
||||
switch (mode) {
|
||||
case EXISTENCE:
|
||||
return true;
|
||||
case ENTRY:
|
||||
return entry;
|
||||
case ENTRY_INDEX_AND_VALUE:
|
||||
return [ i, entry[1] ];
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
function createBucketLister(entryProperty) {
|
||||
return function(aggregatedArr) {
|
||||
var startIndex = aggregatedArr.length;
|
||||
for (var i = 0, len = this.entries.length; i < len; ++i) {
|
||||
aggregatedArr[startIndex + i] = this.entries[i][entryProperty];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Bucket.prototype = {
|
||||
getEqualityFunction: function(searchValue) {
|
||||
return (typeof searchValue.equals == FUNCTION) ? equals_fixedValueHasEquals : equals_fixedValueNoEquals;
|
||||
},
|
||||
|
||||
getEntryForKey: createBucketSearcher(ENTRY),
|
||||
|
||||
getEntryAndIndexForKey: createBucketSearcher(ENTRY_INDEX_AND_VALUE),
|
||||
|
||||
removeEntryForKey: function(key) {
|
||||
var result = this.getEntryAndIndexForKey(key);
|
||||
if (result) {
|
||||
arrayRemoveAt(this.entries, result[0]);
|
||||
return result[1];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
addEntry: function(key, value) {
|
||||
this.entries[this.entries.length] = [key, value];
|
||||
},
|
||||
|
||||
keys: createBucketLister(0),
|
||||
|
||||
values: createBucketLister(1),
|
||||
|
||||
getEntries: function(entries) {
|
||||
var startIndex = entries.length;
|
||||
for (var i = 0, len = this.entries.length; i < len; ++i) {
|
||||
// Clone the entry stored in the bucket before adding to array
|
||||
entries[startIndex + i] = this.entries[i].slice(0);
|
||||
}
|
||||
},
|
||||
|
||||
containsKey: createBucketSearcher(EXISTENCE),
|
||||
|
||||
containsValue: function(value) {
|
||||
var i = this.entries.length;
|
||||
while (i--) {
|
||||
if ( value === this.entries[i][1] ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// Supporting functions for searching hashtable buckets
|
||||
|
||||
function searchBuckets(buckets, hash) {
|
||||
var i = buckets.length, bucket;
|
||||
while (i--) {
|
||||
bucket = buckets[i];
|
||||
if (hash === bucket[0]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function getBucketForHash(bucketsByHash, hash) {
|
||||
var bucket = bucketsByHash[hash];
|
||||
|
||||
// Check that this is a genuine bucket and not something inherited from the bucketsByHash's prototype
|
||||
return ( bucket && (bucket instanceof Bucket) ) ? bucket : null;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
function Hashtable(hashingFunctionParam, equalityFunctionParam) {
|
||||
var that = this;
|
||||
var buckets = [];
|
||||
var bucketsByHash = {};
|
||||
|
||||
var hashingFunction = (typeof hashingFunctionParam == FUNCTION) ? hashingFunctionParam : hashObject;
|
||||
var equalityFunction = (typeof equalityFunctionParam == FUNCTION) ? equalityFunctionParam : null;
|
||||
|
||||
this.put = function(key, value) {
|
||||
checkKey(key);
|
||||
checkValue(value);
|
||||
var hash = hashingFunction(key), bucket, bucketEntry, oldValue = null;
|
||||
|
||||
// Check if a bucket exists for the bucket key
|
||||
bucket = getBucketForHash(bucketsByHash, hash);
|
||||
if (bucket) {
|
||||
// Check this bucket to see if it already contains this key
|
||||
bucketEntry = bucket.getEntryForKey(key);
|
||||
if (bucketEntry) {
|
||||
// This bucket entry is the current mapping of key to value, so replace old value and we're done.
|
||||
oldValue = bucketEntry[1];
|
||||
bucketEntry[1] = value;
|
||||
} else {
|
||||
// The bucket does not contain an entry for this key, so add one
|
||||
bucket.addEntry(key, value);
|
||||
}
|
||||
} else {
|
||||
// No bucket exists for the key, so create one and put our key/value mapping in
|
||||
bucket = new Bucket(hash, key, value, equalityFunction);
|
||||
buckets[buckets.length] = bucket;
|
||||
bucketsByHash[hash] = bucket;
|
||||
}
|
||||
return oldValue;
|
||||
};
|
||||
|
||||
this.get = function(key) {
|
||||
checkKey(key);
|
||||
|
||||
var hash = hashingFunction(key);
|
||||
|
||||
// Check if a bucket exists for the bucket key
|
||||
var bucket = getBucketForHash(bucketsByHash, hash);
|
||||
if (bucket) {
|
||||
// Check this bucket to see if it contains this key
|
||||
var bucketEntry = bucket.getEntryForKey(key);
|
||||
if (bucketEntry) {
|
||||
// This bucket entry is the current mapping of key to value, so return the value.
|
||||
return bucketEntry[1];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
this.containsKey = function(key) {
|
||||
checkKey(key);
|
||||
var bucketKey = hashingFunction(key);
|
||||
|
||||
// Check if a bucket exists for the bucket key
|
||||
var bucket = getBucketForHash(bucketsByHash, bucketKey);
|
||||
|
||||
return bucket ? bucket.containsKey(key) : false;
|
||||
};
|
||||
|
||||
this.containsValue = function(value) {
|
||||
checkValue(value);
|
||||
var i = buckets.length;
|
||||
while (i--) {
|
||||
if (buckets[i].containsValue(value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
this.clear = function() {
|
||||
buckets.length = 0;
|
||||
bucketsByHash = {};
|
||||
};
|
||||
|
||||
this.isEmpty = function() {
|
||||
return !buckets.length;
|
||||
};
|
||||
|
||||
var createBucketAggregator = function(bucketFuncName) {
|
||||
return function() {
|
||||
var aggregated = [], i = buckets.length;
|
||||
while (i--) {
|
||||
buckets[i][bucketFuncName](aggregated);
|
||||
}
|
||||
return aggregated;
|
||||
};
|
||||
};
|
||||
|
||||
this.keys = createBucketAggregator("keys");
|
||||
this.values = createBucketAggregator("values");
|
||||
this.entries = createBucketAggregator("getEntries");
|
||||
|
||||
this.remove = function(key) {
|
||||
checkKey(key);
|
||||
|
||||
var hash = hashingFunction(key), bucketIndex, oldValue = null;
|
||||
|
||||
// Check if a bucket exists for the bucket key
|
||||
var bucket = getBucketForHash(bucketsByHash, hash);
|
||||
|
||||
if (bucket) {
|
||||
// Remove entry from this bucket for this key
|
||||
oldValue = bucket.removeEntryForKey(key);
|
||||
if (oldValue !== null) {
|
||||
// Entry was removed, so check if bucket is empty
|
||||
if (!bucket.entries.length) {
|
||||
// Bucket is empty, so remove it from the bucket collections
|
||||
bucketIndex = searchBuckets(buckets, hash);
|
||||
arrayRemoveAt(buckets, bucketIndex);
|
||||
delete bucketsByHash[hash];
|
||||
}
|
||||
}
|
||||
}
|
||||
return oldValue;
|
||||
};
|
||||
|
||||
this.size = function() {
|
||||
var total = 0, i = buckets.length;
|
||||
while (i--) {
|
||||
total += buckets[i].entries.length;
|
||||
}
|
||||
return total;
|
||||
};
|
||||
|
||||
this.each = function(callback) {
|
||||
var entries = that.entries(), i = entries.length, entry;
|
||||
while (i--) {
|
||||
entry = entries[i];
|
||||
callback(entry[0], entry[1]);
|
||||
}
|
||||
};
|
||||
|
||||
this.putAll = function(hashtable, conflictCallback) {
|
||||
var entries = hashtable.entries();
|
||||
var entry, key, value, thisValue, i = entries.length;
|
||||
var hasConflictCallback = (typeof conflictCallback == FUNCTION);
|
||||
while (i--) {
|
||||
entry = entries[i];
|
||||
key = entry[0];
|
||||
value = entry[1];
|
||||
|
||||
// Check for a conflict. The default behaviour is to overwrite the value for an existing key
|
||||
if ( hasConflictCallback && (thisValue = that.get(key)) ) {
|
||||
value = conflictCallback(key, thisValue, value);
|
||||
}
|
||||
that.put(key, value);
|
||||
}
|
||||
};
|
||||
|
||||
this.clone = function() {
|
||||
var clone = new Hashtable(hashingFunctionParam, equalityFunctionParam);
|
||||
clone.putAll(that);
|
||||
return clone;
|
||||
};
|
||||
}
|
||||
|
||||
return Hashtable;
|
||||
})();
|
@ -1,35 +0,0 @@
|
||||
// Simple JavaScript Templating
|
||||
// John Resig - http://ejohn.org/ - MIT Licensed
|
||||
(function(){
|
||||
var cache = {};
|
||||
|
||||
this.tmpl = function tmpl(str, data){
|
||||
// Figure out if we're getting a template, or if we need to
|
||||
// load the template - and be sure to cache the result.
|
||||
var fn = !/\W/.test(str) ?
|
||||
cache[str] = cache[str] ||
|
||||
tmpl(document.getElementById(str).innerHTML) :
|
||||
|
||||
// Generate a reusable function that will serve as a template
|
||||
// generator (and which will be cached).
|
||||
new Function("obj",
|
||||
"var p=[],print=function(){p.push.apply(p,arguments);};" +
|
||||
|
||||
// Introduce the data as local variables using with(){}
|
||||
"with(obj){p.push('" +
|
||||
|
||||
// Convert the template into pure JavaScript
|
||||
str
|
||||
.replace(/[\r\t\n]/g, " ")
|
||||
.split("<%").join("\t")
|
||||
.replace(/((^|%>)[^\t]*)'/g, "$1\r")
|
||||
.replace(/\t=(.*?)%>/g, "',$1,'")
|
||||
.split("\t").join("');")
|
||||
.split("%>").join("p.push('")
|
||||
.split("\r").join("\\'")
|
||||
+ "');}return p.join('');");
|
||||
|
||||
// Provide some basic currying to the user
|
||||
return data ? fn( data ) : fn;
|
||||
};
|
||||
})();
|
@ -1,53 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>jSlider Show/hide test</title>
|
||||
|
||||
<!-- bin/jquery.slider.min.css -->
|
||||
<link rel="stylesheet" href="../css/jslider.css" type="text/css">
|
||||
<link rel="stylesheet" href="../css/jslider.plastic.css" type="text/css">
|
||||
<!-- end -->
|
||||
|
||||
<script type="text/javascript" src="../js/jquery-1.7.1.js"></script>
|
||||
|
||||
<!-- bin/jquery.slider.min.js -->
|
||||
<script type="text/javascript" src="../js/jshashtable-2.1_src.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.numberformatter-1.2.3.js"></script>
|
||||
<script type="text/javascript" src="../js/tmpl.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.dependClass-0.1.js"></script>
|
||||
<script type="text/javascript" src="../js/draggable-0.1.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.slider.js"></script>
|
||||
<!-- end -->
|
||||
|
||||
<style type="text/css" media="screen">
|
||||
body { background: #EEF0F7; }
|
||||
.layout { padding: 50px; font-family: Georgia, serif; }
|
||||
.layout-slider { margin-bottom: 60px; width: 50%; padding: 20px 0; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="layout">
|
||||
|
||||
<div class="layout-slider" style="width: 100%; display: none;">
|
||||
Slider <span style="display: inline-block; width: 400px; padding: 0 5px;"><input id="Slider3" type="text" name="area" value="25;75" /></span> in string
|
||||
</div>
|
||||
<a href="#" id="trigger">Show/Hide</a>
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
var layout = $(".layout-slider"),
|
||||
trigger = $("#trigger");
|
||||
|
||||
jQuery("#Slider3").slider({ from: 0, to: 500, heterogeneity: ['50/100', '75/250'], scale: [0, '|', 50, '|', '100', '|', 250, '|', 500], limits: false, step: 1, dimension: ' m<small>2</small>', skin: "plastic" });
|
||||
|
||||
$(trigger).click( function(){
|
||||
layout.slideToggle("fast");
|
||||
$("#Slider3").slider().update();
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,64 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>jSlider Zero value test</title>
|
||||
|
||||
<!-- bin/jquery.slider.min.css -->
|
||||
<link rel="stylesheet" href="../css/jslider.css" type="text/css">
|
||||
<link rel="stylesheet" href="../css/jslider.plastic.css" type="text/css">
|
||||
<!-- end -->
|
||||
|
||||
<script type="text/javascript" src="../js/jquery-1.7.1.js"></script>
|
||||
|
||||
<!-- bin/jquery.slider.min.js -->
|
||||
<script type="text/javascript" src="../js/jshashtable-2.1_src.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.numberformatter-1.2.3.js"></script>
|
||||
<script type="text/javascript" src="../js/tmpl.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.dependClass-0.1.js"></script>
|
||||
<script type="text/javascript" src="../js/draggable-0.1.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.slider.js"></script>
|
||||
<!-- end -->
|
||||
|
||||
<style type="text/css" media="screen">
|
||||
body { background: #EEF0F7; }
|
||||
.layout { padding: 50px; font-family: Georgia, serif; }
|
||||
.layout-slider { margin-bottom: 60px; width: 50%; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="layout">
|
||||
|
||||
<div class="layout-slider" style="width: 100%">
|
||||
Slider <span style="display: inline-block; width: 400px; padding: 0 5px;"><input id="Slider1" type="slider" name="price" value="50" /></span> in string
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
jQuery("#Slider1").slider({
|
||||
from: -50,
|
||||
to: 200,
|
||||
step: 5,
|
||||
dimension: '%',
|
||||
skin: 'plastic',
|
||||
scale: ['-50', '|', '0', '|', '50', '|', '100', '|', '150', '|', '200']
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="layout-slider" style="width: 100%">
|
||||
Slider <span style="display: inline-block; width: 400px; padding: 0 5px;"><input id="Slider2" type="slider" name="price" value="-0.5;0.5" /></span> in string
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
jQuery("#Slider2").slider({
|
||||
from: -1,
|
||||
to: 1,
|
||||
step: 0.1,
|
||||
round: 1,
|
||||
dimension: 'px',
|
||||
skin: 'plastic'
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
71
view/js/jquery-compat.js
vendored
@ -1,71 +0,0 @@
|
||||
|
||||
// provide jquery.browser so we can get rid of the migration toolkit
|
||||
|
||||
jQuery.uaMatch = function( ua ) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(msie) ([\w.]+)/.exec( ua ) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
||||
[];
|
||||
|
||||
return {
|
||||
browser: match[ 1 ] || "",
|
||||
version: match[ 2 ] || "0"
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Don't clobber any existing jQuery.browser in case it's different
|
||||
if ( !jQuery.browser ) {
|
||||
matched = jQuery.uaMatch( navigator.userAgent );
|
||||
browser = {};
|
||||
|
||||
if ( matched.browser ) {
|
||||
browser[ matched.browser ] = true;
|
||||
browser.version = matched.version;
|
||||
}
|
||||
|
||||
// Chrome is Webkit, but Webkit is also Safari.
|
||||
if ( browser.chrome ) {
|
||||
browser.webkit = true;
|
||||
} else if ( browser.webkit ) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
jQuery.browser = browser;
|
||||
}
|
||||
|
||||
jQuery.fn.toggle = function( fn, fn2 ) {
|
||||
|
||||
// Don't mess with animation or css toggles
|
||||
if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
|
||||
return oldToggle.apply( this, arguments );
|
||||
}
|
||||
|
||||
// Save reference to arguments for access in closure
|
||||
var args = arguments,
|
||||
guid = fn.guid || jQuery.guid++,
|
||||
i = 0,
|
||||
toggler = function( event ) {
|
||||
// Figure out which function to execute
|
||||
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
|
||||
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
|
||||
|
||||
// Make sure that clicks stop
|
||||
event.preventDefault();
|
||||
|
||||
// and execute the function
|
||||
return args[ lastToggle ].apply( this, arguments ) || false;
|
||||
};
|
||||
|
||||
// link all the functions, so any of them can unbind this click handler
|
||||
toggler.guid = guid;
|
||||
while ( i < args.length ) {
|
||||
args[ i++ ].guid = guid;
|
||||
}
|
||||
|
||||
return this.click( toggler );
|
||||
};
|