mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 06:37:10 -04:00
Revert "patch to allow user-added prefixes and modification to random pad names; correctly process uri-encoded utf-8 characters in pad names and page titles"
This reverts commit bda20a38a4
.
This commit is contained in:
parent
bda20a38a4
commit
223016d78d
4 changed files with 15 additions and 29 deletions
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -89,6 +89,16 @@
|
||||||
<link href="static/custom/index.css" rel="stylesheet">
|
<link href="static/custom/index.css" rel="stylesheet">
|
||||||
<script src="static/custom/index.js"></script>
|
<script src="static/custom/index.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
function go2Name()
|
||||||
|
{
|
||||||
|
var padname = document.getElementById("padname").value;
|
||||||
|
padname.length > 0 ? window.location = /** "p/" + **/ padname : alert("Please enter a name")
|
||||||
|
}
|
||||||
|
|
||||||
|
function go2Random()
|
||||||
|
{
|
||||||
|
window.location = /** "p/" + **/ randomPadName();
|
||||||
|
}
|
||||||
|
|
||||||
function randomPadName()
|
function randomPadName()
|
||||||
{
|
{
|
||||||
|
@ -103,30 +113,6 @@
|
||||||
return randomstring;
|
return randomstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
function go2Name()
|
|
||||||
{
|
|
||||||
var padname = document.getElementById("padname").value;
|
|
||||||
padname.length > 0 ? window.location = /** "p/" + **/ padname : alert("Please enter a name")
|
|
||||||
}
|
|
||||||
|
|
||||||
function go2Random()
|
|
||||||
{
|
|
||||||
var rnd = randomPadName();
|
|
||||||
var prefixedName = prompt( "You can prefix or modify your random pad name with some reasonable characters.\nSpecial characters will be removed or escaped.\n\n", "-"+rnd );
|
|
||||||
if ( prefixedName == "-" + rnd ) prefixedName = rnd;
|
|
||||||
var escPrefixedName = encodeURIComponent( prefixedName.replace( /\//, "" ) );
|
|
||||||
if ( prefixedName == null ) return;
|
|
||||||
if ( prefixedName == decodeURIComponent( escPrefixedName )
|
|
||||||
|| ( prefixedName != escPrefixedName
|
|
||||||
&& confirm( "You have used characters which are not allowed in Urls, and the padname will therefore be modified to "
|
|
||||||
+ decodeURIComponent( escPrefixedName )
|
|
||||||
+ ".\nDo you want to use this modifed name?" ) ) ) {
|
|
||||||
window.location = /** "p/" + **/ escPrefixedName;
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//start the costum js
|
//start the costum js
|
||||||
if(typeof costumStart == "function") costumStart();
|
if(typeof costumStart == "function") costumStart();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -172,7 +172,7 @@ function handshake()
|
||||||
socket.once('connect', function()
|
socket.once('connect', function()
|
||||||
{
|
{
|
||||||
var padId = document.location.pathname.substring(document.location.pathname.lastIndexOf("/") + 1);
|
var padId = document.location.pathname.substring(document.location.pathname.lastIndexOf("/") + 1);
|
||||||
padId = decodeURIComponent(padId);
|
padId = unescape(padId); // unescape neccesary due to Safari and Opera interpretation of spaces
|
||||||
|
|
||||||
document.title = document.title + " | " + padId;
|
document.title = document.title + " | " + padId;
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
|
|
||||||
//get the padId out of the url
|
//get the padId out of the url
|
||||||
var urlParts= document.location.pathname.split("/");
|
var urlParts= document.location.pathname.split("/");
|
||||||
padId = decodeURIComponent( urlParts[urlParts.length-2] );
|
padId = urlParts[urlParts.length-2];
|
||||||
|
|
||||||
//set the title
|
//set the title
|
||||||
document.title = document.title + " | " + padId;
|
document.title = document.title + " | " + padId;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue