[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 9225:69c3b28b3be2
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/69c3b28b3be2
user: dengen <taharaxp at gmail.com>
date: Mon Jul 22 01:19:07 2013 +0900
description:
Merged with upstream
diffstat:
public_html/javascript/title_2_id.js | 76 ++++++++++++++++++------------------
system/classes/gltext.class.php | 11 ++--
system/classes/story.class.php | 8 ++-
3 files changed, 50 insertions(+), 45 deletions(-)
diffs (137 lines):
diff -r 6871893facaf -r 69c3b28b3be2 public_html/javascript/title_2_id.js
--- a/public_html/javascript/title_2_id.js Sun Jul 21 11:14:54 2013 -0400
+++ b/public_html/javascript/title_2_id.js Mon Jul 22 01:19:07 2013 +0900
@@ -1,39 +1,39 @@
-/*******************************************
- ** 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', size = 128) {
-
- if(vChkID()==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"];
-
- 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);
-
- T2ID.value = urlID.slice(0, size); // Max size of id
-
- } // 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', size = 128) {
+
+ if(vChkID()==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"];
+
+ 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);
+
+ T2ID.value = urlID.slice(0, size); // Max size of id
+
+ } // end
}
\ No newline at end of file
diff -r 6871893facaf -r 69c3b28b3be2 system/classes/gltext.class.php
--- a/system/classes/gltext.class.php Sun Jul 21 11:14:54 2013 -0400
+++ b/system/classes/gltext.class.php Mon Jul 22 01:19:07 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 6871893facaf -r 69c3b28b3be2 system/classes/story.class.php
--- a/system/classes/story.class.php Sun Jul 21 11:14:54 2013 -0400
+++ b/system/classes/story.class.php Mon Jul 22 01:19:07 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