Skip to content

Commit

Permalink
Merge pull request #61 from ideaconsult/migrate-compound-ketcher
Browse files Browse the repository at this point in the history
Migrate compound kit with ketcher
  • Loading branch information
kerberizer authored Dec 17, 2020
2 parents ec2387e + 2756dd5 commit 2037964
Show file tree
Hide file tree
Showing 39 changed files with 9,915 additions and 1,633 deletions.
20 changes: 20 additions & 0 deletions core/Tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,26 @@ jT = a$.extend(jT, {
return ret;
},

validateForm: function (form, cb) {
cb = cb || function () {
if ('checkValidity' in this)
return this.checkValidity();
else {
var valid = (this.value.length > 0);
if (!valid)
this.placeholder = 'You need to fill this box';
return valid;
}
};

var ok = true;
$('input,textarea,select', form).each(function () {
ok = ok && (!!cb.call(this));
});

return ok;
},

activateDownload: function (aEl, blob, destName, autoRemove) {
var url = URL.createObjectURL(blob),
selfClick = false;
Expand Down
44 changes: 44 additions & 0 deletions kits/Base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->

<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title>Base jToxKit UI elements</title>
<link rel="stylesheet" href="tests/base.css">
<link rel="stylesheet" href="tests/skeleton.css">
<link rel="stylesheet" href="tests/layout.css">
<link rel="stylesheet" href="tests/jquery-ui.css">
<link rel="stylesheet" href="tests/jquery.dataTables.css">

<link rel="stylesheet" href="www/jtoxkit.css">
<link rel="stylesheet" href="www/ketcher.css" />

<script src="tests/jquery.js"></script>
<script src="tests/jquery-migrate-1.2.1.min.js"></script>
<script src="tests/jquery-ui.js"></script>

<script src="www/jtoxkit.js"></script>
</head>

<body>
<!--[[ jT.ui.templates['button-icon'] -->
<button title="{{ title }}"><i class="fa fa-{{ icon }} {{ className }}"></i></button>
<!-- // end of #button-icon ]]-->
<!--[[ jT.ui.templates['select-one-option'] -->
<option value="{{ value }}" {{ selected }}>{{ name }}</button>
<!-- // end of #select-one-option ]]-->
<!--[[ jT.ui.templates['info-ball'] -->
<sup class="helper"><a target="_blank" href="{{ href }}" title="{{ title }}"><span class="fa fa-info-circle"></span></a></sup>
<!-- // end of #info-ball ]]-->
</div>
</body>

</html>
91 changes: 91 additions & 0 deletions kits/CompoundKit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" >

<title>ToxCompound development page</title>
<link rel="stylesheet" href="tests/base.css">
<link rel="stylesheet" href="tests/skeleton.css">
<link rel="stylesheet" href="tests/layout.css">
<link rel="stylesheet" href="tests/jquery-ui.css">
<link rel="stylesheet" href="tests/jquery.dataTables.css">

<link rel="stylesheet" href="styles/toxcompound.css">
<link rel="stylesheet" href="styles/jtoxkit.css">


<script src="tests/jquery.js"></script>
<script src="tests/jquery-ui.js"></script>
<script src="tests/jquery.dataTables.js"></script>

<script src="scripts/ccLib.js"></script>
<script src="scripts/jtoxkit.js"></script>
<script src="scripts/toxcompound.js"></script>

<script language="javascript">
$(document).ready(function(){
window['ds'] = new jToxCompound($(".jtox-toolkit")[0], {rememberChecks: true, hideEmpty: true} );
// ds.queryDataset("http://apps.ideaconsult.net:8080/data/dataset/18?feature_uris[]=http://apps.ideaconsult.net:8080/toxbank/model/6/predicted");
// ds.queryDataset("http://apps.ideaconsult.net:8080/data/dataset/1", "http://apps.ideaconsult.net:8080/data/dataset/1/feature");
ds.queryDataset("http://localhost:8080/data/dataset");
});
</script>
</head>
<body>
<div class="jtox-toolkit" data-kit="compound" data-manual-init="yes" data-show-features="yes" data-show-export="yes"></div>
<div class="jtox-template">
<!--[[ jT.ui.templates['all-compound'] -->
<div class="jtox-compound">
<div class="jtox-ds-features"></div>
<div class="jtox-controls">
Showing from<span class="jtox-live-data high">{{ pagestart }}</span> to <span class="jtox-live-data high">{{ pageend }}</span><span class="jtox-live-data">{{ filtered-text }}</span>in pages of <select class="jtox-live-data" value="{{ pagesize }}">
<option value="10" selected="yes">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select> entries
<a class="paginate_disabled_previous prev-field" tabindex="0" role="button">Previous</a><a class="paginate_enabled_next next-field" tabindex="0" role="button">Next</a>
<input type="text" class="filterbox" placeholder="Filter..." />
</div>
<div class="jtox-ds-tables">
<div class="jt-error">
<span class="message"></span>
</div>
<div class="jtox-ds-fixed">
<table></table>
</div><div class="jtox-ds-variable">
<table></table>
</div>
</div>
</div>
<!-- // end of all-compound ]]-->
<!--[[ jT.ui.templates['compound-one-tab'] -->
<div class="jtox-selection">
<a href="#" class="multi-select select">select all</a>&nbsp;<a href="#" class="multi-select unselect">unselect all</a>
</div>
<!-- // end of #compound-one-tab ]]-->
<!--[[ jT.ui.templates['compound-one-feature'] -->
<div class="jtox-ds-feature"><input type="checkbox" checked="yes"
class="jtox-checkbox" /><span class="jtox-title">{{ title }}</span><sup class="helper"><a target="_blank"
href="{{ uri }}"><i class="fa fa-info-circle"></i></a></sup></div>
<!-- // end of #jtox-ds-feature ]]-->
<!--[[ jT.ui.templates['compound-download'] -->
<div class="jtox-inline jtox-ds-download">
<a target="_blank" href="{{ link }}"><img class="borderless" title="{{ type }}" src="{{ icon }}" alt="{{ type }}"/></a>
</div>
<!-- // end of #compound-download ]]-->
<!--[[ jT.ui.templates['compound-export'] -->
<div id="{{ id }}">
<div class="jtox-inline">Download dataset as: </div>
<div class="jtox-inline jtox-exportlist"></div>
</div>
<!-- // end of #compound-export ]]-->
</div>
</body>
</html>
3 changes: 0 additions & 3 deletions kits/FacetedSearchKit.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ <h3 id="{{id}}_header" class="nested-tab">{{title}}</h3>
<!--[[ jT.ui.templates['slider-one'] -->
<input type="hidden" />
<!-- // end of #slider-one ]]-->
<!--[[ jT.ui.templates['export-type'] -->
<option value="{{index}}">{{name}}</button>
<!-- // end of #export-type ]]-->
<!--[[ jT.ui.templates['export-format'] -->
<div class="jtox-inline jtox-ds-download jtox-fadable">
<a target="_blank" data-name="{{name}}" data-mime="{{mime}}" href="#"><img class="borderless" src="{{icon}}" /></a>
Expand Down
Loading

0 comments on commit 2037964

Please sign in to comment.