Skip to content

Commit

Permalink
更新 36kr 到 1.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Houfeng committed Oct 21, 2015
1 parent de44f99 commit dd48a83
Show file tree
Hide file tree
Showing 18 changed files with 368 additions and 3,274 deletions.
19 changes: 0 additions & 19 deletions 36Kr/README.md

This file was deleted.

3 changes: 2 additions & 1 deletion 36Kr/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

<body>
<header class="mui-bar mui-bar-nav" style="position: static;">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 id="title" class="mui-title kr-title"><span class="kr-logo">36Kr</span></h1>
</header>
<div class="container">
<article class="single-post-article">
<div class="content-wrapper-single">
<section class="article">
<h3 id="toc_0">36氪,专注互联网创业。</h3>
<p>应用版本:1.0.0</p>
<p>应用版本:1.3.6</p>
<p>2010年12月8日,36氪作为科技媒体正式上线,其名字源于元素周期表的第36号元素“氪”,化学符号为 Kr,一个稳定、独立,不易与其他其他物质发生化学作用的元素。传说中的氪星是超人的故乡。</p>

<p>经历四年成长,36氪不仅有备受顶级投资机构关注的高效互联网融资平台(氪加),还有专注于互联网创业项目孵化的氪空间(Kr Space),在全中国首创了“不收费、不占股、全球资本,平台服务”的新型孵化器模式。同时,36氪的科技媒体,已然成为最前沿科技资讯的平台,也是互联网创业者寻求报道,接洽资本的首选入口。由媒体、氪加和氪空间三条产品线,构成了36氪专注互联网创业的生态圈模式。</p>
Expand Down
73 changes: 73 additions & 0 deletions 36Kr/appStream.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"version": "1.3.6",
"protocol": [
"http",
"https"
],
"rooturl": "",
"index": {
"href": "index.html",
"resources": [
"manifest.json",
"js/app.js",
"js/mui.min.js",
"css/app.css",
"img/36kr_2x.png",
"img/icon.png",
"img/bg.png",
"css/mui.min.css",
"fonts/mui.ttf",
"list.html",
"img/blank.jpg",
"js/html5sql.js",
"js/feed.js",
"js/news.js",
"tmpl/news_item.js"
],
"refer": [
"detail_main.html"
],
"priority": 0
},
"pages": {
"detail_main.html": {
"href": "detail_main.html",
"resources": [],
"refer": [
"detail.html"
],
"priority": 0
},
"detail.html": {
"href": "detail.html",
"resources": [
"js/html5sql.js",
"js/news.js",
"img/blank_big.jpg"
],
"priority": 0
},
"browser.html": {
"href": "browser.html",
"resources": [],
"priority": 0
},
"setting.html": {
"href": "setting.html",
"resources": [],
"priority": 0
},
"about.html": {
"href": "about.html",
"resources": [
"css/about.css"
],
"priority": 0
}
},
"idle": {
"resources": [
"img/36kr.png"
]
}
}
4 changes: 4 additions & 0 deletions 36Kr/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
display: none;
}

#kr-article-article p img:first-child{
display: none;
}

.kr-article .kr-slider a .mui-slider-title {
background: transparent;
color: white;
Expand Down
4 changes: 2 additions & 2 deletions 36Kr/css/mui.min.css

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions 36Kr/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<div id="footer" class="kr-article-bar mui-bar mui-bar-standard mui-bar-footer">
<a id="back" class="mui-action-back mui-icon mui-icon-arrowleft mui-pull-left" style="padding: 10px;margin-left: -10px;"></a>
<div class="mui-pull-right">
<a id="share" class="mui-icon mui-icon-upload" href="javascript:;">&nbsp;</a>
<a id="share" class="mui-icon mui-icon-upload" href="javascript:;"></a>
</div>
</div>
<div class="mui-content">
Expand Down Expand Up @@ -120,19 +120,21 @@ <h2 id="kr-article-title" class="kr-article-title"></h2>
var regex = /\((.*)\)/;
html5sql.openDatabase("kr", "36Kr", 5 * 1024 * 1024);
document.addEventListener('mui.view.beforeshow', function(event) {
//if (!event.detail.guid) return;
if (event.detail.$$type === 'back') {
setTimeout(function() {
document.body.classList.remove('kr-overlay');
}, 500);
return;
}
document.body.classList.add('kr-overlay');
kr.getNewsByGuid(event.detail.guid, function(news) {
//console.log("id:" + event.detail.guid);
kr.getNewsByGuid(decodeURIComponent(event.detail.guid), function(news) {
guid = event.detail.guid;
coverEl.querySelector('img').src = news.image || 'img/blank_big.jpg';
titleEl.innerText = news.title;
console.log("news 222:"+JSON.stringify(news));
var author = news.author;
//console.log("news aaa:" + JSON.stringify(news));
var author = news.author || '';
var matches = author.match(regex);
if (matches && matches.length === 2) {
author = matches[1];
Expand Down
Binary file modified 36Kr/fonts/mui.ttf
Binary file not shown.
Binary file added 36Kr/img/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 28 additions & 4 deletions 36Kr/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1 id="title" class="mui-title kr-title"><span class="kr-logo">36Kr</span></h1>
<script type="text/javascript" charset="UTF-8" src="js/mui.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="js/app.js"></script>
<script>
//预加载
//预加载
mui.init({
preloadPages: [{
"id": "setting",
Expand Down Expand Up @@ -73,21 +73,45 @@ <h1 id="title" class="mui-title kr-title"><span class="kr-logo">36Kr</span></h1>
}]
});
mui.plusReady(function() {
//关闭splash界面
//plus.navigator.closeSplashscreen();
//创建子窗口
plus.webview.currentWebview().append(plus.webview.create('list.html', 'list', {
top: "44px",
bottom: "0px"
}));
if (mui.os.stream) {
//创建桌面快捷方式
if (mui.isFunction(plus.navigator.createShortcut)) {
var shortcut = plus.storage.getItem("SHORTCUT");
if (!shortcut) {
plus.navigator.createShortcut({
name: "36Kr资讯",
icon: "img/icon.png"
});
plus.storage.setItem("SHORTCUT", "true");
}
}
//向服务器发送激活请求,后续可删除
plus.runtime.getProperty(plus.runtime.appid, function(info) {
mui.get('http://stream.dcloud.net.cn/collect/data', {
appid: plus.runtime.appid,
version: info.version,
logtype: 2,
imei: plus.device.imei
});
});
}
});
//右上角设置按钮点击事件
//右上角设置按钮点击事件
var setting_view = null;
document.getElementById("setting").addEventListener('tap', function() {
if(!setting_view){
if (!setting_view) {
setting_view = plus.webview.getWebviewById('setting');
}
setting_view.show('slide-in-bottom', 200);
});
//首页退出事件
//首页退出事件
mui.back = function() {
mui.confirm('确定退出应用?', '提示', ['确定', '取消'], function(e) {
if (e.index === 0) {
Expand Down
8 changes: 6 additions & 2 deletions 36Kr/js/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if (childNodes) {
var childNode = childNodes[0];
if (childNode) {
value = childNode.nodeValue;
value = childNode.wholeText || childNode.nodeValue;
}
}
}
Expand Down Expand Up @@ -58,14 +58,18 @@
return feed;
};
$.getFeed = function(url, success, error) {
error = error || $.noop;
$.ajax({
type: "get",
url: url,
dataType: 'xml',
success: function(response) {
if (!response) {
return error();
}
success(parseFeed(response));
},
error: error || $.noop
error: error
});
};
})(mui);
Loading

0 comments on commit dd48a83

Please sign in to comment.