Add placeholder text when clicking formatting tags with nothing highlighted
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
710f58b034
commit
e9693d20ab
@ -1,4 +1,4 @@
|
||||
39
|
||||
57
|
||||
That is a great idea!
|
||||
username,17May2021 08:29:10;GREEN
|
||||
That is a great idea! <p>There used to be folks I worked with who would use the same technique, and it worked great!</p>
|
||||
@ -77,3 +77,39 @@ fdsa2022-07-28T19:25:51.209453Z[Etc/UTC];GREEN
|
||||
2022-07-28T20:08:50.191504Z[Etc/UTC];GREEN
|
||||
<pre><span class="keyword">Code</span> <span class="keyword">block</span> <span class="keyword">now</span> <span class="variable">works</span>!</
|
||||
2022-07-28T20:13:09.268431Z[Etc/UTC];GREEN
|
||||
Very%20nice%2C%20thanks%20for%20sharing!
|
||||
Sig2022-08-01T16:02:59.075004Z[Etc/UTC];GREEN
|
||||
testest
|
||||
test2022-08-01T16:05:35.718759Z[Etc/UTC];GREEN
|
||||
fdasvdsavd
|
||||
dvsavda2022-08-01T16:05:46.192305Z[Etc/UTC];GREEN
|
||||
dasvavdsvsda
|
||||
ewqfewqfeqw2022-08-01T16:05:49.832914Z[Etc/UTC];GREEN
|
||||
|
||||
2022-08-01T16:05:56.667292Z[Etc/UTC];GREEN
|
||||
<b>we%20broke%20it</b>
|
||||
dvsa2022-08-01T16:06:11.783876Z[Etc/UTC];GREEN
|
||||
%20%20%20%20
|
||||
2022-08-01T16:08:10.957080Z[Etc/UTC];GREEN
|
||||
<b></b>
|
||||
2022-08-01T16:08:13.443427Z[Etc/UTC];GREEN
|
||||
fdsavdsavds
|
||||
dfsafdsa2022-08-01T16:08:18.820345Z[Etc/UTC];GREEN
|
||||
<b></b><b></b><b></b>
|
||||
2022-08-01T16:08:24.546240Z[Etc/UTC];GREEN
|
||||
fdsa
|
||||
2022-08-01T16:08:28.154518Z[Etc/UTC];GREEN
|
||||
<pre><span class="keyword">Cool</span> <span class="keyword">stuff</span> <span class="variable">man</span></
|
||||
2022-08-01T16:08:43.853845Z[Etc/UTC];GREEN
|
||||
<b>Bold%20Text</b>
|
||||
vdsavdsa2022-08-01T16:11:13.185418Z[Etc/UTC];GREEN
|
||||
<pre>//<span class="keyword">Code</span> <span class="keyword">goes</span> <span class="class">here</span>.<span class="variable"></span></
|
||||
vdsavdsav2022-08-01T16:11:23.726618Z[Etc/UTC];GREEN
|
||||
<i>Italic%20Text</i>
|
||||
vdsavdsavdsa2022-08-01T16:11:29.316553Z[Etc/UTC];GREEN
|
||||
dva<u>avsdv</u>dasv
|
||||
2022-08-01T16:11:33.383089Z[Etc/UTC];GREEN
|
||||
<a href="http%3A%2F%2Flink.%F0%9F%98%8Acom">http%3A%2F%2Flink.%F0%9F%98%8Acom</a>
|
||||
2022-08-01T16:11:42.223754Z[Etc/UTC];GREEN
|
||||
<pre>//<span class="keyword">Code</span> <span class="variable">go</span>😔<span class="keyword">es</span> <span class="class">here</span>.<span class="variable"></span></
|
||||
2022-08-01T16:11:57.246254Z[Etc/UTC];GREEN
|
||||
|
@ -17,15 +17,15 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="contentBody">
|
||||
<h2>Directory Listing for /</h2><div class="folderlisting"><a href="/.." class="icon">📁</a><a href="/..">.. </a><a href="/.." class="nounderline">(Previous Directory)</a></div><div class="folderlisting"><a href="/articles" class="icon">📁</a><a href="/articles">articles</a> 2022-08-01T15:59:35.330694Z gitpod 4096</div>
|
||||
<div class="folderlisting"><a href="/images" class="icon">📁</a><a href="/images">images</a> 2022-08-01T15:59:35.326694Z gitpod 77</div>
|
||||
<div class="filelisting"><a href="/codeBackground" class="icon">🗎</a><a href="/codeBackground">codeBackground</a> 2022-08-01T15:59:35.214694Z gitpod 2635</div>
|
||||
<div class="filelisting"><a href="/otherpage.html" class="icon">🗎</a><a href="/otherpage.html">otherpage.html</a> 2022-08-01T15:59:35.258694Z gitpod 88370</div>
|
||||
<div class="filelisting"><a href="/reset.css" class="icon">🗎</a><a href="/reset.css">reset.css</a> 2022-08-01T15:59:35.218694Z gitpod 1092</div>
|
||||
<div class="filelisting"><a href="/testfile.html" class="icon">🗎</a><a href="/testfile.html">testfile.html</a> 2022-08-01T15:59:35.262694Z gitpod 1627</div>
|
||||
<div class="filelisting"><a href="/uploadform.html" class="icon">🗎</a><a href="/uploadform.html">uploadform.html</a> 2022-08-01T15:59:35.262694Z gitpod 1707</div>
|
||||
<div class="filelisting"><a href="/sig.css" class="icon">🗎</a><a href="/sig.css">sig.css</a> 2022-08-01T15:59:35.246694Z gitpod 10595</div>
|
||||
<div class="filelisting"><a href="/error.html" class="icon">🗎</a><a href="/error.html">error.html</a> 2022-08-01T15:59:35.262694Z gitpod 1672</div>
|
||||
<h2>Directory Listing for /</h2><div class="folderlisting"><a href="/.." class="icon">📁</a><a href="/..">.. </a><a href="/.." class="nounderline">(Previous Directory)</a></div><div class="folderlisting"><a href="/articles" class="icon">📁</a><a href="/articles">articles</a> 2022-08-01T16:11:07.418073Z gitpod 4096</div>
|
||||
<div class="folderlisting"><a href="/images" class="icon">📁</a><a href="/images">images</a> 2022-08-01T16:11:07.410073Z gitpod 77</div>
|
||||
<div class="filelisting"><a href="/codeBackground" class="icon">🗎</a><a href="/codeBackground">codeBackground</a> 2022-08-01T16:11:07.174073Z gitpod 2635</div>
|
||||
<div class="filelisting"><a href="/otherpage.html" class="icon">🗎</a><a href="/otherpage.html">otherpage.html</a> 2022-08-01T16:11:07.230073Z gitpod 88370</div>
|
||||
<div class="filelisting"><a href="/reset.css" class="icon">🗎</a><a href="/reset.css">reset.css</a> 2022-08-01T16:11:07.178073Z gitpod 1092</div>
|
||||
<div class="filelisting"><a href="/testfile.html" class="icon">🗎</a><a href="/testfile.html">testfile.html</a> 2022-08-01T16:11:07.230073Z gitpod 1627</div>
|
||||
<div class="filelisting"><a href="/uploadform.html" class="icon">🗎</a><a href="/uploadform.html">uploadform.html</a> 2022-08-01T16:11:07.230073Z gitpod 1707</div>
|
||||
<div class="filelisting"><a href="/sig.css" class="icon">🗎</a><a href="/sig.css">sig.css</a> 2022-08-01T16:11:07.214073Z gitpod 10595</div>
|
||||
<div class="filelisting"><a href="/error.html" class="icon">🗎</a><a href="/error.html">error.html</a> 2022-08-01T16:11:07.230073Z gitpod 1672</div>
|
||||
|
||||
</div> <!--End Content Body-->
|
||||
<div class="codeForeground" id="codeForeground"></div>
|
||||
|
@ -17,13 +17,13 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="contentBody">
|
||||
<h2>Directory Listing for /articles/</h2><div class="folderlisting"><a href="/articles/.." class="icon">📁</a><a href="/articles/..">.. </a><a href="/articles/.." class="nounderline">(Previous Directory)</a></div><div class="folderlisting"><a href="/articles/test articles" class="icon">📁</a><a href="/articles/test articles">test articles</a> 2022-08-01T15:59:35.278694Z gitpod 147</div>
|
||||
<div class="filelisting"><a href="/articles/Love Live! Custom Arcade Controller.article" class="icon">🗎</a><a href="/articles/Love Live! Custom Arcade Controller.article">Love Live! Custom Arcade Controller.article</a> 2022-08-01T15:59:34.742695Z gitpod 497</div>
|
||||
<div class="filelisting"><a href="/articles/curabitur vel tempus ex.article" class="icon">🗎</a><a href="/articles/curabitur vel tempus ex.article">curabitur vel tempus ex.article</a> 2022-08-01T15:59:34.770695Z gitpod 730</div>
|
||||
<div class="filelisting"><a href="/articles/sigplace1.article" class="icon">🗎</a><a href="/articles/sigplace1.article">sigplace1.article</a> 2022-08-01T15:59:35.210694Z gitpod 80858</div>
|
||||
<div class="filelisting"><a href="/articles/Love Live! Custom Arcade Controller.article.html" class="icon">🗎</a><a href="/articles/Love Live! Custom Arcade Controller.article.html">Love Live! Custom Arcade Controller.article.html</a> 2022-08-01T15:59:35.278694Z gitpod 8626</div>
|
||||
<div class="filelisting"><a href="/articles/curabitur vel tempus ex.article.html" class="icon">🗎</a><a href="/articles/curabitur vel tempus ex.article.html">curabitur vel tempus ex.article.html</a> 2022-08-01T15:59:35.306694Z gitpod 8835</div>
|
||||
<div class="filelisting"><a href="/articles/sigplace1.article.html" class="icon">🗎</a><a href="/articles/sigplace1.article.html">sigplace1.article.html</a> 2022-08-01T15:59:35.318694Z gitpod 88935</div>
|
||||
<h2>Directory Listing for /articles/</h2><div class="folderlisting"><a href="/articles/.." class="icon">📁</a><a href="/articles/..">.. </a><a href="/articles/.." class="nounderline">(Previous Directory)</a></div><div class="folderlisting"><a href="/articles/test articles" class="icon">📁</a><a href="/articles/test articles">test articles</a> 2022-08-01T16:11:07.306073Z gitpod 147</div>
|
||||
<div class="filelisting"><a href="/articles/Love Live! Custom Arcade Controller.article" class="icon">🗎</a><a href="/articles/Love Live! Custom Arcade Controller.article">Love Live! Custom Arcade Controller.article</a> 2022-08-01T16:11:06.110074Z gitpod 497</div>
|
||||
<div class="filelisting"><a href="/articles/curabitur vel tempus ex.article" class="icon">🗎</a><a href="/articles/curabitur vel tempus ex.article">curabitur vel tempus ex.article</a> 2022-08-01T16:11:06.218074Z gitpod 730</div>
|
||||
<div class="filelisting"><a href="/articles/sigplace1.article" class="icon">🗎</a><a href="/articles/sigplace1.article">sigplace1.article</a> 2022-08-01T16:11:07.170073Z gitpod 80858</div>
|
||||
<div class="filelisting"><a href="/articles/Love Live! Custom Arcade Controller.article.html" class="icon">🗎</a><a href="/articles/Love Live! Custom Arcade Controller.article.html">Love Live! Custom Arcade Controller.article.html</a> 2022-08-01T16:11:07.310073Z gitpod 9152</div>
|
||||
<div class="filelisting"><a href="/articles/curabitur vel tempus ex.article.html" class="icon">🗎</a><a href="/articles/curabitur vel tempus ex.article.html">curabitur vel tempus ex.article.html</a> 2022-08-01T16:11:07.322073Z gitpod 9361</div>
|
||||
<div class="filelisting"><a href="/articles/sigplace1.article.html" class="icon">🗎</a><a href="/articles/sigplace1.article.html">sigplace1.article.html</a> 2022-08-01T16:11:07.402073Z gitpod 89461</div>
|
||||
|
||||
</div> <!--End Content Body-->
|
||||
<div class="codeForeground" id="codeForeground"></div>
|
||||
|
@ -74,11 +74,32 @@ For over a year since I first got into <u>Love Live! School Idol Festival ~after
|
||||
document.getElementById("msg").disabled=false;
|
||||
})
|
||||
}
|
||||
function bonus(str) {
|
||||
switch (str) {
|
||||
case "^^":{
|
||||
return "Bold Text"
|
||||
}break;
|
||||
case "**":{
|
||||
return "Italic Text"
|
||||
}break;
|
||||
case "__":{
|
||||
return "Underlined Text"
|
||||
}break;
|
||||
case "~~":{
|
||||
return "//Code goes here."
|
||||
}break;
|
||||
case "[[":{
|
||||
return "http://link.com"
|
||||
}break;
|
||||
}
|
||||
}
|
||||
function insert(c1,c2) {
|
||||
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
|
||||
//No highlighting. Insert here.
|
||||
if (c2!=undefined) {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
|
||||
bonus(c1)+
|
||||
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
} else {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
}
|
||||
|
@ -78,11 +78,32 @@ Curabitur vel tempus ex. Duis cursus sapien nisl, ut pulvinar dui porttitor ut.
|
||||
document.getElementById("msg").disabled=false;
|
||||
})
|
||||
}
|
||||
function bonus(str) {
|
||||
switch (str) {
|
||||
case "^^":{
|
||||
return "Bold Text"
|
||||
}break;
|
||||
case "**":{
|
||||
return "Italic Text"
|
||||
}break;
|
||||
case "__":{
|
||||
return "Underlined Text"
|
||||
}break;
|
||||
case "~~":{
|
||||
return "//Code goes here."
|
||||
}break;
|
||||
case "[[":{
|
||||
return "http://link.com"
|
||||
}break;
|
||||
}
|
||||
}
|
||||
function insert(c1,c2) {
|
||||
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
|
||||
//No highlighting. Insert here.
|
||||
if (c2!=undefined) {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
|
||||
bonus(c1)+
|
||||
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
} else {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
}
|
||||
|
@ -553,11 +553,32 @@ Here we demonstrate the love live logo. But wait, it's literally like in the mid
|
||||
document.getElementById("msg").disabled=false;
|
||||
})
|
||||
}
|
||||
function bonus(str) {
|
||||
switch (str) {
|
||||
case "^^":{
|
||||
return "Bold Text"
|
||||
}break;
|
||||
case "**":{
|
||||
return "Italic Text"
|
||||
}break;
|
||||
case "__":{
|
||||
return "Underlined Text"
|
||||
}break;
|
||||
case "~~":{
|
||||
return "//Code goes here."
|
||||
}break;
|
||||
case "[[":{
|
||||
return "http://link.com"
|
||||
}break;
|
||||
}
|
||||
}
|
||||
function insert(c1,c2) {
|
||||
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
|
||||
//No highlighting. Insert here.
|
||||
if (c2!=undefined) {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
|
||||
bonus(c1)+
|
||||
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
} else {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
}
|
||||
|
@ -17,12 +17,12 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="contentBody">
|
||||
<h2>Directory Listing for /articles/test articles/</h2><div class="folderlisting"><a href="/articles/test articles/.." class="icon">📁</a><a href="/articles/test articles/..">.. </a><a href="/articles/test articles/.." class="nounderline">(Previous Directory)</a></div><div class="filelisting"><a href="/articles/test articles/test1.article" class="icon">🗎</a><a href="/articles/test articles/test1.article">test1.article</a> 2022-08-01T15:59:34.738695Z gitpod 1085</div>
|
||||
<div class="filelisting"><a href="/articles/test articles/test2.article" class="icon">🗎</a><a href="/articles/test articles/test2.article">test2.article</a> 2022-08-01T15:59:34.738695Z gitpod 781</div>
|
||||
<div class="filelisting"><a href="/articles/test articles/test3.article" class="icon">🗎</a><a href="/articles/test articles/test3.article">test3.article</a> 2022-08-01T15:59:34.742695Z gitpod 994</div>
|
||||
<div class="filelisting"><a href="/articles/test articles/test1.article.html" class="icon">🗎</a><a href="/articles/test articles/test1.article.html">test1.article.html</a> 2022-08-01T15:59:35.266694Z gitpod 9154</div>
|
||||
<div class="filelisting"><a href="/articles/test articles/test2.article.html" class="icon">🗎</a><a href="/articles/test articles/test2.article.html">test2.article.html</a> 2022-08-01T15:59:35.274694Z gitpod 8850</div>
|
||||
<div class="filelisting"><a href="/articles/test articles/test3.article.html" class="icon">🗎</a><a href="/articles/test articles/test3.article.html">test3.article.html</a> 2022-08-01T15:59:35.278694Z gitpod 9063</div>
|
||||
<h2>Directory Listing for /articles/test articles/</h2><div class="folderlisting"><a href="/articles/test articles/.." class="icon">📁</a><a href="/articles/test articles/..">.. </a><a href="/articles/test articles/.." class="nounderline">(Previous Directory)</a></div><div class="filelisting"><a href="/articles/test articles/test1.article" class="icon">🗎</a><a href="/articles/test articles/test1.article">test1.article</a> 2022-08-01T16:11:06.050074Z gitpod 1085</div>
|
||||
<div class="filelisting"><a href="/articles/test articles/test2.article" class="icon">🗎</a><a href="/articles/test articles/test2.article">test2.article</a> 2022-08-01T16:11:06.102074Z gitpod 781</div>
|
||||
<div class="filelisting"><a href="/articles/test articles/test3.article" class="icon">🗎</a><a href="/articles/test articles/test3.article">test3.article</a> 2022-08-01T16:11:06.106074Z gitpod 994</div>
|
||||
<div class="filelisting"><a href="/articles/test articles/test1.article.html" class="icon">🗎</a><a href="/articles/test articles/test1.article.html">test1.article.html</a> 2022-08-01T16:11:07.234073Z gitpod 9680</div>
|
||||
<div class="filelisting"><a href="/articles/test articles/test2.article.html" class="icon">🗎</a><a href="/articles/test articles/test2.article.html">test2.article.html</a> 2022-08-01T16:11:07.302073Z gitpod 9376</div>
|
||||
<div class="filelisting"><a href="/articles/test articles/test3.article.html" class="icon">🗎</a><a href="/articles/test articles/test3.article.html">test3.article.html</a> 2022-08-01T16:11:07.306073Z gitpod 9589</div>
|
||||
|
||||
</div> <!--End Content Body-->
|
||||
<div class="codeForeground" id="codeForeground"></div>
|
||||
|
@ -72,11 +72,32 @@
|
||||
document.getElementById("msg").disabled=false;
|
||||
})
|
||||
}
|
||||
function bonus(str) {
|
||||
switch (str) {
|
||||
case "^^":{
|
||||
return "Bold Text"
|
||||
}break;
|
||||
case "**":{
|
||||
return "Italic Text"
|
||||
}break;
|
||||
case "__":{
|
||||
return "Underlined Text"
|
||||
}break;
|
||||
case "~~":{
|
||||
return "//Code goes here."
|
||||
}break;
|
||||
case "[[":{
|
||||
return "http://link.com"
|
||||
}break;
|
||||
}
|
||||
}
|
||||
function insert(c1,c2) {
|
||||
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
|
||||
//No highlighting. Insert here.
|
||||
if (c2!=undefined) {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
|
||||
bonus(c1)+
|
||||
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
} else {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
}
|
||||
|
@ -72,11 +72,32 @@
|
||||
document.getElementById("msg").disabled=false;
|
||||
})
|
||||
}
|
||||
function bonus(str) {
|
||||
switch (str) {
|
||||
case "^^":{
|
||||
return "Bold Text"
|
||||
}break;
|
||||
case "**":{
|
||||
return "Italic Text"
|
||||
}break;
|
||||
case "__":{
|
||||
return "Underlined Text"
|
||||
}break;
|
||||
case "~~":{
|
||||
return "//Code goes here."
|
||||
}break;
|
||||
case "[[":{
|
||||
return "http://link.com"
|
||||
}break;
|
||||
}
|
||||
}
|
||||
function insert(c1,c2) {
|
||||
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
|
||||
//No highlighting. Insert here.
|
||||
if (c2!=undefined) {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
|
||||
bonus(c1)+
|
||||
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
} else {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
}
|
||||
|
@ -72,11 +72,32 @@
|
||||
document.getElementById("msg").disabled=false;
|
||||
})
|
||||
}
|
||||
function bonus(str) {
|
||||
switch (str) {
|
||||
case "^^":{
|
||||
return "Bold Text"
|
||||
}break;
|
||||
case "**":{
|
||||
return "Italic Text"
|
||||
}break;
|
||||
case "__":{
|
||||
return "Underlined Text"
|
||||
}break;
|
||||
case "~~":{
|
||||
return "//Code goes here."
|
||||
}break;
|
||||
case "[[":{
|
||||
return "http://link.com"
|
||||
}break;
|
||||
}
|
||||
}
|
||||
function insert(c1,c2) {
|
||||
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
|
||||
//No highlighting. Insert here.
|
||||
if (c2!=undefined) {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
|
||||
bonus(c1)+
|
||||
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
} else {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
}
|
||||
|
@ -12,7 +12,6 @@
|
||||
String filename=null;
|
||||
OutputStream stream = null;
|
||||
requestLine=in.readLine(); //Read the first line, this should be our request.
|
||||
System.out.println(requestLine);
|
||||
if (requestLine!=null) {
|
||||
String[] splitter = requestLine.split(Pattern.quote(" "));
|
||||
boolean ISPOST = splitter[0].equals("POST");
|
||||
@ -38,3 +37,4 @@
|
||||
System.out.println(line);
|
||||
}
|
||||
} else {
|
||||
File myFile = new File(new File(sigPlace.OUTDIR,sigPlace.UPLOADSDIR),filename);
|
||||
|
@ -28,11 +28,32 @@
|
||||
document.getElementById("msg").disabled=false;
|
||||
})
|
||||
}
|
||||
function bonus(str) {
|
||||
switch (str) {
|
||||
case "^^":{
|
||||
return "Bold Text"
|
||||
}break;
|
||||
case "**":{
|
||||
return "Italic Text"
|
||||
}break;
|
||||
case "__":{
|
||||
return "Underlined Text"
|
||||
}break;
|
||||
case "~~":{
|
||||
return "//Code goes here."
|
||||
}break;
|
||||
case "[[":{
|
||||
return "http://link.com"
|
||||
}break;
|
||||
}
|
||||
}
|
||||
function insert(c1,c2) {
|
||||
if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) {
|
||||
//No highlighting. Insert here.
|
||||
if (c2!=undefined) {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+
|
||||
bonus(c1)+
|
||||
c2+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
} else {
|
||||
document.getElementById("msg").value=document.getElementById("msg").value.substring(0,document.getElementById("msg").selectionStart)+c1+document.getElementById("msg").value.substring(document.getElementById("msg").selectionStart)
|
||||
}
|
||||
|
@ -159,6 +159,7 @@ public class sigServer {
|
||||
if (location.equals("COMMENTS")&&requestParams.containsKey("message")&&requestParams.containsKey("name")&&requestParams.containsKey("color")) {
|
||||
//System.out.println(requestParams);
|
||||
String finalMsg = requestParams.get("message").replaceAll(Pattern.quote("%0A"),"<br/>").replaceAll(Pattern.quote("%3C"),"<");
|
||||
if (finalMsg.length()>0) {
|
||||
boolean boldBlock=false;
|
||||
boolean italicBlock=false;
|
||||
boolean underlineBlock=false;
|
||||
@ -368,6 +369,9 @@ public class sigServer {
|
||||
Files.write(Paths.get(sigPlace.COMMENTSDIR,requestParams.get("article")), data, StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE,StandardOpenOption.CREATE_NEW);
|
||||
}
|
||||
CreateRequest(client,"200","OK",Paths.get(sigPlace.OUTDIR,"testfile.html"));
|
||||
} else {
|
||||
CreateRequest(client,"304","Not Modified",Paths.get(sigPlace.OUTDIR,"testfile.html"));
|
||||
}
|
||||
} else {
|
||||
if (modifiedDate==null||Files.exists(file)&&modifiedDate.isBefore(GetLastModifiedDate(file)))
|
||||
{
|
||||
@ -476,6 +480,7 @@ public class sigServer {
|
||||
if (contentType!=null&&contentType.equals("text/html")) {
|
||||
clientOutput.write(("<div class=\"generateTime\">Webpage generated in "+(System.currentTimeMillis()-startTime)+"ms</div>\r\n").getBytes());
|
||||
}
|
||||
System.out.println("Sent "+file+" with status ["+statusCode+"] "+statusMsg);
|
||||
}
|
||||
clientOutput.write("\r\n\r\n".getBytes());
|
||||
clientOutput.flush();
|
||||
|
Loading…
x
Reference in New Issue
Block a user