mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 22:13:23 -07:00
The out of bounds didn't work with edge, as this cuts into the title. So this should improve the experience.
This commit is contained in:
parent
827e095b5b
commit
1aedebd57c
2 changed files with 26 additions and 3 deletions
|
@ -1,8 +1,31 @@
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
var searchQuery = window.location.search;
|
|
||||||
|
var searchQuery = window.location.search.substring(1);
|
||||||
|
var vars = searchQuery.split('&');
|
||||||
|
|
||||||
|
function getQueryVariable(variable) {
|
||||||
|
for (var i = 0; i < vars.length; i++) {
|
||||||
|
var pair = vars[i].split('=');
|
||||||
|
if (decodeURIComponent(pair[0]) == variable) {
|
||||||
|
return decodeURIComponent(pair[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (searchQuery && searchQuery.length >= 1) {
|
if (searchQuery && searchQuery.length >= 1) {
|
||||||
var oldTitle = (window.document.title === undefined) ? "" : window.document.title;
|
var oldTitle = (window.document.title === undefined) ? "" : window.document.title;
|
||||||
window.document.title=oldTitle + "||" + searchQuery.substring(1) + "||";
|
var state=getQueryVariable("state");
|
||||||
|
var code=getQueryVariable("code");
|
||||||
|
var error=getQueryVariable("error") || "unknown";
|
||||||
|
|
||||||
|
if (error == null && (state || code)) {
|
||||||
|
window.document.title=oldTitle + "?state=" + state + "&code=" + code;
|
||||||
|
} else {
|
||||||
|
window.document.title=oldTitle + "?error=" + error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.document.title=oldTitle + "?error=noquery";
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
layout: oauth
|
layout: oauth
|
||||||
title: Greenshot authenticated with Imgur
|
title: Imgur
|
||||||
permalink: /oauth/imgur
|
permalink: /oauth/imgur
|
||||||
categories: [oauth]
|
categories: [oauth]
|
||||||
tags: [uses_alerts]
|
tags: [uses_alerts]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue