From: <ru...@us...> - 2009-09-01 11:38:14
|
Revision: 7096 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7096&view=rev Author: rurban Date: 2009-09-01 11:38:07 +0000 (Tue, 01 Sep 2009) Log Message: ----------- Support xmlrpc start_debug (Zend Debugger): enable js debugging then Modified Paths: -------------- trunk/themes/default/moacdropdown/js/acdropdown.js trunk/themes/default/templates/search.tmpl Modified: trunk/themes/default/moacdropdown/js/acdropdown.js =================================================================== --- trunk/themes/default/moacdropdown/js/acdropdown.js 2009-08-31 11:28:47 UTC (rev 7095) +++ trunk/themes/default/moacdropdown/js/acdropdown.js 2009-09-01 11:38:07 UTC (rev 7096) @@ -128,8 +128,9 @@ cAutocomplete.prototype.init = function( sInputId ) { - this.bDebug = false - /*this.bDebug = true*/ + /*this.bDebug = false*/ + /*this.bDebug = true*/ + this.bDebug = true this.sInputId = sInputId this.sListId = cAutocomplete.CS_LIST_PREFIX + sInputId @@ -673,14 +674,14 @@ sStartWith = sStartWith.replace( /\s$/, '' ) if( sMethodName.indexOf( '?' ) > 0 ) - { + { sMethodName = sMethodName.replace( '/^.+\?/', '' ) sURL = sURL.replace( '/\?.+$/', '' ) - } + } else - { + { sURL = xmlrpc_url - } + } if (sMethodName.length < 1) { @@ -701,26 +702,30 @@ { sRequest += '<params>\n' for( var nI = 1; nI < aMethodArgs.length; nI++ ) - { + { var sArg = aMethodArgs[ nI ]; //this.debug('sMethodName: "'+sMethodName+'" sArg['+nI+']: "'+sArg+'"') if( sArg.indexOf( '[S]' ) >= 0 ) - { + { //this.debug('sArg['+nI+']: "'+sArg+'" sStartWith: "'+sStartWith+'"') sArg = sArg.replace( '[S]', sStartWith ) - } + } // We could parse a prepended "(int)" cast. // Can only do string args so far - sRequest += '<param><value><string>' - sRequest += sArg - sRequest += '</string></value></param>\n' - } + if (sArg == 'debug') { + this.bDebug = true; + } else { + sRequest += '<param><value><string>' + sRequest += sArg + sRequest += '</string></value></param>\n' + } + } sRequest += '</params>\n' } sRequest += '</methodCall>' if (this.bDebug) { + sURL += '?start_debug=1' this.debug('url: "'+sURL+'" sRequest: "'+sRequest.substring(20)+'"') - /*sURL += '?start_debug=1'*/ } this.hXMLHttp.open( 'POST', sURL, true ) var hAC = this @@ -1366,7 +1371,11 @@ var hContainer = document.createElement( 'DIV' ) hContainer.className = 'debug' hContainer.innerHTML = s - hInput.form.appendChild( hContainer ) + var hDiv = hInput.form.parentNode + /*if (hDiv.childNodes[1] && hDiv.childNodes[1].className == 'debug') + hDiv.insertBefore( hContainer, hDiv.childNodes[1] ) + else*/ + hDiv.appendChild( hContainer ) /*alert(s)*/ } } @@ -1448,22 +1457,22 @@ if( hInput.form ) { hInput.form.bLocked = true - if (hAC.bDebug) { hAC.debug ("onInputKeyDown form blocked") } + //if (hAC.bDebug) { hAC.debug ("onInputKeyDown form blocked") } } if ( hEvent.keyCode == 13 || hEvent.keyCode == 27 || hEvent.keyCode == 38 || hEvent.keyCode == 40 ) { if( hEvent.preventDefault ) { hEvent.preventDefault() - /* - if (hEvent.keyCode == 13) { - if (hAC.bDebug) { hAC.debug ("preventDefault: return true") } - return true - } - */ } else { if (hAC.bDebug) { hAC.debug ("no preventDefault return false") } } + if (hEvent.keyCode == 13) { + /*if (hAC.bDebug) { hAC.debug ("Enter") }*/ + hEvent.cancelBubble = true + hEvent.returnValue = true + return true + } hEvent.cancelBubble = true hEvent.returnValue = false return false @@ -1527,11 +1536,13 @@ { hEvent.preventDefault() } - /* - if (hEvent.keyCode == 13) { - return true - } - */ + if (hEvent.keyCode == 13) { + if (hAC.bDebug) { hAC.debug ("Enter KeyUp: returnValue = true") } + hEvent.cancelBubble = true + hEvent.returnValue = true + hInput.form.submit; + return true + } if (hAC.bDebug) { hAC.debug ("keyUp: hEvent.returnValue = false") } hEvent.cancelBubble = true hEvent.returnValue = false Modified: trunk/themes/default/templates/search.tmpl =================================================================== --- trunk/themes/default/templates/search.tmpl 2009-08-31 11:28:47 UTC (rev 7095) +++ trunk/themes/default/templates/search.tmpl 2009-09-01 11:38:07 UTC (rev 7096) @@ -20,7 +20,7 @@ class="dropdown" id="searchInput" title="<?=_("LiveSearch") . " [$p-f]"?>" style="width:115px;" acdropdown="true" autocomplete_complete="false" autocomplete_matchsubstring="false" - autocomplete_list="xmlrpc:wiki.titleSearch [S] 4" /> + autocomplete_list="xmlrpc:wiki.titleSearch [S] 4<?= $request->getArg("start_debug") ? " debug" : "" ?>" /> <?php } elseif (ENABLE_LIVESEARCH) { ?> type="text" id="livesearch" title="<?=_("LiveSearch") . " [$p-f]"?>" onKeypress="liveSearchStart()" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |