Permalink
Browse files

Adds sub filters

  • Loading branch information...
1 parent 56683a5 commit 081b24fb8a8684d465488001878c5ae700aedf10 @abhshkdz committed Dec 16, 2016
Showing with 100 additions and 2 deletions.
  1. +89 −2 _layouts/home.html
  2. +4 −0 static/css/deadlines.css
  3. +7 −0 static/js/store.min.js
View
@@ -18,6 +18,7 @@
<script type="text/javascript" src="{{ "/static/js/jquery.countdown.min.js" | prepend:site.baseurl }}"></script>
<script src="{{ "/static/js/moment.min.js" | prepend:site.baseurl }}"></script>
<script src="{{ "/static/js/moment-timezone-with-data.min.js" | prepend:site.baseurl }}"></script>
+ <script src="{{ "/static/js/store.min.js" | prepend:site.baseurl }}"></script>
</head>
<body>
@@ -36,9 +37,55 @@
To add/update a conference, <a target="_blank" href="//github.com/abhshkdz/ai-deadlines">send in a pull request</a>.
</div>
</div>
+ <br>
+ <div class="row">
+ <div class="col-xs-12">
+ <!-- <div class="well"> -->
+ <form class="form-horizontal">
+ <div class="form-group">
+ <div class="col-md-2 col-xs-5">
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" id="ML-checkbox">Machine Learning
+ </label>
+ </div>
+ </div>
+ <div class="col-md-2 col-xs-5">
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" id="CV-checkbox">Computer Vision
+ </label>
+ </div>
+ </div>
+ <div class="col-md-3 col-xs-5">
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" id="NLP-checkbox">Natural Language Processing
+ </label>
+ </div>
+ </div>
+ <div class="col-md-2 col-xs-5">
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" id="RO-checkbox">Robotics
+ </label>
+ </div>
+ </div>
+ <div class="col-md-2 col-xs-5">
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" id="GR-checkbox">Graphics
+ </label>
+ </div>
+ </div>
+ </div>
+ </form>
+ <!-- </div> -->
+ </div>
+ </div>
</div>
{% for conf in site.data.conferences %}
- <div id="{{conf.id}}">
+ <div id="{{conf.id}}" class="{{conf.sub}}-conf">
<div class="row">
<div class="col-xs-12 col-sm-6">
<a href="{{conf.link}}"><b>{{conf.name}} {{conf.year}}</b></a>
@@ -86,7 +133,47 @@
$('#{{conf.id}}').addClass('past');
{% endif %}
{% endfor %}
- // $(".past").hide();
+
+ // Set checkboxes
+ var all_subs = ['ML', 'CV', 'NLP', 'RO', 'GR'];
+ var subs = store.get('aideadlin.es');
+ if (subs === undefined) {
+ subs = all_subs;
+ for (var i = 0; i < subs.length; i++) {
+ $('#' + subs[i] + '-checkbox').prop('checked', true);
+ }
+ } else {
+ for (var i = 0; i < subs.length; i++) {
+ $('#' + subs[i] + '-checkbox').prop('checked', true);
+ }
+ }
+ // Hide unchecked subs
+ for (var i = 0; i < all_subs.length; i++) {
+ if (subs.indexOf(all_subs[i]) < 0) {
+ $('.' + all_subs[i] + '-conf').hide();
+ }
+ }
+ store.set('aideadlin.es', subs);
+
+ // Event handler on checkbox change
+ $('form :checkbox').change(function(e) {
+ var checked = $(this).is(':checked');
+ var cid = $(this).prop('id');
+ var csub = cid.substring(0, cid.length - 9);
+ if (checked == true) {
+ $('.' + csub + '-conf').show();
+ if (subs.indexOf(csub) < 0)
+ subs.push(csub);
+ }
+ else {
+ $('.' + csub + '-conf').hide();
+ var idx = subs.indexOf(csub);
+ if (idx >= 0)
+ subs.splice(idx, 1);
+ }
+ console.log(subs);
+ store.set('aideadlin.es', subs);
+ });
});
<!-- Google analytics -->
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -105,3 +105,7 @@ footer {
.timer {
font-size: 20px;
}
+
+.checkbox {
+ font-size: 12px;
+}
@@ -0,0 +1,7 @@
+/* Copyright (c) 2010-2016 Marcus Westin */
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.store = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+(function (global){
+"use strict";module.exports=function(){function e(){try{return o in n&&n[o]}catch(e){return!1}}var t,r={},n="undefined"!=typeof window?window:global,i=n.document,o="localStorage",a="script";if(r.disabled=!1,r.version="1.3.20",r.set=function(e,t){},r.get=function(e,t){},r.has=function(e){return void 0!==r.get(e)},r.remove=function(e){},r.clear=function(){},r.transact=function(e,t,n){null==n&&(n=t,t=null),null==t&&(t={});var i=r.get(e,t);n(i),r.set(e,i)},r.getAll=function(){},r.forEach=function(){},r.serialize=function(e){return JSON.stringify(e)},r.deserialize=function(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e||void 0}},e())t=n[o],r.set=function(e,n){return void 0===n?r.remove(e):(t.setItem(e,r.serialize(n)),n)},r.get=function(e,n){var i=r.deserialize(t.getItem(e));return void 0===i?n:i},r.remove=function(e){t.removeItem(e)},r.clear=function(){t.clear()},r.getAll=function(){var e={};return r.forEach(function(t,r){e[t]=r}),e},r.forEach=function(e){for(var n=0;n<t.length;n++){var i=t.key(n);e(i,r.get(i))}};else if(i&&i.documentElement.addBehavior){var c,u;try{u=new ActiveXObject("htmlfile"),u.open(),u.write("<"+a+">document.w=window</"+a+'><iframe src="/favicon.ico"></iframe>'),u.close(),c=u.w.frames[0].document,t=c.createElement("div")}catch(l){t=i.createElement("div"),c=i.body}var f=function(e){return function(){var n=Array.prototype.slice.call(arguments,0);n.unshift(t),c.appendChild(t),t.addBehavior("#default#userData"),t.load(o);var i=e.apply(r,n);return c.removeChild(t),i}},d=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),s=function(e){return e.replace(/^d/,"___$&").replace(d,"___")};r.set=f(function(e,t,n){return t=s(t),void 0===n?r.remove(t):(e.setAttribute(t,r.serialize(n)),e.save(o),n)}),r.get=f(function(e,t,n){t=s(t);var i=r.deserialize(e.getAttribute(t));return void 0===i?n:i}),r.remove=f(function(e,t){t=s(t),e.removeAttribute(t),e.save(o)}),r.clear=f(function(e){var t=e.XMLDocument.documentElement.attributes;e.load(o);for(var r=t.length-1;r>=0;r--)e.removeAttribute(t[r].name);e.save(o)}),r.getAll=function(e){var t={};return r.forEach(function(e,r){t[e]=r}),t},r.forEach=f(function(e,t){for(var n,i=e.XMLDocument.documentElement.attributes,o=0;n=i[o];++o)t(n.name,r.deserialize(e.getAttribute(n.name)))})}try{var v="__storejs__";r.set(v,v),r.get(v)!=v&&(r.disabled=!0),r.remove(v)}catch(l){r.disabled=!0}return r.enabled=!r.disabled,r}();
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+},{}]},{},[1])(1)
+});

0 comments on commit 081b24f

Please sign in to comment.