-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now one can specify custom filename templates via context menu; {handle} will be replaced with AuthorHandle, {OR} will be replaced with Tags Origin, {name} will be replaced with Author Name, {caption} will be replaced with Picture Caption, {tags} will be replaced with a whole tags string.
- Loading branch information
Showing
12 changed files
with
152 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
var tagsOrigin = "AS"; | ||
var windowDisplacement = 90; | ||
|
||
function getImageTags() { | ||
function getImageTags(template) { | ||
var resultingTags = new Array; | ||
var profilelink = document.querySelector('aside div.name a').href; | ||
|
||
var authorHandle = profilelink.substring(profilelink.lastIndexOf('/')+1); | ||
var authorName = document.querySelector('aside div.name a').innerText; | ||
var pictureName = document.querySelector('aside div h1.h3').innerText; | ||
var tempArray = document.getElementsByClassName("tags")[0].innerText.substring(7).split('#'); | ||
|
||
resultingTags.push(authorHandle + "@" + tagsOrigin); | ||
resultingTags.push(authorName.replace(/[ ]/g, '-')); | ||
resultingTags.push(pictureName.replace(/[ ]/g, '-')); | ||
template = template.replace(/\{handle\}/g, authorHandle.replace(/[ \n\t\r\v\f]/g, '-')); | ||
template = template.replace(/\{OR\}/g, tagsOrigin); | ||
template = template.replace(/\{name\}/g, authorName.replace(/[ \n\t\r\v\f]/g, '-')); | ||
template = template.replace(/\{caption\}/g, pictureName.replace(/[ \n\t\r\v\f]/g, '-')) | ||
|
||
for (var i = 0; i < tempArray.length; i++) { | ||
resultingTags.push(tempArray[i]); | ||
template = template.replace(/\{tags\}/g, tempArray[i] + ' {tags}'); | ||
}; | ||
template = template.replace(/ \{tags\}/g, ''); | ||
|
||
resultingTags = template.split(' '); | ||
return resultingTags; | ||
}; |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
var tagsOrigin = "DA"; | ||
var windowDisplacement = 0; | ||
|
||
function getImageTags() { | ||
function getImageTags(template) { | ||
var resultingTags = new Array; | ||
|
||
|
||
var authorHandle = document.URL.substring(document.URL.lastIndexOf('.com/')+5,document.URL.lastIndexOf('/art/')); | ||
var authorName = ""; | ||
var pictureName = document.URL.substring(document.URL.lastIndexOf('/art/')+5,document.URL.lastIndexOf('-')); | ||
var tempArray = document.querySelectorAll("[href*='/tag/']"); | ||
|
||
resultingTags.push(authorHandle + "@" + tagsOrigin); | ||
resultingTags.push(pictureName.replace(/[ ]/g, '-')); //replace is not needed | ||
template = template.replace(/\{handle\}/g, authorHandle.replace(/[ \n\t\r\v\f]/g, '-')); | ||
template = template.replace(/\{OR\}/g, tagsOrigin); | ||
template = template.replace(/\{name\}/g, authorName.replace(/[ \n\t\r\v\f]/g, '-')); | ||
template = template.replace(/\{caption\}/g, pictureName.replace(/[ \n\t\r\v\f]/g, '-')) | ||
|
||
for (var i = 0; i < tempArray.length; i++) { | ||
resultingTags.push(tempArray[i].innerText.replace(/[#]/g, '')); // Eclipse design has no hash here #, old site has hash | ||
template = template.replace(/\{tags\}/g, tempArray[i].innerText.replace(/[#]/g, '') + ' {tags}'); // Eclipse design has no hash here #, old site has hash | ||
}; | ||
template = template.replace(/ \{tags\}/g, ''); | ||
|
||
resultingTags = template.split(' '); | ||
return resultingTags; | ||
}; |
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
var tagsOrigin = "HF"; | ||
var windowDisplacement = 0; | ||
|
||
function getImageTags() { | ||
function getImageTags(template) { | ||
var resultingTags = new Array; | ||
var urlDivided = document.URL.substring(document.URL.lastIndexOf('/user/')+6).split('/'); | ||
|
||
var authorHandle = urlDivided[0]; | ||
var authorName = ""; | ||
var pictureName = urlDivided[2]; | ||
var tempArray = document.querySelectorAll('div.boxbody td a[rel="tag"]'); | ||
|
||
resultingTags.push(authorHandle + "@" + tagsOrigin); | ||
resultingTags.push(pictureName.replace(/[ ]/g, '-')); //replacement is not needed | ||
template = template.replace(/\{handle\}/g, authorHandle.replace(/[ \n\t\r\v\f]/g, '-')); | ||
template = template.replace(/\{OR\}/g, tagsOrigin); | ||
template = template.replace(/\{name\}/g, authorName.replace(/[ \n\t\r\v\f]/g, '-')); | ||
template = template.replace(/\{caption\}/g, pictureName.replace(/[ \n\t\r\v\f]/g, '-')) | ||
|
||
for (var i = 0; i < tempArray.length; i++) { | ||
resultingTags.push(tempArray[i].innerText.replace(/[#]/g, '')); | ||
template = template.replace(/\{tags\}/g, tempArray[i].innerText.replace(/[#]/g, '') + ' {tags}'); | ||
}; | ||
template = template.replace(/ \{tags\}/g, ''); | ||
|
||
resultingTags = template.split(' '); | ||
return resultingTags; | ||
}; |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
var tagsOrigin = "PX"; | ||
var windowDisplacement = 0; | ||
|
||
function getImageTags() { | ||
function getImageTags(template) { | ||
var resultingTags = new Array; | ||
|
||
|
||
var authorHandle = document.querySelector('aside section h2 div div a div').innerText; | ||
var authorName = ""; | ||
var pictureName = document.querySelector('figcaption div div h1').innerText; | ||
var tempArray = document.querySelectorAll('figcaption div footer ul li a'); | ||
|
||
resultingTags.push(authorHandle.replace(/[ ]/g, '-') + "@" + tagsOrigin); | ||
resultingTags.push(pictureName.replace(/[ ]/g, '-')); | ||
|
||
template = template.replace(/\{handle\}/g, authorHandle.replace(/[ \n\t\r\v\f]/g, '-')); | ||
template = template.replace(/\{OR\}/g, tagsOrigin); | ||
template = template.replace(/\{name\}/g, authorName.replace(/[ \n\t\r\v\f]/g, '-')); | ||
template = template.replace(/\{caption\}/g, pictureName.replace(/[ \n\t\r\v\f]/g, '-')) | ||
|
||
for (var i = 0; i < tempArray.length; i++) { | ||
resultingTags.push(tempArray[i].innerText); | ||
template = template.replace(/\{tags\}/g, tempArray[i].innerText + ' {tags}'); | ||
}; | ||
template = template.replace(/ \{tags\}/g, ''); | ||
|
||
resultingTags = template.split(' '); | ||
return resultingTags; | ||
}; |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
var tagsOrigin = "TU"; | ||
var windowDisplacement = 0; | ||
|
||
function getImageTags() { | ||
function getImageTags(template) { | ||
var resultingTags = new Array; | ||
|
||
|
||
var authorHandle = document.URL.substring(document.URL.lastIndexOf('://')+3,document.URL.lastIndexOf('.tumblr')); | ||
var authorName = document.querySelector("header div figcaption, header div h1 a").innerText; //it's either one or the other | ||
var pictureName = ""; | ||
var tempArray = document.querySelectorAll("[href*='/tagged/']"); | ||
|
||
resultingTags.push(authorHandle + "@" + tagsOrigin); | ||
resultingTags.push(authorName.replace(/[ ]/g, '-')); | ||
template = template.replace(/\{handle\}/g, authorHandle.replace(/[ \n\t\r\v\f]/g, '-')); | ||
template = template.replace(/\{OR\}/g, tagsOrigin); | ||
template = template.replace(/\{name\}/g, authorName.replace(/[ \n\t\r\v\f]/g, '-')); | ||
template = template.replace(/\{caption\}/g, pictureName.replace(/[ \n\t\r\v\f]/g, '-')) | ||
|
||
for (var i = 0; i < tempArray.length; i++) { | ||
resultingTags.push(tempArray[i].innerText.replace(/[#]/g, '')); | ||
template = template.replace(/\{tags\}/g, tempArray[i].innerText.replace(/[#]/g, '') + ' {tags}'); | ||
}; | ||
template = template.replace(/ \{tags\}/g, ''); | ||
|
||
resultingTags = template.split(' '); | ||
return resultingTags; | ||
}; |
Oops, something went wrong.