Skip to content

Commit

Permalink
loading animation added
Browse files Browse the repository at this point in the history
shows animation while new keyword proposals are requested and computed
  • Loading branch information
Thomas Franz authored and Thomas Franz committed May 24, 2012
1 parent e0cb2cd commit a5de2d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions hooks/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function HookInline_keywordsSearchSearchbarbottomtoolbar()
</span>
<div id="skmessages"></div>
<div id="skproposals">
<img src="<?php echo $baseurl ?>/plugins/smartkeywording_rs/images/ui-anim_basic_16x16.gif" style="position:absolute;padding:0px;margin:5px;line-height:10px;top:0px;right:0px;display:none;" id="loadingDiv">
<img src="<?php echo $baseurl ?>/plugins/smartkeywording_rs/images/ui-anim_basic_16x16.gif" style="width:16px;height:16px;padding:0px;top:0px;right:0px;" id="loadingAnimation">
</div>
<input type="button" id="selectAllResourceButton" value="<?php echo $lang["selectall"]; ?>">
<input type="button" id="clearSelectedResourceButton" value="<?php echo $lang["unselectall"]; ?>">
Expand Down Expand Up @@ -92,15 +92,17 @@ function HookInline_keywordsSearchAdditionalheaderjs()
jQuery('#submitSelectedResourceButton').on('click', function() {
resourceIds = jQuery.map(jQuery('.chosen'), function(a, b){
return jQuery(a).attr('id').replace('ResourceShell','');
}).join('+');
}).join('+');
jQuery("#loadingAnimation").show();
var selectedKeywords=getSelectedKeywords("skproposals");
jQuery("#skproposals > span").remove();
jQuery.ajax({
type: "POST",
url: "<?php echo $baseurl; ?>/plugins/inline_keywords/pages/add_keywords.php",
data: { refs: resourceIds, keywords: selectedKeywords}
}).done(function( msg ) {
getProposals(0, selectedKeywords, function() {
jQuery("#skproposals").empty();
getProposals(0, selectedKeywords, function() {
jQuery("#loadingAnimation").hide();
addProposals(this);
})
if(msg !== ''){alert( "Data Saved: " + msg );}
Expand All @@ -110,6 +112,7 @@ function HookInline_keywordsSearchAdditionalheaderjs()
});
});
});
jQuery("#loadingAnimation").hide();
});
</script>
<?php }
Expand Down
3 changes: 2 additions & 1 deletion js/kreuzverweis.sk.inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ function addSKProposalsOnReturn(fieldId, proposalContainerId) {
addedKeyword.text(jQuery(this).val());
jQuery("#skproposals").append(addedKeyword);
jQuery(this).val("");

jQuery("#loadingAnimation").show();
getProposals(0, getSelectedKeywords(proposalContainerId), function() {
jQuery("#loadingAnimation").hide();
addProposals(this);
})
return false;
Expand Down

0 comments on commit a5de2d3

Please sign in to comment.