Skip to content

Commit

Permalink
should work in resourcespace 5.x now
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron T. Maturen committed Nov 12, 2013
1 parent 1324b6a commit ac31ccf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions hooks/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function HookInline_keywordsSearchAdditionalheaderjs()
<script type='text/javascript'>
jQuery(document).ready(function() {
jQuery('form#manipulateKeywords label').each(function(){
if(jQuery(this.siblings(':text')).val()!==""){
if(jQuery(this).siblings(':text').val()!==""){
this.hide();
}
});
Expand All @@ -59,18 +59,17 @@ function HookInline_keywordsSearchAdditionalheaderjs()
});
<?php
} ?>

jQuery('form#manipulateKeywords :text').focus(function(event){
jQuery('body').on('focus', 'form#manipulateKeywords :text', function(event){
jQuery(this).siblings('label').fadeOut('fast');
});

jQuery('form#manipulateKeywords :text').blur(function(event){
jQuery('body').on('blur', 'form#manipulateKeywords :text', function(event){
if(jQuery(this).val() === ""){
jQuery(this).siblings('label').fadeIn('fast');
}
});

jQuery('.ResourcePanelShell, .ResourcePanelShellSmall').on('click', function(event) {
jQuery('body').on('click', '.ResourcePanelShell, .ResourcePanelShellSmall', function(event) {
if(!(event.originalEvent.srcElement instanceof HTMLImageElement )){
//console.log(event.originalEvent.srcElement instance of HTMLImageElement);
jQuery(this).toggleClass('chosen');
Expand All @@ -79,20 +78,21 @@ function HookInline_keywordsSearchAdditionalheaderjs()
}
});

jQuery('#clearSelectedResourceButton').on('click', function() {
jQuery('body').on('click', '#clearSelectedResourceButton', function() {

jQuery('.chosen').removeClass('chosen');
jQuery('#newKeywordsForSelectedResources').val('');
jQuery('.ResourcePanel, .ResourcePanelSmall').css('border-color','');
jQuery('.chosen .ResourcePanel, .chosen .ResourcePanelSmall').css('border-color','<?php echo $inline_keywords_background_colour; ?>');
});

jQuery('#selectAllResourceButton').on('click', function() {
jQuery('body').on('click', '#selectAllResourceButton', function() {
jQuery('.ResourcePanelShell, .ResourcePanelShellSmall').addClass('chosen');
jQuery('.ResourcePanel, .ResourcePanelSmall').css('border-color','');
jQuery('.chosen .ResourcePanel, .chosen .ResourcePanelSmall').css('border-color','<?php echo $inline_keywords_background_colour; ?>');
});

jQuery('#archiveResourcesButton').on('click', function(){
jQuery('body').on('click', '#archiveResourcesButton', function(){
resourceIds = jQuery.map(jQuery('.chosen'), function(a, b){
return jQuery(a).attr('id').replace('ResourceShell','');
}).join('+');
Expand All @@ -107,7 +107,7 @@ function HookInline_keywordsSearchAdditionalheaderjs()

});

jQuery('#submitSelectedResourceButton').on('click', function() {
jQuery('body').on('click', '#submitSelectedResourceButton', function() {
var form_values = jQuery('form#manipulateKeywords').serialize();
resourceIds = jQuery.map(jQuery('.chosen'), function(a, b){
return jQuery(a).attr('id').replace('ResourceShell','');
Expand Down
2 changes: 1 addition & 1 deletion inline_keywords.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: inline_keywords
author: Aaron T. Maturen
version: 0.71
version: 0.75
desc: Enable Editing Fields on Search Result Page
info_url: https://github.com/aaronmaturen/rs_inline_keywords
config_url: /plugins/inline_keywords/pages/setup.php
Expand Down

0 comments on commit ac31ccf

Please sign in to comment.