Skip to content

Instantly share code, notes, and snippets.

@jshaw
Created January 20, 2012 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jshaw/1648119 to your computer and use it in GitHub Desktop.
Save jshaw/1648119 to your computer and use it in GitHub Desktop.
Update Mediasearch Gallery
<fm:If value="{$$get.groupId}"><input type="hidden" name="groupId" id="groupId" value="{$$get.groupId}" /></fm:If>
//Update the gallery page upon changing the Uploaded: dropdown menu
function updateMediaSearchGallery(){
if($('#groupId').val()){
if ($('#query').val()){
var timeFrom = "/mediasearch?q=" + $('#query').val() + "&date=" + $('#date').val() + "&groupId=" + $('#groupId').val() + "&sort=" + $('#sort').val() + "&type=" + $('#fileType').val();
}else{
var timeFrom = "/mediasearch?&date=" + $('#date').val() + "&groupId=" + $('#groupId').val() + "&sort=" + $('#sort').val() + "&type=" + $('#fileType').val();
}
}else{
if ($('#query').val()){
var timeFrom = "/mediasearch?q=" + $('#query').val() + "&date=" + $('#date').val() + "&groupId=" + $('#parentId').val() + "&sort=" + $('#sort').val() + "&type=" + $('#fileType').val();
}else{
var timeFrom = "/mediasearch?date=" + $('#date').val() + "&groupId=" + $('#parentId').val() + "&sort=" + $('#sort').val() + "&type=" + $('#fileType').val();
}
}
window.location = timeFrom;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment