IRC log for #drupal-games, 2008-03-01 (GMT)

 
2008-02-29
2008-03-02
TimeNickMessage
[02:12:26]<aaronwinborn_>hey litwol
[02:12:33]<litwol>hey
[02:12:33]<Druplicon>hola
[02:12:36]<litwol>coming to drupalcon
[02:12:37]<litwol>?
[02:13:17]<aaronwinborn_>yep. are you?
[02:13:32]<litwol>yep
[02:13:33]<litwol>:)
[02:13:36]<litwol>i'll be there on tuesday
[02:13:40]<aaronwinborn_>awesome!
[02:13:47]<aaronwinborn_>ah, too bad, my presentation is monday
[02:14:05]<litwol>aww
[02:14:08]<litwol>what are you presenting?
[02:14:12]<aaronwinborn_>drupal multimedia
[02:14:42]<aaronwinborn_>i'd considered hitting you, morbus, & dmitri up for doing 'Games & Drupal' as well, but got too late to make a proposal
[02:14:56]<aaronwinborn_>we'll definitely plan for that next year though
[02:15:01]<litwol>cool
[02:15:11]<litwol>i'm putting in some time researching wysiwygs
[02:15:16]<aaronwinborn_>nic
[02:15:22]<aaronwinborn_>+e
[02:15:24]<litwol>have you read my devel list post on the rick text editor?
[02:15:32]<litwol>its ok if not
[02:15:35]<litwol>its a bit abstract
[02:15:44]<litwol>but concept really suits drupal
[02:15:48]<litwol>you should check it out
[02:17:22]<aaronwinborn_>interesting post
[02:17:25]<aaronwinborn_>i hadn't read it before
[02:17:29]<aaronwinborn_>well thought out
[02:18:03]<litwol>ignore the custom data structure formats, concentrate on the text editor selector API and button functionality + filters
[02:18:03]<aaronwinborn_>would be great to have hook_rte_button or something
[02:18:08]<litwol>thats the bakcbone behind it
[02:18:17]<litwol>aaronwinborn_: exactly what i was thinking
[02:18:31]<litwol>the idea is, make the text box editor as stupid as possible
[02:18:35]<litwol>it only knows how to select stuff
[02:18:37]<litwol>and put back stuff
[02:18:40]<aaronwinborn_>let's do it! you have a project started yet?
[02:18:45]<litwol>well
[02:18:49]<litwol>i dont have a good name for it yet
[02:18:57]<litwol>'dumb text editor' could suit it :)
[02:19:05]<aaronwinborn_>drupal text editor
[02:19:05]<litwol>i'm researching code right now
[02:19:19]<litwol>mainly researching how to select code reliably
[02:19:46]<litwol>minimalistic editor like that could make it into core
[02:19:53]<litwol>the rest of the functionality can be extended usingbuttons
[02:19:54]<litwol>:)
[02:19:56]<aaronwinborn_>build it all out in jquery
[02:20:02]<litwol>yes
[02:20:10]<litwol>i dont intend to use any custom js hackery
[02:20:33]<litwol>jquery doesnt seem to ahve anything that resembled getSelection() method
[02:20:41]<litwol>i looked at different wysiwygs
[02:20:44]<litwol>some use that method
[02:20:56]<litwol>some define some sick selection range fetching code
[02:21:08]<litwol>most of the code was too abstract for me to understand at 2 am lastn ight
[02:21:37]<litwol>i'm thinking to continue my research
[02:21:41]<litwol>and do a write up as i go along
[02:21:50]<litwol>publishing what i find so other smart people can pick it up and do it
[02:21:55]<litwol>or i'll do itwhen i finish research
[02:22:03]<litwol>right now i'm concentrating only on text selection API
[02:22:12]<litwol>oh and my only requirement is
[02:22:15]<litwol>not to use iframes
[02:22:19]<litwol>like other wysiwygs use
[02:22:26]<aaronwinborn_>http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jque...
[02:22:49]<litwol>iframe ;)
[02:22:50]<litwol>but yeah
[02:22:54]<litwol>i'll study it as well
[02:23:19]<aaronwinborn_>yeah, iframe
[02:23:21]<aaronwinborn_>just saw that
[02:23:53]<litwol>its ok
[02:23:59]<aaronwinborn_>it uses get_selection too
[02:24:10]<litwol>probably why it must use iframe
[02:24:19]<litwol>getSelection doesnt work for textarea in FF
[02:24:39]<litwol>so yeah
[02:24:41]<litwol>i figured
[02:24:45]<litwol>if we can make a selection API
[02:24:54]<litwol>the rest is easy text manipulation
[02:27:12]<aaronwinborn_>jquery ignores text nodes (as opposed to element nodes). a quick search looks like that's the main hangup
[02:27:41]<litwol>i dont knoiw js well enough to know what text nodes are
[02:27:55]<litwol>i'm looking up a good JS IDE
[02:27:57]<litwol>and debugger
[02:28:03]<litwol>so it can do 'code suggestion' to me
[02:28:07]<aaronwinborn_>http://dev.jquery.com/ticket/1024
[02:28:09]<litwol>on JS objects that i am not familiar with
[02:29:29]<aaronwinborn_>http://jqueryjs.googlecode.com/svn/trunk/plugins/textNodes/jquery.textNo...
[02:31:27]<litwol>interesting
[02:31:32]<litwol>so what does this gives us?
[02:31:32]<litwol>:)
[02:31:37]<litwol>sry i dont know js THAT well
[02:31:43]<litwol>what are text nodes?
[02:34:33]<aaronwinborn_>that would be treating words/paragraphs as being distinct elements. guess we don't really need that though
[02:35:58]<litwol>duno :)
[02:36:04]<litwol>my idea is really over my head
[02:36:09]<litwol>i'll figure it out eventualy
[02:37:15]<aaronwinborn_>we can just do with using $('#textarea-id').text(), really
[02:37:35]<aaronwinborn_>ummm...
[02:37:39]<litwol>yeah but this doesnt return the selected substr
[02:37:42]<aaronwinborn_>except that still doesn't give you selection
[02:37:47]<litwol>also
[02:37:50]<litwol>what if you have
[02:38:01]<litwol><div [styles]>text</div>more
[02:38:06]<litwol>and you select "xtmo"
[02:38:30]<litwol>i'm thinking your selection should be maintained in memory letter by letter
[02:38:38]<litwol>and it would /add/ styles to it
[02:38:42]<litwol>rather than doing clean replace
[02:38:53]<litwol>hm
[02:39:08]<litwol>so think of your whole text area as a single dimension linked node list
[02:39:11]<litwol>each node is a letter
[02:39:16]<litwol>and it has DOM properties
[02:39:25]<litwol>or something
[02:39:48]<litwol>so when you select substr, that list grows, when you deselect it shrinks
[02:39:50]<litwol>etc etc
[02:40:18]<litwol>having list like that also allows us to optimize the generated code
[02:40:35]<litwol>oh shit!
[02:40:38]<litwol>check this out
[02:40:41]<litwol>remember the game idea i had
[02:40:48]<litwol>that modules extend game by adding properties ;)
[02:40:50]<litwol>so here is the same
[02:41:00]<litwol>buttons define what DOM property they manipulate
[02:41:07]<litwol>:-p
[02:41:08]<litwol>mwuahahahah
[02:43:48]<aaronwinborn_>yep, that would work. seems hackish, like building fonts pixel by pixel in memory. but once that part's built, you just build stuff on top of it and forget about what's underneath
[02:44:12]<litwol>yes
[02:44:29]<litwol>i dont see how this can be done without doing letter by letter
[02:44:41]<litwol>because how else can you /stack/ styles rather than doing complete replace?
[02:46:24]<litwol>i had my greatest game idea yet this past weekend
[02:46:33]<litwol>:-p
[02:54:06]<aaronwinborn_>what's your game idea?
[02:54:43]<aaronwinborn_>ok, here we go:
[02:54:44]<aaronwinborn_>http://www.thescripts.com/forum/thread699866.html
[02:54:54]<aaronwinborn_>use that to write a jquery plugin to select text
[02:54:59]<aaronwinborn_>x-browser
[02:55:40]<aaronwinborn_>then, when text is selected and a button is pressed, the button will split the text into three parts, creating new divs & applying the new styles
[02:55:47]<aaronwinborn_>on the other hand, that's just as hackish
[02:55:57]<litwol>yes!
[02:56:10]<litwol>selectionStart and selectionEnd is where i left off last night
[02:56:18]<litwol>i had no idea how to utilize them
[02:56:21]<litwol>but i knew thye give me range
[02:56:25]<litwol>this is sweet
[02:57:12]<aaronwinborn_>ah, nm. the example goes into more detail as i read
[02:57:16]<aaronwinborn_>looks like this would work
[02:57:24]<aaronwinborn_>so there we go
[02:57:35]<aaronwinborn_>the buttons really only need to define beginning & end tags
[02:57:36]<litwol>this is sweet find!
[02:57:37]<litwol>thank you
[02:57:42]<aaronwinborn_>you're welcome :D
[02:57:55]<litwol>aaronwinborn_: the buttons dont define anything. the buttons do something like
[02:58:35]<litwol>dte.callback('button_callback', dte.get_selection())
[02:58:38]<litwol>done :)
[02:59:11]<litwol>or even better
[02:59:30]<litwol>dte.selection.callback('button_callback')
[02:59:36]<litwol>will fetch, modify and replace
[02:59:37]<litwol>:)
[02:59:42]<aaronwinborn_>nice
[02:59:51]<litwol>dte = dumb text editor
[02:59:51]<litwol>:-p
[02:59:52]<litwol>lol
[03:00:01]<aaronwinborn_>drupal text editor
[03:00:06]<litwol>oh
[03:00:07]<litwol>that too
[03:00:08]<litwol>:-p
[03:00:12]<aaronwinborn_>:D
[03:34:50]* aaron_laptop has joined #drupal-games
[03:46:53]* aaron_laptop has quit (Read error: 113 (No route to host))
[05:31:15]* litwol has quit (heinlein.freenode.net irc.freenode.net)
[05:35:54]* Druplicon has joined #drupal-games
[05:38:26]* aaronwinborn_ has joined #drupal-games
[05:39:22]* aaronwinborn_ has quit (card.freenode.net irc.freenode.net)
[05:40:20]* Druplicon has joined #drupal-games
[18:01:39]* develCuy has joined #drupal-games
[18:03:25]* develCuy has quit (Client Quit)
[20:56:06]* aaronwinborn has quit ("ChatZilla 0.9.81 [Firefox 2.0.0.12/2008020710]")