Browse Source

added emoji + input sanitization

master
Roel 10 years ago
parent
commit
ae99ee803f
  1. 24
      web/emoji.js
  2. BIN
      web/emoticons/iframe-close.png
  3. BIN
      web/emoticons/iframe-open.png
  4. BIN
      web/emoticons/script-close.gif
  5. BIN
      web/emoticons/script-open.gif
  6. BIN
      web/emoticons/style-close.png
  7. BIN
      web/emoticons/style-open.png
  8. 2
      web/main.js
  9. 2
      web/photostuff.js

24
web/emoji.js

@ -5,6 +5,30 @@ function parseEmoticons( inputStr ){
text: ':)', text: ':)',
image: '1.png' image: '1.png'
}, },
{
text: '<iframe',
image: 'iframe-open.png'
},
{
text: '</iframe>',
image: 'iframe-close.png'
},
{
text: '<script',
image: 'script-open.gif'
},
{
text: '</script>',
image: 'script-close.gif'
},
{
text: '<style',
image: 'style-open.png'
},
{
text: '</style>',
image: 'style-close.png'
},
{ {
text:';)', text:';)',
image: '2.png' image: '2.png'

BIN
web/emoticons/iframe-close.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
web/emoticons/iframe-open.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
web/emoticons/script-close.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
web/emoticons/script-open.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
web/emoticons/style-close.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
web/emoticons/style-open.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

2
web/main.js

@ -201,7 +201,7 @@ var localStorageArray = [];
var color = getNodeColor( orderStorage[i].node ); var color = getNodeColor( orderStorage[i].node );
contentString += '<li><div class="message-block" style="background-color:'+color+'">'+ contentString += '<li><div class="message-block" style="background-color:'+color+'">'+
'<div class="date-sender">On ' + datereadable + '<div class="date-sender">On ' + datereadable +
' <b>' + orderStorage[i].user +'</b> wrote:</div>' + ' <b>' + parseEmoticons(orderStorage[i].user) +'</b> wrote:</div>' +
'<div class="message-text">' + parseEmoticons( orderStorage[i].message ) + '</div>' + //parseEmoticons is found in emoji.js '<div class="message-text">' + parseEmoticons( orderStorage[i].message ) + '</div>' + //parseEmoticons is found in emoji.js
' <div class="nodehops"><div class="node '+orderStorage[i].node+'">from '+orderStorage[i].alias + '</div>' + ' <div class="nodehops"><div class="node '+orderStorage[i].node+'">from '+orderStorage[i].alias + '</div>' +
' <div class="hops '+orderStorage[i].hops+'">via '+orderStorage[i].hops+' nodes</div></div></div></li>'; ' <div class="hops '+orderStorage[i].hops+'">via '+orderStorage[i].hops+' nodes</div></div></div></li>';

2
web/photostuff.js

@ -51,7 +51,7 @@ function submitImage(){
if( !namm || namm == "" ){ if( !namm || namm == "" ){
namm = "anonymous"; namm = "anonymous";
} }
addOutboxItem( namm, image.outerHTML ); addOutboxItem( parseEmoticons(namm), image.outerHTML );
showOverview(); showOverview();
return false; return false;

Loading…
Cancel
Save