diff --git a/node/server.js b/node/server.js index a429cd31..1b35233f 100644 --- a/node/server.js +++ b/node/server.js @@ -211,6 +211,7 @@ async.waterfall([ return; } + res.header("Access-Control-Allow-Origin", "*"); res.header("Server", serverName); exportHandler.doExport(req, res, req.params.pad, req.params.type); }); diff --git a/static/css/pad.css b/static/css/pad.css index 7839ff43..df68985c 100644 --- a/static/css/pad.css +++ b/static/css/pad.css @@ -1086,3 +1086,11 @@ width:27px !important; opacity:0.01; display:none; } + +#showhistorylabel{ + position:absolute; + left:58px; + top:4px; + cursor: hand; + cursor: pointer; +} diff --git a/static/css/timeslider.css b/static/css/timeslider.css index 17518634..c609c2bc 100644 --- a/static/css/timeslider.css +++ b/static/css/timeslider.css @@ -194,3 +194,29 @@ float:right; padding-right: 6pt; } + + + padding: 0; + margin: 0; +} +ul { margin-left: 1.5em; } +ul ul { margin-left: 0 !important; } +ul.list-bullet1 { margin-left: 1.5em; } +ul.list-bullet2 { margin-left: 3em; } +ul.list-bullet3 { margin-left: 4.5em; } +ul.list-bullet4 { margin-left: 6em; } +ul.list-bullet5 { margin-left: 7.5em; } +ul.list-bullet6 { margin-left: 9em; } +ul.list-bullet7 { margin-left: 10.5em; } +ul.list-bullet8 { margin-left: 12em; } + +ul { list-style-type: disc; } +ul.list-bullet1 { list-style-type: disc; } +ul.list-bullet2 { list-style-type: circle; } +ul.list-bullet3 { list-style-type: square; } +ul.list-bullet4 { list-style-type: disc; } +ul.list-bullet5 { list-style-type: circle; } +ul.list-bullet6 { list-style-type: square; } +ul.list-bullet7 { list-style-type: disc; } +ul.list-bullet8 { list-style-type: circle; } + diff --git a/static/js/ace.js b/static/js/ace.js index bb2e6833..27899aaa 100644 --- a/static/js/ace.js +++ b/static/js/ace.js @@ -248,6 +248,8 @@ function Ace2Editor() // these lines must conform to a specific format because they are passed by the build script: iframeHTML.push($$INCLUDE_CSS_Q("../static/css/iframe_editor.css")); + iframeHTML.push($$INCLUDE_CSS_Q("../static/css/pad.css")); + iframeHTML.push($$INCLUDE_CSS_Q("../static/custom/pad.css")); iframeHTML.push($$INCLUDE_JS_Q("../static/js/ace2_common.js")); iframeHTML.push($$INCLUDE_JS_Q("../static/js/skiplist.js")); iframeHTML.push($$INCLUDE_JS_Q("../static/js/virtual_lines.js")); @@ -267,7 +269,7 @@ function Ace2Editor() var outerScript = 'editorId = "' + info.id + '"; editorInfo = parent.' + thisFunctionsName + '.registry[editorId]; ' + 'window.onload = function() ' + '{ window.onload = null; setTimeout' + '(function() ' + '{ var iframe = document.createElement("IFRAME"); ' + 'iframe.scrolling = "no"; var outerdocbody = document.getElementById("outerdocbody"); ' + 'iframe.frameBorder = 0; iframe.allowTransparency = true; ' + // for IE 'outerdocbody.insertBefore(iframe, outerdocbody.firstChild); ' + 'iframe.ace_outerWin = window; ' + 'readyFunc = function() { editorInfo.onEditorReady(); readyFunc = null; editorInfo = null; }; ' + 'var doc = iframe.contentWindow.document; doc.open(); var text = (' + iframeHTML.join('+') + ').replace(/\\\\x3c/g, \'<\');doc.write(text); doc.close(); ' + '}, 0); }'; - var outerHTML = [doctype, '', $$INCLUDE_CSS("../static/css/iframe_editor.css"), + var outerHTML = [doctype, '', $$INCLUDE_CSS("../static/css/iframe_editor.css"), $$INCLUDE_CSS("../static/css/pad.css"), $$INCLUDE_CSS("../static/custom/pad.css"), // bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly // (throbs busy while typing) '', '\x3cscript>\n', outerScript, '\n\x3c/script>', '
x
']; diff --git a/static/js/chat.js b/static/js/chat.js index f617bdb3..9039d9d9 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -28,6 +28,13 @@ var chat = (function() }); }); }, + showHistory: function() + { + // this is a placeholder for the showHistory function + // load the messages from the server + // append them to the UI using addMessage + self.scrollDown(); // scroll down to the bottom of the chat + }, hide: function () { $("#chatcounter").text("0"); diff --git a/static/js/pad2.js b/static/js/pad2.js index 1fe56b12..436070c7 100644 --- a/static/js/pad2.js +++ b/static/js/pad2.js @@ -18,6 +18,7 @@ var socket; var LineNumbersDisabled = false; +var useMonospaceFontGlobal = false; var globalUserName = false; $(document).ready(function() @@ -77,6 +78,7 @@ function getParams() var showChat = getUrlVars()["showChat"]; var userName = getUrlVars()["userName"]; var showLineNumbers = getUrlVars()["showLineNumbers"]; + var useMonospaceFont = getUrlVars()["useMonospaceFont"]; if(showControls) { if(showControls == "false") @@ -102,6 +104,15 @@ function getParams() } } + if(useMonospaceFont) + { + if(useMonospaceFont == "true") + { + useMonospaceFontGlobal = true; + } + } + + if(userName) { // If the username is set as a parameter we should set a global value that we can call once we have initiated the pad. @@ -139,6 +150,8 @@ function handshake() socket.once('connect', function() { var padId = document.location.pathname.substring(document.location.pathname.lastIndexOf("/") + 1); + padId = unescape(padId); // unescape neccesary due to Safari and Opera interpretation of spaces + document.title = document.title + " | " + padId; var token = readCookie("token"); @@ -147,7 +160,7 @@ function handshake() token = randomString(); createCookie("token", token, 60); } - + var msg = { "component": "pad", "type": "CLIENT_READY", @@ -183,6 +196,12 @@ function handshake() pad.changeViewOption('showLineNumbers', false); } + // If the Monospacefont value is set to true then change it to monospace. + if (useMonospaceFontGlobal == true) + { + pad.changeViewOption('useMonospaceFont', true); + } + // if the globalUserName value is set we need to tell the server and the client about the new authorname if (globalUserName !== false) { @@ -403,7 +422,8 @@ var pad = { }; options.view[key] = value; pad.handleOptionsChange(options); - if (key != "showLineNumbers") + // if the request isn't to hide line numbers then broadcast this to other users + if (key != "showLineNumbers" && key != "useMonospaceFont") { pad.collabClient.sendClientMessage( { diff --git a/static/pad.html b/static/pad.html index 01a095d7..6e1f75b8 100644 --- a/static/pad.html +++ b/static/pad.html @@ -249,14 +249,17 @@ Use this link to share a read-only version of your pad: - Chat + Chat
0
-
Chat
+
Chat | + Show History + +