Author: mgallegos Date: 2012-03-15 02:17:00 +0100 (Thu, 15 Mar 2012) New Revision: 213 Added: trunk/src/jquery.infieldlabel.min.js Modified: trunk/wp-theme/mc2-form.php Log: Added: trunk/src/jquery.infieldlabel.min.js =================================================================== --- trunk/src/jquery.infieldlabel.min.js (rev 0) +++ trunk/src/jquery.infieldlabel.min.js 2012-03-15 01:17:00 UTC (rev 213) @@ -0,0 +1,12 @@ +/* + * In-Field Label jQuery Plugin + * http://fuelyourcoding.com/scripts/infield.html + * + * Copyright (c) 2009 Doug Neiner + * Dual licensed under the MIT and GPL licenses. + * Uses the same license as jQuery, see: + * http://docs.jquery.com/License + * + * @version 0.1 + */ +(function($){$.InFieldLabels=function(b,c,d){var f=this;f.$label=$(b);f.label=b;f.$field=$(c);f.field=c;f.$label.data("InFieldLabels",f);f.showing=true;f.init=function(){f.options=$.extend({},$.InFieldLabels.defaultOptions,d);if(f.$field.val()!=""){f.$label.hide();f.showing=false};f.$field.focus(function(){f.fadeOnFocus()}).blur(function(){f.checkForEmpty(true)}).bind('keydown.infieldlabel',function(e){f.hideOnChange(e)}).change(function(e){f.checkForEmpty()}).bind('onPropertyChange',function(){f.checkForEmpty()})};f.fadeOnFocus=function(){if(f.showing){f.setOpacity(f.options.fadeOpacity)}};f.setOpacity=function(a){f.$label.stop().animate({opacity:a},f.options.fadeDuration);f.showing=(a>0.0)};f.checkForEmpty=function(a){if(f.$field.val()==""){f.prepForShow();f.setOpacity(a?1.0:f.options.fadeOpacity)}else{f.setOpacity(0.0)}};f.prepForShow=function(e){if(!f.showing){f.$label.css({opacity:0.0}).show();f.$field.bind('keydown.infieldlabel',function(e){f.hideOnChange(e)})}};f.hideOnChange=function(e){if((e.keyCode==16)||(e.keyCode==9))return;if(f.showing){f.$label.hide();f.showing=false};f.$field.unbind('keydown.infieldlabel')};f.init()};$.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};$.fn.inFieldLabels=function(c){return this.each(function(){var a=$(this).attr('for');if(!a)return;var b=$("input#"+a+"[type='text'],"+"input#"+a+"[type='password'],"+"textarea#"+a);if(b.length==0)return;(new $.InFieldLabels(this,b[0],c))})}})(jQuery); \ No newline at end of file Modified: trunk/wp-theme/mc2-form.php =================================================================== --- trunk/wp-theme/mc2-form.php 2012-03-15 00:22:20 UTC (rev 212) +++ trunk/wp-theme/mc2-form.php 2012-03-15 01:17:00 UTC (rev 213) @@ -69,16 +69,22 @@ <label id="mc-optional-non-profit"><?php _e("Optional", "mc"); ?></label> <label class="optional-labels-fields"> <input type="checkbox" name="registered-non-profit" value="S" id="registered-non-profit"/> - <?php _e("We are registered as Non-profit", "mc"); ?> + <?php _e("We are registered as Non-profit, check this webpage:", "mc"); ?> </label> + <label id="infield-non-profit-website" for="non-profit-website">something like http://example.com</label> + <input type="text" name="non-profit-website" value="" id="non-profit-website"> <label class="optional-labels-fields"> <input type="checkbox" name="open-accounting" value="S" id="open-accounting" /> - <?php _e("We have Open-accounting", "mc"); ?> + <?php _e("We have Open-accounting, check this webpage:", "mc"); ?> </label> + <label id="infield-open-accounting-website" for="open-accounting-website">something like http://example.com</label> + <input type="text" name="open-accounting-website" value="" id="open-accounting-website"> <label class="optional-labels-fields"> <input type="checkbox" name="accept-donations" value="S" id="accept-donations" /> - <?php _e("We accept donations", "mc"); ?> - </label> + <?php _e("We accept donations, check this webpage:", "mc"); ?> + </label> + <label id="infield-donation-website" for="donation-website">something like http://example.com</label> + <input type="text" name="donation-website" value="" id="donation-website"> </div> </div> </div> @@ -109,7 +115,7 @@ <label id="mc-optional-reproducible"><?php _e("Optional", "mc"); ?></label> <label class="optional-labels-fields"> <input type="checkbox" name="terms-of-use" value="S" id="terms-of-use"/> - <?php _e("We have Terms of Use of our contents in this webpage:", "mc"); ?> + <?php _e("We have Terms of Use of our contents in this webpage:", "mc"); ?> </label> <label class="optional-labels-fields"> <?php _e("We use this license for sharing our contents:", "mc"); ?> @@ -239,145 +245,21 @@ </div> </div> <div class="mc-clean"></div> - <!-- - <div class="mc-cat-group-a" id="mc-cat-group-a"> - <div class="mc-form-rounded mc-form-category-group mc-form-category-group-a float-left mc-form-category-group-aa" id="mc-form-category-group-aa"> - <img src="/mc/0.1/images/step1.png" alt="step1" class="mc-steps-number-v2" /> - <img src="/mc/0.1/images/cat-selected.png" alt="selected" class="mc-cat-selected mc-cat-selected-a" id="mc-cat-selected-np" /> - <div id="mc-form-np" class="mc-form-rounded mc-form-descbox mc-form-descbox-a" title="<?php _e("Click to select", "mc"); ?>"> - <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> - <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"); ?></div> - </div> - <div class="mc-form-icon mc-form-icon-a"> - <img id="mc-form-icon-np" alt="np" src="/mc/0.1/images/np60.png" /> - </div> - <div class="mc-form-or"> -or</div> - <img src="/mc/0.1/images/cat-selected.png" alt="selected" class="mc-cat-selected mc-cat-selected-b" id="mc-cat-selected-nnp" /> - <div id="mc-form-nnp" class="mc-form-rounded mc-form-descbox mc-form-descbox-b" title="<?php _e("Click to select", "mc"); ?>"> - <div id="mc-form-more-link-nnp" class="mc-form-link"><?php _e("What is this?", "mc"); ?></div> - <div class="mc-form-descbox-header"><?php _e("For-Profit", "mc"); ?></div> - <div id="mc-form-less-link-nnp" class="mc-form-link"><?php _e("less info", "mc"); ?></div> - <div class="mc-form-descbox-intro"><?php _e("Your initiative seeks economic benefit", "mc"); ?></div> - <div id="mc-form-more-text-nnp" class="mc-form-more-text-v2"> -<?php _e("<ul> <li>The initiative seeks both economic benefit and reaching their aims</li> <li>The initiative uses its surplus funds to reward its employees and/or shareholders </li> </ul>", "mc"); ?></div> - </div> - <div class="mc-form-icon mc-form-icon-b"> - <img id="mc-form-icon-nnp" alt="nnp" src="/mc/0.1/images/nnp60.png" /> - </div> - </div> - <div class="mc-form-rounded mc-form-category-group mc-form-category-group-b float-left mc-form-category-group-ab" id="mc-form-category-group-ab"> - <img src="/mc/0.1/images/step2.png" alt="step2" class="mc-steps-number-v2" /> - <img src="/mc/0.1/images/cat-selected.png" alt="selected" class="mc-cat-selected mc-cat-selected-a" id="mc-cat-selected-nrp" /> - <div id="mc-form-nrp" class="mc-form-rounded mc-form-descbox mc-form-descbox-a" title="<?php _e("Click to select", "mc"); ?>"> - <div id="mc-form-more-link-nrp" class="mc-form-link"><?php _e("What is this?", "mc"); ?></div> - <div id="mc-form-less-link-nrp" class="mc-form-link"><?php _e("less info", "mc"); ?></div> - <div class="mc-form-descbox-header"><?php _e("Exclusive", "mc"); ?></div> - <div class="mc-form-descbox-intro"><?php _e("Your initiative prefers to protect their work and not disclose it to others", "mc"); ?></div> - <div id="mc-form-more-text-nrp" class="mc-form-more-text-v2"> -<?php _e("<ul> <li>The initiative protects its work, for instance with full copyright, not allowing others to copy it without permission</li> <li>The initiative's internal methods and mechanics are discrete and not disclosed to the public</li> </ul>", "mc"); ?></div> - </div> - <div class="mc-form-icon mc-form-icon-a"> - <img id="mc-form-icon-nrp" alt="nrp" src="/mc/0.1/images/nrp60.png" /> - </div> - <div class="mc-form-or"><?php _e("or", "mc"); ?></div> - <img src="/mc/0.1/images/cat-selected.png" alt="selected" class="mc-cat-selected mc-cat-selected-b" id="mc-cat-selected-rp" /> - <div id="mc-form-rp" class="mc-form-rounded mc-form-descbox mc-form-descbox-b" title="<?php _e("Click to select", "mc"); ?>"> - <div id="mc-form-more-link-rp" class="mc-form-link"><?php _e("What is this?", "mc"); ?></div> - <div id="mc-form-less-link-rp" class="mc-form-link"><?php _e("less info", "mc"); ?></div> - <div class="mc-form-descbox-header"><?php _e("Reproducible", "mc"); ?></div> - <div class="mc-form-descbox-intro"><?php _e("Your initiative is visible, open and transparent, which allows it to be adapted by others", "mc"); ?></div> - <div id="mc-form-more-text-rp" class="mc-form-more-text-v2"> -<?php _e("<ul> <li>The initiative is easily visible to anyone, providing the necessary online material</li> <li>The initiative has transparent procedures and results</li> <li>The initiative allows others to copy and adapt their procedures and materials, probably using <a href=\"http://creativecommons.org/\">Creative Commons</a> licenses for them</li> </ul>", "mc"); ?></div> - </div> - <div class="mc-form-icon mc-form-icon-b"> - <img id="mc-form-icon-rp" alt="rp" src="/mc/0.1/images/rp60.png" /> - </div> - </div> - </div> - <div class="mc-clean"></div> - <div class="mc-cat-group-b" id="mc-cat-group-b"> - <div class="mc-form-rounded mc-form-category-group mc-form-category-group-b float-left mc-form-category-group-bb" id="mc-form-category-group-bb"> - <img src="/mc/0.1/images/step3.png" alt="step3" class="mc-steps-number-v2" /> - <img src="/mc/0.1/images/cat-selected.png" alt="selected" class="mc-cat-selected mc-cat-selected-a" id="mc-cat-selected-rc" /> - <div id="mc-form-rc" class="mc-form-rounded mc-form-descbox mc-form-descbox-a" title="<?php _e("Click to select", "mc"); ?>"> - <div id="mc-form-more-link-rc" class="mc-form-link"><?php _e("What is this?", "mc"); ?></div> - <div id="mc-form-less-link-rc" class="mc-form-link"><?php _e("less info", "mc"); ?></div> - <div class="mc-form-descbox-header"><?php _e("Reinforcing the Commons", "mc"); ?></div> - <div class="mc-form-descbox-intro"><?php _e("Your initiative protectes/expands The Commons, resources that are collectively owned", "mc"); ?></div> - <div id="mc-form-more-text-rc" class="mc-form-more-text-v2"><?php _e("The Commons are those resources that are collectively owned or shared among populations. Thus, your initiative is promoting The Commons by focusing its work in protecting/expanding any of them in any particular area of action", "mc"); ?></div> - <div class="mc-cat-rc-options" id="mc-cat-rc-options"> <div class="mc-cat-rc-options-intro" id="mc-cat-rc-options-intro"><?php _e("Which area is the main focus of your initiative?", "mc"); ?></div><div class="mc-cat-rc-option-box-v2" id="mc-cat-rc-option-box-ec"> <div class="mc-cat-rc-option-text"><?php _e("Nature Commons", "mc"); ?></div><div class="mc-cat-rc-option-desc"> -<?php _e("the natural environment: forests, seeds, the Moon", "mc"); ?></div></div><div class="mc-cat-rc-option-icon" id="mc-cat-rc-option-icon-ec"><img src="/mc/0.1/images/rcec25.png" alt="ec" /></div><div class="mc-cat-rc-option-box-v2" id="mc-cat-rc-option-box-bo"> <div class="mc-cat-rc-option-text"> -<?php _e("Body/Health Commons", "mc"); ?></div><div class="mc-cat-rc-option-desc"> -<?php _e("the human bodies: blood donation, smiles, non-alienation", "mc"); ?></div></div><div class="mc-cat-rc-option-icon" id="mc-cat-rc-option-icon-bo"><img src="/mc/0.1/images/rcbo25.png" alt="bo" /></div><div class="mc-cat-rc-option-box-v2" id="mc-cat-rc-option-box-to"> <div class="mc-cat-rc-option-text"> -<?php _e("Town/Community/Society Commons", "mc"); ?></div><div class="mc-cat-rc-option-desc"> -<?php _e("the socio-cultural spaces: language, music, streets, science", "mc"); ?></div></div><div class="mc-cat-rc-option-icon" id="mc-cat-rc-option-icon-to"><img src="/mc/0.1/images/rcto25.png" alt="to" /></div><div class="mc-cat-rc-option-box-v2" id="mc-cat-rc-option-box-di"> <div class="mc-cat-rc-option-text"> -<?php _e("Digital Commons", "mc"); ?></div><div class="mc-cat-rc-option-desc"> -<?php _e("the cyberspace: internet, cyber-rights, Wikipedia", "mc"); ?></div></div><div class="mc-cat-rc-option-icon" id="mc-cat-rc-option-icon-di"><img src="/mc/0.1/images/rcdi25.png" alt="di" /></div></div> - </div> - <div class="mc-form-icon mc-form-icon-a"> - <img id="mc-form-icon-rc" alt="rc" src="/mc/0.1/images/rc60.png" /> - </div> - <div class="mc-form-or"> -or</div> - <img src="/mc/0.1/images/cat-selected.png" alt="selected" class="mc-cat-selected mc-cat-selected-b" id="mc-cat-selected-nrc" /> - <div id="mc-form-nrc" class="mc-form-rounded mc-form-descbox mc-form-descbox-b" title="<?php _e("Click to select", "mc"); ?>"> - <div id="mc-form-more-link-nrc" class="mc-form-link"><?php _e("What is this?", "mc"); ?></div> - <div id="mc-form-less-link-nrc" class="mc-form-link"><?php _e("less info", "mc"); ?></div> - <div class="mc-form-descbox-header"><?php _e("Reinforcing Other Aims", "mc"); ?></div> - <div class="mc-form-descbox-intro"><?php _e("Your initiative focuses on other areas different than The Commons", "mc"); ?></div> - <div id="mc-form-more-text-nrc" class="mc-form-more-text-v2"><?php _e("Your initiative prefers to tackle other issues not directly related to the protection/expansion of the Commons", "mc"); ?></div> - </div> - <div class="mc-form-icon mc-form-icon-b"> - <img id="mc-form-icon-nrc" alt="nrc" src="/mc/0.1/images/nrc60.png" /> - </div> - </div> - <div class="mc-form-rounded mc-form-category-group mc-form-category-group-a float-left mc-form-category-group-ba" id="mc-form-category-group-ba"> - <img src="/mc/0.1/images/step4.png" alt="step4" class="mc-steps-number-v2" /> - <img src="/mc/0.1/images/cat-selected.png" alt="selected" class="mc-cat-selected mc-cat-selected-a" id="mc-cat-selected-ngr" /> - <div id="mc-form-ngr" class="mc-form-rounded mc-form-descbox mc-form-descbox-a" title="<?php _e("Click to select", "mc"); ?>"> - <div id="mc-form-more-link-ngr" class="mc-form-link"><?php _e("What is this?", "mc"); ?></div> - <div id="mc-form-less-link-ngr" class="mc-form-link"><?php _e("less info", "mc"); ?></div> - <div class="mc-form-descbox-header"><?php _e("Representative", "mc"); ?></div> - <div class="mc-form-descbox-intro"><?php _e("Your initiative is driven by representatives", "mc"); ?></div> - <div id="mc-form-more-text-ngr" class="mc-form-more-text-v2"> -<?php _e("<ul> <li>The initiative believes in their representatives for tackling most issues</li> <li>The division of tasks is structured with defined roles in different hierarchical levels</li> </ul>", "mc"); ?></div> - </div> - <div class="mc-form-icon mc-form-icon-a">/ - <img id="mc-form-icon-ngr" alt="ngr" src="/mc/0.1/images/ngr60.png" /> - </div> - <div class="mc-form-or"> -or</div> - <img src="/mc/0.1/images/cat-selected.png" alt="selected" class="mc-cat-selected mc-cat-selected-b" id="mc-cat-selected-gr" /> - <div id="mc-form-gr" class="mc-form-rounded mc-form-descbox mc-form-descbox-b" title=" -Click to select"> - <div id="mc-form-more-link-gr" class="mc-form-link"><?php _e("What is this?", "mc"); ?></div> - <div id="mc-form-less-link-gr" class="mc-form-link"><?php _e("less info", "mc"); ?></div> - <div class="mc-form-descbox-header"><?php _e("Grassroots", "mc"); ?></div> - <div class="mc-form-descbox-intro"><?php _e("Your initiative is driven by horizontal collective decisions", "mc"); ?></div> - <div id="mc-form-more-text-gr" class="mc-form-more-text-v2"> -<?php _e("<ul> <li>The initiative follows collective decision-making procedures for tackling most issues</li> <li>The hierarchical structure is minimal or inexistent. That is, horizontal grassroots discussions of the members have a major weight when compared with vertical instructions from the board</li> </ul>", "mc"); ?></div> - </div> - <div class="mc-form-icon mc-form-icon-b"> - <img id="mc-form-icon-gr" alt="gr" src="/mc/0.1/images/gr60.png" /> - </div> - </div> - </div> - <div class="mc-clean"></div> - --> + + <div class="mc-dia-continue-btn" id="mc-dia-continue-btn"><?php _e("Continue", "mc"); ?></div> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript" src="/mc/0.1/jquery.tagsinput.min.js"></script> <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js'></script> +<script type='text/javascript' src='/mc/0.1/jquery.infieldlabel.min.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"/> <script type="text/javascript" src="/mc/0.1/mc-dia-form2.js"></script> <script type="text/javascript"> $('#languages').tagsInput({width:'415px',defaultText:'Add a language'}); $('#keywords').tagsInput({width:'415px',defaultText:'Add a keyword'}); + $('#infield-donation-website').inFieldLabels(); + $('#infield-non-profit-website').inFieldLabels(); + $('#infield-open-accounting-website').inFieldLabels(); //$( "#format" ).buttonset(); </script> \ No newline at end of file