• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Developers docs?

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
4 posts • Page 1 of 1

Postby bcc » Tue Oct 17, 2006 1:46 am

Hey man, I would pay if you could write some docs for developers.
There are so many things I want to fix/change/debug, but without knowing how the app is organized it's really hard.

For example, in scrollDown of pfcgui.js, this.getChatContentFromTabId and elttoscroll. One is a div that's displaying the channel's data and the other one is?

Could you write an intro for people to develop this chat? I would gladly pay for it.
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Tue Oct 17, 2006 9:05 am

Hi,

As long as this release is in beta I don't like to write some doc (developper or not). Because I don't have time to write and rewrite documentation as the internal/external API can change.
However when pfc 1.0-final will be released, I plan to write more doc : for users and for developpers.
I think I will configure a wiki in order to keep this doc alive with all contributors who want to help.

To come back to your questions, I just passed 30minutes to write some docs about the function you are studing, I hope it's clear :

Code: Select all
Index: pfcgui.js
===================================================================
--- pfcgui.js   (révision 833)
+++ pfcgui.js   (copie de travail)
@@ -22,16 +22,26 @@
   },

   /**
-   * scroll down from the posted message height
+   * Scroll down the message list area by elttoscroll height
+   * - elttoscroll is a message DOM element which has been appended to the tabid's message list
+   * - this.elttoscroll is an array containing the list of messages that will be scrolled
+   *   when the corresponding tab will be shown (see setTabById bellow).
+   *   It is necessary to keep in cache the list of hidden (because the tab is inactive) messages
+   *   because the 'scrollTop' javascript attribute
+   *   will not work if the element (tab content) is hidden.
    */
   scrollDown: function(tabid, elttoscroll)
   {
+    // check the wanted tabid is the current active one
     if (this.getTabId() != tabid)
     {
+      // no it's not the current active one so just cache the elttoscroll in the famouse this.elttoscroll array
       if (!this.elttoscroll[tabid]) this.elttoscroll[tabid] = Array();
       this.elttoscroll[tabid].push(elttoscroll);
       return;
     }
+    // the wanted tab is active so just scroll down the tab content element
+    // by elttoscroll element height (use 'offsetHeight' attribute)
     var content = this.getChatContentFromTabId(tabid);
     content.scrollTop += elttoscroll.offsetHeight+2;
     this.scrollpos[tabid] = content.scrollTop;
@@ -98,6 +108,7 @@
       // on by one
       for (var i=0; i<this.elttoscroll[tabid].length; i++)
         this.scrollDown(tabid,this.elttoscroll[tabid][i]);
+      // empty the cached element list because it has been scrolled
       this.elttoscroll[tabid] = Array();
     }

regards,
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bcc » Tue Oct 17, 2006 9:14 pm

OK man, that makes sense.
When do you think you'll finalize the internals and be ready to releaze the 1.0?
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Wed Oct 18, 2006 7:34 pm

I don't have other big features to release before1.0-final, I just have bug fixes, code cleaning and optimization to do and the 1.0-final release will be ready.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
4 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 19 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub