[xiph-commits] r15149 - trunk/oggPusher/firefox-extension/chrome/content
nithin at svn.xiph.org
nithin at svn.xiph.org
Sun Aug 3 06:12:28 PDT 2008
Author: nithin
Date: 2008-08-03 06:12:26 -0700 (Sun, 03 Aug 2008)
New Revision: 15149
Modified:
trunk/oggPusher/firefox-extension/chrome/content/op_Window.js
trunk/oggPusher/firefox-extension/chrome/content/op_Window.xul
Log:
update of gui and updation progress. still not functional
Modified: trunk/oggPusher/firefox-extension/chrome/content/op_Window.js
===================================================================
--- trunk/oggPusher/firefox-extension/chrome/content/op_Window.js 2008-08-02 22:16:08 UTC (rev 15148)
+++ trunk/oggPusher/firefox-extension/chrome/content/op_Window.js 2008-08-03 13:12:26 UTC (rev 15149)
@@ -1,26 +1,53 @@
-var opwindowCommon={leafName:null, timer:null,
+var opwindowCommon={leafName:null, timer:null,isOgg:null,
openFileWindowDialog:function()
{
//alert("Inside openFileWindowDialog");
try{
- const nsIFilePicker = Components.interfaces.nsIFilePicker;
+ const nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
- fp.init(window, "Choose a File", nsIFilePicker.modeOpen);
- fp.appendFilters(nsIFilePicker.filterAll | nsIFilePicker.filterText);
+ fp.init(window, "Choose a File", nsIFilePicker.modeOpen);
+ fp.appendFilters(nsIFilePicker.filterAll | nsIFilePicker.filterText);
}
catch(err){
alert(err);
return;
}
- var rv = fp.show();
- if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) {
- var file = fp.file;
- var path = fp.file.path;
- //alert(fp.file.leafName);
- this.leafName = fp.file.leafName;
+
+ var rv = fp.show();
+ if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) {
+ var file = fp.file;
+ var path = fp.file.path;
+ //alert(fp.file.leafName);
+ this.leafName = fp.file.leafName;
parent.document.getElementById("file-path").value = path;
- }
+ this.appendActionButton();
+
+ }
+
},
+ isOggFormat:function(){
+
+ },
+ appendActionButton:function(){
+
+ var hboxParent = document.getElementById("op-input");
+
+ var actionButton = document.getElementById("action-button");
+ if(actionButton == null){
+ actionButton = document.createElement("button");
+ actionButton.setAttribute("id","action-button");
+ actionButton.setAttribute("oncommand","actionButtonHandler();");
+ actionButton.setAttribute("image","chrome://oggPusher/content/images/xiph.ico");
+ actionButton.setAttribute("orient","vertical");
+ actionButton.setAttribute("label","Upload Audio/Video");
+ hboxParent.appendChild(actionButton);
+ }
+ },
+ actionButtonHandler:function(){
+
+
+
+ },
chooseDestination:function()
{
try{
@@ -87,35 +114,36 @@
myComponentTestGo:function()
{
//alert("Start of MyComponentTestGo()");
- try {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- const cid = "@mydomain.com/XPCOMSample/MyComponent;1";
- obj = Components.classes[cid].createInstance();
- obj = obj.QueryInterface(Components.interfaces.IMyComponent);
- }
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ const cid = "@mydomain.com/XPCOMSample/MyComponent;1";
+ obj = Components.classes[cid].createInstance();
+ obj = obj.QueryInterface(Components.interfaces.IMyComponent);
+ }
catch (err)
{
- alert(err);
- return;
- }
- var res = obj.Add(3, 4);
- alert('Performing 3+4. Returned ' + res + '.');
+ alert(err);
+ return;
+ }
+ var res = obj.Add(3, 4);
+ alert('Performing 3+4. Returned ' + res + '.');
},
uploadFile:function()
{
- var textboxObj = document.getElementById("file-path");
- //alert(textboxObj);
- var filePath = textboxObj.value;
- //alert(filePath);
- var file = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
- file.initWithPath(filePath);
- var fstream = Components.classes['@mozilla.org/network/file-input-stream;1'].createInstance(Components.interfaces.nsIFileInputStream);
- fstream.init(file, 1, 1, Components.interfaces.nsIFileInputStream.CLOSE_ON_EOF);
- var bstream = Components.classes['@mozilla.org/network/buffered-input-stream;1'].createInstance(Components.interfaces.nsIBufferedInputStream);
- bstream.init(fstream, 4096);
- var binary = Components.classes["@mozilla.org/binaryinputstream;1"].createInstance(Components.interfaces.nsIBinaryInputStream);
- binary.setInputStream(fstream);
- xhr = new XMLHttpRequest();
+ var textboxObj = document.getElementById("file-path");
+ //alert(textboxObj);
+ var filePath = textboxObj.value;
+ //alert(filePath);
+
+ var file = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
+ file.initWithPath(filePath);
+ var fstream = Components.classes['@mozilla.org/network/file-input-stream;1'].createInstance(Components.interfaces.nsIFileInputStream);
+ fstream.init(file, 1, 1, Components.interfaces.nsIFileInputStream.CLOSE_ON_EOF);
+ var bstream = Components.classes['@mozilla.org/network/buffered-input-stream;1'].createInstance(Components.interfaces.nsIBufferedInputStream);
+ bstream.init(fstream, 4096);
+ var binary = Components.classes["@mozilla.org/binaryinputstream;1"].createInstance(Components.interfaces.nsIBinaryInputStream);
+ binary.setInputStream(fstream);
+ xhr = new XMLHttpRequest();
@@ -132,12 +160,11 @@
//alert(requestbody);
- xhr.onreadystatechange = function() { if(this.readyState == 4) {}}
+ xhr.onreadystatechange = function() { if(this.readyState == 4) {alert("Uploading Done Successfully.");}}
xhr.open("POST", "http://www.it.iitb.ac.in/~nithind/post.php", true);
xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=\""+ boundaryString + "\"");
xhr.setRequestHeader("Connection", "close");
xhr.setRequestHeader("Content-length", requestbody.length);
- //alert(requestbody.length);
xhr.send(requestbody);
Modified: trunk/oggPusher/firefox-extension/chrome/content/op_Window.xul
===================================================================
--- trunk/oggPusher/firefox-extension/chrome/content/op_Window.xul 2008-08-02 22:16:08 UTC (rev 15148)
+++ trunk/oggPusher/firefox-extension/chrome/content/op_Window.xul 2008-08-03 13:12:26 UTC (rev 15149)
@@ -9,23 +9,22 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- Other elements go here -->
- <script type="application/x-javascript" src="chrome://oggPusher/content/op_Window.js"></script>
- <vbox>
- <label value="Locate Files on your computer:" control="browse-button"/>
- <hbox>
- <textbox id="file-path" control="browse-button" disabled="true" style="width:400px"/>
- <button id="browse-button" label="Browse..." oncommand="opwindowCommon.openFileWindowDialog();"/>
- </hbox>
- <hbox>
- <textbox id="target-path" control="destination-button" disabled="true" style="width:400px"/>
- <button id="destination-button" label="Choose Destination" oncommand="opwindowCommon.chooseDestination();"/>
- </hbox>
- <hbox>
- <button id="upload-button" label="Upload" oncommand="opwindowCommon.uploadFile();"/>
- <button id="convert-button" label="Convert" oncommand="opwindowCommon.convertToTheora();"/>
- </hbox>
+ <script type="application/x-javascript" src="chrome://oggPusher/content/op_Window.js"></script>
+ <vbox >
+ <label value="Locate Files on your computer:" control="browse-button"/>
+ <hbox id="op-input">
+ <textbox id="file-path" control="browse-button" disabled="true" style="width:400px"/>
+ <button id="browse-button" label="Browse..." oncommand="opwindowCommon.openFileWindowDialog();"/>
+ </hbox>
+ <hbox>
+ <textbox id="target-path" control="destination-button" disabled="true" style="width:400px"/>
+ <button id="destination-button" label="Choose Destination" oncommand="opwindowCommon.chooseDestination();"/>
+ </hbox>
+ <hbox>
+ <button id="upload-button" label="Upload" oncommand="opwindowCommon.uploadFile();"/>
+ <button id="convert-button" label="Convert" oncommand="opwindowCommon.convertToTheora();"/>
+ </hbox>
+ </vbox>
- </vbox>
-
</window>
More information about the commits
mailing list