mirror of
https://github.com/greenshot/greenshot
synced 2025-08-23 06:36:20 -07:00
Oauth imgur - Changed the version check, to only show something if a version was supplied. Made the oauth-imgur.html work with alerts.
This commit is contained in:
parent
ab45ff741d
commit
1a42f23258
2 changed files with 26 additions and 20 deletions
|
@ -15,13 +15,13 @@ release_blog_posts["1.2.9.129"] = "/2017/01/28/129-bug-bash/";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="currentVersion" class="alert alert-success collapse" role="alert">
|
<div id="currentVersion" class="alert alert-success collapse" role="alert">
|
||||||
<i class="fa fa-check-circle"></i> You installed the most recent version of Greenshot.
|
<i class="fa fa-check-circle"></i> You are using the most recent version of Greenshot.
|
||||||
<div id="blogPost1" class="collapse">More information about the version you installed can be found <a id="blog1" href="">here</a>.</div>
|
<div id="blogPost1" class="collapse">More information about this version can be found <a id="blog1" href="">here</a>.</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="oldVersion" class="alert alert-danger collapse" role="alert">
|
<div id="oldVersion" class="alert alert-danger collapse" role="alert">
|
||||||
<i class="fa fa-exclamation-triangle"></i> <strong>You are not using the newest Greenshot version.</strong><br/>
|
<i class="fa fa-exclamation-triangle"></i> <strong>You are not using the newest Greenshot version.</strong><br/>
|
||||||
<div id="blogPost2" class="collapse">More information about the version you installed can be found <a id="blog2" href="">here</a>.</div>
|
<div id="blogPost2" class="collapse">More information about the version you are using can be found <a id="blog2" href="">here</a>.</div>
|
||||||
You might want to download the newest version, which is {{ latest_release.tag_name }}, from <a href="/downloads/">here</a>. Also always make sure to get Greenshot from <a href="http://getgreenshot.org/">getgreenshot.org</a>, .
|
You might want to download the newest version, which is {{ latest_release.tag_name }}, from <a href="/downloads/">here</a>. Also always make sure to get Greenshot from <a href="https://getgreenshot.org/">getgreenshot.org</a>, .
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -70,21 +70,26 @@ function compareVersion(a, b) {
|
||||||
// Otherwise they are the same.
|
// Otherwise they are the same.
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
var versionMatch = /version=([^&]+)/.exec(location);
|
||||||
var installedVersion = /version=([^&]+)/.exec(location)[1];
|
if (versionMatch) {
|
||||||
var greenshotTag = {% if latest_release.tag_name %}"{{ latest_release.tag_name }}"{% else %}"Greenshot-Test-1.2.9.129"{% endif %};
|
var installedVersion = versionMatch[1];
|
||||||
var releaseVersion = /.*(\d+\.\d+\.\d+\.\d+)/.exec(greenshotTag)[1];
|
var greenshotTag = {% if latest_release.tag_name %}"{{ latest_release.tag_name }}"{% else %}"Greenshot-Test-1.2.9.129"{% endif %};
|
||||||
var compare=compareVersion(releaseVersion, installedVersion);
|
var releaseVersion = /.*(\d+\.\d+\.\d+\.\d+)/.exec(greenshotTag)[1];
|
||||||
var matchingBlogPost = release_blog_posts[installedVersion];
|
var compare=compareVersion(releaseVersion, installedVersion);
|
||||||
if (matchingBlogPost) {
|
var matchingBlogPost = release_blog_posts[installedVersion];
|
||||||
jQuery('#blog1').prop("href", matchingBlogPost);
|
if (matchingBlogPost) {
|
||||||
jQuery('#blogPost1').slideToggle();
|
jQuery('#blog1').prop("href", matchingBlogPost);
|
||||||
jQuery('#blog2').prop("href", matchingBlogPost);
|
jQuery('#blogPost1').slideToggle();
|
||||||
jQuery('#blogPost2').slideToggle();
|
jQuery('#blog2').prop("href", matchingBlogPost);
|
||||||
}
|
jQuery('#blogPost2').slideToggle();
|
||||||
if (compare >= 1) {
|
}
|
||||||
jQuery('#oldVersion').slideToggle();
|
if (compare >= 1) {
|
||||||
} else if (compare == 0) {
|
jQuery('#oldVersion').slideToggle();
|
||||||
|
} else if (compare == 0) {
|
||||||
|
jQuery('#currentVersion').slideToggle();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
jQuery('#currentVersion').slideToggle();
|
jQuery('#currentVersion').slideToggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
|
@ -3,10 +3,11 @@ layout: oauth
|
||||||
title: Greenshot authenticated with Imgur
|
title: Greenshot authenticated with Imgur
|
||||||
permalink: /oauth/imgur
|
permalink: /oauth/imgur
|
||||||
categories: [oauth]
|
categories: [oauth]
|
||||||
|
tags: [uses_alerts]
|
||||||
comments: []
|
comments: []
|
||||||
---
|
---
|
||||||
{% include version-check.html %}
|
|
||||||
{% include oauth-out-of-bounds.html %}
|
{% include oauth-out-of-bounds.html %}
|
||||||
|
{% include version-check.html %}
|
||||||
<p>
|
<p>
|
||||||
Greenshot should now be authenticated to use Imgur, you can close this window.
|
Greenshot should now be authenticated to use Imgur, you can close this window.
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue