[Movecommons-commits] r330 - in trunk: src src/images wp-theme
Mario Gallegos
mgallegos at ourproject.org
Thu May 10 19:47:01 CEST 2012
Author: mgallegos
Date: 2012-05-10 19:47:01 +0200 (Thu, 10 May 2012)
New Revision: 330
Added:
trunk/src/images/checkbox.png
trunk/src/jquery.checkbox.css
trunk/src/jquery.checkbox.min.js
Modified:
trunk/src/mc-dia-form2.js
trunk/wp-theme/mc2-form.php
Log:
Added: trunk/src/images/checkbox.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/images/checkbox.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/jquery.checkbox.css
===================================================================
--- trunk/src/jquery.checkbox.css (rev 0)
+++ trunk/src/jquery.checkbox.css 2012-05-10 17:47:01 UTC (rev 330)
@@ -0,0 +1,25 @@
+.jquery-checkbox {display: inline; font-size: 20px; line-height: 20px; cursor: pointer; cursor: hand;}
+.jquery-checkbox .mark {display: inline;}
+
+.jquery-checkbox img {vertical-align: middle; width: 60px; height: 20px;}
+.jquery-checkbox img{background: transparent url(/mc/0.1/images/checkbox.png) no-repeat;}
+
+.jquery-checkbox img{
+ background-position: 0px 0px;
+}
+.jquery-checkbox-hover img{
+ background-position: 0px -20px;
+}
+.jquery-checkbox-checked img{
+ background-position: 0px -40px;
+}
+.jquery-checkbox-checked .jquery-checkbox-hover img {
+ background-position: 0px -60px;
+}
+
+.jquery-checkbox-disabled img{
+ background-position: 0px -80px;
+}
+.jquery-checkbox-checked .jquery-checkbox-disabled img{
+ background-position: 0px -100px;
+}
\ No newline at end of file
Added: trunk/src/jquery.checkbox.min.js
===================================================================
--- trunk/src/jquery.checkbox.min.js (rev 0)
+++ trunk/src/jquery.checkbox.min.js 2012-05-10 17:47:01 UTC (rev 330)
@@ -0,0 +1 @@
+(function($){var i=function(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation()};$.fn.checkbox=function(f){try{document.execCommand('BackgroundImageCache',false,true)}catch(e){}var g={cls:'jquery-checkbox',empty:'empty.png'};g=$.extend(g,f||{});var h=function(a){var b=a.checked;var c=a.disabled;var d=$(a);if(a.stateInterval)clearInterval(a.stateInterval);a.stateInterval=setInterval(function(){if(a.disabled!=c)d.trigger((c=!!a.disabled)?'disable':'enable');if(a.checked!=b)d.trigger((b=!!a.checked)?'check':'uncheck')},10);return d};return this.each(function(){var a=this;var b=h(a);if(a.wrapper)a.wrapper.remove();a.wrapper=$('<span class="'+g.cls+'"><span class="mark"><img src="'+g.empty+'" /></span></span>');a.wrapperInner=a.wrapper.children('span:eq(0)');a.wrapper.hover(function(e){a.wrapperInner.addClass(g.cls+'-hover');i(e)},function(e){a.wrapperInner.removeClass(g.cls+'-hover');i(e)});b.css({position:'absolute',zIndex:-1,visibility:'hidden'}).after(a.wrapper);var c=false;if(b.attr('id')){c=$('label[for='+b.attr('id')+']');if(!c.length)c=false}if(!c){c=b.closest?b.closest('label'):b.parents('label:eq(0)');if(!c.length)c=false}if(c){c.hover(function(e){a.wrapper.trigger('mouseover',[e])},function(e){a.wrapper.trigger('mouseout',[e])});c.click(function(e){b.trigger('click',[e]);i(e);return false})}a.wrapper.click(function(e){b.trigger('click',[e]);i(e);return false});b.click(function(e){i(e)});b.bind('disable',function(){a.wrapperInner.addClass(g.cls+'-disabled')}).bind('enable',function(){a.wrapperInner.removeClass(g.cls+'-disabled')});b.bind('check',function(){a.wrapper.addClass(g.cls+'-checked')}).bind('uncheck',function(){a.wrapper.removeClass(g.cls+'-checked')});$('img',a.wrapper).bind('dragstart',function(){return false}).bind('mousedown',function(){return false});if(window.getSelection)a.wrapper.css('MozUserSelect','none');if(a.checked)a.wrapper.addClass(g.cls+'-checked');if(a.disabled)a.wrapperInner.addClass(g.cls+'-disabled')})}})(jQuery);
\ No newline at end of file
Modified: trunk/src/mc-dia-form2.js
===================================================================
--- trunk/src/mc-dia-form2.js 2012-05-09 18:39:44 UTC (rev 329)
+++ trunk/src/mc-dia-form2.js 2012-05-10 17:47:01 UTC (rev 330)
@@ -313,7 +313,7 @@
var keywordsIni = "";
// var click_to_select = $j("#mc-form-gr").attr("title"); // store of title value
-conf_link("np");
+//conf_link("np");
conf_link("rp");
conf_link("rc");
conf_link("gr");
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-05-09 18:39:44 UTC (rev 329)
+++ trunk/wp-theme/mc2-form.php 2012-05-10 17:47:01 UTC (rev 330)
@@ -78,6 +78,7 @@
<div id="mc-form-more-link-np" class="mc-form-link"><?php _e("What is this?", "mc"); ?></div>
<div id="mc-form-less-link-np" class="mc-form-link"><?php _e("less info", "mc"); ?></div>
<div class="mc-form-descbox-header"><?php _e("Non-Profit", "mc"); ?></div>
+ <input id="np-checkbox" name="np-checkbox" type="checkbox" onclick="var j = jQuery('#check').attr('disabled', jQuery('#check').attr('disabled') ? false : true)">
<div class="mc-form-descbox-intro"><?php _e("Your initiative does not seek economic benefit", "mc"); ?></div>
<div id="mc-form-more-text-np" class="mc-form-more-text-v2">
<?php _e("<ul> <li>The initiative does not seek economic benefit</li> <li>Any surplus funds of the initiative are used to help pursue its goals instead of distributing them to owners or shareholders.</li> </ul>", "mc"); ?>
@@ -323,8 +324,10 @@
<script type='text/javascript' src='/mc/0.1/jquery.bxSlider.js'></script>
<script type='text/javascript' src='/mc/0.1/jquery.infieldlabel.min.js'></script>
<script type='text/javascript' src='/mc/0.1/jquery.blockUI.js'></script>
+<script type='text/javascript' src='/mc/0.1/jquery.checkbox.min.js'></script>
<script type="text/javascript" src="/mc/0.1/mc-dia-form2.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/black-tie/jquery-ui.css"/>
+<link rel="stylesheet" type="text/css" href="/mc/0.1/jquery.checkbox.min.js"/>
<script type="text/javascript">
$j('#languages').tagsInput({width:'400px',defaultText:'Add a language'});
@@ -337,6 +340,7 @@
$j('#infield-url').inFieldLabels();
$j('#infield-terms-of-use-website').inFieldLabels();
$j('#slider1').bxSlider();
+ $j('#np-checkbox').checkbox();
//$j('div.blockMe1').block({ message: null });
//$j('div.blockMe2').block({ message: null });
//$j('div.blockMe3').block({ message: null });
More information about the Movecommons-commits
mailing list