[geeklog-hg] geeklog: Merged with upstream
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Mon Jul 22 09:12:34 EDT 2013
changeset 9224:e42cc0f6d886
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/e42cc0f6d886
user: dengen <taharaxp at gmail.com>
date: Sun Jul 21 07:28:30 2013 +0900
description:
Merged with upstream
diffstat:
public_html/javascript/title_2_id.js | 112 +++++++++++++++++-----------------
system/classes/gltext.class.php | 11 +-
system/classes/story.class.php | 8 +-
3 files changed, 68 insertions(+), 63 deletions(-)
diffs (173 lines):
diff -r 7d74d79b126e -r e42cc0f6d886 public_html/javascript/title_2_id.js
--- a/public_html/javascript/title_2_id.js Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/javascript/title_2_id.js Sun Jul 21 07:28:30 2013 +0900
@@ -1,57 +1,57 @@
-/*******************************************
- ** Title 2 ID ****************************
- ** Auto generate ID based on title **
- *******************************************/
-
-function vNoE(param) {
- var param = param.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
- var rgxpt = "[\\?&]" + param + "=([^&#]*)";
- var regex = new RegExp(rgxpt);
- var result = regex.exec(window.location.href);
- if(result == null) return ""; else return result[1];
-}
-
-function vChkID() {
- var chkSID = vNoE("sid");
- if (chkSID == "") return false;
-}
-
-function TitleToId(getTitle = 'title', setTl2ID = 'id') {
-
- 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++) {
- Title = Title.replace(Sch[i], Nch[i]);
- }
- }
- 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;
-
- } // end
+/*******************************************
+ ** Title 2 ID ****************************
+ ** Auto generate ID based on title **
+ *******************************************/
+
+function vNoE(param) {
+ var param = param.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
+ var rgxpt = "[\\?&]" + param + "=([^&#]*)";
+ var regex = new RegExp(rgxpt);
+ var result = regex.exec(window.location.href);
+ if(result == null) return ""; else return result[1];
+}
+
+function vChkID() {
+ var chkSID = vNoE("sid");
+ if (chkSID == "") return false;
+}
+
+function TitleToId(getTitle = 'title', setTl2ID = 'id') {
+
+ 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++) {
+ Title = Title.replace(Sch[i], Nch[i]);
+ }
+ }
+ 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;
+
+ } // end
}
\ No newline at end of file
diff -r 7d74d79b126e -r e42cc0f6d886 system/classes/gltext.class.php
--- a/system/classes/gltext.class.php Sat Jul 20 14:34:13 2013 -0400
+++ b/system/classes/gltext.class.php Sun Jul 21 07:28:30 2013 +0900
@@ -90,14 +90,15 @@
/**
* Returns text ready for display.
*
- * @param string $text Text to prepare for display
- * @param string $postmode Indicates if text is html, wikitext or plaintext
- * @param int $version version of GLText engine
+ * @param string $text Text to prepare for display
+ * @param string $postmode Indicates if text is html, wikitext or plaintext
+ * @param string $permissions comma-separated list of rights which identify the current user as an "Admin"
+ * @param int $version version of GLText engine
* @return string Escaped String
* @access public
*
*/
- public static function getDisplayText($text, $postmode, $version)
+ public static function getDisplayText($text, $postmode, $permissions, $version)
{
if ($version == GLTEXT_FIRST_VERSION) {
@@ -117,7 +118,7 @@
// latest version
if ($postmode == 'html') {
- $text = self::checkHTML($text, 'story.edit');
+ $text = self::checkHTML($text, $permissions);
}
if ($postmode == 'plaintext') {
diff -r 7d74d79b126e -r e42cc0f6d886 system/classes/story.class.php
--- a/system/classes/story.class.php Sat Jul 20 14:34:13 2013 -0400
+++ b/system/classes/story.class.php Sun Jul 21 07:28:30 2013 +0900
@@ -1708,13 +1708,17 @@
{
case 'introtext':
$return = GLText::getDisplayText($this->_introtext,
- $this->_postmode, $this->_text_version);
+ $this->_postmode,
+ 'story.edit',
+ $this->_text_version);
break;
case 'bodytext':
if (empty($this->_bodytext)) break;
$return = GLText::getDisplayText($this->_bodytext,
- $this->_postmode, $this->_text_version);
+ $this->_postmode,
+ 'story.edit',
+ $this->_text_version);
break;
More information about the geeklog-cvs
mailing list