...
 
Commits (4423)
......@@ -42,4 +42,7 @@ compile
cscope.out
tags
TAGS
gnome-doc-utils.make
ABOUT-NLS
config.rpath
test-driver
INSTALL
[submodule "telepathy-account-widgets"]
path = telepathy-account-widgets
url = https://gitlab.gnome.org/GNOME/telepathy-account-widgets.git
......@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
......@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
......
This diff is collapsed.
Empathy is split in different processes:
- src/empathy: contact list, considered as the main UI
- src/empathy-chat: chat UI
- src/empathy-call: call UI
- src/empathy-accounts: UI to configure IM accounts
- src/empathy-debugger: debug tool
Each process can be run directly from source without having to be installed to
its prefix. You just have to define an appropriate environment using the
wrapper found in the tools/ directory.. For example:
./tools/empathy-env ./src/empathy
The chat and call UI are automatically started by telepathy-mission-control
when receiving or requesting a chat/call. In order to use your custom version
you have to kill any existing instance of empathy-{chat,call} and then start
it with EMPATHY_PERSIST=1 to prevent it from auto exiting if there is no
channel to handle. For example:
EMPATHY_PERSIST=1 ./tools/empathy-env ./src/empathy-chat
Debugging can be turned on using EMPATHY_DEBUG=all and logged to a file
with EMPATHY_LOGFILE=/tmp/empathy.log
Sometimes you may want to load the locally compiled version of some GStreamer
plugin (e.g. Farstream) instead of the system installed one. To do so, just
set the GST_PLUGIN_PATH environment variable to tell GStreamer where your
plugins are located and the GST_PLUGIN_LOADING_WHITELIST to avoid conflicts
with system installed plugins. It's also a good idea to use GST_REGISTRY to
avoid clobbering your default GStreamer registry. For example you can
export these before launching the empathy processes as shown above:
export GST_PLUGIN_LOADING_WHITELIST=gstreamer:gst-plugins-base:gst-plugins-good:libnice:farstream:gst-plugins-bad:gst-plugins-ugly:gst-ffmpeg
export GST_PLUGIN_PATH=/path/to/your/custom/lib/gstreamer-0.10
export GST_REGISTRY=/tmp/gstreamer.registry
See http://live.gnome.org/Empathy/ about coding style conventions.
See also http://live.gnome.org/Empathy/Git to read about our git workflow.
Please visite the Empathy website for installation instructions:
http://live.gnome.org/Empathy/Install
MY_SUBDIRS = tools extensions po data libempathy libempathy-gtk src help tests
NST_SUBDIRS = nautilus-sendto-plugin
MY_SUBDIRS = tools extensions po data telepathy-account-widgets libempathy libempathy-gtk src help tests
GOA_SUBDIRS = goa-mc-plugin
UOA_SUBDIRS = ubuntu-online-accounts
DIST_SUBDIRS = $(MY_SUBDIRS) $(NST_SUBDIRS)
DIST_SUBDIRS = $(MY_SUBDIRS) $(GOA_SUBDIRS) $(UOA_SUBDIRS)
SUBDIRS = $(MY_SUBDIRS)
if HAVE_NST
SUBDIRS += $(NST_SUBDIRS)
if HAVE_GOA
SUBDIRS += $(GOA_SUBDIRS)
endif
ACLOCAL_AMFLAGS = -I m4
if HAVE_UOA
SUBDIRS += $(UOA_SUBDIRS)
endif
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
DISTCHECK_CONFIGURE_FLAGS = \
--disable-scrollkeeper \
......
This diff is collapsed.
MIME-Version: 1.0
Received: by 10.231.11.1 with HTTP; Tue, 11 Oct 2011 22:59:10 -0700 (PDT)
In-Reply-To:
<CADttZZpfye8-Pi9=UDK3OUq8NmsagYV5AF_oewVNEUMRp7joFg@mail.gmail.com>
References: <CADttZZoDLnv+aoZBPLcHT43-yKCH8LB+3objC-ST1qRp3P3Lnw@mail.gmail.com>
<CACuygeBuekJwr3t+7GxLA8Ft+A-Q6QmZUhe_2VU2LozSYduYxQ@mail.gmail.com>
<CADttZZqadJP3441etHxd2JFmNCqqHxDhg-uiCqqV=Qs3hUCynA@mail.gmail.com>
<CADttZZrWAw7hjQb1+qN+4z42d10FEWwOvLG-P_s85Htf_fwbEg@mail.gmail.com>
<CACuygeCOpAmYBogzay2VOb7SGnEhLsKfeaU-07QXQG=mj-ZRfg@mail.gmail.com>
<CADttZZrmrz5Dr7d9THQsSPJtWvy_P_-vkAx=UDcUEo_c+RE2nQ@mail.gmail.com>
<CADttZZqGfRUjcr8Cppz5oWniXwmreomd3wshCBzwx1E32A=Kdw@mail.gmail.com>
<CACuygeDDcW1NZYGCzTuxAUrJ92BgEnG+0ewME-yhR03Pwvd02A@mail.gmail.com>
<CADttZZpfye8-Pi9=UDK3OUq8NmsagYV5AF_oewVNEUMRp7joFg@mail.gmail.com>
Date: Wed, 12 Oct 2011 11:29:10 +0530
Delivered-To: chandniverma2112@gmail.com
Message-ID: <CADttZZrP+XkPtNgAzxM56WkQAT72hjcQD0Z1UcFj8=q86Cpxeg@mail.gmail.com>
Subject: Re: API issues
From: Chandni Verma <chandniverma2112@gmail.com>
To: Pastebin Support <admin@pastebin.com>
Content-Type: multipart/alternative; boundary=001636ef068e08c10c04af13b9e5
--001636ef068e08c10c04af13b9e5
Content-Type: text/plain; charset=ISO-8859-1
Hi Admin,
One thing which I want to ask you since it it not answered anywhere on the
pastebin.com website is that who is allowed to use the API developer key in
their codes. Are there any licences to keep in mind?
It's crucial to the open source project I have used the pastebin API for.
Can we publish a member's (my) key in the open source code?
Regards,
Chandni
_______
Delivered-To: chandniverma2112@gmail.com
Received: by 10.231.11.1 with SMTP id r1cs44531ibr;
Wed, 12 Oct 2011 02:27:32 -0700 (PDT)
Return-Path: <godius@gmail.com>
Received-SPF: pass (google.com: domain of godius@gmail.com designates
10.182.187.100 as permitted sender) client-ip=10.182.187.100;
Authentication-Results: mr.google.com; spf=pass (google.com: domain of
godius@gmail.com designates 10.182.187.100 as permitted sender)
smtp.mail=godius@gmail.com; dkim=pass header.i=godius@gmail.com
Received: from mr.google.com ([10.182.187.100])
by 10.182.187.100 with SMTP id fr4mr13834663obc.79.1318411651457
(num_hops = 1);
Wed, 12 Oct 2011 02:27:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=mime-version:sender:in-reply-to:references:date
:x-google-sender-auth:message-id:subject:from:to:content-type;
bh=pv3X2ILKj91U9H2lw/fwrkHPzZRFCaB8pPO2Y6pBzSA=;
b=T2XQR8CcrP3jF/9wJPYJxBQPToZp2ckFMelfmdRFd7akc6f8iEQRXUjEsYXvRPbuzS
6TWaTHiT0QLBZaqh1D6AifP2E4m84H+h8LwEkYXXAN4dJyTIbAM8rQ5KfbTiaoKzuv48
7dS26KA2YOB1bWTlhEm0zW4bdPCGSBxsCW67Y=
MIME-Version: 1.0
Received: by 10.182.187.100 with SMTP id fr4mr13834663obc.79.1318411651452;
Wed, 12 Oct 2011 02:27:31 -0700 (PDT)
Sender: godius@gmail.com
Received: by 10.182.118.36 with HTTP; Wed, 12 Oct 2011 02:27:31 -0700 (PDT)
In-Reply-To:
<CADttZZrP+XkPtNgAzxM56WkQAT72hjcQD0Z1UcFj8=q86Cpxeg@mail.gmail.com>
References: <CADttZZoDLnv+aoZBPLcHT43-yKCH8LB+3objC-ST1qRp3P3Lnw@mail.gmail.com>
<CACuygeBuekJwr3t+7GxLA8Ft+A-Q6QmZUhe_2VU2LozSYduYxQ@mail.gmail.com>
<CADttZZqadJP3441etHxd2JFmNCqqHxDhg-uiCqqV=Qs3hUCynA@mail.gmail.com>
<CADttZZrWAw7hjQb1+qN+4z42d10FEWwOvLG-P_s85Htf_fwbEg@mail.gmail.com>
<CACuygeCOpAmYBogzay2VOb7SGnEhLsKfeaU-07QXQG=mj-ZRfg@mail.gmail.com>
<CADttZZrmrz5Dr7d9THQsSPJtWvy_P_-vkAx=UDcUEo_c+RE2nQ@mail.gmail.com>
<CADttZZqGfRUjcr8Cppz5oWniXwmreomd3wshCBzwx1E32A=Kdw@mail.gmail.com>
<CACuygeDDcW1NZYGCzTuxAUrJ92BgEnG+0ewME-yhR03Pwvd02A@mail.gmail.com>
<CADttZZpfye8-Pi9=UDK3OUq8NmsagYV5AF_oewVNEUMRp7joFg@mail.gmail.com>
<CADttZZrP+XkPtNgAzxM56WkQAT72hjcQD0Z1UcFj8=q86Cpxeg@mail.gmail.com>
Date: Wed, 12 Oct 2011 11:27:31 +0200
X-Google-Sender-Auth: cXD_1Zj39UiHBWVSdEJRk04LVC8
Message-ID: <CACuygeDAqGCP+=KsV+ZyxNuLoy9L0CTQ63NpRhrig-9bzeFp6A@mail.gmail.com>
Subject: Re: API issues
From: Pastebin Support <admin@pastebin.com>
To: Chandni Verma <chandniverma2112@gmail.com>
Content-Type: multipart/alternative; boundary=14dae9398ea5270f6904af16a25e
--14dae9398ea5270f6904af16a25e
Content-Type: text/plain; charset=ISO-8859-1
Hello,
Yes you can use your api developer key in the open for your project.
Regards,
Pastebin
On Wed, Oct 12, 2011 at 7:59 AM, Chandni Verma
<chandniverma2112@gmail.com>wrote:
> Hi Admin,
>
> One thing which I want to ask you since it it not answered anywhere on the
> pastebin.com website is that who is allowed to use the API developer key
> in their codes. Are there any licences to keep in mind?
> It's crucial to the open source project I have used the pastebin API for.
>
> Can we publish a member's (my) key in the open source code?
>
> Regards,
> Chandni
>
......@@ -6,7 +6,8 @@ $ make && make install
2) Start empathy
$ empathy
This will start MC, connect all enabled accounts and add a GtkStatusIcon. If you
start a private chat or someone is saying something to you, empathy-chat will be
started automagicaly and display a chat UI for your conversation.
This will start telepathy-mission-control, connect all enabled accounts and add
a GtkStatusIcon. If you start a private chat or someone is saying something to
you, empathy-chat will be started automagicaly and display a chat UI for your
conversation.
......@@ -17,6 +17,17 @@ which gnome-autogen.sh || {
echo "You need to install gnome-common from the GNOME GIT"
exit 1
}
USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh
# Fetch submodules if needed
if test ! -f telepathy-account-widgets/COPYING;
then
echo "+ Setting up submodules"
git submodule init
fi
git submodule update
cd telepathy-account-widgets
sh autogen.sh --no-configure
cd ..
USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh
This diff is collapsed.
empathy.appdata.xml
empathy.desktop
empathy.desktop.in
org.gnome.Empathy.gschema.valid
org.gnome.Empathy.gschema.xml
gschemas.compiled
org.freedesktop.Telepathy.Client.Empathy.Chat.service
org.freedesktop.Telepathy.Client.Empathy.AudioVideo.service
empathy-accounts.desktop
empathy-accounts.desktop.in
org.freedesktop.Telepathy.Client.Empathy.Call.service
org.freedesktop.Telepathy.Client.Empathy.Auth.service
org.freedesktop.Telepathy.Client.Empathy.FileTransfer.service
icons/local-copy/*
......@@ -2,20 +2,22 @@
Interfaces=org.freedesktop.Telepathy.Client.Handler
[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 0]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamedMedia
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 1]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamedMedia
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
org.freedesktop.Telepathy.Channel.Type.StreamedMedia.InitialAudio b=true
org.freedesktop.Telepathy.Channel.Type.Call1.InitialAudio b=true
[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 2]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamedMedia
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
org.freedesktop.Telepathy.Channel.Type.StreamedMedia.InitialVideo b=true
org.freedesktop.Telepathy.Channel.Type.Call1.InitialVideo b=true
[org.freedesktop.Telepathy.Client.Handler.Capabilities]
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/ice-udp=true
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p=true
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/h264=true
org.freedesktop.Telepathy.Channel.Type.Call1/audio=true
org.freedesktop.Telepathy.Channel.Type.Call1/video=true
org.freedesktop.Telepathy.Channel.Type.Call1/ice=true
org.freedesktop.Telepathy.Channel.Type.Call1/gtalk-p2p=true
org.freedesktop.Telepathy.Channel.Type.Call1/video/h264=true
[org.freedesktop.Telepathy.Client]
Interfaces=org.freedesktop.Telepathy.Client.Handler
[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 0]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.FileTransfer
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
org.freedesktop.Telepathy.Channel.Requested b=false
SUBDIRS = icons
SUBDIRS = icons themes
desktopdir = $(datadir)/applications
desktop_in_files = \
empathy.desktop.in \
empathy-accounts.desktop.in \
org.gnome.Empathy.desktop.in \
$(NULL)
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
gsettings_files = \
org.gnome.Empathy.gschema.xml.in \
$(NULL)
gsettings_SCHEMAS = $(gsettings_files:.xml.in=.xml)
@INTLTOOL_XML_NOMERGE_RULE@
gsettings_SCHEMAS = org.gnome.Empathy.gschema.xml
@GSETTINGS_RULES@
# We need to compile schemas at make time
# to run from source tree
gschemas.compiled: $(gsettings_SCHEMAS:.xml=.valid)
$(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --targetdir=. .
all-local: gschemas.compiled
convertdir = $(datarootdir)/GConf/gsettings
convert_DATA = \
empathy.convert
streamingprefsdir = $(datadir)/empathy
streamingprefs_DATA = \
codec-preferences \
element-properties
servicefiledir = $(datadir)/dbus-1/services
servicefile_in_files = \
org.freedesktop.Telepathy.Client.Empathy.Chat.service.in \
org.freedesktop.Telepathy.Client.Empathy.AudioVideo.service.in \
org.freedesktop.Telepathy.Client.Empathy.Auth.service.in
org.freedesktop.Telepathy.Client.Empathy.Auth.service.in \
org.freedesktop.Telepathy.Client.Empathy.Call.service.in \
org.freedesktop.Telepathy.Client.Empathy.FileTransfer.service.in
servicefile_DATA = $(servicefile_in_files:.service.in=.service)
org.freedesktop.Telepathy.Client.Empathy.Chat.service: org.freedesktop.Telepathy.Client.Empathy.Chat.service.in
$(AM_V_GEN)sed -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@
org.freedesktop.Telepathy.Client.Empathy.AudioVideo.service: org.freedesktop.Telepathy.Client.Empathy.AudioVideo.service.in
org.freedesktop.Telepathy.Client.Empathy.Auth.service: org.freedesktop.Telepathy.Client.Empathy.Auth.service.in
$(AM_V_GEN)sed -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@
org.freedesktop.Telepathy.Client.Empathy.Auth.service: org.freedesktop.Telepathy.Client.Empathy.Auth.service.in
org.freedesktop.Telepathy.Client.Empathy.Call.service: org.freedesktop.Telepathy.Client.Empathy.Call.service.in
$(AM_V_GEN)sed -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@
org.freedesktop.Telepathy.Client.Empathy.FileTransfer.service: org.freedesktop.Telepathy.Client.Empathy.FileTransfer.service.in
$(AM_V_GEN)sed -e "s|[@]bindir[@]|$(bindir)|" $< > $@
clientfiledir = $(datarootdir)/telepathy/clients
clientfile_DATA = \
Empathy.Chat.client \
Empathy.AudioVideo.client \
Empathy.Auth.client
Empathy.Auth.client \
Empathy.Call.client \
Empathy.FileTransfer.client
htmldir = $(datadir)/empathy
html_DATA = Template.html
html_DATA = \
Template.html \
empathy-log-window.html \
$(NULL)
cssdir = $(datadir)/empathy
css_DATA = \
empathy.css \
$(NULL)
appdatadir = $(datadir)/metainfo
appdata_in_files = org.gnome.Empathy.appdata.xml.in
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
@INTLTOOL_XML_RULE@
EXTRA_DIST = \
$(appdata_in_files) \
$(convert_DATA) \
$(desktop_in_files) \
$(desktop_DATA) \
$(schemas_DATA) \
$(streamingprefs_DATA) \
$(html_DATA) \
$(clientfile_DATA) \
$(servicefile_in_files) \
$(gsettings_files) \
$(gsettings_SCHEMAS) \
$(css_DATA) \
$(NULL)
CLEANFILES = \
$(appdata_DATA)
DISTCLEANFILES = \
$(desktop_DATA) \
$(schemas_DATA) \
$(servicefile_DATA) \
$(gsettings_SCHEMAS) \
$(css_DATA) \
gschemas.compiled \
$(NULL)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<base href="%@">
<script type="text/ecmascript" defer="defer">
//Appending new content to the message view
function appendMessage(html) {
shouldScroll = nearBottom();
<script type="text/javascript" defer="defer">
// NOTE:
// Any percent signs in this file must be escaped!
// Use two escape signs (%%) to display it, this is passed through a format call!
function appendHTML(html) {
var node = document.getElementById("Chat");
var range = document.createRange();
range.selectNode(node);
var documentFragment = range.createContextualFragment(html);
node.appendChild(documentFragment);
}
//Remove any existing insertion point
insert = document.getElementById("insert");
if(insert) insert.parentNode.removeChild(insert);
// a coalesced HTML object buffers and outputs DOM objects en masse.
// saves A LOT of CSS recalculation time when loading many messages.
// (ex. a long twitter timeline)
function CoalescedHTML() {
var self = this;
this.fragment = document.createDocumentFragment();
this.timeoutID = 0;
this.coalesceRounds = 0;
this.isCoalescing = false;
this.isConsecutive = undefined;
this.shouldScroll = undefined;
this.interdiv = undefined;
var appendElement = function (elem) {
document.getElementById("Chat").appendChild(elem);
};
function outputHTML() {
var insert = document.getElementById("insert");
if(!!insert && self.isConsecutive) {
insert.parentNode.replaceChild(self.fragment, insert);
} else {
if(insert)
insert.parentNode.removeChild(insert);
// insert the documentFragment into the live DOM
appendElement(self.fragment);
}
alignChat(self.shouldScroll);
// reset state to empty/non-coalescing
self.shouldScroll = undefined;
self.isConsecutive = undefined;
self.isCoalescing = false;
self.coalesceRounds = 0;
}
// creates and returns a new documentFragment, containing all content nodes
// which can be inserted as a single node.
function createHTMLNode(html) {
var range = document.createRange();
range.selectNode(document.getElementById("Chat"));
return range.createContextualFragment(html);
}
// removes first insert node from the internal fragment.
function rmInsertNode() {
var insert = self.fragment.querySelector("#insert");
if(insert)
insert.parentNode.removeChild(insert);
}
function setShouldScroll(flag) {
if(flag && undefined === self.shouldScroll)
self.shouldScroll = flag;
}
// hook in a custom method to append new data
// to the chat.
this.setAppendElementMethod = function (func) {
if(typeof func === 'function')
appendElement = func;
}
// (re)start the coalescing timer.
// we wait 25ms for a new message to come in.
// If we get one, restart the timer and wait another 10ms.
// If not, run outputHTML()
// We do this a maximum of 400 times, for 10s max that can be spent
// coalescing input, since this will block display.
this.coalesce = function() {
window.clearTimeout(self.timeoutID);
self.timeoutID = window.setTimeout(outputHTML, 25);
self.isCoalescing = true;
self.coalesceRounds += 1;
if(400 < self.coalesceRounds)
self.cancel();
}
// if we need to append content into an insertion div,
// we need to clear the buffer and cancel the timeout.
this.cancel = function() {
if(self.isCoalescing) {
window.clearTimeout(self.timeoutID);
outputHTML();
}
}
// This method is called, if the size of the chat window
// changes or after new messages have been appended.
// Adjusts the size of the interleaving page (if existing)
this.onchange = function() {
if (self.interdiv !== undefined){
var old_padding = parseInt(self.interdiv.style.paddingTop, 10);
var diff = document.height -
(self.interdiv.offsetTop + old_padding);
new_padding = window.innerHeight - diff;
//Append the new message to the bottom of our chat block
chat = document.getElementById("Chat");
range = document.createRange();
range.selectNode(chat);
documentFragment = range.createContextualFragment(html);
chat.appendChild(documentFragment);
if (new_padding <= 0)
removePage();
else
self.interdiv.style.paddingTop = new_padding + "px";
}
}
alignChat(shouldScroll);
}
function appendMessageNoScroll(html) {
//Remove any existing insertion point
insert = document.getElementById("insert");
if(insert) insert.parentNode.removeChild(insert);
// coalased analogs to the global functions
this.append = function(html, shouldScroll) {
// if we started this fragment with a consecuative message,
// cancel and output before we continue
if(self.isConsecutive) {
self.cancel();
}
self.isConsecutive = false;
rmInsertNode();
var node = createHTMLNode(html);
self.fragment.appendChild(node);
node = null;
//Append the new message to the bottom of our chat block
chat = document.getElementById("Chat");
range = document.createRange();
range.selectNode(chat);
documentFragment = range.createContextualFragment(html);
chat.appendChild(documentFragment);
setShouldScroll(shouldScroll);
self.onchange();
self.coalesce();
}
this.appendNext = function(html, shouldScroll) {
if(undefined === self.isConsecutive)
self.isConsecutive = true;
var node = createHTMLNode(html);
var insert = self.fragment.querySelector("#insert");
if(insert) {
insert.parentNode.replaceChild(node, insert);
} else {
self.fragment.appendChild(node);
}
node = null;
setShouldScroll(shouldScroll);
self.onchange();
self.coalesce();
}
this.replaceLast = function (html, shouldScroll) {
rmInsertNode();
var node = createHTMLNode(html);
var lastMessage = self.fragment.lastChild;
lastMessage.parentNode.replaceChild(node, lastMessage);
node = null;
setShouldScroll(shouldScroll);
}
}
function appendNextMessage(html){
shouldScroll = nearBottom();
//Locate the insertion point
insert = document.getElementById("insert");
//make new node
range = document.createRange();
range.selectNode(insert.parentNode);
newNode = range.createContextualFragment(html);
var coalescedHTML;
//swap
insert.parentNode.replaceChild(newNode,insert);
//Appending new content to the message view
function appendMessage(html) {
var shouldScroll;
alignChat(shouldScroll);
// Only call nearBottom() if should scroll is undefined.
if(undefined === coalescedHTML.shouldScroll) {
shouldScroll = nearBottom();
} else {
shouldScroll = coalescedHTML.shouldScroll;
}
appendMessageNoScroll(html, shouldScroll);
}
function appendNextMessageNoScroll(html){
//Locate the insertion point
insert = document.getElementById("insert");
//make new node
range = document.createRange();
range.selectNode(insert.parentNode);
newNode = range.createContextualFragment(html);
//swap
insert.parentNode.replaceChild(newNode,insert);
function appendMessageNoScroll(html, shouldScroll) {
shouldScroll = shouldScroll || false;
// always try to coalesce new, non-griuped, messages
coalescedHTML.append(html, shouldScroll)
}
function appendNextMessage(html){
var shouldScroll;
if(undefined === coalescedHTML.shouldScroll) {
shouldScroll = nearBottom();
} else {
shouldScroll = coalescedHTML.shouldScroll;
}
appendNextMessageNoScroll(html, shouldScroll);
}
function appendNextMessageNoScroll(html, shouldScroll){
shouldScroll = shouldScroll || false;
// only group next messages if we're already coalescing input
coalescedHTML.appendNext(html, shouldScroll);
}