Skip to content

Commit

Permalink
v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tower1229 committed Jul 21, 2017
1 parent 8a91cdf commit 4e09190
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 169 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- [mam](http://docs.apicloud.com/Client-API/Cloud-Service/mam)版本管理必备

## 资源
[Apk 安装包](http://downloadpkg.apicloud.com/app/download?path=http://7xm7pq.com1.z0.glb.clouddn.com/51aaa239cc4279fc74a70b1a351da199_d)
[Apk 安装包](http://downloadpkg.apicloud.com/app/download?path=http://7xm7pq.com1.z0.glb.clouddn.com/8cb26eca4ee9f6ef2a06debb470b0eec_d)

[Github](https://github.com/tower1229/HybridStart)

Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ <h4>配置</h4>
</table>
<h3 id="download">下载</h3>
<p>源码:<a href="https://github.com/tower1229/HybridStart">Github</a></p>
<p>体验APP:<a href="http://downloadpkg.apicloud.com/app/download?path=http://7xm7pq.com1.z0.glb.clouddn.com/51aaa239cc4279fc74a70b1a351da199_d">HybridStart(安卓)</a></p>
<p>体验APP:<a href="http://downloadpkg.apicloud.com/app/download?path=http://7xm7pq.com1.z0.glb.clouddn.com/8cb26eca4ee9f6ef2a06debb470b0eec_d">HybridStart(安卓)</a></p>

</section>
<section class="wrap" id="SDK">
Expand Down
2 changes: 1 addition & 1 deletion docs/seajs.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
seajs.root = '/HybridStart/docs';
seajs.root = '/docs';//'/HybridStart/docs';
seajs.config({
base: "http://static-zt.oss-cn-qingdao.aliyuncs.com/modules",
paths: {
Expand Down
34 changes: 29 additions & 5 deletions sdk/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,52 @@ define(function(require, exports, module) {
//批量绑定active
$body.on('touchstart', '[active]', function(e) {
var target = e.target;
$(target)[0].classList.add('active');
target.classList.remove('active');
var activeHandle = document.createElement('div');
activeHandle.classList.add('active-handle');
var targetOffset = e.touches;
var eleOffset = target.getBoundingClientRect();
if(targetOffset && eleOffset){
activeHandle.style.left = targetOffset.clientX - eleOffset.left - 200 + 'px';
activeHandle.style.top = targetOffset.clientY - eleOffset.top - 200 + 'px';
target.normalize();
var lastNode = target.lastChild;
if(lastNode.nodeName==='#text' && !lastNode.nodeValue.trim()){
lastNode = lastNode.previousSibling;
}
target.insertBefore(activeHandle, lastNode);
setTimeout(function(){
target.classList.add('active');
},0);
}

target.setAttribute('data-touch', 1);

}).on('touchcancel', '[active]', function(e) {
var target = e.target;
$(target)[0].classList.remove('active');
target.classList.remove('active');
target.removeAttribute('data-touch');
}).on('touchmove', '[active]', function(e) {
var target = e.target;
$(target)[0].classList.remove('active');
target.classList.remove('active');
target.removeAttribute('data-touch');
}).on('touchend', '[active]', function(e) {
var target = e.target;
var v = target.getAttribute('active');
$(target)[0].classList.remove('active');
setTimeout(function(){
var oldNode = target.querySelector('.active-handle');
if(oldNode){
target.removeChild(oldNode);
}
target = v = null;
}, appcfg.set.animateDuration * 2);
if (v) {
v = v.split(',');
if (target.getAttribute('data-touch')) {
target.removeAttribute('data-touch');
app.openView({
anim: ['none', 'push', 'movein', 'fade', 'reveal'][v[0]]
}, v[1], v[2]);
target = v = null;
}
}
});
Expand Down
10 changes: 8 additions & 2 deletions sdk/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,13 @@ var apputil = (function(document, undefined) {
if (ele === target) {
handle.call(target, {
target: target,
detail: event.detail
detail: event.detail,
touches: event.touches && event.touches[0] ? {
clientX: event.touches[0].clientX,
clientY: event.touches[0].clientY,
screenX: event.touches[0].screenX,
screenY: event.touches[0].screenY,
} : null
});
return isHand = true;
}
Expand Down Expand Up @@ -1350,7 +1356,7 @@ app.ready(function() {
break;
case "closeback": //关闭后台页面
setTimeout(function() {
if (!!window.isBack && platform === 'android') {
if (!!window.isBack && api.systemType === 'android') {
//console.log('closeback:' + api.winName);
api.closeWin({
name: api.winName,
Expand Down
2 changes: 1 addition & 1 deletion sdk/ui.css

Large diffs are not rendered by default.

186 changes: 84 additions & 102 deletions sdk/ui.less

Large diffs are not rendered by default.

68 changes: 12 additions & 56 deletions view/x/temp.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,66 +16,22 @@
</div>
<div class="flex-1 scroll_cont">
<div class="list">
<div active class="item item-icon-left item-icon-right">
<i class="ion">&#xe641;</i>我的收藏
<i class="ion">&#xe610;</i>
</div>
<div class="item" active>active 测试</div>
<div class="item" active="1,common">打开error页面</div>
<div class="item" id="test">加密测试</div>
<div class="item" id="openblank">打开空页面</div>
<div class="item" id="openblanknojs">打开没有js的空页面</div>
<div class="item" id="devicePixelRatio"></div>
<div class="item" active id="test">加密测试</div>
<div class="item" active id="openblank">打开空页面</div>
<div class="item" active id="openblanknojs">打开没有js的空页面</div>
<div class="item" active id="devicePixelRatio"></div>
</div>

</div>
</body>
<script type="text/javascript">
var headNode = document.getElementsByTagName('head')[0];
var confNode = document.createElement('script');
var coreNode = document.createElement('script');
var selfPath = window.location.href;
var widgetPath = "widget://";
var pathMatch = selfPath.match(/\/view(.+)$/);
if(pathMatch[1]){
selfPath = pathMatch[1];
var index = -1;
var pathDeep = 0;
do {
index = selfPath.indexOf("/", index + 1);
if (index != -1) {
pathDeep++;
}
} while (index != -1);
if(pathDeep){
widgetPath ="";
for(var deepStart = 0;deepStart<pathDeep;deepStart++){
widgetPath += "../";
}
}
}

confNode.type = "text/javascript";
confNode.src = widgetPath + "config.js";
coreNode.type = "text/javascript";

if (coreNode.addEventListener) {
coreNode.addEventListener("load", scriptOnload, false);
} else if (coreNode.readyState) {
coreNode.onreadystatechange = function() {
if (coreNode.readyState == "loaded" || coreNode.readyState == "complete") {
coreNode.onreadystatechange = null;
scriptOnload();
}
};
} else {
coreNode.onload = scriptOnload;
}
coreNode.src = widgetPath + "sdk/core.js";
coreNode.onerror = function(e){
console.log(JSON.stringify(e));
};
apiready = function() {
headNode.appendChild(confNode);
headNode.appendChild(coreNode);
};
function scriptOnload(){
seajs.use("./script");
}
<script src="../../config.js"></script><script src="../../sdk/core.js" id="seajsnode" ></script>
<script>
seajs.use('./script');
</script>
</html>

0 comments on commit 4e09190

Please sign in to comment.