I ended up not being able to figure out exactly what was messing the
widget browser but since the template for the widget was a little
weird, I just rewrote it.

I copied the new template mostly from the mochikit demo site. I also
added in the multi-line input box from there, too. Best of all, it now
works with the widget browser!

If you want me to send these somewhere, let me know.

widgets.py.diff:
31,56c31,44
<     <div xmlns:py='http://purl.org/kid/ns#'>
<     <script language="JavaScript" py:if="active">
<     function interpreter() {
<       if (!interpreter.box) {
<         interpreter.box = document.createElement("div");
<         interpreter.box.setAttribute('style',
<                                      'background-color: white; ' +
<                                      'border: solid black 3px; ' +
<                                      'padding: 10px;' +
<                                      'width: 610px;');
<          document.body.appendChild(interpreter.box);
<       }
<
<       // Start Mochikit interpreter
<       if (!(typeof(interpreterManager) == 'undefined')) {
<         interpreterString = '<h5>Interactive Javascript
Interpreter/Debugger</h5>' +
<         '<form id="interpreter_form"><div id="interpreter_area"><div
id="interpreter_output"></div></div>'+
<         '<input id="interpreter_text" name="input_text" type="text"
class="textbox" size="100" />'+
<         '</form>';
<         interpreter.box.innerHTML = interpreterString;
<         interpreterManager.initialize();
<       } else {
<         interpreterString = '<h5>MochiKit Interactive
Interpreter/Debugger Not Found</h5>';
<         interpreter.box.innerHTML = interpreterString;
<       }
<     }
---
>     <div xmlns:py='http://purl.org/kid/ns#' py:if="active">
>     <script type="text/javascript">
>     function toggleinterpreter() {
>       if (getElement('interpreterswitch')) {
>               showElement('interpreter_form');
>               getElement('interpreterswitch').id='interpreterswitchoff';
>               getElement('interpreterswitchoff').innerHTML='Hide Interpreter';
>               }
>       else {
>               hideElement('interpreter_form')
>               getElement('interpreterswitchoff').id='interpreterswitch';
>               getElement('interpreterswitch').innerHTML='Show Interpreter';
>               }
>       }
58,60c46,59
<     <div class='mochiinterpreter' py:if="active">
<       <p><a href='javascript:window.interpreter()'>MochiKit
Interpreter</a></p>
<     </div>
---
>     <a id='interpreterswitch' onclick="toggleinterpreter()" 
> href="#interpreterswitch">Show Interpreter</a>
>     <form id="interpreter_form" autocomplete="off">
>             <div id="interpreter_area">
>                 <div id="interpreter_output"></div>
>             </div>
>             <div id="oneline">
>                 <input id="interpreter_text" name="input_text" type="text" 
> class="textbox" size="100" />
>             </div>
>
>             <div id="multiline">
>                 <textarea id="interpreter_textarea" name="input_textarea" 
> type="text" class="textbox" cols="97" rows="10"></textarea>
>                 <br />
>             </div>
>         </form>

interpreter.css.diff:
6a7,18
> #interpreter_form {
>       display:none;
> }
>
> textarea.textbox {
>       font-family: Monaco, "lucida console", Courier;
>       border: 1px solid #CCCCCC;
>       font-size: .60em;
>       padding: 2px 4px;
>       margin-top: .3em;
>                   }
>
24a37,47
> #interpreter_textarea {
>    display: block;
>    border: 1px solid #CCCCCC;
>    padding: 2px 4px;
>    margin-top: .3em;
>    width: 600px;
>    height: 300px;
>    overflow: auto;
>  }
>
>
40c63
< input.textbox:focus { background-color: #FFFEE3; }
---
> input.textbox:focus, textarea.textbox:focus { background-color: #FFFEE3; }



Jorge Godoy wrote:
> Em Segunda 05 Junho 2006 18:05, Roger Demetrescu escreveu:
> > Hmmm... there seems to be a problem with this interpreter...
> >
> > My Tidy extension shows me some errors, related to missing escaped code:
> >
> > line 1800 column 78 - Warning: '<' + '/' + letter not allowed here
> >
> > eg.:
> >
> >     interpreterString = '<H5>Interactive Javascript
> > Interpreter/Debugger</H5>' +
> >
> > should be writen this way:
> >
> >     interpreterString = '<H5>Interactive Javascript
> > Interpreter/Debugger<\/H5>' +
> >
> > But I am not sure if this is the reason... I'll do some tests here...
>
> I accept patches to fix that.  I just can't take a look at it now, but if you
> send me a patch I'll make a new release.
> 
> -- 
> Jorge Godoy      <[EMAIL PROTECTED]>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to