@@ -55,15 +55,15 @@ angular.module('mm.addons.mod_data')
5555 angular . forEach ( fields , function ( field ) {
5656 replace = "[[" + field . name + "]]" ;
5757 replace = replace . replace ( / [ \- \[ \] \/ \{ \} \( \) \* \+ \? \. \\ \^ \$ \| ] / g, "\\$&" ) ;
58- replace = new RegExp ( replace , 'g ' ) ;
58+ replace = new RegExp ( replace , 'gi ' ) ;
5959
6060 // Replace field by a generic directive.
6161 render = '<mma-mod-data-field mode="' + mode + '" field="fields[' + field . id + ']" value="entries[' + entryId + '].contents[' + field . id + ']" database="data" view-action="gotoEntry(' + entryId + ')"></mma-mod-data-field>' ;
6262 template = template . replace ( replace , render ) ;
6363 } ) ;
6464
6565 angular . forEach ( actions , function ( enabled , action ) {
66- replace = new RegExp ( "##" + action + "##" , 'g ' ) ;
66+ replace = new RegExp ( "##" + action + "##" , 'gi ' ) ;
6767 if ( enabled ) {
6868 if ( action == "moreurl" ) {
6969 // Render more url directly because it can be part of an HTML attribute.
@@ -196,7 +196,7 @@ angular.module('mm.addons.mod_data')
196196 angular . forEach ( fields , function ( field ) {
197197 replace = "[[" + field . name + "]]" ;
198198 replace = replace . replace ( / [ \- \[ \] \/ \{ \} \( \) \* \+ \? \. \\ \^ \$ \| ] / g, "\\$&" ) ;
199- replace = new RegExp ( replace , 'g ' ) ;
199+ replace = new RegExp ( replace , 'gi ' ) ;
200200
201201 // Replace field by a generic directive.
202202 var render = '<mma-mod-data-field mode="search" field="fields[' + field . id + ']"></mma-mod-data-field>' ;
@@ -205,7 +205,7 @@ angular.module('mm.addons.mod_data')
205205
206206 // Not pluginable other search elements.
207207 angular . forEach ( self . searchOther , function ( field , name ) {
208- replace = new RegExp ( "##" + field + "##" , 'g ' ) ;
208+ replace = new RegExp ( "##" + field + "##" , 'gi ' ) ;
209209
210210 // Replace field by the text input.
211211 var render = '<input type="text" name="' + name + '" placeholder="{{ \'mma.mod_data.author' + field + '\' | translate }}">' ;
@@ -315,7 +315,7 @@ angular.module('mm.addons.mod_data')
315315 angular . forEach ( fields , function ( field ) {
316316 replace = "[[" + field . name + "]]" ;
317317 replace = replace . replace ( / [ \- \[ \] \/ \{ \} \( \) \* \+ \? \. \\ \^ \$ \| ] / g, "\\$&" ) ;
318- replace = new RegExp ( replace , 'g ' ) ;
318+ replace = new RegExp ( replace , 'gi ' ) ;
319319
320320 // Replace field by a generic directive.
321321 var render = '<mma-mod-data-field mode="edit" field="fields[' + field . id + ']" value="entry.contents[' + field . id + ']" database="data" error="errors[' + field . id + ']"></mma-mod-data-field>' ;
@@ -324,7 +324,7 @@ angular.module('mm.addons.mod_data')
324324 // Replace the field id tag.
325325 replace = "[[" + field . name + "#id]]" ;
326326 replace = replace . replace ( / [ \- \[ \] \/ \{ \} \( \) \* \+ \? \. \\ \^ \$ \| ] / g, "\\$&" ) ;
327- replace = new RegExp ( replace , 'g ' ) ;
327+ replace = new RegExp ( replace , 'gi ' ) ;
328328
329329 template = template . replace ( replace , 'field_' + field . id ) ;
330330 } ) ;
0 commit comments