Permalink
Browse files

Now a new space URL can be passed to the OpenSpace directory. Yet the…

… directory itself gets not reloaded.
  • Loading branch information...
1 parent cc0ad0f commit 76f309e3abe4d65dd7d2f500844e22f615f30449 slopjong committed Mar 9, 2012
Showing with 27 additions and 5 deletions.
  1. +1 −0 chrome.manifest
  2. +21 −2 chrome/content/openspace.js
  3. +1 −3 chrome/content/openspace.xul
  4. +4 −0 chrome/skin/openspace.css
View
@@ -3,6 +3,7 @@ content openspace chrome/content/
skin openspace classic/1.0 chrome/skin/
overlay chrome://browser/content/browser.xul chrome://openspace/content/openspace.xul
+#overlay chrome://browser/content/browser.xul chrome://openspace/content/add-hackerspace.xul
#style chrome://browser/content/browser.xul chrome://openspace/skin/openspace.css
resource openspace modules/
@@ -44,9 +44,15 @@ var openspace = {
.getService(Components.interfaces.nsIPrefService)
.getBranch( "extensions.openspace." );
- // attach event handlers to the panel
+ // attach an event handlers to the panel
jQuery("#spaces-list").select(this.saveMyspace);
+
+ //attach an event handler to the 'add' label
jQuery("#add-hackerspace").click(this.addSpace);
+
+ // attach an event handler to the submit button
+ jQuery("#add-hackerspace-submit").click(this.submitSpace);
+
//jQuery("#refresh-interval").change(this.saveRefreshInterval);
registerOpenSpaceObserver(this);
@@ -179,7 +185,20 @@ var openspace = {
},
addSpace: function(){
- //alert("test");
+ // jQuery(...).show() doesn't work
+ jQuery("#add-hackerspace-submit").css("display","block");
+ jQuery("#space-url-input").css("display","block");
+ jQuery("#add-hackerspace").hide();
+
+ },
+
+ submitSpace: function(){
+ var url = jQuery("#space-url-input").val();
+ gBrowser.selectedTab = gBrowser.addTab("http://openspace.slopjong.de/#add=" + url);
+ jQuery("#space-url-input").val("");
+ jQuery("#space-url-input").hide();
+ jQuery("#add-hackerspace-submit").hide();
+ jQuery("#add-hackerspace").css("display","block");
}
};
@@ -12,9 +12,7 @@
<!-- noautohide="true" style="-moz-appearance: none" -->
<panel id="thepanel" type="arrow" onpopupshowing="openspace.initPanel();" position="before_end">
<vbox align="stretch">
- <!--
- <hbox align="right"><label id="add-hackerspace">Add a hackerspace</label></hbox>
- -->
+ <hbox align="right"><textbox id="space-url-input" value="" /><button id="add-hackerspace-submit" label="Add"/><label id="add-hackerspace">Add a hackerspace</label></hbox>
<listbox id="spaces-list">
</listbox>
<hbox>
@@ -65,4 +65,8 @@ label {
#add-hackerspace:hover {
color: #000000;
+}
+
+#add-hackerspace-submit, #space-url-input{
+ display: none;
}

0 comments on commit 76f309e

Please sign in to comment.