Skip to content

Commit

Permalink
fixed bug where form has saved data and label didnt dissapear
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmaturen committed May 24, 2012
1 parent 8ef163d commit 27eb7c3
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
git log | grep -m 1 commit
commit=`git log | grep -m 1 commit `
commitnick=${commit:7:10}
commitnick='0.5'
commitnick='0.6'
echo "updating version information in inline_keywords.yaml with latest git commit $commitnick"
sed -ibk "s/version: .*/version: $commitnick/" inline_keywords.yaml
rm inline_keywords.yamlbk
Expand Down
3 changes: 2 additions & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
$inline_keywords_usertype = 'a';
$inline_keywords_background_colour = 'hotPink';
$inline_keywords_use_jQuery_ui = True;
$inline_keywords_use_legacy_jQuery = True;
$inline_keywords_use_legacy_jQuery = True;
$inline_keywords_clear_fields_on_submit = True;
15 changes: 14 additions & 1 deletion hooks/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ function HookInline_keywordsSearchSearchbarbottomtoolbar()
<label for='newKeywordsForSelectedResources'>Keywords</label>
<input id='newKeywordsForSelectedResources' class='SearchWidth'/>
</p>
<p>
<label for='newNamedPersonsForSelectedResources'>Named Persons</label>
<input id='newNamedPersonsForSelectedResources' class='SearchWidth'/>
</p>
</span>
<input type="button" id="selectAllResourceButton" value="<?php echo $lang["selectall"]; ?>">
<input type="button" id="clearSelectedResourceButton" value="<?php echo $lang["unselectall"]; ?>">
Expand All @@ -28,12 +32,18 @@ function HookInline_keywordsSearchSearchbarbottomtoolbar()
}
function HookInline_keywordsSearchAdditionalheaderjs()
{
global $baseurl, $inline_keywords_usertype, $inline_keywords_background_colour;
global $baseurl, $inline_keywords_usertype, $inline_keywords_background_colour, $inline_keywords_clear_fields_on_submit;
if(checkperm($inline_keywords_usertype))
{ ?>
<script src="../plugins/inline_keywords/js/jquery.infieldlabel.min.js" type="text/javascript" charset="utf-8"></script>
<script type='text/javascript'>
jQuery(document).ready(function() {
jQuery('form#manipulateKeywords label').each(function(){
if(jQuery(this.siblings(':text')).val('aaaa')!==""){
this.hide();
}
});

jQuery('form#manipulateKeywords :text').focus(function(event){
jQuery(this).siblings('label').fadeOut('fast');
});
Expand Down Expand Up @@ -80,6 +90,9 @@ function HookInline_keywordsSearchAdditionalheaderjs()
jQuery(".keywordPanel").fadeTo("slow", 0.5, function () {
jQuery(".keywordPanel").fadeTo("slow", 1.0, function(){});
});
<?php if($inline_keywords_clear_fields_on_submit){
echo "jQuery('form#manipulateKeywords :text').val('');jQuery('form#manipulateKeywords label').show();";
}?>
});
});
});
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.5
version: 0.6
desc: Enable Adding Keywords on Search Result Page
info_url: https://github.com/aaronmaturen/rs_inline_keywords
config_url: /plugins/inline_keywords/pages/setup.php
Expand Down
1 change: 1 addition & 0 deletions languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
$lang['editfields'] = 'Edit Field(s)';
$lang['submitchanges'] = 'Submit Changes';
$lang['keywordstoresource'] = 'Change fields on selected resources.';
$lang['inline_keywords_clear_fields_on_submit'] = "Clear fields after submitting.";

$lang['inline_keywords_heading'] = 'Inline Keywords Plugin Configuration';
$lang['inline_keywords_frontm']='This is a sample configuration page for a plugin. It doesn\'t actually modify ' .
Expand Down
1 change: 1 addition & 0 deletions pages/add_keywords.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
//function tweak_preview_images($ref,$rotateangle,$gamma,$extension="jpg")

include_once "../../../include/db.php";
include_once "../../../include/authenticate.php";if (!checkperm(checkperm($inline_keywords_usertype))) {exit("Permission denied");}
Expand Down
4 changes: 1 addition & 3 deletions pages/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@

$page_def[] = config_add_text_input('inline_keywords_usertype', $lang['inline_keywords_usertype'] );
$page_def[] = config_add_text_input('inline_keywords_background_colour', $lang['inline_keywords_background_colour']);
$page_def[] = config_add_boolean_select('inline_keywords_use_legacy_jQuery',$lang['inline_keywords_use_jQuery_ui'], $lang['no-yes']);
$page_def[] = config_add_boolean_select('inline_keywords_use_jQuery_ui',$lang['inline_keywords_use_jQuery_ui'], $lang['no-yes']);

$page_def[] = config_add_boolean_select('inline_keywords_clear_fields_on_submit',$lang['inline_keywords_clear_fields_on_submit'], $lang['no-yes']);
// Do the page generation ritual
$upload_status = config_gen_setup_post($page_def, $plugin_name);
include '../../../include/header.php';
Expand Down

0 comments on commit 27eb7c3

Please sign in to comment.