Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
smart collaboration sidebar that toggles depending on your setting
  • Loading branch information
Dion Almaer committed Aug 5, 2009
1 parent 94b633e commit 429df10
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
9 changes: 7 additions & 2 deletions frontend/css/editor.css
Expand Up @@ -264,6 +264,10 @@ body {
background-repeat: repeat-y; background-repeat: repeat-y;
} }


#collab a {
color: #eee;
}

#collab_header { #collab_header {
background-image: url("../images/collab_hdr_bg.gif"); background-image: url("../images/collab_hdr_bg.gif");
height: 32px; height: 32px;
Expand All @@ -277,20 +281,21 @@ body {
padding: 5px 0 0 9px; padding: 5px 0 0 9px;
} }


.collab_subheader { #collab_on .collab_subheader {
background-image: url("../images/collab_categorybar_bg.gif"); background-image: url("../images/collab_categorybar_bg.gif");
margin-left: 10px; margin-left: 10px;
height: 23px; height: 23px;
} }


.collab_subheader div { #collab_on .collab_subheader div {
font-family: Calibri, Arial, sans-serif; font-family: Calibri, Arial, sans-serif;
font-size: 10pt; font-size: 10pt;
color: #dad4ba; color: #dad4ba;
padding: 3px 0 0 9px; padding: 3px 0 0 9px;
} }


.collab_text { .collab_text {
margin-top: 10px;
margin-left: 10px; margin-left: 10px;
font-family: Calibri, Arial, sans-serif; font-family: Calibri, Arial, sans-serif;
font-size: 10pt; font-size: 10pt;
Expand Down
20 changes: 17 additions & 3 deletions frontend/editor.html
Expand Up @@ -188,10 +188,24 @@
</div> </div>
<div id="collab"> <div id="collab">
<div id="collab_header"><div>Collaboration</div></div> <div id="collab_header"><div>Collaboration</div></div>
<div class="collab_subheader"><div>Users editing this file:</div></div> <div id="collab_off" style="display:none">
<div id="collab_list"> <div class="collab_text">
Collaboration is a beta feature. You have it turned off right now.
<p>
Would you like to <a href="javascript:void(0);" onclick="bespin.publish('settings:set:collaborate', { value: 'on' });" title="Runs: set collaborate on">turn it on?</a>
</p><p>
After you do so, check out the <a href="https://wiki.mozilla.org/Labs/Bespin/UserGuide#Collaboration">tutorial on how to use it</a>.
</p>
</div>
</div>
<div id="collab_on" style="display:none">
<div class="collab_subheader"><div>Users editing this file:</div></div>
<div id="collab_list">
</div>
<div class="collab_text">Collaboration is a beta feature. Thanks for trying it out.<br><br>
Would you like to <a href="javascript:void(0);" onclick="bespin.publish('settings:set:collaborate', { value: 'off' });" title="Runs: set collaborate off">turn it off?</a>
</div>
</div> </div>
<div class="collab_text" style="margin-top: 10px">Collaboration is a beta feature.</div>
</div> </div>
<!-- debugbar HTML should move to a plugin --> <!-- debugbar HTML should move to a plugin -->
<div id="debugbar"> <div id="debugbar">
Expand Down
8 changes: 8 additions & 0 deletions frontend/js/bespin/client/session.js
Expand Up @@ -270,6 +270,14 @@ dojo.declare("bespin.client.session.EditSession", null, {
getStatus: function() { getStatus: function() {
var file = this.path || 'a new scratch file'; var file = this.path || 'a new scratch file';
return 'Hey ' + this.username + ', you are editing ' + file + ' in project ' + this.project; return 'Hey ' + this.username + ', you are editing ' + file + ' in project ' + this.project;
},

/**
* If true is passed in, turn off the collab_off "off mode" of the sidebar, and turn on the collab_on mode, else do the opposite
*/
setCollaborateSidebar: function(on) {
dojo.style("collab_off", "display", on ? "none" : "block");
dojo.style("collab_on", "display", on ? "block" : "none");
} }
}); });


Expand Down
1 change: 1 addition & 0 deletions frontend/js/bespin/client/settings.js
Expand Up @@ -548,6 +548,7 @@ dojo.declare("bespin.client.settings.Events", null, {
// Turn on the collaboration system if set to be on // Turn on the collaboration system if set to be on
bespin.subscribe("settings:set:collaborate", function(event) { bespin.subscribe("settings:set:collaborate", function(event) {
editSession.collaborate = settings.isOn(event.value); editSession.collaborate = settings.isOn(event.value);
editSession.setCollaborateSidebar(settings.isOn(event.value));
}); });


// ** {{{ Event: settings:set:fontsize }}} ** // ** {{{ Event: settings:set:fontsize }}} **
Expand Down

0 comments on commit 429df10

Please sign in to comment.