Author: jleroux
Date: Sun Oct 10 18:35:02 2010 New Revision: 1006334 URL: http://svn.apache.org/viewvc?rev=1006334&view=rev Log: A patch from Sascha Rodekamp "Ofbiz Website Migration" (https://issues.apache.org/jira/browse/OFBIZ-3976) - OFBIZ-3976 Replace Prototype/Scritaculous by jQuery using the jcarousel plugin: http://sorgalla.com/projects/jcarousel/ See also current discussion on dev ML about obsolete components: http://markmail.org/message/tvfirwv6odkbxcy2 Removed: ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/script/effects.js ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/script/slides.js Modified: ofbiz/branches/jquery/specialpurpose/ofbizwebsite/config/OfbizUiLabels.xml ofbiz/branches/jquery/specialpurpose/ofbizwebsite/data/OfbizData.xml ofbiz/branches/jquery/specialpurpose/ofbizwebsite/template/HtmlHead.ftl ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/images/global.css ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/script/search.js Modified: ofbiz/branches/jquery/specialpurpose/ofbizwebsite/config/OfbizUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/specialpurpose/ofbizwebsite/config/OfbizUiLabels.xml?rev=1006334&r1=1006333&r2=1006334&view=diff ============================================================================== --- ofbiz/branches/jquery/specialpurpose/ofbizwebsite/config/OfbizUiLabels.xml (original) +++ ofbiz/branches/jquery/specialpurpose/ofbizwebsite/config/OfbizUiLabels.xml Sun Oct 10 18:35:02 2010 @@ -45,9 +45,9 @@ <value xml:lang="nl">We have<br/> street cred</value> </property> <property key="OfbizCallout5"> - <value xml:lang="en">Just like muscles,<br/> e-commerce should<br/>be flexible.</value> - <value xml:lang="fr">Just like muscles,<br/> e-commerce should<br/>be flexible.</value> - <value xml:lang="nl">Just like muscles,<br/> e-commerce should<br/>be flexible.</value> + <value xml:lang="en">Just like muscles,<br/> e-commerce should be flexible.</value> + <value xml:lang="fr">Just like muscles,<br/> e-commerce should be flexible.</value> + <value xml:lang="nl">Just like muscles,<br/> e-commerce should be flexible.</value> </property> <property key="OfbizCommunity"> <value xml:lang="en">Community</value> Modified: ofbiz/branches/jquery/specialpurpose/ofbizwebsite/data/OfbizData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/specialpurpose/ofbizwebsite/data/OfbizData.xml?rev=1006334&r1=1006333&r2=1006334&view=diff ============================================================================== --- ofbiz/branches/jquery/specialpurpose/ofbizwebsite/data/OfbizData.xml (original) +++ ofbiz/branches/jquery/specialpurpose/ofbizwebsite/data/OfbizData.xml Sun Oct 10 18:35:02 2010 @@ -96,33 +96,33 @@ under the License. </form> </div> <div id="slides"> - <div class="slideshow" id="mantleSlides"> - <div style="display: none;" id="slide1"> + <ul class="jcarousel-skin-tango" id="mantleSlides"> + <li> <div class="callout">${uiLabelMap.OfbizCallout1}</div> <div class="description">${uiLabelMap.OfbizMantle1}</div> <div class="mantle"><img src="/ofbiz/images/mantle.png"></div> - </div> - <div id="slide2" style="display: none;"> + </li> + <li> <div class="callout">${uiLabelMap.OfbizCallout2}</div> <div class="description">${uiLabelMap.OfbizMantle2}</div> <div class="mantle"><img src="/ofbiz/images/mantle2.png"></div> - </div> - <div id="slide3" style=""> + </li> + <li> <div class="callout">${uiLabelMap.OfbizCallout3}</div> <div class="description">${uiLabelMap.OfbizMantle3}</div> <div class="mantle"><img src="/ofbiz/images/mantle3.png"></div> - </div> - <div id="slide4" style="display: none;"> + </li> + <li> <div class="callout">${uiLabelMap.OfbizCallout4}</div> <div class="description">${uiLabelMap.OfbizMantle4}</div> <div class="mantle"><img src="/ofbiz/images/mantle4.png"></div> - </div> - <div id="slide5" style="display: none;"> + </li> + <li> <div class="callout">${uiLabelMap.OfbizCallout5}</div> <div class="description">${uiLabelMap.OfbizMantle5}</div> <div class="mantle"><img src="/ofbiz/images/mantle5.png"></div> - </div> - </div> + </li> + </ul> <div class="controls"> <a class="next" id="next" title="Next" href="#">Next</a> <a class="previous" id="previous" title="Previous" href="#">Previous</a> @@ -132,9 +132,48 @@ under the License. </div> <script type="text/javascript"> function StartSlides() { - new Slides('mantleSlides'); + // casrousel scrolling interval set to 2 sec + var carouselScrollInterval = 2; + + jQuery('#mantleSlides').jcarousel({ + auto: carouselScrollInterval, + wrap: "circular", + initCallback: mycarousel_initCallback, + buttonNextHTML: null, + buttonPrevHTML: null + }); + + // create functions for the controll menu + function mycarousel_initCallback(carousel) { + jQuery('#stop').bind('click', function() { + carousel.options.auto = 0; + jQuery('#start').css({"display": ""}); + jQuery('#stop').css({"display": "none"}); + return false; + }); + + jQuery('#start').bind('click', function() { + carousel.options.auto = carouselScrollInterval; + carousel.next(); + jQuery('#stop').css({"display": ""}); + jQuery('#start').css({"display": "none"}); + return false; + }); + + jQuery('#next').bind('click', function() { + carousel.next(); + return false; + }); + + jQuery('#previous').bind('click', function() { + carousel.prev(); + return false; + }); + }; + } - document.observe ('dom:loaded', StartSlides); + + jQuery(document).ready(StartSlides); </script> </div> <div id="content-wrap" class="clearfix"> @@ -330,8 +369,8 @@ under the License. </form> </div> <div id="slides"> - <div class="slideshow" id="mantleSlides"> - <div id="slide1"> + <ul class="jcarousel-skin-tango" id="mantleSlides"> + <li> <div class="callout"> The best things in life<br /> are FREE.<br /> @@ -343,8 +382,8 @@ under the License. <div class="mantle"> <img src="/ofbiz/images/mantle.png" /> </div> - </div> - <div id="slide2" style="display:none"> + </li> + <li> <div class="callout"> Lower Costs,<br /> Higher Margins.<br /> @@ -357,8 +396,8 @@ under the License. <div class="mantle"> <img src="/ofbiz/images/mantle2.png" /> </div> - </div> - <div id="slide3" style="display:none"> + </li> + <li> <div class="callout"> OPEN yourself up to all<br /> of the possibilities<br /> @@ -371,8 +410,8 @@ under the License. <div class="mantle"> <img src="/ofbiz/images/mantle3.png" /> </div> - </div> - <div id="slide4" style="display:none"> + </li> + <li> <div class="callout"> We have<br /> street cred.<br /> @@ -384,11 +423,11 @@ under the License. <div class="mantle"> <img src="/ofbiz/images/mantle4.png" /> </div> - </div> - <div id="slide5" style="display:none"> + </li> + <li> <div class="callout"> Just like muscles,<br /> - e-commerce should<br /> + e-commerce should be flexible. </div> <div class="description"> @@ -398,21 +437,60 @@ under the License. <div class="mantle"> <img src="/ofbiz/images/mantle5.png" /> </div> - </div> - </div> + </li> + </ul> <div class="controls"> <a class="next" id="next" title="Next" href="#">Next</a> <a class="previous" id="previous" title="Previous" href="#">Previous</a> - <a class="start" id="start" title="Start" href="#">Start</a> + <a class="start" id="start" style="display:none;" title="Start" href="#">Start</a> <a class="stop" id="stop" title="Stop" href="#">Stop</a> </div> </div> <script type="text/javascript"> function StartSlides() { - new Slides('mantleSlides'); + // casrousel scrolling interval set to 2 sec + var carouselScrollInterval = 2; + + jQuery('#mantleSlides').jcarousel({ + auto: carouselScrollInterval, + wrap: "circular", + initCallback: mycarousel_initCallback, + buttonNextHTML: null, + buttonPrevHTML: null + }); + + // create functions for the controll menu + function mycarousel_initCallback(carousel) { + jQuery('#stop').bind('click', function() { + carousel.options.auto = 0; + jQuery('#start').css({"display": ""}); + jQuery('#stop').css({"display": "none"}); + return false; + }); + + jQuery('#start').bind('click', function() { + carousel.options.auto = carouselScrollInterval; + carousel.next(); + jQuery('#stop').css({"display": ""}); + jQuery('#start').css({"display": "none"}); + return false; + }); + + jQuery('#next').bind('click', function() { + carousel.next(); + return false; + }); + + jQuery('#previous').bind('click', function() { + carousel.prev(); + return false; + }); + }; + } - document.observe ('dom:loaded', StartSlides); + + jQuery(document).ready(StartSlides); </script> </div> Modified: ofbiz/branches/jquery/specialpurpose/ofbizwebsite/template/HtmlHead.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/specialpurpose/ofbizwebsite/template/HtmlHead.ftl?rev=1006334&r1=1006333&r2=1006334&view=diff ============================================================================== --- ofbiz/branches/jquery/specialpurpose/ofbizwebsite/template/HtmlHead.ftl (original) +++ ofbiz/branches/jquery/specialpurpose/ofbizwebsite/template/HtmlHead.ftl Sun Oct 10 18:35:02 2010 @@ -23,17 +23,16 @@ under the License. <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <title>${uiLabelMap.OfbizTitle}</title> <link rel="shortcut icon" href="/ofbiz/images/favicon.ico"> - <script language="javascript" src="/images/prototypejs/prototype.js" type="text/javascript"></script> + <script language="javascript" src="/images/jquery/jquery-1.4.2.min.js" type="text/javascript"></script> <script language="javascript" src="/images/fieldlookup.js" type="text/javascript"></script> <script language="javascript" src="/images/selectall.js" type="text/javascript"></script> - <script language="javascript" src="/images/calendar_date_select.js" type="text/javascript"></script> - <script language="javascript" src="/images/calendarDateSelect/locale/${(parameters.userLogin.lastLocale?substring(0,2))!initialLocale?substring(0,2)!'en'}.js" type="text/javascript"></script> - <script language="javascript" src="/ofbiz/script/effects.js" type="text/javascript"></script> <script language="javascript" src="/ofbiz/script/search.js" type="text/javascript"></script> - <script language="javascript" src="/ofbiz/script/slides.js" type="text/javascript"></script> + <script language="javascript" src="/images/jquery/plugins/jcarousel/jquery.jcarousel.min.js"></script> + <link rel="stylesheet" type="text/css" href="/images/jquery/plugins/jcarousel/skins/tango/skin.css" /> + <link rel="stylesheet" href="/ofbiz/images/global.css" type="text/css"/> - + <meta content="OFBiz_Thai for Thai user" name="Description"/> <meta content="Open Source ERP,Open Source CRM,Open Source E-Commerce,Open Source eCommerce,Open Source POS,Open Source SCM,Open Source MRP,Open Source CMMS,Open Source EAM,web services,workflow,ebusiness,e-business,ecommerce,e-commerce,automation,enterprise software,open source,entity engine,service engine,erp,crm,party,accounting,facility,supply,chain,management,catalog,order,project,task,work effort,financial,ledger,content management,customer,inventory" name="keywords"/> </head> Modified: ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/images/global.css URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/images/global.css?rev=1006334&r1=1006333&r2=1006334&view=diff ============================================================================== --- ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/images/global.css (original) +++ ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/images/global.css Sun Oct 10 18:35:02 2010 @@ -812,6 +812,7 @@ body#home #header #slides { position: absolute; top: 128px; left: 10px; + overflow: hidden; background: url(/ofbiz/images/slideshow-bg.jpg) top center no-repeat; width: 923px; height: 260px; @@ -825,7 +826,7 @@ body#home #header #slides .slideshow { } body#home #header #slides .callout { - position: absolute; + position: relative; top: 35px; left: 30px; font-size: 30px; @@ -834,8 +835,8 @@ body#home #header #slides .callout { } body#home #header #slides .description { - position: absolute; - top: 175px; + position: relative; + top: 110px; left: 30px; font-size: 14px; line-height: 15px; @@ -896,9 +897,21 @@ body#home #header #slides .controls a im } body#home #header #slides .mantle{ - position:absolute; - top:58px; + position:relative; + top:-80px; left:385px; + float:right; +} + +#mantleSlides{ + width: 20000em; + height: 260px; + position: absolute; +} + +#mantleSlides div { + float:left; + width: 923px; } body#home #col1 { Modified: ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/script/search.js URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/script/search.js?rev=1006334&r1=1006333&r2=1006334&view=diff ============================================================================== --- ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/script/search.js (original) +++ ofbiz/branches/jquery/specialpurpose/ofbizwebsite/webapp/ofbiz/script/search.js Sun Oct 10 18:35:02 2010 @@ -17,24 +17,17 @@ * under the License. */ -function initSearch(){ - var methods = { - defaultValueActsAsHint: function(element){ - element = $(element); - element._default = element.value; - return element.observe('focus', function(){ - if(element._default != element.value) return; - element.removeClassName('hint').value = ''; - }).observe('blur', function(){ - if(element.value.strip() != '') return; - element.addClassName('hint').value = element._default; - }).addClassName('hint'); +jQuery(document).ready(function () { + var jOsearchDocs = jQuery('#searchDocs'); + var _default = jOsearchDocs.val(); + + jOsearchDocs.focus(function() { + if (jOsearchDocs.val() != "") { + jOsearchDocs.val("").removeClass("hint"); } - }; - $w('input textarea').each(function(tag){ Element.addMethods(tag, methods) }); -} -initSearch(); - -document.observe('dom:loaded', function(){ - $('searchDocs').defaultValueActsAsHint(); + }).blur(function() { + if (jOsearchDocs.val() == "") { + jOsearchDocs.val(_default).addClass("hint"); + } + }); }); \ No newline at end of file |
Free forum by Nabble | Edit this page |