3 Jappix - An open social platform
4 These are the talkpage JS scripts for Jappix
6 -------------------------------------------------
10 Last revision: 06/05/11
14 // Creates the talkpage events
15 function eventsTalkPage() {
16 // Launch all associated plugins
21 launchNotifications();
25 // Creates the talkpage code
26 function createTalkPage() {
32 var anonymous = isAnonymous();
34 // Generate the HTML code
36 '<div id="talk" class="removable">' +
37 '<div id="top-content">' +
38 '<div class="tools tools-logo talk-images"></div>' +
40 '<div class="tools tools-all">';
42 if(!anonymous) html +=
43 '<a href="#" onclick="return openInbox();" class="inbox-hidable">' + _e("Messages") + '</a>' +
44 '<a href="#" onclick="return openVCard();">' + _e("Profile") + '</a>' +
45 '<a href="#" onclick="return optionsOpen();" class="options-hidable">' + _e("Options") + '</a>' +
46 '<a href="#" onclick="return normalQuit();">' + _e("Disconnect") + '</a>';
49 '<a href="./">' + _e("Disconnect") + '</a>';
54 if(!anonymous && document.createElement('audio').canPlayType) html +=
55 '<div class="tools-all ibubble">' +
56 '<div class="tools music talk-images" onclick="return openMusic();"></div>' +
58 '<div class="music-content tools-content bubble hidable">' +
59 '<div class="tools-content-subarrow talk-images"></div>' +
61 '<div class="tools-content-subitem">' +
62 '<div class="player">' +
63 '<a href="#" class="stop talk-images" onclick="return actionMusic(\'stop\');"></a>' +
66 '<div class="list">' +
67 '<p class="no-results">' + _e("No result!") + '</p>' +
70 '<div class="search">' +
71 '<input type="text" />' +
77 if(!anonymous) html +=
78 '<div class="tools-all ibubble">' +
79 '<div class="tools notifications talk-images" onclick="return showBubble(\'.notifications-content\');"></div>' +
81 '<div class="notifications-content tools-content bubble hidable">' +
82 '<div class="tools-content-subarrow talk-images"></div>' +
84 '<div class="tools-content-subitem">' +
85 '<a class="empty" href="#" onclick="return clearNotifications();">' + _e("Empty") + '</a>' +
86 '<p class="nothing">' + _e("No notifications.") + '</p>' +
94 '<div id="main-content">' +
95 '<div id="left-content">';
96 if(!anonymous) html +=
97 '<div id="buddy-list">' +
98 '<div class="content"></div>' +
100 '<div class="filter">' +
101 '<input type="text" placeholder="' + _e("Filter") + '" />' +
102 '<a href="#">x</a>' +
105 '<div class="foot ibubble">' +
106 '<div class="buddy-list-add buddy-list-icon">' +
107 '<a href="#" class="add talk-images" title="' + _e("Add a friend") + '"></a>' +
110 '<div class="buddy-list-join buddy-list-icon">' +
111 '<a href="#" class="join talk-images" title="' + _e("Join a chat") + '"></a>' +
114 '<div class="buddy-list-groupchat buddy-list-icon">' +
115 '<a href="#" class="groupchat talk-images" title="' + _e("Your groupchats") + '"></a>' +
118 '<div class="buddy-list-more buddy-list-icon">' +
119 '<a href="#" class="more talk-images" title="' + _e("More stuff") + '"></a>' +
122 '<div style="clear: both;"></div>' +
127 '<div id="my-infos">' +
128 '<div class="content">' +
129 '<div class="element f-presence ibubble">' +
130 '<a href="#" class="icon picker disabled" data-value="available">' +
131 '<span class="talk-images"></span>' +
134 '<input id="presence-status" type="text" placeholder="' + _e("Status") + '" disabled="" />' +
137 if(!anonymous) html +=
138 '<div class="element f-mood pep-hidable ibubble">' +
139 '<a href="#" class="icon picker" data-value="happy">' +
140 '<span class="talk-images"></span>' +
143 '<input id="mood-text" type="text" placeholder="' + _e("Mood") + '" />' +
146 '<div class="element f-activity pep-hidable ibubble">' +
147 '<a href="#" class="icon picker" data-value="exercising">' +
148 '<span class="talk-images activity-exercising"></span>' +
151 '<input id="activity-text" type="text" placeholder="' + _e("Activity") + '" />' +
159 '<div id="right-content">' +
160 '<div id="page-switch">' +
161 '<div class="chans">';
162 if(!anonymous) html +=
163 '<div class="channel switcher activechan" onclick="return switchChan(\'channel\');">' +
164 '<div class="icon talk-images"></div>' +
166 '<div class="name">' + _e("Channel") + '</div>' +
172 '<div class="more ibubble">' +
173 '<div class="more-button talk-images" onclick="return loadChatSwitch();" title="' + _e("All tabs") + '"></div>' +
177 '<div id="page-engine">';
178 if(!anonymous) html +=
179 '<div id="channel" class="page-engine-chan" style="display: block;">' +
180 '<div class="top mixed ' + hex_md5(getXID()) + '">' +
181 '<div class="avatar-container">' +
182 '<img class="avatar" src="' + './img/others/default-avatar.png' + '" alt="" />' +
185 '<div class="update">' +
186 '<p>' + _e("What\'s up with you?") + '</p>' +
188 '<div class="microblog-body">' +
189 '<input class="focusable" type="text" name="microblog_body" placeholder="' + _e("Type something you want to share with your friends...") + '" disabled="" />' +
192 '<div class="one-microblog-icon ibubble">' +
193 '<a href="#" onclick="return showBubble(\'#attach\');" title="' + _e("Attach a file") + '" class="postit attach talk-images"></a>' +
195 '<form id="attach" class="bubble hidable" action="./php/file-share.php" method="post" enctype="multipart/form-data">' +
196 '<div class="attach-subarrow talk-images"></div>' +
198 '<div class="attach-subitem">' +
199 '<p class="attach-p">' + _e("Attach a file") + '</p>' +
200 generateFileShare() +
207 '<div class="content mixed"></div>' +
209 '<div class="footer">' +
210 '<div class="sync talk-images">' + _e("You are synchronized with your network.") + '</div>' +
212 '<div class="unsync talk-images">' + _e("Cannot send anything: you can only receive notices!") + '</div>' +
214 '<div class="fetch wait-small">' + _e("Fetching the social channel...") + '</div>' +
224 // Create the HTML code
225 $('body').prepend(html);
227 // Adapt the buddy-list size
233 // Start the auto idle functions
239 // Destroys the talkpage code
240 function destroyTalkPage() {
241 // Reset our database
247 FIRST_PRESENCE_SENT = false;
248 SEARCH_FILTERED = false;
251 // Kill all timers, exept the board ones
252 $('*:not(#board .one-board)').stopTime();
254 // Kill the auto idle functions
257 // We renitalise the html markup as its initiale look
258 $('.removable').remove();
261 // Finally we show the homepage