|
|
@ -2,33 +2,26 @@ let yo = require('yo-yo') |
|
|
|
let csjs = require('csjs-inject') |
|
|
|
let csjs = require('csjs-inject') |
|
|
|
|
|
|
|
|
|
|
|
var css = csjs` |
|
|
|
var css = csjs` |
|
|
|
.item { |
|
|
|
.text { |
|
|
|
display : flex; |
|
|
|
background-color : var(--success); |
|
|
|
flex-direction : column; |
|
|
|
|
|
|
|
align-items : center; |
|
|
|
|
|
|
|
width : 400px; |
|
|
|
|
|
|
|
height : 160px; |
|
|
|
|
|
|
|
padding : 20px; |
|
|
|
|
|
|
|
background-color: var(--primary); |
|
|
|
|
|
|
|
font-family : "Lucida Console", Monaco, monospace; |
|
|
|
|
|
|
|
font-size : 12px; |
|
|
|
|
|
|
|
cursor : default; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
span { |
|
|
|
|
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
font-size: 100%; |
|
|
|
color: var(--primary); |
|
|
|
|
|
|
|
font-weight: normal; |
|
|
|
} |
|
|
|
} |
|
|
|
span:hover { |
|
|
|
.text:hover { |
|
|
|
font-size: 120%; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
} |
|
|
|
a:link { |
|
|
|
.link { |
|
|
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
background-color : var(--primary); |
|
|
|
|
|
|
|
color: var(--success); |
|
|
|
|
|
|
|
font-weight: normal; |
|
|
|
text-decoration : none; |
|
|
|
text-decoration : none; |
|
|
|
color: white |
|
|
|
|
|
|
|
font-size: 100%; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
a:hover { |
|
|
|
.link:hover { |
|
|
|
color: var(--bg-warning); |
|
|
|
color: var(--success); |
|
|
|
font-size: 120%; |
|
|
|
font-weight: bold; |
|
|
|
|
|
|
|
text-decoration : none; |
|
|
|
} |
|
|
|
} |
|
|
|
` |
|
|
|
` |
|
|
|
|
|
|
|
|
|
|
@ -36,36 +29,36 @@ class Section { |
|
|
|
constructor (title, actions) { |
|
|
|
constructor (title, actions) { |
|
|
|
this.title = title |
|
|
|
this.title = title |
|
|
|
this.actions = actions |
|
|
|
this.actions = actions |
|
|
|
this.cardStyle = (this.title === 'Workspaces') ? 'bg-success' : 'border-success' |
|
|
|
this.cardStyle = (this.title === 'Workspaces') ? 'bg-success text-primary' : 'bg-primary text-success border-success' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render () { |
|
|
|
render () { |
|
|
|
let sectionLook = yo` |
|
|
|
let sectionLook = yo` |
|
|
|
<div class="card ${this.cardStyle} bg-primary mb-3"> |
|
|
|
<div class="card ${this.cardStyle} p-2" style="min-width: 300px;"> |
|
|
|
<div class="card-header">${this.title}</div> |
|
|
|
<div class="card-header">${this.title}</div> |
|
|
|
<div class="card-body" style="min-width: 350px;"> |
|
|
|
<p></p> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
` |
|
|
|
` |
|
|
|
for (var i = 0; i < this.actions.length; i++) { |
|
|
|
for (var i = 0; i < this.actions.length; i++) { |
|
|
|
if (this.actions[i].type === `callback`) { |
|
|
|
if (this.actions[i].type === `callback`) { |
|
|
|
sectionLook.appendChild(yo` |
|
|
|
sectionLook.appendChild(yo` |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<span class="card-text" onclick=${this.actions[i].payload} > |
|
|
|
<span class ="${css.text}" onclick=${this.actions[i].payload} > |
|
|
|
${this.actions[i].label} |
|
|
|
${this.actions[i].label} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
`)
|
|
|
|
`)
|
|
|
|
} else if (this.actions[i].type === `link`) { |
|
|
|
} else if (this.actions[i].type === `link`) { |
|
|
|
sectionLook.appendChild(yo` |
|
|
|
sectionLook.appendChild(yo` |
|
|
|
<div> |
|
|
|
<div > |
|
|
|
<a href=${this.actions[i].payload} target="_blank" > |
|
|
|
<a class="${css.link} text-decoration-none" href=${this.actions[i].payload} target="_blank" > |
|
|
|
${this.actions[i].label} |
|
|
|
${this.actions[i].label} |
|
|
|
</a> |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
`)
|
|
|
|
`)
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
sectionLook.appendChild(yo`<p></p>`) |
|
|
|
|
|
|
|
|
|
|
|
if (!this._view) { |
|
|
|
if (!this._view) { |
|
|
|
this._view = sectionLook |
|
|
|
this._view = sectionLook |
|
|
|