Last active
December 14, 2015 05:59
-
-
Save derekjohnson/5039415 to your computer and use it in GitHub Desktop.
Revisions
-
derekjohnson revised this gist
Feb 26, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ (function(doc){ if(doc.querySelectorAll) { // This only works in IE 8+ var copy = doc.querySelectorAll('.string') // Element(s) with class="string" need to be in markup , i = 0 , ii = copy.length , replace_at = function(text, index, char) { -
derekjohnson revised this gist
Feb 26, 2013 . 1 changed file with 15 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,21 +1,21 @@ (function(doc){ if(doc.querySelectorAll) { // This only works in IE 8+ var copy = doc.querySelectorAll('.string') , i = 0 , ii = copy.length , replace_at = function(text, index, char) { return text.substr(0, index) + char + text.substr(index + 1); } ; for(i; i<ii; i++) { var text = copy[i].textContent; text = replace_at(text, 44, '^'); // Replace 45th char with asterisk text = replace_at(text, 71, '$'); // Replace 72nd char with caret text = replace_at(text, 66, '*'); // Replace 66th char with asterisk copy[i].textContent = text; } } })(document); -
derekjohnson created this gist
Feb 26, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ (function(doc){ if(doc.querySelectorAll) { // This only works in IE 8+ var copy = doc.querySelectorAll('.string') , i = 0 , ii = copy.length , replace_at = function(text, index, char) { return text.substr(0, index) + char + text.substr(index + 1); } ; for(i; i<ii; i++) { var text = copy[i].textContent; text = replace_at(text, 44, '^'); // Replace 45th char with asterisk text = replace_at(text, 71, '$'); // Replace 72nd char with caret text = replace_at(text, 66, '*'); // Replace 66th char with asterisk copy[i].textContent = text; } } })(document);