<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[2376] 2013/sayaksarkar/trunk/source: Repository commits fixed.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://gsoc.trac.wordpress.org/changeset/2376">2376</a></dd>
<dt>Author</dt> <dd>sayaksarkar</dd>
<dt>Date</dt> <dd>2013-09-23 20:32:18 +0000 (Mon, 23 Sep 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Repository commits fixed. Package Finalized.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#2013sayaksarkartrunksourcepagecomposejs">2013/sayaksarkar/trunk/source/pagecompose.js</a></li>
<li><a href="#2013sayaksarkartrunksourcepostcomposejs">2013/sayaksarkar/trunk/source/postcompose.js</a></li>
<li><a href="#2013sayaksarkartrunksourcexmlrpcservicejs">2013/sayaksarkar/trunk/source/xmlrpcservice.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="2013sayaksarkartrunksourcepagecomposejs"></a>
<div class="modfile"><h4>Modified: 2013/sayaksarkar/trunk/source/pagecompose.js (2375 => 2376)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/pagecompose.js     2013-09-23 19:01:31 UTC (rev 2375)
+++ 2013/sayaksarkar/trunk/source/pagecompose.js        2013-09-23 20:32:18 UTC (rev 2376)
</span><span class="lines">@@ -9,7 +9,10 @@
</span><span class="cx">                          {kind: "onyx.Icon", src: "images/toolbar/back.png", ontap: "backTap", style: "height: 38px;"},
</span><span class="cx">                  ]},
</span><span class="cx">                  {kind: "onyx.Icon", src: "images/toolbar/wp.png", style: "margin-left: 5px; margin-right: 4px; height: 38px; width: 38px;"},
</span><del>-                       {content: "New Page", style: "margin-right: 80px;"}, 
</del><ins>+                        {content: "New Page", style: "margin-right: 40px;"}, 
+                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "draftTap", style: "background-color: #21759b;", components: [
+                               {kind: "onyx.Icon", classes: "buttonIcon", id: "saveDraft",  src: "images/toolbar/save.png"}
+                       ]},
</ins><span class="cx">                   {kind: "onyx.Button", classes: "toolbarButton", ontap: "publishTap", style: "background-color: #21759b;", components: [
</span><span class="cx">                          {kind: "onyx.Icon", classes: "buttonIcon", id: "publish",  src: "images/toolbar/publish.png"}
</span><span class="cx">                  ]}
</span><span class="lines">@@ -28,61 +31,56 @@
</span><span class="cx">                  {kind: "onyx.InputDecorator", layoutKind:"FittableRowsLayout", style: "margin-top: 20px; width: 270px; height: 300px;", components: [
</span><span class="cx">                          {kind: "onyx.RichText", id: "pageComposeContent", name: "contentField", placeholder: "Content (tap to add text)", fit: true, style: "width: 100%;"}
</span><span class="cx">                  ]},
</span><del>-
-                       //Status Menu
-                       {
-                               name:"pickerPageStatus",
-                               id: "pickerPageStatusId",
-                               kind: "onyx.PickerDecorator",
-                               style: "margin-top: 10px;",
-                               components: [
-                                       {
-                                               kind: "onyx.PickerButton",
-                                               content: "Status",
-                                               style: "width: 100%"
-                                       },
-                                       {
-                                               kind: "onyx.Picker",
-                                               components: [
-                                                       {content: "Publish"},
-                                                       {content: "Draft"},
-                                                       {content: "Pending Review"},
-                                                       {content: "Private"}
-                                               ]
-                                       }
-                               ]
-                       },
-
</del><span class="cx">           ]}
</span><span class="cx">  ],
</span><span class="cx">  publishTap: function (inSender, inEvent) {
</span><span class="cx">          sessvars.pagetitle = this.$.title.getValue();
</span><span class="cx">          sessvars.pagecontentField = this.$.contentField.getValue();
</span><del>-               if (this.$.pickerPageStatus.selected != null){
-                       sessvars.pageStatus = this.$.pickerPageStatus.selected.content;
-               }
</del><ins>+                
</ins><span class="cx">           console.log(sessvars.pagetitle + "<br/>" + sessvars.pagecontentField);
</span><del>-               newPage();
</del><ins>+                publishPage();
</ins><span class="cx">   },
</span><ins>+       draftTap: function (inSender, inEvent) {
+               sessvars.pagetitle = this.$.title.getValue();
+               sessvars.pagecontentField = this.$.contentField.getValue();
+
+               console.log(sessvars.pagetitle + "<br/>" + sessvars.pagecontentField);
+               draftPage();
+       },
</ins><span class="cx">   backTap: function(inSender, inEvent) {
</span><span class="cx">          new wp.Pages().renderInto(document.body);
</span><span class="cx">  }
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-function newPage() {
</del><ins>+function publishPage() {
</ins><span class="cx"> 
</span><span class="cx">  var content = {
</span><span class="cx">          "title": sessvars.pagetitle,
</span><del>-               "description" : sessvars.pagecontentField
</del><ins>+                "description" : sessvars.pagecontentField,
+               "page_status": "publish"
</ins><span class="cx">   };
</span><span class="cx"> 
</span><del>-       var params = [sessvars.blogId, sessvars.username, sessvars.password, content];
-       var xmlrpc_data =  XMLRPCBuilder.marshal("wp.newPost", params);
</del><ins>+        var params = [sessvars.blogid, sessvars.username, sessvars.password, content];
+       var xmlrpc_data =  XMLRPCBuilder.marshal("wp.newPage", params);
</ins><span class="cx">   
</span><del>-       makeRequest(sessvars.url, xmlrpc_data);         
</del><ins>+        makeNewPageRequest(sessvars.url, xmlrpc_data);          
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function draftPage() {
</ins><span class="cx"> 
</span><ins>+       var content = {
+               "title": sessvars.pagetitle,
+               "description" : sessvars.pagecontentField,
+               "page_status": "draft"
+       };
+
+       var params = [sessvars.blogid, sessvars.username, sessvars.password, content];
+       var xmlrpc_data =  XMLRPCBuilder.marshal("wp.newPage", params);
+       
+       makeNewPageRequest(sessvars.url, xmlrpc_data);          
+}
+
+
</ins><span class="cx"> function makeNewPageRequest(url, data) {
</span><span class="cx">  var xhr = new XMLHttpRequest({mozSystem:true});
</span><span class="cx">  xhr.open('POST', url);
</span></span></pre></div>
<a id="2013sayaksarkartrunksourcepostcomposejs"></a>
<div class="modfile"><h4>Modified: 2013/sayaksarkar/trunk/source/postcompose.js (2375 => 2376)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/postcompose.js     2013-09-23 19:01:31 UTC (rev 2375)
+++ 2013/sayaksarkar/trunk/source/postcompose.js        2013-09-23 20:32:18 UTC (rev 2376)
</span><span class="lines">@@ -9,7 +9,10 @@
</span><span class="cx">                          {kind: "onyx.Icon", src: "images/toolbar/back.png", ontap: "backTap", style: "height: 38px;"},
</span><span class="cx">                  ]},
</span><span class="cx">                  {kind: "onyx.Icon", src: "images/toolbar/wp.png", style: "margin-left:5px; height: 38px; width: 38px;"},
</span><del>-                       {content: "New Post", style: "margin-right: 80px;"}, 
</del><ins>+                        {content: "New Post", style: "margin-right: 40px;"}, 
+                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "draftTap", style: "background-color: #21759b;", components: [
+                               {kind: "onyx.Icon", classes: "buttonIcon", id: "saveDraft",  src: "images/toolbar/save.png"}
+                       ]},
</ins><span class="cx">                   {kind: "onyx.Button", classes: "toolbarButton", ontap: "publishTap", style: "background-color: #21759b;", components: [
</span><span class="cx">                          {kind: "onyx.Icon", classes: "buttonIcon", id: "publish",  src: "images/toolbar/publish.png"}
</span><span class="cx">                  ]}
</span><span class="lines">@@ -22,118 +25,92 @@
</span><span class="cx"> 
</span><span class="cx">                  //Title Input box Definition
</span><span class="cx">                  {kind: "onyx.InputDecorator", components: [
</span><del>-                               {kind: "onyx.Input", name: "title", placeholder: "Title", style: "width: 270px;"}
</del><ins>+                                {kind: "onyx.Input", id: "post-title" ,name: "title", placeholder: "Title", style: "width: 270px;"}
</ins><span class="cx">                   ]},
</span><span class="cx">                  
</span><span class="cx">                  //Text Input Area Definition
</span><span class="cx">                  {kind: "onyx.InputDecorator", layoutKind:"FittableRowsLayout", style: "margin-top: 20px; width: 270px; height: 300px;", components: [
</span><del>-                               {kind: "onyx.RichText", name: "contentField", placeholder: "Content (tap to add text)", fit: true, style: "width: 100%;"}
-                       ]},
-
-                       //Status Menu
-                       {
-                               name:"pickerPostStatus",
-                               kind: "onyx.PickerDecorator",
-                               style: "margin-top: 5px;",
-                               components: [
-                                       {
-                                               kind: "onyx.PickerButton",
-                                               content: "Status",
-                                               style: "width: 100%"
-                                       },
-                                       {
-                                               kind: "onyx.Picker",
-                                               components: [
-                                                       {content: "Publish"},
-                                                       {content: "Draft"},
-                                                       {content: "Pending Review"},
-                                                       {content: "Private"}
-                                               ]
-                                       }
-                               ]
-                       },
-
-                       //Post Format Menu
-                       {
-                               name:"pickerPostFormat",
-                               kind: "onyx.PickerDecorator",
-                               style: "margin-top: 5px;",
-                               components: [
-                                       {
-                                               kind: "onyx.PickerButton",
-                                               content: "Post Format",
-                                               style: "width: 100%"
-                                       },
-                                       {
-                                               kind: "onyx.Picker",
-                                               components: [
-                                                       {content: "Standard"},
-                                                       {content: "Status"},
-                                                       {content: "Gallery"},
-                                                       {content: "Quote"},
-                                                       {content: "Link"},
-                                                       {content: "Image"},
-                                                       {content: "Chat"},
-                                                       {content: "Aside"},
-                                                       {content: "Video"}
-                                               ]
-                                       }
-                               ]
-                       },
</del><ins>+                                {kind: "onyx.RichText", id: "post-content", name: "contentField", placeholder: "Content (tap to add text)", fit: true, style: "width: 100%;"}
+                       ]}
</ins><span class="cx">           ]}
</span><span class="cx">  ],
</span><span class="cx">  publishTap: function (inSender, inEvent) {
</span><span class="cx">          sessvars.postTitle = this.$.title.getValue();
</span><span class="cx">          sessvars.postcontentField = this.$.contentField.getValue();
</span><del>-               if (this.$.pickerPostStatus.selected != null){
-                       sessvars.postStatus = this.$.pickerPostStatus.selected.content;
-               }
-               if (this.$.pickerPostFormat.selected != null){
-                       sessvars.postFormat = this.$.pickerPostFormat.selected.content;
-               }
</del><ins>+
</ins><span class="cx">           console.log(sessvars.postTitle + "<br/>" + sessvars.postcontentField);
</span><del>-               newPost();
</del><ins>+                console.log(sessvars.blogid, sessvars.username, sessvars.password);
+
+               publishPost();
</ins><span class="cx">   },
</span><ins>+       draftTap: function (inSender, inEvent) {
+               sessvars.postTitle = this.$.title.getValue();
+               sessvars.postcontentField = this.$.contentField.getValue();
+
+               console.log(sessvars.postTitle + "<br/>" + sessvars.postcontentField);
+               console.log(sessvars.blogid, sessvars.username, sessvars.password);
+
+               draftPost();
+       },
</ins><span class="cx">   backTap: function(inSender, inEvent) {
</span><span class="cx">          new wp.Posts().renderInto(document.body);
</span><span class="cx">  }
</span><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-function newPost() {
</del><ins>+function publishPost() {
</ins><span class="cx"> 
</span><span class="cx">  var content = {
</span><del>-               "post_title": sessvars.posttitle,
-               "post_content": sessvars.postcontentField
</del><ins>+                "post_title": sessvars.postTitle,
+               "post_status": "publish",
+               "post_content" : sessvars.postcontentField
</ins><span class="cx">   };
</span><span class="cx"> 
</span><del>-       var params = [sessvars.blogId, sessvars.username, sessvars.password, content];
</del><ins>+        var params = [sessvars.blogid, sessvars.username, sessvars.password, content];
</ins><span class="cx">   var xmlrpc_data =  XMLRPCBuilder.marshal("wp.newPost", params);
</span><span class="cx">  
</span><del>-       makeRequest(sessvars.url, xmlrpc_data);         
</del><ins>+        makeNewPostRequest(sessvars.url, xmlrpc_data);          
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-function makeRequest(url, data) {
</del><ins>+function draftPost() {
+
+       var content = {
+               "post_title": sessvars.postTitle,
+               "post_status": "draft",
+               "post_content" : sessvars.postcontentField
+       };
+
+       var params = [sessvars.blogid, sessvars.username, sessvars.password, content];
+       var xmlrpc_data =  XMLRPCBuilder.marshal("wp.newPost", params);
+       
+       makeNewPostRequest(sessvars.url, xmlrpc_data);          
+}
+
+function makeNewPostRequest(url, data) {
</ins><span class="cx">   var xhr = new XMLHttpRequest({mozSystem:true});
</span><span class="cx">  xhr.open('POST', url);
</span><span class="cx">  
</span><span class="cx">  xhr.onreadystatechange = function() {
</span><del>-               console.log("Readystate: ", xhr.readyState)
</del><ins>+                console.log("Readystate: ", xhr.readyState);
+               if (xhr.readyState=="4") {
+                       alert("Post Published Successfully!")
+               };
</ins><span class="cx">   }
</span><span class="cx">  
</span><span class="cx">  xhr.onload = function() {
</span><del>-               handleSuccess(xhr);
</del><ins>+                handleNewPostSuccess(xhr);
</ins><span class="cx">   };
</span><span class="cx">  
</span><span class="cx">  xhr.onerror = function() {
</span><del>-               handleError(xhr);
</del><ins>+                handleNewPostError(xhr);
</ins><span class="cx">   };
</span><span class="cx">  
</span><span class="cx">  xhr.send(data);
</span><span class="cx">  return xhr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function handleSuccess(xhr) {
</del><ins>+
+function handleNewPostSuccess(xhr) {
</ins><span class="cx">   document.getElementById("results").innerHTML = xhr.responseText;
</span><span class="cx"> 
</span><span class="cx">  var parser = new XMLRPCParser(xhr.response);
</span><span class="lines">@@ -154,6 +131,7 @@
</span><span class="cx">  
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function handleError(xhr) {
</del><ins>+
+function handleNewPostError(xhr) {
</ins><span class="cx">   document.getElementById("results").innerHTML = "Error: " + xhr.statusText;
</span><span class="cx"> }
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="2013sayaksarkartrunksourcexmlrpcservicejs"></a>
<div class="modfile"><h4>Modified: 2013/sayaksarkar/trunk/source/xmlrpcservice.js (2375 => 2376)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/xmlrpcservice.js   2013-09-23 19:01:31 UTC (rev 2375)
+++ 2013/sayaksarkar/trunk/source/xmlrpcservice.js      2013-09-23 20:32:18 UTC (rev 2376)
</span><span class="lines">@@ -2,6 +2,7 @@
</span><span class="cx"> XMLRPCBuilder = function(methodName, methodParams){
</span><span class="cx">   this.methodName = methodName;
</span><span class="cx">   this.methodParams = methodParams;
</span><ins>+    
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> XMLRPCBuilder.marshal = function(methodName, methodParams){
</span></span></pre>
</div>
</div>

</body>
</html>