<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: opera code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 25 Jul 2008 07:34:13 GMT</pubDate>
    <description>DZone Snippets: opera code</description>
    <item>
      <title>JavaScript Fill Textarea from HTML Select not working with FireFox or Opera but does in IE6</title>
      <link>http://snippets.dzone.com/posts/show/4465</link>
      <description>//&lt;br /&gt;//  Fill textarea with keywords from HTML Select element&lt;br /&gt;//&lt;br /&gt;&lt;br /&gt;This code DOES work in I.E6 (on my machine (XP pro), but doesn't work in Firefox 2.0.0.4 or Opera 9.0.2&lt;br /&gt;&lt;br /&gt;The idea is to be able to either type in the text area directly or choose from a list of saved words in the select box. When a new choice is made from the select, it automatically gets inserted into the text area.&lt;br /&gt;&lt;br /&gt;With Firefox , when the page is first loaded, I can choose from the select control and it works until I type something in the text area, and then it stops working.&lt;br /&gt;&lt;br /&gt;With Opera 9.02, the select control doesn't work at all.&lt;br /&gt;&lt;br /&gt;IE6, works fine.&lt;br /&gt;&lt;br /&gt;Any hints tips, appreciated, as I'm a novice with javascript / DOM programming.&lt;br /&gt;&lt;br /&gt;I quite possibly am not using the most correct / efficient document.XXX calls here.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Mike&lt;br /&gt;&lt;br /&gt;You can test it at http://mstramba.com/fb5.html&lt;br /&gt;&lt;br /&gt;///////////////&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;  &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;textarea {  height:200px; width:50%;}&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;&lt;br /&gt;function htmlData(selectValue,targetTextArea)&lt;br /&gt;{&lt;br /&gt;//   alert("select box changed to : '" + selectValue + "'");&lt;br /&gt;&lt;br /&gt;   var txtNode=document.createTextNode(selectValue);&lt;br /&gt;   var textArea=document.getElementById(targetTextArea);&lt;br /&gt;   textArea.appendChild(txtNode);&lt;br /&gt;}&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt; &lt;form method="post"&gt;&lt;br /&gt; &lt;select name="country" id="selbox" onchange="htmlData(this.value,'content')" /&gt;&lt;br /&gt;   &lt;option value="#"&gt;-Select-&lt;/option&gt;&lt;br /&gt;   &lt;option value="SuperCaliFragilisticExpiAliDocius"&gt;SuperCaliFragilisticExpiAliDocius&lt;/option&gt;&lt;br /&gt;   &lt;option value="Discombombulatively"&gt;Discombombulatively&lt;/option&gt;&lt;br /&gt;   &lt;option value="I don't understand how this can be happening"&gt;I don't understand how this can be happening&lt;/option&gt;&lt;br /&gt; &lt;/select&gt;&lt;br /&gt;&lt;br /&gt; &lt;textarea name="content" id="content"&gt;Type some text or choose words from the select control&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt; &lt;input type="submit" /&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 24 Aug 2007 23:38:44 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4465</guid>
      <author>mstram (Mike Stramba)</author>
    </item>
    <item>
      <title>Babelfish translate</title>
      <link>http://snippets.dzone.com/posts/show/4265</link>
      <description>Ok, so maybe some of you might think that Babelfish's the best translator out there. I don't know about that , but I do know where my towel is ;)&lt;br /&gt;So, boys and girls, here's the bookmarklet that allows to translate your current web-page using the babelfish translation engine.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;javascript:location.href='http://babelfish.altavista.com/babelfish/tr?trurl='+encodeURIComponent(location.href)+'&amp;lp=%s&amp;btnTrUrl=Translate'&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To make it useful, save it as a bookmark in FF (or as a new search engine in Opera) and give it a keyword/shortcut by editing the bookmark's properties in FF (or the search properties in Opera). Let's call him, say 'bf', that should do it.&lt;br /&gt;&lt;br /&gt;Here are some examples:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;bf en_fr&lt;br /&gt;bf fr_en&lt;br /&gt;bf en_ja&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;G.R.</description>
      <pubDate>Thu, 05 Jul 2007 20:48:59 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4265</guid>
      <author>griflet (guillaume riflet)</author>
    </item>
    <item>
      <title>Opera Syncing using Svn</title>
      <link>http://snippets.dzone.com/posts/show/4219</link>
      <description>This batch file allows to run opera after checking out your web-based opera profile. When you terminate your opera session, the batch will commit the changes you made to your profile during the opera session.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt; REM OperaSync.bat&lt;br /&gt; @echo off&lt;br /&gt; &lt;br /&gt; set PRG=Opera&lt;br /&gt; set TARGET=%APPDATA%/%PRG%/%PRG%/profile&lt;br /&gt; set EXEC=%PROGS%/%PRG%/%PRG%.exe&lt;br /&gt; set REPO=https://********.googlecode.com/svn/trunk/%PROG%Sync&lt;br /&gt; set USER=*************&lt;br /&gt; &lt;br /&gt; echo Checking out from %REPO% ...&lt;br /&gt; svn checkout %REPO% "%TARGET%" --username %USER%&lt;br /&gt; echo %PROG% running ...&lt;br /&gt; %EXEC%&lt;br /&gt; echo Commiting to %REPO% ...&lt;br /&gt; svn commit -m --force-log "%TARGET%"&lt;br /&gt; echo Done.&lt;br /&gt; &lt;br /&gt; @echo on&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Here's the list of files that I update from a svn repo for my Opera profile&lt;br /&gt;&lt;code&gt;&lt;br /&gt;contacts.adr&lt;br /&gt;files.txt&lt;br /&gt;jscripts/&lt;br /&gt;jscripts/deliciousmp3.js&lt;br /&gt;notes.adr&lt;br /&gt;opcacrt6.dat&lt;br /&gt;opcert6.dat&lt;br /&gt;opera6.adr&lt;br /&gt;search.ini&lt;br /&gt;sessions/&lt;br /&gt;sessions/autosave.win&lt;br /&gt;sessions/autosave.win.bak&lt;br /&gt;speeddial.ini&lt;br /&gt;&lt;/code&gt;&lt;br /&gt; </description>
      <pubDate>Thu, 28 Jun 2007 18:47:19 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4219</guid>
      <author>griflet (guillaume riflet)</author>
    </item>
  </channel>
</rss>
