[geeklog-hg] geeklog: Tweak script more. Still doesn't work for themes which ...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Jul 21 10:37:50 EDT 2013
changeset 9220:22ac44ea143c
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/22ac44ea143c
user: Tom <websitemaster at cogeco.net>
date: Sun Jul 21 10:37:34 2013 -0400
description:
Tweak script more. Still doesn't work for themes which use a default theme and for regular themes under certian IE browser versions.
diffstat:
public_html/javascript/title_2_id.js | 24 +++---------------------
1 files changed, 3 insertions(+), 21 deletions(-)
diffs (49 lines):
diff -r de4cbb6815f0 -r 22ac44ea143c public_html/javascript/title_2_id.js
--- a/public_html/javascript/title_2_id.js Sun Jul 21 10:36:12 2013 -0400
+++ b/public_html/javascript/title_2_id.js Sun Jul 21 10:37:34 2013 -0400
@@ -16,21 +16,14 @@
if (chkSID == "") return false;
}
-function TitleToId(getTitle = 'title', setTl2ID = 'id') {
+function TitleToId(getTitle = 'title', setTl2ID = 'id', size = 128) {
if(vChkID()==false) {
- // vars - set your own variables.
- // edit here!
- // var getTitle = "title";
- // var setTl2ID = "id";
- var useDigits = false;
var Separ = "-";
var Sch = ["Ä", "â", "î", "Å", "Å£", "à ", "á", "ã", "ä", "Ã¥", "æ", "ç", "Å", "ð", "è", "é", "ê", "ë", "ì", "Ã", "ï", "ñ", "û", "ù", "ú", "ü", "ž", "ý", "ÿ", "ò", "ó", "õ", "ô", "ö", "ø", "Å¡"];
var Nch = ["a", "a", "i", "s", "t", "a", "a", "a", "a", "a", "a", "c", "oe", "d", "e", "e", "e", "e", "i", "i", "i", "n", "u", "u", "u", "u", "z", "y", "y", "o", "o", "o", "o", "o", "o", "s"];
- // done!
- // do not edit below
var Title = document.getElementById(getTitle).value.toLowerCase();
for(x=0; x<Title.length; x++) {
for(i=0; i<Sch.length; i++) {
@@ -39,19 +32,8 @@
}
var urlID = Title.replace(/\s\s+/g, " ").replace(/\s/g, "_").replace(/\W/g, Separ).replace(/_/g, Separ);
var T2ID = document.getElementById(setTl2ID);
- if(useDigits==true) {
- var gDigit = new Date();
- var gD1 = gDigit.getDate();
- var gD2 = gDigit.getMonth();
- if (gD1 < 10) gD1 = "0" + gD1;
- if (gD2 < 10) gD2 = "0" + gD2;
- yondigit = Separ + gD1 + gD2;
- nr = 35;
- } else {
- yondigit = "";
- nr = 128;
- }
- T2ID.value = urlID.slice(0, nr) + yondigit;
+
+ T2ID.value = urlID.slice(0, size); // Max size of id
} // end
}
\ No newline at end of file
More information about the geeklog-cvs
mailing list