<!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>[2375] 2013/sayaksarkar/trunk/source: Package Finalized.</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/2375">2375</a></dd>
<dt>Author</dt> <dd>sayaksarkar</dd>
<dt>Date</dt> <dd>2013-09-23 19:01:31 +0000 (Mon, 23 Sep 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Package Finalized.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#2013sayaksarkartrunksourcecommentsjs">2013/sayaksarkar/trunk/source/comments.js</a></li>
<li><a href="#2013sayaksarkartrunksourcepackagejs">2013/sayaksarkar/trunk/source/package.js</a></li>
<li><a href="#2013sayaksarkartrunksourcepagecomposejs">2013/sayaksarkar/trunk/source/pagecompose.js</a></li>
<li><a href="#2013sayaksarkartrunksourcepagesjs">2013/sayaksarkar/trunk/source/pages.js</a></li>
<li><a href="#2013sayaksarkartrunksourcepostcomposejs">2013/sayaksarkar/trunk/source/postcompose.js</a></li>
<li><a href="#2013sayaksarkartrunksourcepostsjs">2013/sayaksarkar/trunk/source/posts.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#2013sayaksarkartrunksourcepagepreviewjs">2013/sayaksarkar/trunk/source/pagepreview.js</a></li>
<li><a href="#2013sayaksarkartrunksourcepostpreviewjs">2013/sayaksarkar/trunk/source/postpreview.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="2013sayaksarkartrunksourcecommentsjs"></a>
<div class="modfile"><h4>Modified: 2013/sayaksarkar/trunk/source/comments.js (2374 => 2375)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/comments.js        2013-09-23 13:02:04 UTC (rev 2374)
+++ 2013/sayaksarkar/trunk/source/comments.js   2013-09-23 19:01:31 UTC (rev 2375)
</span><span class="lines">@@ -96,6 +96,9 @@
</span><span class="cx">                  window.open("http://wordpress.com/my-stats/");
</span><span class="cx">                  //new wp.Stats().renderInto(document.body);
</span><span class="cx">          }
</span><ins>+               else if (this.menuDatasource[inEvent.index].name == "View Site") {
+                       window.open(sessvars.inputUrl);
+               }
</ins><span class="cx">           else{
</span><span class="cx">                  alert("Functionality on its way!");   
</span><span class="cx">          }
</span></span></pre></div>
<a id="2013sayaksarkartrunksourcepackagejs"></a>
<div class="modfile"><h4>Modified: 2013/sayaksarkar/trunk/source/package.js (2374 => 2375)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/package.js 2013-09-23 13:02:04 UTC (rev 2374)
+++ 2013/sayaksarkar/trunk/source/package.js    2013-09-23 19:01:31 UTC (rev 2375)
</span><span class="lines">@@ -11,9 +11,11 @@
</span><span class="cx">  "postcompose.js",
</span><span class="cx">  "posts.js",
</span><span class="cx">  "postsettings.js",
</span><ins>+       "postpreview.js",
</ins><span class="cx">   "pagecompose.js",
</span><span class="cx">  "pages.js",
</span><span class="cx">  "pagesettings.js",
</span><ins>+       "pagepreview.js",
</ins><span class="cx">   "sessvars.js",
</span><span class="cx">  "comments.js",
</span><span class="cx">  "reader.js",
</span></span></pre></div>
<a id="2013sayaksarkartrunksourcepagecomposejs"></a>
<div class="modfile"><h4>Modified: 2013/sayaksarkar/trunk/source/pagecompose.js (2374 => 2375)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/pagecompose.js     2013-09-23 13:02:04 UTC (rev 2374)
+++ 2013/sayaksarkar/trunk/source/pagecompose.js        2013-09-23 19:01:31 UTC (rev 2375)
</span><span class="lines">@@ -1,8 +1,6 @@
</span><span class="cx"> enyo.kind({
</span><span class="cx">  name: "wp.PageCompose",
</span><del>-       kind: "FittableRows",
-       fit: true,
-       classes: "enyo-fit",
</del><ins>+        kind: "Scroller",
</ins><span class="cx">   components:[
</span><span class="cx"> 
</span><span class="cx">          //Header Toolbar Definition
</span><span class="lines">@@ -11,116 +9,126 @@
</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"}, 
-                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "previewTap", style: "background-color: #21759b; margin-left: 2px;", components: [
-                               {kind: "onyx.Icon", classes: "buttonIcon", id: "preview", src: "images/toolbar/preview.png"}
-                       ]},
-                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "saveDraftTap", style: "background-color: #21759b;", components: [
-                               {kind: "onyx.Icon", classes: "buttonIcon", id: "saveDraft",  src: "images/toolbar/save.png"}
-                       ]},
</del><ins>+                        {content: "New Page", style: "margin-right: 80px;"}, 
</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="cx">          ]},
</span><span class="cx"> 
</span><del>-               {name: "main", classes: "nice-padding", layoutKind:"FittableRowsLayout", fit: true, components: [
</del><ins>+                {name: "previewContent", classes: "nice-margins", tag: "div"},
</ins><span class="cx"> 
</span><ins>+               {name: "main", classes: "nice-padding", touch: true, thumb: true, components: [
+
</ins><span class="cx">                   //Title Input box Definition
</span><ins>+                       {kind: "onyx.InputDecorator", components: [
+                               {kind: "onyx.Input", id: "pageComposeTitle", name: "title", placeholder: "Title", style: "width: 270px;"}
+                       ]},
+                       
+                       //Text Input Area Definition
+                       {kind: "onyx.InputDecorator", layoutKind:"FittableRowsLayout", style: "margin-top: 20px; width: 270px; height: 300px;", components: [
+                               {kind: "onyx.RichText", id: "pageComposeContent", name: "contentField", placeholder: "Content (tap to add text)", fit: true, style: "width: 100%;"}
+                       ]},
+
+                       //Status Menu
</ins><span class="cx">                   {
</span><del>-                                layoutKind:"FittableColumnsLayout", components: [
-                                       {kind: "onyx.InputDecorator", fit: true, components: [
-                                               {kind: "onyx.Input", name: "title", placeholder: "Title"}
-                                       ]}
-                                ]
</del><ins>+                                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"}
+                                               ]
+                                       }
+                               ]
</ins><span class="cx">                   },
</span><span class="cx"> 
</span><del>-                       //Post Text Area Definition
-                       {kind: "onyx.Groupbox", style: "margin-top: 15px; ", layoutKind:"FittableRowsLayout", fit: true, components: [
-/*
-                               //WYSIWYG Toolbar Definition
-                               {kind: "onyx.GroupboxHeader", components: [
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "boldTap", components: [
-                                               {kind: "onyx.Icon", id: "strongButton", content: "B"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "italicTap", components: [
-                                               {kind: "onyx.Icon", id: "emButton", content: "I"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "boldTap", components: [
-                                               {kind: "onyx.Icon", id: "strikethroughButton", content: "ABC"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "underlineTap", components: [
-                                               {kind: "onyx.Icon", id: "uButton", content: "U"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "ulTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "ulButton",  src: "images/compose/icon_ul.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "olTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "olButton",  src: "images/compose/icon_ol.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "blockquoteTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "blockquoteButton",  src: "images/compose/icon_bquote.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "linkTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "linkButton",  src: "images/compose/icon_link.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "moreTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "moreButton",  src: "images/compose/icon_more.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "leftTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "leftButton",  src: "images/compose/icon_left.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "centerTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "centerButton",  src: "images/compose/icon_center.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "rightTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "rightButton",  src: "images/compose/icon_right.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "imageTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "imageButton",  src: "images/compose/icon_camera.png"}
-                                       ]},
-                               ]},
-                               */
-                               //Main Scroller Definition
-                               {kind: "enyo.Scroller", fit: true, horizontal: "hidden", layoutKind:"FittableRowsLayout", touch: true, thumb: true, components: [
-       
-                                       //Text Input Area Definition
-                                       {kind: "onyx.InputDecorator", layoutKind:"FittableRowsLayout", fit: true, style: "width: 100%; height: 100%;", components: [
-                                         {kind: "onyx.RichText", name: "contentField", fit: true, style: "width: 100%;"}
-                                       ]}
-                               ]},
-
-                               //Settings Toolbar Definition
-                               {kind: "onyx.Toolbar", layoutKind:"FittableColumnsLayout", classes: "toolbar", components: [
-                                       {kind: "onyx.Button", content: "Setings", fit: true, style: "background-color: #21759b; margin-bottom:0;", ontap: "settingsTap"}
-                               ]}
-                       ]}
</del><span class="cx">           ]}
</span><span class="cx">  ],
</span><span class="cx">  publishTap: function (inSender, inEvent) {
</span><del>-               this.payLoad = {};
-               this.payLoad.title = this.$.title.getValue();
-               this.payLoad.contentField = this.$.contentField.getValue();
-               console.log(this.payLoad);
-               return this.payLoad;
</del><ins>+                sessvars.pagetitle = this.$.title.getValue();
+               sessvars.pagecontentField = this.$.contentField.getValue();
+               if (this.$.pickerPageStatus.selected != null){
+                       sessvars.pageStatus = this.$.pickerPageStatus.selected.content;
+               }
+               console.log(sessvars.pagetitle + "<br/>" + sessvars.pagecontentField);
+               newPage();
</ins><span class="cx">   },
</span><del>-       previewTap: function (inSender, inEvent) {
-               this.payLoad = {};
-               this.payLoad.title = this.$.title.getValue();
-               this.payLoad.contentField = this.$.contentField.getValue();
-               console.log(this.payLoad);
-               return this.payLoad;
-       },
-       saveDraftTap: function (inSender, inEvent) {
-               this.payLoad = {};
-               this.payLoad.title = this.$.title.getValue();
-               this.payLoad.contentField = this.$.contentField.getValue();
-               console.log(this.payLoad);
-               return this.payLoad;
-       },
</del><span class="cx">   backTap: function(inSender, inEvent) {
</span><span class="cx">          new wp.Pages().renderInto(document.body);
</span><del>-       },
-       settingsTap: function(inSender, inEvent) {
-               new wp.PageSettings().renderInto(document.body);
</del><span class="cx">   }
</span><span class="cx"> });
</span><ins>+
+function newPage() {
+
+       var content = {
+               "title": sessvars.pagetitle,
+               "description" : sessvars.pagecontentField
+       };
+
+       var params = [sessvars.blogId, sessvars.username, sessvars.password, content];
+       var xmlrpc_data =  XMLRPCBuilder.marshal("wp.newPost", params);
+       
+       makeRequest(sessvars.url, xmlrpc_data);         
+}
+
+
+function makeNewPageRequest(url, data) {
+       var xhr = new XMLHttpRequest({mozSystem:true});
+       xhr.open('POST', url);
+       
+       xhr.onreadystatechange = function() {
+               console.log("Readystate: ", xhr.readyState);
+               if (xhr.readyState=="4") {
+                       alert("Page Published Successfully!")
+               };
+       }
+       
+       xhr.onload = function() {
+               handleNewPageSuccess(xhr);
+       };
+       
+       xhr.onerror = function() {
+               handleNewPageError(xhr);
+       };
+       
+       xhr.send(data);
+       return xhr;
+}
+
+
+function handleNewPageSuccess(xhr) {
+       document.getElementById("results").innerHTML = xhr.responseText;
+
+       var parser = new XMLRPCParser(xhr.response);
+       var json = parser.toObject();
+       var fault = parser.fault;
+       console.log(fault);
+
+       if (json instanceof Array) {
+               for (var i = 0; i < json.length; i++) {
+                       var obj = json[i];
+                       for(var key in obj) {
+                               console.log(key, obj[key]);
+                       }
+               }
+       } else {
+                console.log(json);
+       }
+       
+}
+
+
+function handleNewPageError(xhr) {
+       document.getElementById("results").innerHTML = "Error: " + xhr.statusText;
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="2013sayaksarkartrunksourcepagepreviewjs"></a>
<div class="addfile"><h4>Added: 2013/sayaksarkar/trunk/source/pagepreview.js (0 => 2375)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/pagepreview.js                             (rev 0)
+++ 2013/sayaksarkar/trunk/source/pagepreview.js        2013-09-23 19:01:31 UTC (rev 2375)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+enyo.kind({
+       name: "wp.PagePreview",
+       kind: "Scroller",
+       components:[
+               //Header Toolbar Definition
+               {kind: "onyx.Toolbar", layoutKind:"FittableColumnsLayout", classes: "toolbar", components: [
+                       {kind: "onyx.Button", ontap: "backTap", style: "background-color: #21759b; width: 10px; margin-top: 10px; margin-left: -10px; margin-right: 4px; padding-top: 7px; padding-right: 0px;", components: [
+                               {kind: "onyx.Icon", src: "images/toolbar/back.png", ontap: "backTap", style: "height: 38px;"},
+                       ]},
+                       {kind: "onyx.Icon", src: "images/toolbar/wp.png", style: "margin-left: 5px; margin-right: 4px; height: 38px; width: 38px;"},
+                       {content: "Post Preview"}
+               ]},
+               {tag: "div", id: "previewContainer", components: [
+                       {tag: "div", name: "pagePreviewTitle"},
+                       {tag: "div", name: "pagePreviewContent"}
+               ]}
+       ],
+       create: function (inSender, inEvent) {
+               //generatePreview();
+       },
+       backTap: function(inSender, inEvent) {
+               new wp.PageCompose().renderInto(document.body);
+               populatePageComposer();
+       },
+});
+
+/*function generatePreview(inSender, inEvent) {
+       var titleElement = document.createElement("div");
+       titleElement.innerHTML = sessvars.pagetitle;
+       titleElement.id = "pagePreviewTitle";
+       document.getElementById("previewContainer").appendChild(titleElement);
+       
+       var contentElement = document.createElement("div");
+       contentElement.innerHTML = sessvars.pagecontentField;
+       contentElement.id = "pagePreviewContent";
+       document.getElementById("previewContainer").appendChild(contentElement);
+}*/
</ins></span></pre></div>
<a id="2013sayaksarkartrunksourcepagesjs"></a>
<div class="modfile"><h4>Modified: 2013/sayaksarkar/trunk/source/pages.js (2374 => 2375)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/pages.js   2013-09-23 13:02:04 UTC (rev 2374)
+++ 2013/sayaksarkar/trunk/source/pages.js      2013-09-23 19:01:31 UTC (rev 2375)
</span><span class="lines">@@ -96,6 +96,9 @@
</span><span class="cx">                  window.open("http://wordpress.com/my-stats/");
</span><span class="cx">                  //new wp.Stats().renderInto(document.body);
</span><span class="cx">          }
</span><ins>+               else if (this.menuDatasource[inEvent.index].name == "View Site") {
+                       window.open(sessvars.inputUrl);
+               }
</ins><span class="cx">           else{
</span><span class="cx">                  alert("Functionality on its way!");   
</span><span class="cx">          }
</span></span></pre></div>
<a id="2013sayaksarkartrunksourcepostcomposejs"></a>
<div class="modfile"><h4>Modified: 2013/sayaksarkar/trunk/source/postcompose.js (2374 => 2375)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/postcompose.js     2013-09-23 13:02:04 UTC (rev 2374)
+++ 2013/sayaksarkar/trunk/source/postcompose.js        2013-09-23 19:01:31 UTC (rev 2375)
</span><span class="lines">@@ -1,8 +1,6 @@
</span><span class="cx"> enyo.kind({
</span><span class="cx">  name: "wp.PostCompose",
</span><del>-       kind: "FittableRows",
-       fit: true,
-       classes: "enyo-fit",
</del><ins>+        kind: "Scroller",
</ins><span class="cx">   components:[
</span><span class="cx"> 
</span><span class="cx">          //Header Toolbar Definition
</span><span class="lines">@@ -11,116 +9,151 @@
</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"}, 
-                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "previewTap", style: "background-color: #21759b;", components: [
-                               {kind: "onyx.Icon", classes: "buttonIcon", id: "preview", src: "images/toolbar/preview.png"}
-                       ]},
-                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "saveDraftTap", style: "background-color: #21759b;", components: [
-                               {kind: "onyx.Icon", classes: "buttonIcon", id: "saveDraft",  src: "images/toolbar/save.png"}
-                       ]},
</del><ins>+                        {content: "New Post", style: "margin-right: 80px;"}, 
</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="cx">          ]},
</span><span class="cx"> 
</span><del>-               {name: "main", classes: "nice-padding", layoutKind:"FittableRowsLayout", fit: true, components: [
</del><span class="cx"> 
</span><ins>+               {name: "previewContent", classes: "nice-margins", tag: "div"},
+
+               {name: "main", classes: "nice-padding", touch: true, thumb: true, components: [
+
</ins><span class="cx">                   //Title Input box Definition
</span><ins>+                       {kind: "onyx.InputDecorator", components: [
+                               {kind: "onyx.Input", name: "title", placeholder: "Title", style: "width: 270px;"}
+                       ]},
+                       
+                       //Text Input Area Definition
+                       {kind: "onyx.InputDecorator", layoutKind:"FittableRowsLayout", style: "margin-top: 20px; width: 270px; height: 300px;", components: [
+                               {kind: "onyx.RichText", name: "contentField", placeholder: "Content (tap to add text)", fit: true, style: "width: 100%;"}
+                       ]},
+
+                       //Status Menu
</ins><span class="cx">                   {
</span><del>-                                layoutKind:"FittableColumnsLayout", components: [
-                                       {kind: "onyx.InputDecorator", fit: true, components: [
-                                               {kind: "onyx.Input", name: "title", placeholder: "Title"}
-                                       ]}
-                                ]
</del><ins>+                                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"}
+                                               ]
+                                       }
+                               ]
</ins><span class="cx">                   },
</span><span class="cx"> 
</span><del>-                       //Post Text Area Definition
-                       {kind: "onyx.Groupbox", style: "margin-top: 15px; ", layoutKind:"FittableRowsLayout", fit: true, components: [
-/*
-                               //WYSIWYG Toolbar Definition
-                               {kind: "onyx.GroupboxHeader", components: [
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "boldTap", components: [
-                                               {kind: "onyx.Icon", id: "strongButton", content: "B"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "italicTap", components: [
-                                               {kind: "onyx.Icon", id: "emButton", content: "I"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "boldTap", components: [
-                                               {kind: "onyx.Icon", id: "strikethroughButton", content: "ABC"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "underlineTap", components: [
-                                               {kind: "onyx.Icon", id: "uButton", content: "U"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "ulTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "ulButton",  src: "images/compose/icon_ul.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "olTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "olButton",  src: "images/compose/icon_ol.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "blockquoteTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "blockquoteButton",  src: "images/compose/icon_bquote.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "linkTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "linkButton",  src: "images/compose/icon_link.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "moreTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "moreButton",  src: "images/compose/icon_more.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "leftTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "leftButton",  src: "images/compose/icon_left.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "centerTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "centerButton",  src: "images/compose/icon_center.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "rightTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "rightButton",  src: "images/compose/icon_right.png"}
-                                       ]},
-                                       {kind: "onyx.Button", classes: "toolbarButton", ontap: "imageTap", components: [
-                                               {kind: "onyx.Icon", classes: "buttonIcon", id: "imageButton",  src: "images/compose/icon_camera.png"}
-                                       ]},
-                               ]},
-                               */
-                               //Main Scroller Definition
-                               {kind: "enyo.Scroller", fit: true, horizontal: "hidden", layoutKind:"FittableRowsLayout", touch: true, thumb: true, components: [
-       
-                                       //Text Input Area Definition
-                                       {kind: "onyx.InputDecorator", layoutKind:"FittableRowsLayout", fit: true, style: "width: 100%; height: 100%;", components: [
-                                         {kind: "onyx.RichText", name: "contentField", fit: true, style: "width: 100%;"}
-                                       ]}
-                               ]},
-
-                               //Settings Toolbar Definition
-                               {kind: "onyx.Toolbar", layoutKind:"FittableColumnsLayout", classes: "toolbar", components: [
-                                       {kind: "onyx.Button", content: "Setings", fit: true, style: "background-color: #21759b; margin-bottom:0;", ontap: "settingsTap"}
-                               ]}
-                       ]}
</del><ins>+                        //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"}
+                                               ]
+                                       }
+                               ]
+                       },
</ins><span class="cx">           ]}
</span><span class="cx">  ],
</span><span class="cx">  publishTap: function (inSender, inEvent) {
</span><del>-               this.payLoad = {};
-               this.payLoad.title = this.$.title.getValue();
-               this.payLoad.contentField = this.$.contentField.getValue();
-               console.log(this.payLoad);
-               return this.payLoad;
</del><ins>+                sessvars.postTitle = this.$.title.getValue();
+               sessvars.postcontentField = this.$.contentField.getValue();
+               if (this.$.pickerPostStatus.selected != null){
+                       sessvars.postStatus = this.$.pickerPostStatus.selected.content;
+               }
+               if (this.$.pickerPostFormat.selected != null){
+                       sessvars.postFormat = this.$.pickerPostFormat.selected.content;
+               }
+               console.log(sessvars.postTitle + "<br/>" + sessvars.postcontentField);
+               newPost();
</ins><span class="cx">   },
</span><del>-       previewTap: function (inSender, inEvent) {
-               this.payLoad = {};
-               this.payLoad.title = this.$.title.getValue();
-               this.payLoad.contentField = this.$.contentField.getValue();
-               console.log(this.payLoad);
-               return this.payLoad;
-       },
-       saveDraftTap: function (inSender, inEvent) {
-               this.payLoad = {};
-               this.payLoad.title = this.$.title.getValue();
-               this.payLoad.contentField = this.$.contentField.getValue();
-               console.log(this.payLoad);
-               return this.payLoad;
-       },
</del><span class="cx">   backTap: function(inSender, inEvent) {
</span><span class="cx">          new wp.Posts().renderInto(document.body);
</span><del>-       },
-       settingsTap: function(inSender, inEvent) {
-               new wp.PostSettings().renderInto(document.body);
</del><span class="cx">   }
</span><span class="cx"> });
</span><ins>+
+
+function newPost() {
+
+       var content = {
+               "post_title": sessvars.posttitle,
+               "post_content": sessvars.postcontentField
+       };
+
+       var params = [sessvars.blogId, sessvars.username, sessvars.password, content];
+       var xmlrpc_data =  XMLRPCBuilder.marshal("wp.newPost", params);
+       
+       makeRequest(sessvars.url, xmlrpc_data);         
+}
+
+function makeRequest(url, data) {
+       var xhr = new XMLHttpRequest({mozSystem:true});
+       xhr.open('POST', url);
+       
+       xhr.onreadystatechange = function() {
+               console.log("Readystate: ", xhr.readyState)
+       }
+       
+       xhr.onload = function() {
+               handleSuccess(xhr);
+       };
+       
+       xhr.onerror = function() {
+               handleError(xhr);
+       };
+       
+       xhr.send(data);
+       return xhr;
+}
+
+function handleSuccess(xhr) {
+       document.getElementById("results").innerHTML = xhr.responseText;
+
+       var parser = new XMLRPCParser(xhr.response);
+       var json = parser.toObject();
+       var fault = parser.fault;
+       console.log(fault);
+
+       if (json instanceof Array) {
+               for (var i = 0; i < json.length; i++) {
+                       var obj = json[i];
+                       for(var key in obj) {
+                               console.log(key, obj[key]);
+                       }
+               }
+       } else {
+                console.log(json);
+       }
+       
+}
+
+function handleError(xhr) {
+       document.getElementById("results").innerHTML = "Error: " + xhr.statusText;
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="2013sayaksarkartrunksourcepostpreviewjs"></a>
<div class="addfile"><h4>Added: 2013/sayaksarkar/trunk/source/postpreview.js (0 => 2375)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/postpreview.js                             (rev 0)
+++ 2013/sayaksarkar/trunk/source/postpreview.js        2013-09-23 19:01:31 UTC (rev 2375)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+enyo.kind({
+       name: "wp.PostPreview",
+       kind: "Scroller",
+       components: [
+               //Header Toolbar Definition
+               {kind: "onyx.Toolbar", layoutKind:"FittableColumnsLayout", classes: "toolbar", components: [
+                       {kind: "onyx.Button", ontap: "backTap", style: "background-color: #21759b; width: 10px; margin-top: 10px; margin-left: -10px; margin-right: 4px; padding-top: 7px; padding-right: 0px;", components: [
+                               {kind: "onyx.Icon", src: "images/toolbar/back.png", ontap: "backTap", style: "height: 38px;"},
+                       ]},
+                       {kind: "onyx.Icon", src: "images/toolbar/wp.png", style: "margin-left: 5px; margin-right: 4px; height: 38px; width: 38px;"},
+                       {content: "Post Preview"}
+               ]},
+
+
+       ],
+       backTap: function(inSender, inEvent) {
+               new wp.PostCompose().renderInto(document.body);
+               populatePostComposer();
+       },
+});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="2013sayaksarkartrunksourcepostsjs"></a>
<div class="modfile"><h4>Modified: 2013/sayaksarkar/trunk/source/posts.js (2374 => 2375)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/sayaksarkar/trunk/source/posts.js   2013-09-23 13:02:04 UTC (rev 2374)
+++ 2013/sayaksarkar/trunk/source/posts.js      2013-09-23 19:01:31 UTC (rev 2375)
</span><span class="lines">@@ -96,6 +96,9 @@
</span><span class="cx">                  window.open("http://wordpress.com/my-stats/");
</span><span class="cx">                  //new wp.Stats().renderInto(document.body);
</span><span class="cx">          }
</span><ins>+               else if (this.menuDatasource[inEvent.index].name == "View Site") {
+                       window.open(sessvars.inputUrl);
+               }
</ins><span class="cx">           else{
</span><span class="cx">                  alert("Functionality on its way!");   
</span><span class="cx">          }
</span></span></pre>
</div>
</div>

</body>
</html>