Skip to content

Commit

Permalink
Now a new space URL can be passed to the OpenSpace directory. Yet the…
Browse files Browse the repository at this point in the history
… directory itself gets not reloaded.
  • Loading branch information
slopjong committed Mar 9, 2012
1 parent cc0ad0f commit 76f309e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
1 change: 1 addition & 0 deletions chrome.manifest
Expand Up @@ -3,6 +3,7 @@ content openspace chrome/content/
skin openspace classic/1.0 chrome/skin/ 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/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 #style chrome://browser/content/browser.xul chrome://openspace/skin/openspace.css


resource openspace modules/ resource openspace modules/
23 changes: 21 additions & 2 deletions chrome/content/openspace.js
Expand Up @@ -44,9 +44,15 @@ var openspace = {
.getService(Components.interfaces.nsIPrefService) .getService(Components.interfaces.nsIPrefService)
.getBranch( "extensions.openspace." ); .getBranch( "extensions.openspace." );


// attach event handlers to the panel // attach an event handlers to the panel
jQuery("#spaces-list").select(this.saveMyspace); jQuery("#spaces-list").select(this.saveMyspace);

//attach an event handler to the 'add' label
jQuery("#add-hackerspace").click(this.addSpace); 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); //jQuery("#refresh-interval").change(this.saveRefreshInterval);


registerOpenSpaceObserver(this); registerOpenSpaceObserver(this);
Expand Down Expand Up @@ -179,7 +185,20 @@ var openspace = {
}, },


addSpace: function(){ 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");
} }
}; };


Expand Down
4 changes: 1 addition & 3 deletions chrome/content/openspace.xul
Expand Up @@ -12,9 +12,7 @@
<!-- noautohide="true" style="-moz-appearance: none" --> <!-- noautohide="true" style="-moz-appearance: none" -->
<panel id="thepanel" type="arrow" onpopupshowing="openspace.initPanel();" position="before_end"> <panel id="thepanel" type="arrow" onpopupshowing="openspace.initPanel();" position="before_end">
<vbox align="stretch"> <vbox align="stretch">
<!-- <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>
<hbox align="right"><label id="add-hackerspace">Add a hackerspace</label></hbox>
-->
<listbox id="spaces-list"> <listbox id="spaces-list">
</listbox> </listbox>
<hbox> <hbox>
Expand Down
4 changes: 4 additions & 0 deletions chrome/skin/openspace.css
Expand Up @@ -65,4 +65,8 @@ label {


#add-hackerspace:hover { #add-hackerspace:hover {
color: #000000; color: #000000;
}

#add-hackerspace-submit, #space-url-input{
display: none;
} }

0 comments on commit 76f309e

Please sign in to comment.