Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30b2784

Browse files
committed
add panel stype
1 parent 2ac342a commit 30b2784

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

pyspider/webui/static/debug.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,3 +431,21 @@ span.element > ul > li:hover {
431431
#slime-editor .panel-group .panel-body.active {
432432
display: block;
433433
}
434+
#slime-editor .panel-group .crawl,
435+
#slime-editor .panel-group .return {
436+
padding: 10px 10px;
437+
cursor: pointer;
438+
border: 0 solid #fae3c4;
439+
border-left-width: 10px;
440+
}
441+
#slime-editor .panel-group .crawl.active,
442+
#slime-editor .panel-group .return.active {
443+
border: 0 solid #f0ad4e;
444+
border-left-width: 10px;
445+
}
446+
#slime-editor .panel-group .crawl:hover,
447+
#slime-editor .panel-group .return:hover {
448+
background-color: #fceedb;
449+
border: 0 solid #f0ad4e;
450+
border-left-width: 10px;
451+
}

pyspider/webui/static/debug.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ window.SlimeEditor = (function() {
328328
$(this).find("~.panel-body").addClass("active");
329329
_this.resize_panel_body();
330330
});
331+
this.slime_elem.on("click", ".crawl, .return", function() {
332+
$(this).parent().find(".active").removeClass("active");
333+
$(this).addClass("active");
334+
});
331335
},
332336

333337
resize_panel_body: function() {

pyspider/webui/static/debug.less

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,4 +469,22 @@ span.element {
469469
display: block;
470470
}
471471
}
472+
473+
.crawl, .return {
474+
padding: 10px 10px;
475+
cursor: pointer;
476+
border: 0 solid lighten(@orange, 25%);
477+
border-left-width: 10px;
478+
479+
&.active {
480+
border: 0 solid @orange;
481+
border-left-width: 10px;
482+
}
483+
484+
&:hover {
485+
background-color: lighten(@orange, 30%);
486+
border: 0 solid @orange;
487+
border-left-width: 10px;
488+
}
489+
}
472490
}

pyspider/webui/templates/debug.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,23 @@
9292
<div class="panel-group">
9393
<div class="panel">
9494
<div class="panel-heading panel-setup">
95-
setup
95+
def on_start(self):
9696
</div>
9797
<div class="panel-body active">
98-
body
98+
<div class="crawl active">
99+
self.crawl(<input />, <button>...</button>, callback=self.<a href="#">callback</a>)
100+
</div>
101+
<div class="return">
102+
return {
103+
<div class="return-item">
104+
<input />: <input /> . <select>
105+
<option>items()</option>
106+
<option>text()</option>
107+
<option>html()</option>
108+
</select>
109+
</div>
110+
}
111+
</div>
99112
</div>
100113
</div>
101114
<div class="panel">

0 commit comments

Comments
 (0)