[pLog-svn] r3299 - in plog/trunk: js/ui templates/admin

mark at devel.lifetype.net mark at devel.lifetype.net
Fri Apr 28 16:32:44 GMT 2006


Author: mark
Date: 2006-04-28 16:32:44 +0000 (Fri, 28 Apr 2006)
New Revision: 3299

Modified:
   plog/trunk/js/ui/plogui.js
   plog/trunk/templates/admin/editpost.template
   plog/trunk/templates/admin/newpost.template
Log:
It is really a stupid bug. I forget put the postId back to the template, so ... when you save the post as draft in each time, it will treat it as different post ...

Modified: plog/trunk/js/ui/plogui.js
===================================================================
--- plog/trunk/js/ui/plogui.js	2006-04-28 11:28:31 UTC (rev 3298)
+++ plog/trunk/js/ui/plogui.js	2006-04-28 16:32:44 UTC (rev 3299)
@@ -53,7 +53,9 @@
 {
 	//put returned XML in the textarea
 	var xmldoc = originalRequest.responseXML;
+	var id = xmldoc.getElementsByTagName('id')[0].firstChild.nodeValue;
 	var message = xmldoc.getElementsByTagName('message')[0].firstChild.nodeValue;
+	$( 'postId' ).value = id;
 	window.alert(message);
 }
 
@@ -74,30 +76,6 @@
 	}
 }
 
-function addArticleCategoryOption_old(originalRequest)
-{
-	//put returned XML in the textarea
-	var xmldoc = originalRequest.responseXML;
-	var success = xmldoc.getElementsByTagName('success')[0].firstChild.nodeValue;
-	var message = xmldoc.getElementsByTagName('message')[0].firstChild.nodeValue;
-	if (!success) {
-		window.alert(message);
-	}
-	else
-	{
-		var catId = xmldoc.getElementsByTagName('id')[0].firstChild.nodeValue;
-		var catName = xmldoc.getElementsByTagName('name')[0].firstChild.nodeValue;
-	    $( 'postCategories' ).options.add( new Option( catName, catId ), 0 );
-	    for(i=0; i<$( 'postCategories' ).length; i++)
-	    {
-			$( 'postCategories' ).options[i].selected = false;
-	    }
-	    $( 'postCategories' ).options[0].selected = true;
-	    $( 'newArticleCategory' ).value = '';
-	    $( 'addArticleCategory' ).disabled = 0;
-	}
-}
-
 function addArticleCategoryOption(originalRequest)
 {
 	//put returned XML in the textarea

Modified: plog/trunk/templates/admin/editpost.template
===================================================================
--- plog/trunk/templates/admin/editpost.template	2006-04-28 11:28:31 UTC (rev 3298)
+++ plog/trunk/templates/admin/editpost.template	2006-04-28 16:32:44 UTC (rev 3299)
@@ -158,7 +158,7 @@
       <input type="button" name="previewPost" value="{$locale->tr("preview")}" onclick="javascript:previewUpdatedPost()" />	
       <input type="submit" name="updatePost" value="{$locale->tr("update")}"/>
       <input type="hidden" name="op" value="updatePost"/>
-      <input type="hidden" name="postId" value="{$postId}"/>
+      <input type="hidden" name="postId" id="postId" value="{$postId}"/>
 	</div>  	
   </form>
 {include file="$admintemplatepath/footernavigation.template"}

Modified: plog/trunk/templates/admin/newpost.template
===================================================================
--- plog/trunk/templates/admin/newpost.template	2006-04-28 11:28:31 UTC (rev 3298)
+++ plog/trunk/templates/admin/newpost.template	2006-04-28 16:32:44 UTC (rev 3299)
@@ -189,7 +189,7 @@
 		<input type="submit" name="addPost" value="{$locale->tr("add_post")}"/>		
 		<input type="hidden" name="isDraft" value="" />
 		<input type="hidden" name="op" value="addPost"/>
-		<input type="hidden" name="postId" value="{$postId}" />
+		<input type="hidden" name="postId" id="postId" value="{$postId}" />
     </div>
   </form>
 {include file="$admintemplatepath/footernavigation.template"}



More information about the pLog-svn mailing list