On Wed, Nov 26, 2008 at 6:36 AM, Matthew Toseland
<toad at amphibian.dyndns.org> wrote:
> I thought we had an API capable of returning arbitrary data, but nobody used
> it so sdiz got rid of it?

we had an _interface_ for that, but no implementation.
that API never works.

>
> On Sunday 16 November 2008 14:12, xor at freenetproject.org wrote:
>> Author: xor
>> Date: 2008-11-16 14:12:26 +0000 (Sun, 16 Nov 2008)
>> New Revision: 23641
>>
>> Modified:
>>    trunk/plugins/WoT/introduction/IntroductionPuzzle.java
>>    trunk/plugins/WoT/ui/web/IntroduceIdentityPage.java
>> Log:
>> Display puzzles by including their image data directly in the img tag as
> base64. Cool, eh?
>>
>> Modified: trunk/plugins/WoT/introduction/IntroductionPuzzle.java
>> ===================================================================
>> --- trunk/plugins/WoT/introduction/IntroductionPuzzle.java    2008-11-16
> 10:41:06 UTC (rev 23640)
>> +++ trunk/plugins/WoT/introduction/IntroductionPuzzle.java    2008-11-16
> 14:12:26 UTC (rev 23641)
>> @@ -39,9 +39,9 @@
>>  import com.db4o.ObjectContainer;
>>  import com.db4o.ObjectSet;
>>  import com.db4o.query.Query;
>> -import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
>>
>>  import freenet.keys.FreenetURI;
>> +import freenet.support.Base64;
>>  import freenet.support.Logger;
>>
>>  public final class IntroductionPuzzle {
>> @@ -265,6 +265,10 @@
>>               return mData;
>>       }
>>
>> +     public String getDataBase64() {
>> +             return Base64.encode(mData, true);
>> +     }
>> +
>>       /**
>>        * Get the solution of the puzzle. Null if the puzzle was received and 
>> not
> locally generated.
>>        */
>> @@ -380,7 +384,7 @@
>>               puzzleTag.appendChild(validUntilTag);
>>
>>               Element dataTag = xmlDoc.createElement("Data");
>> -             dataTag.setAttribute("value", Base64.encode(mData));
>> +             dataTag.setAttribute("value", Base64.encode(mData, true));
>>               puzzleTag.appendChild(dataTag);
>>
>>               rootElement.appendChild(puzzleTag);
>>
>> Modified: trunk/plugins/WoT/ui/web/IntroduceIdentityPage.java
>> ===================================================================
>> --- trunk/plugins/WoT/ui/web/IntroduceIdentityPage.java       2008-11-16 
>> 10:41:06
> UTC (rev 23640)
>> +++ trunk/plugins/WoT/ui/web/IntroduceIdentityPage.java       2008-11-16 
>> 14:12:26
> UTC (rev 23641)
>> @@ -76,7 +76,7 @@
>>                                       row = puzzleTable.addChild("tr");
>>
>>                               HTMLNode cell = row.addChild("td");
>> -                             cell.addChild("img", new String[] {"src"}, new 
>> String[] {SELF_URI
> + "/puzzle?id=" + p.getID()});
>> +                             cell.addChild("img", new String[] {"src"}, new 
>> String[]
> {"data:image/jpeg;base64," + p.getDataBase64()}); /* FIXME: use SELF_URI
> + "puzzle?id=" instead */
>>                               cell.addChild("input", new String[] { "type", 
>> "name", "size"}, new
> String[] { "text", "solution" + p.getID(), "10" });
>>                       }
>>               } else {
>>
>> _______________________________________________
>> cvs mailing list
>> cvs at freenetproject.org
>> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>>
>>
>
> _______________________________________________
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>

Reply via email to