This commit is contained in:
mluto 2013-01-14 09:04:15 -08:00
commit a4ed01d146
40 changed files with 2343 additions and 3 deletions

View file

@ -43,6 +43,7 @@
"timeslider.version": "Weergawe {{version}}", "timeslider.version": "Weergawe {{version}}",
"timeslider.saved": "Gestoor op {{day}} {{month}} {{year}}", "timeslider.saved": "Gestoor op {{day}} {{month}} {{year}}",
"timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{year}}-{{month}}-{{day}}",
"timeslider.month.january": "Januarie", "timeslider.month.january": "Januarie",
"timeslider.month.february": "Februarie", "timeslider.month.february": "Februarie",
"timeslider.month.march": "Maart", "timeslider.month.march": "Maart",

View file

@ -87,6 +87,7 @@
"timeslider.version": "Versi\u00f3n {{version}}", "timeslider.version": "Versi\u00f3n {{version}}",
"timeslider.saved": "Guard\u00e1u el {{day}} de {{month}} de {{year}}", "timeslider.saved": "Guard\u00e1u el {{day}} de {{month}} de {{year}}",
"timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}",
"timeslider.month.january": "de xineru", "timeslider.month.january": "de xineru",
"timeslider.month.february": "de febreru", "timeslider.month.february": "de febreru",
"timeslider.month.march": "de marzu", "timeslider.month.march": "de marzu",

View file

@ -84,6 +84,7 @@
"timeslider.version": "Verze {{version}}", "timeslider.version": "Verze {{version}}",
"timeslider.saved": "Ulo\u017eeno {{day}} {{month}} {{year}}", "timeslider.saved": "Ulo\u017eeno {{day}} {{month}} {{year}}",
"timeslider.dateformat": "{{day}} {{month}} {{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}} {{month}} {{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}} {{month}} {{year}}",
"timeslider.month.january": "leden", "timeslider.month.january": "leden",
"timeslider.month.february": "\u00fanor", "timeslider.month.february": "\u00fanor",
"timeslider.month.march": "b\u0159ezen", "timeslider.month.march": "b\u0159ezen",

View file

@ -87,6 +87,7 @@
"timeslider.version": "Version {{version}}", "timeslider.version": "Version {{version}}",
"timeslider.saved": "Gemt den {{day}}.{{month}} {{year}}", "timeslider.saved": "Gemt den {{day}}.{{month}} {{year}}",
"timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}",
"timeslider.month.january": "januar", "timeslider.month.january": "januar",
"timeslider.month.february": "februar", "timeslider.month.february": "februar",
"timeslider.month.march": "marts", "timeslider.month.march": "marts",

View file

@ -91,6 +91,7 @@
"timeslider.version": "Version {{version}}", "timeslider.version": "Version {{version}}",
"timeslider.saved": "Gespeichert am {{day}}.{{month}}.{{year}}", "timeslider.saved": "Gespeichert am {{day}}.{{month}}.{{year}}",
"timeslider.dateformat": "{{day}}.{{month}}.{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}}.{{month}}.{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}}.{{month}}.{{year}}",
"timeslider.month.january": "Januar", "timeslider.month.january": "Januar",
"timeslider.month.february": "Februar", "timeslider.month.february": "Februar",
"timeslider.month.march": "M\u00e4rz", "timeslider.month.march": "M\u00e4rz",

View file

@ -61,6 +61,7 @@
"timeslider.version": "Versiyon\u00ea {{version}}", "timeslider.version": "Versiyon\u00ea {{version}}",
"timeslider.saved": "{{day}} {{month}}, {{year}} de biyo qeyd", "timeslider.saved": "{{day}} {{month}}, {{year}} de biyo qeyd",
"timeslider.dateformat": "{{month}}\/{{day}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{month}}\/{{day}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{month}}\/{{day}}\/{{year}}",
"timeslider.month.january": "\u00c7ele", "timeslider.month.january": "\u00c7ele",
"timeslider.month.february": "\u015e\u0131bate", "timeslider.month.february": "\u015e\u0131bate",
"timeslider.month.march": "Adar", "timeslider.month.march": "Adar",

File diff suppressed because one or more lines are too long

5
src/locales/en.json.orig Normal file

File diff suppressed because one or more lines are too long

View file

@ -88,6 +88,7 @@
"timeslider.version": "Versi\u00f3n {{version}}", "timeslider.version": "Versi\u00f3n {{version}}",
"timeslider.saved": "Guardado el {{day}} de {{month}} de {{year}}", "timeslider.saved": "Guardado el {{day}} de {{month}} de {{year}}",
"timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}",
"timeslider.month.january": "Enero", "timeslider.month.january": "Enero",
"timeslider.month.february": "Febrero", "timeslider.month.february": "Febrero",
"timeslider.month.march": "Marzo", "timeslider.month.march": "Marzo",

View file

@ -91,6 +91,7 @@
"timeslider.version": "Versio {{version}}", "timeslider.version": "Versio {{version}}",
"timeslider.saved": "Tallennettu {{day}}. {{month}}ta {{year}}", "timeslider.saved": "Tallennettu {{day}}. {{month}}ta {{year}}",
"timeslider.dateformat": "{{day}}.{{month}}.{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}}.{{month}}.{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}}.{{month}}.{{year}}",
"timeslider.month.january": "tammikuu", "timeslider.month.january": "tammikuu",
"timeslider.month.february": "helmikuu", "timeslider.month.february": "helmikuu",
"timeslider.month.march": "maaliskuu", "timeslider.month.march": "maaliskuu",

View file

@ -87,6 +87,7 @@
"timeslider.version": "Versi\u00f3n {{version}}", "timeslider.version": "Versi\u00f3n {{version}}",
"timeslider.saved": "Gardado o {{day}} de {{month}} de {{year}}", "timeslider.saved": "Gardado o {{day}} de {{month}} de {{year}}",
"timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}",
"timeslider.month.january": "xaneiro", "timeslider.month.january": "xaneiro",
"timeslider.month.february": "febreiro", "timeslider.month.february": "febreiro",
"timeslider.month.march": "marzo", "timeslider.month.march": "marzo",

View file

@ -86,6 +86,7 @@
"timeslider.version": "\u05d2\u05e8\u05e1\u05d4 {{version}}", "timeslider.version": "\u05d2\u05e8\u05e1\u05d4 {{version}}",
"timeslider.saved": "\u05e0\u05e9\u05de\u05e8\u05d4 \u05d1\u05be{{day}} \u05d1{{month}} {{year}}", "timeslider.saved": "\u05e0\u05e9\u05de\u05e8\u05d4 \u05d1\u05be{{day}} \u05d1{{month}} {{year}}",
"timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{year}}-{{month}}-{{day}}",
"timeslider.month.january": "\u05d9\u05e0\u05d5\u05d0\u05e8", "timeslider.month.january": "\u05d9\u05e0\u05d5\u05d0\u05e8",
"timeslider.month.february": "\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8", "timeslider.month.february": "\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8",
"timeslider.month.march": "\u05de\u05e8\u05e5", "timeslider.month.march": "\u05de\u05e8\u05e5",

View file

@ -87,6 +87,7 @@
"timeslider.version": "{{version}} verzi\u00f3", "timeslider.version": "{{version}} verzi\u00f3",
"timeslider.saved": "{{year}}. {{month}} {{day}}-n elmentve", "timeslider.saved": "{{year}}. {{month}} {{day}}-n elmentve",
"timeslider.dateformat": "{{year}}\/{{month}}\/{{day}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{year}}\/{{month}}\/{{day}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{year}}\/{{month}}\/{{day}}",
"timeslider.month.january": "janu\u00e1r", "timeslider.month.january": "janu\u00e1r",
"timeslider.month.february": "febru\u00e1r", "timeslider.month.february": "febru\u00e1r",
"timeslider.month.march": "m\u00e1rcius", "timeslider.month.march": "m\u00e1rcius",

View file

@ -90,6 +90,7 @@
"timeslider.version": "Versione {{version}}", "timeslider.version": "Versione {{version}}",
"timeslider.saved": "Salvato {{day}} {{month}} {{year}}", "timeslider.saved": "Salvato {{day}} {{month}} {{year}}",
"timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}",
"timeslider.month.january": "gennaio", "timeslider.month.january": "gennaio",
"timeslider.month.february": "febbraio", "timeslider.month.february": "febbraio",
"timeslider.month.march": "marzo", "timeslider.month.march": "marzo",

View file

@ -87,6 +87,7 @@
"timeslider.version": "\u30d0\u30fc\u30b8\u30e7\u30f3 {{version}}", "timeslider.version": "\u30d0\u30fc\u30b8\u30e7\u30f3 {{version}}",
"timeslider.saved": "| {{year}}\u5e74{{month}}{{day}}\u65e5\u306b\u4fdd\u5b58", "timeslider.saved": "| {{year}}\u5e74{{month}}{{day}}\u65e5\u306b\u4fdd\u5b58",
"timeslider.dateformat": "{{year}}\u5e74{{month}}{{day}}\u65e5 {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{year}}\u5e74{{month}}{{day}}\u65e5 {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{year}}\u5e74{{month}}{{day}}\u65e5",
"timeslider.month.january": "1\u6708", "timeslider.month.january": "1\u6708",
"timeslider.month.february": "2\u6708", "timeslider.month.february": "2\u6708",
"timeslider.month.march": "3\u6708", "timeslider.month.march": "3\u6708",

View file

@ -87,6 +87,7 @@
"timeslider.version": "\ubc84\uc804 {{version}}", "timeslider.version": "\ubc84\uc804 {{version}}",
"timeslider.saved": "{{year}}\ub144 {{month}} {{day}}\uc77c\uc5d0 \uc800\uc7a5\ud568", "timeslider.saved": "{{year}}\ub144 {{month}} {{day}}\uc77c\uc5d0 \uc800\uc7a5\ud568",
"timeslider.dateformat": "{{year}}\ub144\/{{month}}\/{{day}}\uc77c {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{year}}\ub144\/{{month}}\/{{day}}\uc77c {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{year}}\ub144\/{{month}}\/{{day}}\uc77c",
"timeslider.month.january": "1\uc6d4", "timeslider.month.january": "1\uc6d4",
"timeslider.month.february": "2\uc6d4", "timeslider.month.february": "2\uc6d4",
"timeslider.month.march": "3\uc6d4", "timeslider.month.march": "3\uc6d4",

View file

@ -80,6 +80,7 @@
"timeslider.version": "V\u00e4sjon {{version}}", "timeslider.version": "V\u00e4sjon {{version}}",
"timeslider.saved": "Fa\u00dfjehallde aam {{day}}. {{month}} {{year}}", "timeslider.saved": "Fa\u00dfjehallde aam {{day}}. {{month}} {{year}}",
"timeslider.dateformat": "amm {{day}}. {{month}} {{year}} \u00f6m {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "amm {{day}}. {{month}} {{year}} \u00f6m {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "amm {{day}}. {{month}} {{year}}",
"timeslider.month.january": "Jannewaa", "timeslider.month.january": "Jannewaa",
"timeslider.month.february": "F\u00e4\u00e4browaa", "timeslider.month.february": "F\u00e4\u00e4browaa",
"timeslider.month.march": "M\u00e4\u00e4z", "timeslider.month.march": "M\u00e4\u00e4z",

View file

@ -88,6 +88,7 @@
"timeslider.version": "\u0412\u0435\u0440\u0437\u0438\u0458\u0430 {{version}}", "timeslider.version": "\u0412\u0435\u0440\u0437\u0438\u0458\u0430 {{version}}",
"timeslider.saved": "\u0417\u0430\u0447\u0443\u0432\u0430\u043d\u043e \u043d\u0430 {{day}} {{month}} {{year}} \u0433.", "timeslider.saved": "\u0417\u0430\u0447\u0443\u0432\u0430\u043d\u043e \u043d\u0430 {{day}} {{month}} {{year}} \u0433.",
"timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}",
"timeslider.month.january": "\u0458\u0430\u043d\u0443\u0430\u0440\u0438", "timeslider.month.january": "\u0458\u0430\u043d\u0443\u0430\u0440\u0438",
"timeslider.month.february": "\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438", "timeslider.month.february": "\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438",
"timeslider.month.march": "\u043c\u0430\u0440\u0442", "timeslider.month.march": "\u043c\u0430\u0440\u0442",

View file

@ -87,6 +87,7 @@
"timeslider.version": "Versi {{version}}", "timeslider.version": "Versi {{version}}",
"timeslider.saved": "Disimpan pada {{day}} {{month}} {{year}}", "timeslider.saved": "Disimpan pada {{day}} {{month}} {{year}}",
"timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}",
"timeslider.month.january": "Januari", "timeslider.month.january": "Januari",
"timeslider.month.february": "Februari", "timeslider.month.february": "Februari",
"timeslider.month.march": "Mac", "timeslider.month.march": "Mac",

View file

@ -87,6 +87,7 @@
"timeslider.version": "Versie {{version}}", "timeslider.version": "Versie {{version}}",
"timeslider.saved": "Opgeslagen op {{day}} {{month}} {{year}}", "timeslider.saved": "Opgeslagen op {{day}} {{month}} {{year}}",
"timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{year}}-{{month}}-{{day}}",
"timeslider.month.january": "januari", "timeslider.month.january": "januari",
"timeslider.month.february": "februari", "timeslider.month.february": "februari",
"timeslider.month.march": "maart", "timeslider.month.march": "maart",

View file

@ -87,6 +87,7 @@
"timeslider.version": "Utg\u00e5ve {{version}}", "timeslider.version": "Utg\u00e5ve {{version}}",
"timeslider.saved": "Lagra {{day}}. {{month}}, {{year}}", "timeslider.saved": "Lagra {{day}}. {{month}}, {{year}}",
"timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}.{{minutes}}.{{seconds}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}.{{minutes}}.{{seconds}}",
"timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}",
"timeslider.month.january": "januar", "timeslider.month.january": "januar",
"timeslider.month.february": "februar", "timeslider.month.february": "februar",
"timeslider.month.march": "mars", "timeslider.month.march": "mars",

View file

@ -89,6 +89,7 @@
"timeslider.version": "Wersja {{version}}", "timeslider.version": "Wersja {{version}}",
"timeslider.saved": "Zapisano {{day}} {{month}} {{year}}", "timeslider.saved": "Zapisano {{day}} {{month}} {{year}}",
"timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{year}}-{{month}}-{{day}}",
"timeslider.month.january": "Stycze\u0144", "timeslider.month.january": "Stycze\u0144",
"timeslider.month.february": "Luty", "timeslider.month.february": "Luty",
"timeslider.month.march": "Marzec", "timeslider.month.march": "Marzec",

View file

@ -85,6 +85,7 @@
"timeslider.version": "Versioni {{version}}", "timeslider.version": "Versioni {{version}}",
"timeslider.saved": "Ruajtur m\u00eb {{month}} {{day}}, {{year}}", "timeslider.saved": "Ruajtur m\u00eb {{month}} {{day}}, {{year}}",
"timeslider.dateformat": "{{month}}\/{{day}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{month}}\/{{day}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{month}}\/{{day}}\/{{year}}",
"timeslider.month.january": "Janar", "timeslider.month.january": "Janar",
"timeslider.month.february": "Shkurt", "timeslider.month.february": "Shkurt",
"timeslider.month.march": "Mars", "timeslider.month.march": "Mars",

View file

@ -87,6 +87,7 @@
"timeslider.version": "Version {{version}}", "timeslider.version": "Version {{version}}",
"timeslider.saved": "Sparades den {{day}} {{month}} {{year}}", "timeslider.saved": "Sparades den {{day}} {{month}} {{year}}",
"timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}",
"timeslider.month.january": "januari", "timeslider.month.january": "januari",
"timeslider.month.february": "februari", "timeslider.month.february": "februari",
"timeslider.month.march": "mars", "timeslider.month.march": "mars",

View file

@ -89,6 +89,7 @@
"timeslider.version": "\u0412\u0435\u0440\u0441\u0456\u044f {{version}}", "timeslider.version": "\u0412\u0435\u0440\u0441\u0456\u044f {{version}}",
"timeslider.saved": "\u0417\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043e {{month}} {{day}}, {{year}}", "timeslider.saved": "\u0417\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043e {{month}} {{day}}, {{year}}",
"timeslider.dateformat": "{{month}}\/{{day}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{month}}\/{{day}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{month}}\/{{day}}\/{{year}}",
"timeslider.month.january": "\u0421\u0456\u0447\u0435\u043d\u044c", "timeslider.month.january": "\u0421\u0456\u0447\u0435\u043d\u044c",
"timeslider.month.february": "\u041b\u044e\u0442\u0438\u0439", "timeslider.month.february": "\u041b\u044e\u0442\u0438\u0439",
"timeslider.month.march": "\u0411\u0435\u0440\u0435\u0437\u0435\u043d\u044c", "timeslider.month.march": "\u0411\u0435\u0440\u0435\u0437\u0435\u043d\u044c",

View file

@ -87,6 +87,7 @@
"timeslider.version": "\u7248\u672c{{version}}", "timeslider.version": "\u7248\u672c{{version}}",
"timeslider.saved": "{{year}}{{month}}{{day}}\u4fdd\u5b58", "timeslider.saved": "{{year}}{{month}}{{day}}\u4fdd\u5b58",
"timeslider.dateformat": "{{year}}{{month}}{{day}} {{hours}}:{{minutes}}:{{seconds}}", "timeslider.dateformat": "{{year}}{{month}}{{day}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.dateonlyformat": "{{year}}{{month}}{{day}}",
"timeslider.month.january": "1\u6708", "timeslider.month.january": "1\u6708",
"timeslider.month.february": "2\u6708", "timeslider.month.february": "2\u6708",
"timeslider.month.march": "3\u6708", "timeslider.month.march": "3\u6708",

View file

@ -575,6 +575,14 @@ table#otheruserstable {
margin-right: 3px; margin-right: 3px;
margin-top: 2px; margin-top: 2px;
} }
.chatDaySeperator
{
text-align:center;
border-bottom: 1px solid #aaa;
line-height:0.85em;
margin:3px 0 5px;
color:#888;
}
.exporttype { .exporttype {
margin-top: 4px; margin-top: 4px;
background-repeat: no-repeat; background-repeat: no-repeat;

View file

@ -25,6 +25,8 @@ var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon'); var Tinycon = require('tinycon/tinycon');
var lastDateStr = null;
var chat = (function() var chat = (function()
{ {
var isStuck = false; var isStuck = false;
@ -84,13 +86,22 @@ var chat = (function()
msg.time += this._pad.clientTimeOffset; msg.time += this._pad.clientTimeOffset;
//create the time string //create the time string
var minutes = "" + new Date(msg.time).getMinutes(); var msgDate = new Date(msg.time);
var hours = "" + new Date(msg.time).getHours(); var minutes = "" + msgDate.getMinutes();
var hours = "" + msgDate.getHours();
var month = "" + (msgDate.getMonth() + 1);
var day = "" + msgDate.getDate();
var year = "" + (msgDate.getYear() + 1900);
if(minutes.length == 1) if(minutes.length == 1)
minutes = "0" + minutes ; minutes = "0" + minutes ;
if(hours.length == 1) if(hours.length == 1)
hours = "0" + hours ; hours = "0" + hours ;
if(month.length == 1)
month = "0" + month ;
if(day.length == 1)
day = "0" + day ;
var timeStr = hours + ":" + minutes; var timeStr = hours + ":" + minutes;
var dateStr = html10n.get('timeslider.dateonlyformat', {month: month, day: day, year: year});
//create the authorclass //create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c) var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
@ -113,11 +124,21 @@ var chat = (function()
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName); var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
<<<<<<< HEAD
var html = "";
if(lastDateStr != null && lastDateStr != dateStr)
html = "<p class='chatDaySeperator'>" + dateStr + "</p>";
html += "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "' title='" + dateStr + "'>" + timeStr + "</span> " + text + "</p>";
$("#chattext").append(html);
=======
var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>"; var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
if(isHistoryAdd) if(isHistoryAdd)
$(html).insertAfter('#chatloadmessagesbutton'); $(html).insertAfter('#chatloadmessagesbutton');
else else
$("#chattext").append(html); $("#chattext").append(html);
>>>>>>> 025c92f3464516f63c942b0dcc9fe4a8dda8e414
lastDateStr = dateStr;
//should we increment the counter?? //should we increment the counter??
if(increment) if(increment)

View file

@ -0,0 +1,210 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var lastDateStr = null;
var chat = (function()
{
var isStuck = false;
var gotInitialMessages = false;
var historyPointer = 0;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment, isHistoryAdd)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var msgDate = new Date(msg.time);
var minutes = "" + msgDate.getMinutes();
var hours = "" + msgDate.getHours();
var month = "" + (msgDate.getMonth() + 1);
var day = "" + msgDate.getDate();
var year = "" + (msgDate.getYear() + 1900);
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
if(month.length == 1)
month = "0" + month ;
if(day.length == 1)
day = "0" + day ;
var timeStr = hours + ":" + minutes;
var dateStr = html10n.get('timeslider.dateonlyformat', {month: month, day: day, year: year});
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
<<<<<<< HEAD
var html = "";
if(lastDateStr != null && lastDateStr != dateStr)
html = "<p class='chatDaySeperator'>" + dateStr + "</p>";
html += "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "' title='" + dateStr + "'>" + timeStr + "</span> " + text + "</p>";
$("#chattext").append(html);
=======
var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
if(isHistoryAdd)
$(html).insertAfter('#chatloadmessagesbutton');
else
$("#chattext").append(html);
>>>>>>> 025c92f3464516f63c942b0dcc9fe4a8dda8e414
lastDateStr = dateStr;
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused && !isHistoryAdd)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
if(!isHistoryAdd)
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
// initial messages are loaded in pad.js' _afterHandshake
$("#chatcounter").text(0);
$("#chatloadmessagesbutton").click(function()
{
var start = Math.max(self.historyPointer - 20, 0);
var end = self.historyPointer;
if(start == end) // nothing to load
return;
$("#chatloadmessagesbutton").css("display", "none");
$("#chatloadmessagesball").css("display", "block");
pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": end});
self.historyPointer = start;
});
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,205 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var lastDateStr = null;
var chat = (function()
{
var isStuck = false;
var gotInitialMessages = false;
var historyPointer = 0;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment, isHistoryAdd)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var msgDate = new Date(msg.time);
var minutes = "" + msgDate.getMinutes();
var hours = "" + msgDate.getHours();
var month = "" + (msgDate.getMonth() + 1);
var day = "" + msgDate.getDate();
var year = "" + (msgDate.getYear() + 1900);
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
if(month.length == 1)
month = "0" + month ;
if(day.length == 1)
day = "0" + day ;
var timeStr = hours + ":" + minutes;
var dateStr = html10n.get('timeslider.dateonlyformat', {month: month, day: day, year: year});
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
var html = "";
if(lastDateStr != null && lastDateStr != dateStr)
html = "<p class='chatDaySeperator'>" + dateStr + "</p>";
html += "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "' title='" + dateStr + "'>" + timeStr + "</span> " + text + "</p>";
if(isHistoryAdd)
$(html).insertAfter('#chatloadmessagesbutton');
else
$("#chattext").append(html);
lastDateStr = dateStr;
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused && !isHistoryAdd)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
if(!isHistoryAdd)
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
// initial messages are loaded in pad.js' _afterHandshake
$("#chatcounter").text(0);
$("#chatloadmessagesbutton").click(function()
{
var start = Math.max(self.historyPointer - 20, 0);
var end = self.historyPointer;
if(start == end) // nothing to load
return;
$("#chatloadmessagesbutton").css("display", "none");
$("#chatloadmessagesball").css("display", "block");
pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": end});
self.historyPointer = start;
});
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,210 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var lastDateStr = null;
var chat = (function()
{
var isStuck = false;
var gotInitialMessages = false;
var historyPointer = 0;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment, isHistoryAdd)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var msgDate = new Date(msg.time);
var minutes = "" + msgDate.getMinutes();
var hours = "" + msgDate.getHours();
var month = "" + (msgDate.getMonth() + 1);
var day = "" + msgDate.getDate();
var year = "" + (msgDate.getYear() + 1900);
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
if(month.length == 1)
month = "0" + month ;
if(day.length == 1)
day = "0" + day ;
var timeStr = hours + ":" + minutes;
var dateStr = html10n.get('timeslider.dateonlyformat', {month: month, day: day, year: year});
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
<<<<<<< HEAD
var html = "";
if(lastDateStr != null && lastDateStr != dateStr)
html = "<p class='chatDaySeperator'>" + dateStr + "</p>";
html += "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "' title='" + dateStr + "'>" + timeStr + "</span> " + text + "</p>";
$("#chattext").append(html);
=======
var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
if(isHistoryAdd)
$(html).insertAfter('#chatloadmessagesbutton');
else
$("#chattext").append(html);
>>>>>>> 025c92f3464516f63c942b0dcc9fe4a8dda8e414
lastDateStr = dateStr;
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused && !isHistoryAdd)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
if(!isHistoryAdd)
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
// initial messages are loaded in pad.js' _afterHandshake
$("#chatcounter").text(0);
$("#chatloadmessagesbutton").click(function()
{
var start = Math.max(self.historyPointer - 20, 0);
var end = self.historyPointer;
if(start == end) // nothing to load
return;
$("#chatloadmessagesbutton").css("display", "none");
$("#chatloadmessagesball").css("display", "block");
pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": end});
self.historyPointer = start;
});
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,173 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var chat = (function()
{
var isStuck = false;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var minutes = "" + new Date(msg.time).getMinutes();
var hours = "" + new Date(msg.time).getHours();
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
var timeStr = hours + ":" + minutes;
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
$("#chattext").append(html);
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
var that = this;
$.each(clientVars.chatHistory, function(i, o){
that.addMessage(o, false);
})
$("#chatcounter").text(clientVars.chatHistory.length);
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,173 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var chat = (function()
{
var isStuck = false;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var minutes = "" + new Date(msg.time).getMinutes();
var hours = "" + new Date(msg.time).getHours();
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
var timeStr = hours + ":" + minutes;
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
$("#chattext").append(html);
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
var that = this;
$.each(clientVars.chatHistory, function(i, o){
that.addMessage(o, false);
})
$("#chatcounter").text(clientVars.chatHistory.length);
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,173 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var chat = (function()
{
var isStuck = false;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var minutes = "" + new Date(msg.time).getMinutes();
var hours = "" + new Date(msg.time).getHours();
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
var timeStr = hours + ":" + minutes;
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
$("#chattext").append(html);
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
var that = this;
$.each(clientVars.chatHistory, function(i, o){
that.addMessage(o, false);
})
$("#chatcounter").text(clientVars.chatHistory.length);
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,189 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var lastDateStr = null;
var chat = (function()
{
var isStuck = false;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var msgDate = new Date(msg.time);
var minutes = "" + msgDate.getMinutes();
var hours = "" + msgDate.getHours();
var month = "" + (msgDate.getMonth() + 1);
var day = "" + msgDate.getDate();
var year = "" + (msgDate.getYear() + 1900);
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
if(month.length == 1)
month = "0" + month ;
if(day.length == 1)
day = "0" + day ;
var timeStr = hours + ":" + minutes;
var dateStr = html10n.get('timeslider.dateonlyformat', {month: month, day: day, year: year});
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
var html = "";
if(lastDateStr != null && lastDateStr != dateStr)
html = "<p class='chatDaySeperator'>" + dateStr + "</p>";
html += "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "' title='" + dateStr + "'>" + timeStr + "</span> " + text + "</p>";
$("#chattext").append(html);
lastDateStr = dateStr;
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
var that = this;
$.each(clientVars.chatHistory, function(i, o){
that.addMessage(o, false);
})
$("#chatcounter").text(clientVars.chatHistory.length);
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,189 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var lastDateStr = null;
var chat = (function()
{
var isStuck = false;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var msgDate = new Date(msg.time);
var minutes = "" + msgDate.getMinutes();
var hours = "" + msgDate.getHours();
var month = "" + (msgDate.getMonth() + 1);
var day = "" + msgDate.getDate();
var year = "" + (msgDate.getYear() + 1900);
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
if(month.length == 1)
month = "0" + month ;
if(day.length == 1)
day = "0" + day ;
var timeStr = hours + ":" + minutes;
var dateStr = html10n.get('timeslider.dateonlyformat', {month: month, day: day, year: year});
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
var html = "";
if(lastDateStr != null && lastDateStr != dateStr)
html = "<p class='chatDaySeperator'>" + dateStr + "</p>";
html += "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "' title='" + dateStr + "'>" + timeStr + "</span> " + text + "</p>";
$("#chattext").append(html);
lastDateStr = dateStr;
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
var that = this;
$.each(clientVars.chatHistory, function(i, o){
that.addMessage(o, false);
})
$("#chatcounter").text(clientVars.chatHistory.length);
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,189 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var lastDateStr = null;
var chat = (function()
{
var isStuck = false;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var msgDate = new Date(msg.time);
var minutes = "" + msgDate.getMinutes();
var hours = "" + msgDate.getHours();
var month = "" + (msgDate.getMonth() + 1);
var day = "" + msgDate.getDate();
var year = "" + (msgDate.getYear() + 1900);
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
if(month.length == 1)
month = "0" + month ;
if(day.length == 1)
day = "0" + day ;
var timeStr = hours + ":" + minutes;
var dateStr = html10n.get('timeslider.dateonlyformat', {month: month, day: day, year: year});
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
var html = "";
if(lastDateStr != null && lastDateStr != dateStr)
html = "<p class='chatDaySeperator'>" + dateStr + "</p>";
html += "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "' title='" + dateStr + "'>" + timeStr + "</span> " + text + "</p>";
$("#chattext").append(html);
lastDateStr = dateStr;
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
var that = this;
$.each(clientVars.chatHistory, function(i, o){
that.addMessage(o, false);
})
$("#chatcounter").text(clientVars.chatHistory.length);
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,189 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var chat = (function()
{
var isStuck = false;
var gotInitialMessages = false;
var historyPointer = 0;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment, isHistoryAdd)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var minutes = "" + new Date(msg.time).getMinutes();
var hours = "" + new Date(msg.time).getHours();
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
var timeStr = hours + ":" + minutes;
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
if(isHistoryAdd)
$(html).insertAfter('#chatloadmessagesbutton');
else
$("#chattext").append(html);
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused && !isHistoryAdd)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
if(!isHistoryAdd)
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
// initial messages are loaded in pad.js' _afterHandshake
$("#chatcounter").text(0);
$("#chatloadmessagesbutton").click(function()
{
var start = Math.max(self.historyPointer - 20, 0);
var end = self.historyPointer;
if(start == end) // nothing to load
return;
$("#chatloadmessagesbutton").css("display", "none");
$("#chatloadmessagesball").css("display", "block");
pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": end});
self.historyPointer = start;
});
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,189 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var chat = (function()
{
var isStuck = false;
var gotInitialMessages = false;
var historyPointer = 0;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment, isHistoryAdd)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var minutes = "" + new Date(msg.time).getMinutes();
var hours = "" + new Date(msg.time).getHours();
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
var timeStr = hours + ":" + minutes;
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
if(isHistoryAdd)
$(html).insertAfter('#chatloadmessagesbutton');
else
$("#chattext").append(html);
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused && !isHistoryAdd)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
if(!isHistoryAdd)
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
// initial messages are loaded in pad.js' _afterHandshake
$("#chatcounter").text(0);
$("#chatloadmessagesbutton").click(function()
{
var start = Math.max(self.historyPointer - 20, 0);
var end = self.historyPointer;
if(start == end) // nothing to load
return;
$("#chatloadmessagesbutton").css("display", "none");
$("#chatloadmessagesball").css("display", "block");
pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": end});
self.historyPointer = start;
});
}
}
return self;
}());
exports.chat = chat;

View file

@ -0,0 +1,189 @@
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var padutils = require('./pad_utils').padutils;
var padcookie = require('./pad_cookie').padcookie;
var Tinycon = require('tinycon/tinycon');
var chat = (function()
{
var isStuck = false;
var gotInitialMessages = false;
var historyPointer = 0;
var chatMentions = 0;
var self = {
show: function ()
{
$("#chaticon").hide();
$("#chatbox").show();
self.scrollDown();
chatMentions = 0;
Tinycon.setBubble(0);
},
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
{
chat.show();
if(!isStuck || fromInitialCall) { // Stick it to
padcookie.setPref("chatAlwaysVisible", true);
$('#chatbox').addClass("stickyChat");
$('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true;
} else { // Unstick it
padcookie.setPref("chatAlwaysVisible", false);
$('#chatbox').removeClass("stickyChat");
$('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"});
isStuck = false;
}
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
},
scrollDown: function()
{
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},
send: function()
{
var text = $("#chatinput").val();
this._pad.collabClient.sendMessage({"type": "CHAT_MESSAGE", "text": text});
$("#chatinput").val("");
},
addMessage: function(msg, increment, isHistoryAdd)
{
//correct the time
msg.time += this._pad.clientTimeOffset;
//create the time string
var minutes = "" + new Date(msg.time).getMinutes();
var hours = "" + new Date(msg.time).getHours();
if(minutes.length == 1)
minutes = "0" + minutes ;
if(hours.length == 1)
hours = "0" + hours ;
var timeStr = hours + ":" + minutes;
//create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
var text = padutils.escapeHtmlWithClickableLinks(msg.text, "_blank");
/* Performs an action if your name is mentioned */
var myName = $('#myusernameedit').val();
myName = myName.toLowerCase();
var chatText = text.toLowerCase();
var wasMentioned = false;
if (chatText.indexOf(myName) !== -1 && myName != "undefined"){
wasMentioned = true;
}
/* End of new action */
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
if(isHistoryAdd)
$(html).insertAfter('#chatloadmessagesbutton');
else
$("#chattext").append(html);
//should we increment the counter??
if(increment)
{
var count = Number($("#chatcounter").text());
count++;
// is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus");
$("#chatcounter").text(count);
// chat throb stuff -- Just make it throw for twice as long
if(wasMentioned && !alreadyFocused && !isHistoryAdd)
{ // If the user was mentioned show for twice as long and flash the browser window
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(4000).hide(400);
chatMentions++;
Tinycon.setBubble(chatMentions);
}
else
{
$('#chatthrob').html("<b>"+authorName+"</b>" + ": " + text).show().delay(2000).hide(400);
}
}
// Clear the chat mentions when the user clicks on the chat input box
$('#chatinput').click(function(){
chatMentions = 0;
Tinycon.setBubble(0);
});
if(!isHistoryAdd)
self.scrollDown();
},
init: function(pad)
{
this._pad = pad;
$("#chatinput").keypress(function(evt)
{
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)
{
evt.preventDefault();
self.send();
}
});
// initial messages are loaded in pad.js' _afterHandshake
$("#chatcounter").text(0);
$("#chatloadmessagesbutton").click(function()
{
var start = Math.max(self.historyPointer - 20, 0);
var end = self.historyPointer;
if(start == end) // nothing to load
return;
$("#chatloadmessagesbutton").css("display", "none");
$("#chatloadmessagesball").css("display", "block");
pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": end});
self.historyPointer = start;
});
}
}
return self;
}());
exports.chat = chat;