Hello Andun, Thanks for the plugin I have asked Sebastian regarding including plugin into wicket-jquery-ui [1] if plugin will be accepted the code required will be reduced a lot: [2]
Here is my review: 1) currently code at https://github.com/andunslg/EmotIcons-Wicket contains both behavior and example, I would separate it 2) I feel add methods like emotIconsBehavior.addEmoticonizeId is too much, one method for add and one for remove accepting selectors is fine :) 3) To reduce code required to use it I would suggest to create EmotIconsBehavior constructor able to take parent markup id automatically 4) toggle is a nice feature :) need to think if it is required :) [1] https://groups.google.com/d/msg/wicket-jquery-ui/seMxvXD1_mk/c24pA_WLE3YJ [2] https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui-plugins/src/main/java/com/googlecode/wicket/jquery/ui/plugins/FontSizeBehavior.java On Fri, May 24, 2013 at 2:43 AM, Andun Sameera <[email protected]> wrote: > Hi Maxim, > > I have successfully created the initial version of the EmotIcon Wicket > Module in https://github.com/andunslg/EmotIcons-Wicket. I have created > the module in the following way, > > We can add the behavior like this, > > EmotIconsBehavior emotIconsBehavior=new EmotIconsBehavior(); > this.add(emotIconsBehavior); > > To add emoticons for tag classes, > emotIconsBehavior.addEmoticonizeClass("class"); > > To remove emoticons for tag classes, > emotIconsBehavior.addUnemoticonizeClass("class2"); > > To add emoticons for tag ids, > emotIconsBehavior.addEmoticonizeId("id3"); > > To remove emoticons for tag id, > emotIconsBehavior.addUnemoticonizeId("id4"); > > Using this module, I have created a sample here in > https://github.com/andunslg/EmotIcons-Wicket-Sample. Please review this > and give me comments. > > Also There is one single thing missing in the module. All the above ones > are predefined set of emoticons which is initialized at the document ready > function. We define what are the tag we emotcionized and what are the tags > we unemoticonized. We need to add the functionality of adding dynamic > emoticons scripts in any place in the html document. > > For example if need to add a function like this, > > $('#toggle-headline').toggle( > function(){ > $('#large').unemoticonize({ > //delay: 800, > //animate: false > }) > }, > function(){ > $('#large').emoticonize({ > //delay: 800, > //animate: false > }) > } > ); > > We have to find a method to provide such a dynamic use of emoticons. I > need some ideas. > > Thnaks! > > > On Thu, May 23, 2013 at 11:30 PM, Andun Sameera <[email protected]>wrote: > >> Hi Maxim, >> >> I found the reason for the fault just know. :) Such a coincidence. >> >> In the EmotIcons guide they said to insert the JQuery as a separate >> script entry, But in wicket there is Jquery included. I found it after lot >> of reading in >> http://mail-archives.apache.org/mod_mbox/wicket-users/201209.mbox/%3ccamomwmota7gre3prjwz-gtzbl33kap6yygkn1j3ca4jszfc...@mail.gmail.com%3E. >> That causes the all problem. After adding the built in JQuery reference to >> the code like this, >> >> >> response.render(JavaScriptReferenceHeaderItem.forReference(JQueryResourceReference.get(),"jquery")); >> >> It work well. I will continue to work on the development of the wicket >> component. >> >> Thanks! >> >> >> On Thu, May 23, 2013 at 11:23 PM, Maxim Solodovnik >> <[email protected]>wrote: >> >>> Hello Andun, >>> >>> will try to review your code tomorrow morning >>> >>> >>> On Thu, May 23, 2013 at 11:50 PM, Andun Sameera <[email protected]>wrote: >>> >>>> Hi Maxim, >>>> >>>> I tried many times to correct the problem. But still failing. In my >>>> example app using my created EmotIcons behavior I get the following >>>> rendered code, >>>> >>>> <html> >>>> >>>> <head> >>>> <script >>>> src="./wicket/resource/org.wicketstuff.emoticons.EmotIconsBehavior/jquery.cssemoticons-ver-1369327371000.js" >>>> type="text/javascript"></script> >>>> <script >>>> src="./wicket/resource/org.wicketstuff.emoticons.EmotIconsBehavior/jquery-1.4.2.min-ver-1369327371000.js" >>>> type="text/javascript"></script> >>>> <link >>>> href="./wicket/resource/org.wicketstuff.emoticons.EmotIconsBehavior/jquery.cssemoticons-ver-1369327371000.css" >>>> type="text/css" rel="stylesheet"> >>>> >>>> </head> >>>> >>>> <body> >>>> <div class="comment"> >>>> Hi, this is a great plugin! :-) >>>> </div> >>>> >>>> <script >>>> type="text/javascript">$(document).ready(function(){$('.comment').emoticonize({});});</script> >>>> </body> >>>> </html> >>>> >>>> But with this code no emoticons shown. When I clicked on the script >>>> tags in the head element using Firebug it shows the js code inside >>>> correctly. Then how come this not working ? >>>> >>>> Then what I did is coppied the code to a html file. Then copied all the >>>> js and css file to same location. And chnaged the head script elements like >>>> this, >>>> >>>> <script src="jquery-1.4.2.min.js" type="text/javascript"></script> >>>> <script src="jquery.cssemoticons.min.js" >>>> type="text/javascript"></script> >>>> <link href="jquery.cssemoticons.css" type="text/css" rel="stylesheet"> >>>> >>>> Then it works perfect. So what is wrong hear when running through >>>> wickets ? Is there a problem with scope of Java Script Resource items and >>>> CSS resource items ? >>>> >>>> Please help me to find a solution. Then I can finalize the work of >>>> emoticons wicket component. >>>> >>>> Thanks! >>>> >>>> >>>> On Thu, May 23, 2013 at 12:48 AM, Andun Sameera <[email protected]>wrote: >>>> >>>>> Hi Maxim, >>>>> >>>>> I have created git hub repository to my work. You can find it under >>>>> https://github.com/andunslg/EmotIcons-Wicket. There I have created a >>>>> behavior to emoticons( >>>>> https://github.com/andunslg/EmotIcons-Wicket/blob/master/src/main/java/org/wiketstuff/emoticons/EmotIconsBehavior.java). >>>>> >>>>> >>>>> Using that I have created a small application in >>>>> https://github.com/andunslg/EmotIcons-Wicket/blob/master/src/main/java/org/wiketstuff/emoticons/HomePage.htmland >>>>> https://github.com/andunslg/EmotIcons-Wicket/blob/master/src/main/java/org/wiketstuff/emoticons/HomePage.java. >>>>> When I run the application all the java scripts and are loaded correctly >>>>> like this, >>>>> >>>>> <html> >>>>> <head> >>>>> <script type="text/javascript"> >>>>> $(document).ready(function(){ >>>>> $('.comment').emoticonize({}); >>>>> }); >>>>> </script> >>>>> <script >>>>> src="./wicket/resource/org.wiketstuff.emoticons.HomePage/jquery.cssemoticons-ver-1369249259000.js" >>>>> type="text/javascript"></script> >>>>> <script >>>>> src="./wicket/resource/org.wiketstuff.emoticons.HomePage/jquery-1.4.2.min-ver-1369249259000.js" >>>>> type="text/javascript"></script> >>>>> <link >>>>> href="./wicket/resource/org.wiketstuff.emoticons.HomePage/jquery.cssemoticons-ver-1369249259000.css" >>>>> type="text/css" rel="stylesheet"> >>>>> </head><body> >>>>> >>>>> <div class="comment"> >>>>> Hi, this is a great plugin! :-) >>>>> </div> >>>>> </body> >>>>> </html> >>>>> >>>>> But emoticons are not showing. Then I looked at the example given by >>>>> the EmotIcon developers in >>>>> http://jspkg.com/packages/css-emoticons/download. Both my one and >>>>> there one is equal. >>>>> >>>>> I am trying to correct the problem. If you have any idea please >>>>> instruct me. >>>>> >>>>> Thanks! >>>>> >>>>> >>>>> On Wed, May 22, 2013 at 10:36 PM, Andun Sameera <[email protected]>wrote: >>>>> >>>>>> OK Maxim. Until then I will work based on the article which describes >>>>>> to add a javascript ibraya as a wicket component in here >>>>>> https://cwiki.apache.org/WICKET/creating-a-behavior-to-use-a-javascript-library.html. >>>>>> >>>>>> >>>>>> Thanks! >>>>>> >>>>>> >>>>>> On Wed, May 22, 2013 at 9:31 AM, Maxim Solodovnik < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Hello Andun, >>>>>>> >>>>>>> <script src="javascripts/jquery.js" type="text/javascript"></script> >>>>>>> is not necessary (it is embedded into Wicket, maybe some standard >>>>>>> check should be performed) >>>>>>> >>>>>>> here is the Behavior you can take a look at: >>>>>>> https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui-core/src/main/java/com/googlecode/wicket/jquery/core/JQueryBehavior.java >>>>>>> >>>>>>> the most "parametrized" constructor is public JQueryBehavior(String >>>>>>> selector, String method, Options options) >>>>>>> So you can specify: ".comment" as a selector, "emoticonize" as >>>>>>> method, and additionally can specify Options animate,delay,exclude >>>>>>> etc. >>>>>>> >>>>>>> I'll talk to Sebastien (the author of wicket-jquery-ui) and ask >>>>>>> maybe This emoticonize plugin can be added to his project >>>>>>> >>>>>>> >>>>>>> On Wed, May 22, 2013 at 2:06 AM, Andun Sameera >>>>>>> <[email protected]>wrote: >>>>>>> >>>>>>>> Hi Maxim, >>>>>>>> >>>>>>>> I have gone through both resources you have given. I have this kind >>>>>>>> of a thought, >>>>>>>> >>>>>>>> We need this to run emoticons, >>>>>>>> >>>>>>>> The Markup >>>>>>>> >>>>>>>> <div class="comment"> >>>>>>>> Hi, this is a great plugin! :-) >>>>>>>> </div> >>>>>>>> >>>>>>>> Required Files >>>>>>>> >>>>>>>> <link href="stylesheets/jquery.cssemoticons.css" media="screen" >>>>>>>> rel="stylesheet" type="text/css" /> >>>>>>>> <script src="javascripts/jquery.js" type="text/javascript"></script> >>>>>>>> <script src="javascripts/jquery.cssemoticons.js" >>>>>>>> type="text/javascript"></script> >>>>>>>> >>>>>>>> The JS >>>>>>>> >>>>>>>> $('.comment').emoticonize(); >>>>>>>> >>>>>>>> So we have to create a Wickets Behavior which includes above >>>>>>>> necessary files in the head. Also that Behavior class should take the >>>>>>>> div >>>>>>>> class argument which it should assign emoticons. >>>>>>>> >>>>>>>> Is the initial thought correct ? >>>>>>>> >>>>>>>> Thanks! >>>>>>>> >>>>>>>> On Tue, May 21, 2013 at 8:39 PM, Andun Sameera >>>>>>>> <[email protected]>wrote: >>>>>>>> >>>>>>>>> OK Maxim. I will start it ASAP. And will let you know about the >>>>>>>>> progress. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Tue, May 21, 2013 at 8:32 PM, Maxim Solodovnik < >>>>>>>>> [email protected]> wrote: >>>>>>>>> >>>>>>>>>> OK here is the very small task: >>>>>>>>>> >>>>>>>>>> We need emotions for the chat >>>>>>>>>> http://openmeetings.markmail.org/thread/aenmqjk377m3m3cd >>>>>>>>>> >>>>>>>>>> I would like this to be wrapped into wicket behavior >>>>>>>>>> So it can be applied like this: >>>>>>>>>> >>>>>>>>>> http://www.7thweb.net/wicket-jquery-ui/accordion/DefaultAccordionPage >>>>>>>>>> >>>>>>>>>> I would like this task to be implemented as github project under >>>>>>>>>> AL >>>>>>>>>> with the main package: "org.wicketstuff" (so it can be >>>>>>>>>> contributed to Wicketstuff) >>>>>>>>>> >>>>>>>>>> please contact me if you have any questions :) >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Tue, May 21, 2013 at 9:53 PM, Andun Sameera < >>>>>>>>>> [email protected]> wrote: >>>>>>>>>> >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> Still learning Wickets. So will take some time to complete. If >>>>>>>>>>> you are OK with that I like the warm up project. >>>>>>>>>>> >>>>>>>>>>> Thanks! >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Tue, May 21, 2013 at 8:20 PM, Maxim Solodovnik < >>>>>>>>>>> [email protected]> wrote: >>>>>>>>>>> >>>>>>>>>>>> Great news :) >>>>>>>>>>>> >>>>>>>>>>>> Do you have time for the small "warm-up" project? >>>>>>>>>>>> Or should I create the the stub for the new room so you can >>>>>>>>>>>> start coding? >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On Tue, May 21, 2013 at 9:34 PM, Andun Sameera < >>>>>>>>>>>> [email protected]> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Hi Maxim, >>>>>>>>>>>>> >>>>>>>>>>>>> Because of my recent work related to OM. I will select OM and >>>>>>>>>>>>> will leave AXIOM. That choice has been been made about the future >>>>>>>>>>>>> after >>>>>>>>>>>>> GSOC also. I like to work as an active member in OM. >>>>>>>>>>>>> >>>>>>>>>>>>> Thanks! >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> On Tue, May 21, 2013 at 8:01 PM, Maxim Solodovnik < >>>>>>>>>>>>> [email protected]> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> Hello Andun, >>>>>>>>>>>>>> >>>>>>>>>>>>>> "You have written proposals for more than one project. If >>>>>>>>>>>>>> accepted, which one would you chose?" >>>>>>>>>>>>>> >>>>>>>>>>>>>> -- >>>>>>>>>>>>>> WBR >>>>>>>>>>>>>> Maxim aka solomax >>>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> -- >>>>>>>>>>>>> Regards >>>>>>>>>>>>> Andun S.L. Gunawardana >>>>>>>>>>>>> Undergraduate >>>>>>>>>>>>> Department of Computer Science And Engineering >>>>>>>>>>>>> University of Moratuwa >>>>>>>>>>>>> Sri Lanka >>>>>>>>>>>>> >>>>>>>>>>>>> Blog - http://www.insightforfuture.blogspot.com/ >>>>>>>>>>>>> LinkedIn - >>>>>>>>>>>>> http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703 >>>>>>>>>>>>> Twitter -http://twitter.com/AndunSLG >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>>> WBR >>>>>>>>>>>> Maxim aka solomax >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> Regards >>>>>>>>>>> Andun S.L. Gunawardana >>>>>>>>>>> Undergraduate >>>>>>>>>>> Department of Computer Science And Engineering >>>>>>>>>>> University of Moratuwa >>>>>>>>>>> Sri Lanka >>>>>>>>>>> >>>>>>>>>>> Blog - http://www.insightforfuture.blogspot.com/ >>>>>>>>>>> LinkedIn - >>>>>>>>>>> http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703 >>>>>>>>>>> Twitter -http://twitter.com/AndunSLG >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> WBR >>>>>>>>>> Maxim aka solomax >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Regards >>>>>>>>> Andun S.L. Gunawardana >>>>>>>>> Undergraduate >>>>>>>>> Department of Computer Science And Engineering >>>>>>>>> University of Moratuwa >>>>>>>>> Sri Lanka >>>>>>>>> >>>>>>>>> Blog - http://www.insightforfuture.blogspot.com/ >>>>>>>>> LinkedIn - >>>>>>>>> http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703 >>>>>>>>> Twitter -http://twitter.com/AndunSLG >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Regards >>>>>>>> Andun S.L. Gunawardana >>>>>>>> Undergraduate >>>>>>>> Department of Computer Science And Engineering >>>>>>>> University of Moratuwa >>>>>>>> Sri Lanka >>>>>>>> >>>>>>>> Blog - http://www.insightforfuture.blogspot.com/ >>>>>>>> LinkedIn - >>>>>>>> http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703 >>>>>>>> Twitter -http://twitter.com/AndunSLG >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> WBR >>>>>>> Maxim aka solomax >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Regards >>>>>> Andun S.L. Gunawardana >>>>>> Undergraduate >>>>>> Department of Computer Science And Engineering >>>>>> University of Moratuwa >>>>>> Sri Lanka >>>>>> >>>>>> Blog - http://www.insightforfuture.blogspot.com/ >>>>>> LinkedIn - >>>>>> http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703 >>>>>> Twitter -http://twitter.com/AndunSLG >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Regards >>>>> Andun S.L. Gunawardana >>>>> Undergraduate >>>>> Department of Computer Science And Engineering >>>>> University of Moratuwa >>>>> Sri Lanka >>>>> >>>>> Blog - http://www.insightforfuture.blogspot.com/ >>>>> LinkedIn - >>>>> http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703 >>>>> Twitter -http://twitter.com/AndunSLG >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Regards >>>> Andun S.L. Gunawardana >>>> Undergraduate >>>> Department of Computer Science And Engineering >>>> University of Moratuwa >>>> Sri Lanka >>>> >>>> Blog - http://www.insightforfuture.blogspot.com/ >>>> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703 >>>> Twitter -http://twitter.com/AndunSLG >>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> -- >>> WBR >>> Maxim aka solomax >>> >> >> >> >> -- >> Regards >> Andun S.L. Gunawardana >> Undergraduate >> Department of Computer Science And Engineering >> University of Moratuwa >> Sri Lanka >> >> Blog - http://www.insightforfuture.blogspot.com/ >> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703 >> Twitter -http://twitter.com/AndunSLG >> >> >> >> >> > > > > -- > Regards > Andun S.L. Gunawardana > Undergraduate > Department of Computer Science And Engineering > University of Moratuwa > Sri Lanka > > Blog - http://www.insightforfuture.blogspot.com/ > LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703 > Twitter -http://twitter.com/AndunSLG > > > > > -- WBR Maxim aka solomax
