From 96cbcdcf2f3613b453fda9a4eaaac02090458a44 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 10 Feb 2012 11:34:00 +0100 Subject: [PATCH] [REM] web_chat, does not work bzr revid: xmo@openerp.com-20120210103400-p1j8ajc99noe72xe --- addons/web_chat/__init__.py | 1 - addons/web_chat/__openerp__.py | 20 - addons/web_chat/controllers/__init__.py | 1 - addons/web_chat/controllers/main.py | 215 -- addons/web_chat/i18n/es.po | 20 - addons/web_chat/i18n/es_CR.po | 20 - addons/web_chat/i18n/web_chat.pot | 19 - addons/web_chat/static/lib/AjaxIM/LICENSE.txt | 19 - addons/web_chat/static/lib/AjaxIM/js/im.js | 2101 ----------------- .../web_chat/static/lib/AjaxIM/js/im.load.js | 79 - .../static/lib/AjaxIM/js/jStore.Flash.html | 19 - .../web_chat/static/lib/AjaxIM/js/jStore.swf | Bin 569 -> 0 bytes .../static/lib/AjaxIM/js/jquery-1.3.2.js | 19 - .../lib/AjaxIM/js/jquery.jsonp-1.1.0.js | 269 --- .../lib/AjaxIM/js/jquery.jstore-all-min.js | 56 - .../static/lib/AjaxIM/js/jquery.jstore-all.js | 963 -------- .../static/lib/AjaxIM/js/jquery.md5.js | 230 -- .../themes/default/emoticons/attribution.txt | 8 - .../themes/default/emoticons/evilgrin.png | Bin 868 -> 0 bytes .../AjaxIM/themes/default/emoticons/grin.png | Bin 814 -> 0 bytes .../AjaxIM/themes/default/emoticons/happy.png | Bin 853 -> 0 bytes .../AjaxIM/themes/default/emoticons/smile.png | Bin 853 -> 0 bytes .../themes/default/emoticons/surprised.png | Bin 850 -> 0 bytes .../themes/default/emoticons/tongue.png | Bin 843 -> 0 bytes .../themes/default/emoticons/unhappy.png | Bin 860 -> 0 bytes .../AjaxIM/themes/default/emoticons/waii.png | Bin 846 -> 0 bytes .../AjaxIM/themes/default/emoticons/wink.png | Bin 854 -> 0 bytes .../AjaxIM/themes/default/images/bottom.png | Bin 121 -> 0 bytes .../AjaxIM/themes/default/images/closemin.png | Bin 176 -> 0 bytes .../AjaxIM/themes/default/images/error.png | Bin 552 -> 0 bytes .../AjaxIM/themes/default/images/lrbox.png | Bin 212 -> 0 bytes .../default/images/player/playpause.png | Bin 706 -> 0 bytes .../lib/AjaxIM/themes/default/images/sl.png | Bin 142 -> 0 bytes .../lib/AjaxIM/themes/default/images/sr.png | Bin 141 -> 0 bytes .../AjaxIM/themes/default/images/tooltip.png | Bin 234 -> 0 bytes .../lib/AjaxIM/themes/default/images/w.png | Bin 109 -> 0 bytes .../lib/AjaxIM/themes/default/theme.css | 535 ----- .../lib/AjaxIM/themes/default/theme.html | 132 -- addons/web_chat/static/src/js/web_chat.js | 10 - 39 files changed, 4736 deletions(-) delete mode 100644 addons/web_chat/__init__.py delete mode 100644 addons/web_chat/__openerp__.py delete mode 100644 addons/web_chat/controllers/__init__.py delete mode 100644 addons/web_chat/controllers/main.py delete mode 100644 addons/web_chat/i18n/es.po delete mode 100644 addons/web_chat/i18n/es_CR.po delete mode 100644 addons/web_chat/i18n/web_chat.pot delete mode 100644 addons/web_chat/static/lib/AjaxIM/LICENSE.txt delete mode 100644 addons/web_chat/static/lib/AjaxIM/js/im.js delete mode 100644 addons/web_chat/static/lib/AjaxIM/js/im.load.js delete mode 100644 addons/web_chat/static/lib/AjaxIM/js/jStore.Flash.html delete mode 100644 addons/web_chat/static/lib/AjaxIM/js/jStore.swf delete mode 100644 addons/web_chat/static/lib/AjaxIM/js/jquery-1.3.2.js delete mode 100644 addons/web_chat/static/lib/AjaxIM/js/jquery.jsonp-1.1.0.js delete mode 100644 addons/web_chat/static/lib/AjaxIM/js/jquery.jstore-all-min.js delete mode 100644 addons/web_chat/static/lib/AjaxIM/js/jquery.jstore-all.js delete mode 100644 addons/web_chat/static/lib/AjaxIM/js/jquery.md5.js delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/attribution.txt delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/evilgrin.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/grin.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/happy.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/smile.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/surprised.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/tongue.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/unhappy.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/waii.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/wink.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/images/bottom.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/images/closemin.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/images/error.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/images/lrbox.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/images/player/playpause.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/images/sl.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/images/sr.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/images/tooltip.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/images/w.png delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/theme.css delete mode 100644 addons/web_chat/static/lib/AjaxIM/themes/default/theme.html delete mode 100644 addons/web_chat/static/src/js/web_chat.js diff --git a/addons/web_chat/__init__.py b/addons/web_chat/__init__.py deleted file mode 100644 index ee5959455ad..00000000000 --- a/addons/web_chat/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import controllers diff --git a/addons/web_chat/__openerp__.py b/addons/web_chat/__openerp__.py deleted file mode 100644 index 109fe54f345..00000000000 --- a/addons/web_chat/__openerp__.py +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "Web Chat", - "category": "Hidden", - "description": - """ - OpenERP Web chat module. - """, - "version": "2.0", - "depends": ['web'], - "js": [ - 'static/lib/AjaxIM/js/jquery.jsonp-1.1.0.js', - 'static/lib/AjaxIM/js/jquery.jstore-all-min.js', - 'static/lib/AjaxIM/js/jquery.md5.js', - 'static/lib/AjaxIM/js/im.js', - 'static/src/js/web_chat.js' - ], - "css": [], - 'active': False, - 'installable': False, -} diff --git a/addons/web_chat/controllers/__init__.py b/addons/web_chat/controllers/__init__.py deleted file mode 100644 index 8ee9bae18d9..00000000000 --- a/addons/web_chat/controllers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import main diff --git a/addons/web_chat/controllers/main.py b/addons/web_chat/controllers/main.py deleted file mode 100644 index 87d64806180..00000000000 --- a/addons/web_chat/controllers/main.py +++ /dev/null @@ -1,215 +0,0 @@ -# -*- coding: utf-8 -*- -import time - -import simplejson -import web.common.http as openerpweb -import logging - -_logger = logging.getLogger(__name__) - -#---------------------------------------------------------- -# OpenERP Web ajaxim Controllers -#---------------------------------------------------------- -class PollServerMessageQueue(object): - def __init__(self): - # message queue - self.messages = [] - # online users - self.users = {} - # should contains: { - # 'user1234' : { s:1, m:"status message", timestamp: last_contact_timestamp } - # } - def userlist(self, req): - userlist = [users for users in req.applicationsession['users']] - -# userlist = [ -# {"u": "Guest130205108745.47", "s": {"s": 1, "m": ""}, "g": "Users"}, -# {"u": "Guest130209838956.76", "s": {"s": 1, "m": ""}, "g": "Users"}, -# ] - - return userlist - - def write(self, m_type, m_from, m_to, m_message, m_group): - self.messages.append({'type': m_type, 'from': m_from, 'to': m_to, 'message': m_message, 'group': m_group}) - # when status message update users - pass - - def read(self, recipient, timestamp): - for msg in self.messages: - if msg['to'] == recipient: - return self.messages - - def gc(self): - # remove message older than 300s from self.l - # remove dead users from self.users - pass - -class PollServer(openerpweb.Controller): - _cp_path = "/web_chat/pollserver" - - @openerpweb.httprequest - def login(self, req, **kw): - - """ - --> POST http://ajaxim.com/wp-content/plugins/im/ajaxim.php/login - Form Data - username:"" - password:"d41d8cd98f00b204e9800998ecf8427e" - <-- 200 OK - Content-Type:text/html - - { - "r":"logged in", - "u":"Guest130213866190.85", - "s":"f9e1811536f19ad5b9e00376f9ff1532", - "f":[ - {"u":"Guest130205108745.47","s":{"s":1,"m":""},"g":"Users"}, - {"u":"Guest130209838956.76","s":{"s":1,"m":""},"g":"Users"}, - ] - } - """ - mq = req.applicationsession.setdefault("web_chat", PollServerMessageQueue()) - mq.messages = [] - - #r = 'logged in' - #u = generate random.randint(0,2**32) - #f = mq.userlist() - -# username = 'Guest'+ str(random.randint(0, 2**32)) -# -# if not req.applicationsession.get('users'): -# req.applicationsession['users'] = [{'u': username, 's':{'s':1, 'm':''}, 'g':'Users'}] -# else: -# req.applicationsession['users'].append({'u': username, 's':{'s':1, 'm':''}, 'g':'Users'}) - req.applicationsession['users'] = [{'u': 'Guest1', 's':{'s':1, 'm':'111'}, 'g':'Users'}, - {'u': 'Guest2', 's':{'s':1, 'm':'222'}, 'g':'Users'}, - {'u': 'Guest3', 's':{'s':1, 'm':'333'}, 'g':'Users'}] - - # Temporary Guest1 is my current user - req.applicationsession['current_user'] = 'Guest1' - - - return simplejson.dumps({'r': 'logged in', 'u': 'Guest1', 's': 'f9e1811536f19ad5b9e00376f9ff1532', - 'f': [{'u': 'Guest1', 's':{'s':1, 'm':'111'}, 'g':'Users'}, - {'u': 'Guest2', 's':{'s':1, 'm':'222'}, 'g':'Users'}, - {'u': 'Guest3', 's':{'s':1, 'm':'333'}, 'g':'Users'}]}) - - @openerpweb.httprequest - def logout(self, req): - """ - --> GET http://im.ajaxim.com/logout - { "r":"logged out" } - """ - - @openerpweb.httprequest - def poll(self, req, **kw): - """ - --> GET http://im.ajaxim.com/poll?callback=jsonp1302138663582&_1302138663582= - <-- 200 OK - Content-Type:text/html - - noop: - jsonp1302138663582([]); - - roster user online: - jsonp1302140366243([{"t":"s","s":"Guest130214038974.31","r":"all","m":"1:","g":"Users"}]); - - roster user left: - jsonp1302140441577([{"t":"s","s":"Guest130214038974.31","r":"","m":"0:"}]); - - receive message: - jsonp1302140191599([{"t":"m","s":"Guest130214008855.5","r":"Guest130214013134.26","m":"xxxxxx"}]); - - ('t' => $msg->type, 's' => $msg->from, 'r' => $msg->to, 'm' => $msg->message ) - mag type s or m - echo '' - - """ - mq = req.applicationsession.setdefault("web_chat", PollServerMessageQueue()) - - # Method: Long Poll - - - msg = '[]' - - for i in range(5): - received_msg = mq.read('Guest1', i) - if received_msg: - msg = self._pollParseMessages(received_msg) - mq.messages = [] - return '%s'%kw.get('callback', '') + '(' + str(msg) + ');' - else: - msg = '[]' - time.sleep(2) - return '%s'%kw.get('callback', '') + '(' + str(msg) + ');' - - @openerpweb.httprequest - def send(self, req, **kw): - """ - --> GET http://im.ajaxim.com/send?callback=jsonp1302139980022&to=Guest130205108745.47&message=test&_1302139980022= - callback: jsonp1302139980022 - to: Guest130205108745.47 - message: test - _1302139980022: - - <-- 200 OK - Content-Type:text/html - - return array('r' => 'sent'); - return array('r' => 'error', 'e' => 'no session found'); - return array('r' => 'error', 'e' => 'no_recipient'); - return array('r' => 'error', 'e' => 'send error'); - - """ - - to = kw.get('to') - message = kw.get('message') - - mq = req.applicationsession.setdefault("web_chat", PollServerMessageQueue()) - - - if not req.applicationsession['current_user']: - return dict(r='error', e='no session found') - - if not to: - return dict(r='error', e='no_recipient') - - if message: - mq.write(m_type="m", m_from=req.applicationsession['current_user'], m_to=to, m_message=message, m_group="Users") - return '%s'%kw.get('callback', '') + '(' + simplejson.dumps({'r': 'sent'}) + ')' - else: - return {'r': 'error', 'e': 'send error'} - - @openerpweb.httprequest - def status(self, req, **kw): - """ - --> GET status call - const Offline = 0; - const Available = 1; - const Away = 2; - const Invisible = 3; - - <-- 200 OK - Content-Type:text/html - - return array('r' => 'status set'); - return array('r' => 'error', 'e' => 'no session found'); - return array('r' => 'error', 'e' => 'status error'); - """ - mq = req.applicationsession.setdefault("web_chat", PollServerMessageQueue()) - - _logger.debug("======== chat status ======== %s", kw) - # mq.write() - return {"action": ""} - - def _pollParseMessages(self, messages): - msg_arr = [] - for msg in messages: - msg_arr.append({"t": str(msg['type']), "s": str(msg['from']), "r": str(msg['to']), "m": str(msg['message'])}) - - return msg_arr - - def _sanitize(self, message): - return message.replace('>', '>').replace('<', '<').replace('&', '&'); - - diff --git a/addons/web_chat/i18n/es.po b/addons/web_chat/i18n/es.po deleted file mode 100644 index 67063226b21..00000000000 --- a/addons/web_chat/i18n/es.po +++ /dev/null @@ -1,20 +0,0 @@ -# Spanish translation for openerp-web -# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2012-02-06 17:33+0100\n" -"PO-Revision-Date: 2012-02-08 02:04+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Spanish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-02-09 07:27+0000\n" -"X-Generator: Launchpad (build 14763)\n" - - diff --git a/addons/web_chat/i18n/es_CR.po b/addons/web_chat/i18n/es_CR.po deleted file mode 100644 index 238f3396c1a..00000000000 --- a/addons/web_chat/i18n/es_CR.po +++ /dev/null @@ -1,20 +0,0 @@ -# Spanish translation for openerp-web -# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2012-02-06 17:33+0100\n" -"PO-Revision-Date: 2012-02-08 02:26-0600\n" -"Last-Translator: Carlos Vásquez - CLEARCORP \n" -"Language-Team: Spanish \n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-02-08 06:38+0000\n" -"X-Generator: Launchpad (build 14747)\n" - diff --git a/addons/web_chat/i18n/web_chat.pot b/addons/web_chat/i18n/web_chat.pot deleted file mode 100644 index fa7bd80d130..00000000000 --- a/addons/web_chat/i18n/web_chat.pot +++ /dev/null @@ -1,19 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2012 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2012. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2012-02-06 17:33+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.6\n" - diff --git a/addons/web_chat/static/lib/AjaxIM/LICENSE.txt b/addons/web_chat/static/lib/AjaxIM/LICENSE.txt deleted file mode 100644 index 78685f1b2b8..00000000000 --- a/addons/web_chat/static/lib/AjaxIM/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2005 - 2010 Joshua Gross, http://ajaxim.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/addons/web_chat/static/lib/AjaxIM/js/im.js b/addons/web_chat/static/lib/AjaxIM/js/im.js deleted file mode 100644 index 9ab195fd6b6..00000000000 --- a/addons/web_chat/static/lib/AjaxIM/js/im.js +++ /dev/null @@ -1,2101 +0,0 @@ -// = im.js = -// -// **Copyright © 2005 – 2010 Joshua Gross**\\ -// //MIT Licensed// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -// This is the main library for Ajax IM. It encompasses the UI controls, -// and connecting with the server. It does //not// handle registration or -// account management. - -(function($, _instance) { - AjaxIM = function(options, actions) { - if(this instanceof AjaxIM) { - var self = this; - - // === {{{ defaults }}} === - // - // These are the available settings for Ajax IM, and the associated - // defaults: - // - // * {{{pollType}}} determines the way in which the client will talk to - // the server. - // ** {{{comet}}} will use http streaming, wherein a connection to the server will be held open indefinitely, and the server will push down new events (messages, status updates) as they occur. - // ** {{{long}}} will hold open a connection with the server for as long as possible, or until a new event is received. Upon the server sending an event or closing the connection, the client will automatically—and immediately—reconnect. - // ** {{{short}}} will open a connection, and the server (if this method is supported) will //immediately// provide a response as to whether or not there are any new events. Once a response is received, the client will wait 5 seconds, and then reconnect. - // * {{{pollServer}}} is the default URL to which all actions refer. It is - // possible to specify certain action URLs separately (as is used with the - // NodeJS server). - // * {{{cookieName}}} is the name of the session cookie used by the server. - // If this is not set properly, the IM engine will not be able to automatically - // reinitialize sessions. - // * {{{theme}}} is the name of the theme folder that defines the HTML and - // CSS of the IM bar and chat boxes. Usually, themes are deposited in the - // provided "themes" folder and specified by that path, e.g. {{{themes/default}}}. - // Theme files within the theme folder must be named {{{theme.html}}} and - // {{{theme.css}}}. - // * {{{storageMethod}}} defines the way in which data (chat sessions) are - // temporarily stored client-side. By default, {{{"flash"}}} is used because - // it is the most widely supported method. However, - // [[http://eric.garside.name/docs.html?p=jstore#js-engines|other storage engines]] - // are available, with their respective up- and down-sides - // outlined, on the jStore website. - // * {{{storeSession}}} (**not implemented**) sets the number of days to - // retain stored chat session data before it should be deleted. - // * {{{checkResume}}} is a flag that sets whether or not the client should - // make a call to the server before resuming the session (such as on a page - // reload). This will ensure that the session has not expired. If set to {{{false}}}, - // a call to the server will not be made, and the session will be assumed to - // be active. - var defaults = { - pollType: 'long', - pollServer: './ajaxim.php', - cookieName: 'ajaxim_session', - theme: 'themes/default', - storageMethod: 'auto', - flashStorage: 'js/jStore.Flash.html', - storeSession: 5, // number of days to store chat data (0 for current session only) - checkResume: true - }; - - // === {{{AjaxIM.}}}**{{{settings}}}** === - // - // These are the settings for the IM. If particular options are not specified, - // the defaults (see above) will be used. //These options will be defined - // upon calling the initialization function, and not set directly.// - this.settings = $.extend(defaults, options); - - // === {{{AjaxIM.}}}**{{{actions}}}** === - // - // Each individual action that the IM engine can execute is predefined here. - // By default, it merely appends the action onto the end of the {{{pollServer}}} url, - // however, it is possible to define actions individually. //The alternative actions - // will be defined upon calling the initialization function, and not set directly.// - // - // Should you define an action at a different URL, Ajax IM will determine whether - // or not this URL is within the current domain. If it is within a subdomain of - // the current domain, it will set the document.domain variable for you, - // to match a broader hostname scope; the action will continue to use {{{$.post}}} - // (the default AJAX method for Ajax IM). - // - // On the other hand, should you choose a URL outside the current domain - // Ajax IM will switch to {{{$.getJSON}}} (a get request) to avoid - // cross-domain scripting issues. This means that a server on a different - // port or at a different address will need to be able to handle GET - // requests rather than POST requests (such as how the Node.JS Ajax IM - // server works). - this.actions = $.extend({ - login: this.settings.pollServer + '/login', - logout: this.settings.pollServer + '/logout', - register: this.settings.pollServer + '/register', - poll: this.settings.pollServer + '/poll', - send: this.settings.pollServer + '/send', - status: this.settings.pollServer + '/status', - resume: this.settings.pollServer + '/resume' - }, actions); - - var httpRx = new RegExp('^http://', 'i'), - slashslashRx = new RegExp('^//', 'i'), - queryStrRx = new RegExp('[?](.+)$'), - subdomainRx = new RegExp('((http[s]?:)?//)?(.+?)[.]' + window.location.host, 'i'); - $.each(this.actions, function(name, action) { - if(name == 'poll' || name == 'send') { - if(self.settings.pollType != 'comet') - action += (queryStrRx.test(action[1]) ? '&' : '?') + 'callback=?'; - - action = ['jsonp', action]; - } else { - action = ['ajax', action]; - if(subdomainRx.test(action[1])) { - document.domain = '.' + window.location.host; - } else if((http = httpRx.test(action[1])) || slashslashRx.test(action[1])) { - if(!(new RegExp('//' + window.location.host + '/', 'i')).test(action[1])) { - action[1] += (queryStrRx.test(action[1]) ? '&' : '?') + 'callback=?'; - action = ['jsonp', action[1]]; - } - } - } - - self.actions[name] = action; - }); - - // We load the theme dynamically based on the passed - // settings. If the theme is set to false, we assume - // that the user is going to load it himself. - this.themeLoaded = false; - if(this.settings.theme) { - $('
').appendTo('body').load(this.settings.theme + '/theme.html #imjs-bar, .imjs-tooltip', - function() { - self.themeLoaded = true; - setup.apply(self); - } - ); - if(typeof document.createStyleSheet == 'function') - document.createStyleSheet(this.settings.theme + '/theme.css'); - else - $('body').append(''); - } else { - this.themeLoaded = true; - setup.apply(this); - } - - // Client-side storage for keeping track of - // conversation states, active tabs, etc. - // The default is flash storage, however, other - // options are available via the jStore library. - if(this.settings.storageMethod) { - this.storageBrowserKey = 'unknown'; - this.storeKey = ''; - - $.each($.browser, function(k, v) { - if(k == 'version') return true; - else if(v == true) { - self.storageBrowserKey = k; - return false; - } - }); - - if(this.settings.storageMethod == 'auto') { - $.each(['ie', 'html5', 'local', 'flash'], function() { - if($.jStore.Availability[this]()) { - self.settings.storageMethod = this; - return false; - } - }); - } - - $.extend($.jStore.defaults, { - project: 'im.js', - engine: this.settings.storageMethod, - flash: this.settings.flashStorage - }); - - this.storageReady = false; - - if(this.settings.storageMethod == 'flash') { - $.jStore.ready(function(engine) { - $.jStore.flashReady(function() { - self.storageReady = true; - setup.apply(self); - }); - }) - } else { - $.jStore.ready(function(engine) { - self.storageReady = true; - setup.apply(self); - }); - } - - $.jStore.load(); - } else { - this.storageReady = true; - setup.apply(this); - } - - // Allow a chatbox to me minimized - $('.imjs-chatbox').live('click', function(e) { - e.preventDefault(); - return false; - }); - - $('.imjs-chatbox .imjs-minimize').live('click', function() { - $(this).parents('.imjs-chatbox').data('tab').click(); - }); - - // Allow a chatbox to be closed - $('.imjs-chatbox .imjs-close').live('click', function() { - var chatbox = $(this).parents('.imjs-chatbox'); - chatbox.data('tab') - .data('state', 'closed').css('display', 'none'); - - if(self.settings.storageMethod && self.storageReady) { - delete self.chatstore[chatbox.data('username')]; - if(self.storageReady) { - $.jStore.store( - self.storageBrowserKey + '-' + - self.username + '-chats', - self.chatstore); - } - } - }); - - // Setup message sending for all chatboxes - $('.imjs-chatbox .imjs-input').live('keydown', function(event) { - var obj = $(this); - if(event.keyCode == 13 && !($.browser.msie && $.browser.version < 8)) { - self.send(obj.parents('.imjs-chatbox').data('username'), obj.val()); - } - }).live('keyup', function(event) { - if(event.keyCode == 13) { - if($.browser.msie && $.browser.version < 8) { - var obj = $(this); - self.send(obj.parents('.imjs-chatbox').data('username'), obj.val()); - } - - var obj = $(this); - obj.val(''); - obj.height(obj.data('height')); - } - }).live('keypress', function(e) { - var obj = $(this); - if(!($.browser.msie && $.browser.opera)) obj.height(0); - if(this.scrollHeight > obj.height() || this.scrollHeight < obj.height()) { - obj.height(this.scrollHeight); - } - }); - - $('.imjs-msglog').live('click', function() { - var chatbox = $(this).parents('.imjs-chatbox'); - chatbox.find('.imjs-input').focus(); - }); - - // Create a chatbox when a buddylist item is clicked - $('.imjs-friend').live('click', function() { - var chatbox = self._createChatbox($(this).data('friend')); - - if(chatbox.data('tab').data('state') != 'active') - chatbox.data('tab').click(); - - chatbox.find('.imjs-input').focus(); - }); - - // Setup and hide the scrollers - $('.imjs-scroll').css('display', 'none'); - $('#imjs-scroll-left').live('click', function() { - var hiddenTab = $('#imjs-bar li.imjs-tab:visible').slice(-1) - .next('#imjs-bar li.imjs-tab:hidden') - .filter(function() { - return $(this).data('state') != 'closed' - }) - .not('.imjs-default').slice(-1).css('display', ''); - - if(hiddenTab.length) { - $('#imjs-bar li.imjs-tab:visible').eq(0).css('display', 'none'); - $(this).html(parseInt($(this).html()) - 1); - $('#imjs-scroll-right').html(parseInt($('#imjs-scroll-right').html()) + 1); - } - - return false; - }); - $('#imjs-scroll-right').live('click', function() { - var hiddenTab = $('#imjs-bar li.imjs-tab:visible').eq(0) - .prev('#imjs-bar li.imjs-tab:hidden') - .filter(function() { - return $(this).data('state') != 'closed' - }) - .not('.imjs-default').slice(-1).css('display', ''); - - if(hiddenTab.length) { - $('#imjs-bar li.imjs-tab:visible').slice(-1).css('display', 'none'); - $(this).html(parseInt($(this).html()) - 1); - $('#imjs-scroll-left').html(parseInt($('#imjs-scroll-left').html()) + 1); - } - - return false; - }); - - // Initialize the chatbox hash - this.chats = {}; - - // Try to resume any existing session - this.resume(); - - $(window).resize(function() { - self.bar._scrollers(); - }); - } else - return AjaxIM.init(options); - }; - - // We predefine all public functions here... - // If they are called before everything (theme, storage engine) has loaded, - // then they get put into a "prequeue" and run when everything *does* - // finally load. - // - // This ensures that nothing loads without all of the principal components - // being pre-loaded. If that were to occur (without this prequeue), things - // would surely break. - var prequeue = []; - var empty = function() { - var func = this; - return function() { prequeue.push([func, arguments]) }; - }; - $.extend(AjaxIM.prototype, { - settings: {}, - friends: {}, - chats: {}, - - storage: empty.apply('storage'), - login: empty.apply('login'), - logout: empty.apply('logout'), - resume: empty.apply('resume'), - form: empty.apply('form'), - poll: empty.apply('poll'), - incoming: empty.apply('incoming'), - send: empty.apply('send'), - status: empty.apply('status'), - statuses: {}, - bar: { - initialize: empty.apply('bar.initialize'), - activateTab: empty.apply('bar.activateTab'), - closeTab: empty.apply('bar.closeTab'), - addTab: empty.apply('bar.addTab'), - notification: empty.apply('bar.notification'), - _scrollers: empty.apply('bar._scrollers') - } - }); - - setup = (function() { - var self = this; - if(!this.storageReady || !this.themeLoaded) return; - - $(self).trigger('loadComplete'); - $(window).resize(); - - $.extend(AjaxIM.prototype, { - // == Cookies == - // - // The "cookies" functions can be used to set, get, and erase JSON-based cookies. - // These functions are primarily used to manage and read the server-set cookie - // that handles the user's chat session ID. - cookies: { - // === {{{AjaxIM.}}}**{{{cookies.set(name, value, days)}}}** === - // - // Sets a cookie, stringifying the JSON value upon storing it. - // - // ==== Parameters ==== - // * {{{name}}} is the cookie name.\\ - // * {{{value}}} is the cookie data that you would like to store.\\ - // * {{{days}}} is the number of days that the cookie will be stored for. - set: function(name, value, days) { - if (days) { - var date = new Date(); - date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); - var expires = "; expires=" + date.toGMTString(); - } else var expires = ""; - document.cookie = name + "=" + $.compactJSON(value) + expires + "; path=/"; - }, - - // === {{{AjaxIM.}}}**{{{cookies.get(name)}}}** === - // - // Gets a cookie, decoding the JSON value before returning the data. - // - // ==== Parameters ==== - // * {{{name}}} is the cookie name that you would like to retrieve. - get: function(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for(var i = 0; i < ca.length; i++) { - var c = ca[i]; - while (c.charAt(0) == ' ') c = c.substring(1, c.length); - if (c.indexOf(nameEQ) == 0) { - var cval = decodeURIComponent(c.substring(nameEQ.length, c.length)); - return $.secureEvalJSON(cval); - } - } - return null; - }, - - // === {{{AjaxIM.}}}**{{{cookies.erase(name)}}}** === - // - // Deletes a cookie. - // - // {{{name}}} is the existing cookie that you would like to delete. - erase: function(name) { - self.cookies.set(name, '', -1); - } - }, - - // == Main == - - // === {{{AjaxIM.}}}**{{{storage()}}}** === - // - // Retrieves chat session data from whatever storage engine is enabled - // (provided that one is enabled at all). If a page reloads, this function - // is called to restore the user's chat state (existing conversations, active tab). - // This function is called //automatically//, upon initialization of the IM engine. - storage: function() { - if(!self.storeKey.length) return; - - try { - var chatstore = $.jStore.store(self.storeKey + 'chats') || {}; - } catch(e) { - $.jStore.remove(self.storeKey + 'chats'); - var chatstore = {}; - } - - if(this.chatstore) { - $.each(this.chatstore, function(username, convo) { - if(username in chatstore) - chatstore[username] = $.merge(chatstore[username], self.chatstore[username]); - else - chatstore[username] = self.chatstore[username]; - }); - - this.chatstore = chatstore; - $.jStore.store(self.storeKey + 'chats', chatstore); - } else { - this.chatstore = chatstore; - } - - $.each(this.chatstore, function(username, convo) { - if(!convo.length) return; - - var chatbox = self._createChatbox(username, true); - chatbox.data('lastDateStamp', null).css('display', 'none'); - - // Remove the automatic date stamp - chatbox.find('.imjs-msglog').empty(); - - // Restore all messages, date stamps, and errors - $.each(convo, function() { - switch(this[0]) { - case 'error': - self._addError(chatbox, decodeURIComponent(this[2]), this[3]); - break; - - case 'datestamp': - self._addDateStamp(chatbox, this[3]); - break; - - case 'a': - case 'b': - self._addMessage(this[0], chatbox, this[1], - decodeURIComponent(this[2]), this[3]); - break; - } - }); - - $(self).trigger('chatRestored', [username, chatbox]); - }); - - var activeTab = $.jStore.store(self.storeKey + 'activeTab') || []; - if(activeTab.length && (activeTab = activeTab[0]) && activeTab in this.chats) { - this.chats[activeTab].data('tab').click(); - var msglog = this.chats[activeTab].find('.imjs-msglog'); - msglog[0].scrollTop = msglog[0].scrollHeight; - } - }, - - // === {{{AjaxIM.}}}**{{{login(username, password)}}}** === - // - // Authenticates a user and initializes the IM engine. If the user is - // already logged in, [s]he is logged out, the session is cleared, and - // the new user is logged in. - // - // Returns the user's properly formatted username, session ID, and online - // friends in JSON, if successful; e.g.:\\ - // {{{ {u: 'username', s: 'longsessionid', f: [{u: 'friend', s: 1, g: 'group'}]} }}} - // - // If unsuccessful, {{{false}}} is returned. - // - // ==== Parameters ==== - // * {{{username}}} is the user's username.\\ - // * {{{password}}} is the user's password. This password will be MD5 hashed - // before it is sent to the server. - login: function(username, password) { - if(!username) username = ''; - if(!password) password = ''; - - if(this.username) - return true; // Already logged in! - - // hash password before sending it to the server - password = $.md5(password); - - // authenticate - AjaxIM.request( - this.actions.login, - {'username': username, 'password': password}, - function(auth) { - if(auth.r == 'logged in') { - self.username = ('u' in auth ? auth.u : username); - - if(self.settings.storageMethod) - self.storeKey = [self.storageBrowserKey, self.username, ''].join('-'); - - var existing = self.cookies.get(self.settings.cookieName); - self.storage(); - - // Begin the session - $.each(auth.f, function() { - self.friends[this.u] = {status: [this.s, ''], group: this.g}; - }); - self._session(self.friends); - self._storeFriends(); - - $(self).trigger('loginSuccessful', [auth]); - - return auth; - } else { - $(self).trigger('loginError', [auth]); - } - - return false; - } - ); - }, - - // === {{{AjaxIM.}}}**{{{logout()}}}** === - // - // Logs the user out and removes his/her session cookie. As well, it - // will close all existing chat windows, clear the storage engine, and - // remove the IM bar. - logout: function() { - AjaxIM.request( - this.actions.logout, - {}, - function(done) { - if(done) { - self.cookies.erase(self.settings.cookieName); - self._clearSession(); - $(self).trigger('logoutSuccessful'); - return true; - } else { - $(self).trigger('logoutError'); - return false; - } - } - ); - }, - - // === {{{AjaxIM.}}}**{{{resume()}}}** === - // - // Resumes an existing session based on a session ID stored in the - // server-set cookie. This function is called //automatically// upon IM - // engine (re-)initialization, so the user does not need to re-login - // should a session already exist. - resume: function() { - var session = this.cookies.get(this.settings.cookieName); - - if(session && session.sid) { - this.username = session.user; - - this.storeKey = [this.storageBrowserKey, this.username, ''].join('-'); - - var friends = $.jStore.store(this.storeKey + 'friends') || []; - if(self.settings.checkResume) { - AjaxIM.request( - this.actions.resume, - {}, - function(response) { - if(response.r == 'connected') { - self._session(friends); - self.storage(); - } else { - var username = this.username; - self._clearSession(); - $(self).trigger('sessionNotResumed', [username]); - } - } - ); - } else { - self._session(friends); - self.storage(); - } - } else { - $(self).trigger('noSession'); - } - }, - - // === //private// {{{AjaxIM.}}}**{{{_session(friends)}}}** === - // - // Restores session data (username, friends) and begins polling the server. - // Called only by {{{AjaxIM.resume()}}}. - // - // ==== Parameters ==== - // * {{{friends}}} is a list of "friend" objects, e.g.:\\ - // {{{[{u: 'friend', s: 1, g: 'group'}, ...]}}} - // ** {{{u}}} being the friend's username. - // ** {{{s}}} being one of the available status codes (see {{{AjaxIM.statuses}}}), depending on the friend's current status. - // ** {{{g}}} being the group that the friend is in. - _session: function(friends) { - $('#imjs-friends-panel .imjs-header span').html(this.username); - $('#imjs-friends').removeClass('imjs-not-connected'); - - $.each(friends, function(friend, info) { - self.addFriend.apply(self, [friend, info.status, info.group]); - }); - self._storeFriends(); - - $(self).trigger('sessionResumed', [this.username]); - - setTimeout(function() { self.poll(); }, 0); - }, - - // === //private// {{{AjaxIM.}}}**{{{_clearSession()}}}** === - // - // Clears all session data from the last known user. - _clearSession: function() { - if(self.settings.storageMethod && self.storageReady) { - $.jStore.remove(self.storeKey + 'chats'); - $.jStore.remove(self.storeKey + 'friends'); - $.jStore.remove(self.storeKey + 'activeTab'); - } - - self.chats = {}; - $('.imjs-tab').not('.imjs-tab.imjs-default').remove(); - - self.cookies.erase('ajaxim_session'); - delete self.username; - }, - - // === {{{AjaxIM.}}}**{{{form(element)}}}** === - // - // Loads a login and registration form into the specified element - // or, if no element is supplied, to the location on the page from - // which this function was called. - form: function(element) { - $(element).load(this.settings.theme + '/theme.html #imjs-lr', function() { - $('#imjs-lr .error').hide(); - - if(self.username) { - $('#imjs-register, #imjs-login fieldset').hide(); - $('#imjs-logged-in') - .show() - .html($('#imjs-logged-in').html().replace('{username}', self.username)); - } else { - $('#imjs-logged-in').hide(); - } - - // Handle logout success - $(self).bind('logoutSuccessful', function() { - $('#imjs-login fieldset').slideDown(); - $('#imjs-register').slideDown(); - - $('#imjs-logged-in') - .html($('#imjs-logged-in strong').html('{username}')) - .slideUp(); - }); - $('#imjs-logged-in a').click(function() { - self.logout(); - return false; - }); - - // Handle login error or success - $(self).bind('loginError', function() { - $('#imjs-login .error').html(AjaxIM.i18n.authInvalid).slideDown('fast'); - $('#imjs-login input') - .addClass('imjs-lr-error') - .blur(function() { $(this).removeClass('imjs-lr-error'); }); - }).bind('loginSuccessful', function() { - $('#imjs-login fieldset').slideUp(); - $('#imjs-register').slideUp(); - - $('#imjs-logged-in') - .html($('#imjs-logged-in').html().replace('{username}', self.username)) - .slideDown(); - }); - var login = function() { - self.login($('#imjs-login-username').val(), $('#imjs-login-password').val()); - return false; - }; - $('#imjs-login').submit(login); - $('#imjs-login-submit').click(login); - - var regIssues = false; - var regError = function(error, fields) { - $('#imjs-register .error') - .append(AjaxIM.i18n['register' + error] + ' ') - .slideDown(); - $(fields) - .addClass('imjs-lr-error') - .blur(function() { $(this).removeClass('imjs-lr-error'); }); - regIssues = true; - }; - - var register = function() { - $('#imjs-register .error').empty(); - - regIssues = false; - - var username = $('#imjs-register-username').val(); - var password = $('#imjs-register-password').val(); - - if(password.length < 4) - regError('PasswordLength', '#imjs-register-password'); - - if(password != $('#imjs-register-cpassword').val()) - regError('PasswordMatch', '#imjs-register-password, #imjs-register-cpassword'); - - if(username.length <= 2 || - !$('#imjs-register-username').val().match(/^[A-Za-z0-9_.]+$/)) - regError('UsernameLength', '#imjs-register-username'); - - if(!regIssues) { - AjaxIM.request( - self.actions.register, - {username: username, password: password}, - function(response) { - if(response.r == 'registered') { - self.login(username, password); - } else if(response.r == 'error') { - switch(response.e) { - case 'unknown': - regError('Unknown', ''); - break; - - case 'invalid password': - regError('PasswordLength', '#imjs-register-password'); - break; - - case 'invalid username': - regError('UsernameLength', '#imjs-register-username'); - break; - - case 'username taken': - regError('UsernameTaken', '#imjs-register-username'); - break; - } - } - }, - function(error) { - regError('Unknown', ''); - } - ); - } - - return false; - }; - $('#imjs-register').submit(register); - $('#imjs-register-submit').click(register); - }); - }, - - // === {{{AjaxIM.}}}**{{{poll()}}}** === - // - // Queries the server for new messages. If a 'long' or 'short' poll - // type is used, jQuery's {{{$.post}}} or {{{$.getJSON}}} will be - // used. If 'comet' is used, the server connection will be deferred - // to the comet set of functions. - poll: function() { - if(/^(short|long)$/.test(this.settings.pollType)) { - AjaxIM.request( - this.actions.poll, - {}, - function(response) { - if(!response['e']) { - if(response.length) - self._parseMessages(response); - - setTimeout(function() { self.poll(); }, 0); - } else { - switch(response.e) { - case 'no session found': - self._notConnected(); - break; - } - - $(self).trigger('pollFailed', [response.e]); - } - }, - function(error) { - self._notConnected(); - $(self).trigger('pollFailed', ['not connected']); - // try reconnecting? - } - ); - } else if(this.settings.pollType == 'comet') { - this.comet.connect(); - } - }, - - // === //private// {{{AjaxIM.}}}**{{{_parseMessages(messages)}}}** === - // - // Handles an incoming message array:\\ - // {{{[{t: 'type', s: 'sender', r: 'recipient', m: 'message'}, ...]}}} - // - // * {{{t}}} (message type) is one of: - // ** {{{m}}} — a standard message - // ** {{{s}}} — a user's status update - // ** {{{b}}} — a broadcasted message (sent to many users simultaneously) - // * {{{s}}} is the sender of the message. - // * {{{r}}} is the intended recipient of the message. Most of the time, this will - // simply be the logged in user, however, a broadcasted message may not specify - // a recipient or may specify a different recipient. Also provides future - // compatability for chatrooms. - // * {{{m}}} is the actual message. For something such as a status update, this can - // be a JSON object or parsable string; e.g. {{{"2:I'm away."}}} - // - // ==== Parameters ==== - // * {{{messages}}} is the message array - _parseMessages: function(messages) { - if($.isArray(messages)) { - $.each(messages, function() { - $(self).trigger('parseMessage', [this]); - - switch(this.t) { - case 'm': - self.incoming(this.s, this.m); - break; - - case 's': - var status = this.m.split(':'); - if(this['g']) - self.addFriend(this.s, status, this.g); - self._friendUpdate(this.s, status[0], status.slice(1).join(':')); - self._storeFriends(); - break; - - case 'b': - break; - - default: - break; - } - }); - } - }, - - // === {{{AjaxIM.}}}**{{{incoming(from, message)}}}** === - // - // Handles a new message from another user. If a chatbox for that - // user does not yet exist, one is created. If it does exist, but - // is minimized, the user is notified but the chatbox is not brought - // to the front. This function also stores the message, if a storage - // method is set. - // - // ==== Parameters ==== - // * {{{from}}} is the username of the sender. - // * {{{message}}} is the body. - incoming: function(from, message) { - // check if IM exists, otherwise create new window - // TODO: If friend is not on the buddylist, - // should add them to a temp list? - var chatbox = this._createChatbox(from); - - if(!$('#imjs-bar .imjs-selected').length) { - chatbox.data('tab').click(); - } else if(chatbox.data('tab').data('state') != 'active') { - this.bar.notification(chatbox.data('tab')); - } - - var time = this._addMessage('b', chatbox, from, message); - this._storeMessage('b', chatbox, from, message, time); - }, - - // === {{{AjaxIM.}}}**{{{addFriend(username, group)}}}** === - // - // Inserts a new friend into the friends list. If the group specified - // doesn't exist, it is created. If the friend is already in this group, - // they aren't added again, however, the friend item is returned. - // - // ==== Parameters ==== - // * {{{username}}} is the username of the new friend. - // * {{{status}}} is the current status of the friend. - // * {{{group}}} is the user group to which the friend should be added. - addFriend: function(username, status, group) { - var status_name = 'available'; - $.each(this.statuses, - function(key, val) { if(status[0] == val) { status_name = key; return false; } }); - - var group_id = 'imjs-group-' + $.md5(group); - - if(!(group_item = $('#' + group_id)).length) { - var group_item = $('.imjs-friend-group.imjs-default').clone() - .removeClass('imjs-default') - .attr('id', group_id) - .data('group', group) - .appendTo('#imjs-friends-list'); - - var group_header = group_item.find('.imjs-friend-group-header'); - group_header.html(group_header.html().replace('{group}', group)); - } - - var user_id = 'imjs-friend-' + $.md5(username + group); - - if(!$('#' + user_id).length) { - var user_item = group_item.find('ul li.imjs-default').clone() - .removeClass('imjs-default') - .addClass('imjs-' + status_name) - .attr('id', user_id) - .data('friend', username) - .appendTo(group_item.find('ul')); - if(status[0] == 0) user_item.hide(); - user_item.html(user_item.html().replace('{username}', username)); - } - - this.friends[username] = {'status': status, group: group}; - - this._updateFriendCount(); - - return this.friends[username]; - }, - - // === //private// {{{AjaxIM.}}}**{{{_updateFriendCount()}}}** === - // - // Counts the number of online friends and updates the friends count - // in the friend tab. - _updateFriendCount: function() { - var friendsLength = 0; - for(var f in this.friends) { - if(this.friends[f].status[0] != 0) - friendsLength++; - } - $('#imjs-friends .imjs-tab-text span span').html(friendsLength); - }, - - // === //private// {{{AjaxIM.}}}**{{{_storeFriends()}}}** === - // - // If a storage method is enabled, the current state of the - // user's friends list is stored. - _storeFriends: function() { - if(this.settings.storageMethod && this.storageReady) - $.jStore.store(this.storeKey + 'friends', this.friends); - }, - - // === //private// {{{AjaxIM.}}}**{{{_createChatbox(username)}}}** === - // - // Builds a chatbox based on the default chatbox HTML and CSS defined - // in the current theme. Should a chatbox for this user already exist, - // a new one is not created. Instead, it is either given focus (should - // no other windows already have focus), or a notification is issued. - // - // As well, if the chatbox does not exist, an associated tab will be - // created. - // - // ==== Parameters ==== - // * {{{username}}} is the name of the user for whom the chatbox is intended - // for. - // * {{{no_stamp}}} sets whther or not to add a date stamp to the chatbox - // upon creation. - // - // //Note:// New chatboxes are given an automatically generated ID in the - // format of {{{#imjs-[md5 of username]}}}. - _createChatbox: function(username, no_stamp) { - var chatbox_id = 'imjs-' + $.md5(username); - if(!(chatbox = $('#' + chatbox_id)).size()) { - // add a tab - var tab = this.bar.addTab(username, '#' + chatbox_id); - var chatbox = tab.find('.imjs-chatbox'); - chatbox.attr('id', chatbox_id); - - chatbox.data('tab', tab); - - // remove default items from the message log - var message_log = chatbox.find('.imjs-msglog').empty(); - - // setup the chatbox header - var cb_header = chatbox.find('.imjs-header'); - cb_header.html(cb_header.html().replace('{username}', username)); - - if(!no_stamp) { - // add a date stamp - var time = this._addDateStamp(chatbox); - this._storeNonMessage('datestamp', username, null, time); - } - - // associate the username with the object and vice-versa - this.chats[username] = chatbox; - chatbox.data('username', username); - - // did this chatbox fall down? - this.bar._scrollers(); - - if(username in this.friends) { - status = this.friends[username].status; - var status_name = 'available'; - $.each(this.statuses, - function(key, val) { if(status[0] == val) { status_name = key; return false; } }); - tab.addClass('imjs-' + status_name); - } - - // store inputbox height - //var input = chatbox.find('.imjs-input'); - //input.data('height', input.height()); - } else if(chatbox.data('tab').data('state') == 'closed') { - chatbox.find('.imjs-msglog > *').addClass('imjs-msg-old'); - - var tab = chatbox.data('tab'); - if(tab.css('display') == 'none') - tab.css('display', '').removeClass('imjs-selected') - .appendTo('#imjs-bar'); - - if(!no_stamp) { - // possibly add a date stamp - var time = this._addDateStamp(chatbox); - this._storeNonMessage('datestamp', username, null, time); - } - - if(!$('#imjs-bar .imjs-selected').length) { - tab.click(); - } else { - this.bar.notification(tab); - } - } - - return chatbox; - }, - - // === //private// {{{AjaxIM.}}}**{{{_addDateStamp(chatbox)}}}** // - // - // Adds a date/time notifier to a chatbox. These are generally - // inserted upon creation of a chatbox, or upon the date changing - // since the last time a date stamp was added. If a date stamp for - // the current date already exists, a new one will not be added. - // - // ==== Parameters ==== - // * {{{chatbox}}} refers to the jQuery-selected chatbox DOM element. - // * {{{time}}} is the date/time the date stamp will show. It is specified - // in milliseconds since the Unix Epoch. This is //only// defined when - // date stamps are being restored from storage; if not specified, the - // current computer time will be used. - _addDateStamp: function(chatbox, time) { - var message_log = $(chatbox).find('.imjs-msglog'); - if(!time) - time = (new Date()).getTime(); - - var date_stamp = $('.imjs-tab.imjs-default .imjs-chatbox .imjs-msglog .imjs-date').clone(); - var date_stamp_time = date_stamp.find('.imjs-msg-time'); - if(date_stamp_time.length) - date_stamp_time.html(AjaxIM.dateFormat(time, date_stamp_time.html())); - - var date_stamp_date = date_stamp.find('.imjs-date-date'); - var formatted_date = AjaxIM.dateFormat(time, date_stamp_date.html()); - if(chatbox.data('lastDateStamp') != formatted_date) { - if(date_stamp_date.length) - date_stamp_date.html(AjaxIM.dateFormat(time, date_stamp_date.html())); - - chatbox.data('lastDateStamp', formatted_date); - date_stamp.appendTo(message_log); - } else { - //$('
').appendTo(message_log); - } - - return time; - }, - - // === //private// {{{AjaxIM.}}}**{{{_addError(chatbox, error)}}}** // - // - // Adds an error to a chatbox. These are generally inserted after - // a user sends a message unsuccessfully. If an error message - // was already added, another one will be added anyway. - // - // ==== Parameters ==== - // * {{{chatbox}}} refers to the jQuery-selected chatbox DOM element. - // * {{{error}}} is the error message string. - // * {{{time}}} is the date/time the error occurred. It is specified in - // milliseconds since the Unix Epoch. This is //only// defined when - // errors are being restored from storage; if not specified, the current - // computer time will be used. - _addError: function(chatbox, error, time) { - var message_log = $(chatbox).find('.imjs-msglog'); - - var error_item = - $('.imjs-tab.imjs-default .imjs-chatbox .imjs-msglog .imjs-error').clone(); - - var error_item_time = error_item.find('.imjs-msg-time'); - if(error_item_time.length) { - if(!time) - time = (new Date()).getTime(); - error_item_time.html(AjaxIM.dateFormat(time, error_item_time.html())); - } - - error_item.find('.imjs-error-error').html(error); - error_item.appendTo(message_log); - - message_log[0].scrollTop = message_log[0].scrollHeight; - }, - - // === //private// {{{AjaxIM.}}}**{{{_addMessage(ab, chatbox, username, message, time)}}}** // - // - // Adds a message to a chatbox. Depending on the {{{ab}}} value, - // the color of the username may change as a way of visually - // identifying users (however, this depends on the theme's CSS). - // A timestamp is added to the message, and the chatbox is scrolled - // to the bottom, such that the new message is visible. - // - // Messages will be automatically tag-escaped, so as to prevent - // any potential cross-site scripting problems. Additionally, - // URLs will be automatically linked. - // - // ==== Parameters ==== - // * {{{ab}}} refers to whether the user is "a" or "b" in a conversation. - // For the general case, "you" are "a" and "they" are "b". - // * {{{chatbox}}} refers to the jQuery-selected chatbox DOM element. - // * {{{username}}} is the username of the user who sent the message. - // * {{{time}}} is the time the message was sent in milliseconds since - // the Unix Epoch. This is //only// defined when messages are being - // restored from storage. For new messages, the current computer - // time is automatically used. - _addMessage: function(ab, chatbox, username, message, time) { - var last_message = chatbox.find('.imjs-msglog > *:last-child'); - if(last_message.hasClass('imjs-msg-' + ab)) { - // Last message was from the same person, so let's just add another imjs-msg-*-msg - var message_container = (last_message.hasClass('imjs-msg-' + ab + '-container') ? - last_message : - last_message.find('.imjs-msg-' + ab + '-container')); - - var single_message = - $('.imjs-tab.imjs-default .imjs-chatbox .imjs-msglog .imjs-msg-' + ab + '-msg') - .clone().appendTo(message_container); - - single_message.html(single_message.html().replace('{username}', username)); - } else if(!last_message.length || !last_message.hasClass('imjs-msg-' + ab)) { - var message_group = $('.imjs-tab.imjs-default .imjs-chatbox .imjs-msg-' + ab) - .clone().appendTo(chatbox.find('.imjs-msglog')); - message_group.html(message_group.html().replace('{username}', username)); - - var single_message = message_group.find('.imjs-msg-' + ab + '-msg'); - } - - // clean up the message - message = message.replace(//g, '>') - .replace(/(^|.*)\*([^*]+)\*(.*|$)/, '$1$2$3'); - - // autolink URLs - message = message.replace( - new RegExp('([A-Za-z][A-Za-z0-9+.-]{1,120}:[A-Za-z0-9/]' + - '(([A-Za-z0-9$_.+!*,;/?:@&~=-])|%[A-Fa-f0-9]{2}){1,333}' + - '(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*,;/?:@&~=%-]{0,1000}))?)', 'g'), - '$1'); - - // insert the message - single_message.html(single_message.html().replace('{message}', message)); - - // set the message time - var msgtime = single_message.find('.imjs-msg-time'); - if(!time) - time = new Date(); - - if(typeof time != 'string') - time = AjaxIM.dateFormat(time, msgtime.html()); - - msgtime.html(time); - - var msglog = chatbox.find('.imjs-msglog'); - msglog[0].scrollTop = msglog[0].scrollHeight; - - return time; - }, - - // === //private// {{{AjaxIM.}}}**{{{_storeNonMessage(type, username, data, time)}}}** === - // - // **Redundant?**\\ - // Similar to {{{AjaxIM._storeMessage}}}, but stores items that aren't messages, - // such as datestamps and errors. - // - // ==== Parameters ==== - // * {{{type}}} is the type of non-message (error, datestamp). - // * {{{username}}} is the username of the user being chatted with. - // * {{{data}}} is the (optional) data of the non-message to be stored. - // * {{{time}}} is the time of the message. - _storeNonMessage: function(type, username, data, time) { - // If storage is on & ready, store the non-message - if(this.settings.storageMethod) { - if(!this.chatstore) this.chatstore = {}; - if(!(username in this.chatstore)) this.chatstore[username] = []; - - // If the chat store gets too long, it becomes slow to load. - if(this.chatstore[username].length > 300) - this.chatstore[username].shift(); - - // For some reason, if we don't encode and decode the message, it *will* break - // (at least) the Flash storage engine's retrieval. Gah! - this.chatstore[username].push( - [type, username, encodeURIComponent(data), time]); - - if(this.storageReady) $.jStore.store(self.storeKey + 'chats', this.chatstore); - } - }, - - // === //private// {{{AjaxIM.}}}**{{{_storeMessage(ab, chatbox, username, message, time)}}}** === - // - // Taking the same arguments as {{{AjaxIM._addMessage}}}, {{{_storeMessage}}} pushes a message - // into the storage hash, if storage is enabled. - // - // Messages are added to a message array, by username. The entire chat hash is stored as - // a {{{'chats'}}} object in whatever storage engine is enabled. - _storeMessage: function(ab, chatbox, username, message, time) { - // If storage is on & ready, store the message - if(this.settings.storageMethod) { - if(!this.chatstore) this.chatstore = {}; - - message = message.replace(//g, '>'); - - if(!(username in this.chatstore)) { - this.chatstore[username] = []; - } else if(this.chatstore[username].length > 300) { - // If the chat store gets too long, it becomes slow to load. - this.chatstore[username].shift(); - } - - // For some reason, if we don't encode and decode the message, it *will* break - // (at least) the Flash storage engine's retrieval. Gah! - this.chatstore[chatbox.data('username')].push( - [ab, username, encodeURIComponent(message), time]); - - if(this.storageReady) $.jStore.store(this.storeKey + 'chats', this.chatstore); - } - }, - - // === //private// {{{AjaxIM.}}}**{{{_friendUpdate(friend, status, statusMessage)}}}** === - // - // Called when a friend's status is updated. This function will update all locations - // where a status icon is displayed (chat tab, friends list), as well as insert - // a notification, should a chatbox be open. - // - // ==== Parameters ==== - // * {{{friend}}} is the username of the friend. - // * {{{status}}} is the new status code. See {{{AjaxIM.statuses}}} for a list of available - // codes. //Note: If an invalid status is specified, no action will be taken.// - // * {{{statusMessage}}} is a message that was, optionally, specified by the user. It will be - // used should "you" send the user an IM while they are away, or if their status is viewed - // in another way (such as via the friends list [**not yet implemented**]). - _friendUpdate: function(friend, status, statusMessage) { - // add friend to buddylist, update their status, etc. - var status_name = 'available'; - $.each(this.statuses, - function(key, val) { if(status == val) { status_name = key; return false; } }); - - if(this.chats[friend]) { - var tab = this.chats[friend].data('tab'); - var tab_class = 'imjs-tab'; - if(tab.data('state') == 'active') tab_class += ' imjs-selected'; - tab_class += ' imjs-' + status_name; - - tab.attr('class', tab_class); - - // display the status in the chatbox - var date_stamp = - $('.imjs-tab.imjs-default .imjs-chatbox .imjs-msglog .imjs-date').clone(); - - var date_stamp_time = date_stamp.find('.imjs-msg-time'); - if(date_stamp_time.length) - date_stamp_time.html(AjaxIM.dateFormat(date_stamp_time.html())); - - var date_stamp_date = date_stamp.find('.imjs-date-date').html( - AjaxIM.i18n[ - 'chat' + status_name[0].toUpperCase() + status_name.slice(1) - ].replace(/%s/g, friend)); - - var msglog = this.chats[friend].find('.imjs-msglog'); - date_stamp.appendTo(msglog); - msglog[0].scrollTop = msglog[0].scrollHeight; - } - - if(this.friends[friend]) { - var friend_id = 'imjs-friend-' + $.md5(friend + this.friends[friend].group); - $('#' + friend_id).attr('class', 'imjs-friend imjs-' + status_name); - - if(status == 0) { - $('#' + friend_id + ':visible').slideUp(); - $('#' + friend_id + ':hidden').hide(); - } else if(!$('#' + friend_id + ':visible').length) { - $('#' + friend_id).slideDown(); - } - - this.friends[friend].status = [status, statusMessage]; - this._updateFriendCount(); - } - }, - - // === //private// {{{AjaxIM.}}}**{{{_notConnected()}}}** === - // - // Puts the user into a visible state of disconnection. Sets the - // friends list to "not connected" and empties it; disallows new messages - // to be sent. - _notConnected: function() { - $('#imjs-friends').addClass('imjs-not-connected').unbind('click', this.activateTab); - }, - - // === {{{AjaxIM.}}}**{{{send(to, message)}}}** === - // - // Sends a message to another user. The message will be added - // to the chatbox before it is actually sent, however, if an - // error occurs during sending, that will be indicated immediately - // afterward. - // - // After sending the message, one of three status codes should be - // returned as a JSON object, e.g. {{{{r: 'code'}}}}: - // * {{{ok}}} — Message was sent successfully. - // * {{{offline}}} — The user is offline or unavailable to - // receive messages. - // * {{{error}}} — a problem occurred, unrelated to the user - // being unavailable. - // - // ==== Parameters ==== - // * {{{to}}} is the username of the recipient. - // * {{{message}}} is the content to be sent. - send: function(to, message) { - if(!message) return; - - if(this.chats[to]) { // REMOVE ME? - // possibly add a datestamp - var time = self._addDateStamp(this.chats[to]); - this._storeNonMessage('datestamp', to, null, time); - - time = this._addMessage('a', this.chats[to], this.username, message); - this._storeMessage('a', this.chats[to], this.username, message, time); - } - - $(self).trigger('sendingMessage', [to, message]); - - AjaxIM.request( - this.actions.send, - {'to': to, 'message': message}, - function(result) { - switch(result.r) { - case 'ok': - $(self).trigger('sendMessageSuccessful', [to, message]); - break; - - case 'offline': - $(self).trigger('sendMessageFailed', ['offline', to, message]); - break; - - case 'error': - default: - if(result.e == 'no session found') { - self._notConnected(); - self._addError(self.chats[to], AjaxIM.i18n.notConnected); - self._storeNonMessage('error', to, - AjaxIM.i18n.notConnected, (new Date()).getTime()); - } - - $(self).trigger('sendMessageFailed', [result.e, to, message]); - break; - } - }, - function(error) { - self._notConnected(); - self._addError(self.chats[to], AjaxIM.i18n.notConnected); - self._storeNonMessage('error', to, - AjaxIM.i18n.notConnected, (new Date()).getTime()); - - $(self).trigger('sendMessageFailed', ['not connected', to, message]); - } - ); - }, - - // === {{{AjaxIM.}}}**{{{status(s, message)}}}** === - // - // Sets the user's status and status message. It is possible to not - // set a status message by setting it to an empty string. The status - // will be sent to the server, where upon the server will broadcast - // the update to all individuals with "you" on their friends list. - // - // ==== Parameters ==== - // * {{{s}}} is the status code, as defined by {{{AjaxIM.statuses}}}. - // * {{{message}}} is the custom status message. - status: function(s, message) { - // update status icon(s) - if(!this.statuses[s]) - return; - - $('#imjs-friends').attr('class', 'imjs-' + s); - - $(self).trigger('changingStatus', [s, message]); - - AjaxIM.request( - this.actions.status, - {'status': this.statuses[s], 'message': message}, - function(result) { - switch(result.r) { - case 'ok': - $(self).trigger('changeStatusSuccessful', [s, message]); - break; - - case 'error': - default: - $(self).trigger('changeStatusFailed', [result.e, s, message]); - break; - } - }, - function(error) { - $(self).trigger('changeStatusFailed', ['not connected', s, message]); - } - ); - }, - - // === {{{AjaxIM.}}}**{{{statuses}}}** === - // - // These are the available status codes and their associated identities: - // * {{{offline}}} (0) — Only used when signing out/when another - // user has signed out, as once this status is set, the user is removed - // from the server and friends will be unable to contact the user. - // * {{{available}}} (1) — The user is online and ready to be messaged. - // * {{{away}}} (2) — The user is online but is not available. Others - // may still contact this user, however, the user may not respond. Anyone - // contacting an away user will receive a notice stating that the user is away, - // and (if one is set) their custom status message. - // * {{{invisible}}} (3; **not yet implemented**) — The user is online, - // but other users are made unaware, and the user will be represented - // as being offline. It is still possible to contact this user, and for this - // user to contact others; no status message or notice will be sent to others - // messaging this user. - statuses: {offline: 0, available: 1, away: 2, invisible: 3}, - - // == Footer bar == - // - // The footer bar is the bar that sits at the bottom of the page, in a fixed - // position. It contains a tab for the friends list, and tabs for any open - // chat boxes. It is also possible to add custom tabs for other functionality. - bar: { - // === {{{AjaxIM.}}}**{{{bar.initialize()}}}** === - // - // Setup the footer bar and enable tab actions. This function - // uses {{{jQuery.live}}} to set hooks on any bar tabs created - // in the future. - initialize: function() { - // Set up your standard tab actions - $('.imjs-tab') - .live('click', this.activateTab); - - $('.imjs-tab .imjs-close') - .live('click', this.closeTab); - - // Set up the friends list actions - var self = this; - $(document).click(function(e) { - if(e.target.id == 'imjs-friends' || - $(e.target).parents('#imjs-friends').length) { - return; - } - - if($('#imjs-friends').data('state') == 'active') - self.activateTab.call($('#imjs-friends')); - }); - $('#imjs-friends') - .data('state', 'minimized') - .click(function(e) { - if(!$(this).hasClass('imjs-not-connected') && - e.target.id != 'imjs-friends-panel' && - !$(e.target).parents('#imjs-friends-panel').length) - self.activateTab.call(this); - }) - .mouseenter(function() { - if($(this).hasClass('imjs-not-connected')) { - $('.imjs-tooltip').css('display', 'block'); - $('.imjs-tooltip p').html(AjaxIM.i18n.notConnectedTip); - - var tip_left = $(this).offset().left - - $('.imjs-tooltip').outerWidth() + - ($(this).outerWidth() / 2); - var tip_top = $(this).offset().top - - $('.imjs-tooltip').outerHeight(true); - - $('.imjs-tooltip').css({ - left: tip_left, - top: tip_top - }); - } - }) - .mouseleave(function() { - if($(this).hasClass('imjs-not-connected')) { - $('.imjs-tooltip').css('display', ''); - } - }); - $('#imjs-friends-panel') - .data('tab', $('#imjs-friends')) - .css('display', 'none'); - }, - - // === {{{AjaxIM.}}}**{{{bar.activateTab()}}}** === - // - // Activate a tab by setting it to the 'active' state and - // showing any related chatbox. If a chatbox is available - // for this tab, also focus the input box. - // - // //Note:// {{{this}}}, here, refers to the tab DOM element. - activateTab: function() { - var chatbox = $(this).find('.imjs-chatbox') || false; - - if($(this).data('state') != 'active') { - if($(this).attr('id') != 'imjs-friends') { - $('#imjs-bar > li') - .not($(this)) - .not('#imjs-friends') - .removeClass('imjs-selected') - .each(function() { - if($(this).data('state') != 'closed') { - $(this).data('state', 'minimized'); - var chatbox = $(this).find('.imjs-chatbox'); - if(chatbox.length) - chatbox.css('display', 'none'); - } - }); - } - - if(chatbox && chatbox.css('display') == 'none') - chatbox.css('display', ''); - - // set the tab to active... - var tab = $(this).addClass('imjs-selected').data('state', 'active'); - - // ...and hide and reset the notification icon - tab.find('.imjs-notification').css('display', 'none') - .data('count', 0); - - if(self.settings.storageMethod && self.storageReady && - chatbox && (username = chatbox.data('username'))) { - $.jStore.store(self.storeKey + 'activeTab', [username]); - } - - $(self).trigger('tabToggled', ['activated', tab]); - } else { - var tab = $(this).removeClass('imjs-selected').data('state', 'minimized'); - - if(chatbox && chatbox.css('display') != 'none') - chatbox.css('display', 'none'); - - if(self.settings.storageMethod && self.storageReady) { - $.jStore.store(self.storeKey + 'activeTab', ['*']); - } - - $(self).trigger('tabToggled', ['minimized', tab]); - } - - if(chatbox) { - if(!(input = chatbox.find('.imjs-input')).data('height')) { - // store the height for resizing later - input.data('height', input.height()); - } - - try { - var msglog = chatbox.find('.imjs-msglog'); - msglog[0].scrollTop = msglog[0].scrollHeight; - } catch(e) {} - - try { chatbox.find('.imjs-input').focus(); } catch(e) {} - } - }, - - // === {{{AjaxIM.}}}**{{{bar.closeTab()}}}** === - // - // Close a tab and hide any related chatbox, such that - // the chatbox can not be reopened without reinitializing - // the tab. - // - // //Note:// {{{this}}}, here, refers to the tab DOM element. - closeTab: function() { - var tab = $(this).parents('.imjs-tab'); - tab.css('display', 'none').data('state', 'closed'); - - if(self.settings.storageMethod && self.storageReady) { - delete self.chatstore[tab.find('.imjs-chatbox').data('username')]; - if(self.storageReady) $.jStore.store(self.storeKey + 'chats', self.chatstore); - } - - $(self).trigger('tabToggled', ['closed', tab]); - - self.bar._scrollers(); - - return false; - }, - - // === {{{AjaxIM.}}}**{{{bar.addTab(label, action, closable)}}}** === - // - // Adds a tab to the tab bar, with the label {{{label}}}. When - // clicked, it will call a callback function, {{{action}}}. If - // {{{action}}} is a string, it is assumed that the string is - // referring to a chatbox ID. - // - // ==== Parameters ==== - // * {{{label}}} is the text that will be displayed on the tab.\\ - // * {{{action}}} is the callback function, if it is a non-chatbox - // tab, or a string if it //is// a chatbox tab.\\ - // * {{{closable}}} is a boolean value that determines whether or not - // it is possible for a user to close this tab. - // - // //Note:// New tabs are given an automatically generated ID - // in the format of {{{#imjs-tab-[md5 of label]}}}. - addTab: function(label, action, closable) { - var tab = $('.imjs-tab.imjs-default').clone().insertAfter('#imjs-scroll-right'); - tab.removeClass('imjs-default') - .attr('id', 'imjs-tab-' + $.md5(label)) - .html(tab.html().replace('{label}', label)) - .data('state', 'minimized'); - - var notification = tab.find('.imjs-notification'); - notification.css('display', 'none') - .data('count', 0) - .data('default-text', notification.html()) - .html(notification.html().replace('{count}', '0')); - - if(closable === false) - tab.find('.imjs-close').eq(0).remove(); - - if(typeof action == 'string') { - //tab.data('chatbox', action); - } else { - tab.find('.imjs-chatbox').remove(); - tab.click(action); - } - - return tab; - }, - - // === {{{AjaxIM.}}}**{{{bar.notification(tab)}}}** === - // - // Displays a notification on a tab. Generally, this is called when - // a tab is minimized to let the user know that there is an update - // for them. The way the notification is displayed depends on the - // theme CSS. - // - // ==== Parameters ==== - // * {{{tab}}} is the jQuery-selected tab DOM element. - notification: function(tab) { - var notify = tab.find('.imjs-notification'); - var notify_count = notify.data('count') + 1; - - notify.data('count', notify_count) - .html(notify.data('default-text').replace('{count}', notify_count)) - .css('display', ''); - }, - - // === //private// {{{AjaxIM.}}}**{{{bar._scrollers()}}}** === - // - // Document me! - _scrollers: function() { - var needScrollers = false; - $('.imjs-tab').filter(function() { - return $(this).data('state') != 'closed' - }).css('display', ''); - - $.each(self.chats, function(username, chatbox) { - var tab = chatbox.data('tab'); - if(tab.data('state') == 'closed') return true; - - if(tab.position().top > $('#imjs-bar').height()) { - $('.imjs-scroll').css('display', ''); - tab.css('display', 'none'); - needScrollers = true; - } else { - tab.css('display', ''); - } - }); - - if(!needScrollers) { - $('.imjs-scroll').css('display', 'none'); - } - - if($('#imjs-scroll-left').css('display') != 'none' && - $('#imjs-scroll-left').position().top > $('#imjs-bar').height()) { - $('#imjs-bar li.imjs-tab:visible').slice(-1).css('display', 'none'); - } - - var hiddenLeft = $('#imjs-bar li.imjs-tab:visible').slice(-1) - .nextAll('#imjs-bar li.imjs-tab:hidden') - .not('.imjs-default') - .filter(function() { - return $(this).data('state') != 'closed' - }).length; - - var hiddenRight = $('#imjs-bar li.imjs-tab:visible').eq(0) - .prevAll('#imjs-bar li.imjs-tab:hidden') - .not('.imjs-default') - .filter(function() { - return $(this).data('state') != 'closed' - }).length; - - $('#imjs-scroll-left').html(hiddenLeft); - $('#imjs-scroll-right').html(hiddenRight); - } - }, - - // == Comet == - // - // Comet, or HTTP streaming, holds open a connection between the client and - // the server indefinitely. As the server receives new messages or events, - // they are passed down to the client in a {{{<script>}}} - // tag which calls the {{{AjaxIM.incoming()}}} function. The connection is - // opened using either an {{{iframe}}} (in Opera or Internet Explorer) or - // an {{{XMLHTTPRequest}}} object. Due to the extra flexibility necessary - // with the {{{XMLHTTPRequest}}} object, jQuery's {{{$.ajax}}} is not used. - comet: { - type: '', - obj: null, - - onbeforeunload: null, - onreadystatechange: null, - - iframe: function() { - if(/loaded|complete/i.test(this.obj.readyState)) - throw new Error("IM server not available!"); - }, - - // === {{{AjaxIM.}}}**{{{comet.connect()}}}** === - // - // Creates and initializes the object and connection between the server - // and the client. For Internet Explorer and Opera, we use an - // {{{<iframe>}}} element; for all other browsers, we create an - // {{{XMLHTTPRequest}}} object. The server connects to the URI defined - // as the "poll" action. This function is called automatically, when - // the IM engine is initialized and the {{{AjaxIM.poll()}}} function - // is called. - connect: function() { - var self = _instance; - - if($.browser.opera || $.browser.msie) { - var iframe = $(''); - with(iframe) { - css({ - position: 'absolute', - visibility: 'visible', - display: 'block', - left: '-10000px', - top: '-10000px', - width: '1px', - height: '1px' - }); - - attr('src', self.actions.poll[1]); - appendTo('body'); - - bind('readystatechange', - self.comet.onreadystatechange = function() { self.comet.iframe() }); - bind('beforeunload', - self.comet.onbeforeunload = function() { self.comet.disconnect() }); - } - - self.comet.type = 'iframe'; - self.comet.obj = iframe; - } else { - var xhr = new XMLHttpRequest; - var length = 1029; - var code = /^\s*]*>parent\.(.+);<\/script>$/; - - xhr.open('get', self.actions.poll[1], true); - xhr.onreadystatechange = function(){ - if(xhr.readyState > 2) { - if(xhr.status == 200) { - responseText = xhr.responseText.substring(length); - length = xhr.responseText.length; - if(responseText != ' ') - eval(responseText.replace(code, "$1")); - } - // We need an "else" here. If the state changes to - // "loaded", the user needs to know they're - // disconnected. - } - }; - - self.comet.type = 'xhr'; - self.comet.obj = xhr; - - addEventListener('beforeunload', - self.comet.beforeunload = function() { self.comet.disconnect(); }, false); - setTimeout(function() { xhr.send(null) }, 10); - } - }, - - // === {{{AjaxIM.}}}**{{{comet.disconnect()}}}** === - // - // Disconnect from the server and destroy the connection object. This - // function is called before the page unloads, so that we plug up and - // potential leaks and free memory. - disconnect: function() { - var self = _instance.comet; - - if(!this.type || !this.obj) - return; - - if(this.type == 'iframe') { - detachEvent('onreadystatechange', this.onreadystatechange); - detachEvent('onbeforeunload', this.onbeforeunload); - this.obj.src = '.'; - $(this.obj).remove(); - } else { - removeEventListener('beforeunload', this.onbeforeunload, false); - this.obj.onreadystatechange = function(){}; - this.obj.abort(); - } - - delete this.obj; - } - } - }) - - self.bar.initialize(); - - if(prequeue.length) { - $.each(prequeue, function() { - var func = this[0].split('.'); - if(func.length > 1) - self[func[0]][func[1]].apply(self, this[1]); - else - self[func[0]].apply(self, this[1]); - }); - } - }); - - // == Static functions and variables == - // - // The following functions and variables are available outside of an initialized - // {{{AjaxIM}}} object. - - // === {{{AjaxIM.}}}**{{{client}}}** === - // - // Once {{{AjaxIM.init()}}} is called, this will be set to the active AjaxIM - // object. Only one AjaxIM object instance can exist at a time. This variable - // can and should be accessed directly. - AjaxIM.client = null; - - // === {{{AjaxIM.}}}**{{{init(options, actions)}}}** === - // - // Initialize the AjaxIM client object and engine. Here, you can define your - // options and actions as outlined at the top of this documentation. - // - // ==== Parameters ==== - // * {{{options}}} is the hash of custom settings to initialize Ajax IM with. - // * {{{actions}}} is the hash of any custom action URLs. - AjaxIM.init = function(options, actions) { - if(!_instance) { - _instance = new AjaxIM(options, actions); - AjaxIM.client = _instance; - } - - return _instance; - } - - - // === {{{AjaxIM.}}}**{{{request(url, data, successFunc, failureFunc)}}}** === - // - // Wrapper around {{{$.jsonp}}}, the JSON-P library for jQuery, and {{{$.ajax}}}, - // jQuery's ajax library. Allows either function to be called, automatically, - // depending on the request's URL array (see {{{AjaxIM.actions}}}). - // - // ==== Parameters ==== - // {{{url}}} is the URL of the request. - // {{{data}}} are any arguments that go along with the request. - // {{{success}}} is a callback function called when a request has completed - // without issue. - // {{{_ignore_}}} is simply to provide compatability with {{{$.post}}}. - // {{{failure}}} is a callback function called when a request hasn't not - // completed successfully. - AjaxIM.request = function(url, data, successFunc, failureFunc) { - if(typeof failureFunc != 'function'); - failureFunc = function(){}; - - $[url[0]]({ - 'url': url[1], - 'data': data, - dataType: (url[0] == 'ajax' ? 'json' : 'jsonp'), - type: 'POST', - cache: false, - timeout: 60000, - callback: 'jsonp' + (new Date()).getTime(), - success: function(json, textStatus) { - successFunc(json); - }, - error: function(xOptions, error) { - failureFunc(error); - } - }); - - // This prevents Firefox from spinning indefinitely - // while it waits for a response. Why? Fuck if I know. - if(url[0] == 'jsonp' && $.browser.mozilla) { - $.jsonp({ - 'url': 'about:', - timeout: 0 - }); - } - }; - - // === {{{AjaxIM.}}}**{{{incoming(data)}}}** === - // - // Never call this directly. It is used as a connecting function between - // client and server for Comet. - // - // //Note:// There are two {{{AjaxIM.incoming()}}} functions. This one is a - // static function called outside of the initialized AjaxIM object; the other - // is only called within the initalized AjaxIM object. - AjaxIM.incoming = function(data) { - if(!_instance) - return false; - - if(data.length) - _instance._parseMessages(data); - } - - // === {{{AjaxIM.}}}**{{{loaded}}}** === - // - // If Ajax IM has been loaded with the im.load.js file, this function will be - // called when the library is finally loaded and ready for use. Similar to - // jQuery's $(document).ready(), but for Ajax IM. - AjaxIM.loaded = function() { - if(typeof AjaxIMLoadedFunction == 'function') { - AjaxIMLoadedFunction(); - delete AjaxIMLoadedFunction; // clean up the global namespace - } - }; - - // === {{{AjaxIM.}}}**{{{dateFormat([date,] [mask,] utc)}}}** === - // - // Date Format 1.2.3\\ - // © 2007-2009 Steven Levithan ([[http://blog.stevenlevithan.com/archives/date-time-format|stevenlevithan.com]])\\ - // MIT license - // - // Includes enhancements by Scott Trenda - // and Kris Kowal ([[http://cixar.com/~kris.kowal/|cixar.com/~kris.kowal/]]) - // - // Accepts a date, a mask, or a date and a mask and returns a formatted version - // of the given date. - // - // ==== Parameters ==== - // * {{{date}}} is a {{{Date()}}} object. If not specified, the date defaults to the - // current date/time. - // * {{{mask}}} is a string that defines the formatting of the date. Formatting - // options can be found in the - // [[http://blog.stevenlevithan.com/archives/date-time-format|Date Format]] - // documentation. If not specified, the mask defaults to {{{dateFormat.masks.default}}}. - - AjaxIM.dateFormat = function () { - var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, - timezone = new RegExp('\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) ' + - '(?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b', - 'g'), - timezoneClip = /[^-+\dA-Z]/g, - pad = function (val, len) { - val = String(val); - len = len || 2; - while (val.length < len) val = "0" + val; - return val; - }; - - // Regexes and supporting functions are cached through closure - return function (date, mask, utc) { - var dF = AjaxIM.dateFormat; - - // You can't provide utc if you skip other args (use the "UTC:" mask prefix) - if (arguments.length == 1 && Object.prototype.toString.call(date) == - "[object String]" && !/\d/.test(date)) { - mask = date; - date = undefined; - } - - // Passing date through Date applies Date.parse, if necessary - date = date ? new Date(date) : new Date; - if (isNaN(date)) throw SyntaxError("invalid date"); - - mask = String(dF.masks[mask] || mask || dF.masks["default"]); - - // Allow setting the utc argument via the mask - if (mask.slice(0, 4) == "UTC:") { - mask = mask.slice(4); - utc = true; - } - - var _ = utc ? "getUTC" : "get", - d = date[_ + "Date"](), - D = date[_ + "Day"](), - m = date[_ + "Month"](), - y = date[_ + "FullYear"](), - H = date[_ + "Hours"](), - M = date[_ + "Minutes"](), - s = date[_ + "Seconds"](), - L = date[_ + "Milliseconds"](), - o = utc ? 0 : date.getTimezoneOffset(), - flags = { - d: d, - dd: pad(d), - ddd: AjaxIM.i18n.dayNames[D], - dddd: AjaxIM.i18n.dayNames[D + 7], - m: m + 1, - mm: pad(m + 1), - mmm: AjaxIM.i18n.monthNames[m], - mmmm: AjaxIM.i18n.monthNames[m + 12], - yy: String(y).slice(2), - yyyy: y, - h: H % 12 || 12, - hh: pad(H % 12 || 12), - H: H, - HH: pad(H), - M: M, - MM: pad(M), - s: s, - ss: pad(s), - l: pad(L, 3), - L: pad(L > 99 ? Math.round(L / 10) : L), - t: H < 12 ? "a" : "p", - tt: H < 12 ? "am" : "pm", - T: H < 12 ? "A" : "P", - TT: H < 12 ? "AM" : "PM", - Z: utc ? "UTC" : - (String(date).match(timezone) || [""]) - .pop().replace(timezoneClip, ""), - o: (o > 0 ? "-" : "+") + - pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), - S: ["th", "st", "nd", "rd"][d % 10 > 3 ? - 0 : - (d % 100 - d % 10 != 10) * d % 10] - }; - - return mask.replace(token, function ($0) { - return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); - }); - }; - }(); - - // Some common format strings - AjaxIM.dateFormat.masks = { - "default": "ddd mmm dd yyyy HH:MM:ss", - shortDate: "m/d/yy", - mediumDate: "mmm d, yyyy", - longDate: "mmmm d, yyyy", - fullDate: "dddd, mmmm d, yyyy", - shortTime: "h:MM TT", - mediumTime: "h:MM:ss TT", - longTime: "h:MM:ss TT Z", - isoDate: "yyyy-mm-dd", - isoTime: "HH:MM:ss", - isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", - isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" - }; - - // === {{{AjaxIM.}}}**{{{i18n}}}** === - // - // Text strings used by Ajax IM. Should you want to translate Ajax IM into - // another language, merely change these strings. - // - // {{{%s}}} denotes text that will be automatically replaced when the string is - // used. - AjaxIM.i18n = { - dayNames: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" - ], - monthNames: [ - "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", - "January", "February", "March", "April", "May", "June", "July", "August", "September", - "October", "November", "December" - ], - - chatOffline: '%s signed off.', - chatAvailable: '%s became available.', - chatAway: '%s went away.', - - notConnected: 'You are currently not connected or the server is not available. ' + - 'Please ensure that you are signed in and try again.', - notConnectedTip: 'You are currently not connected.', - - authInvalid: 'Invalid username or password.', - - registerPasswordLength: 'Passwords must be more than 4 characters in length.', - registerUsernameLength: 'Usernames must be more than 2 characters in length and ' + - ' contain only A-Z, a-z, 0-9, underscores (_) and periods (.).', - registerPasswordMatch: 'Entered passwords do not match.', - registerUsernameTaken: 'The chosen username is already in use; please choose another.', - registerUnknown: 'An unknown error occurred. Please try again.' - } -})(jQuery, false); diff --git a/addons/web_chat/static/lib/AjaxIM/js/im.load.js b/addons/web_chat/static/lib/AjaxIM/js/im.load.js deleted file mode 100644 index b848464ecdb..00000000000 --- a/addons/web_chat/static/lib/AjaxIM/js/im.load.js +++ /dev/null @@ -1,79 +0,0 @@ -// Automatically load dependencies, in order, if they aren't already loaded. -// Each array is: [filename, deptest] where deptest is the function to -// test for the dependency. -var AjaxIM, AjaxIMLoadedFunction; -(function() { - AjaxIM = {}; - AjaxIM.loaded = function(f) { - AjaxIMLoadedFunction = f; - }; - - var tagsrc = - (thistag = document.getElementsByTagName('script'))[thistag.length-1].src; - var jsfolder = tagsrc.replace(/im.load.js([?].+)?/, ''); - var imfolder = jsfolder.replace(/js\/$/, ''); - - var nodehost = ''; - - var dependencies = [ - ['jquery-1.3.2.js', function() { return (typeof window['jQuery'] != 'undefined'); }], - ['jquery.jsonp-1.1.0.js', function() { return (typeof jQuery['jsonp'] != 'undefined'); }], - ['jquery.jstore-all-min.js', function() { return (typeof jQuery['jstore'] != 'undefined'); }], - ['jquery.md5.js', function() { return (typeof jQuery['md5'] != 'undefined'); }], - ['im.js', function() { return (typeof window['AjaxIM'] != 'object'); }] - ]; - - var head = document.getElementsByTagName('head')[0]; - - (loadDep = function(depPos) { - if(depPos >= dependencies.length) { init(); return; } - var dep = dependencies[depPos]; - - if(!dep[1]()) { - var newdep = document.createElement('script'); - newdep.type = 'text/javascript'; - newdep.src = jsfolder + dep[0]; - - var nextdep = function() { loadDep(depPos + 1); }; - newdep.onload = nextdep; - newdep.onreadystatechange = nextdep; - - head.appendChild(newdep); - } else loadDep(depPos + 1); - })(0); - - var init = function() { - if(tagsrc.match(/[?]php$/)) { - AjaxIM.init({ - pollServer: imfolder + 'ajaxim.php', - theme: imfolder + 'themes/default', - flashStorage: jsfolder + 'jStore.Flash.html' - }); - } else if(tagsrc.match(/[?]node$/)) { - AjaxIM.init({ - pollServer: imfolder + 'ajaxim.php', - theme: imfolder + 'themes/default', - flashStorage: jsfolder + 'jStore.Flash.html' - }, { - poll: 'http://' + nodehost + '/poll', - send: 'http://' + nodehost + '/send', - status: 'http://' + nodehost + '/status', - resume: 'http://' + nodehost + '/resume' - }); - } else if(tagsrc.match(/[?]guest$/)) { - AjaxIM.init({ - pollServer: imfolder + 'ajaxim.php', - theme: imfolder + 'themes/default', - flashStorage: jsfolder + 'jStore.Flash.html' - }, { - poll: 'http://' + nodehost + '/poll', - send: 'http://' + nodehost + '/send', - status: 'http://' + nodehost + '/status', - resume: 'http://' + nodehost + '/resume' - }); - AjaxIM.client.login(); - } - - AjaxIM.loaded(); - }; -})(); \ No newline at end of file diff --git a/addons/web_chat/static/lib/AjaxIM/js/jStore.Flash.html b/addons/web_chat/static/lib/AjaxIM/js/jStore.Flash.html deleted file mode 100644 index a34659af450..00000000000 --- a/addons/web_chat/static/lib/AjaxIM/js/jStore.Flash.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - Flash External Object - - - - - - - \ No newline at end of file diff --git a/addons/web_chat/static/lib/AjaxIM/js/jStore.swf b/addons/web_chat/static/lib/AjaxIM/js/jStore.swf deleted file mode 100644 index 665f32f88875d7fd55635b3d35f35ec628c8ca11..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 569 zcmV-90>=GAS5pYT1pokeoSjn9ZqqOnJ#muNY%5z^x-gb9KuC!30MF2sN!t*WrdBE+ zP`QaqOGAU2Y+`@FQ{gERn)udYJL#GM|z@~9N!-ec~?0DcEP)Sj|GEn>;_&ZfB>Hc zY{K1k?+bTAeCFYq?=TOG`-k(f6At|``dx9GCkQfuU=eV+$3vcq#g2J6(V2>;g$jZW zXWn&G5@vJ$(^(!4WwEAL$D@;CK__r8dp23z6h_f84OUJ>UKNY z5YLm9M2(I$eX+7oL3jWyQ8wb2I7Q~Yd03WuObBVZlp`1-9fn5Q$%Tl^TPyQu?a-P& z&woyi>*q=?RXZ&xGQ6{*qA--wdj%pv>#CrQPA#rC-9NomOKEDI$z&B+X`ig3saT3g z`x`Ok^i6(Z2=oJxlZr)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/addons/web_chat/static/lib/AjaxIM/js/jquery.jsonp-1.1.0.js b/addons/web_chat/static/lib/AjaxIM/js/jquery.jsonp-1.1.0.js deleted file mode 100644 index 927bf5327f5..00000000000 --- a/addons/web_chat/static/lib/AjaxIM/js/jquery.jsonp-1.1.0.js +++ /dev/null @@ -1,269 +0,0 @@ -/* - * jQuery JSONP Core Plugin 1.1.0 (2009-10-06) - * - * http://code.google.com/p/jquery-jsonp/ - * - * Copyright (c) 2009 Julian Aubourg - * - * This document is licensed as free software under the terms of the - * MIT License: http://www.opensource.org/licenses/mit-license.php - */ -(function($){ - - // ###################### UTILITIES ## - // Test a value is neither undefined nor null - var defined = function(v) { - return v!==undefined && v!==null; - }, - // Call if defined - callIfDefined = function(method,object,parameters) { - defined(method) && method.apply(object,parameters); - }, - // Let the current thread running - later = function(functor) { - setTimeout(functor,0); - }, - // String constants (for better minification) - empty="", - amp="&", - qMark="?", - success = "success", - error = "error", - - // Head element (for faster use) - head = $("head"), - // Page cache - pageCache = {}, - - // ###################### DEFAULT OPTIONS ## - xOptionsDefaults = { - //beforeSend: undefined, - //cache: false, - callback: "C", - //callbackParameter: undefined, - //complete: undefined, - //data: "" - //dataFilter: undefined, - //error: undefined, - //pageCache: false, - //success: undefined, - //timeout: 0, - url: location.href - }, - - // ###################### MAIN FUNCTION ## - jsonp = function(xOptions) { - - // Build data with default - xOptions = $.extend({},xOptionsDefaults,xOptions); - - // References to beforeSend (for better minification) - var beforeSendCallback = xOptions.beforeSend, - - // Abort/done flag - done = 0; - - // Put a temporary abort - xOptions.abort = function() { done = 1; }; - - // Call beforeSend if provided (early abort if false returned) - if (defined(beforeSendCallback) && (beforeSendCallback(xOptions,xOptions)===false || done)) - return xOptions; - - // References to xOptions members (for better minification) - var successCallback = xOptions.success, - completeCallback = xOptions.complete, - errorCallback = xOptions.error, - dataFilter = xOptions.dataFilter, - callbackParameter = xOptions.callbackParameter, - successCallbackName = xOptions.callback, - cacheFlag = xOptions.cache, - pageCacheFlag = xOptions.pageCache, - url = xOptions.url, - data = xOptions.data, - timeout = xOptions.timeout, - - // Misc variables - splitUrl,splitData,i,j; - - // Control entries - url = defined(url)?url:empty; - data = defined(data)?((typeof data)=="string"?data:$.param(data)):empty; - - // Add callback parameter if provided as option - defined(callbackParameter) - && (data += (data==empty?empty:amp)+escape(callbackParameter)+"=?"); - - // Add anticache parameter if needed - !cacheFlag && !pageCacheFlag - && (data += (data==empty?empty:amp)+"_"+(new Date()).getTime()+"="); - - // Search for ? in url - splitUrl = url.split(qMark); - // Also in parameters if provided - // (and merge arrays) - if (data!=empty) { - splitData = data.split(qMark); - j = splitUrl.length-1; - j && (splitUrl[j] += amp + splitData.shift()); - splitUrl = splitUrl.concat(splitData); - } - // If more than 2 ? replace the last one by the callback - i = splitUrl.length-2; - i && (splitUrl[i] += successCallbackName + splitUrl.pop()); - - // Build the final url - var finalUrl = splitUrl.join(qMark), - - // Utility function - notifySuccess = function(json) { - // Apply the data filter if provided - defined(dataFilter) && (json = dataFilter.apply(xOptions,[json])); - // Call success then complete - callIfDefined(successCallback,xOptions,[json,success]); - callIfDefined(completeCallback,xOptions,[xOptions,success]); - }, - notifyError = function(type) { - // Call error then complete - callIfDefined(errorCallback,xOptions,[xOptions,type]); - callIfDefined(completeCallback,xOptions,[xOptions,type]); - }, - - // Get from pageCache - pageCached = pageCache[finalUrl]; - - // Check page cache - if (pageCacheFlag && defined(pageCached)) { - later(function() { - // If an error was cached - defined(pageCached.s) - ? notifySuccess(pageCached.s) - : notifyError(error); - }); - return xOptions; - } - - - // Create & write to the iframe (sends the request) - // We let the hand to current code to avoid - // pre-emptive callbacks - - // We also install the timeout here to avoid - // timeout before the code has been dumped to the frame - // (in case of insanely short timeout values) - later(function() { - - // If it has been aborted, do nothing - if (done) return; - - // Create an iframe & add it to the document - var frame = $("')},flashReady:function(f){var c=b("#jStoreFlashFrame")[0];if(c.Document&&b.isFunction(c.Document.jStoreFlash.f_get_cookie)){this.db=c.Document.jStoreFlash}else{if(c.contentWindow&&c.contentWindow.document){var d=c.contentWindow.document;if(b.isFunction(b("object",b(d))[0].f_get_cookie)){this.db=b("object",b(d))[0]}else{if(b.isFunction(b("embed",b(d))[0].f_get_cookie)){this.db=b("embed",b(d))[0]}}}}if(this.db){this.delegate.trigger("engine-ready")}},isAvailable:a,get:function(d){this.interruptAccess();var c=this.db.f_get_cookie(d);return c=="null"?null:b.jStore.safeResurrect(c)},set:function(c,d){this.interruptAccess();this.db.f_set_cookie(c,b.jStore.safeStore(d));return d},rem:function(c){this.interruptAccess();var d=this.get(c);this.db.f_delete_cookie(c);return d}});b.jStore.Engines.flash=jStoreFlash;b.jStore.EngineOrder[2]="flash";b.jStore.hasFlash=function(c){var e=b.jStore.flashVersion().match(/\d+/g),f=c.match(/\d+/g);for(var d=0;d<3;d++){e[d]=parseInt(e[d]||0);f[d]=parseInt(f[d]||0);if(e[d]f[d]){return true}}return true};b.jStore.flashVersion=function(){try{try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{c.AllowScriptAccess="always"}catch(d){return"6,0,0"}}catch(d){}return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(d){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}}catch(d){}}return"0,0,0"}})(jQuery);function flash_ready(){$.jStore.delegate.trigger("flash-ready")} -/* - * jStore Google Gears Storage Engine - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - */ -(function(b){var a=b.jStore.Availability.gears=function(){return !!(window.google&&window.google.gears)};this.jStoreGears=StorageEngine.extend({init:function(d,c){this._super(d,c);this.type="Google Gears";this.includes.push("http://code.google.com/apis/gears/gears_init.js");this.autoload=true},connect:function(){var c=this.db=google.gears.factory.create("beta.database");c.open("jstore-"+this.project);c.execute("CREATE TABLE IF NOT EXISTS jstore (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)");this.updateCache()},updateCache:function(){var c=this.db.execute("SELECT k,v FROM jstore");while(c.isValidRow()){this.data[c.field(0)]=b.jStore.safeResurrect(c.field(1));c.next()}c.close();this.delegate.trigger("engine-ready")},isAvailable:a,set:function(d,e){this.interruptAccess();var c=this.db;c.execute("BEGIN");c.execute("INSERT OR REPLACE INTO jstore(k, v) VALUES (?, ?)",[d,b.jStore.safeStore(e)]);c.execute("COMMIT");return this._super(d,e)},rem:function(d){this.interruptAccess();var c=this.db;c.execute("BEGIN");c.execute("DELETE FROM jstore WHERE k = ?",[d]);c.execute("COMMIT");return this._super(d)}});b.jStore.Engines.gears=jStoreGears;b.jStore.EngineOrder[3]="gears"})(jQuery); -/* - * jStore HTML5 Specification Storage Engine - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - */ -(function(b){var a=b.jStore.Availability.html5=function(){return !!window.openDatabase};this.jStoreHtml5=StorageEngine.extend({init:function(d,c){this._super(d,c);this.type="HTML5";this.limit=1024*200},connect:function(){var c=this.db=openDatabase("jstore-"+this.project,"1.0",this.project,this.limit);if(!c){throw"JSTORE_ENGINE_HTML5_NODB"}c.transaction(function(d){d.executeSql("CREATE TABLE IF NOT EXISTS jstore (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)")});this.updateCache()},updateCache:function(){var c=this;this.db.transaction(function(d){d.executeSql("SELECT k,v FROM jstore",[],function(f,e){var h=e.rows,g=0,j;for(;g
').appendTo(document.body).get(0);this.delegate.trigger("engine-ready")},isAvailable:a,get:function(c){this.interruptAccess();this.db.load(this.project);return b.jStore.safeResurrect(this.db.getAttribute(c))},set:function(c,d){this.interruptAccess();this.db.setAttribute(c,b.jStore.safeStore(d));this.db.save(this.project);return d},rem:function(c){this.interruptAccess();var d=this.get(c);this.db.removeAttribute(c);this.db.save(this.project);return d}});b.jStore.Engines.ie=jStoreIE;b.jStore.EngineOrder[4]="ie"})(jQuery); \ No newline at end of file diff --git a/addons/web_chat/static/lib/AjaxIM/js/jquery.jstore-all.js b/addons/web_chat/static/lib/AjaxIM/js/jquery.jstore-all.js deleted file mode 100644 index 55ab2b36a19..00000000000 --- a/addons/web_chat/static/lib/AjaxIM/js/jquery.jstore-all.js +++ /dev/null @@ -1,963 +0,0 @@ -/*! - * jStore - Persistent Client-Side Storage - * - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - * - * Dual licensed under: - * MIT: http://www.opensource.org/licenses/mit-license.php - * GPLv3: http://www.opensource.org/licenses/gpl-3.0.html - */ -/*! - * jQuery JSON Plugin - * version: 1.0 (2008-04-17) - * - * This document is licensed as free software under the terms of the - * MIT License: http://www.opensource.org/licenses/mit-license.php - * - * Brantley Harris technically wrote this plugin, but it is based somewhat - * on the JSON.org website's http://www.json.org/json2.js, which proclaims: - * "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that - * I uphold. I really just cleaned it up. - * - * It is also based heavily on MochiKit's serializeJSON, which is - * copywrited 2005 by Bob Ippolito. - */ - -(function($) { - function toIntegersAtLease(n) - // Format integers to have at least two digits. - { - return n < 10 ? '0' + n : n; - } - - Date.prototype.toJSON = function(date) - // Yes, it polutes the Date namespace, but we'll allow it here, as - // it's damned usefull. - { - return this.getUTCFullYear() + '-' + - toIntegersAtLease(this.getUTCMonth()) + '-' + - toIntegersAtLease(this.getUTCDate()); - }; - - var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g; - var meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }; - - $.quoteString = function(string) - // Places quotes around a string, inteligently. - // If the string contains no control characters, no quote characters, and no - // backslash characters, then we can safely slap some quotes around it. - // Otherwise we must also replace the offending characters with safe escape - // sequences. - { - if (escapeable.test(string)) - { - return '"' + string.replace(escapeable, function (a) - { - var c = meta[a]; - if (typeof c === 'string') { - return c; - } - c = a.charCodeAt(); - return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16); - }) + '"'; - } - return '"' + string + '"'; - }; - - $.toJSON = function(o, compact) - { - var type = typeof(o); - - if (type == "undefined") - return "undefined"; - else if (type == "number" || type == "boolean") - return o + ""; - else if (o === null) - return "null"; - - // Is it a string? - if (type == "string") - { - return $.quoteString(o); - } - - // Does it have a .toJSON function? - if (type == "object" && typeof o.toJSON == "function") - return o.toJSON(compact); - - // Is it an array? - if (type != "function" && typeof(o.length) == "number") - { - var ret = []; - for (var i = 0; i < o.length; i++) { - ret.push( $.toJSON(o[i], compact) ); - } - if (compact) - return "[" + ret.join(",") + "]"; - else - return "[" + ret.join(", ") + "]"; - } - - // If it's a function, we have to warn somebody! - if (type == "function") { - throw new TypeError("Unable to convert object of type 'function' to json."); - } - - // It's probably an object, then. - var ret = []; - for (var k in o) { - var name; - type = typeof(k); - - if (type == "number") - name = '"' + k + '"'; - else if (type == "string") - name = $.quoteString(k); - else - continue; //skip non-string or number keys - - var val = $.toJSON(o[k], compact); - if (typeof(val) != "string") { - // skip non-serializable values - continue; - } - - if (compact) - ret.push(name + ":" + val); - else - ret.push(name + ": " + val); - } - return "{" + ret.join(", ") + "}"; - }; - - $.compactJSON = function(o) - { - return $.toJSON(o, true); - }; - - $.evalJSON = function(src) - // Evals JSON that we know to be safe. - { - try { - return eval("(" + src + ")"); - } catch(e) { - return src; - } - }; - - $.secureEvalJSON = function(src) - // Evals JSON in a way that is *more* secure. - { - var filtered = src; - filtered = filtered.replace(/\\["\\\/bfnrtu]/g, '@'); - filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'); - filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, ''); - - if (/^[\],:{}\s]*$/.test(filtered)) - return eval("(" + src + ")"); - else - throw new SyntaxError("Error parsing JSON, source is not valid."); - }; -})(jQuery); -/** - * Javascript Class Framework - * - * Copyright (c) 2008 John Resig (http://ejohn.org/blog/simple-javascript-inheritance/) - * Inspired by base2 and Prototype - */ -(function(){ - var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; - - // The base Class implementation (does nothing) - this.Class = function(){}; - - // Create a new Class that inherits from this class - Class.extend = function(prop) { - var _super = this.prototype; - - // Instantiate a base class (but only create the instance, - // don't run the init constructor) - initializing = true; - var prototype = new this(); - initializing = false; - - // Copy the properties over onto the new prototype - for (var name in prop) { - // Check if we're overwriting an existing function - prototype[name] = typeof prop[name] == "function" && - typeof _super[name] == "function" && fnTest.test(prop[name]) ? - (function(name, fn){ - return function() { - var tmp = this._super; - - // Add a new ._super() method that is the same method - // but on the super-class - this._super = _super[name]; - - // The method only need to be bound temporarily, so we - // remove it when we're done executing - var ret = fn.apply(this, arguments); - this._super = tmp; - - return ret; - }; - })(name, prop[name]) : - prop[name]; - } - - // The dummy class constructor - function Class() { - // All construction is actually done in the init method - if ( !initializing && this.init ) - this.init.apply(this, arguments); - } - - // Populate our constructed prototype object - Class.prototype = prototype; - - // Enforce the constructor to be what we expect - Class.constructor = Class; - - // And make this class extendable - Class.extend = arguments.callee; - - return Class; - }; -})(); -/*! - * jStore Delegate Framework - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - */ -(function($){ - - this.jStoreDelegate = Class.extend({ - init: function(parent){ - // The Object this delgate operates for - this.parent = parent; - // Container for callbacks to dispatch. - // eventType => [ callback, callback, ... ] - this.callbacks = {}; - }, - bind: function(event, callback){ - if ( !$.isFunction(callback) ) return this; - if ( !this.callbacks[ event ] ) this.callbacks[ event ] = []; - - this.callbacks[ event ].push(callback); - - return this; - }, - trigger: function(){ - var parent = this.parent, - args = [].slice.call(arguments), - event = args.shift(), - handlers = this.callbacks[ event ]; - - if ( !handlers ) return false; - - $.each(handlers, function(){ this.apply(parent, args) }); - return this; - } - }); - -})(jQuery); -/** - * jStore-jQuery Interface - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - */ -(function($){ - - var rxJson; - - try { - rxJson = new RegExp('^("(\\\\.|[^"\\\\\\n\\r])*?"|[,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t])+?$') - } catch (e) { - rxJson = /^(true|false|null|\[.*\]|\{.*\}|".*"|\d+|\d+\.\d+)$/ - } - - // Setup the jStore namespace in jQuery for options storage - $.jStore = {}; - - // Seed the object - $.extend($.jStore, { - EngineOrder: [], - // Engines should put their availability tests within jStore.Availability - Availability: {}, - // Defined engines should enter themselves into the jStore.Engines - Engines: {}, - // Instanciated engines should exist within jStore.Instances - Instances: {}, - // The current engine to use for storage - CurrentEngine: null, - // Provide global settings for overwriting - defaults: { - project: null, - engine: null, - autoload: true, - flash: 'jStore.Flash.html' - }, - // Boolean for ready state handling - isReady: false, - // Boolean for flash ready state handling - isFlashReady: false, - // An event delegate - delegate: new jStoreDelegate($.jStore) - .bind('jStore-ready', function(engine){ - $.jStore.isReady = true; - if ($.jStore.defaults.autoload) engine.connect(); - }) - .bind('flash-ready', function(){ - $.jStore.isFlashReady = true; - }), - // Enable ready callback for jStore - ready: function(callback){ - if ($.jStore.isReady) callback.apply($.jStore, [$.jStore.CurrentEngine]); - else $.jStore.delegate.bind('jStore-ready', callback); - }, - // Enable failure callback registration for jStore - fail: function(callback){ - $.jStore.delegate.bind('jStore-failure', callback); - }, - // Enable ready callback for Flash - flashReady: function(callback){ - if ($.jStore.isFlashReady) callback.apply($.jStore, [$.jStore.CurrentEngine]); - else $.jStore.delegate.bind('flash-ready', callback); - }, - // Enable and test an engine - use: function(engine, project, identifier){ - project = project || $.jStore.defaults.project || location.hostname.replace(/\./g, '-') || 'unknown'; - - var e = $.jStore.Engines[engine.toLowerCase()] || null, - name = (identifier ? identifier + '.' : '') + project + '.' + engine; - - if ( !e ) throw 'JSTORE_ENGINE_UNDEFINED'; - - // Instanciate the engine - e = new e(project, name); - - // Prevent against naming conflicts - if ($.jStore.Instances[name]) throw 'JSTORE_JRI_CONFLICT'; - - // Test the engine - if (e.isAvailable()){ - $.jStore.Instances[name] = e; // The Easy Way - if (!$.jStore.CurrentEngine){ - $.jStore.CurrentEngine = e; - } - $.jStore.delegate.trigger('jStore-ready', e); - } else { - if (!e.autoload) // Not available - throw 'JSTORE_ENGINE_UNAVILABLE'; - else { // The hard way - e.included(function(){ - if (this.isAvailable()) { // Worked out - $.jStore.Instances[name] = this; - // If there is no current engine, use this one - if (!$.jStore.CurrentEngine){ - $.jStore.CurrentEngine = this; - } - $.jStore.delegate.trigger('jStore-ready', this); - } - else $.jStore.delegate.trigger('jStore-failure', this); - }).include(); - } - } - }, - // Set the current storage engine - setCurrentEngine: function(name){ - if (!$.jStore.Instances.length ) // If no instances exist, attempt to load one - return $.jStore.FindEngine(); - - if (!name && $.jStore.Instances.length >= 1) { // If no name is specified, use the first engine - $.jStore.delegate.trigger('jStore-ready', $.jStore.Instances[0]); - return $.jStore.CurrentEngine = $.jStore.Instances[0]; - } - - if (name && $.jStore.Instances[name]) { // If a name is specified and exists, use it - $.jStore.delegate.trigger('jStore-ready', $.jStore.Instances[name]); - return $.jStore.CurrentEngine = $.jStore.Instances[name]; - } - - throw 'JSTORE_JRI_NO_MATCH'; - }, - // Test all possible engines for straightforward useability - FindEngine: function(){ - $.each($.jStore.EngineOrder, function(k){ - if ($.jStore.Availability[this]()){ // Find the first, easiest option and use it. - $.jStore.use(this, $.jStore.defaults.project, 'default'); - return false; - } - }) - }, - // Provide a way for users to call for auto-loading - load: function(){ - if ($.jStore.defaults.engine) - return $.jStore.use($.jStore.defaults.engine, $.jStore.defaults.project, 'default'); - - // Attempt to find a valid engine, and catch any exceptions if we can't - try { - $.jStore.FindEngine(); - } catch (e) {} - }, - // Parse a value as JSON before its stored. - safeStore: function(value){ - switch (typeof value){ - case 'object': case 'function': return $.compactJSON(value); - case 'number': case 'boolean': case 'string': case 'xml': return value; - case 'undefined': default: return ''; - } - }, - // Restores JSON'd values before returning - safeResurrect: function(value){ - return rxJson.test(value) ? $.evalJSON(value) : value; - }, - // Provide a simple interface for storing/getting values - store: function(key, value){ - if (!$.jStore.CurrentEngine) return false; - - if ( !value ) // Executing a get command - return $.jStore.CurrentEngine.get(key); - // Executing a set command - return $.jStore.CurrentEngine.set(key, value); - }, - // Provide a simple interface for removing values - remove: function(key){ - if (!$.jStore.CurrentEngine) return false; - - return $.jStore.CurrentEngine.rem(key); - }, - // Alias access for reading - get: function(key){ - return $.jStore.store(key); - }, - // Alias access for setting - set: function(key, value){ - return $.jStore.store(key, value); - } - }) - - // Extend the jQuery funcitonal object - $.extend($.fn, { - // Provide a chainable interface for storing values/getting a value at the end of a chain - store: function(key, value){ - if (!$.jStore.CurrentEngine) return this; - - var result = $.jStore.store(key, value); - - return !value ? result : this; - }, - // Provide a chainable interface for removing values - removeStore: function(key){ - $.jStore.remove(key); - - return this; - }, - // Alias access for reading at the end of a chain. - getStore: function(key){ - return $.jStore.store(key); - }, - // Alias access for setting on a chanin. - setStore: function(key, value){ - $.jStore.store(key, value); - return this; - } - }) - -})(jQuery); -/** - * jStore Engine Core - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - */ -(function($){ - - this.StorageEngine = Class.extend({ - init: function(project, name){ - // Configure the project name - this.project = project; - // The JRI name given by the manager - this.jri = name; - // Cache the data so we can work synchronously - this.data = {}; - // The maximum limit of the storage engine - this.limit = -1; - // Third party script includes - this.includes = []; - // Create an event delegate for users to subscribe to event triggers - this.delegate = new jStoreDelegate(this) - .bind('engine-ready', function(){ - this.isReady = true; - }) - .bind('engine-included', function(){ - this.hasIncluded = true; - }); - // If enabled, the manager will check availability, then run include(), then check again - this.autoload = false; // This should be changed by the engines, if they have required includes - // When set, we're ready to transact data - this.isReady = false; - // When the includer is finished, it will set this to true - this.hasIncluded = false; - }, - // Performs all necessary script includes - include: function(){ - var self = this, - total = this.includes.length, - count = 0; - - $.each(this.includes, function(){ - $.ajax({type: 'get', url: this, dataType: 'script', cache: true, - success: function(){ - count++; - if (count == total) self.delegate.trigger('engine-included'); - } - }) - }); - }, - // This should be overloaded with an actual functionality presence check - isAvailable: function(){ - return false; - }, - // All get/set/rem functions across the engines should add this to the - // first line of those functions to prevent accessing the engine while unstable. - interruptAccess: function(){ - if (!this.isReady) throw 'JSTORE_ENGINE_NOT_READY'; - }, - /** Event Subscription Shortcuts **/ - ready: function(callback){ - if (this.isReady) callback.apply(this); - else this.delegate.bind('engine-ready', callback); - return this; - }, - included: function(callback){ - if (this.hasIncluded) callback.apply(this); - else this.delegate.bind('engine-included', callback); - return this; - }, - /** Cache Data Access **/ - get: function(key){ - this.interruptAccess(); - return this.data[key] || null; - }, - set: function(key, value){ - this.interruptAccess(); - this.data[key] = value; - return value; - }, - rem: function(key){ - this.interruptAccess(); - var beforeDelete = this.data[key]; - this.data[key] = null; - return beforeDelete; - } - }); - -})(jQuery); -/*! - * jStore DOM Storage Engine - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - */ -(function($){ - - // Set up a static test function for this instance - var sessionAvailability = $.jStore.Availability.session = function(){ - return !!window.sessionStorage; - }, - localAvailability = $.jStore.Availability.local = function(){ - return !!(window.localStorage || window.globalStorage); - }; - - this.jStoreDom = StorageEngine.extend({ - init: function(project, name){ - // Call the parental init object - this._super(project, name); - - // The type of storage engine - this.type = 'DOM'; - - // Set the Database limit - this.limit = 5 * 1024 * 1024; - }, - connect: function(){ - // Fire our delegate to indicate we're ready for data transactions - this.delegate.trigger('engine-ready'); - }, - get: function(key){ - this.interruptAccess(); - var out = this.db.getItem(key); - // Gecko's getItem returns {value: 'the value'}, WebKit returns 'the value' - return $.jStore.safeResurrect( (out && out.value ? out.value : out) ); - }, - set: function(key, value){ - this.interruptAccess(); - this.db.setItem(key,$.jStore.safeStore(value)); - return value; - }, - rem: function(key){ - this.interruptAccess(); - var out = this.get(key); - this.db.removeItem(key); - return out - } - }) - - this.jStoreLocal = jStoreDom.extend({ - connect: function(){ - // Gecko uses a non-standard globalStorage[ www.example.com ] DOM access object for persistant storage. - this.db = !window.globalStorage ? window.localStorage : window.globalStorage[location.hostname]; - this._super(); - }, - isAvailable: localAvailability - }) - - this.jStoreSession = jStoreDom.extend({ - connect: function(){ - this.db = sessionStorage; - this._super(); - }, - isAvailable: sessionAvailability - }) - - $.jStore.Engines.local = jStoreLocal; - $.jStore.Engines.session = jStoreSession; - - // Store the ordering preference - $.jStore.EngineOrder[ 1 ] = 'local'; - -})(jQuery); -/*! - * jStore Flash Storage Engine - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - * jStore.swf Copyright (c) 2008 Daniel Bulli (http://www.nuff-respec.com) - */ -(function($){ - - // Set up a static test function for this instance - var avilability = $.jStore.Availability.flash = function(){ - return !!($.jStore.hasFlash('8.0.0')); - } - - this.jStoreFlash = StorageEngine.extend({ - init: function(project, name){ - // Call the parental init object - this._super(project, name); - - // The type of storage engine - this.type = 'Flash'; - - // Bind our flashReady function to the jStore Delegate - var self = this; - $.jStore.flashReady(function(){ self.flashReady() }); - }, - connect: function(){ - var name = 'jstore-flash-embed-' + this.project; - - // To make Flash Storage work on IE, we have to load up an iFrame - // which contains an HTML page that embeds the object using an - // object tag wrapping an embed tag. Of course, this is unnecessary for - // all browsers except for IE, which, to my knowledge, is the only browser - // in existance where you need to complicate your code to fix bugs. Goddamnit. :( - $(document.body) - .append(''); - }, - flashReady: function(e){ - var iFrame = $('#jStoreFlashFrame')[0]; - - // IE - if (iFrame.Document && $.isFunction(iFrame.Document['jStoreFlash'].f_get_cookie)) this.db = iFrame.Document['jStoreFlash']; - // Safari && Firefox - else if (iFrame.contentWindow && iFrame.contentWindow.document){ - var doc = iFrame.contentWindow.document; - // Safari - if ($.isFunction($('object', $(doc))[0].f_get_cookie)) this.db = $('object', $(doc))[0]; - // Firefox - else if ($.isFunction($('embed', $(doc))[0].f_get_cookie)) this.db = $('embed', $(doc))[0]; - } - - // We're ready to process data - if (this.db) this.delegate.trigger('engine-ready'); - }, - isAvailable: avilability, - get: function(key){ - this.interruptAccess(); - var out = this.db.f_get_cookie(key); - return out == 'null' ? null : $.jStore.safeResurrect(out); - }, - set: function(key, value){ - this.interruptAccess(); - this.db.f_set_cookie(key, $.jStore.safeStore(value)); - return value; - }, - rem: function(key){ - this.interruptAccess(); - var beforeDelete = this.get(key); - this.db.f_delete_cookie(key); - return beforeDelete; - } - }) - - $.jStore.Engines.flash = jStoreFlash; - - // Store the ordering preference - $.jStore.EngineOrder[ 2 ] = 'flash'; - - /** - * Flash Detection functions copied from the jQuery Flash Plugin - * Copyright (c) 2006 Luke Lutman (http://jquery.lukelutman.com/plugins/flash) - * Dual licensed under the MIT and GPL licenses. - * http://www.opensource.org/licenses/mit-license.php - * http://www.opensource.org/licenses/gpl-license.php - */ - $.jStore.hasFlash = function(version){ - var pv = $.jStore.flashVersion().match(/\d+/g), - rv = version.match(/\d+/g); - - for(var i = 0; i < 3; i++) { - pv[i] = parseInt(pv[i] || 0); - rv[i] = parseInt(rv[i] || 0); - // player is less than required - if(pv[i] < rv[i]) return false; - // player is greater than required - if(pv[i] > rv[i]) return true; - } - // major version, minor version and revision match exactly - return true; - } - - $.jStore.flashVersion = function(){ - // ie - try { - try { - // avoid fp6 minor version lookup issues - // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ - var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); - try { axo.AllowScriptAccess = 'always'; } - catch(e) { return '6,0,0'; } - } catch(e) { - return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; - } - // other browsers - } catch(e) { - try { - if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ - return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; - } - } catch(e) {} - } - return '0,0,0'; - } - -})(jQuery); - -// Callback fired when ExternalInterface is established -function flash_ready(){ - $.jStore.delegate.trigger('flash-ready'); -} -/*! - * jStore Google Gears Storage Engine - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - */ -(function($){ - - // Set up a static test function for this instance - var avilability = $.jStore.Availability.gears = function(){ - return !!(window.google && window.google.gears) - } - - this.jStoreGears = StorageEngine.extend({ - init: function(project, name){ - // Call the parental init object - this._super(project, name); - - // The type of storage engine - this.type = 'Google Gears'; - - // Add required third-party scripts - this.includes.push('http://code.google.com/apis/gears/gears_init.js'); - - // Allow Autoloading on fail - this.autoload = true; - }, - connect: function(){ - // Create our database connection - var db = this.db = google.gears.factory.create('beta.database'); - db.open( 'jstore-' + this.project ); - db.execute( 'CREATE TABLE IF NOT EXISTS jstore (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)' ); - - // Cache the data from the table - this.updateCache(); - }, - updateCache: function(){ - // Read the database into our cache object - var result = this.db.execute( 'SELECT k,v FROM jstore' ); - while (result.isValidRow()){ - this.data[result.field(0)] = $.jStore.safeResurrect( result.field(1) ); - result.next(); - } result.close(); - - // Fire our delegate to indicate we're ready for data transactions - this.delegate.trigger('engine-ready'); - }, - isAvailable: avilability, - set: function(key, value){ - this.interruptAccess(); - // Update the database - var db = this.db; - db.execute( 'BEGIN' ); - db.execute( 'INSERT OR REPLACE INTO jstore(k, v) VALUES (?, ?)', [key,$.jStore.safeStore(value)] ); - db.execute( 'COMMIT' ); - return this._super(key, value); - }, - rem: function(key){ - this.interruptAccess(); - // Update the database - var db = this.db; - db.execute( 'BEGIN' ); - db.execute( 'DELETE FROM jstore WHERE k = ?', [key] ); - db.execute( 'COMMIT' ); - return this._super(key); - } - }) - - $.jStore.Engines.gears = jStoreGears; - - // Store the ordering preference - $.jStore.EngineOrder[ 3 ] = 'gears'; - -})(jQuery); -/*! - * jStore HTML5 Specification Storage Engine - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - */ -(function($){ - - // Set up a static test function for this instance - var avilability = $.jStore.Availability.html5 = function(){ - return !!window.openDatabase - } - - this.jStoreHtml5 = StorageEngine.extend({ - init: function(project, name){ - // Call the parental init object - this._super(project, name); - - // The type of storage engine - this.type = 'HTML5'; - - // Set the Database limit - this.limit = 1024 * 200; - }, - connect: function(){ - // Create our database connection - var db = this.db = openDatabase('jstore-' + this.project, '1.0', this.project, this.limit); - if (!db) throw 'JSTORE_ENGINE_HTML5_NODB'; - db.transaction(function(db){ - db.executeSql( 'CREATE TABLE IF NOT EXISTS jstore (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)' ); - }); - - // Cache the data from the table - this.updateCache(); - }, - updateCache: function(){ - var self = this; - // Read the database into our cache object - this.db.transaction(function(db){ - db.executeSql( 'SELECT k,v FROM jstore', [], function(db, result){ - var rows = result.rows, i = 0, row; - for (; i < rows.length; ++i){ - row = rows.item(i); - self.data[row.k] = $.jStore.safeResurrect( row.v ); - } - - // Fire our delegate to indicate we're ready for data transactions - self.delegate.trigger('engine-ready'); - }); - }); - }, - isAvailable: avilability, - set: function(key, value){ - this.interruptAccess(); - // Update the database - this.db.transaction(function(db){ - db.executeSql( 'INSERT OR REPLACE INTO jstore(k, v) VALUES (?, ?)', [key,$.jStore.safeStore(value)]); - }); - return this._super(key, value); - }, - rem: function(key){ - this.interruptAccess(); - // Update the database - this.db.transaction(function(db){ - db.executeSql( 'DELETE FROM jstore WHERE k = ?', [key] ) - }) - return this._super(key); - } - }) - - $.jStore.Engines.html5 = jStoreHtml5; - - // Store the ordering preference - $.jStore.EngineOrder[ 0 ] = 'html5'; - -})(jQuery); -/*!* - * jStore IE Storage Engine - * Copyright (c) 2009 Eric Garside (http://eric.garside.name) - */ -(function($){ - - // Set up a static test function for this instance - var avilability = $.jStore.Availability.ie = function(){ - return !!window.ActiveXObject; - } - - this.jStoreIE = StorageEngine.extend({ - init: function(project, name){ - // Call the parental init object - this._super(project, name); - - // The type of storage engine - this.type = 'IE'; - - // Allow Autoloading on fail - this.limit = 64 * 1024; - }, - connect: function(){ - // Create a hidden div to store attributes in - this.db = $('') - .appendTo(document.body).get(0); - // Fire our delegate to indicate we're ready for data transactions - this.delegate.trigger('engine-ready'); - }, - isAvailable: avilability, - get: function(key){ - this.interruptAccess(); - this.db.load(this.project); - return $.jStore.safeResurrect( this.db.getAttribute(key) ); - }, - set: function(key, value){ - this.interruptAccess(); - this.db.setAttribute(key, $.jStore.safeStore(value)); - this.db.save(this.project); - return value; - }, - rem: function(key){ - this.interruptAccess(); - var beforeDelete = this.get(key); - this.db.removeAttribute(key); - this.db.save(this.project); - return beforeDelete; - } - }) - - $.jStore.Engines.ie = jStoreIE; - - // Store the ordering preference - $.jStore.EngineOrder[ 4 ] = 'ie'; - -})(jQuery); \ No newline at end of file diff --git a/addons/web_chat/static/lib/AjaxIM/js/jquery.md5.js b/addons/web_chat/static/lib/AjaxIM/js/jquery.md5.js deleted file mode 100644 index 0333717efde..00000000000 --- a/addons/web_chat/static/lib/AjaxIM/js/jquery.md5.js +++ /dev/null @@ -1,230 +0,0 @@ - - /** - * jQuery MD5 hash algorithm function - * - * - * Calculate the md5 hash of a String - * String $.md5 ( String str ) - * - * - * Calculates the MD5 hash of str using the » RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash. - * MD5 (Message-Digest algorithm 5) is a widely-used cryptographic hash function with a 128-bit hash value. MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of data. The generated hash is also non-reversable. Data cannot be retrieved from the message digest, the digest uniquely identifies the data. - * MD5 was developed by Professor Ronald L. Rivest in 1994. Its 128 bit (16 byte) message digest makes it a faster implementation than SHA-1. - * This script is used to process a variable length message into a fixed-length output of 128 bits using the MD5 algorithm. It is fully compatible with UTF-8 encoding. It is very useful when u want to transfer encrypted passwords over the internet. If you plan using UTF-8 encoding in your project don't forget to set the page encoding to UTF-8 (Content-Type meta tag). - * This function orginally get from the WebToolkit and rewrite for using as the jQuery plugin. - * - * Example - * Code - * - * $.md5("I'm Persian."); - * - * Result - * - * "b8c901d0f02223f9761016cfff9d68df" - * - * - * @alias Muhammad Hussein Fattahizadeh < muhammad [AT] semnanweb [DOT] com > - * @link http://www.semnanweb.com/jquery-plugin/md5.html - * @see http://www.webtoolkit.info/ - * @license http://www.gnu.org/licenses/gpl.html [GNU General Public License] - * @param {jQuery} {md5:function(string)) - * @return string - */ - - (function($){ - - var rotateLeft = function(lValue, iShiftBits) { - return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); - } - - var addUnsigned = function(lX, lY) { - var lX4, lY4, lX8, lY8, lResult; - lX8 = (lX & 0x80000000); - lY8 = (lY & 0x80000000); - lX4 = (lX & 0x40000000); - lY4 = (lY & 0x40000000); - lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); - if (lX4 & lY4) return (lResult ^ 0x80000000 ^ lX8 ^ lY8); - if (lX4 | lY4) { - if (lResult & 0x40000000) return (lResult ^ 0xC0000000 ^ lX8 ^ lY8); - else return (lResult ^ 0x40000000 ^ lX8 ^ lY8); - } else { - return (lResult ^ lX8 ^ lY8); - } - } - - var F = function(x, y, z) { - return (x & y) | ((~ x) & z); - } - - var G = function(x, y, z) { - return (x & z) | (y & (~ z)); - } - - var H = function(x, y, z) { - return (x ^ y ^ z); - } - - var I = function(x, y, z) { - return (y ^ (x | (~ z))); - } - - var FF = function(a, b, c, d, x, s, ac) { - a = addUnsigned(a, addUnsigned(addUnsigned(F(b, c, d), x), ac)); - return addUnsigned(rotateLeft(a, s), b); - }; - - var GG = function(a, b, c, d, x, s, ac) { - a = addUnsigned(a, addUnsigned(addUnsigned(G(b, c, d), x), ac)); - return addUnsigned(rotateLeft(a, s), b); - }; - - var HH = function(a, b, c, d, x, s, ac) { - a = addUnsigned(a, addUnsigned(addUnsigned(H(b, c, d), x), ac)); - return addUnsigned(rotateLeft(a, s), b); - }; - - var II = function(a, b, c, d, x, s, ac) { - a = addUnsigned(a, addUnsigned(addUnsigned(I(b, c, d), x), ac)); - return addUnsigned(rotateLeft(a, s), b); - }; - - var convertToWordArray = function(string) { - var lWordCount; - var lMessageLength = string.length; - var lNumberOfWordsTempOne = lMessageLength + 8; - var lNumberOfWordsTempTwo = (lNumberOfWordsTempOne - (lNumberOfWordsTempOne % 64)) / 64; - var lNumberOfWords = (lNumberOfWordsTempTwo + 1) * 16; - var lWordArray = Array(lNumberOfWords - 1); - var lBytePosition = 0; - var lByteCount = 0; - while (lByteCount < lMessageLength) { - lWordCount = (lByteCount - (lByteCount % 4)) / 4; - lBytePosition = (lByteCount % 4) * 8; - lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition)); - lByteCount++; - } - lWordCount = (lByteCount - (lByteCount % 4)) / 4; - lBytePosition = (lByteCount % 4) * 8; - lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition); - lWordArray[lNumberOfWords - 2] = lMessageLength << 3; - lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; - return lWordArray; - }; - - var wordToHex = function(lValue) { - var WordToHexValue = "", WordToHexValueTemp = "", lByte, lCount; - for (lCount = 0; lCount <= 3; lCount++) { - lByte = (lValue >>> (lCount * 8)) & 255; - WordToHexValueTemp = "0" + lByte.toString(16); - WordToHexValue = WordToHexValue + WordToHexValueTemp.substr(WordToHexValueTemp.length - 2, 2); - } - return WordToHexValue; - }; - - var uTF8Encode = function(string) { - string = string.replace(/\x0d\x0a/g, "\x0a"); - var output = ""; - for (var n = 0; n < string.length; n++) { - var c = string.charCodeAt(n); - if (c < 128) { - output += String.fromCharCode(c); - } else if ((c > 127) && (c < 2048)) { - output += String.fromCharCode((c >> 6) | 192); - output += String.fromCharCode((c & 63) | 128); - } else { - output += String.fromCharCode((c >> 12) | 224); - output += String.fromCharCode(((c >> 6) & 63) | 128); - output += String.fromCharCode((c & 63) | 128); - } - } - return output; - }; - - $.extend({ - md5: function(string) { - var x = Array(); - var k, AA, BB, CC, DD, a, b, c, d; - var S11=7, S12=12, S13=17, S14=22; - var S21=5, S22=9 , S23=14, S24=20; - var S31=4, S32=11, S33=16, S34=23; - var S41=6, S42=10, S43=15, S44=21; - string = uTF8Encode(string); - x = convertToWordArray(string); - a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476; - for (k = 0; k < x.length; k += 16) { - AA = a; BB = b; CC = c; DD = d; - a = FF(a, b, c, d, x[k+0], S11, 0xD76AA478); - d = FF(d, a, b, c, x[k+1], S12, 0xE8C7B756); - c = FF(c, d, a, b, x[k+2], S13, 0x242070DB); - b = FF(b, c, d, a, x[k+3], S14, 0xC1BDCEEE); - a = FF(a, b, c, d, x[k+4], S11, 0xF57C0FAF); - d = FF(d, a, b, c, x[k+5], S12, 0x4787C62A); - c = FF(c, d, a, b, x[k+6], S13, 0xA8304613); - b = FF(b, c, d, a, x[k+7], S14, 0xFD469501); - a = FF(a, b, c, d, x[k+8], S11, 0x698098D8); - d = FF(d, a, b, c, x[k+9], S12, 0x8B44F7AF); - c = FF(c, d, a, b, x[k+10], S13, 0xFFFF5BB1); - b = FF(b, c, d, a, x[k+11], S14, 0x895CD7BE); - a = FF(a, b, c, d, x[k+12], S11, 0x6B901122); - d = FF(d, a, b, c, x[k+13], S12, 0xFD987193); - c = FF(c, d, a, b, x[k+14], S13, 0xA679438E); - b = FF(b, c, d, a, x[k+15], S14, 0x49B40821); - a = GG(a, b, c, d, x[k+1], S21, 0xF61E2562); - d = GG(d, a, b, c, x[k+6], S22, 0xC040B340); - c = GG(c, d, a, b, x[k+11], S23, 0x265E5A51); - b = GG(b, c, d, a, x[k+0], S24, 0xE9B6C7AA); - a = GG(a, b, c, d, x[k+5], S21, 0xD62F105D); - d = GG(d, a, b, c, x[k+10], S22, 0x2441453); - c = GG(c, d, a, b, x[k+15], S23, 0xD8A1E681); - b = GG(b, c, d, a, x[k+4], S24, 0xE7D3FBC8); - a = GG(a, b, c, d, x[k+9], S21, 0x21E1CDE6); - d = GG(d, a, b, c, x[k+14], S22, 0xC33707D6); - c = GG(c, d, a, b, x[k+3], S23, 0xF4D50D87); - b = GG(b, c, d, a, x[k+8], S24, 0x455A14ED); - a = GG(a, b, c, d, x[k+13], S21, 0xA9E3E905); - d = GG(d, a, b, c, x[k+2], S22, 0xFCEFA3F8); - c = GG(c, d, a, b, x[k+7], S23, 0x676F02D9); - b = GG(b, c, d, a, x[k+12], S24, 0x8D2A4C8A); - a = HH(a, b, c, d, x[k+5], S31, 0xFFFA3942); - d = HH(d, a, b, c, x[k+8], S32, 0x8771F681); - c = HH(c, d, a, b, x[k+11], S33, 0x6D9D6122); - b = HH(b, c, d, a, x[k+14], S34, 0xFDE5380C); - a = HH(a, b, c, d, x[k+1], S31, 0xA4BEEA44); - d = HH(d, a, b, c, x[k+4], S32, 0x4BDECFA9); - c = HH(c, d, a, b, x[k+7], S33, 0xF6BB4B60); - b = HH(b, c, d, a, x[k+10], S34, 0xBEBFBC70); - a = HH(a, b, c, d, x[k+13], S31, 0x289B7EC6); - d = HH(d, a, b, c, x[k+0], S32, 0xEAA127FA); - c = HH(c, d, a, b, x[k+3], S33, 0xD4EF3085); - b = HH(b, c, d, a, x[k+6], S34, 0x4881D05); - a = HH(a, b, c, d, x[k+9], S31, 0xD9D4D039); - d = HH(d, a, b, c, x[k+12], S32, 0xE6DB99E5); - c = HH(c, d, a, b, x[k+15], S33, 0x1FA27CF8); - b = HH(b, c, d, a, x[k+2], S34, 0xC4AC5665); - a = II(a, b, c, d, x[k+0], S41, 0xF4292244); - d = II(d, a, b, c, x[k+7], S42, 0x432AFF97); - c = II(c, d, a, b, x[k+14], S43, 0xAB9423A7); - b = II(b, c, d, a, x[k+5], S44, 0xFC93A039); - a = II(a, b, c, d, x[k+12], S41, 0x655B59C3); - d = II(d, a, b, c, x[k+3], S42, 0x8F0CCC92); - c = II(c, d, a, b, x[k+10], S43, 0xFFEFF47D); - b = II(b, c, d, a, x[k+1], S44, 0x85845DD1); - a = II(a, b, c, d, x[k+8], S41, 0x6FA87E4F); - d = II(d, a, b, c, x[k+15], S42, 0xFE2CE6E0); - c = II(c, d, a, b, x[k+6], S43, 0xA3014314); - b = II(b, c, d, a, x[k+13], S44, 0x4E0811A1); - a = II(a, b, c, d, x[k+4], S41, 0xF7537E82); - d = II(d, a, b, c, x[k+11], S42, 0xBD3AF235); - c = II(c, d, a, b, x[k+2], S43, 0x2AD7D2BB); - b = II(b, c, d, a, x[k+9], S44, 0xEB86D391); - a = addUnsigned(a, AA); - b = addUnsigned(b, BB); - c = addUnsigned(c, CC); - d = addUnsigned(d, DD); - } - var tempValue = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d); - return tempValue.toLowerCase(); - } - }); - })(jQuery); \ No newline at end of file diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/attribution.txt b/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/attribution.txt deleted file mode 100644 index d59da9e0e08..00000000000 --- a/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/attribution.txt +++ /dev/null @@ -1,8 +0,0 @@ -Emoticons and "error" icon from "LED Icon Set" by led24.de ----------------------------------------------------------- -You can do whatever you want with these icons (use on web or in desktop applications) as long as you don’t pass them off as your own and remove this readme file. A credit statement and a link back to -http://led24.de/iconset/ or http://led24.de/ would be appreciated. - -Follow us on twitter http://twitter.com/gasyoun or email leds24@gmail.com -512 icons 20/05/2009 ----------------------------------------------------------- \ No newline at end of file diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/evilgrin.png b/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/evilgrin.png deleted file mode 100644 index f7771e8f5d2298797802d7987ce0ae98a08da693..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 868 zcmV-q1DpJbP)R^I=!_hH9Sz|Kp`1`k;0XN-Xe3NBQsvoL zlKgk{1%)c}bneCj$PjEu&$U8^6a*$5hT!->_1No{bFt9OCF0dD1}qi0rpe!SBD?G) zgggu4Q7_`*Pe{bW$P`vVlUD}buoeD+8+DUI_tS}ge5t^B?b;nDEPEU9<-u5(P0vD~Co?ipt;R%!g)lemM?*kX-a^5Ls1wtWD>%dxDu`k_vW(j??{9%Nhv-t| zcN?AaeveJ5)F6Q&VK@GF+yiaYULFd~E=;}eVx|t(g~oA5JEZ75mgU$GbX~*DnB$+| zS?@3cqgRlwvrV;Jdch7=1Y$*%r8`26?~ zOdE=!$f|_1=LVv|sjDfT`pl-GR?f zZ^Ap+-AKWIj57RKa~#9H!CB9{I-$4Q50Qw?%c^&&Qs0N z#K%}*kmh6Tfl)>uWeJwiPajcHDgK4hUj{*-5J=ekR6ju!K`#;|Nh*Irv2YAim=euN z$5BU}X`H!pAMG=0Oj>lfi+lIJd#$t2K6`U-u4%DunFtpNc0vh(Ck(8@LGZGm%H~Kk zcs={35O27ezUvH-GX6GQ`gfh1n3w|9MvF$(w?+m>IS57NTG4OeEbT+rg&7<9)}_Y z@#5hV2!e_u$BMzn=Ymh%i~jp35cYdAHMDzOru{s4UV;?-OlMYLv>0Kw7@`?4+hozh zY}Qk#0?GdgP#0h=I?Xb#V@IemW|tze)JOlRvYd$hhxX8$kERb*L`7vORQV^_ehQZn z@pZ$TTaK|_)G&d9L_;dX`43o}^J8ftxI(7AiA|5ZB1}T662|6a4fMtk;3~Wq5 zlp_HhR0-4L6DU5_8Lg_v)r&M+#fI;JNBf{Rq>yenYO@-+mVJ}pv?g*!@ZUulX>=)c zQ!~t(U;-V!@qTEN%V18`MR)txns+;4GVu^hN8y_oWUekI;FxlD&|NPhHOG$Wp*Dm9 zvm3~g7{o+h3sQ4Ss1`E54?JaV2NQ6I1Kw6wPdjB%iu}Uu7<+pTQY84B%BLC6KY`W@MdoE56HChX+V6p9{W~q+;3oXsS?RQ8)#rP5=M^07*qoM6N<$g2m%-asU7T diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/happy.png b/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/happy.png deleted file mode 100644 index 3a88e9b4368a743943b418b77486771aef76b62c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 853 zcmV-b1FHOqP)CLR+%edpjHqBf-C5zJ3B4xDw1xZf*>deB5F4sE`pGVqF@=TW*JdrC7KP5jk31X zX)U+kZU1S1?>9B<@WI2+`~A=JeDC{y@27ckLXW=|N7zqjBy1q)2yf@%CQLC>>q#j? z{#$*=En!y!tZXJk`h18P2}3U76gk8E^^h)oz`|Y zbOt>VKLgMyqfpZ+

q>R_?_L`(BKAx{hL`C!hF-78{%{somDOdgmnwF+T?T?!%Ck zjk@~PfRaRTxDR4#7S{F6u(q9rU!!&TP8xVBqf0|QFjLy0#siN4c?>VSH(|AHz*1uw zpbAjQKvj6me4oJRhafgJZ-p+e3H{fc5aN>-EuHSNGGD5UIjTmK*m2&ZrjZ=cQJz<#Z?WEVy}U;L`{>x84C$ZGwIL81>i~w zNGKCsffRiNW3` zl^N8q3`9lZGwzX4lt?6!DQ0B)vY3fUMG!C*NoTmKBK*F_Kr$M#WoL6x^raB=HYBHe zp;x~mD`&0;qM(Hg3-Xq2hZK1VZB`HhA7T10%)k>J>$h1NoY0S5M{cnb#>&n3--<;( zB3Jdoz#Yc)@ME_1kd@#bAM!vElQ30S@%iNmh{>6M#L3tsCI*g!v(!^o3ckL*!?xYb zAT01x=K{V<&=)qKvet;8uLIvk9zzxrkWz7k{XGc1+y`^D35McU1fE@i$WLFOLGrUf zLKLe|jNs+cI)|&K#Gbkzoei1YH!>#ET%5?lK61f*>LWU36m?(naFMDw4zsA`&gFhOXgX z^Jkm7+|Jz2&R_30Cx~?5;XB{^z3=n>bMNmMvF#HG*9f(QqXeEXl7f>EWJ*ola#DG_ z^?g%D_U-)YOUNpyLT3IEa4;aUG+rn!j_S}`%S09pI*QUW%f+s>rLq}Pw6THa? zE#Ze2pM+qV+jvmH3qQQr0xYRn5soC3%3&~+6g zfSQ;GLL&Gbr6_B805@lF40fADN~4RT8Wd94zS`>pfHDhJnghpY09-ntOVEixS4AQc zp(_#a871H?Couf{Jfw)_uzP>63$OczNL7Op z`9{QlQBZY}Mebk(XL9x(gB<=!?=lrlhLD>@*qID}<8Fmuvy!1g>MG>W0CG#}7(pwm zL762x4~f+;6t)pM3F@0!_YCAcnk21ntfVy7H&UUy7Mq57PZJ|3WdsRT7SkBJl8Av% zQ^9E@<|sH_qcq5?CJ|!EQ&lAJ>`9f9)n_SqV<8_o7vS?wL5i->V1o8dzEbPVUFj*@oGZlYEUNHhE zf4RXBQ4{MHDI7SNSKbD*Swog}8PgNXaE~lu#Q50SGUS~!fwQ(Fp zXUs~bBBfL^jY9B2eIyxb5JAvKQ7Qg~(q9HakPt-FKu{m~(}yKJB-510pHM8{sF|-c zn^7E{xsEe)U+r^MFzLeLa?aU%t#$U(WBHD5gg82k`o>w5`cc=2CUX_}61%e<$4h+F)5b*Y86FxS-g3)Bu*YBHJ z(e|zjCX)c!{~gd)V9&n5oL4b|()hi(kbK>MDpAoSSQFw1y8vZ+xiNO(!iV%AzX-^lPxSx;}-->7PKX;ae!(_$M)SN%l z&D?SGob8bDH=#Oj zXW!B8uwJ#-o`J-4SI84H;FizKxcmadGLIa$m0M-RU^}<+Vq(2LO+E>zR-9Tj+)bKwUY_7 zW*57WSR0{z%4|wfk8L-GRm4NRb&2~-)ayC`9kB(OmNV-##1 z?xP*5Wpj7)VcHXEE~!D3_!JCgGZQFdNtEP-pkwNBAqs=Z0#4DWcV@>{BNLfesuklg z==GFfS^QVVKs@rRMz6OayzmLZDIW@41<1ZLhHI}CMxz3)?HHEFU$d=2mIKec z&r7wAQ=KbeGAXF6-3il#9xXEt9GP_@>$?H2Y73EN@WyJonT*-dXH3Au1m;8`)E^ig zfX3p6h8!TT!(6OEL`onmN-!4Eohb*5tj%sh;N3$=!tymlf}g7`7IfZy~!N=_BRyyqM^T@eCrA7F7}*hA#YjL2>4#y(x9wcD}36}e>x zVaVF8E^e$XVP$dz!7(qy=<;1!y0Y1g+<)4+ki9U%Nml3d+7#h=x}5`C+xd?G0{{cR VL-Rg?t=|9u002ovPDHLkV1nDXg+~AY diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/unhappy.png b/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/unhappy.png deleted file mode 100644 index 8e2dfa9e6e7d518f09e145b9aa7c5d306463001e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 860 zcmV-i1Ec(jP)qM-)e1YIPR;zbaS?lK61f*>LWU34RabWs?rLTiN~L}oElQJab7 z|G(SZ&)Lp7z2BxF(t(HXeDC+Z&->4PxE+UWpN?>qP)aB!2!y^3*a-_vsj@X3Ro-rW zPo>e`G90;t)GRZS4Tr&jhj+F=+c)E?nfl&#C+uH-Fq>$xZ5nJPc&y8}HXCd05L9vS zueu>fBT(cZ60|z#_BLR*r2)eZTMLHYCX;^CR)V|weW#mE^-mD;48hg?8Y*=>_7|D} zDS)woZivBk7>`TDk#HLQsf6 zk$hNNn#IWA7|N`tAS4|}@3T6DymL7`d2h@qy#hgqAmSf@rMwKzH=S_2XosRmltKg@ z?GE&O{DxzeJVd-dhTZ+|HC41tW5Npb4uzUtq($q1Ti_bgz1Sz1bi_siOFgha#NAL zM+2S{q0*hh;=p_M^o~VfpXql%5(5wt55mHAgKp z(Z7VheJ>e-UAS!Jy^`op3VG&FWSZ)clo&)th8JqJOf{f+r<~O)38`8RTEih|cAka% z(^Gh+1|QKNwQWwKZDF*V##3o5sJKp}dbTu3O?I zYqvFRg)~!FqC$mUiVQ92rMIG5@gWG8-ZBV+gdjrpC3@+-=wT_c7OJ<@yri3#LGgas z%joXx&faFW^N(wYH1P4yoc}xD{O3F8SABh~#ev5}xJzgzoF!-oBU!i!enx8VODW`o z+0S%_!bhcNZlR#89{HuGp@JHbjfrw$eY|7!*V`wlSg457^m@G{=>bQexkE_=|{V|{T-TMWenyW7L)LtKeByvay^AMvV40#4n z01=);ZjJ;^t_}8%=kTf2PH&%1pfX%4@}QiKz0!Pd5J)dVN-SY(BZP(7Iaq5>LQco& zeFoMOB`_Cjp)pvY$vcOkH(f|XHY?QhcV|WOZD=%Uq+^pnM#2ssL`z#Mc0xgfw|O`& zG|(y#RYp28N}O$!)!$?%cQS!1MaLVF3jd^iayFAhRgIN&MA)h=^lnk&)~XWPOA}o} ziXTL=)xiWhnSed7@CX?;k9dTq#26VDrBy&87K9iMkU*S}pm-8VQG_fmKyNfM0UHxY zN-056=f)<%Z>*3P0>WF%;6{eQjgEoeTq6My;UEugYE9v0q{P2Aaw5M{pOa&P#a@Cx z!#;#V0*odj>`m1)2Qqv^)4Q=kJ!{}mzaQuUmU8hXzYR^I)#Rd*4^P# zsT4z5%?;;|Aw%AeLh8}6O{UqU3b5u$~-VHG{Y8=f46B Y048E)wNxfea{vGU07*qoM6N<$g22&!<^TWy diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/wink.png b/addons/web_chat/static/lib/AjaxIM/themes/default/emoticons/wink.png deleted file mode 100644 index aade1b726ea9a9bbf46eb4671b3345d1dbf0bef5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 854 zcmV-c1F8IpP)i5JbrK)JyM0gcyk?nh|aqYIxf%@v?c@ zTkei~ncbP`{DXo>10OU0ne%=B`M>`huK%$Cdmc04Hldzyf*=sawqYlDSdy(Xt|#wh zKNC|jALZ5DK!&9nX?aJ%fk$Xu!OkIc4YCs;+iJiMZf%|3JX&Lw-py z)h{FHcjDKq6TFy-vc`J=$F~f0iV_{8gCh^}sqB^dJAFW65lU4Lteo_ zsv=A~MW7}^fLI7qwhfNgR}c%W7x1)uOF{ij2toph@J~Qf;20jk)b~+Xii;tN0+N#r z=})jMkz-(Z$rr0*tvfCSYX( zvJ#h)$aVyMeyFMs*?GClDB4|xMscVyoN7Ewrwi+TaGFNnG2MN31Xm=m0?uH@zAOV4 zXPk(HyrdVRBr;85Z)uwx)y4Rv{fJ2$jK9PLdIF0M7&7W8c?%WCE%-4wj-@##6gjAq zSv(?b5;>v^h~^6jEKM+hk4(V6I@v?X5eTLVB#AO=PZvQBZ(-=eI7WJ>;P^a`^<}^A zg^*fBl_*#qd&>mu%ma5!@^rZdy4%aoKcI8dO@zi!T5i%oEd6Sk7mO@s+29;_1zGaG zphlYB>BJ7t{1COL)?z(-7siYR$lmu*qQ5DmfltndG3PQF3?kdHK0RP3^8LND(CV2V zmNr+W+AYVLkYhcGl$?wDk7#fM?#WO1Gtooc=Y3A0hdU(hKjU1)I*f3Q-Sc*Af$(m7 goL#%e`JVs-0OLbkG;!2E`2YX_07*qoM6N<$f*!YpXaE2J diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/images/bottom.png b/addons/web_chat/static/lib/AjaxIM/themes/default/images/bottom.png deleted file mode 100644 index ce52900e365dd1add15e178b27bd8ab330b70d28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 121 zcmeAS@N?(olHy`uVBq!ia0vp^4}qAGg9%73pBlFwNJ*BsMwA5SrR|DNig)WpGT%PfAtr z%uP&B4N6T+sVqF1Y6Dcn7T^=&%Ff6NWNx|>@D)fgl?3?(|7Uo*-M|aTGxBtC45_%4 zl+eP==ElZmaF!v>$e@XngY}`2(~X`NJ}pctxgKqbk%lK`@B}oRVc{@fNbzDgY{+q@ Q1gM+A)78&qol`;+05=gZa{vGU diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/images/error.png b/addons/web_chat/static/lib/AjaxIM/themes/default/images/error.png deleted file mode 100644 index f5ba881738ae3072e476f3ddbd7dd34d642f06d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 552 zcmV+@0@wYCP)A&a_P7S}o zG!s6}jEu~GKp4p&41mvo3NbA|1~KhGFq>2ZZB(et$g5@cY9-1{tFW22MeRe4v~wF$QERIaM<- z{{O*nd`23>@mYBc|Np&XP;x8-%MmglnP1j4N=(g;;pf|paKWFi*D(ky8Zq$8n1Dhw z4W9v-%1)IGf4<*f`2Xh#iNdNA(_lT4EX==BZIP28N-#eIhh~>reEIz qPU=w%q=BsgAGU?yv=6{q$EpRBT9nv(@M${i&7aJQ}UBi z6+Ckj(^G>|6H_V+Po~-c6_t6qIEGZ*dUN4Edy9j>fsY&2PkIV<{{H`evxWOD70+e2 zU;n-l^}DG5?dkTPiD!BuvP1pKZX~p_rp-ubVYK_ucCX`vc%SydIc!C7j?ApR-(K!d ztck1H|0DMwf5i=MtBi$>Qd$}hIa!}fILO>%@myu%4s&}(HU{yDF~8zI-O~cPfWgz% K&t;ucLK6VX2~-jQ diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/images/player/playpause.png b/addons/web_chat/static/lib/AjaxIM/themes/default/images/player/playpause.png deleted file mode 100644 index bd502819a5c262caa74a060025701b588eaa3c23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 706 zcmV;z0zLhSP)L>AUpGYK4)g8LfP7|&< zc;*iB8S)7WTj4H$zGfpIkspwMZcDD&h(AL9LcXyPzlkKrQ0!wF0}3!0ytJR>>>8PASjttzF%`hI1LDzL?x7*V5K~rtJ>2!Kk6U}B*CVX2HobgLB zo6VrnXnF z&dBHUkjv#n!Y(vk9+cqo`JhlJh>8=sn#lTOb>yW|2{M_CO!zSwIFuC+hr>`Vmm!@_ z%cd}>29A(tBGYg_pF=zzhhnh^(P&gwoHUO#-e^CIM5a-vfzxX<))%n0_bSM;3ZJdMabzQr0B>I2Yh;-Ikx)VNBZA%-Ru!iMQdWqaa zo~}UrlyhI&-3zEd?op4rC~k1hGp9GB-^g9$Q{=gV@Hyw$<($HILn@XHfy$qhNelF{r5}E+T9V>nS diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/images/sr.png b/addons/web_chat/static/lib/AjaxIM/themes/default/images/sr.png deleted file mode 100644 index 8e8308ae3a80cdea0bad03c1606ffe4b5ba8df34..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^tRT$61|)m))t&+=$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1G`kpS1Ar-fhe*FJ$&&;vec+yCi7&_QE3>cPph;sh!Hhc%v%HZkh=d#Wzp$Pz(Dl5YJMCLdn3O? g#wB?&JBI;-X8VP8UW(N!KzA{Cy85}Sb4q9e0Kt)7}1{rLai-l2h!f%PBLKizYk?|@Pap00i_>zopr E0IK63`v3p{ diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/theme.css b/addons/web_chat/static/lib/AjaxIM/themes/default/theme.css deleted file mode 100644 index 6b53a213e97..00000000000 --- a/addons/web_chat/static/lib/AjaxIM/themes/default/theme.css +++ /dev/null @@ -1,535 +0,0 @@ -.imjs-default { display: none; } - -/* [begin] Chatbox */ -.imjs-chatbox { - position: absolute; - bottom: 25px; - right: -1px; - width: 225px; - border: 1px solid #cecece; - font: 12px/14px Helvetica Neue, Helvetica, Arial, Calibri, Tahoma, Verdana, sans-serif; - color: #000; - cursor: default; - text-shadow: none; -} - - .imjs-chatbox > div { - display: block; - } - - /* [begin] Chatbox header */ - div.imjs-header { - display: block; - position: relative; - width: 215px; - height: 12px; - padding: 5px; - background: #f0efed; - border-bottom: 1px solid #999; - font-weight: 700; - box-shadow: 0 1px 2px #ccc; - -moz-box-shadow: 0 1px 2px #ccc; - text-shadow: 0 1px 0 #fff; - color: #333; - } - - div.imjs-header a { - position: absolute; - text-shadow: none; - color: #333; - text-decoration: none; - line-height: 2em; - } - - div.imjs-header a.imjs-close { - top: 6px; - right: 5px; - height: 0; - padding-top: 10px; - width: 10px; - overflow: hidden; - background: url(images/closemin.png) 0 0 no-repeat; - } - - div.imjs-header a.imjs-minimize { - position: absolute; - top: 0; - left: 0; - padding-top: 23px; - height: 0; - width: 207px; - overflow: hidden; - background: url(images/closemin.png) 100% -10px no-repeat; - } - - div.imjs-header a.imjs-minimize:active { - outline: none; - } - /* [end] Chatbox header */ - - /* [begin] Message log */ - ul.imjs-msglog { - display: block; - overflow-y: auto; - height: 235px; - list-style-type: none; - margin: 0; - padding: 0; - border-bottom: 1px solid #ddd; - background: #fff; - } - - li.imjs-date { - display: block; - padding: 5px 5px 3px 8px; - border-top: 1px dotted #afafaf; - background-color: #e9e9e9; - } - - li.imjs-error { - display: block; - padding: 0 5px 3px 8px; - border-top: 1px dotted #afafaf; - background-color: #ffeded; - color: #ff0000; - } - - li.imjs-error span.imjs-msg-time { - color: #ff0000; - } - - li.imjs-msg-a, li.imjs-msg-b { - display: block; - padding: 3px 5px 3px 8px; - border-top: 1px dotted #bfbfbf; - } - - li.imjs-msg-b > span { - color: #ff0000; - font-weight: 700; - } - - li.imjs-msg-a > span { - color: #0099ff; - font-weight: 700; - } - - li.imjs-msg-old { - opacity: 0.4; - } - /* [end] Message log */ - - /* [begin] Message Log Messages */ - ul.imjs-msglog li ul { - list-style-type: none; - margin: 0; - padding: 0; - font-size: 11px; - line-height: 14px; - } - - ul.imjs-msglog li ul span { - float: left; - margin-right: 5px; - color: #bcbcbc; - } - - li.imjs-msg-a ul p, li.imjs-msg-b ul p, li.imjs-date ul p { - margin: 0; - } - /* [end] Message Log Messages */ - - /* [begin] Input */ - textarea.imjs-input { - font: 12px/14px Helvetica Neue, Helvetica, Arial, Calibri, Tahoma, Verdana, sans-serif; - height: 16px; - padding: 3px; - margin: 0; - width: 219px; - border: solid #aaa; - border-width: 1px 0 0 0; - overflow: hidden; - } - /* [end] Input */ -/* [end] Chatbox */ - -/* [begin] Messenger bar */ -ul#imjs-bar { - display: block; - position: fixed; - bottom: 0; - left: 50%; - width: 95%; - background: #f0efed url(images/w.png) top left repeat-x; - height: 25px; - border: solid #cfceca; - border-width: 1px 1px 0 1px; - list-style-type: none; - padding: 0; - margin: 0 0 0 -47.5%; - font: 12px/25px Helvetica Neue, Helvetica, Arial, Calibri, Tahoma, Verdana, sans-serif; - color: #222; -} - - /* [begin] Generic bar item */ - ul#imjs-bar > li { - position: relative; - float: right; - width: 161px; - border-left: 1px solid #cecece; - padding: 0 10px; - cursor: pointer; - text-shadow: 0 1px 0 #fff; - } - - ul#imjs-bar > li:hover { - background: #fff; - } - - ul#imjs-bar > li .imjs-tab-text strong { - position: relative; - color: #00cc00; - font-size: 28px; - line-height: 19px; - top: 6px; - margin-right: 5px; - } - - ul#imjs-bar > li.imjs-offline .imjs-tab-text strong { - color: #777; - } - - ul#imjs-bar > li.imjs-away .imjs-tab-text strong { - color: #df9b00; - } - - ul#imjs-bar > li.imjs-selected { - text-shadow: 0 1px 0 #eaeaea; - background: #fff; - color: #000; - margin: -1px 0 0; - border: solid #444; - border-width: 0 1px 1px 1px; - width: 160px; - line-height: 23px; - height: 25px; - } - - ul#imjs-bar > li.imjs-selected .imjs-tab-text { - font-weight: 700; - } - - ul#imjs-bar > li.imjs-selected .imjs-tab-text strong { - line-height: 17px; - } - - ul#imjs-bar > li.imjs-selected .imjs-tab-text a { - display: block; - } - - ul#imjs-bar > li.imjs-selected > .imjs-chatbox { - border-color: #444; - border-bottom: 0; - padding-bottom: 1px; - background-image: url(images/bottom.png); - background-position: left bottom; - background-repeat: no-repeat; - } - - ul#imjs-bar > li.imjs-selected > #imjs-friends-panel.imjs-chatbox { - background-repeat: repeat-x; - background-position: -45px bottom; - } - - /* [begin] Generic bar close */ - ul#imjs-bar > li .imjs-tab-text a { - float: right; - text-decoration: none; - display: none; - width: 10px; - height: 0; - padding-top: 10px; - overflow: hidden; - margin-top: 7.5px; - background: url(images/closemin.png) 0 0 no-repeat; - } - - ul#imjs-bar > li:hover .imjs-tab-text a { - display: inline; - } - /* [end] Generic bar close */ - /* [end] Generic bar item */ - - /* [begin] Bar scrolling buttons */ - ul#imjs-bar > li.imjs-scroll { - width: 20px; - text-align: center; - font-size: 9px; - font-weight: 700; - background-repeat: no-repeat; - } - - ul#imjs-bar li#imjs-scroll-left { - padding: 1px 6px 0 4px; - background-image: url(images/sl.png); - background-position: 5px center; - } - - ul#imjs-bar li#imjs-scroll-right { - padding: 1px 5px 0; - background-image: url(images/sr.png); - background-position: 20px center; - } - /* [end] Bar scrolling buttons */ - - /* [begin] Notification icon */ - span.imjs-notification { - display: block; - position: absolute; - width: 15px; - height: 15px; - right: -9px; - top: -12px; - padding: 2px; - line-height: 16px; - background: #eb2121; - color: #fff; - text-shadow: none; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - overflow: hidden; - text-align: center; - } - /* [end] Notification icon */ - - /* [begin] Tooltip */ - span.imjs-tooltip { - display: none; - position: absolute; - padding-bottom: 5px; - margin: 0 0 3px 6px; - left: -10000px; - background: url(images/tooltip.png) right bottom no-repeat; - color: #fff; - text-shadow: none; - opacity: 0.9; - } - - span.imjs-tooltip p { - font: 11px/18px Helvetica Neue, Helvetica, Arial, Calibri, Tahoma, Verdana, sans-serif; - margin: 0; - padding: 2px 6px; - background: #000; - max-width: 200px; - } - /* [end] Tooltip */ - - /* [begin] Friends list button */ - ul#imjs-bar > li#imjs-friends.imjs-not-connected, - ul#imjs-bar > li#imjs-friends.not-connected:hover { - width: 10px; - background-image: url(images/error.png); - background-position: center; - background-repeat: no-repeat; - } - - ul#imjs-bar > li#imjs-friends.imjs-not-connected span.imjs-tab-text { - margin-left: -10000px; - } - - li#imjs-friends .imjs-tab-text span { - color: #888; - } - - li#imjs-friends .imjs-tab-text span > span { - color: #222; - font-weight: 700; - } - /* [end] Friends list button */ -/* [end] Messenger bar */ - -/* [begin] Friends list */ -div#imjs-friends-panel { - background: #fff; - width: 200px; - right: auto; - left: -1px; - z-index: 100; -} - - div#imjs-friends-panel div.imjs-header { - width: 190px; - } - - div#imjs-friends-panel a.imjs-minimize { - width: 194px; - } - - div#imjs-friends-panel a.imjs-minimize:active { - outline: 0; - } - -ul#imjs-friends-list { - list-style-type: none; - padding: 0; - margin: 0; - font: 12px/25px Helvetica Neue, Helvetica, Arial, Calibri, Tahoma, Verdana, sans-serif; - max-height: 300px; - overflow-x: hidden; - overflow-y: auto; -} - - ul#imjs-friends-list li, ul.imjs-friend-group li { - width: 200px; - padding: 0; - margin: 0; - cursor: pointer; - list-style-type: none; - } - - span.imjs-friend-group-header { - display: block; - padding: 0 0 0 5px; - width: 195px; - font-weight: 700; - border-top: 1px solid #aaa; - cursor: default; - } - - li.imjs-friend-group ul { - margin: 0 0 5px; - padding: 0; - } - - li.imjs-friend-group ul li { - width: 200px; - } - - li.imjs-friend-group ul li:hover { - background: #0055aa; - color: #fff; - } - - li.imjs-friend-group ul li > strong { - position: relative; - color: #00cc00; - font-size: 28px; - line-height: 19px; - top: 6px; - margin: 0 5px; - } - - li.imjs-friend-group ul li.imjs-offline > strong { - color: #777; - } - - li.imjs-friend-group ul li.imjs-away > strong { - color: #df9b00; - } - - li.imjs-friend-group ul li.imjs-selected { - background: #686868; - color: #eee; - font-weight: 700; - text-shadow: 0 1px 0 #333; - } - -div#imjs-friends-panel form, div#imjs-friends-panel form p { - margin: 0; - padding: 0; -} - - input#imjs-search-friends { - font: 12px/14px Helvetica Neue, Helvetica, Arial, Calibri, Tahoma, Verdana, sans-serif; - height: 16px; - width: 194px; - padding: 6px 3px 3px; - margin: 0; - border: solid #aaa; - border-width: 1px 0 0 0; - color: #aaa; - } -/* [end] Friends list */ - -/* [begin] Login/Registration Forms */ -div#imjs-lr form { - background: #F0EFED url(images/w.png) repeat-x; - border: 1px solid #cfceca; - max-width: 220px; - padding: 5px 5px 10px 8px; - overflow: auto; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; -} - - div#imjs-lr .error { - font: 700 12px/18px Helvetica Neue, Helvetica, Arial, Calibri, Tahoma, Verdana, sans-serif; - color: #ff0000; - } - - div#imjs-lr form fieldset { - border: 0; - padding: 0; - margin: 0; - } - - div#imjs-lr form h2 { - font: 700 20px/24px Helvetica Neue, Helvetica, Arial, Calibri, Tahoma, Verdana, sans-serif; - margin: 0; - padding: 7px 0 0 2px; - color: #555; - text-shadow: 0 1px 0px #fff; - } - - div#imjs-lr form label { - display: block; - font: 700 12px/14px Helvetica Neue, Helvetica, Arial, Calibri, Tahoma, Verdana, sans-serif; - color: #7B7A79; - } - - div#imjs-lr form input { - width: 200px; - } - - div#imjs-lr form input.imjs-lr-error, div#imjs-lr form input.imjs-lr-error:focus { - margin: -1px; - border: 2px solid #ff1111; - } - - div#imjs-lr form button { - float: right; - background: #f4f3f1; - outline: 0; - } - - div#imjs-lr form input, div#imjs-lr form button { - border: 1px solid #ddd; - color: #000; - padding: 4px 3px; - font: 16px/20px Helvetica Neue, Helvetica, Arial, Calibri, Tahoma, Verdana, sans-serif; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - margin: 0; - } - - div#imjs-lr form p { - padding-left: 2px; - overflow: visible; - } - - div#imjs-lr form input:focus, div#imjs-lr form button:focus { - position: relative; - border: 2px solid #999; - margin: -1px; - } - - p.imjs-submit { - width: 207px; - overflow: visible; - } - - form#imjs-login { - margin-bottom: 10px; - } -/* [end] Login/Registration Forms */ \ No newline at end of file diff --git a/addons/web_chat/static/lib/AjaxIM/themes/default/theme.html b/addons/web_chat/static/lib/AjaxIM/themes/default/theme.html deleted file mode 100644 index 52a4508ca85..00000000000 --- a/addons/web_chat/static/lib/AjaxIM/themes/default/theme.html +++ /dev/null @@ -1,132 +0,0 @@ - -

    -
  • - Friends (0) -
    -
    - {username} - _ -
    -
      -
    • - {group} -
        -
      • {username}
      • -
      -
    • -
    -
    -

    -
    -
    -
  • -
  • {count}
  • -
  • - {label} x - {count} -
    -
    -
    - {username} - x - _ -
    -
      -
    • -
        -
      • - hh:MM TT • -

        ddd, mmmm d, yyyy

        -
      • -
      -
    • - -
    • -
        -
      • - hh:MM TT • -

        ddd, mmmm d, yyyy

        -
      • -
      -
    • - -
    • - {username} -
        -
      • - hh:MM TT • -

        {message}

        -
      • -
      -
    • -
    • - {username} -
        -
      • - hh:MM TT • -

        {message}

        -
      • -
      -
    • -
    - -
    -
    -
  • -
  • {count}
  • -
-

{tip}

- - -
-
-
-

Login

- -

- -

- - -

- -

- - -

- -

- -

-
- -

Signed in as {username}. Sign Out.

-
- -
-
-

Register

- -

- -

- - -

- -

- - -

- -

- - -

- -

- -

-
-
-
\ No newline at end of file diff --git a/addons/web_chat/static/src/js/web_chat.js b/addons/web_chat/static/src/js/web_chat.js deleted file mode 100644 index fce64ee6f78..00000000000 --- a/addons/web_chat/static/src/js/web_chat.js +++ /dev/null @@ -1,10 +0,0 @@ -openerp.web_chat = function (openerp) { - openerp.web_chat = {}; - openerp.web_chat.im = new AjaxIM({ - storageMethod: 'local', - pollServer: '/web_chat/pollserver', - theme: '/web_chat/static/lib/AjaxIM/themes/default', - flashStorage: '/web_chat/static/lib/AjaxIM/js/jStore.Flash.html' - }); - openerp.web_chat.im.login(); -};