</div>
<div id="about-text" class="panel-collapse collapse">
<div class="panel-body">
- <p><strong>ObsCalc 2.0</strong></p>
+ <p><strong>ObsCalc <span class="version"></span></strong></p>
<p>ObsCalc is a free and open source software published under GPL v3. It has been developed by Agnibho Mondal <mail@agnibho.com>.</p>
<p><a href="https://code.agnibho.com/obscalc/">https://code.agnibho.com/obscalc/</a></p>
<p>Copyright © <span class="copyright" data-start="2016">2016</span> Agnibho Mondal</p>
$(".loader").remove();
$(".container").fadeIn();
+ //Insert version code
+ $(".version").text(VERSION);
+
//Update copyright
$(".copyright").each(function(){
if(new Date().getFullYear()>$(this).data("start")){
$("#notify").width($(".container").width()-20);
});
$.get("https://code.agnibho.com/obscalc/info.json", function(data){
- if(data.latest > VERSION){
+ var vCurr=VERSION.split(".").map(Number);
+ var vLtst=data.latest.split(".").map(Number);
+ function isBiggerThan(v1, v2){
+ while(v1.length<v2.length){
+ v1.push(0);
+ }
+ while(v2.length<v1.length){
+ v2.push(0);
+ }
+ for(var i=0; i<v1.length; i++){
+ if(v1[i]>v2[i]){
+ return true;
+ }
+ }
+ return false;
+ }
+ if(isBiggerThan(data.latest, VERSION)){
$("#notify").slideDown();
$("#notify").width($(".container").width()-20);
$("#notify-text").text("A new version of ObsCalc is available.");