<form class="col-md-6">
<h5>Insert raw SPAM source:</h5>
<textarea class="col-md-5 upload-textarea" id="spamTextSource" value=""></textarea>
- <p><button class="btn btn-default pull-right" data-upload="spam"><i class="glyphicon glyphicon-upload"></i> Upload text</button></p>
+ <p><button class="btn btn-default pull-right" data-upload="spam" disabled><i class="glyphicon glyphicon-upload"></i> Upload text</button></p>
</form>
<form class="col-md-6">
<h5>Insert raw HAM source:</h5>
<textarea class="col-md-5 upload-textarea" id="hamTextSource" value=""></textarea>
- <p><button class="btn btn-default pull-right" data-upload="ham"><i class="glyphicon glyphicon-upload"></i> Upload text</button></p>
+ <p><button class="btn btn-default pull-right" data-upload="ham" disabled><i class="glyphicon glyphicon-upload"></i> Upload text</button></p>
</form>
</div>
<div class="row">
<input id="fuzzyWeightText" class="slider" type="slider" value="1"/>
</div>
</div>
- <p><button class="btn btn-default pull-right" data-upload="fuzzy"><i class="glyphicon glyphicon-upload"></i> Upload text</button></p>
+ <p><button class="btn btn-default pull-right" data-upload="fuzzy" disabled><i class="glyphicon glyphicon-upload"></i> Upload text</button></p>
</form>
</div>
</div>
return e.options[e.selectedIndex].value;
}
- $("textarea").change(function () {
- if ($(this).val().length !== "") {
- $(this).closest("form").find("button").removeAttr("disabled").removeClass("disabled");
- } else {
- $(this).closest("form").find("button").attr("disabled").addClass("disabled");
- }
+ $("textarea").keyup(function () {
+ var $this = $(this);
+ $this.closest("form").find("button")
+ .prop("disabled", ($.trim($this.val()).length === 0));
});
$("#scanClean").on("click", function () {
weight: $("#fuzzyWeightText").val()
}
: {};
- if (data.length > 0) {
+ if ($.trim(data).length > 0) {
if (source === "scan") {
var checked_server = getSelector("selSrv");
var server = (checked_server === "All SERVERS") ? "local" : checked_server;