|
Author: jleroux
Date: Sun Oct 3 11:36:38 2010 New Revision: 1003949 URL: http://svn.apache.org/viewvc?rev=1003949&view=rev Log: A patch from Sascha Rodekamp OFBIZ-3966 TestToolsApplicationMigration.patch Sascha: One of patches for different components. Jacques: using document.getElementById instead of $( or jQuery('# is certainly a good idea! Modified: ofbiz/branches/jquery/framework/testtools/webapp/testtools/SeleniumTest.ftl ofbiz/branches/jquery/framework/testtools/widget/CommonScreens.xml Modified: ofbiz/branches/jquery/framework/testtools/webapp/testtools/SeleniumTest.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/testtools/webapp/testtools/SeleniumTest.ftl?rev=1003949&r1=1003948&r2=1003949&view=diff ============================================================================== --- ofbiz/branches/jquery/framework/testtools/webapp/testtools/SeleniumTest.ftl (original) +++ ofbiz/branches/jquery/framework/testtools/webapp/testtools/SeleniumTest.ftl Sun Oct 3 11:36:38 2010 @@ -66,50 +66,50 @@ under the License. </td> </tr> </table> -<script type="text/javascript"> +<script type="text/javascript"> var progressBar; // click start load call servlet & new progressBar function clickDownLoad(url){ startDownLoad(url); - $('progress_bar').style.display = ""; - $('filesize').style.display = ""; + document.getElementById('progress_bar').style.display = ""; + document.getElementById('filesize').style.display = ""; progressBar = new Control.ProgressBar('progress_bar'); } - + function startDownLoad(url){ - var pars = ''; - var myAjax = new Ajax.Request( url, { - method: 'post', - parameters: pars, - onLoading:getProgressDownloadStatus, - onComplete : $('download').innerHTML = 'loading....' - } ); + jQuery.ajax({ + url: url, + type: "POST", + beforeSend: getProgressDownloadStatus, + complete: function(data) {document.getElementById('download').innerHTML = '${uiLabel.CommonLoading}'} + }); } - + //function PeriodicalExecuter check download status function getProgressDownloadStatus(){ - new PeriodicalExecuter(function(event){ - var pars = ''; - var myAjax = new Ajax.Request( '<@ofbizUrl>progressDownloadStatus</@ofbizUrl>', { - method: 'get', - parameters: pars, - onSuccess:function check(transfer){ - var data = transfer.responseText.evalJSON(true); - if( data != null ){ - if(data.contentLength != null && data.loadPercent != null){ - var loadPercent = data.loadPercent; - $('loadpercent').innerHTML = ''+loadPercent+'%'; - var contentLength = data.contentLength; - //$('filesize').innerHTML = '<b>'+contentLength/1000 + ' k</b>'; - progressBar.setProgress(loadPercent); - if(loadPercent > 99){ - $('download').innerHTML = 'download'; - event.stop(); + jQuery.fjTimer({ + interval: 1000, + repeat: true, + tick: function(counter, timerId) { + jQuery.ajax({ + url: "<@ofbizUrl>progressDownloadStatus</@ofbizUrl>", + type: "GET", + succuess: function(data) { + if( data != null ){ + if(data.contentLength != null && data.loadPercent != null){ + var loadPercent = data.loadPercent; + document.getElementById('loadpercent').innerHTML = ''+loadPercent+'%'; + var contentLength = data.contentLength; + progressBar.setProgress(loadPercent); + if(loadPercent > 99){ + document.getElementById('download').innerHTML = '${uiLabel.CommonDownloaded}'; + timerId.stop(); + } } - } - } + } } - } ); - },1); + }); + } + }); } </script> \ No newline at end of file Modified: ofbiz/branches/jquery/framework/testtools/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/testtools/widget/CommonScreens.xml?rev=1003949&r1=1003948&r2=1003949&view=diff ============================================================================== --- ofbiz/branches/jquery/framework/testtools/widget/CommonScreens.xml (original) +++ ofbiz/branches/jquery/framework/testtools/widget/CommonScreens.xml Sun Oct 3 11:36:38 2010 @@ -62,14 +62,11 @@ </widgets> </section> </screen> - + <screen name="selenium"> <section> <actions> - <set field="tabButtonItem" value="selenium"/> - <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/> - <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/control.progress_bar.js" global="true"/> - <set field="layoutSettings.styleSheets[]" value="/images/prototypejs/progress_bar.css" global="true"/> + <set field="tabButtonItem" value="selenium"/> <entity-one entity-name="SeleniumTestSuitePath" value-field="testSuitePath"> <field-map field-name="testSuiteId" value="${parameters.testSuiteId}"/> </entity-one> |
| Free forum by Nabble | Edit this page |
