diff --git a/src/locales/af.json b/src/locales/af.json index 979a823d2..042d03eab 100644 --- a/src/locales/af.json +++ b/src/locales/af.json @@ -43,6 +43,7 @@ "timeslider.version": "Weergawe {{version}}", "timeslider.saved": "Gestoor op {{day}} {{month}} {{year}}", "timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{year}}-{{month}}-{{day}}", "timeslider.month.january": "Januarie", "timeslider.month.february": "Februarie", "timeslider.month.march": "Maart", diff --git a/src/locales/ast.json b/src/locales/ast.json index 1437d8698..9385ccda0 100644 --- a/src/locales/ast.json +++ b/src/locales/ast.json @@ -87,6 +87,7 @@ "timeslider.version": "Versi\u00f3n {{version}}", "timeslider.saved": "Guard\u00e1u el {{day}} de {{month}} de {{year}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}", "timeslider.month.january": "de xineru", "timeslider.month.february": "de febreru", "timeslider.month.march": "de marzu", diff --git a/src/locales/cs.json b/src/locales/cs.json index bf415f232..23f82b428 100644 --- a/src/locales/cs.json +++ b/src/locales/cs.json @@ -84,6 +84,7 @@ "timeslider.version": "Verze {{version}}", "timeslider.saved": "Ulo\u017eeno {{day}} {{month}} {{year}}", "timeslider.dateformat": "{{day}} {{month}} {{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}} {{month}} {{year}}", "timeslider.month.january": "leden", "timeslider.month.february": "\u00fanor", "timeslider.month.march": "b\u0159ezen", diff --git a/src/locales/da.json b/src/locales/da.json index 3e785b585..de41986e4 100644 --- a/src/locales/da.json +++ b/src/locales/da.json @@ -87,6 +87,7 @@ "timeslider.version": "Version {{version}}", "timeslider.saved": "Gemt den {{day}}.{{month}} {{year}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}", "timeslider.month.january": "januar", "timeslider.month.february": "februar", "timeslider.month.march": "marts", diff --git a/src/locales/de.json b/src/locales/de.json index 1bdbdaf3d..ddd35c7e2 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -91,6 +91,7 @@ "timeslider.version": "Version {{version}}", "timeslider.saved": "Gespeichert am {{day}}.{{month}}.{{year}}", "timeslider.dateformat": "{{day}}.{{month}}.{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}}.{{month}}.{{year}}", "timeslider.month.january": "Januar", "timeslider.month.february": "Februar", "timeslider.month.march": "M\u00e4rz", diff --git a/src/locales/diq.json b/src/locales/diq.json index 62079d78b..33d75d1a0 100644 --- a/src/locales/diq.json +++ b/src/locales/diq.json @@ -61,6 +61,7 @@ "timeslider.version": "Versiyon\u00ea {{version}}", "timeslider.saved": "{{day}} {{month}}, {{year}} de biyo qeyd", "timeslider.dateformat": "{{month}}\/{{day}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{month}}\/{{day}}\/{{year}}", "timeslider.month.january": "\u00c7ele", "timeslider.month.february": "\u015e\u0131bate", "timeslider.month.march": "Adar", diff --git a/src/locales/en.json b/src/locales/en.json index 37e07a154..48b6904e1 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1 +1,5 @@ -{"index.newPad":"New Pad","index.createOpenPad":"or create/open a Pad with the name:","pad.toolbar.bold.title":"Bold (Ctrl-B)","pad.toolbar.italic.title":"Italic (Ctrl-I)","pad.toolbar.underline.title":"Underline (Ctrl-U)","pad.toolbar.strikethrough.title":"Strikethrough","pad.toolbar.ol.title":"Ordered list","pad.toolbar.ul.title":"Unordered List","pad.toolbar.indent.title":"Indent","pad.toolbar.unindent.title":"Outdent","pad.toolbar.undo.title":"Undo (Ctrl-Z)","pad.toolbar.redo.title":"Redo (Ctrl-Y)","pad.toolbar.clearAuthorship.title":"Clear Authorship Colors","pad.toolbar.import_export.title":"Import/Export from/to different file formats","pad.toolbar.timeslider.title":"Timeslider","pad.toolbar.savedRevision.title":"Saved Revisions","pad.toolbar.settings.title":"Settings","pad.toolbar.embed.title":"Embed this pad","pad.toolbar.showusers.title":"Show the users on this pad","pad.colorpicker.save":"Save","pad.colorpicker.cancel":"Cancel","pad.loading":"Loading...","pad.passwordRequired":"You need a password to access this pad","pad.permissionDenied":"You do not have permission to access this pad","pad.wrongPassword":"Your password was wrong","pad.settings.padSettings":"Pad Settings","pad.settings.myView":"My View","pad.settings.stickychat":"Chat always on screen","pad.settings.colorcheck":"Authorship colors","pad.settings.linenocheck":"Line numbers","pad.settings.fontType":"Font type:","pad.settings.fontType.normal":"Normal","pad.settings.fontType.monospaced":"Monospace","pad.settings.globalView":"Global View","pad.settings.language":"Language:","pad.importExport.import_export":"Import/Export","pad.importExport.import":"Upload any text file or document","pad.importExport.importSuccessful":"Successful!","pad.importExport.export":"Export current pad as:","pad.importExport.exporthtml":"HTML","pad.importExport.exportplain":"Plain text","pad.importExport.exportword":"Microsoft Word","pad.importExport.exportpdf":"PDF","pad.importExport.exportopen":"ODF (Open Document Format)","pad.importExport.exportdokuwiki":"DokuWiki","pad.importExport.abiword.innerHTML":"You only can import from plain text or html formats. For more advanced import features please install abiword.","pad.modals.connected":"Connected.","pad.modals.reconnecting":"Reconnecting to your pad..","pad.modals.forcereconnect":"Force reconnect","pad.modals.userdup":"Opened in another window","pad.modals.userdup.explanation":"This pad seems to be opened in more than one browser window on this computer.","pad.modals.userdup.advice":"Reconnect to use this window instead.","pad.modals.unauth":"Not authorized","pad.modals.unauth.explanation":"Your permissions have changed while viewing this page. Try to reconnect.","pad.modals.looping":"Disconnected.","pad.modals.looping.explanation":"There are communication problems with the synchronization server.","pad.modals.looping.cause":"Perhaps you connected through an incompatible firewall or proxy.","pad.modals.initsocketfail":"Server is unreachable.","pad.modals.initsocketfail.explanation":"Couldn't connect to the synchronization server.","pad.modals.initsocketfail.cause":"This is probably due to a problem with your browser or your internet connection.","pad.modals.slowcommit":"Disconnected.","pad.modals.slowcommit.explanation":"The server is not responding.","pad.modals.slowcommit.cause":"This could be due to problems with network connectivity.","pad.modals.deleted":"Deleted.","pad.modals.deleted.explanation":"This pad has been removed.","pad.modals.disconnected":"You have been disconnected.","pad.modals.disconnected.explanation":"The connection to the server was lost","pad.modals.disconnected.cause":"The server may be unavailable. Please notify us if this continues to happen.","pad.share":"Share this pad","pad.share.readonly":"Read only","pad.share.link":"Link","pad.share.emebdcode":"Embed URL","pad.chat":"Chat","pad.chat.title":"Open the chat for this pad.","pad.chat.loadmessages": "Load more messages","timeslider.pageTitle":"{{appTitle}} Timeslider","timeslider.toolbar.returnbutton":"Return to pad","timeslider.toolbar.authors":"Authors:","timeslider.toolbar.authorsList":"No Authors","timeslider.toolbar.exportlink.title":"Export","timeslider.exportCurrent":"Export current version as:","timeslider.version":"Version {{version}}","timeslider.saved":"Saved {{month}} {{day}}, {{year}}","timeslider.dateformat":"{{month}}/{{day}}/{{year}} {{hours}}:{{minutes}}:{{seconds}}","timeslider.month.january":"January","timeslider.month.february":"February","timeslider.month.march":"March","timeslider.month.april":"April","timeslider.month.may":"May","timeslider.month.june":"June","timeslider.month.july":"July","timeslider.month.august":"August","timeslider.month.september":"September","timeslider.month.october":"October","timeslider.month.november":"November","timeslider.month.december":"December","pad.savedrevs.marked":"This revision is now marked as a saved revision","pad.userlist.entername":"Enter your name","pad.userlist.unnamed":"unnamed","pad.userlist.guest":"Guest","pad.userlist.deny":"Deny","pad.userlist.approve":"Approve","pad.editbar.clearcolors":"Clear authorship colors on entire document?","pad.impexp.importbutton":"Import Now","pad.impexp.importing":"Importing...","pad.impexp.confirmimport":"Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?","pad.impexp.convertFailed":"We were not able to import this file. Please use a different document format or copy paste manually","pad.impexp.uploadFailed":"The upload failed, please try again","pad.impexp.importfailed":"Import failed","pad.impexp.copypaste":"Please copy paste","pad.impexp.exportdisabled":"Exporting as {{type}} format is disabled. Please contact your system administrator for details."} \ No newline at end of file +<<<<<<< HEAD +{"index.newPad":"New Pad","index.createOpenPad":"or create/open a Pad with the name:","pad.toolbar.bold.title":"Bold (Ctrl-B)","pad.toolbar.italic.title":"Italic (Ctrl-I)","pad.toolbar.underline.title":"Underline (Ctrl-U)","pad.toolbar.strikethrough.title":"Strikethrough","pad.toolbar.ol.title":"Ordered list","pad.toolbar.ul.title":"Unordered List","pad.toolbar.indent.title":"Indent","pad.toolbar.unindent.title":"Outdent","pad.toolbar.undo.title":"Undo (Ctrl-Z)","pad.toolbar.redo.title":"Redo (Ctrl-Y)","pad.toolbar.clearAuthorship.title":"Clear Authorship Colors","pad.toolbar.import_export.title":"Import/Export from/to different file formats","pad.toolbar.timeslider.title":"Timeslider","pad.toolbar.savedRevision.title":"Saved Revisions","pad.toolbar.settings.title":"Settings","pad.toolbar.embed.title":"Embed this pad","pad.toolbar.showusers.title":"Show the users on this pad","pad.colorpicker.save":"Save","pad.colorpicker.cancel":"Cancel","pad.loading":"Loading...","pad.passwordRequired":"You need a password to access this pad","pad.permissionDenied":"You do not have permission to access this pad","pad.wrongPassword":"Your password was wrong","pad.settings.padSettings":"Pad Settings","pad.settings.myView":"My View","pad.settings.stickychat":"Chat always on screen","pad.settings.colorcheck":"Authorship colors","pad.settings.linenocheck":"Line numbers","pad.settings.fontType":"Font type:","pad.settings.fontType.normal":"Normal","pad.settings.fontType.monospaced":"Monospace","pad.settings.globalView":"Global View","pad.settings.language":"Language:","pad.importExport.import_export":"Import/Export","pad.importExport.import":"Upload any text file or document","pad.importExport.importSuccessful":"Successful!","pad.importExport.export":"Export current pad as:","pad.importExport.exporthtml":"HTML","pad.importExport.exportplain":"Plain text","pad.importExport.exportword":"Microsoft Word","pad.importExport.exportpdf":"PDF","pad.importExport.exportopen":"ODF (Open Document Format)","pad.importExport.exportdokuwiki":"DokuWiki","pad.importExport.abiword.innerHTML":"You only can import from plain text or html formats. For more advanced import features please install abiword.","pad.modals.connected":"Connected.","pad.modals.reconnecting":"Reconnecting to your pad..","pad.modals.forcereconnect":"Force reconnect","pad.modals.userdup":"Opened in another window","pad.modals.userdup.explanation":"This pad seems to be opened in more than one browser window on this computer.","pad.modals.userdup.advice":"Reconnect to use this window instead.","pad.modals.unauth":"Not authorized","pad.modals.unauth.explanation":"Your permissions have changed while viewing this page. Try to reconnect.","pad.modals.looping":"Disconnected.","pad.modals.looping.explanation":"There are communication problems with the synchronization server.","pad.modals.looping.cause":"Perhaps you connected through an incompatible firewall or proxy.","pad.modals.initsocketfail":"Server is unreachable.","pad.modals.initsocketfail.explanation":"Couldn't connect to the synchronization server.","pad.modals.initsocketfail.cause":"This is probably due to a problem with your browser or your internet connection.","pad.modals.slowcommit":"Disconnected.","pad.modals.slowcommit.explanation":"The server is not responding.","pad.modals.slowcommit.cause":"This could be due to problems with network connectivity.","pad.modals.deleted":"Deleted.","pad.modals.deleted.explanation":"This pad has been removed.","pad.modals.disconnected":"You have been disconnected.","pad.modals.disconnected.explanation":"The connection to the server was lost","pad.modals.disconnected.cause":"The server may be unavailable. Please notify us if this continues to happen.","pad.share":"Share this pad","pad.share.readonly":"Read only","pad.share.link":"Link","pad.share.emebdcode":"Embed URL","pad.chat":"Chat","pad.chat.title":"Open the chat for this pad.","timeslider.pageTitle":"{{appTitle}} Timeslider","timeslider.toolbar.returnbutton":"Return to pad","timeslider.toolbar.authors":"Authors:","timeslider.toolbar.authorsList":"No Authors","timeslider.toolbar.exportlink.title":"Export","timeslider.exportCurrent":"Export current version as:","timeslider.version":"Version {{version}}","timeslider.saved":"Saved {{month}} {{day}}, {{year}}","timeslider.dateformat":"{{month}}/{{day}}/{{year}} {{hours}}:{{minutes}}:{{seconds}}","timeslider.dateonlyformat":"{{month}}/{{day}}/{{year}}","timeslider.month.january":"January","timeslider.month.february":"February","timeslider.month.march":"March","timeslider.month.april":"April","timeslider.month.may":"May","timeslider.month.june":"June","timeslider.month.july":"July","timeslider.month.august":"August","timeslider.month.september":"September","timeslider.month.october":"October","timeslider.month.november":"November","timeslider.month.december":"December","pad.savedrevs.marked":"This revision is now marked as a saved revision","pad.userlist.entername":"Enter your name","pad.userlist.unnamed":"unnamed","pad.userlist.guest":"Guest","pad.userlist.deny":"Deny","pad.userlist.approve":"Approve","pad.editbar.clearcolors":"Clear authorship colors on entire document?","pad.impexp.importbutton":"Import Now","pad.impexp.importing":"Importing...","pad.impexp.confirmimport":"Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?","pad.impexp.convertFailed":"We were not able to import this file. Please use a different document format or copy paste manually","pad.impexp.uploadFailed":"The upload failed, please try again","pad.impexp.importfailed":"Import failed","pad.impexp.copypaste":"Please copy paste","pad.impexp.exportdisabled":"Exporting as {{type}} format is disabled. Please contact your system administrator for details."} +======= +{"index.newPad":"New Pad","index.createOpenPad":"or create/open a Pad with the name:","pad.toolbar.bold.title":"Bold (Ctrl-B)","pad.toolbar.italic.title":"Italic (Ctrl-I)","pad.toolbar.underline.title":"Underline (Ctrl-U)","pad.toolbar.strikethrough.title":"Strikethrough","pad.toolbar.ol.title":"Ordered list","pad.toolbar.ul.title":"Unordered List","pad.toolbar.indent.title":"Indent","pad.toolbar.unindent.title":"Outdent","pad.toolbar.undo.title":"Undo (Ctrl-Z)","pad.toolbar.redo.title":"Redo (Ctrl-Y)","pad.toolbar.clearAuthorship.title":"Clear Authorship Colors","pad.toolbar.import_export.title":"Import/Export from/to different file formats","pad.toolbar.timeslider.title":"Timeslider","pad.toolbar.savedRevision.title":"Saved Revisions","pad.toolbar.settings.title":"Settings","pad.toolbar.embed.title":"Embed this pad","pad.toolbar.showusers.title":"Show the users on this pad","pad.colorpicker.save":"Save","pad.colorpicker.cancel":"Cancel","pad.loading":"Loading...","pad.passwordRequired":"You need a password to access this pad","pad.permissionDenied":"You do not have permission to access this pad","pad.wrongPassword":"Your password was wrong","pad.settings.padSettings":"Pad Settings","pad.settings.myView":"My View","pad.settings.stickychat":"Chat always on screen","pad.settings.colorcheck":"Authorship colors","pad.settings.linenocheck":"Line numbers","pad.settings.fontType":"Font type:","pad.settings.fontType.normal":"Normal","pad.settings.fontType.monospaced":"Monospace","pad.settings.globalView":"Global View","pad.settings.language":"Language:","pad.importExport.import_export":"Import/Export","pad.importExport.import":"Upload any text file or document","pad.importExport.importSuccessful":"Successful!","pad.importExport.export":"Export current pad as:","pad.importExport.exporthtml":"HTML","pad.importExport.exportplain":"Plain text","pad.importExport.exportword":"Microsoft Word","pad.importExport.exportpdf":"PDF","pad.importExport.exportopen":"ODF (Open Document Format)","pad.importExport.exportdokuwiki":"DokuWiki","pad.importExport.abiword.innerHTML":"You only can import from plain text or html formats. For more advanced import features please install abiword.","pad.modals.connected":"Connected.","pad.modals.reconnecting":"Reconnecting to your pad..","pad.modals.forcereconnect":"Force reconnect","pad.modals.userdup":"Opened in another window","pad.modals.userdup.explanation":"This pad seems to be opened in more than one browser window on this computer.","pad.modals.userdup.advice":"Reconnect to use this window instead.","pad.modals.unauth":"Not authorized","pad.modals.unauth.explanation":"Your permissions have changed while viewing this page. Try to reconnect.","pad.modals.looping":"Disconnected.","pad.modals.looping.explanation":"There are communication problems with the synchronization server.","pad.modals.looping.cause":"Perhaps you connected through an incompatible firewall or proxy.","pad.modals.initsocketfail":"Server is unreachable.","pad.modals.initsocketfail.explanation":"Couldn't connect to the synchronization server.","pad.modals.initsocketfail.cause":"This is probably due to a problem with your browser or your internet connection.","pad.modals.slowcommit":"Disconnected.","pad.modals.slowcommit.explanation":"The server is not responding.","pad.modals.slowcommit.cause":"This could be due to problems with network connectivity.","pad.modals.deleted":"Deleted.","pad.modals.deleted.explanation":"This pad has been removed.","pad.modals.disconnected":"You have been disconnected.","pad.modals.disconnected.explanation":"The connection to the server was lost","pad.modals.disconnected.cause":"The server may be unavailable. Please notify us if this continues to happen.","pad.share":"Share this pad","pad.share.readonly":"Read only","pad.share.link":"Link","pad.share.emebdcode":"Embed URL","pad.chat":"Chat","pad.chat.title":"Open the chat for this pad.","pad.chat.loadmessages": "Load more messages","timeslider.pageTitle":"{{appTitle}} Timeslider","timeslider.toolbar.returnbutton":"Return to pad","timeslider.toolbar.authors":"Authors:","timeslider.toolbar.authorsList":"No Authors","timeslider.toolbar.exportlink.title":"Export","timeslider.exportCurrent":"Export current version as:","timeslider.version":"Version {{version}}","timeslider.saved":"Saved {{month}} {{day}}, {{year}}","timeslider.dateformat":"{{month}}/{{day}}/{{year}} {{hours}}:{{minutes}}:{{seconds}}","timeslider.month.january":"January","timeslider.month.february":"February","timeslider.month.march":"March","timeslider.month.april":"April","timeslider.month.may":"May","timeslider.month.june":"June","timeslider.month.july":"July","timeslider.month.august":"August","timeslider.month.september":"September","timeslider.month.october":"October","timeslider.month.november":"November","timeslider.month.december":"December","pad.savedrevs.marked":"This revision is now marked as a saved revision","pad.userlist.entername":"Enter your name","pad.userlist.unnamed":"unnamed","pad.userlist.guest":"Guest","pad.userlist.deny":"Deny","pad.userlist.approve":"Approve","pad.editbar.clearcolors":"Clear authorship colors on entire document?","pad.impexp.importbutton":"Import Now","pad.impexp.importing":"Importing...","pad.impexp.confirmimport":"Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?","pad.impexp.convertFailed":"We were not able to import this file. Please use a different document format or copy paste manually","pad.impexp.uploadFailed":"The upload failed, please try again","pad.impexp.importfailed":"Import failed","pad.impexp.copypaste":"Please copy paste","pad.impexp.exportdisabled":"Exporting as {{type}} format is disabled. Please contact your system administrator for details."} +>>>>>>> 025c92f3464516f63c942b0dcc9fe4a8dda8e414 diff --git a/src/locales/en.json.orig b/src/locales/en.json.orig new file mode 100644 index 000000000..48b6904e1 --- /dev/null +++ b/src/locales/en.json.orig @@ -0,0 +1,5 @@ +<<<<<<< HEAD +{"index.newPad":"New Pad","index.createOpenPad":"or create/open a Pad with the name:","pad.toolbar.bold.title":"Bold (Ctrl-B)","pad.toolbar.italic.title":"Italic (Ctrl-I)","pad.toolbar.underline.title":"Underline (Ctrl-U)","pad.toolbar.strikethrough.title":"Strikethrough","pad.toolbar.ol.title":"Ordered list","pad.toolbar.ul.title":"Unordered List","pad.toolbar.indent.title":"Indent","pad.toolbar.unindent.title":"Outdent","pad.toolbar.undo.title":"Undo (Ctrl-Z)","pad.toolbar.redo.title":"Redo (Ctrl-Y)","pad.toolbar.clearAuthorship.title":"Clear Authorship Colors","pad.toolbar.import_export.title":"Import/Export from/to different file formats","pad.toolbar.timeslider.title":"Timeslider","pad.toolbar.savedRevision.title":"Saved Revisions","pad.toolbar.settings.title":"Settings","pad.toolbar.embed.title":"Embed this pad","pad.toolbar.showusers.title":"Show the users on this pad","pad.colorpicker.save":"Save","pad.colorpicker.cancel":"Cancel","pad.loading":"Loading...","pad.passwordRequired":"You need a password to access this pad","pad.permissionDenied":"You do not have permission to access this pad","pad.wrongPassword":"Your password was wrong","pad.settings.padSettings":"Pad Settings","pad.settings.myView":"My View","pad.settings.stickychat":"Chat always on screen","pad.settings.colorcheck":"Authorship colors","pad.settings.linenocheck":"Line numbers","pad.settings.fontType":"Font type:","pad.settings.fontType.normal":"Normal","pad.settings.fontType.monospaced":"Monospace","pad.settings.globalView":"Global View","pad.settings.language":"Language:","pad.importExport.import_export":"Import/Export","pad.importExport.import":"Upload any text file or document","pad.importExport.importSuccessful":"Successful!","pad.importExport.export":"Export current pad as:","pad.importExport.exporthtml":"HTML","pad.importExport.exportplain":"Plain text","pad.importExport.exportword":"Microsoft Word","pad.importExport.exportpdf":"PDF","pad.importExport.exportopen":"ODF (Open Document Format)","pad.importExport.exportdokuwiki":"DokuWiki","pad.importExport.abiword.innerHTML":"You only can import from plain text or html formats. For more advanced import features please install abiword.","pad.modals.connected":"Connected.","pad.modals.reconnecting":"Reconnecting to your pad..","pad.modals.forcereconnect":"Force reconnect","pad.modals.userdup":"Opened in another window","pad.modals.userdup.explanation":"This pad seems to be opened in more than one browser window on this computer.","pad.modals.userdup.advice":"Reconnect to use this window instead.","pad.modals.unauth":"Not authorized","pad.modals.unauth.explanation":"Your permissions have changed while viewing this page. Try to reconnect.","pad.modals.looping":"Disconnected.","pad.modals.looping.explanation":"There are communication problems with the synchronization server.","pad.modals.looping.cause":"Perhaps you connected through an incompatible firewall or proxy.","pad.modals.initsocketfail":"Server is unreachable.","pad.modals.initsocketfail.explanation":"Couldn't connect to the synchronization server.","pad.modals.initsocketfail.cause":"This is probably due to a problem with your browser or your internet connection.","pad.modals.slowcommit":"Disconnected.","pad.modals.slowcommit.explanation":"The server is not responding.","pad.modals.slowcommit.cause":"This could be due to problems with network connectivity.","pad.modals.deleted":"Deleted.","pad.modals.deleted.explanation":"This pad has been removed.","pad.modals.disconnected":"You have been disconnected.","pad.modals.disconnected.explanation":"The connection to the server was lost","pad.modals.disconnected.cause":"The server may be unavailable. Please notify us if this continues to happen.","pad.share":"Share this pad","pad.share.readonly":"Read only","pad.share.link":"Link","pad.share.emebdcode":"Embed URL","pad.chat":"Chat","pad.chat.title":"Open the chat for this pad.","timeslider.pageTitle":"{{appTitle}} Timeslider","timeslider.toolbar.returnbutton":"Return to pad","timeslider.toolbar.authors":"Authors:","timeslider.toolbar.authorsList":"No Authors","timeslider.toolbar.exportlink.title":"Export","timeslider.exportCurrent":"Export current version as:","timeslider.version":"Version {{version}}","timeslider.saved":"Saved {{month}} {{day}}, {{year}}","timeslider.dateformat":"{{month}}/{{day}}/{{year}} {{hours}}:{{minutes}}:{{seconds}}","timeslider.dateonlyformat":"{{month}}/{{day}}/{{year}}","timeslider.month.january":"January","timeslider.month.february":"February","timeslider.month.march":"March","timeslider.month.april":"April","timeslider.month.may":"May","timeslider.month.june":"June","timeslider.month.july":"July","timeslider.month.august":"August","timeslider.month.september":"September","timeslider.month.october":"October","timeslider.month.november":"November","timeslider.month.december":"December","pad.savedrevs.marked":"This revision is now marked as a saved revision","pad.userlist.entername":"Enter your name","pad.userlist.unnamed":"unnamed","pad.userlist.guest":"Guest","pad.userlist.deny":"Deny","pad.userlist.approve":"Approve","pad.editbar.clearcolors":"Clear authorship colors on entire document?","pad.impexp.importbutton":"Import Now","pad.impexp.importing":"Importing...","pad.impexp.confirmimport":"Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?","pad.impexp.convertFailed":"We were not able to import this file. Please use a different document format or copy paste manually","pad.impexp.uploadFailed":"The upload failed, please try again","pad.impexp.importfailed":"Import failed","pad.impexp.copypaste":"Please copy paste","pad.impexp.exportdisabled":"Exporting as {{type}} format is disabled. Please contact your system administrator for details."} +======= +{"index.newPad":"New Pad","index.createOpenPad":"or create/open a Pad with the name:","pad.toolbar.bold.title":"Bold (Ctrl-B)","pad.toolbar.italic.title":"Italic (Ctrl-I)","pad.toolbar.underline.title":"Underline (Ctrl-U)","pad.toolbar.strikethrough.title":"Strikethrough","pad.toolbar.ol.title":"Ordered list","pad.toolbar.ul.title":"Unordered List","pad.toolbar.indent.title":"Indent","pad.toolbar.unindent.title":"Outdent","pad.toolbar.undo.title":"Undo (Ctrl-Z)","pad.toolbar.redo.title":"Redo (Ctrl-Y)","pad.toolbar.clearAuthorship.title":"Clear Authorship Colors","pad.toolbar.import_export.title":"Import/Export from/to different file formats","pad.toolbar.timeslider.title":"Timeslider","pad.toolbar.savedRevision.title":"Saved Revisions","pad.toolbar.settings.title":"Settings","pad.toolbar.embed.title":"Embed this pad","pad.toolbar.showusers.title":"Show the users on this pad","pad.colorpicker.save":"Save","pad.colorpicker.cancel":"Cancel","pad.loading":"Loading...","pad.passwordRequired":"You need a password to access this pad","pad.permissionDenied":"You do not have permission to access this pad","pad.wrongPassword":"Your password was wrong","pad.settings.padSettings":"Pad Settings","pad.settings.myView":"My View","pad.settings.stickychat":"Chat always on screen","pad.settings.colorcheck":"Authorship colors","pad.settings.linenocheck":"Line numbers","pad.settings.fontType":"Font type:","pad.settings.fontType.normal":"Normal","pad.settings.fontType.monospaced":"Monospace","pad.settings.globalView":"Global View","pad.settings.language":"Language:","pad.importExport.import_export":"Import/Export","pad.importExport.import":"Upload any text file or document","pad.importExport.importSuccessful":"Successful!","pad.importExport.export":"Export current pad as:","pad.importExport.exporthtml":"HTML","pad.importExport.exportplain":"Plain text","pad.importExport.exportword":"Microsoft Word","pad.importExport.exportpdf":"PDF","pad.importExport.exportopen":"ODF (Open Document Format)","pad.importExport.exportdokuwiki":"DokuWiki","pad.importExport.abiword.innerHTML":"You only can import from plain text or html formats. For more advanced import features please install abiword.","pad.modals.connected":"Connected.","pad.modals.reconnecting":"Reconnecting to your pad..","pad.modals.forcereconnect":"Force reconnect","pad.modals.userdup":"Opened in another window","pad.modals.userdup.explanation":"This pad seems to be opened in more than one browser window on this computer.","pad.modals.userdup.advice":"Reconnect to use this window instead.","pad.modals.unauth":"Not authorized","pad.modals.unauth.explanation":"Your permissions have changed while viewing this page. Try to reconnect.","pad.modals.looping":"Disconnected.","pad.modals.looping.explanation":"There are communication problems with the synchronization server.","pad.modals.looping.cause":"Perhaps you connected through an incompatible firewall or proxy.","pad.modals.initsocketfail":"Server is unreachable.","pad.modals.initsocketfail.explanation":"Couldn't connect to the synchronization server.","pad.modals.initsocketfail.cause":"This is probably due to a problem with your browser or your internet connection.","pad.modals.slowcommit":"Disconnected.","pad.modals.slowcommit.explanation":"The server is not responding.","pad.modals.slowcommit.cause":"This could be due to problems with network connectivity.","pad.modals.deleted":"Deleted.","pad.modals.deleted.explanation":"This pad has been removed.","pad.modals.disconnected":"You have been disconnected.","pad.modals.disconnected.explanation":"The connection to the server was lost","pad.modals.disconnected.cause":"The server may be unavailable. Please notify us if this continues to happen.","pad.share":"Share this pad","pad.share.readonly":"Read only","pad.share.link":"Link","pad.share.emebdcode":"Embed URL","pad.chat":"Chat","pad.chat.title":"Open the chat for this pad.","pad.chat.loadmessages": "Load more messages","timeslider.pageTitle":"{{appTitle}} Timeslider","timeslider.toolbar.returnbutton":"Return to pad","timeslider.toolbar.authors":"Authors:","timeslider.toolbar.authorsList":"No Authors","timeslider.toolbar.exportlink.title":"Export","timeslider.exportCurrent":"Export current version as:","timeslider.version":"Version {{version}}","timeslider.saved":"Saved {{month}} {{day}}, {{year}}","timeslider.dateformat":"{{month}}/{{day}}/{{year}} {{hours}}:{{minutes}}:{{seconds}}","timeslider.month.january":"January","timeslider.month.february":"February","timeslider.month.march":"March","timeslider.month.april":"April","timeslider.month.may":"May","timeslider.month.june":"June","timeslider.month.july":"July","timeslider.month.august":"August","timeslider.month.september":"September","timeslider.month.october":"October","timeslider.month.november":"November","timeslider.month.december":"December","pad.savedrevs.marked":"This revision is now marked as a saved revision","pad.userlist.entername":"Enter your name","pad.userlist.unnamed":"unnamed","pad.userlist.guest":"Guest","pad.userlist.deny":"Deny","pad.userlist.approve":"Approve","pad.editbar.clearcolors":"Clear authorship colors on entire document?","pad.impexp.importbutton":"Import Now","pad.impexp.importing":"Importing...","pad.impexp.confirmimport":"Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?","pad.impexp.convertFailed":"We were not able to import this file. Please use a different document format or copy paste manually","pad.impexp.uploadFailed":"The upload failed, please try again","pad.impexp.importfailed":"Import failed","pad.impexp.copypaste":"Please copy paste","pad.impexp.exportdisabled":"Exporting as {{type}} format is disabled. Please contact your system administrator for details."} +>>>>>>> 025c92f3464516f63c942b0dcc9fe4a8dda8e414 diff --git a/src/locales/es.json b/src/locales/es.json index 71d201a43..3df39019c 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -88,6 +88,7 @@ "timeslider.version": "Versi\u00f3n {{version}}", "timeslider.saved": "Guardado el {{day}} de {{month}} de {{year}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}", "timeslider.month.january": "Enero", "timeslider.month.february": "Febrero", "timeslider.month.march": "Marzo", diff --git a/src/locales/fi.json b/src/locales/fi.json index 9a644bda4..075ac987f 100644 --- a/src/locales/fi.json +++ b/src/locales/fi.json @@ -91,6 +91,7 @@ "timeslider.version": "Versio {{version}}", "timeslider.saved": "Tallennettu {{day}}. {{month}}ta {{year}}", "timeslider.dateformat": "{{day}}.{{month}}.{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}}.{{month}}.{{year}}", "timeslider.month.january": "tammikuu", "timeslider.month.february": "helmikuu", "timeslider.month.march": "maaliskuu", diff --git a/src/locales/gl.json b/src/locales/gl.json index 2cd30e337..174b90b56 100644 --- a/src/locales/gl.json +++ b/src/locales/gl.json @@ -87,6 +87,7 @@ "timeslider.version": "Versi\u00f3n {{version}}", "timeslider.saved": "Gardado o {{day}} de {{month}} de {{year}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}", "timeslider.month.january": "xaneiro", "timeslider.month.february": "febreiro", "timeslider.month.march": "marzo", diff --git a/src/locales/he.json b/src/locales/he.json index 2a265791b..a9f4e5732 100644 --- a/src/locales/he.json +++ b/src/locales/he.json @@ -86,6 +86,7 @@ "timeslider.version": "\u05d2\u05e8\u05e1\u05d4 {{version}}", "timeslider.saved": "\u05e0\u05e9\u05de\u05e8\u05d4 \u05d1\u05be{{day}} \u05d1{{month}} {{year}}", "timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{year}}-{{month}}-{{day}}", "timeslider.month.january": "\u05d9\u05e0\u05d5\u05d0\u05e8", "timeslider.month.february": "\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8", "timeslider.month.march": "\u05de\u05e8\u05e5", diff --git a/src/locales/hu.json b/src/locales/hu.json index 6e6673002..e0b55304d 100644 --- a/src/locales/hu.json +++ b/src/locales/hu.json @@ -87,6 +87,7 @@ "timeslider.version": "{{version}} verzi\u00f3", "timeslider.saved": "{{year}}. {{month}} {{day}}-n elmentve", "timeslider.dateformat": "{{year}}\/{{month}}\/{{day}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{year}}\/{{month}}\/{{day}}", "timeslider.month.january": "janu\u00e1r", "timeslider.month.february": "febru\u00e1r", "timeslider.month.march": "m\u00e1rcius", diff --git a/src/locales/it.json b/src/locales/it.json index 8f2a9c995..051abe374 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -90,6 +90,7 @@ "timeslider.version": "Versione {{version}}", "timeslider.saved": "Salvato {{day}} {{month}} {{year}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}", "timeslider.month.january": "gennaio", "timeslider.month.february": "febbraio", "timeslider.month.march": "marzo", diff --git a/src/locales/ja.json b/src/locales/ja.json index 36c2328c0..0f15956f9 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -87,6 +87,7 @@ "timeslider.version": "\u30d0\u30fc\u30b8\u30e7\u30f3 {{version}}", "timeslider.saved": "| {{year}}\u5e74{{month}}{{day}}\u65e5\u306b\u4fdd\u5b58", "timeslider.dateformat": "{{year}}\u5e74{{month}}{{day}}\u65e5 {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{year}}\u5e74{{month}}{{day}}\u65e5", "timeslider.month.january": "1\u6708", "timeslider.month.february": "2\u6708", "timeslider.month.march": "3\u6708", diff --git a/src/locales/ko.json b/src/locales/ko.json index f9e696955..af65e018f 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -87,6 +87,7 @@ "timeslider.version": "\ubc84\uc804 {{version}}", "timeslider.saved": "{{year}}\ub144 {{month}} {{day}}\uc77c\uc5d0 \uc800\uc7a5\ud568", "timeslider.dateformat": "{{year}}\ub144\/{{month}}\/{{day}}\uc77c {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{year}}\ub144\/{{month}}\/{{day}}\uc77c", "timeslider.month.january": "1\uc6d4", "timeslider.month.february": "2\uc6d4", "timeslider.month.march": "3\uc6d4", diff --git a/src/locales/ksh.json b/src/locales/ksh.json index e4557e855..e17ead983 100644 --- a/src/locales/ksh.json +++ b/src/locales/ksh.json @@ -80,6 +80,7 @@ "timeslider.version": "V\u00e4sjon {{version}}", "timeslider.saved": "Fa\u00dfjehallde aam {{day}}. {{month}} {{year}}", "timeslider.dateformat": "amm {{day}}. {{month}} {{year}} \u00f6m {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "amm {{day}}. {{month}} {{year}}", "timeslider.month.january": "Jannewaa", "timeslider.month.february": "F\u00e4\u00e4browaa", "timeslider.month.march": "M\u00e4\u00e4z", diff --git a/src/locales/mk.json b/src/locales/mk.json index 1ed2a47d9..c3b976fe0 100644 --- a/src/locales/mk.json +++ b/src/locales/mk.json @@ -88,6 +88,7 @@ "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.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}", "timeslider.month.january": "\u0458\u0430\u043d\u0443\u0430\u0440\u0438", "timeslider.month.february": "\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438", "timeslider.month.march": "\u043c\u0430\u0440\u0442", diff --git a/src/locales/ms.json b/src/locales/ms.json index b2d953879..8da45fc48 100644 --- a/src/locales/ms.json +++ b/src/locales/ms.json @@ -87,6 +87,7 @@ "timeslider.version": "Versi {{version}}", "timeslider.saved": "Disimpan pada {{day}} {{month}} {{year}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}", "timeslider.month.january": "Januari", "timeslider.month.february": "Februari", "timeslider.month.march": "Mac", diff --git a/src/locales/nl.json b/src/locales/nl.json index 14ba42c0a..7a6d78635 100644 --- a/src/locales/nl.json +++ b/src/locales/nl.json @@ -87,6 +87,7 @@ "timeslider.version": "Versie {{version}}", "timeslider.saved": "Opgeslagen op {{day}} {{month}} {{year}}", "timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{year}}-{{month}}-{{day}}", "timeslider.month.january": "januari", "timeslider.month.february": "februari", "timeslider.month.march": "maart", diff --git a/src/locales/nn.json b/src/locales/nn.json index e8004e8d5..6660dfab8 100644 --- a/src/locales/nn.json +++ b/src/locales/nn.json @@ -87,6 +87,7 @@ "timeslider.version": "Utg\u00e5ve {{version}}", "timeslider.saved": "Lagra {{day}}. {{month}}, {{year}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}.{{minutes}}.{{seconds}}", + "timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}", "timeslider.month.january": "januar", "timeslider.month.february": "februar", "timeslider.month.march": "mars", diff --git a/src/locales/pl.json b/src/locales/pl.json index e52f7c32a..be727790a 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -89,6 +89,7 @@ "timeslider.version": "Wersja {{version}}", "timeslider.saved": "Zapisano {{day}} {{month}} {{year}}", "timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{year}}-{{month}}-{{day}}", "timeslider.month.january": "Stycze\u0144", "timeslider.month.february": "Luty", "timeslider.month.march": "Marzec", diff --git a/src/locales/sq.json b/src/locales/sq.json index 6ae81135b..939109494 100644 --- a/src/locales/sq.json +++ b/src/locales/sq.json @@ -85,6 +85,7 @@ "timeslider.version": "Versioni {{version}}", "timeslider.saved": "Ruajtur m\u00eb {{month}} {{day}}, {{year}}", "timeslider.dateformat": "{{month}}\/{{day}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{month}}\/{{day}}\/{{year}}", "timeslider.month.january": "Janar", "timeslider.month.february": "Shkurt", "timeslider.month.march": "Mars", diff --git a/src/locales/sv.json b/src/locales/sv.json index 54dc25136..ae69813be 100644 --- a/src/locales/sv.json +++ b/src/locales/sv.json @@ -87,6 +87,7 @@ "timeslider.version": "Version {{version}}", "timeslider.saved": "Sparades den {{day}} {{month}} {{year}}", "timeslider.dateformat": "{{day}}\/{{month}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{day}}\/{{month}}\/{{year}}", "timeslider.month.january": "januari", "timeslider.month.february": "februari", "timeslider.month.march": "mars", diff --git a/src/locales/uk.json b/src/locales/uk.json index af035c651..793ed9332 100644 --- a/src/locales/uk.json +++ b/src/locales/uk.json @@ -89,6 +89,7 @@ "timeslider.version": "\u0412\u0435\u0440\u0441\u0456\u044f {{version}}", "timeslider.saved": "\u0417\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043e {{month}} {{day}}, {{year}}", "timeslider.dateformat": "{{month}}\/{{day}}\/{{year}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{month}}\/{{day}}\/{{year}}", "timeslider.month.january": "\u0421\u0456\u0447\u0435\u043d\u044c", "timeslider.month.february": "\u041b\u044e\u0442\u0438\u0439", "timeslider.month.march": "\u0411\u0435\u0440\u0435\u0437\u0435\u043d\u044c", diff --git a/src/locales/zh-hant.json b/src/locales/zh-hant.json index c91e2fe37..423fd4546 100644 --- a/src/locales/zh-hant.json +++ b/src/locales/zh-hant.json @@ -87,6 +87,7 @@ "timeslider.version": "\u7248\u672c{{version}}", "timeslider.saved": "{{year}}{{month}}{{day}}\u4fdd\u5b58", "timeslider.dateformat": "{{year}}{{month}}{{day}} {{hours}}:{{minutes}}:{{seconds}}", + "timeslider.dateonlyformat": "{{year}}{{month}}{{day}}", "timeslider.month.january": "1\u6708", "timeslider.month.february": "2\u6708", "timeslider.month.march": "3\u6708", diff --git a/src/static/css/pad.css b/src/static/css/pad.css index bbbadbc18..6790654d5 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -575,6 +575,14 @@ table#otheruserstable { margin-right: 3px; margin-top: 2px; } +.chatDaySeperator +{ + text-align:center; + border-bottom: 1px solid #aaa; + line-height:0.85em; + margin:3px 0 5px; + color:#888; +} .exporttype { margin-top: 4px; background-repeat: no-repeat; diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 01adc34e8..3feb5808e 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -25,6 +25,8 @@ var padcookie = require('./pad_cookie').padcookie; var Tinycon = require('tinycon/tinycon'); +var lastDateStr = null; + var chat = (function() { var isStuck = false; @@ -84,13 +86,22 @@ var chat = (function() msg.time += this._pad.clientTimeOffset; //create the time string - var minutes = "" + new Date(msg.time).getMinutes(); - var hours = "" + new Date(msg.time).getHours(); + 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) @@ -113,11 +124,21 @@ var chat = (function() var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName); +<<<<<<< HEAD + var html = ""; + if(lastDateStr != null && lastDateStr != dateStr) + html = "

" + dateStr + "

"; + html += "

" + authorName + ":" + timeStr + " " + text + "

"; + $("#chattext").append(html); +======= var html = "

" + authorName + ":" + timeStr + " " + text + "

"; if(isHistoryAdd) $(html).insertAfter('#chatloadmessagesbutton'); else $("#chattext").append(html); +>>>>>>> 025c92f3464516f63c942b0dcc9fe4a8dda8e414 + + lastDateStr = dateStr; //should we increment the counter?? if(increment) diff --git a/src/static/js/chat.js.BACKUP.4938.js b/src/static/js/chat.js.BACKUP.4938.js new file mode 100644 index 000000000..3feb5808e --- /dev/null +++ b/src/static/js/chat.js.BACKUP.4938.js @@ -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 = "

" + dateStr + "

"; + html += "

" + authorName + ":" + timeStr + " " + text + "

"; + $("#chattext").append(html); +======= + var html = "

" + authorName + ":" + timeStr + " " + text + "

"; + 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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.BACKUP.5072.js b/src/static/js/chat.js.BACKUP.5072.js new file mode 100644 index 000000000..c676a03e2 --- /dev/null +++ b/src/static/js/chat.js.BACKUP.5072.js @@ -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 = "

" + dateStr + "

"; + html += "

" + authorName + ":" + timeStr + " " + text + "

"; + 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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.BACKUP.5167.js b/src/static/js/chat.js.BACKUP.5167.js new file mode 100644 index 000000000..3feb5808e --- /dev/null +++ b/src/static/js/chat.js.BACKUP.5167.js @@ -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 = "

" + dateStr + "

"; + html += "

" + authorName + ":" + timeStr + " " + text + "

"; + $("#chattext").append(html); +======= + var html = "

" + authorName + ":" + timeStr + " " + text + "

"; + 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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.BASE.4938.js b/src/static/js/chat.js.BASE.4938.js new file mode 100644 index 000000000..79224e80c --- /dev/null +++ b/src/static/js/chat.js.BASE.4938.js @@ -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 = "

" + authorName + ":" + timeStr + " " + text + "

"; + $("#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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.BASE.5072.js b/src/static/js/chat.js.BASE.5072.js new file mode 100644 index 000000000..79224e80c --- /dev/null +++ b/src/static/js/chat.js.BASE.5072.js @@ -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 = "

" + authorName + ":" + timeStr + " " + text + "

"; + $("#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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.BASE.5167.js b/src/static/js/chat.js.BASE.5167.js new file mode 100644 index 000000000..79224e80c --- /dev/null +++ b/src/static/js/chat.js.BASE.5167.js @@ -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 = "

" + authorName + ":" + timeStr + " " + text + "

"; + $("#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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.LOCAL.4938.js b/src/static/js/chat.js.LOCAL.4938.js new file mode 100644 index 000000000..e070e324b --- /dev/null +++ b/src/static/js/chat.js.LOCAL.4938.js @@ -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 = "

" + dateStr + "

"; + html += "

" + authorName + ":" + timeStr + " " + text + "

"; + $("#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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.LOCAL.5072.js b/src/static/js/chat.js.LOCAL.5072.js new file mode 100644 index 000000000..e070e324b --- /dev/null +++ b/src/static/js/chat.js.LOCAL.5072.js @@ -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 = "

" + dateStr + "

"; + html += "

" + authorName + ":" + timeStr + " " + text + "

"; + $("#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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.LOCAL.5167.js b/src/static/js/chat.js.LOCAL.5167.js new file mode 100644 index 000000000..e070e324b --- /dev/null +++ b/src/static/js/chat.js.LOCAL.5167.js @@ -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 = "

" + dateStr + "

"; + html += "

" + authorName + ":" + timeStr + " " + text + "

"; + $("#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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.REMOTE.4938.js b/src/static/js/chat.js.REMOTE.4938.js new file mode 100644 index 000000000..01adc34e8 --- /dev/null +++ b/src/static/js/chat.js.REMOTE.4938.js @@ -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 = "

" + authorName + ":" + timeStr + " " + text + "

"; + 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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.REMOTE.5072.js b/src/static/js/chat.js.REMOTE.5072.js new file mode 100644 index 000000000..01adc34e8 --- /dev/null +++ b/src/static/js/chat.js.REMOTE.5072.js @@ -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 = "

" + authorName + ":" + timeStr + " " + text + "

"; + 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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; + diff --git a/src/static/js/chat.js.REMOTE.5167.js b/src/static/js/chat.js.REMOTE.5167.js new file mode 100644 index 000000000..01adc34e8 --- /dev/null +++ b/src/static/js/chat.js.REMOTE.5167.js @@ -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 = "

" + authorName + ":" + timeStr + " " + text + "

"; + 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(""+authorName+"" + ": " + text).show().delay(4000).hide(400); + chatMentions++; + Tinycon.setBubble(chatMentions); + } + else + { + $('#chatthrob').html(""+authorName+"" + ": " + 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; +