Skip to content

Commit 44aedb9

Browse files
committed
Modified the ruleset names to open the elements within them, and we added an 'edit' link to allow editing the rulesets. 'A commit message (from Bruce).'
1 parent 72cc2ee commit 44aedb9

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

packages/pico-engine/public/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ <h2>Children</h2>
197197
Pico Rulesets
198198
<ul id="ruleset-list" style="list-style: none;padding:0">
199199
{{#each installed}}
200-
<li><input type="checkbox"><span class="krlrid">{{@key}}</span>
200+
<li><input type="checkbox" id="installed-{{@index}}">
201+
<label for="installed-{{@index}}">{{@key}}</label>
202+
<a href="javascript:window.open('ruleset.html#{{@key}}','ruleset');void 0">edit</a>
201203
{{#if canDel}}
202204
<a class="js-ajax-link" href="/api/pico/{{../pico_id}}/rm-ruleset/{{@key}}">del</a>
203205
{{/if}}
@@ -310,7 +312,9 @@ <h2>Children</h2>
310312
Testing
311313
<ul class="testing-rids">
312314
{{#each testing}}
313-
<li><input type="checkbox"><span class="krlrid">{{this.rid}}</span>
315+
<li><input type="checkbox" id="testing-{{@index}}">
316+
<label class="krlrid" for="testing-{{@index}}">{{this.rid}}</label>
317+
<a href="javascript:window.open('ruleset.html#{{this.rid}}','ruleset');void 0">edit</a>
314318
</li>
315319
{{/each}}
316320
<li class="legend">Legend

packages/pico-engine/public/js/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ $.getJSON("/api/db-dump?legacy=true", function(db_dump){
243243
$theSection.html(tabTemplate(theDB));
244244
var d = "";
245245
if(liContent === "rulesets") {
246-
$(".pico-edit .krlrid").click(displayKrl);
247246
d = theDB.pico_id+"-Rulesets";
248247
location.hash = d;
249248
$theSection.find('.rulesetFromURL').submit(function(e){
@@ -296,18 +295,18 @@ $.getJSON("/api/db-dump?legacy=true", function(db_dump){
296295
$(".testing-rids li input").change(function(e){
297296
$("#test-results pre").html("");
298297
if(this.checked){
299-
var $span = $(this).next(".krlrid");
300-
if($span.next().length==0){
301-
var rid = $span.text();
298+
var $label = $(this).next(".krlrid");
299+
let $editAnchor = $label.next("a");
300+
if($editAnchor.next('ul').length==0){
301+
var rid = $label.text();
302302
var eci = theDB.eci;
303303
$.getJSON("/sky/cloud/"+eci+"/"+rid+"/__testing",function(c){
304-
$span.after(capTemplate({eci:eci,rid:rid,capabilities:c}));
305-
}).fail(function(){$span.after("<ul></ul>");
304+
$editAnchor.after(capTemplate({eci:eci,rid:rid,capabilities:c}));
305+
}).fail(function(){$editAnchor.after("<ul></ul>");
306306
});
307307
}
308308
}
309309
});
310-
$(".pico-edit .krlrid").click(displayKrl);
311310
location.hash = theDB.pico_id+"-Testing";
312311
} else if(liContent === "about") {
313312
$theSection.find('.use-minicolors').minicolors(

0 commit comments

Comments
 (0)