final release version 1.0
|
@ -1,17 +0,0 @@
|
|||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
|
@ -7,7 +7,8 @@ function loadReplace()
|
|||
chrome.storage.local.get("person", function(value)
|
||||
{
|
||||
person = value.person;
|
||||
walk(document.body);
|
||||
if(person != null){walk(document.body);}
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,79 +0,0 @@
|
|||
|
||||
var person;
|
||||
|
||||
|
||||
loadReplace();
|
||||
|
||||
|
||||
function loadReplace()
|
||||
{
|
||||
chrome.storage.local.get("person", function(value)
|
||||
{
|
||||
person = value.person;
|
||||
walk(document.body);
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function walk(node)
|
||||
{
|
||||
// I stole this function from here:
|
||||
// http://is.gd/mwZp7E
|
||||
|
||||
var child, next;
|
||||
|
||||
switch ( node.nodeType )
|
||||
{
|
||||
case 1: // Element
|
||||
case 9: // Document
|
||||
case 11: // Document fragment
|
||||
child = node.firstChild;
|
||||
while ( child )
|
||||
{
|
||||
next = child.nextSibling;
|
||||
walk(child);
|
||||
child = next;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // Text node
|
||||
handleText(node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function handleText(textNode)
|
||||
{
|
||||
var v = textNode.nodeValue;
|
||||
|
||||
v = v.replace("Y/N", person);
|
||||
v = v.replace("y/n", person);
|
||||
v = v.replace("Y/n", person);
|
||||
v = v.replace("y/N", person);
|
||||
v = v.replace("(Y/N)", person);
|
||||
v = v.replace("(y/n)", person);
|
||||
v = v.replace("(Y/n)", person);
|
||||
v = v.replace("(y/N)", person);
|
||||
v = v.replace("Y/N?", person + "?");
|
||||
v = v.replace("y/n?", person + "?");
|
||||
v = v.replace("Y/n?", person + "?");
|
||||
v = v.replace("y/N?", person + "?");
|
||||
v = v.replace("Y/N!", person + "!");
|
||||
v = v.replace("y/n!", person + "!");
|
||||
v = v.replace("Y/n!", person + "!");
|
||||
v = v.replace("y/N!", person + "!");
|
||||
v = v.replace("(Y/N)?", person + "?");
|
||||
v = v.replace("(y/n)?", person + "?");
|
||||
v = v.replace("(Y/n)?", person + "?");
|
||||
v = v.replace("(y/N)?", person + "?");
|
||||
v = v.replace("(Y/N)!", person + "!");
|
||||
v = v.replace("(y/n)!", person + "!");
|
||||
v = v.replace("(Y/n)!", person + "!");
|
||||
v = v.replace("(y/N)!", person + "!");
|
||||
|
||||
|
||||
|
||||
textNode.nodeValue = v;
|
||||
}
|
||||
|
||||
|
BIN
icon-128.png
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 20 KiB |
BIN
icon-16.png
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.3 KiB |
BIN
icon-48.png
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 5.7 KiB |
BIN
icon.png
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 4.8 KiB |
|
@ -20,7 +20,10 @@
|
|||
"run_at": "document_end"
|
||||
}
|
||||
],
|
||||
"incognito": "split"
|
||||
"incognito": "split",
|
||||
"background": {
|
||||
"page": "popup.html"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Interactive Fics",
|
||||
"version": "1.0",
|
||||
"description": "Replaces Y/N in Reader Insert/second person fics with a name of your choice.",
|
||||
"browser_action": {
|
||||
"default_icon": "icon.png",
|
||||
"default_popup": "popup.html" },
|
||||
"permissions": [
|
||||
"storage",
|
||||
"tabs"],
|
||||
"icons": { "16": "icon-16.png",
|
||||
"48": "icon-48.png",
|
||||
"128": "icon-128.png" },
|
||||
"content_scripts":
|
||||
[
|
||||
{
|
||||
"matches": ["*://*/*"],
|
||||
"js": ["content_script.js"],
|
||||
"run_at": "document_end"
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href='http://fonts.googleapis.com/css?family=Play:400,700' rel='stylesheet' type='text/css'>
|
||||
<title>Interactive Fics</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">
|
||||
<meta http-equiv="content-style-type" content="text/css">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link href='http://fonts.googleapis.com/css?family=Play' rel='stylesheet' type='text/css'>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-color: white;
|
||||
|
|
50
popup.html~
|
@ -1,50 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href='http://fonts.googleapis.com/css?family=Play:400,700' rel='stylesheet' type='text/css'>
|
||||
<title>Interactive Fics</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">
|
||||
<meta http-equiv="content-style-type" content="text/css">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-color: white;
|
||||
color: #16a085;
|
||||
width: 250px;
|
||||
padding:10px;
|
||||
font-family: 'Play', sans-serif;
|
||||
}
|
||||
h1 {
|
||||
font-size: 16px;
|
||||
}
|
||||
a{
|
||||
color: #e67e22;
|
||||
}
|
||||
a:hover{
|
||||
color: #16a085;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script src="popup.js" type="text/javascript" >
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<h1>Enter the name here:</h1>
|
||||
|
||||
<form><input type="text" id="inputTxt" placeholder="To restore, enter 'Y/N'"/><input type="submit" id="submit" value="Change"/></form>
|
||||
<p>
|
||||
<details><summary>About</summary>
|
||||
<a href="http://interactivefics.tumblr.com" target="_blank" title="Official tumblr">Interactive Fics</a> is a free Chrome extension developed by <a href="https://github.com/blaringsilence" target="_blank" title="her github">blaringsilence</a> to improve your online story reading experience. The extension is open source and all source code can be found <a href="https://github.com/blaringsilence/interactive-fics" title="github repo">here.</a>
|
||||
</details>
|
||||
<br>
|
||||
<a href="http://interactivefics.tumblr.com/ask" target="_blank">Feedback, suggestions and requests.</a></br>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
2
popup.js
|
@ -4,6 +4,8 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
}); //instead of onclick="clickHandler()" in popup.html
|
||||
|
||||
|
||||
|
||||
|
||||
function clickHandler(){
|
||||
var person = document.getElementById("inputTxt").value;
|
||||
chrome.storage.local.set({"person": person}, chrome.tabs.reload());
|
||||
|
|
11
popup.js~
|
@ -1,11 +0,0 @@
|
|||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.querySelector('button').addEventListener('click', clickHandler);
|
||||
}); //instead of onclick="clickHandler()" in popup.html
|
||||
|
||||
|
||||
function clickHandler(){
|
||||
var person = document.getElementById("inputTxt").value;
|
||||
chrome.storage.local.set({"person": person}, chrome.tabs.reload());
|
||||
}
|
||||
|