selectable table

This commit is contained in:
Claude 2016-09-03 20:30:09 +02:00
parent 090ce7dcd8
commit eb1f629a15
5 changed files with 28 additions and 1 deletions

View File

@ -565,3 +565,6 @@ h4 {
word-wrap: break-word; word-wrap: break-word;
} }
.ui-selectable>.ui-selected { background-color: #a6c9e2; }
.ui-selectable>.ui-selecting { background: #FECA40; }

File diff suppressed because one or more lines are too long

View File

@ -51,6 +51,23 @@ ST.spamadmin = function() {
return false; return false;
}); });
} }
// needed by .selectable
$.fn.addBack = function(selector) {
return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
}
$('.selectable>tbody').selectable({
filter: 'tr',
cancel: 'a',
stop: function() {
var result = $("#select-result").empty();
$(".ui-selected", this).each(function() {
var index = $("tr").index(this);
result.append(" #" + (index + 1));
});
}
});
}; };
ST.line_highlighter = function() { ST.line_highlighter = function() {

View File

@ -18,6 +18,7 @@ if(isset($ace_modes)){
//Javascript //Javascript
$this->carabiner->js('jquery.js'); $this->carabiner->js('jquery.js');
$this->carabiner->js('jquery.timers.js'); $this->carabiner->js('jquery.timers.js');
$this->carabiner->js('jquery-ui-selectable-combined.min.js');
$this->carabiner->js('crypto-js/rollups/aes.js'); $this->carabiner->js('crypto-js/rollups/aes.js');
$this->carabiner->js('lz-string-1.3.3-min.js'); $this->carabiner->js('lz-string-1.3.3-min.js');
$this->carabiner->js('filereader.js'); $this->carabiner->js('filereader.js');

View File

@ -8,7 +8,7 @@
} }
$n = 0; $n = 0;
if(!empty($pastes)){ ?> if(!empty($pastes)){ ?>
<table class="recent"> <table class="recent selectable">
<tbody> <tbody>
<tr> <tr>
<th class="title">Title</th> <th class="title">Title</th>