Skip to content

Commit 122ce76

Browse files
committed
Converted markup to use markdown syntax.
1 parent 4f94286 commit 122ce76

File tree

6 files changed

+10
-128
lines changed

6 files changed

+10
-128
lines changed

README.md

+1-47
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This chat application is designed for for use within a web browser and is focuse
1212
* Slash commands similar to IRC. Implement `CommandPlugin` for custom slash commands. e.g. /help
1313
* User is typing notification.
1414
* Growl messages for events such as: status changes, sign on, sign off, user is typing, ...
15-
* Messages formatting with markdown syntax.
15+
* Messages formatted with markdown syntax using the [showdown](https://github.com/showdownjs/showdown) library. Here's a populate [markdown cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
1616

1717
## INSTALL
1818

@@ -159,52 +159,6 @@ e.g. https://www.example.com/talk2me/#room@username!
159159

160160
*Note, a username may only be a member of one room at any time.*
161161

162-
### Message Filtering (Wiki like syntax)
163-
164-
Embed YouTube videos.
165-
166-
{youtube}https://www.youtube.com/watch?v=mgMn68Rgva0{/youtube}
167-
168-
Insert image.
169-
170-
{http://www.example.com/image.jpg}
171-
172-
Insert hyper link with custom text.
173-
174-
[http://www.example.com | This is a link]
175-
176-
Insert a hyper link.
177-
178-
[http://www.example.com]
179-
180-
Bold text.
181-
182-
'''make me bold'''
183-
184-
Italic text.
185-
186-
''make me italic''
187-
188-
Strikethrough text.
189-
190-
{-strike me-}
191-
192-
Monospace code font.
193-
194-
@@This will be monospace@@
195-
196-
Create a line break. i.e. <br />
197-
198-
{br}
199-
200-
Code blocks.
201-
202-
{code}
203-
function foo() {
204-
console.log('hello world');
205-
}
206-
{/code}
207-
208162
## Command Plugin
209163

210164
To enable the command plugin copy `src/Talk2Me/example.CommandPlugin.php` to `src/Talk2Me/CommandPlugin.php`.

html/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ <h1><span style="color:#930000">t</span><span style="color:#aa1717">a</span><spa
112112
<script src="js/tinycon.min.js"></script>
113113
<script src="js/livequery/jquery.livequery.min.js"></script>
114114
<script src="js/highlight/highlight.pack.js"></script>
115-
<script src="js/wwiki.min.js"></script>
116115
<script src="js/Autolinker.min.js"></script>
116+
<script src="js/showdown.min.js"></script>
117117
<script src="js/talk2me.js"></script>
118118
</body>
119119
</html>

html/js/showdown.min.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

html/js/talk2me.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
twitter: false,
2424
urls: true
2525
});
26+
var converter = new showdown.Converter();
2627

2728
function random(min, max) {
2829
"use strict";
@@ -343,7 +344,7 @@
343344

344345
if (v.item.message) {
345346
$(".messages").append("<div class=\"well well-sm message\">"
346-
+ Wwiki.render(linker.link(htmlMessage)) + "</div>");
347+
+ linker.link(converter.makeHtml(htmlMessage)) + "</div>");
347348
}
348349
});
349350
var s = $(jsonObj.messages).size();
@@ -414,7 +415,7 @@
414415
if (encrypted) {
415416
msg = getMessageLockHTML() + " " + msg;
416417
}
417-
$(".messages").prepend("<div class=\"well well-sm message\">" + Wwiki.render(linker.link(msg)) + "</div>");
418+
$(".messages").prepend("<div class=\"well well-sm message\">" + linker.link(converter.makeHtml(msg)) + "</div>");
418419
}
419420

420421
function appendParsedMessage(msg, encrypted) {
@@ -444,7 +445,7 @@
444445
var htmlMessage = "<span class=\"room-user-message\">@" + username + "</span> "
445446
+ message + " <span class=\"timestamp\">" + timestamp + "</span>";
446447
// TODO: end: create function for this (#duplicateParsedMessage)
447-
$(".messages").prepend("<div class=\"well well-sm message\">" + Wwiki.render(linker.link(htmlMessage)) + "</div>");
448+
$(".messages").prepend("<div class=\"well well-sm message\">" + linker.link(converter.makeHtml(htmlMessage)) + "</div>");
448449
growl('@' + username + ': ' + jsonMessage.msg, "from-message-" + username);
449450
}
450451

@@ -795,7 +796,7 @@
795796
// TODO: end: create function for this (#duplicateParsedMessage)
796797

797798
$(".messages").append("<div class=\"well well-sm message\">"
798-
+ Wwiki.render(linker.link(htmlMessage)) + "</div>");
799+
+ linker.link(converter.makeHtml(htmlMessage)) + "</div>");
799800
});
800801
var s = $(jsonObj.messages).size();
801802
messagesShown += s;

html/js/wwiki.js

-73
This file was deleted.

html/js/wwiki.min.js

-3
This file was deleted.

0 commit comments

Comments
 (0)