Skip to content

Commit

Permalink
[feat]Update ain.js
Browse files Browse the repository at this point in the history
  • Loading branch information
renyuzhuo committed Aug 15, 2019
1 parent a25c3c0 commit 0ab56a8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
5 changes: 2 additions & 3 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@




</script>
<script type="text/ractive" id="detailTpl">
{{#post}}
Expand All @@ -62,6 +63,7 @@ <h1>{{title}}</h1>
{{/post}}



</script>
</section>
<footer>
Expand All @@ -87,10 +89,7 @@ <h1>{{title}}</h1>
</div>
<script type="text/javascript">
if (IsPhone()) {
alert("in");
$(".side-bar").hide();
} else {
alert("out")
}
</script>
</body>
Expand Down
27 changes: 15 additions & 12 deletions zzuhtzy/js/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Ractive.DEBUG = false;

var _config = {
const _config = {
blog_name: 'Blog',
owner: 'renyuzhuo',
repo: 'Blog',
access_token: '6c42564c0e7fb298df020' + '38caae586fcdd0ef18d'
}
};

var baseUrl = "https://api.github.com/repos/" + _config['owner'] + "/" + _config['repo'] + "/issues";
const baseUrl = "https://api.github.com/repos/" + _config['owner'] + "/" + _config['repo'] + "/issues";

function highlight() {
$('pre code').each(function (i, block) {
Expand Down Expand Up @@ -125,13 +125,13 @@ function index() {
labels("Blog");
}

var helpers = Ractive.defaults.data;
const helpers = Ractive.defaults.data;
helpers.markdown2HTML = function (content) {
return marked(content);
}
};
helpers.formatTime = function (time) {
return time.substr(0, 10);
}
};

var routes = {
'/': index,
Expand Down Expand Up @@ -182,12 +182,15 @@ function goBack() {
/**
* @return {boolean}
*/
function IsPhone(){
var userAgentInfo = navigator.userAgent;
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }
function IsPhone() {
const userAgentInfo = navigator.userAgent;
const Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
let flag = true;
for (let v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return !flag;
}

0 comments on commit 0ab56a8

Please sign in to comment.