Browse Source

Correction du placeholder de l'input a tags. (il y avait des bugs de message par defaut souvent ...)

Sevajol Bastien 12 years ago
parent
commit
1549b7b55f

+ 3 - 4
src/Muzich/CoreBundle/Resources/views/Tag/tagsPrompt.html.twig View File

11
     {% endif %}
11
     {% endif %}
12
   {% endif %}
12
   {% endif %}
13
   
13
   
14
-   <input class="tags_prompt_list" name="tags" value=""> 
14
+   <input class="tags_prompt_list" name="tags" value="" /> 
15
    <input id="tags_selected_tag_{{ form_name }}" type="hidden" value="" />
15
    <input id="tags_selected_tag_{{ form_name }}" type="hidden" value="" />
16
-   <input class="tag_text_help" type="hidden" value="{{ 'tags.inputtext.help'|trans({}, 'userui') }}"/>
16
+   
17
    <div id="search_tag_{{ form_name }}" class="search_tag_list" style="display: none;">
17
    <div id="search_tag_{{ form_name }}" class="search_tag_list" style="display: none;">
18
      <span class="info"></span>
18
      <span class="info"></span>
19
      <div class="tag_loader_div">
19
      <div class="tag_loader_div">
46
   // garde la valeur de l'input)
46
   // garde la valeur de l'input)
47
   $(document).ready(function(){
47
   $(document).ready(function(){
48
     $('div#tags_prompt_{{ form_name }} ul.tagbox li.input input[type="text"]')
48
     $('div#tags_prompt_{{ form_name }} ul.tagbox li.input input[type="text"]')
49
-      .val(string_tag_prompt_input_help)
50
-    ;
49
+      .attr('placeholder', "{{ 'tags.inputtext.help'|trans({}, 'userui') }}");
51
   });
50
   });
52
   
51
   
53
   // On détruit la variable taginit
52
   // On détruit la variable taginit

+ 0 - 1
src/Muzich/CoreBundle/Resources/views/layout.html.twig View File

32
     string_follow_stop = "{{ 'user.stop_follow'|trans({}, 'users') }}";
32
     string_follow_stop = "{{ 'user.stop_follow'|trans({}, 'users') }}";
33
     string_follow_following = "{{ 'user.following'|trans({}, 'users') }}";
33
     string_follow_following = "{{ 'user.following'|trans({}, 'users') }}";
34
     string_follow_follow = "{{ 'user.follow'|trans({}, 'users') }}";
34
     string_follow_follow = "{{ 'user.follow'|trans({}, 'users') }}";
35
-    string_tag_prompt_input_help = "{{ 'tags.inputtext.help'|trans({}, 'userui') }}";
36
     string_tag_add_title = "{{ 'tags.add.title'|trans({}, 'userui') }}";
35
     string_tag_add_title = "{{ 'tags.add.title'|trans({}, 'userui') }}";
37
     string_tag_add_text = "{{ 'tags.add.text'|trans({}, 'userui') }}";
36
     string_tag_add_text = "{{ 'tags.add.text'|trans({}, 'userui') }}";
38
     string_tag_add_argument = "{{ 'tags.add.argument'|trans({}, 'userui') }}";
37
     string_tag_add_argument = "{{ 'tags.add.argument'|trans({}, 'userui') }}";

+ 4 - 9
web/bundles/muzichcore/js/muzich.js View File

217
   //tagsAddeds[form_name] = new Array();
217
   //tagsAddeds[form_name] = new Array();
218
   $('form[name="'+form_name+'"] ul.tagbox li.tag').remove();
218
   $('form[name="'+form_name+'"] ul.tagbox li.tag').remove();
219
   $('form[name="'+form_name+'"] input.tagBox_tags_ids').val('');
219
   $('form[name="'+form_name+'"] input.tagBox_tags_ids').val('');
220
-  $('div#tags_prompt_'+form_name+' ul.tagbox li.input input[type="text"]')
221
-    .val(string_tag_prompt_input_help)
222
-  ;
220
+  
223
 }
221
 }
224
 
222
 
225
 $(document).ready(function(){
223
 $(document).ready(function(){
687
   ////////////////// TAG PROMPT ///////////////
685
   ////////////////// TAG PROMPT ///////////////
688
  
686
  
689
   var ajax_query_timestamp = null;
687
   var ajax_query_timestamp = null;
690
-  var tag_text_help = $('input.tag_text_help').val();
691
  
688
  
692
   // Les deux clicks ci-dessous permettent de faire disparaitre
689
   // Les deux clicks ci-dessous permettent de faire disparaitre
693
   // la div de tags lorsque l'on clique ailleurs
690
   // la div de tags lorsque l'on clique ailleurs
706
   function autocomplete_tag(input, form_name)
703
   function autocomplete_tag(input, form_name)
707
   {
704
   {
708
     // Il doit y avoir au moin un caractère
705
     // Il doit y avoir au moin un caractère
709
-    if ((input.val().length > 0) && (input.val() != string_tag_prompt_input_help)) 
706
+    if (input.val().length > 0) 
710
     {
707
     {
711
 
708
 
712
       // on met en variable l'input
709
       // on met en variable l'input
808
                       inputTag.trigger("selectTag");
805
                       inputTag.trigger("selectTag");
809
                       // On cache la liste puisque le choix vient d'être fait
806
                       // On cache la liste puisque le choix vient d'être fait
810
                       divtags.hide();
807
                       divtags.hide();
811
-                      inputTag.val(tag_text_help); 
808
+                      // On vide le champs de saisie du tag
809
+                      $('input.form-default-value-processed').val('');
812
                       return false;
810
                       return false;
813
                     })
811
                     })
814
                     .append(t_string)
812
                     .append(t_string)
924
           inputTag.trigger("selectTag");
922
           inputTag.trigger("selectTag");
925
           // On cache la liste puisque le choix vient d'être fait
923
           // On cache la liste puisque le choix vient d'être fait
926
           divtags.hide();
924
           divtags.hide();
927
-          inputTag.val(tag_text_help); 
928
 
925
 
929
           link_add_tag.parents('div.search_tag_list').find('img.tag_loader').hide();
926
           link_add_tag.parents('div.search_tag_list').find('img.tag_loader').hide();
930
 
927
 
1060
     return false;
1057
     return false;
1061
   });
1058
   });
1062
   
1059
   
1063
-  $('ul.tagbox li.input input[type="text"]').val(tag_text_help);
1064
   $('ul.tagbox li.input input[type="text"]').formDefaults();
1060
   $('ul.tagbox li.input input[type="text"]').formDefaults();
1065
  
1061
  
1066
   ////////////////// FIN TAG PROMPT ///////////////
1062
   ////////////////// FIN TAG PROMPT ///////////////
1247
       input_tag.val($(this).text());
1243
       input_tag.val($(this).text());
1248
       // Et on execute l'évènement selectTag de l'input
1244
       // Et on execute l'évènement selectTag de l'input
1249
       input_tag.trigger("selectTag");
1245
       input_tag.trigger("selectTag");
1250
-      input_tag.val(tag_text_help); 
1251
     }
1246
     }
1252
     else
1247
     else
1253
     {
1248
     {

+ 0 - 3
web/js/tags/jquery.tagBox.js View File

145
              
145
              
146
           }
146
           }
147
           
147
           
148
-          $('div#tags_prompt_'+form_name+' ul.tagbox li.input input[type="text"]')
149
-            .val(string_tag_prompt_input_help)
150
-          ;
151
         },
148
         },
152
         removeTag : function(index, id, form_name) {
149
         removeTag : function(index, id, form_name) {
153
             
150