Skip to content

Commit

Permalink
publish to gh-pages site
Browse files Browse the repository at this point in the history
  • Loading branch information
lduboeuf committed Mar 22, 2017
1 parent 57b756d commit 065d320
Show file tree
Hide file tree
Showing 16 changed files with 531 additions and 464 deletions.
2 changes: 2 additions & 0 deletions dist/dev/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ app.alert = function(type, message){
}



app.cleanUI = function(evt){
//toggle menu when a menu item is clicked
if (evt.target.parentNode.className!=='icon'){
Expand Down Expand Up @@ -39,6 +40,7 @@ app.init = function(event) {

$menu_icon.onclick = toggleMenu;


//remotestorage
remoteStorage.access.claim('teams', 'rw');
remoteStorage.access.claim('archives', 'rw');
Expand Down
12 changes: 8 additions & 4 deletions dist/dev/archives/archive-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ <h3>{{=team.name}}</h3>
<br/>
<form>
<div class="form-group">
<textarea name="comment" placeholder="comments" required="">{{=it.comment}}</textarea>
<input type="submit" name="add" value="add comment" class="button btn-success"/>
<textarea name="comment" placeholder="comments" required="">{{=it.comment || ''}}</textarea>
<input type="submit" name="add" value="update comment" class="button btn-success"/>
</div>
</form>
<button name="remove" class="btn-danger">&#10006; remove archive</button>
<div class="danger-zone">
<button name="remove" class="btn-danger">&#10006; remove archive</button>
</div>


<script type="text/javascript">
app.page("archive-details", function()
{
Expand Down Expand Up @@ -78,6 +82,6 @@ <h3>{{=team.name}}</h3>

}
});

//# sourceURL=archive-details.js
</script>
</div>
2 changes: 1 addition & 1 deletion dist/dev/archives/archive-save.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ <h3>Save result</h3>
$desc.value="";
}
});

//# sourceURL=archive-save.js
</script>
</div>
129 changes: 129 additions & 0 deletions dist/dev/commons/app-components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
//reusable components
app.checkList = (function(){

var $cl = document.getElementById('check-list');
var tplCheckList = doT.template($cl.innerHTML);
//empty component
$cl.innerHTML =null;

//provide a memberId->member object key-value
function mapMembers(teams){
var currentSelection = {};
for (var t_id in teams){
var members = teams[t_id].members;
for (var i=0; i < members.length; i++){
var m = members[i];
currentSelection[m.id] = m;
}
}
return currentSelection;
}

function applyTo($target){
var $this = $target;
var members= null;

$this.render = function(teams){
members = mapMembers(teams);
$this.innerHTML = tplCheckList(teams);
$this.querySelector('input[name="tick_all"]').onclick = $this.selectAll;
}

$this.selectAll =function(){
var $checkbox_members = $this.querySelectorAll('input[name="member_id"]');
var checked = this.checked;
for (var i=0; i < $checkbox_members.length; i++){
$checkbox_members[i].checked = checked;
}
}

$this.getSelectedItems = function(){
var $checkboxes = $this.querySelectorAll('input[name="member_id"]');
var items = [];
for (var i=0; i < $checkboxes.length; i++){
if ($checkboxes[i].checked){
items.push(members[$checkboxes[i].value]);
}
}
return items;
}



}

return {
applyTo: applyTo
}

})();


app.selectList = (function(){

var $select = document.getElementById('select-list');
var tplList = doT.template($select.innerHTML);
//empty component
$select.innerHTML =null;

function applyTo($target){
var $this = $target;
var _teams = null;

$this.populate = function(){
remoteStorage.teams.findAll().then(
function(teams){

if (Object.keys(teams).length === 0){
app.alert('alert-info','humm, no members found, you can add members by clicking on the "My Groups" menu');
}
$this.render(teams);
}
);
}

$this.render = function(teams){
_teams = teams;
$this.innerHTML = tplList(teams);
}

$this.getSelectedItems = function(){
if ($this.value==-1){
return _teams;
}else{
var t = {};
t[$this.value] = _teams[$this.value];
return t;
}
}

}

return {
applyTo: applyTo
}

})();

app.list = (function(){

var $list = document.getElementById('list');
var tplList = doT.template($list.innerHTML);
//empty component
$list.innerHTML =null;


function applyTo($target){
var $this = $target;

$this.render = function(teams){
$this.innerHTML = tplList(teams);
}

}

return {
applyTo: applyTo
}

})();
50 changes: 46 additions & 4 deletions dist/dev/commons/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ body.tool-next-member > section#tool-next-member ,
body.sync > section#sync,
body.settings > section#settings,
body.tool-match > section#tool-match,
body.tool-match2 > section#tool-match2,
body.tool-match3 > section#tool-match3,
/*@spapp_generator css*/
body.team-member-details > section#team-member-details { display:block;}

Expand All @@ -57,6 +59,10 @@ body.archive-details #menu a[href="#archive-list "],
body.settings #menu a[href="#settings"],
body.home #menu a[href="#home"] { background-color: #555; }

/*components*/
#components {
display: none;
}

/*header*/
body> header {
Expand Down Expand Up @@ -323,18 +329,27 @@ ul.topnav li.icon {
padding:8px;
/*padding-top:12px;*/
}
#tool-next-member li, #tool-match li{

.checklist li{
padding:0;
}
#tool-next-member li label, #tool-match li label{

.checklist li label{
display:block;
padding:10px 16px;
}
#tool-next-member li input, #tool-match li input{

.checklist li input{
float:right;
}


.danger-zone{
padding:1em;
margin:1em 0;
border: 1px dashed grey;
text-align: center;
}


.list {
Expand Down Expand Up @@ -365,6 +380,33 @@ ul.topnav li.icon {
border-bottom: none
}





ol {
counter-reset: nbres;
}
ol li{
list-style-type: none;
counter-increment: nbres; /* on incrémente le compteur à chaque nouveau li */
margin-bottom: 10px;
border-bottom: : 1px solid #ddd;
}
ol li::before{
content: counter(nbres);
padding: 0 20px 6px;
margin-right: 8px;
vertical-align: top;
background: #678;
-moz-border-radius: 60px;
border-radius: 60px;
font-weight: bold;
font-size: 0.8em;
color: white;
}


div.team h3, .header-tbl{
margin:0;
padding:12px 0px;
Expand Down Expand Up @@ -463,7 +505,7 @@ button, input[type=submit], input[type=button]:hover {
textarea{
color: #5f5f5f;
box-sizing: border-box;
width: 50%;
width: 100%;
height: 80px;
box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.08);
font: normal 13px sans-serif;
Expand Down
Loading

0 comments on commit 065d320

Please sign in to comment.