mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Merging the updated Limesurvey 1.92+ branch of queXS to trunk
This commit is contained in:
@@ -1,80 +1,80 @@
|
||||
*{ font-family:Arial, Helvetica, sans-serif; margin:0; padding:0; outline:none; }
|
||||
form{ padding:0/*!important*/; margin:0/*!important*/; }
|
||||
img{ border:0; }
|
||||
ul,ol{ padding:2px 5px; margin:0 0 0 20px; }
|
||||
|
||||
body{ font-size:72%; color: #333; background:#fff; margin:0px; padding:0px; }
|
||||
h1{ color:#333; font-size:140%; float:left; width:auto; margin:0px 5px 0 0; }
|
||||
h2{ color:#666; margin:20px 0 3px 0; }
|
||||
h3{ color:#666; margin:10px 0 1px 0; }
|
||||
p{ margin:10px 0; }
|
||||
/*pre,code{ clear:both; display:block; }*/
|
||||
pre.code{
|
||||
background-color:#F7F7F7;
|
||||
border-color:#A7A7CC;
|
||||
border-style:solid;
|
||||
border-width:1px 1px 1px 5px;
|
||||
font-size:small;
|
||||
overflow-x:auto;
|
||||
padding:5px 5px 5px 15px;
|
||||
}
|
||||
|
||||
@media screen{
|
||||
/* LAYOUT 1 - sticky footer */
|
||||
/*ALL*/html,body,#wrap{ min-height: 100%; height: auto !important; height: 100%; }
|
||||
/* FIXED HEADER/FOOTER: */
|
||||
#roof{ height:24px; position:fixed; width:100%; z-index:9999; left:0; top:0; }
|
||||
#head{ height:30px; position:fixed; width:100%; z-index:9999; left:0; top:25px; }
|
||||
#foot{ height:55px; position:fixed; width:100%; z-index:9999; left:0; bottom:0; }
|
||||
#wrap{ padding:85px 0; }
|
||||
#wrap{ padding:95px 0 !IE; }
|
||||
html > body #roof{ height:14px; }
|
||||
}
|
||||
|
||||
|
||||
@media debug{
|
||||
#wrap{ background:#ffeeee;/*IE8*/ background:#eeffee;/*IE7*/ }
|
||||
html > body #wrap{ background:#eeeeff;/*MOZ*/ }
|
||||
}
|
||||
|
||||
#head, #foot{ border:#AAA solid 2px; }
|
||||
#head{ background:#F7F7F7 url('/jquery/project/head.png') bottom left repeat-x; }
|
||||
#foot{ background:#F7F7F7 url('/jquery/project/foot.png') top left repeat-x; }
|
||||
#head{ border-width:0 0 2px 0; }
|
||||
#foot{ border-width:2px 0 0 0; padding:0 0 20px 0; }
|
||||
|
||||
#roof{ height:14px; background:#e7e7e7; border-bottom:#AAA solid 1px; padding:5px; }
|
||||
#roof{ color:#777; font-size:94%; }
|
||||
#roof a{ color:#00A; }
|
||||
|
||||
#body{ margin:10px; }
|
||||
|
||||
#ad{ position:absolute; right:0; /*background:#090;*/ padding:5px; margin:5px 0 0 0; width:160px !important; overflow:hidden !important; }
|
||||
#ad iframe{ width:160px !important; overflow:hidden !important; }
|
||||
#documentation{ margin-right:170px; }
|
||||
|
||||
#search{ text-align:right; padding:0; margin:5px 0; border:0; display:inline; clear:none; width:200px; }
|
||||
#search *{ display:inline; float:left; clear:none; }
|
||||
#search label{ color:#C00; font-weight:bold; font-size:100%; margin:2px 5px 0 0; }
|
||||
#search input{ font-weight:bold; font-size:95%; }
|
||||
|
||||
.license-info{ padding:10px 20px; margin:0px 50px; border:#77cc77 solid 1px; background:#f3f9f3; }
|
||||
.hint{ padding:3px; background:#FFFF99; color:#000; border-bottom:#CC9900 solid 1px; margin:0 0 10px 0; }
|
||||
|
||||
/* Utilities */
|
||||
.P5{ padding:5px; }
|
||||
.Warning,.No,.Error{ color:red; }
|
||||
.Success,.Yes,.Y{ color:green; }
|
||||
.Bold,.B{ font-weight:bold; }
|
||||
|
||||
/* FROM: http://roscoecreations.com/help/css/global2.css */
|
||||
.Clear:after {content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
|
||||
.Clear {display: inline-block;}
|
||||
html[xmlns] .Clear {display: block;}
|
||||
* html .Clear {height: 1%;}
|
||||
/* - END - */
|
||||
|
||||
/* tabs css */
|
||||
@media projection,screen{.tabs-hide{display:none}}@media print{.tabs-nav{display:none}}.tabs-nav{list-style:none;margin:0;padding:0 0 0 4px}.tabs-nav:after{display:block;clear:both;content:" "}.tabs-nav li{float:left;margin:0 0 0 1px}.tabs-nav a{display:block;position:relative;top:1px;z-index:2;padding:6px 10px 0;height:18px;color:#27537a;font-size:12px;font-weight:bold;line-height:1.2;text-align:center;text-decoration:none;background:url(/@/js/tabs/tab.png) no-repeat}.tabs-nav .tabs-selected a{padding-top:7px;color:#000}.tabs-nav .tabs-selected a,.tabs-nav a:hover,.tabs-nav a:focus,.tabs-nav a:active{background-position:0 -50px;outline:0}.tabs-nav .tabs-disabled a:hover,.tabs-nav .tabs-disabled a:focus,.tabs-nav .tabs-disabled a:active{background-position:0 0}.tabs-nav .tabs-selected a:link,.tabs-nav .tabs-selected a:visited,.tabs-nav .tabs-disabled a:link,.tabs-nav .tabs-disabled a:visited{cursor:text;cursor:default}.tabs-nav a:hover,.tabs-nav a:focus,.tabs-nav a:active{cursor:pointer;cursor:hand}.tabs-nav .tabs-disabled{opacity:.4}.tabs-container{border-top:1px solid #97a5b0;padding:1em 8px;background:#fff}.tabs-loading span{padding:0 0 0 20px;background:url(/@/js/tabs/loading.gif) no-repeat 0 50%}.tabs-nav li{margin:0px;padding:0px 4px 0px 0px}.tabs-nav a{position:relative;padding:5px 3px 0px 3px;font-size:100%;font-weight:normal;line-height:1;height:16px;border:#ccc solid;border-width:1px 1px 0px 1px;background:#f5f5f5;color:#333!important}.tabs-nav a:hover{color:#339!important;text-decoration:underline}.tabs-nav .tabs-selected a{padding-top:6px;border-width:1px 1px 0px 1px;background:#e7e7e7;color:#000!important}.tabs-nav .tabs-disabled a{border-color:#ccc;color:#555!important}.tabs-container{border-top:1px solid #e0e0e0;padding:0px 0px;background:transparent}* html .tabs-nav a{display:inline-block;height:23px}.tabs-nav li > a{}
|
||||
|
||||
.tabs-nav{ font-size:110%; }.tabs-nav a{ font-weight:bold; }
|
||||
*{ font-family:Arial, Helvetica, sans-serif; margin:0; padding:0; outline:none; }
|
||||
form{ padding:0/*!important*/; margin:0/*!important*/; }
|
||||
img{ border:0; }
|
||||
ul,ol{ padding:2px 5px; margin:0 0 0 20px; }
|
||||
|
||||
body{ font-size:72%; color: #333; background:#fff; margin:0px; padding:0px; }
|
||||
h1{ color:#333; font-size:140%; float:left; width:auto; margin:0px 5px 0 0; }
|
||||
h2{ color:#666; margin:20px 0 3px 0; }
|
||||
h3{ color:#666; margin:10px 0 1px 0; }
|
||||
p{ margin:10px 0; }
|
||||
/*pre,code{ clear:both; display:block; }*/
|
||||
pre.code{
|
||||
background-color:#F7F7F7;
|
||||
border-color:#A7A7CC;
|
||||
border-style:solid;
|
||||
border-width:1px 1px 1px 5px;
|
||||
font-size:small;
|
||||
overflow-x:auto;
|
||||
padding:5px 5px 5px 15px;
|
||||
}
|
||||
|
||||
@media screen{
|
||||
/* LAYOUT 1 - sticky footer */
|
||||
/*ALL*/html,body,#wrap{ min-height: 100%; height: auto !important; height: 100%; }
|
||||
/* FIXED HEADER/FOOTER: */
|
||||
#roof{ height:24px; position:fixed; width:100%; z-index:9999; left:0; top:0; }
|
||||
#head{ height:30px; position:fixed; width:100%; z-index:9999; left:0; top:25px; }
|
||||
#foot{ height:55px; position:fixed; width:100%; z-index:9999; left:0; bottom:0; }
|
||||
#wrap{ padding:85px 0; }
|
||||
#wrap{ padding:95px 0 !IE; }
|
||||
html > body #roof{ height:14px; }
|
||||
}
|
||||
|
||||
|
||||
@media debug{
|
||||
#wrap{ background:#ffeeee;/*IE8*/ background:#eeffee;/*IE7*/ }
|
||||
html > body #wrap{ background:#eeeeff;/*MOZ*/ }
|
||||
}
|
||||
|
||||
#head, #foot{ border:#AAA solid 2px; }
|
||||
#head{ background:#F7F7F7 url('/jquery/project/head.png') bottom left repeat-x; }
|
||||
#foot{ background:#F7F7F7 url('/jquery/project/foot.png') top left repeat-x; }
|
||||
#head{ border-width:0 0 2px 0; }
|
||||
#foot{ border-width:2px 0 0 0; padding:0 0 20px 0; }
|
||||
|
||||
#roof{ height:14px; background:#e7e7e7; border-bottom:#AAA solid 1px; padding:5px; }
|
||||
#roof{ color:#777; font-size:94%; }
|
||||
#roof a{ color:#00A; }
|
||||
|
||||
#body{ margin:10px; }
|
||||
|
||||
#ad{ position:absolute; right:0; /*background:#090;*/ padding:5px; margin:5px 0 0 0; width:160px !important; overflow:hidden !important; }
|
||||
#ad iframe{ width:160px !important; overflow:hidden !important; }
|
||||
#documentation{ margin-right:170px; }
|
||||
|
||||
#search{ text-align:right; padding:0; margin:5px 0; border:0; display:inline; clear:none; width:200px; }
|
||||
#search *{ display:inline; float:left; clear:none; }
|
||||
#search label{ color:#C00; font-weight:bold; font-size:100%; margin:2px 5px 0 0; }
|
||||
#search input{ font-weight:bold; font-size:95%; }
|
||||
|
||||
.license-info{ padding:10px 20px; margin:0px 50px; border:#77cc77 solid 1px; background:#f3f9f3; }
|
||||
.hint{ padding:3px; background:#FFFF99; color:#000; border-bottom:#CC9900 solid 1px; margin:0 0 10px 0; }
|
||||
|
||||
/* Utilities */
|
||||
.P5{ padding:5px; }
|
||||
.Warning,.No,.Error{ color:red; }
|
||||
.Success,.Yes,.Y{ color:green; }
|
||||
.Bold,.B{ font-weight:bold; }
|
||||
|
||||
/* FROM: http://roscoecreations.com/help/css/global2.css */
|
||||
.Clear:after {content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
|
||||
.Clear {display: inline-block;}
|
||||
html[xmlns] .Clear {display: block;}
|
||||
* html .Clear {height: 1%;}
|
||||
/* - END - */
|
||||
|
||||
/* tabs css */
|
||||
@media projection,screen{.tabs-hide{display:none}}@media print{.tabs-nav{display:none}}.tabs-nav{list-style:none;margin:0;padding:0 0 0 4px}.tabs-nav:after{display:block;clear:both;content:" "}.tabs-nav li{float:left;margin:0 0 0 1px}.tabs-nav a{display:block;position:relative;top:1px;z-index:2;padding:6px 10px 0;height:18px;color:#27537a;font-size:12px;font-weight:bold;line-height:1.2;text-align:center;text-decoration:none;background:url(/@/js/tabs/tab.png) no-repeat}.tabs-nav .tabs-selected a{padding-top:7px;color:#000}.tabs-nav .tabs-selected a,.tabs-nav a:hover,.tabs-nav a:focus,.tabs-nav a:active{background-position:0 -50px;outline:0}.tabs-nav .tabs-disabled a:hover,.tabs-nav .tabs-disabled a:focus,.tabs-nav .tabs-disabled a:active{background-position:0 0}.tabs-nav .tabs-selected a:link,.tabs-nav .tabs-selected a:visited,.tabs-nav .tabs-disabled a:link,.tabs-nav .tabs-disabled a:visited{cursor:text;cursor:default}.tabs-nav a:hover,.tabs-nav a:focus,.tabs-nav a:active{cursor:pointer;cursor:hand}.tabs-nav .tabs-disabled{opacity:.4}.tabs-container{border-top:1px solid #97a5b0;padding:1em 8px;background:#fff}.tabs-loading span{padding:0 0 0 20px;background:url(/@/js/tabs/loading.gif) no-repeat 0 50%}.tabs-nav li{margin:0px;padding:0px 4px 0px 0px}.tabs-nav a{position:relative;padding:5px 3px 0px 3px;font-size:100%;font-weight:normal;line-height:1;height:16px;border:#ccc solid;border-width:1px 1px 0px 1px;background:#f5f5f5;color:#333!important}.tabs-nav a:hover{color:#339!important;text-decoration:underline}.tabs-nav .tabs-selected a{padding-top:6px;border-width:1px 1px 0px 1px;background:#e7e7e7;color:#000!important}.tabs-nav .tabs-disabled a{border-color:#ccc;color:#555!important}.tabs-container{border-top:1px solid #e0e0e0;padding:0px 0px;background:transparent}* html .tabs-nav a{display:inline-block;height:23px}.tabs-nav li > a{}
|
||||
|
||||
.tabs-nav{ font-size:110%; }.tabs-nav a{ font-weight:bold; }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
<!--#include file="../documentation.asp"//-->
|
||||
@@ -1,19 +1,19 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div style="padding:50px; font-family:Arial, Helvetica, sans-serif; font-size:150%;">
|
||||
This project has moved. Hold on, I'm taking you there...<br/>
|
||||
<a href="http://www.fyneworks.com/jquery/">http://www.fyneworks.com/jquery/</a>
|
||||
</div>
|
||||
|
||||
<script language="javascript">
|
||||
if(window.location.toString().match(/localhost/i))
|
||||
window.location = 'index.asp';
|
||||
else
|
||||
window.location = "http://www.fyneworks.com/jquery/star-rating/";
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div style="padding:50px; font-family:Arial, Helvetica, sans-serif; font-size:150%;">
|
||||
This project has moved. Hold on, I'm taking you there...<br/>
|
||||
<a href="http://www.fyneworks.com/jquery/">http://www.fyneworks.com/jquery/</a>
|
||||
</div>
|
||||
|
||||
<script language="javascript">
|
||||
if(window.location.toString().match(/localhost/i))
|
||||
window.location = 'index.asp';
|
||||
else
|
||||
window.location = "http://www.fyneworks.com/jquery/star-rating/";
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,121 +1,121 @@
|
||||
/*
|
||||
* Metadata - jQuery plugin for parsing metadata from elements
|
||||
*
|
||||
* Copyright (c) 2006 John Resig, Yehuda Katz, Jörn Zaefferer, Paul McLanahan
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Revision: $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sets the type of metadata to use. Metadata is encoded in JSON, and each property
|
||||
* in the JSON will become a property of the element itself.
|
||||
*
|
||||
* There are three supported types of metadata storage:
|
||||
*
|
||||
* attr: Inside an attribute. The name parameter indicates *which* attribute.
|
||||
*
|
||||
* class: Inside the class attribute, wrapped in curly braces: { }
|
||||
*
|
||||
* elem: Inside a child element (e.g. a script tag). The
|
||||
* name parameter indicates *which* element.
|
||||
*
|
||||
* The metadata for an element is loaded the first time the element is accessed via jQuery.
|
||||
*
|
||||
* As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
|
||||
* matched by expr, then redefine the metadata type and run another $(expr) for other elements.
|
||||
*
|
||||
* @name $.metadata.setType
|
||||
*
|
||||
* @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("class")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from the class attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("attr", "data")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a "data" attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
|
||||
* @before $.metadata.setType("elem", "script")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a nested script element
|
||||
*
|
||||
* @param String type The encoding type
|
||||
* @param String name The name of the attribute to be used to get metadata (optional)
|
||||
* @cat Plugins/Metadata
|
||||
* @descr Sets the type of encoding to be used when loading metadata for the first time
|
||||
* @type undefined
|
||||
* @see metadata()
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.extend({
|
||||
metadata : {
|
||||
defaults : {
|
||||
type: 'class',
|
||||
name: 'metadata',
|
||||
cre: /({.*})/,
|
||||
single: 'metadata'
|
||||
},
|
||||
setType: function( type, name ){
|
||||
this.defaults.type = type;
|
||||
this.defaults.name = name;
|
||||
},
|
||||
get: function( elem, opts ){
|
||||
var settings = $.extend({},this.defaults,opts);
|
||||
// check for empty string in single property
|
||||
if ( !settings.single.length ) settings.single = 'metadata';
|
||||
|
||||
var data = $.data(elem, settings.single);
|
||||
// returned cached data if it already exists
|
||||
if ( data ) return data;
|
||||
|
||||
data = "{}";
|
||||
|
||||
if ( settings.type == "class" ) {
|
||||
var m = settings.cre.exec( elem.className );
|
||||
if ( m )
|
||||
data = m[1];
|
||||
} else if ( settings.type == "elem" ) {
|
||||
if( !elem.getElementsByTagName ) return;
|
||||
var e = elem.getElementsByTagName(settings.name);
|
||||
if ( e.length )
|
||||
data = $.trim(e[0].innerHTML);
|
||||
} else if ( elem.getAttribute != undefined ) {
|
||||
var attr = elem.getAttribute( settings.name );
|
||||
if ( attr )
|
||||
data = attr;
|
||||
}
|
||||
|
||||
if ( data.indexOf( '{' ) <0 )
|
||||
data = "{" + data + "}";
|
||||
|
||||
data = eval("(" + data + ")");
|
||||
|
||||
$.data( elem, settings.single, data );
|
||||
return data;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns the metadata object for the first member of the jQuery object.
|
||||
*
|
||||
* @name metadata
|
||||
* @descr Returns element's metadata object
|
||||
* @param Object opts An object contianing settings to override the defaults
|
||||
* @type jQuery
|
||||
* @cat Plugins/Metadata
|
||||
*/
|
||||
$.fn.metadata = function( opts ){
|
||||
return $.metadata.get( this[0], opts );
|
||||
};
|
||||
|
||||
/*
|
||||
* Metadata - jQuery plugin for parsing metadata from elements
|
||||
*
|
||||
* Copyright (c) 2006 John Resig, Yehuda Katz, Jörn Zaefferer, Paul McLanahan
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Revision: $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sets the type of metadata to use. Metadata is encoded in JSON, and each property
|
||||
* in the JSON will become a property of the element itself.
|
||||
*
|
||||
* There are three supported types of metadata storage:
|
||||
*
|
||||
* attr: Inside an attribute. The name parameter indicates *which* attribute.
|
||||
*
|
||||
* class: Inside the class attribute, wrapped in curly braces: { }
|
||||
*
|
||||
* elem: Inside a child element (e.g. a script tag). The
|
||||
* name parameter indicates *which* element.
|
||||
*
|
||||
* The metadata for an element is loaded the first time the element is accessed via jQuery.
|
||||
*
|
||||
* As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
|
||||
* matched by expr, then redefine the metadata type and run another $(expr) for other elements.
|
||||
*
|
||||
* @name $.metadata.setType
|
||||
*
|
||||
* @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("class")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from the class attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("attr", "data")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a "data" attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
|
||||
* @before $.metadata.setType("elem", "script")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a nested script element
|
||||
*
|
||||
* @param String type The encoding type
|
||||
* @param String name The name of the attribute to be used to get metadata (optional)
|
||||
* @cat Plugins/Metadata
|
||||
* @descr Sets the type of encoding to be used when loading metadata for the first time
|
||||
* @type undefined
|
||||
* @see metadata()
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.extend({
|
||||
metadata : {
|
||||
defaults : {
|
||||
type: 'class',
|
||||
name: 'metadata',
|
||||
cre: /({.*})/,
|
||||
single: 'metadata'
|
||||
},
|
||||
setType: function( type, name ){
|
||||
this.defaults.type = type;
|
||||
this.defaults.name = name;
|
||||
},
|
||||
get: function( elem, opts ){
|
||||
var settings = $.extend({},this.defaults,opts);
|
||||
// check for empty string in single property
|
||||
if ( !settings.single.length ) settings.single = 'metadata';
|
||||
|
||||
var data = $.data(elem, settings.single);
|
||||
// returned cached data if it already exists
|
||||
if ( data ) return data;
|
||||
|
||||
data = "{}";
|
||||
|
||||
if ( settings.type == "class" ) {
|
||||
var m = settings.cre.exec( elem.className );
|
||||
if ( m )
|
||||
data = m[1];
|
||||
} else if ( settings.type == "elem" ) {
|
||||
if( !elem.getElementsByTagName ) return;
|
||||
var e = elem.getElementsByTagName(settings.name);
|
||||
if ( e.length )
|
||||
data = $.trim(e[0].innerHTML);
|
||||
} else if ( elem.getAttribute != undefined ) {
|
||||
var attr = elem.getAttribute( settings.name );
|
||||
if ( attr )
|
||||
data = attr;
|
||||
}
|
||||
|
||||
if ( data.indexOf( '{' ) <0 )
|
||||
data = "{" + data + "}";
|
||||
|
||||
data = eval("(" + data + ")");
|
||||
|
||||
$.data( elem, settings.single, data );
|
||||
return data;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns the metadata object for the first member of the jQuery object.
|
||||
*
|
||||
* @name metadata
|
||||
* @descr Returns element's metadata object
|
||||
* @param Object opts An object contianing settings to override the defaults
|
||||
* @type jQuery
|
||||
* @cat Plugins/Metadata
|
||||
*/
|
||||
$.fn.metadata = function( opts ){
|
||||
return $.metadata.get( this[0], opts );
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,22 +1,22 @@
|
||||
/* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
|
||||
div.rating-cancel,div.star-rating{float:left;width:36px;height:35px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
|
||||
div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px; display:none;visibility:hidden;}
|
||||
/* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
|
||||
div.rating-cancel,div.star-rating{float:left;width:36px;height:35px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
|
||||
div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px; display:none;visibility:hidden;}
|
||||
/*
|
||||
div.star-rating,div.star-rating a{background:url(star.gif) no-repeat 0 0px}
|
||||
*/
|
||||
|
||||
.starNr0 a{background:url(star1.gif) no-repeat 0 0px;}
|
||||
.starNr1 a{background:url(star2.gif) no-repeat 0 0px;}
|
||||
.starNr2 a{background:url(star3.gif) no-repeat 0 0px;}
|
||||
.starNr3 a{background:url(star4.gif) no-repeat 0 0px;}
|
||||
.starNr4 a{background:url(star5.gif) no-repeat 0 0px;}
|
||||
|
||||
|
||||
div.rating-cancel a,div.star-rating a{display:block;width:36px;height:100%;background-position:0 0px;border:0}
|
||||
div.star-rating-on a{background-position:0 -51px!important}
|
||||
div.star-rating-hover a{background-position:0 -103px}
|
||||
/* Read Only CSS */
|
||||
div.star-rating-readonly a{cursor:default !important}
|
||||
/* Partial Star CSS */
|
||||
div.star-rating{background:transparent!important;overflow:hidden!important}
|
||||
*/
|
||||
|
||||
.starNr0 a{background:url(star1.gif) no-repeat 0 0px;}
|
||||
.starNr1 a{background:url(star2.gif) no-repeat 0 0px;}
|
||||
.starNr2 a{background:url(star3.gif) no-repeat 0 0px;}
|
||||
.starNr3 a{background:url(star4.gif) no-repeat 0 0px;}
|
||||
.starNr4 a{background:url(star5.gif) no-repeat 0 0px;}
|
||||
|
||||
|
||||
div.rating-cancel a,div.star-rating a{display:block;width:36px;height:100%;background-position:0 0px;border:0}
|
||||
div.star-rating-on a{background-position:0 -51px!important}
|
||||
div.star-rating-hover a{background-position:0 -103px}
|
||||
/* Read Only CSS */
|
||||
div.star-rating-readonly a{cursor:default !important}
|
||||
/* Partial Star CSS */
|
||||
div.star-rating{background:transparent!important;overflow:hidden!important}
|
||||
/* END jQuery.Rating Plugin CSS */
|
||||
@@ -1,385 +1,385 @@
|
||||
/*
|
||||
### jQuery Star Rating Plugin v3.13 - 2009-03-26 ###
|
||||
* Home: http://www.fyneworks.com/jquery/star-rating/
|
||||
* Code: http://code.google.com/p/jquery-star-rating-plugin/
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
###
|
||||
*/
|
||||
|
||||
/*# AVOID COLLISIONS #*/
|
||||
;if(window.jQuery) (function($){
|
||||
/*# AVOID COLLISIONS #*/
|
||||
|
||||
// IE6 Background Image Fix
|
||||
if ($.browser.msie) try { document.execCommand("BackgroundImageCache", false, true)} catch(e) { };
|
||||
// Thanks to http://www.visualjquery.com/rating/rating_redux.html
|
||||
|
||||
// plugin initialization
|
||||
$.fn.rating = function(options){
|
||||
if(this.length==0) return this; // quick fail
|
||||
|
||||
// Handle API methods
|
||||
if(typeof arguments[0]=='string'){
|
||||
// Perform API methods on individual elements
|
||||
if(this.length>1){
|
||||
var args = arguments;
|
||||
return this.each(function(){
|
||||
$.fn.rating.apply($(this), args);
|
||||
});
|
||||
};
|
||||
// Invoke API method handler
|
||||
$.fn.rating[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []);
|
||||
// Quick exit...
|
||||
return this;
|
||||
};
|
||||
|
||||
// Initialize options for this call
|
||||
var options = $.extend(
|
||||
{}/* new object */,
|
||||
$.fn.rating.options/* default options */,
|
||||
options || {} /* just-in-time options */
|
||||
);
|
||||
|
||||
// Allow multiple controls with the same name by making each call unique
|
||||
$.fn.rating.calls++;
|
||||
//color change
|
||||
var i=0;
|
||||
// loop through each matched element
|
||||
this
|
||||
.not('.star-rating-applied')
|
||||
.addClass('star-rating-applied')
|
||||
.each(function(){
|
||||
|
||||
// Load control parameters / find context / etc
|
||||
var control, input = $(this);
|
||||
var eid = (this.name || 'unnamed-rating').replace(/\[|\]/g, '_').replace(/^\_+|\_+$/g,'');
|
||||
var context = $(this.form || document.body);
|
||||
|
||||
// FIX: http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=23
|
||||
var raters = context.data('rating');
|
||||
if(!raters || raters.call!=$.fn.rating.calls) raters = { count:0, call:$.fn.rating.calls };
|
||||
var rater = raters[eid];
|
||||
|
||||
// if rater is available, verify that the control still exists
|
||||
if(rater) control = rater.data('rating');
|
||||
|
||||
if(rater && control)//{// save a byte!
|
||||
// add star to control if rater is available and the same control still exists
|
||||
control.count++;
|
||||
|
||||
//}// save a byte!
|
||||
else{
|
||||
// create new control if first star or control element was removed/replaced
|
||||
|
||||
// Initialize options for this raters
|
||||
control = $.extend(
|
||||
{}/* new object */,
|
||||
options || {} /* current call options */,
|
||||
($.metadata? input.metadata(): ($.meta?input.data():null)) || {}, /* metadata options */
|
||||
{ count:0, stars: [], inputs: [] }
|
||||
);
|
||||
|
||||
// increment number of rating controls
|
||||
control.serial = raters.count++;
|
||||
|
||||
// create rating element
|
||||
rater = $('<span class="star-rating-control"/>');
|
||||
input.before(rater);
|
||||
|
||||
// Mark element for initialization (once all stars are ready)
|
||||
rater.addClass('rating-to-be-drawn');
|
||||
|
||||
// Accept readOnly setting from 'disabled' property
|
||||
if(input.attr('disabled')) control.readOnly = true;
|
||||
|
||||
// Create 'cancel' button
|
||||
rater.append(
|
||||
control.cancel = $('<div class="rating-cancel"><a title="' + control.cancel + '">' + control.cancelValue + '</a></div>')
|
||||
.mouseover(function(){
|
||||
$(this).rating('drain');
|
||||
$(this).addClass('star-rating-hover');
|
||||
//$(this).rating('focus');
|
||||
})
|
||||
.mouseout(function(){
|
||||
$(this).rating('draw');
|
||||
$(this).removeClass('star-rating-hover');
|
||||
//$(this).rating('blur');
|
||||
})
|
||||
.click(function(){
|
||||
$(this).rating('select');
|
||||
})
|
||||
.data('rating', control)
|
||||
);
|
||||
|
||||
}; // first element of group
|
||||
|
||||
// insert rating star
|
||||
var star = $('<div class="star-rating rater-'+ control.serial +' starNr'+i+'"><a title="' + (this.title || this.value) + '">' + this.value + '</a></div>');
|
||||
i++;
|
||||
rater.append(star);
|
||||
|
||||
// inherit attributes from input element
|
||||
if(this.id) star.attr('id', this.id);
|
||||
if(this.className) star.addClass(this.className);
|
||||
|
||||
// Half-stars?
|
||||
if(control.half) control.split = 2;
|
||||
|
||||
// Prepare division control
|
||||
if(typeof control.split=='number' && control.split>0){
|
||||
var stw = ($.fn.width ? star.width() : 0) || control.starWidth;
|
||||
var spi = (control.count % control.split), spw = Math.floor(stw/control.split);
|
||||
star
|
||||
// restrict star's width and hide overflow (already in CSS)
|
||||
.width(spw)
|
||||
// move the star left by using a negative margin
|
||||
// this is work-around to IE's stupid box model (position:relative doesn't work)
|
||||
.find('a').css({ 'margin-left':'-'+ (spi*spw) +'px' })
|
||||
};
|
||||
|
||||
// readOnly?
|
||||
if(control.readOnly)//{ //save a byte!
|
||||
// Mark star as readOnly so user can customize display
|
||||
star.addClass('star-rating-readonly');
|
||||
//} //save a byte!
|
||||
else//{ //save a byte!
|
||||
// Enable hover css effects
|
||||
star.addClass('star-rating-live')
|
||||
// Attach mouse events
|
||||
.mouseover(function(){
|
||||
$(this).rating('fill');
|
||||
$(this).rating('focus');
|
||||
})
|
||||
.mouseout(function(){
|
||||
$(this).rating('draw');
|
||||
$(this).rating('blur');
|
||||
})
|
||||
.click(function(){
|
||||
$(this).rating('select');
|
||||
})
|
||||
;
|
||||
//}; //save a byte!
|
||||
|
||||
// set current selection
|
||||
if(this.checked) control.current = star;
|
||||
|
||||
// hide input element
|
||||
input.hide();
|
||||
|
||||
// backward compatibility, form element to plugin
|
||||
input.change(function(){
|
||||
$(this).rating('select');
|
||||
});
|
||||
|
||||
// attach reference to star to input element and vice-versa
|
||||
star.data('rating.input', input.data('rating.star', star));
|
||||
|
||||
// store control information in form (or body when form not available)
|
||||
control.stars[control.stars.length] = star[0];
|
||||
control.inputs[control.inputs.length] = input[0];
|
||||
control.rater = raters[eid] = rater;
|
||||
control.context = context;
|
||||
|
||||
input.data('rating', control);
|
||||
rater.data('rating', control);
|
||||
star.data('rating', control);
|
||||
context.data('rating', raters);
|
||||
}); // each element
|
||||
|
||||
// Initialize ratings (first draw)
|
||||
$('.rating-to-be-drawn').rating('draw').removeClass('rating-to-be-drawn');
|
||||
|
||||
return this; // don't break the chain...
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
### Core functionality and API ###
|
||||
*/
|
||||
$.extend($.fn.rating, {
|
||||
// Used to append a unique serial number to internal control ID
|
||||
// each time the plugin is invoked so same name controls can co-exist
|
||||
calls: 0,
|
||||
|
||||
focus: function(){
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
if(!control.focus) return this; // quick fail if not required
|
||||
// find data for event
|
||||
var input = $(this).data('rating.input') || $( this.tagName=='INPUT' ? this : null );
|
||||
// focus handler, as requested by focusdigital.co.uk
|
||||
if(control.focus) control.focus.apply(input[0], [input.val(), $('a', input.data('rating.star'))[0]]);
|
||||
}, // $.fn.rating.focus
|
||||
|
||||
blur: function(){
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
if(!control.blur) return this; // quick fail if not required
|
||||
// find data for event
|
||||
var input = $(this).data('rating.input') || $( this.tagName=='INPUT' ? this : null );
|
||||
// blur handler, as requested by focusdigital.co.uk
|
||||
if(control.blur) control.blur.apply(input[0], [input.val(), $('a', input.data('rating.star'))[0]]);
|
||||
}, // $.fn.rating.blur
|
||||
|
||||
fill: function(){ // fill to the current mouse position.
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
// do not execute when control is in read-only mode
|
||||
if(control.readOnly) return;
|
||||
// Reset all stars and highlight them up to this element
|
||||
this.rating('drain');
|
||||
this.prevAll().andSelf().filter('.rater-'+ control.serial).addClass('star-rating-hover');
|
||||
},// $.fn.rating.fill
|
||||
|
||||
drain: function() { // drain all the stars.
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
// do not execute when control is in read-only mode
|
||||
if(control.readOnly) return;
|
||||
// Reset all stars
|
||||
control.rater.children().filter('.rater-'+ control.serial).removeClass('star-rating-on').removeClass('star-rating-hover');
|
||||
},// $.fn.rating.drain
|
||||
|
||||
draw: function(){ // set value and stars to reflect current selection
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
// Clear all stars
|
||||
this.rating('drain');
|
||||
// Set control value
|
||||
if(control.current){
|
||||
control.current.data('rating.input').attr('checked','checked');
|
||||
control.current.prevAll().andSelf().filter('.rater-'+ control.serial).addClass('star-rating-on');
|
||||
}
|
||||
else
|
||||
$(control.inputs).removeAttr('checked');
|
||||
// Show/hide 'cancel' button
|
||||
control.cancel[control.readOnly || control.required?'hide':'show']();
|
||||
// Add/remove read-only classes to remove hand pointer
|
||||
this.siblings()[control.readOnly?'addClass':'removeClass']('star-rating-readonly');
|
||||
},// $.fn.rating.draw
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
select: function(value,wantCallBack){ // select a value
|
||||
|
||||
// ***** MODIFICATION *****
|
||||
// Thanks to faivre.thomas - http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=27
|
||||
//
|
||||
// ***** LIST OF MODIFICATION *****
|
||||
// ***** added Parameter wantCallBack : false if you don't want a callback. true or undefined if you want postback to be performed at the end of this method'
|
||||
// ***** recursive calls to this method were like : ... .rating('select') it's now like .rating('select',undefined,wantCallBack); (parameters are set.)
|
||||
// ***** line which is calling callback
|
||||
// ***** /LIST OF MODIFICATION *****
|
||||
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
// do not execute when control is in read-only mode
|
||||
if(control.readOnly) return;
|
||||
// clear selection
|
||||
control.current = null;
|
||||
// programmatically (based on user input)
|
||||
if(typeof value!='undefined'){
|
||||
// select by index (0 based)
|
||||
if(typeof value=='number')
|
||||
return $(control.stars[value]).rating('select',undefined,wantCallBack);
|
||||
// select by literal value (must be passed as a string
|
||||
if(typeof value=='string')
|
||||
//return
|
||||
$.each(control.stars, function(){
|
||||
if($(this).data('rating.input').val()==value) $(this).rating('select',undefined,wantCallBack);
|
||||
});
|
||||
}
|
||||
else
|
||||
control.current = this[0].tagName=='INPUT' ?
|
||||
this.data('rating.star') :
|
||||
(this.is('.rater-'+ control.serial) ? this : null);
|
||||
|
||||
// Update rating control state
|
||||
this.data('rating', control);
|
||||
// Update display
|
||||
this.rating('draw');
|
||||
// find data for event
|
||||
var input = $( control.current ? control.current.data('rating.input') : null );
|
||||
// click callback, as requested here: http://plugins.jquery.com/node/1655
|
||||
|
||||
// **** MODIFICATION *****
|
||||
// Thanks to faivre.thomas - http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=27
|
||||
//
|
||||
//old line doing the callback :
|
||||
//if(control.callback) control.callback.apply(input[0], [input.val(), $('a', control.current)[0]]);// callback event
|
||||
//
|
||||
//new line doing the callback (if i want :)
|
||||
if((wantCallBack ||wantCallBack == undefined) && control.callback) control.callback.apply(input[0], [input.val(), $('a', control.current)[0]]);// callback event
|
||||
//to ensure retro-compatibility, wantCallBack must be considered as true by default
|
||||
// **** /MODIFICATION *****
|
||||
|
||||
},// $.fn.rating.select
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
readOnly: function(toggle, disable){ // make the control read-only (still submits value)
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
// setread-only status
|
||||
control.readOnly = toggle || toggle==undefined ? true : false;
|
||||
// enable/disable control value submission
|
||||
if(disable) $(control.inputs).attr("disabled", "disabled");
|
||||
else $(control.inputs).removeAttr("disabled");
|
||||
// Update rating control state
|
||||
this.data('rating', control);
|
||||
// Update display
|
||||
this.rating('draw');
|
||||
},// $.fn.rating.readOnly
|
||||
|
||||
disable: function(){ // make read-only and never submit value
|
||||
this.rating('readOnly', true, true);
|
||||
},// $.fn.rating.disable
|
||||
|
||||
enable: function(){ // make read/write and submit value
|
||||
this.rating('readOnly', false, false);
|
||||
}// $.fn.rating.select
|
||||
|
||||
});
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
### Default Settings ###
|
||||
eg.: You can override default control like this:
|
||||
$.fn.rating.options.cancel = 'Clear';
|
||||
*/
|
||||
$.fn.rating.options = { //$.extend($.fn.rating, { options: {
|
||||
cancel: 'Cancel Rating', // advisory title for the 'cancel' link
|
||||
cancelValue: '', // value to submit when user click the 'cancel' link
|
||||
split: 0, // split the star into how many parts?
|
||||
|
||||
// Width of star image in case the plugin can't work it out. This can happen if
|
||||
// the jQuery.dimensions plugin is not available OR the image is hidden at installation
|
||||
starWidth: 16//,
|
||||
|
||||
//NB.: These don't need to be pre-defined (can be undefined/null) so let's save some code!
|
||||
//half: false, // just a shortcut to control.split = 2
|
||||
//required: false, // disables the 'cancel' button so user can only select one of the specified values
|
||||
//readOnly: false, // disable rating plugin interaction/ values cannot be changed
|
||||
//focus: function(){}, // executed when stars are focused
|
||||
//blur: function(){}, // executed when stars are focused
|
||||
//callback: function(){}, // executed when a star is clicked
|
||||
}; //} });
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
### Default implementation ###
|
||||
The plugin will attach itself to file inputs
|
||||
with the class 'multi' when the page loads
|
||||
*/
|
||||
$(function(){
|
||||
$('input[type=radio].star').rating();
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*# AVOID COLLISIONS #*/
|
||||
})(jQuery);
|
||||
/*# AVOID COLLISIONS #*/
|
||||
/*
|
||||
### jQuery Star Rating Plugin v3.13 - 2009-03-26 ###
|
||||
* Home: http://www.fyneworks.com/jquery/star-rating/
|
||||
* Code: http://code.google.com/p/jquery-star-rating-plugin/
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
###
|
||||
*/
|
||||
|
||||
/*# AVOID COLLISIONS #*/
|
||||
;if(window.jQuery) (function($){
|
||||
/*# AVOID COLLISIONS #*/
|
||||
|
||||
// IE6 Background Image Fix
|
||||
if ($.browser.msie) try { document.execCommand("BackgroundImageCache", false, true)} catch(e) { };
|
||||
// Thanks to http://www.visualjquery.com/rating/rating_redux.html
|
||||
|
||||
// plugin initialization
|
||||
$.fn.rating = function(options){
|
||||
if(this.length==0) return this; // quick fail
|
||||
|
||||
// Handle API methods
|
||||
if(typeof arguments[0]=='string'){
|
||||
// Perform API methods on individual elements
|
||||
if(this.length>1){
|
||||
var args = arguments;
|
||||
return this.each(function(){
|
||||
$.fn.rating.apply($(this), args);
|
||||
});
|
||||
};
|
||||
// Invoke API method handler
|
||||
$.fn.rating[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []);
|
||||
// Quick exit...
|
||||
return this;
|
||||
};
|
||||
|
||||
// Initialize options for this call
|
||||
var options = $.extend(
|
||||
{}/* new object */,
|
||||
$.fn.rating.options/* default options */,
|
||||
options || {} /* just-in-time options */
|
||||
);
|
||||
|
||||
// Allow multiple controls with the same name by making each call unique
|
||||
$.fn.rating.calls++;
|
||||
//color change
|
||||
var i=0;
|
||||
// loop through each matched element
|
||||
this
|
||||
.not('.star-rating-applied')
|
||||
.addClass('star-rating-applied')
|
||||
.each(function(){
|
||||
|
||||
// Load control parameters / find context / etc
|
||||
var control, input = $(this);
|
||||
var eid = (this.name || 'unnamed-rating').replace(/\[|\]/g, '_').replace(/^\_+|\_+$/g,'');
|
||||
var context = $(this.form || document.body);
|
||||
|
||||
// FIX: http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=23
|
||||
var raters = context.data('rating');
|
||||
if(!raters || raters.call!=$.fn.rating.calls) raters = { count:0, call:$.fn.rating.calls };
|
||||
var rater = raters[eid];
|
||||
|
||||
// if rater is available, verify that the control still exists
|
||||
if(rater) control = rater.data('rating');
|
||||
|
||||
if(rater && control)//{// save a byte!
|
||||
// add star to control if rater is available and the same control still exists
|
||||
control.count++;
|
||||
|
||||
//}// save a byte!
|
||||
else{
|
||||
// create new control if first star or control element was removed/replaced
|
||||
|
||||
// Initialize options for this raters
|
||||
control = $.extend(
|
||||
{}/* new object */,
|
||||
options || {} /* current call options */,
|
||||
($.metadata? input.metadata(): ($.meta?input.data():null)) || {}, /* metadata options */
|
||||
{ count:0, stars: [], inputs: [] }
|
||||
);
|
||||
|
||||
// increment number of rating controls
|
||||
control.serial = raters.count++;
|
||||
|
||||
// create rating element
|
||||
rater = $('<span class="star-rating-control"/>');
|
||||
input.before(rater);
|
||||
|
||||
// Mark element for initialization (once all stars are ready)
|
||||
rater.addClass('rating-to-be-drawn');
|
||||
|
||||
// Accept readOnly setting from 'disabled' property
|
||||
if(input.attr('disabled')) control.readOnly = true;
|
||||
|
||||
// Create 'cancel' button
|
||||
rater.append(
|
||||
control.cancel = $('<div class="rating-cancel"><a title="' + control.cancel + '">' + control.cancelValue + '</a></div>')
|
||||
.mouseover(function(){
|
||||
$(this).rating('drain');
|
||||
$(this).addClass('star-rating-hover');
|
||||
//$(this).rating('focus');
|
||||
})
|
||||
.mouseout(function(){
|
||||
$(this).rating('draw');
|
||||
$(this).removeClass('star-rating-hover');
|
||||
//$(this).rating('blur');
|
||||
})
|
||||
.click(function(){
|
||||
$(this).rating('select');
|
||||
})
|
||||
.data('rating', control)
|
||||
);
|
||||
|
||||
}; // first element of group
|
||||
|
||||
// insert rating star
|
||||
var star = $('<div class="star-rating rater-'+ control.serial +' starNr'+i+'"><a title="' + (this.title || this.value) + '">' + this.value + '</a></div>');
|
||||
i++;
|
||||
rater.append(star);
|
||||
|
||||
// inherit attributes from input element
|
||||
if(this.id) star.attr('id', this.id);
|
||||
if(this.className) star.addClass(this.className);
|
||||
|
||||
// Half-stars?
|
||||
if(control.half) control.split = 2;
|
||||
|
||||
// Prepare division control
|
||||
if(typeof control.split=='number' && control.split>0){
|
||||
var stw = ($.fn.width ? star.width() : 0) || control.starWidth;
|
||||
var spi = (control.count % control.split), spw = Math.floor(stw/control.split);
|
||||
star
|
||||
// restrict star's width and hide overflow (already in CSS)
|
||||
.width(spw)
|
||||
// move the star left by using a negative margin
|
||||
// this is work-around to IE's stupid box model (position:relative doesn't work)
|
||||
.find('a').css({ 'margin-left':'-'+ (spi*spw) +'px' })
|
||||
};
|
||||
|
||||
// readOnly?
|
||||
if(control.readOnly)//{ //save a byte!
|
||||
// Mark star as readOnly so user can customize display
|
||||
star.addClass('star-rating-readonly');
|
||||
//} //save a byte!
|
||||
else//{ //save a byte!
|
||||
// Enable hover css effects
|
||||
star.addClass('star-rating-live')
|
||||
// Attach mouse events
|
||||
.mouseover(function(){
|
||||
$(this).rating('fill');
|
||||
$(this).rating('focus');
|
||||
})
|
||||
.mouseout(function(){
|
||||
$(this).rating('draw');
|
||||
$(this).rating('blur');
|
||||
})
|
||||
.click(function(){
|
||||
$(this).rating('select');
|
||||
})
|
||||
;
|
||||
//}; //save a byte!
|
||||
|
||||
// set current selection
|
||||
if(this.checked) control.current = star;
|
||||
|
||||
// hide input element
|
||||
input.hide();
|
||||
|
||||
// backward compatibility, form element to plugin
|
||||
input.change(function(){
|
||||
$(this).rating('select');
|
||||
});
|
||||
|
||||
// attach reference to star to input element and vice-versa
|
||||
star.data('rating.input', input.data('rating.star', star));
|
||||
|
||||
// store control information in form (or body when form not available)
|
||||
control.stars[control.stars.length] = star[0];
|
||||
control.inputs[control.inputs.length] = input[0];
|
||||
control.rater = raters[eid] = rater;
|
||||
control.context = context;
|
||||
|
||||
input.data('rating', control);
|
||||
rater.data('rating', control);
|
||||
star.data('rating', control);
|
||||
context.data('rating', raters);
|
||||
}); // each element
|
||||
|
||||
// Initialize ratings (first draw)
|
||||
$('.rating-to-be-drawn').rating('draw').removeClass('rating-to-be-drawn');
|
||||
|
||||
return this; // don't break the chain...
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
### Core functionality and API ###
|
||||
*/
|
||||
$.extend($.fn.rating, {
|
||||
// Used to append a unique serial number to internal control ID
|
||||
// each time the plugin is invoked so same name controls can co-exist
|
||||
calls: 0,
|
||||
|
||||
focus: function(){
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
if(!control.focus) return this; // quick fail if not required
|
||||
// find data for event
|
||||
var input = $(this).data('rating.input') || $( this.tagName=='INPUT' ? this : null );
|
||||
// focus handler, as requested by focusdigital.co.uk
|
||||
if(control.focus) control.focus.apply(input[0], [input.val(), $('a', input.data('rating.star'))[0]]);
|
||||
}, // $.fn.rating.focus
|
||||
|
||||
blur: function(){
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
if(!control.blur) return this; // quick fail if not required
|
||||
// find data for event
|
||||
var input = $(this).data('rating.input') || $( this.tagName=='INPUT' ? this : null );
|
||||
// blur handler, as requested by focusdigital.co.uk
|
||||
if(control.blur) control.blur.apply(input[0], [input.val(), $('a', input.data('rating.star'))[0]]);
|
||||
}, // $.fn.rating.blur
|
||||
|
||||
fill: function(){ // fill to the current mouse position.
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
// do not execute when control is in read-only mode
|
||||
if(control.readOnly) return;
|
||||
// Reset all stars and highlight them up to this element
|
||||
this.rating('drain');
|
||||
this.prevAll().andSelf().filter('.rater-'+ control.serial).addClass('star-rating-hover');
|
||||
},// $.fn.rating.fill
|
||||
|
||||
drain: function() { // drain all the stars.
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
// do not execute when control is in read-only mode
|
||||
if(control.readOnly) return;
|
||||
// Reset all stars
|
||||
control.rater.children().filter('.rater-'+ control.serial).removeClass('star-rating-on').removeClass('star-rating-hover');
|
||||
},// $.fn.rating.drain
|
||||
|
||||
draw: function(){ // set value and stars to reflect current selection
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
// Clear all stars
|
||||
this.rating('drain');
|
||||
// Set control value
|
||||
if(control.current){
|
||||
control.current.data('rating.input').attr('checked','checked');
|
||||
control.current.prevAll().andSelf().filter('.rater-'+ control.serial).addClass('star-rating-on');
|
||||
}
|
||||
else
|
||||
$(control.inputs).removeAttr('checked');
|
||||
// Show/hide 'cancel' button
|
||||
control.cancel[control.readOnly || control.required?'hide':'show']();
|
||||
// Add/remove read-only classes to remove hand pointer
|
||||
this.siblings()[control.readOnly?'addClass':'removeClass']('star-rating-readonly');
|
||||
},// $.fn.rating.draw
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
select: function(value,wantCallBack){ // select a value
|
||||
|
||||
// ***** MODIFICATION *****
|
||||
// Thanks to faivre.thomas - http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=27
|
||||
//
|
||||
// ***** LIST OF MODIFICATION *****
|
||||
// ***** added Parameter wantCallBack : false if you don't want a callback. true or undefined if you want postback to be performed at the end of this method'
|
||||
// ***** recursive calls to this method were like : ... .rating('select') it's now like .rating('select',undefined,wantCallBack); (parameters are set.)
|
||||
// ***** line which is calling callback
|
||||
// ***** /LIST OF MODIFICATION *****
|
||||
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
// do not execute when control is in read-only mode
|
||||
if(control.readOnly) return;
|
||||
// clear selection
|
||||
control.current = null;
|
||||
// programmatically (based on user input)
|
||||
if(typeof value!='undefined'){
|
||||
// select by index (0 based)
|
||||
if(typeof value=='number')
|
||||
return $(control.stars[value]).rating('select',undefined,wantCallBack);
|
||||
// select by literal value (must be passed as a string
|
||||
if(typeof value=='string')
|
||||
//return
|
||||
$.each(control.stars, function(){
|
||||
if($(this).data('rating.input').val()==value) $(this).rating('select',undefined,wantCallBack);
|
||||
});
|
||||
}
|
||||
else
|
||||
control.current = this[0].tagName=='INPUT' ?
|
||||
this.data('rating.star') :
|
||||
(this.is('.rater-'+ control.serial) ? this : null);
|
||||
|
||||
// Update rating control state
|
||||
this.data('rating', control);
|
||||
// Update display
|
||||
this.rating('draw');
|
||||
// find data for event
|
||||
var input = $( control.current ? control.current.data('rating.input') : null );
|
||||
// click callback, as requested here: http://plugins.jquery.com/node/1655
|
||||
|
||||
// **** MODIFICATION *****
|
||||
// Thanks to faivre.thomas - http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=27
|
||||
//
|
||||
//old line doing the callback :
|
||||
//if(control.callback) control.callback.apply(input[0], [input.val(), $('a', control.current)[0]]);// callback event
|
||||
//
|
||||
//new line doing the callback (if i want :)
|
||||
if((wantCallBack ||wantCallBack == undefined) && control.callback) control.callback.apply(input[0], [input.val(), $('a', control.current)[0]]);// callback event
|
||||
//to ensure retro-compatibility, wantCallBack must be considered as true by default
|
||||
// **** /MODIFICATION *****
|
||||
|
||||
},// $.fn.rating.select
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
readOnly: function(toggle, disable){ // make the control read-only (still submits value)
|
||||
var control = this.data('rating'); if(!control) return this;
|
||||
// setread-only status
|
||||
control.readOnly = toggle || toggle==undefined ? true : false;
|
||||
// enable/disable control value submission
|
||||
if(disable) $(control.inputs).attr("disabled", "disabled");
|
||||
else $(control.inputs).removeAttr("disabled");
|
||||
// Update rating control state
|
||||
this.data('rating', control);
|
||||
// Update display
|
||||
this.rating('draw');
|
||||
},// $.fn.rating.readOnly
|
||||
|
||||
disable: function(){ // make read-only and never submit value
|
||||
this.rating('readOnly', true, true);
|
||||
},// $.fn.rating.disable
|
||||
|
||||
enable: function(){ // make read/write and submit value
|
||||
this.rating('readOnly', false, false);
|
||||
}// $.fn.rating.select
|
||||
|
||||
});
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
### Default Settings ###
|
||||
eg.: You can override default control like this:
|
||||
$.fn.rating.options.cancel = 'Clear';
|
||||
*/
|
||||
$.fn.rating.options = { //$.extend($.fn.rating, { options: {
|
||||
cancel: 'Cancel Rating', // advisory title for the 'cancel' link
|
||||
cancelValue: '', // value to submit when user click the 'cancel' link
|
||||
split: 0, // split the star into how many parts?
|
||||
|
||||
// Width of star image in case the plugin can't work it out. This can happen if
|
||||
// the jQuery.dimensions plugin is not available OR the image is hidden at installation
|
||||
starWidth: 16//,
|
||||
|
||||
//NB.: These don't need to be pre-defined (can be undefined/null) so let's save some code!
|
||||
//half: false, // just a shortcut to control.split = 2
|
||||
//required: false, // disables the 'cancel' button so user can only select one of the specified values
|
||||
//readOnly: false, // disable rating plugin interaction/ values cannot be changed
|
||||
//focus: function(){}, // executed when stars are focused
|
||||
//blur: function(){}, // executed when stars are focused
|
||||
//callback: function(){}, // executed when a star is clicked
|
||||
}; //} });
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
### Default implementation ###
|
||||
The plugin will attach itself to file inputs
|
||||
with the class 'multi' when the page loads
|
||||
*/
|
||||
$(function(){
|
||||
$('input[type=radio].star').rating();
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*# AVOID COLLISIONS #*/
|
||||
})(jQuery);
|
||||
/*# AVOID COLLISIONS #*/
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
### jQuery Star Rating Plugin v3.13 - 2009-03-26 ###
|
||||
* Home: http://www.fyneworks.com/jquery/star-rating/
|
||||
* Code: http://code.google.com/p/jquery-star-rating-plugin/
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
###
|
||||
*/
|
||||
/*
|
||||
### jQuery Star Rating Plugin v3.13 - 2009-03-26 ###
|
||||
* Home: http://www.fyneworks.com/jquery/star-rating/
|
||||
* Code: http://code.google.com/p/jquery-star-rating-plugin/
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
###
|
||||
*/
|
||||
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}(';5(29.1j)(7($){5($.1L.1J)1I{1t.1H("1K",J,H)}1M(e){};$.n.3=7(i){5(4.Q==0)k 4;5(A I[0]==\'1h\'){5(4.Q>1){8 j=I;k 4.W(7(){$.n.3.y($(4),j)})};$.n.3[I[0]].y(4,$.1T(I).1U(1)||[]);k 4};8 i=$.12({},$.n.3.1s,i||{});$.n.3.K++;4.2a(\'.9-3-1f\').o(\'9-3-1f\').W(7(){8 a,l=$(4);8 b=(4.23||\'21-3\').1v(/\\[|\\]/g,\'Z\').1v(/^\\Z+|\\Z+$/g,\'\');8 c=$(4.1X||1t.1W);8 d=c.6(\'3\');5(!d||d.18!=$.n.3.K)d={z:0,18:$.n.3.K};8 e=d[b];5(e)a=e.6(\'3\');5(e&&a)a.z++;x{a=$.12({},i||{},($.1b?l.1b():($.1S?l.6():s))||{},{z:0,F:[],v:[]});a.w=d.z++;e=$(\'<1R V="9-3-1Q"/>\');l.1P(e);e.o(\'3-15-T-17\');5(l.S(\'R\'))a.m=H;e.1c(a.E=$(\'<P V="3-E"><a 14="\'+a.E+\'">\'+a.1d+\'</a></P>\').1g(7(){$(4).3(\'O\');$(4).o(\'9-3-N\')}).1i(7(){$(4).3(\'u\');$(4).G(\'9-3-N\')}).1l(7(){$(4).3(\'r\')}).6(\'3\',a))};8 f=$(\'<P V="9-3 q-\'+a.w+\'"><a 14="\'+(4.14||4.1p)+\'">\'+4.1p+\'</a></P>\');e.1c(f);5(4.11)f.S(\'11\',4.11);5(4.1r)f.o(4.1r);5(a.1F)a.t=2;5(A a.t==\'1u\'&&a.t>0){8 g=($.n.10?f.10():0)||a.1w;8 h=(a.z%a.t),Y=1y.1z(g/a.t);f.10(Y).1A(\'a\').1B({\'1C-1D\':\'-\'+(h*Y)+\'1E\'})};5(a.m)f.o(\'9-3-1o\');x f.o(\'9-3-1G\').1g(7(){$(4).3(\'1n\');$(4).3(\'D\')}).1i(7(){$(4).3(\'u\');$(4).3(\'C\')}).1l(7(){$(4).3(\'r\')});5(4.L)a.p=f;l.1q();l.1N(7(){$(4).3(\'r\')});f.6(\'3.l\',l.6(\'3.9\',f));a.F[a.F.Q]=f[0];a.v[a.v.Q]=l[0];a.q=d[b]=e;a.1O=c;l.6(\'3\',a);e.6(\'3\',a);f.6(\'3\',a);c.6(\'3\',d)});$(\'.3-15-T-17\').3(\'u\').G(\'3-15-T-17\');k 4};$.12($.n.3,{K:0,D:7(){8 a=4.6(\'3\');5(!a)k 4;5(!a.D)k 4;8 b=$(4).6(\'3.l\')||$(4.U==\'13\'?4:s);5(a.D)a.D.y(b[0],[b.M(),$(\'a\',b.6(\'3.9\'))[0]])},C:7(){8 a=4.6(\'3\');5(!a)k 4;5(!a.C)k 4;8 b=$(4).6(\'3.l\')||$(4.U==\'13\'?4:s);5(a.C)a.C.y(b[0],[b.M(),$(\'a\',b.6(\'3.9\'))[0]])},1n:7(){8 a=4.6(\'3\');5(!a)k 4;5(a.m)k;4.3(\'O\');4.1a().19().X(\'.q-\'+a.w).o(\'9-3-N\')},O:7(){8 a=4.6(\'3\');5(!a)k 4;5(a.m)k;a.q.1V().X(\'.q-\'+a.w).G(\'9-3-1k\').G(\'9-3-N\')},u:7(){8 a=4.6(\'3\');5(!a)k 4;4.3(\'O\');5(a.p){a.p.6(\'3.l\').S(\'L\',\'L\');a.p.1a().19().X(\'.q-\'+a.w).o(\'9-3-1k\')}x $(a.v).1m(\'L\');a.E[a.m||a.1Y?\'1q\':\'1Z\']();4.20()[a.m?\'o\':\'G\'](\'9-3-1o\')},r:7(a,b){8 c=4.6(\'3\');5(!c)k 4;5(c.m)k;c.p=s;5(A a!=\'B\'){5(A a==\'1u\')k $(c.F[a]).3(\'r\',B,b);5(A a==\'1h\')$.W(c.F,7(){5($(4).6(\'3.l\').M()==a)$(4).3(\'r\',B,b)})}x c.p=4[0].U==\'13\'?4.6(\'3.9\'):(4.22(\'.q-\'+c.w)?4:s);4.6(\'3\',c);4.3(\'u\');8 d=$(c.p?c.p.6(\'3.l\'):s);5((b||b==B)&&c.1e)c.1e.y(d[0],[d.M(),$(\'a\',c.p)[0]])},m:7(a,b){8 c=4.6(\'3\');5(!c)k 4;c.m=a||a==B?H:J;5(b)$(c.v).S("R","R");x $(c.v).1m("R");4.6(\'3\',c);4.3(\'u\')},1x:7(){4.3(\'m\',H,H)},24:7(){4.3(\'m\',J,J)}});$.n.3.1s={E:\'25 26\',1d:\'\',t:0,1w:16};$(7(){$(\'l[27=28].9\').3()})})(1j);',62,135,'|||rating|this|if|data|function|var|star|||||||||||return|input|readOnly|fn|addClass|current|rater|select|null|split|draw|inputs|serial|else|apply|count|typeof|undefined|blur|focus|cancel|stars|removeClass|true|arguments|false|calls|checked|val|hover|drain|div|length|disabled|attr|be|tagName|class|each|filter|spw|_|width|id|extend|INPUT|title|to||drawn|call|andSelf|prevAll|metadata|append|cancelValue|callback|applied|mouseover|string|mouseout|jQuery|on|click|removeAttr|fill|readonly|value|hide|className|options|document|number|replace|starWidth|disable|Math|floor|find|css|margin|left|px|half|live|execCommand|try|msie|BackgroundImageCache|browser|catch|change|context|before|control|span|meta|makeArray|slice|children|body|form|required|show|siblings|unnamed|is|name|enable|Cancel|Rating|type|radio|window|not'.split('|'),0,{}))
|
||||
Reference in New Issue
Block a user