Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: joekr/D-D-Leaderboard
base: 2272ccb32f
...
head fork: joekr/D-D-Leaderboard
compare: 0eb53cd04b
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Sep 09, 2012
@moneypenny moneypenny Listing buff source, delete button in dashboard
Consolidating DM scratchpad and party buff tabs into one dashboard.
Adding delete button with confirmation to buff list in dashboard.
Defaulting 'enemy?' checkbox to checked for Jon's sake.  Displaying the
source character name for buffs in buff list.  Removing some debug
statements.
0eb53cd
Showing with 92 additions and 59 deletions.
  1. +34 −3 client/dnd.css
  2. +36 −39 client/dnd.html
  3. +22 −17 client/dnd.js
View
37 client/dnd.css
@@ -7,12 +7,15 @@
border-top-color: #DBC300
}
body.dm {
-
}
body.dm div.dm,
body.dm fieldset.dm,
+ body.dm div.tab-pane.active.dm,
body.dm .row-fluid .dm[class*="span"] {
- display: block
+ display: block;
+ }
+ body.dm li.dm {
+ display: list-item;
}
body.dm .navbar .brand {
color: #D0EEB8
@@ -43,6 +46,24 @@ body.dm {
.btn + .btn {
margin-left: 5px
}
+.buff-list {
+ padding-left: 0;
+ margin-left: 0;
+ list-style: none;
+}
+ .buff-list li + li {
+ border-top: 1px solid #dddddd;
+ margin-top: 5px;
+ padding-top: 5px;
+ }
+.buff-name {
+ font-weight: bold;
+ display: block;
+}
+.buff-sep {
+}
+.buff-source {
+}
.character-blinded.control-group label {
background-image: url('/icon-blind.svg');
-o-background-size: 16px 100%;
@@ -82,6 +103,10 @@ body.dm {
background-image: url('/icon-sleep.png');
padding-left: 20px;
}
+div.dm,
+div.dm.tab-pane.active {
+ display: none;
+}
td.char-damage {
font-size: 200%;
font-weight: 700;
@@ -128,7 +153,7 @@ div.control-group.dm,
fieldset.dm,
.navbar fieldset.dm,
.row-fluid .dm[class*="span"] {
- display: none
+ display: none;
}
footer {
color: #B4B4B4
@@ -181,6 +206,9 @@ input.error {
label[for] {
cursor: pointer
}
+li.dm {
+ display: none;
+}
.navbar-inner {
-webkit-border-radius: 0;
-moz-border-radius: 0;
@@ -324,6 +352,9 @@ input[type="number"] {
.sub-enemy-name-form {
display: none
}
+.tab-pane ul {
+ margin-top: 0.5em;
+}
td.dm,
th.dm {
display: none
View
75 client/dnd.html
@@ -93,7 +93,7 @@
<input type="number" id="char-dmg" placeholder="~Dmg">
</div>
<div class="control-group">
- <input type="checkbox" id="new-enemy">
+ <input type="checkbox" id="new-enemy" checked="checked">
<label for="new-enemy">Enemy?</label>
</div>
<div class="form-actions">
@@ -117,60 +117,57 @@
</tr>
</template>
-<template name="scratch_pad">
+<template name="dashboard">
<div class="icon-save" id="scratch-pad-save-indicator"></div>
<ul class="nav nav-tabs">
- <li class="active"><a href="#scratch-pad-tab" data-toggle="tab">Editor</a></li>
- <li><a href="#scratch-pad-revisions-tab" data-toggle="tab">History</a></li>
+ <li class="dm"><a href="#scratch-pad-tab" data-toggle="tab">Editor</a></li>
+ <li class="dm"><a href="#scratch-pad-revisions-tab" data-toggle="tab">History</a></li>
+ <li class="active"><a href="#party-buffs-tab" data-toggle="tab">Buffs</a></li>
</ul>
<div class="tab-content">
- <div class="tab-pane active" id="scratch-pad-tab">
- <textarea id="scratch-pad" rows="5"></textarea>
+ <div class="tab-pane" id="scratch-pad-tab">
+ <div class="dm">
+ <textarea id="scratch-pad" rows="5"></textarea>
+ </div>
</div>
<div class="tab-pane" id="scratch-pad-revisions-tab">
- <table class="table table-striped scratch-pad-revisions">
- <thead>
- <tr>
- <th>Date</th>
- <th>Content</th>
- </tr>
- </thead>
- <tbody>
- {{#each scratchPadRevisions}}
- {{> scratch_pad_revision}}
- {{/each}}
- </tbody>
- </table>
+ <div class="dm">
+ <table class="table table-striped scratch-pad-revisions">
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Content</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{#each scratchPadRevisions}}
+ {{> scratch_pad_revision}}
+ {{/each}}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="tab-pane active" id="party-buffs-tab">
+ <ul class="buff-list">
+ {{#each allPartyBuffs}}
+ <li class="clearfix">
+ <a href="#remove-buff" class="pull-right delete btn btn-danger"><i class="icon-white icon-trash"></i></a>
+ <span class="buff-name">{{name}}</span>
+ <span class="buff-sep">from</span>
+ <span class="buff-source">{{getBuffSource}}</span>
+ </li>
+ {{/each}}
+ </ul>
</div>
</div>
</template>
-<template name="dashboard">
- <h2>Party Dashboard</h2>
- <div class="icon-save" id="scratch-pad-save-indicator"></div>
- <ul class="nav nav-tabs">
- <li class="active"><a href="#pary-buffs" data-toggle="tab">Buffs</a></li>
- </ul>
- <table class="table table-hover">
- <tbody>
- {{#each allPartyBuffs}}
- <tr class="success">
- <td>{{name}}</td>
- </tr>
- {{/each}}
- </tbody>
- </table>
-</template>
-
<template name="characters">
<section id="characters-view">
<div class="row-fluid">
<div class="span9" id="character-list-span">
{{> character_list}}
</div>
- <div class="span3 dm" id="scratch-pad-span">
- {{> scratch_pad}}
- </div>
<div class="span3" id="dashboard-span">
{{> dashboard}}
</div>
View
39 client/dnd.js
@@ -161,10 +161,6 @@ var getRowSpanForEnemyInDMView = function(charID) {
}).count() + 1;
};
-var getPartyBuffForCharacter = function(charID) {
- return PartyBuffList.find({charID: charID});
- };
-
var getAllPartyBuffs = function() {
var allCharInGame = CharacterList.find({char_in_game:true});
var ids = new Array();
@@ -242,7 +238,7 @@ var setupScratchPad = function() {
resizable: false
});
var timeout = null;
- var editBody = $($('#scratch-pad-span .el-rte .workzone iframe')[0].contentDocument.body);
+ var editBody = $($('#dashboard-span .el-rte .workzone iframe')[0].contentDocument.body);
editBody.keypress(function() {
clearTimeout(timeout);
timeout = setTimeout(function() {
@@ -284,7 +280,23 @@ Template.footer.events = {
}
};
-Template.scratch_pad.scratchPadRevisions = function() {
+Template.dashboard.events = {
+ 'click a[href=#remove-buff]': function() {
+ if (confirm("Are you sure you want to remove this buff?")) {
+ PartyBuffList.remove({_id: this._id});
+ }
+ return false;
+ }
+};
+
+Template.dashboard.getBuffSource = function() {
+ var character = CharacterList.findOne({
+ _id: this.charID
+ });
+ return character.name
+};
+
+Template.dashboard.scratchPadRevisions = function() {
return ScratchPadList.find({
}, {
sort: {
@@ -388,7 +400,7 @@ Template.character_status_effects.events = {
};
var resetCharacterForm = function() {
- $('#new-enemy').attr('checked', false);
+ $('#new-enemy').attr('checked', true);
$("#char-ac").val('');
$("#char-fort").val('');
$("#char-ref").val('');
@@ -498,8 +510,7 @@ Template.character_list.characters = function() {
Template.character.partyBuffs = function() {
- console.debug(this._id+" "+(PartyBuffList.find({charID:this._id})).count());
- return getPartyBuffForCharacter(this._id);
+ return PartyBuffList.find({charID: this._id});
};
Template.dashboard.allPartyBuffs = function() {
@@ -693,16 +704,14 @@ Template.character.events = {
});
return false;
},
- 'click a[href=#create-new-buff]': function(event) {
+ 'click a[href=#create-new-buff]': function(event) {
var link = $(event.currentTarget);
var charID = this.charID;
- var name = this.name;
-
+ var name = this.name;
PartyBuffList.insert({
charID: this._id,
name: "New Buff"
});
- console.debug("INSERT "+PartyBuffList.find().count());
return false;
},
'click a[href=#show-all-buffs]': function(event) {
@@ -759,10 +768,6 @@ Template.out_character.events = {
};
Template.char_buff_row.events = {
- 'click a[href=#remove-buff]': function() {
- PartyBuffList.remove({_id: this._id});
- return false;
- },
'click .char-buff': function(event) {
var charBuffSpan = $(event.currentTarget);
if (charBuffSpan.hasClass('editing')) {

No commit comments for this range

Something went wrong with that request. Please try again.