Skip to content

Commit

Permalink
Reposi3-Nightly-15.07.13-1: Bugfixes
Browse files Browse the repository at this point in the history
- Fix target _blank is not being applied in Cydia then repo.xml is missing
- Fix IE9/10 compatibility.
  • Loading branch information
supermamon committed Jul 13, 2015
1 parent 7a86c96 commit 5bd586b
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 50 deletions.
83 changes: 45 additions & 38 deletions depictions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
<style>
@media (max-width: 767px) {
body{background:#efeff4!important;margin:0;padding:0;border:0;outline:0;box-sizing:border-box}
}
}
.jumbotron-bg {
background: green
}
</style>
<script type="text/javascript">
bundleid = $.QueryString['p'];

bundleid = $.QueryString['p'];

var contentBlocks = {
"#packageName" :
{"type":"text","source":"package>name"}
,"#packageHeader" :
,"#packageHeader" :
{"type":"custom"
,"source":"package>name"
,"render":function(element,source){
if (navigator.userAgent.search(/Cydia/) != -1) {
$(element).hide();
if (navigator.userAgent.search(/Cydia/) == -1) {
$(element).show();
}
}
}
Expand All @@ -51,14 +51,14 @@
if(res==0) {$(element).hide()}
}
}
,"#descriptionList" :
{"type":"list"
,"#descriptionList" :
{"type":"list"
,"source" :"package>descriptionlist>description"
,"paragraphElement" : "<li class='list-group-item'>"
,"emptyListCallback":function(e){$("#descriptionPanel").hide()}
}
,"#screenshotsLink" :
{"type":"custom"
,"#screenshotsLink" :
{"type":"custom"
,"source" :"package>screenshots>screenshot"
,"render":function(element, source){
$("#screenshotsLink").remove();
Expand All @@ -70,20 +70,20 @@
$("<li class='list-group-item'>").append(
$("<a>")
.attr("href","screenshots.html?p="+bundleid)
.text("Screenshots")
.text("Screenshots")
)
);
}
}
,"#versionBadge" : {"type":"text","source":"package>version"}
,"#changesList" :
{"type":"list"
,"#changesList" :
{"type":"list"
,"source" :"package>changelog>change"
,"reverseRender" : true
,"paragraphElement" : "<li class='list-group-item'>"
,"emptyListCallback":function(e){$("#changesList").hide()}
}
,"#changelogLink" :
,"#changelogLink" :
{"type":"link"
,"text":"Full Changelog"
,"url":"changelog.html"
Expand All @@ -92,23 +92,23 @@
]
}
,"#dependencyList" :
{"type":"list"
{"type":"list"
,"source" :"package>dependencies>package"
,"paragraphElement" : "<li class='list-group-item'>"
,"emptyListCallback":function(e){$("#dependenciesContainer").remove()}
}
,"#externalLinksList" :
{"type":"custom"
{"type":"custom"
,"source" :"package>links>link"
,"paragraphElement" : "<li class='list-group-item'>"
,"render":function(element,source){
if ($(source).size()==0){
$('#externalLinksContainer').remove()
}

$.each(source, function(index,data){
var p = $("<li class='list-group-item'>");
$(p).append(
$(p).append(
$("<a>")
.attr("href",$(data).find('url').text())
.text($(data).find('name').text())
Expand All @@ -126,15 +126,15 @@
success : function(xml){
document.title = $(xml).find("package>name").text();
data_loader_engine(contentBlocks,xml)

},
cache : false,
error: function() {
$("#packageError").show();
$("#packageInformation").hide();
}
}); //ajax

}); // ready
</script>
</head>
Expand All @@ -143,7 +143,7 @@

<div id="packageInformation">

<div id="packageHeader" class="container">
<div id="packageHeader" class="container" style="hide">
<div class="jumbotron">
<h1 id="packageName"></h1>
<p>brought to you by Reposi3</p>
Expand All @@ -160,7 +160,7 @@ <h5>DESCRIPTION</h5>
<li id="screenshotsLink" />
</ul>
</div>

<div class="container">
<h5>IN THIS VERSION <span id="versionBadge" class="badge" /></h5>
<ul id="changesList" class="list-group">
Expand All @@ -172,25 +172,34 @@ <h5>DEPENDENCIES</h5>
<ul id="dependencyList" class="list-group">
</ul>
</div>

<div class="container" id="externalLinksContainer">
<h5>LINKS</h5>
<ul id="externalLinksList" class="list-group">
</ul>
</div>

</div>
<div id="packageError" style="display:none">
<div class="container">
<div class="alert alert-danger">
<strong>Oh snap!</strong> The package you are tying to view is not hosted on this repository.
<strong>Oh snap!</strong> The package you are tying to view is not hosted on this repository.
</div>
</div>
</div>

<script type="text/javascript">
function setAnchorTargets() {
// if on Cydia, set link targets to _blank
if (navigator.userAgent.search(/Cydia/) != -1) {
$("a").each(function() {
$(this).attr("target","_blank");
});
}
}

var repoContents = {
"#repoFooterLinks" :
"#repoFooterLinks" :
{"type":"custom"
,"source":"repo>footerlinks>link"
,"render":function(element,source) {
Expand All @@ -203,7 +212,7 @@ <h5>LINKS</h5>
i.attr("class",$(data).find('iconclass').text());
console.log(i);
$(a).append(i);
}
}
$(a).append(' '+$(data).find('name').text());
$(p).append(a)
$(element).append(p);
Expand All @@ -214,18 +223,16 @@ <h5>LINKS</h5>
$( document ).ready(function() {
$.ajax({type: "GET", dataType: "xml",url : ("../repo.xml"),cache: false,
success : function(xml){
data_loader_engine(repoContents,xml);
if (navigator.userAgent.search(/Cydia/) != -1) {
$("a").each(function() {
console.log($(this).text());
$(this).attr("target","_blank");
});
}
},
error: function() {$("#contactInfo").hide()}
data_loader_engine(repoContents,xml);
setAnchorTargets();
},
error: function() {
$("#contactInfo").hide();
setAnchorTargets();
}
}); //ajax


}); // ready

</script>
Expand Down
25 changes: 13 additions & 12 deletions depictions/js/ios_version_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ let me know and I'll credit you.
*/

const VERSION_CHECK_SUPPORTED = "Your iOS version is supported! &#x1f60a;";
const VERSION_CHECK_NEEDS_UPGRADE = "Requires at least iOS %s &#x1f615;";
const VERSION_CHECK_UNCONFIRMED = "Not yet tested on iOS %s &#x1f601;";
const VERSION_CHECK_UNSUPPORTED = "Only compatible with iOS %s to %s &#x1f61e;";
// changed const to var for IE9/10 compatibity.
var VERSION_CHECK_SUPPORTED = "Your iOS version is supported! &#x1f60a;";
var VERSION_CHECK_NEEDS_UPGRADE = "Requires at least iOS %s &#x1f615;";
var VERSION_CHECK_UNCONFIRMED = "Not yet tested on iOS %s &#x1f601;";
var VERSION_CHECK_UNSUPPORTED = "Only compatible with iOS %s to %s &#x1f61e;";

function ios_version_check(minIOS,maxIOS,otherIOS,callBack) {
"use strict";
"use strict";


function parseVersionString(version) {
var bits = version.split(".");
return [ bits[0], bits[1] ? bits[1] : 0, bits[2] ? bits[2] : 0 ];
Expand All @@ -39,8 +40,8 @@ function ios_version_check(minIOS,maxIOS,otherIOS,callBack) {
}

return 0;
}
}

var version = navigator.appVersion.match(/CPU( iPhone)? OS (\d+)_(\d+)(_(\d+))? like/i);
if (!version) {
return 0;
Expand All @@ -57,7 +58,7 @@ function ios_version_check(minIOS,maxIOS,otherIOS,callBack) {

message = VERSION_CHECK_SUPPORTED,
isBad = false;

if (compareVersions(minVersion, osVersion) == 1) {
message = VERSION_CHECK_NEEDS_UPGRADE.replace("%s", minString);
isBad = true;
Expand All @@ -71,6 +72,6 @@ function ios_version_check(minIOS,maxIOS,otherIOS,callBack) {
isBad = true;
}
callBack(message,isBad);

return (isBad?-1:1);
}
}

0 comments on commit 5bd586b

Please sign in to comment.