-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added some javascript for input forms
- Loading branch information
1 parent
d023661
commit f46a1ce
Showing
2 changed files
with
29 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,31 @@ | ||
/* | ||
* Some Javscript functions for SMuFL-Browser | ||
* Some Javascript functions for SMuFL-Browser | ||
*/ | ||
|
||
function gotoPage(page) { | ||
/* var data = $("#fun-query-form").serialize();*/ | ||
/*$.ajax({ | ||
type: "POST", | ||
url: "ajax.html", | ||
data: data + "&action=search", | ||
success: function (data) { | ||
$("#results").fadeOut(100, function() { | ||
$(this).html(data); | ||
$(this).fadeIn(100, function() { | ||
$(".signature").highlight(); | ||
}); | ||
timeout = null; | ||
}); | ||
} | ||
});*/ | ||
console.log(page); | ||
} | ||
$.fn.facets = function () | ||
{ | ||
this.selectize({ | ||
plugins: ['remove_button'], | ||
hideSelected: true, | ||
onDropdownClose: function(e){ | ||
var params = []; | ||
/* Set filters */ | ||
$('option:selected').each(function() { | ||
var facet = $(this).parent().attr('name'); | ||
var value = $(this).attr('value'); | ||
/*console.log(facet + '=' + value);*/ | ||
params.push(facet + '=' + encodeURI(value)) | ||
}) | ||
|
||
/* Refresh page */ | ||
self.location='?'+params.join('&') | ||
} | ||
}) | ||
}; | ||
|
||
/* Initialize selectize plugin for the input forms */ | ||
$(document).ready(function() { | ||
$("#ranges-list").facets(); | ||
$("#glyphnames-list").facets(); | ||
$("#classes-list").facets(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters