File tree Expand file tree Collapse file tree 3 files changed +10
-13
lines changed
Expand file tree Collapse file tree 3 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -136,9 +136,8 @@ <h2>a simple client side profanity filter</h2>
136136 customSwears : [ 'ass' ] ,
137137 filter : false ,
138138 externalSwears : 'swearWords.json' ,
139- profaneText : function ( ret ) {
139+ profaneText : function ( data ) {
140140 $ ( '#five' ) . css ( 'color' , 'blue' ) ;
141- alert ( ret ) ;
142141 }
143142 } )
144143 </ script >
Original file line number Diff line number Diff line change 129129 x ,
130130 inputs = $ ( this ) . find ( ':input' ) ,
131131 profane = false ,
132- returnVal = [ ] ;
132+ data = [ ] ;
133133
134134 if ( options . externalSwears !== null ) {
135135 if ( localStorageIsEnabled ) {
170170 for ( x = 0 ; x < nodes . length ; x += 1 ) {
171171 if ( re . test ( nodes [ x ] . nodeValue ) ) {
172172 profane = true ;
173- console . log ( badWords [ 1 ] ) ;
174- returnVal . push ( badWords [ i ] ) ;
173+ data . push ( badWords [ i ] ) ;
175174 if ( options . filter ) {
176175 nodes [ x ] . nodeValue = nodes [ x ] . nodeValue . replace ( re , rep ) ;
177176 }
182181 for ( var x = 0 ; x < inputs . length ; x ++ ) {
183182 if ( re . test ( inputs [ x ] . value ) ) {
184183 profane = true ;
185- console . log ( badWords [ 1 ] ) ;
186- returnVal . push ( badWords [ i ] ) ;
184+ data . push ( badWords [ i ] ) ;
187185 if ( options . filter ) {
188186 $ ( inputs [ x ] ) . val ( inputs [ x ] . value . replace ( re , rep ) ) ;
189187 }
192190 }
193191
194192 if ( profane ) {
195- options . profaneText ( returnVal . unique ( ) ) ;
193+ options . profaneText ( data . unique ( ) ) ;
196194 } ;
197195 } ) ;
198196 } ;
Original file line number Diff line number Diff line change 129129 x ,
130130 inputs = $ ( this ) . find ( ':input' ) ,
131131 profane = false ,
132- returnVal = [ ] ;
132+ data = [ ] ;
133133
134134 if ( options . externalSwears !== null ) {
135135 if ( localStorageIsEnabled ) {
170170 for ( x = 0 ; x < nodes . length ; x += 1 ) {
171171 if ( re . test ( nodes [ x ] . nodeValue ) ) {
172172 profane = true ;
173- returnVal . push ( badWords [ i ] ) ;
173+ data . push ( badWords [ i ] ) ;
174174 if ( options . filter ) {
175175 nodes [ x ] . nodeValue = nodes [ x ] . nodeValue . replace ( re , rep ) ;
176176 }
181181 for ( var x = 0 ; x < inputs . length ; x ++ ) {
182182 if ( re . test ( inputs [ x ] . value ) ) {
183183 profane = true ;
184- returnVal . push ( badWords [ i ] ) ;
184+ data . push ( badWords [ i ] ) ;
185185 if ( options . filter ) {
186186 $ ( inputs [ x ] ) . val ( inputs [ x ] . value . replace ( re , rep ) ) ;
187187 }
190190 }
191191
192192 if ( profane ) {
193- options . profaneText ( returnVal . unique ( ) ) ;
194- }
193+ options . profaneText ( data . unique ( ) ) ;
194+ } ;
195195 } ) ;
196196 } ;
197197} ) ( jQuery ) ;
You can’t perform that action at this time.
0 commit comments