xuguohong

rm

Showing 132 changed files with 0 additions and 1785 deletions
No preview for this file type
/publicAndroidSDK/demo/Demo_PoolSdk/bin
# 更新说明
2018-07-05<br>
1、修复bug
2018-02-26<br>
1、PoolSdkHelper中添加callFunc(String funcName, Map<Object, Object> param)作为通用接口,用于处理现有接口无法处理的需求,使用前需先与公共SDK接入同事确认方法用途。
2、添加onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults),用于安卓6.0权限获取回调。
2018-01-16<br>
1、添加单机轮询补单处理
单机游戏无服务端时需调用接口:<br>
(1)PoolSdkHelper.setPayListener(mPoolPayListener );调用登录接口前调用<br>
(2)PoolSdkHelper.paymentSuccess(AppActivity.this, orderIds.toString()); 游戏发货成功时调用,样例可查看文档
2017-07-31<br>
1、修改聊天统计接口
2017-07-24<br>
1、添加聊天统计,安装统计方法修改
2017-07-07<br>
1、sdk更新和添加文件损坏处理
```xml
2017-4-24
1、删除了SDK相关so库
```
```xml
2017-2-09
1、已接入直接替换poolsdkV2.jar
```
```xml
2017-1-10
1、重新替换asset/poolsdk.xml
```
```xml
2016-12-14
1、公共SDK加入9133正式版SDK
```
2016-07-26:
1、公共SDK安卓版本提交
<br>2016-12-7:
<br>1、添加注销接口,切换账号接口
<br>2、添加了onSaveInstanceState,onRestoreInstanceState,onWindowFocusChanged,onWindowAttributesChanged等接口
<br>3、提交角色方法增加了字段
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="utf-8"?>
<config>
<sdkconfig
YA_APPID="58fd78a9834e7246b8dc0eac"
YA_APPKEY="b06b86b79c25774ec758657a7203bae6"
gamesimplename="fytx_test"
sdksimplename="youyu"
sdkversioncode="V1_1"
channelparameter1=""
channelparameter2=""
custom=""
gamechannelid=""
logincheckurl="http://login.public.sdk.gzyouai.com/logincheck/check"
paycheckurl="http://pay.public.sdk.gzyouai.com/paycheck/confirm"
payorderurl="http://pay.public.sdk.gzyouai.com/paycheck/create"
usertype="gssaXIIEiL0=" />
</config>
\ No newline at end of file
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sdk_3</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.aptana.editor.php.aptanaPhpBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.aptana.ide.core.unifiedBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.aptana.projects.webnature</nature>
<nature>com.aptana.editor.php.phpNature</nature>
</natures>
<filteredResources>
<filter>
<id>1489975865951</id>
<name></name>
<type>26</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-node_modules</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
//游戏皮肤对应manifest文件的生成配置文件, 包括基本的第三方库、业务逻辑js、样式
var base_js = [
'js/fastclick.min.1.0.js',
'js/zepto.min.js',
'js/doT.min.js',
'js/iscroll.min.1.0.js'
]
var concat_with_mtime = [
'skin/new_sdk.min.css',
'skin/responsive.min.css',
'js/core.min.js',
'js/loader.min.js',
'js/center.min.js',
'js/pay.min.js',
'js/login.min.js'
]
var htmls = [
'login.html',
'center.html',
'pay.html',
'share.html'
]
var images = 'skin/img';
var target = [
'bllm',
'bwts',
'bwzq',
'fytx',
'hxjh',
'rxxt',
'sgg',
'smlw',
'twzw',
'whj'
]
exports.htmls = htmls;
exports.target = target;
exports.concat_with_mtime = concat_with_mtime;
exports.base_js = base_js;
exports.images = images;
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
// Laura Doktorova https://github.com/olado/doT
(function(){function o(){var b={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},a=/&(?!#?\w+;)|<|>|"|'|\//g;return function(f){return f?f.toString().replace(a,function(g){return b[g]||g}):f}}function p(b,a,f){return(typeof a==="string"?a:a.toString()).replace(b.define||h,function(g,e,c,i){if(e.indexOf("def.")===0)e=e.substring(4);if(!(e in f))if(c===":")f[e]=i;else eval("def['"+e+"']="+i);return""}).replace(b.use||h,function(g,e){var c=eval(e);return c?p(b,c,f):c})}function l(b){return b.replace(/\\('|\\)/g,
"$1").replace(/[\r\t\n]/g," ")}var j={version:"0.2.0",templateSettings:{evaluate:/\{\{([\s\S]+?)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:true,append:true,selfcontained:false},template:undefined,compile:undefined},m=function(){return this||(0,eval)("this")}();
if(typeof module!=="undefined"&&module.exports)module.exports=j;else if(typeof define==="function"&&define.amd)define(function(){return j});else m.doT=j;m.encodeHTML=o();var q={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},h=/$^/;j.template=function(b,a,f){a=a||j.templateSettings;var g=a.append?q.append:q.split,e,c=0,i;if(a.use||a.define){var r=m.def;m.def=f||{};b=p(a,b,m.def);m.def=r}b=("var out='"+(a.strip?b.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g,
" ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):b).replace(/'|\\/g,"\\$&").replace(a.interpolate||h,function(n,d){return g.start+l(d)+g.end}).replace(a.encode||h,function(n,d){e=true;return g.startencode+l(d)+g.end}).replace(a.conditional||h,function(n,d,k){return d?k?"';}else if("+l(k)+"){out+='":"';}else{out+='":k?"';if("+l(k)+"){out+='":"';}out+='"}).replace(a.iterate||h,function(n,d,k,s){if(!d)return"';} } out+='";c+=1;i=s||"i"+c;d=l(d);return"';var arr"+c+"="+d+";if(arr"+c+"){var "+k+","+i+"=-1,l"+
c+"=arr"+c+".length-1;while("+i+"<l"+c+"){"+k+"=arr"+c+"["+i+"+=1];out+='"}).replace(a.evaluate||h,function(n,d){return"';"+l(d)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|}|^|{)out\+='';/g,"$1").replace(/\+''/g,"").replace(/(\s|;|}|^|{)out\+=''\+/g,"$1out+=");if(e&&a.selfcontained)b="var encodeHTML=("+o.toString()+"());"+b;try{return new Function(a.varname,b)}catch(t){typeof console!=="undefined"&&console.log("Could not create a template function: "+
b);throw t;}};j.compile=function(b,a){return j.template(b,null,a)}})();
function FastClick(layer){"use strict";var oldOnClick,self=this;this.trackingClick=false;this.trackingClickStart=0;this.targetElement=null;this.touchStartX=0;this.touchStartY=0;this.lastTouchIdentifier=0;this.touchBoundary=10;this.layer=layer;if(!layer||!layer.nodeType){throw new TypeError("Layer must be a document node")}this.onClick=function(){return FastClick.prototype.onClick.apply(self,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(self,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(self,arguments)};this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(self,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(self,arguments)};if(FastClick.notNeeded(layer)){return}if(this.deviceIsAndroid){layer.addEventListener("mouseover",this.onMouse,true);layer.addEventListener("mousedown",this.onMouse,true);layer.addEventListener("mouseup",this.onMouse,true)}layer.addEventListener("click",this.onClick,true);layer.addEventListener("touchstart",this.onTouchStart,false);layer.addEventListener("touchend",this.onTouchEnd,false);layer.addEventListener("touchcancel",this.onTouchCancel,false);if(!Event.prototype.stopImmediatePropagation){layer.removeEventListener=function(type,callback,capture){var rmv=Node.prototype.removeEventListener;if(type==="click"){rmv.call(layer,type,callback.hijacked||callback,capture)}else{rmv.call(layer,type,callback,capture)}};layer.addEventListener=function(type,callback,capture){var adv=Node.prototype.addEventListener;if(type==="click"){adv.call(layer,type,callback.hijacked||(callback.hijacked=function(event){if(!event.propagationStopped){callback(event)}}),capture)}else{adv.call(layer,type,callback,capture)}}}if(typeof layer.onclick==="function"){oldOnClick=layer.onclick;layer.addEventListener("click",function(event){oldOnClick(event)},false);layer.onclick=null}}FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0;FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent);FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent);FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);FastClick.prototype.needsClick=function(target){"use strict";switch(target.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(target.disabled){return true}break;case"input":if(this.deviceIsIOS&&target.type==="file"||target.disabled){return true}break;case"label":case"video":return true}return/\bneedsclick\b/.test(target.className)};FastClick.prototype.needsFocus=function(target){"use strict";switch(target.nodeName.toLowerCase()){case"textarea":case"select":return true;case"input":switch(target.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return false}return!target.disabled&&!target.readOnly;default:return/\bneedsfocus\b/.test(target.className)}};FastClick.prototype.sendClick=function(targetElement,event){"use strict";var clickEvent,touch;if(document.activeElement&&document.activeElement!==targetElement){document.activeElement.blur()}touch=event.changedTouches[0];clickEvent=document.createEvent("MouseEvents");clickEvent.initMouseEvent("click",true,true,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,false,false,false,false,0,null);clickEvent.forwardedTouchEvent=true;targetElement.dispatchEvent(clickEvent)};FastClick.prototype.focus=function(targetElement){"use strict";var length;if(this.deviceIsIOS&&targetElement.setSelectionRange){length=targetElement.value.length;targetElement.setSelectionRange(length,length)}else{targetElement.focus()}};FastClick.prototype.updateScrollParent=function(targetElement){"use strict";var scrollParent,parentElement;scrollParent=targetElement.fastClickScrollParent;if(!scrollParent||!scrollParent.contains(targetElement)){parentElement=targetElement;do{if(parentElement.scrollHeight>parentElement.offsetHeight){scrollParent=parentElement;targetElement.fastClickScrollParent=parentElement;break}parentElement=parentElement.parentElement}while(parentElement)}if(scrollParent){scrollParent.fastClickLastScrollTop=scrollParent.scrollTop}};FastClick.prototype.getTargetElementFromEventTarget=function(eventTarget){"use strict";if(eventTarget.nodeType===Node.TEXT_NODE){return eventTarget.parentNode}return eventTarget};FastClick.prototype.onTouchStart=function(event){"use strict";var targetElement,touch,selection;if(event.targetTouches.length>1){return true}targetElement=this.getTargetElementFromEventTarget(event.target);touch=event.targetTouches[0];if(this.deviceIsIOS){selection=window.getSelection();if(selection.rangeCount&&!selection.isCollapsed){return true}if(!this.deviceIsIOS4){if(touch.identifier===this.lastTouchIdentifier){event.preventDefault();return false}this.lastTouchIdentifier=touch.identifier;this.updateScrollParent(targetElement)}}this.trackingClick=true;this.trackingClickStart=event.timeStamp;this.targetElement=targetElement;this.touchStartX=touch.pageX;this.touchStartY=touch.pageY;if(event.timeStamp-this.lastClickTime<200){event.preventDefault()}return true};FastClick.prototype.touchHasMoved=function(event){"use strict";var touch=event.changedTouches[0],boundary=this.touchBoundary;if(Math.abs(touch.pageX-this.touchStartX)>boundary||Math.abs(touch.pageY-this.touchStartY)>boundary){return true}return false};FastClick.prototype.findControl=function(labelElement){"use strict";if(labelElement.control!==undefined){return labelElement.control}if(labelElement.htmlFor){return document.getElementById(labelElement.htmlFor)}return labelElement.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")};FastClick.prototype.onTouchEnd=function(event){"use strict";var forElement,trackingClickStart,targetTagName,scrollParent,touch,targetElement=this.targetElement;if(this.touchHasMoved(event)){this.trackingClick=false;this.targetElement=null}if(!this.trackingClick){return true}if(event.timeStamp-this.lastClickTime<200){this.cancelNextClick=true;return true}this.lastClickTime=event.timeStamp;trackingClickStart=this.trackingClickStart;this.trackingClick=false;this.trackingClickStart=0;if(this.deviceIsIOSWithBadTarget){touch=event.changedTouches[0];targetElement=document.elementFromPoint(touch.pageX-window.pageXOffset,touch.pageY-window.pageYOffset)||targetElement;targetElement.fastClickScrollParent=this.targetElement.fastClickScrollParent}targetTagName=targetElement.tagName.toLowerCase();if(targetTagName==="label"){forElement=this.findControl(targetElement);if(forElement){this.focus(targetElement);if(this.deviceIsAndroid){return false}targetElement=forElement}}else if(this.needsFocus(targetElement)){if(event.timeStamp-trackingClickStart>100||this.deviceIsIOS&&window.top!==window&&targetTagName==="input"){this.targetElement=null;return false}this.focus(targetElement);if(!this.deviceIsIOS4||targetTagName!=="select"){this.targetElement=null;event.preventDefault()}return false}if(this.deviceIsIOS&&!this.deviceIsIOS4){scrollParent=targetElement.fastClickScrollParent;if(scrollParent&&scrollParent.fastClickLastScrollTop!==scrollParent.scrollTop){return true}}if(!this.needsClick(targetElement)){event.preventDefault();this.sendClick(targetElement,event)}return false};FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=false;this.targetElement=null};FastClick.prototype.onMouse=function(event){"use strict";if(!this.targetElement){return true}if(event.forwardedTouchEvent){return true}if(!event.cancelable){return true}if(!this.needsClick(this.targetElement)||this.cancelNextClick){if(event.stopImmediatePropagation){event.stopImmediatePropagation()}else{event.propagationStopped=true}event.stopPropagation();event.preventDefault();return false}return true};FastClick.prototype.onClick=function(event){"use strict";var permitted;if(this.trackingClick){this.targetElement=null;this.trackingClick=false;return true}if(event.target.type==="submit"&&event.detail===0){return true}permitted=this.onMouse(event);if(!permitted){this.targetElement=null}return permitted};FastClick.prototype.destroy=function(){"use strict";var layer=this.layer;if(this.deviceIsAndroid){layer.removeEventListener("mouseover",this.onMouse,true);layer.removeEventListener("mousedown",this.onMouse,true);layer.removeEventListener("mouseup",this.onMouse,true)}layer.removeEventListener("click",this.onClick,true);layer.removeEventListener("touchstart",this.onTouchStart,false);layer.removeEventListener("touchend",this.onTouchEnd,false);layer.removeEventListener("touchcancel",this.onTouchCancel,false)};FastClick.notNeeded=function(layer){"use strict";var metaViewport;if(typeof window.ontouchstart==="undefined"){return true}if(/Chrome\/[0-9]+/.test(navigator.userAgent)){if(FastClick.prototype.deviceIsAndroid){metaViewport=document.querySelector("meta[name=viewport]");if(metaViewport&&metaViewport.content.indexOf("user-scalable=no")!==-1){return true}}else{return true}}if(layer.style.msTouchAction==="none"){return true}return false};FastClick.attach=function(layer){"use strict";return new FastClick(layer)};if(typeof define!=="undefined"&&define.amd){define(function(){"use strict";return FastClick})}else if(typeof module!=="undefined"&&module.exports){module.exports=FastClick.attach;module.exports.FastClick=FastClick}else{window.FastClick=FastClick}
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
(function() {
// 加载数据
var goInit = function() {
if (window.isGetData == 1) {
Core.init();
} else {
window.isGetData = 1;
}
}
var getData = function(url) {
var params = location.hash.slice(1);
var args = params.match(/app_id=(\w*)&?/);
var start_page = params.match(/mod=(\w*)&?/);
var core_server = params.match(/core_server=(.*)&?/);
var appId = '';
var skin_v = '?' + $('#skin').attr('data-v');
if (args && args.length == 2) {
//匹配出app_id
appId = args[1];
}
if(start_page && start_page.length == 2){
//匹配出启动模块
Core.start_page = start_page[1];
console.log(Core.start_page);
}
if (core_server){
Core.server = core_server[1]
}
location.hash = '';
if (appId == '') {
//刷新地址出错
params = localStorage.getItem('params_' + url);
appId = localStorage.getItem('app_id');
} else {
localStorage.setItem('params_' + url, params);
localStorage.setItem('app_id', appId);
}
Core.params = params;
if (!appId) {
//无法获取到app_id
Core.showTips('无法获取app_id!', false, 3000);
goInit();
$('#loading').hide();
return;
}
Core.Data.app_id = appId;
var setSkin = false;
//先尝试设置皮肤,检查是否自动登录
var tryAutoLogin = false;
var _skin = localStorage.getItem('skin_' + appId);
if (_skin) {
$('#skin').attr('href', Core.server + '/static/sdk/skin/' + _skin + '/skin.css' + skin_v);
setSkin = true;
}
if ($('#login').length != 0) {
var auto = localStorage.getItem('auto');
var auto_time = parseInt(localStorage.getItem('auto_time'));
var d = new Date().getTime();
if (auto == 'true' && (d - auto_time) < 600000) {
tryAutoLogin = false;
} else if (auto == null) {
tryAutoLogin = false;
} else {
tryAutoLogin = true;
}
}
//如果不尝试自动登录,直接初始化界面
if (!tryAutoLogin)
goInit();
Core.ajax({
type: 'GET',
url: url + '?' + params,
dataType: 'json',
success: function(data) {
if (data.code == 0) {
// 成功请求
Core.Data = data.msg;
if (Core.Data.face) {
Core.Data.face = Core.server + data.msg.face;
}
//更新server
var lastServer = localStorage.getItem('last_server');
if (Core.Data.new_server) {
if (lastServer && lastServer == Core.Data.new_server) {
//没有变化
} else {
//需要更新server
var s = 'sdk://changeServer?addr=' + Core.Data.new_server;
localStorage.setItem('last_server', Core.Data.new_server);
location.href = s;
}
}
if (!setSkin && data.skin) {
$('#skin').attr('href', Core.server + '/static/sdk/skin/' + data.skin + '/skin.css' + skin_v);
localStorage.setItem('skin_' + appId, data.skin);
}
localStorage.setItem('data_' + url, JSON.stringify(data.msg));
//模块初始化函数,兼容旧版本sdk
if (typeof(window.initFunc) == "function") {
window.initFunc();
}
// 核心初始化
$('#loading').hide();
if (tryAutoLogin) {
goInit();
} else {
var first_mod = Core.start_page? Core.start_page: 'home';
Core.updateMod(first_mod);
}
} else {
//参数出错,没有游戏服什么的.
$('#loading').hide();
$('<h2 class="error_title">出错了,正在努力抢修中...</h2>').appendTo($('.mask'));
Core.showTips(data.msg, false, 6000);
// 核心初始化
Core.loadFinished();
}
},
error: function(xhr, type) {
// 请求失败,服务器崩溃
//尝试从缓存中获取数据
var data_str = localStorage.getItem('data_' + url);
if (data_str && data_str != '') {
var data = JSON.parse(data_str);
if (typeof data == "object") {
Core.Data = data;
if (tryAutoLogin) {
goInit();
} else {
Core.updateMod('home');
}
}
}
Core.showTips('网络出错,请检查网络状态。', false);
// 核心初始化
$('#loading').hide();
}
});
}
window.getData = getData;
})();
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
/*!
** create by zhangxinxu(.com) 2013-07-15
** a simple method for custom scrolling
** it can be used on both mobile and parts desktop browser IE9+/FF/Chrome/...
*/
var simpScroller=(function(){var c=!((window.DocumentTouch&&document instanceof window.DocumentTouch)||"ontouchstart" in window)*1,b={start:["touchstart","mousedown"][c],move:["touchmove","mousemove"][c],end:["touchend","mouseup"][c]};var a=function(e,l,f){var n="top",o="Top",p="height",g="Height",d="pageY";if(l=="horizontal"){n="left";o="Left";p="width";g="Width";d="pageX"}var i=null;if(f.hideScrollBar==false){i=document.createElement("div");i.className="scroller_"+l;f.container.appendChild(i)}var m=e["client"+g],h=0;var j=function(){if(i==null){return}var r=i.style[p].replace("px",""),q=e["scroll"+o]/(h-m)*(m-r);if(m-r-q<=0){q=m-r}i.style[n]=q+"px"};var k={};e.addEventListener(b.start,function(q){h=this["scroll"+g];k[d]=q.touches?q.touches[0][d]:q[d];k[n]=this["scroll"+o];document.moveFollow=true;if(i&&h>m){i.style.opacity=1;i.style[p]=(m*m/h)+"px";j()}c&&q.preventDefault()});e.addEventListener(b.move,function(q){if(c==false||(document.moveFollow==true)){this["scroll"+o]=k[n]+(k[d]-(q.touches?q.touches[0][d]:q[d]));j();f.onScroll.call(this,q)}q.preventDefault()});e.addEventListener(b.end,function(q){i&&(i.style.opacity=0)});if(c==true){document.addEventListener("mouseup",function(){this.moveFollow=false})}};return function(d,f){f=f||{};var j=new Object({verticalScroll:true,horizontalScroll:false,hideScrollBar:false,onScroll:function(){}}),g;for(g in f){j[g]=f[g]}if(window.getComputedStyle(d).position=="static"){d.style.position="relative"}var i=d.childNodes,e=document.createDocumentFragment();[].slice.call(i).forEach(function(k){e.appendChild(k)});var h=document.createElement("div");h.style.height="100%";h.style.width="100%";h.style.overflow="hidden";d.appendChild(h);h.appendChild(e);j.container=d;if(j.verticalScroll==true){a(h,"vertical",j)}if(j.horizontalScroll==true){a(h,"horizontal",j)}}})();
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
/**
* 动态生成各游戏皮肤下对应的manifest文件。分别将带上修改时间戳的第三方库、业务逻辑js、
* sdk基本样式、指定皮肤样式、皮肤资源文件的路径添加到manifes文件中
* 并将修改时间更新到html文档的资源引用中
* 配置文件:config.js
* 生成文件:skin/xxxx/sdk.manifest
* 运行方法:node makefile.js
**/
var fs = require('fs'),
PATH = require('path'),
config = require('./config.js');
var target = config.target;
var concat_with_mtime = config.concat_with_mtime;
var base_js = config.base_js;
var base_img = config.images;
var htmls = config.htmls;
//读取三个html文件的内容,以便后面更新引用信息
var html_content = [];
for (i = 0, l = htmls.length; i < l; i++) {
html_content.push(fs.readFileSync(htmls[i], 'utf-8'));
}
function formatTime(mtime) {
var date = '';
date += mtime.getFullYear();
var month = mtime.getMonth() + 1;
month < 10 ? date += '0' + month : date += month;
var day = mtime.getDate();
day < 10 ? date += '0' + day : date += day;
var hour = mtime.getHours();
hour < 10 ? date += '0' + hour : date += hour;
var minute = mtime.getMinutes();
minute < 10 ? date += '0' + minute : date += minute;
return date;
}
var content = [];
var path, mtime, jsPath, reg;
content.push('CACHE MANIFEST');
content.push('');
var now = new Date();
content.push('#version=' + formatTime(now));
for(var i=0, l= htmls.length; i<l; i++){
path = htmls[i];
if(PATH.existsSync(path)){
// mtime = formatTime(fs.statSync(path).mtime);
content.push('/static/sdk/' + path);// + '?' + mtime);
}
}
for (i = 0, l = base_js.length; i < l; i++) {
path = base_js[i];
if (PATH.existsSync(path)) {
mtime = formatTime(fs.statSync(path).mtime);
content.push('/static/sdk/' + path + '?' + mtime);
//更新login.html, center.html, pay.html的引用信息的版本号
for (var j = 0, k = html_content.length; j < k; j++) {
reg = new RegExp(path.replace('/', '\\/') + '\\?\\d+')
html_content[j] = html_content[j].replace(reg, path + '?' + mtime);
}
} else {
console.error('指定文件不存在:' + base_js[i]);
}
}
for (i = 0, l = concat_with_mtime.length; i < l; i++) {
path = concat_with_mtime[i];
if (PATH.existsSync(path)) {
mtime = formatTime(fs.statSync(path).mtime);
content.push('/static/sdk/' + path + '?' + mtime);
//更新login.html, center.html, pay.html的引用信息的版本号
for (j = 0, k = html_content.length; j < k; j++) {
reg = new RegExp(path.replace('/', '\\/') + '\\?\\d+')
html_content[j] = html_content[j].replace(reg, path + '?' + mtime);
}
} else {
console.error('指定文件不存在:' + path);
}
}
// 添加sdk基本图片资源
/*
var base_img_files = fs.readdirSync(base_img);
for(i=0,l=base_img_files.length; i<l; i++){
if(base_img_files[i].indexOf('.') == 0) continue;
path = base_img + '/' + base_img_files[i];
content.push('/static/sdk/' + path);
}
*/
//获取皮肤的最大mtime
/*
var skin_mtime = 0;
for(i=0, l= target.length; i<l; i++){
path = 'skin/' + target[i] + '/skin.css';
mtime = parseInt(formatTime(fs.statSync(path).mtime));
if(mtime > skin_mtime) skin_mtime = mtime;
}
*/
//在基础文件上添加对应皮肤的样式和所需要的图片
var skin_content;
for (i = 0, l = target.length; i < l; i++) {
path = 'skin/' + target[i];
skin_content = content.concat();
/*
skin_content.push('/static/sdk/' + path + '/skin.css' + '?' + skin_mtime);
*/
//更新login.html, center.html, pay.html的引用信息的版本号
for (j = 0, k = html_content.length; j < k; j++) {
reg = new RegExp('data-v="\\d+"');
html_content[j] = html_content[j].replace(reg, 'data-v="' + skin_mtime + '"');
}
//push the img fiels if exists
/*
var images = fs.readdirSync(path + '/img');
for (var j = 0, k = images.length; j < k; j++) {
if(images[j].indexOf('.') == 0) continue;
var img_path = path + '/img/' + images[j];
// mtime = formatTime(fs.statSync(img_path).mtime);
skin_content.push('/static/sdk/' + path + '/img/' + images[j]) //+ '?' + mtime);
}
*/
skin_content.push('NETWORK:');
skin_content.push('*');
skin_content = skin_content.join('\n');
fs.writeFileSync(path + '/sdk.manifest', skin_content);
}
content.push('NETWORK:');
content.push('*');
//生成基础的没有皮肤的缓存文件
fs.writeFileSync('skin/sdk.manifest', content.join('\n'));
//将对html文件引用信息的修改写回文件中
for(i=0, l=htmls.length; i<l; i++){
fs.writeFileSync(htmls[i], html_content[i]);
}
\ No newline at end of file
This diff is collapsed. Click to expand it.
date:2017-4-11
author
:lizenghua
instructions
:与星玩SDK同步
date:2017-4-12
author:lizenghua
instructions:修复当账户及密码为空时(本地存储的账号密码数据为空),通过密保找回密码时一直处于加载中无法跳转的问题
date:2017-4-21
author:lizenghua
instructions:
1、当用户是正式用户并绑定了手机后进行实名认证;身份证校验js:identity_id.js
改动的文件有:login.html、login.js(同步在sdk_xingwan、sdk_6)
2、改动注释了pay.js里面的911行到918行:进入sdk要购买的游戏币>0时强制进入渠道充值页面(已同步在sdk_xingwan、sdk_6)
date:2017-4-24
author:lizenghua
instructions:
1、处理绑定手机的手机验证规则(176),
2、手机找回密码中重置密码残留旧密码问题
date:2017-5-3
author:lizenghua
instructions:
1、注释掉pay.html中的“游爱星”兑换入口
2、处理支付方式切换中出现 input_item 为undefind 的bug (将383行的{{?}}移至435行)
3、去掉设置密保中select默认的下拉图标(login.css)
4、如果没有第三方登录则隐藏掉“第三方登录”字眼
date:2017-5-8
author:lizenghua
instructions:处理支付方式点击支付图标出现 input_item 为undefind 的bug(将150行$c改成$(this))
date:2017-5-12
author:lizenghua
instructions:修改充值的界面显示大小
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, user-scalable=no,target-densitydpi=device-dpi" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="format-detection" content="telephone=no">
<meta name="screen-orientation" content="portrait">
<meta name="full-screen" content="yes">
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<link href="skin/new_sdk.min.css?v=20150318002" type="text/css" rel="stylesheet" />
<link id="skin" data-v="20150318001" type="text/css" rel="stylesheet" />
<link href="skin/responsive.min.css?v=20150318001" type="text/css" rel="stylesheet" />
<title>
手游平台登录
</title>
</head>
<body>
<div class="mask">
<div class="container_load" id="loading">
<div class="content">
<div class="circle"></div>
<div class="circle1"></div>
</div>
</div>
<div class="alert alert-success hide" id="alert">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<span></span>
</div>
<section id="home" data-attr="dot" class="hide"></section>
<section id="frame" data-attr="dot" class="hide" ></section>
<script id="frame_template" type="text/x-jquery-tmpl" >
<div class="header">
<span class="title">{{=Core.Data.frame_title}}</span>
<a class="btn pull-left op-back" href="#main">返回</a>
</div>
<div class="container" style="">
<div class="container_load in_frame" id="loading_frame">
<div class="content">
<div class="circle"></div>
<div class="circle1"></div>
</div>
</div>
{{? Core.isIos}}<div class="ios_scroll">{{?}}
<iframe frameborder=0 src="{{=Core.Data.frame_src}}" scrolling="yes" width="100%" height="100%"></iframe>
{{? Core.isIos}}</div>{{?}}
</div>
</script>
<script id="home_template" type="text/x-jquery-tmpl">
<div class="header">
<span class="title">分享游戏</span>
<a class="btn pull-left op-back" href="sdk://exit?action=share">回到游戏</a>
</div>
<div class="container">
<div class="box_info_center">
<div class="share_box1">
<div class="share_game clearfix">
<img class="pull-left game_face" src="{{=Core.Data.icon || ''}}" height="75" width="75">
<textarea class="s_content">{{=Core.Data.content || '这款游戏还不错噢,一起来玩吧!'}}</textarea>
</div>
</div>
<div class="share_box2">
<div class="">
<h3 class="text-info">分享到</h3>
<ul class="other-login inline clearfix">
<li><a href="/sdk/share/game/qq/?app_id={{=Core.Data.app_id || ''}}" class="qq" title="QQ空间分享"></a></li>
<li><a href="/sdk/share/game/sina/?app_id={{=Core.Data.app_id || ''}}" class="sina" title="新浪微博分享"></a></li>
<li><a href="/sdk/share/game/tqq/?app_id={{=Core.Data.app_id || ''}}" class="tqq" title="腾讯微博分享"></a></li>
</ul>
<div class="invite_box">
<h3 class="text-info">奖励说明:</h3>
<p>
1.成功邀请好友一起玩游戏,您可获得<span class="text-info">5{{=Core.Data.game_unit_name}}</span>的奖励。
</p>
<p>
2.好友若充值(限前10),您可获得<span class="text-info">5%</span>充值奖励。
</p>
<p>
3.好友首次充值,因被您邀请可额外获得<span class="text-info">10%</span>充值返利。
</p>
</div>
</div>
</div>
</div>
</div>
</script>
</div>
<script type="text/javascript" src="js/fastclick.min.1.0.js?201309041309"></script>
<script type="text/javascript" src="js/zepto.min.js?201309041309"></script>
<script type="text/javascript" src="js/doT.min.js?201309041309" ></script>
<script type="text/javascript">
window.isGetData = 0;
$(function() {
FastClick.attach(document.body);
});
</script>
<script type="text/javascript" src="js/core.min.js?201403141112" ></script>
<script type="text/javascript">
(function(){
// Home模块
var Home = function(modId) {
Module.call(this, modId);
}
// 继承基础模块
Core.inherit(Home, Module);
Home.prototype.bind = function(){
var that = this;
that.$c.on('click', '.other-login a', function(e){
e.preventDefault();
//分享连接
var $tar = $(e.target);
var content = that.$c.find('.s_content').val();
$tar.attr('params', 'content=' + content);
Core.ajax_do($tar, function(data){
console.log(data);
if(data.code == 0){
if(data.msg.next_url){
// 需要重新授权
var src = data.msg.next_url;
if (Core.isFile) {
src = Core.server + src;
}
Core.Data.frame_title = $tar.attr('title');
Core.Data.frame_src = src;
Core.updateMod('frame');
} else {
//
Core.showTips(data.msg);
}
}
}, that);
});
}
Core.registerMod('home', Home);
var Frame = function(modId) {
Module.call(this, modId);
}
Core.inherit(Frame, Module);
Frame.prototype.show_after = function() {
var that = this;
var _des = Core.last_mod ? Core.last_mod : 'home';
this.$c.find('a.btn.pull-left').attr('href', '#' + _des);
this.$c.find('iframe')[0].onload = function() {
that.$c.find('#loading_frame').hide();
}
}
Core.registerMod('frame', Frame);
})();
</script>
<script type="text/javascript" src="js/loader.min.js?201401151617"></script>
<script type="text/javascript">
(function(){
window.isGetData = 1;
getData('/game/info/');
})();
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
CACHE MANIFEST
#version=20151112001
/static/sdk_3/login.html?20151112001
/static/sdk_3/center.html?20151112001
/static/sdk_3/pay.html?20151112001
/static/sdk_3/share.html?20151112001
/static/sdk_3/js/fastclick.min.1.0.js?20151112001
/static/sdk_3/js/zepto.min.js?20151112001
/static/sdk_3/js/doT.min.js?20151112001
/static/sdk_3/js/iscroll.min.1.0.js?20151112001
/static/sdk_3/skin/login.css?20151112001
/static/sdk_3/skin/pay.css?20151112001
/static/sdk_3/js/core.min.js?20151112001
/static/sdk_3/js/loader.min.js?20151112001
/static/sdk_3/js/center.min.js?20151112001
/static/sdk_3/js/pay.min.js?20151112001
/static/sdk_3/js/login.min.js?20151112001
/static/sdk_3/images/login_icon.png?20151112001
/static/sdk_3/images/new-sdk-logo.png?20151112001
NETWORK:
*
\ No newline at end of file
#!/bin/sh
#js css压缩,生成更新包打包
CDN_SERVER='http://sdk.uuufish.com/static'
DIR_PATH="$( cd "$( dirname "$0" )" && pwd )"
echo "$DIR_PATH"
cd $DIR_PATH
VERSION=`cat version.txt`
DIR_NAME=${DIR_PATH##*/}
ZIP_FILE="${DIR_NAME}_${VERSION}.zip"
SAVE_DIR="dst"
MD5=''
echo $DIR_NAME
function make_new_zip_file {
cd $DIR_PATH
mkdir -pv dst
save_zip_file="${SAVE_DIR}/${ZIP_FILE}"
[ -f "$save_zip_file" ] && rm "$save_zip_file" && echo "rm $save_zip_file"
echo "zip $ZIP_FILE"
zip -x 'uglifyjs_sqwish.sh' -x 'v.txt' -x '*.svn/*' -x "${SAVE_DIR}/*" -x "${ZIP_FILE}" -r "${save_zip_file}" ./
MD5=`md5sum dst/${ZIP_FILE} |cut -d ' ' -f1`
}
function make_version_file {
make_new_zip_file
cd $DIR_PATH
URL="${CDN_SERVER}/${DIR_NAME}/${SAVE_DIR}/${ZIP_FILE}"
echo "${VERSION}|${MD5}|${URL}" > v.txt
cat v.txt
}
function uglifyjs_js_css {
cd $DIR_PATH
cd js/
for f in `ls *.js`;do
uglifyjs $f -m -o $f
done
cd ../skin
unalias mv
for f in `ls *.css`;do
if [ -f "$f" ];then
sqwish $f
new_f=`basename $f css`
new_f="$new_f""min.css"
echo " mv $new_f $f"
[ -f "$new_f" ] && mv $new_f $f
fi
done
cd ..
}
uglifyjs_js_css
make_version_file
20180207
\ No newline at end of file
SERVER_URL=http://sdk.uuufish.com
CDN_SERVER_URL=http://sdk.uuufish.com
SDK_TYPE=.sys_config_youyu
\ No newline at end of file
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Demo_PoolSdk</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.python.pydev.pythonNature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
</pydev_project>
connection.arguments=
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.java.home=null
connection.jvm.arguments=
connection.project.dir=
derived.resources=.gradle,build
eclipse.preferences.version=1
project.path=\:
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.source=1.6
@echo off
cd /d %~dp0
"%ANT_ROOT%\bin\ant" clean release -f build.xml
pause
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.youai.poolsdk.demo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="20" />
<!-- SDK start -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="org.simalliance.openmobileapi.SMARTCARD" />
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc.hce" />
<!-- SDK end -->
<application
android:name="com.gzyouai.publicsdk.application.PoolSDKApplication"
android:allowBackup="true"
android:icon="@drawable/public_sdk_self_ic_launcher"
android:label="@string/app_name" >
<activity
android:name="com.youai.foolsdk.demo.AppActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- SDK start -->
<receiver
android:name="com.gzyouai.fengniao.sdk.framework.AppInstallReceiver"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
<activity
android:name="com.youai.sdk.YouaiSDK"
android:label="youai_sdk"
android:launchMode="singleTask"
android:theme="@android:style/Theme.Dialog" />
<service
android:name="com.youai.sdk.YouaiService"
android:enabled="true" >
<intent-filter>
<action android:name="com.youai.sdk.YouaiService" />
</intent-filter>
</service>
<service
android:name="com.youai.sdk.FloatViewService"
android:enabled="true"
android:exported="true" >
<intent-filter>
<action android:name="com.youai.sdk.FloatViewService" />
</intent-filter>
</service>
<receiver android:name="com.youai.sdk.Receiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</receiver>
<activity
android:name="com.alipay.sdk.app.H5PayActivity"
android:configChanges="keyboardHidden|navigation|orientation"
android:exported="false"
android:screenOrientation="behind" />
<activity
android:name="com.alipay.sdk.auth.AuthActivity"
android:configChanges="keyboardHidden|navigation|orientation"
android:exported="false"
android:screenOrientation="behind" />
<activity
android:name=".wxapi.WXPayEntryActivity"
android:exported="true"
android:launchMode="singleTop" />
<activity
android:name=".wxapi.WXEntryActivity"
android:exported="true"
android:launchMode="singleTop" />
<!-- SDK end -->
</application>
</manifest>
\ No newline at end of file
# This file is used to override default values used by the Ant build system.
#
# This file must be checked into Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
<?xml version="1.0" encoding="utf-8"?>
<config>
<sdkconfig
YA_APPID="5aab390cf0d770694b7207a8"
YA_APPKEY="dc38d95cf3fd45894090ca7c341ba51e"
gamesimplename="gcsg_hb"
sdksimplename="youyu"
sdkversioncode="V1_1"
channelparameter1=""
channelparameter2=""
custom=""
gamechannelid=""
logincheckurl="http://login.public.sdk.gzyouai.com/logincheck/check"
paycheckurl="http://pay.public.sdk.gzyouai.com/paycheck/confirm"
payorderurl="http://pay.public.sdk.gzyouai.com/paycheck/create"
usertype="gssaXIIEiL0=" />
</config>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sdk_3</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.aptana.editor.php.aptanaPhpBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.aptana.ide.core.unifiedBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.aptana.projects.webnature</nature>
<nature>com.aptana.editor.php.phpNature</nature>
</natures>
<filteredResources>
<filter>
<id>1489975865951</id>
<name></name>
<type>26</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-node_modules</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
//游戏皮肤对应manifest文件的生成配置文件, 包括基本的第三方库、业务逻辑js、样式
var base_js = [
'js/fastclick.min.1.0.js',
'js/zepto.min.js',
'js/doT.min.js',
'js/iscroll.min.1.0.js'
]
var concat_with_mtime = [
'skin/new_sdk.min.css',
'skin/responsive.min.css',
'js/core.min.js',
'js/loader.min.js',
'js/center.min.js',
'js/pay.min.js',
'js/login.min.js'
]
var htmls = [
'login.html',
'center.html',
'pay.html',
'share.html'
]
var images = 'skin/img';
var target = [
'bllm',
'bwts',
'bwzq',
'fytx',
'hxjh',
'rxxt',
'sgg',
'smlw',
'twzw',
'whj'
]
exports.htmls = htmls;
exports.target = target;
exports.concat_with_mtime = concat_with_mtime;
exports.base_js = base_js;
exports.images = images;
\ No newline at end of file
// Laura Doktorova https://github.com/olado/doT
(function(){function o(){var b={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},a=/&(?!#?\w+;)|<|>|"|'|\//g;return function(f){return f?f.toString().replace(a,function(g){return b[g]||g}):f}}function p(b,a,f){return(typeof a==="string"?a:a.toString()).replace(b.define||h,function(g,e,c,i){if(e.indexOf("def.")===0)e=e.substring(4);if(!(e in f))if(c===":")f[e]=i;else eval("def['"+e+"']="+i);return""}).replace(b.use||h,function(g,e){var c=eval(e);return c?p(b,c,f):c})}function l(b){return b.replace(/\\('|\\)/g,
"$1").replace(/[\r\t\n]/g," ")}var j={version:"0.2.0",templateSettings:{evaluate:/\{\{([\s\S]+?)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:true,append:true,selfcontained:false},template:undefined,compile:undefined},m=function(){return this||(0,eval)("this")}();
if(typeof module!=="undefined"&&module.exports)module.exports=j;else if(typeof define==="function"&&define.amd)define(function(){return j});else m.doT=j;m.encodeHTML=o();var q={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},h=/$^/;j.template=function(b,a,f){a=a||j.templateSettings;var g=a.append?q.append:q.split,e,c=0,i;if(a.use||a.define){var r=m.def;m.def=f||{};b=p(a,b,m.def);m.def=r}b=("var out='"+(a.strip?b.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g,
" ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):b).replace(/'|\\/g,"\\$&").replace(a.interpolate||h,function(n,d){return g.start+l(d)+g.end}).replace(a.encode||h,function(n,d){e=true;return g.startencode+l(d)+g.end}).replace(a.conditional||h,function(n,d,k){return d?k?"';}else if("+l(k)+"){out+='":"';}else{out+='":k?"';if("+l(k)+"){out+='":"';}out+='"}).replace(a.iterate||h,function(n,d,k,s){if(!d)return"';} } out+='";c+=1;i=s||"i"+c;d=l(d);return"';var arr"+c+"="+d+";if(arr"+c+"){var "+k+","+i+"=-1,l"+
c+"=arr"+c+".length-1;while("+i+"<l"+c+"){"+k+"=arr"+c+"["+i+"+=1];out+='"}).replace(a.evaluate||h,function(n,d){return"';"+l(d)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|}|^|{)out\+='';/g,"$1").replace(/\+''/g,"").replace(/(\s|;|}|^|{)out\+=''\+/g,"$1out+=");if(e&&a.selfcontained)b="var encodeHTML=("+o.toString()+"());"+b;try{return new Function(a.varname,b)}catch(t){typeof console!=="undefined"&&console.log("Could not create a template function: "+
b);throw t;}};j.compile=function(b,a){return j.template(b,null,a)}})();
function FastClick(layer){"use strict";var oldOnClick,self=this;this.trackingClick=false;this.trackingClickStart=0;this.targetElement=null;this.touchStartX=0;this.touchStartY=0;this.lastTouchIdentifier=0;this.touchBoundary=10;this.layer=layer;if(!layer||!layer.nodeType){throw new TypeError("Layer must be a document node")}this.onClick=function(){return FastClick.prototype.onClick.apply(self,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(self,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(self,arguments)};this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(self,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(self,arguments)};if(FastClick.notNeeded(layer)){return}if(this.deviceIsAndroid){layer.addEventListener("mouseover",this.onMouse,true);layer.addEventListener("mousedown",this.onMouse,true);layer.addEventListener("mouseup",this.onMouse,true)}layer.addEventListener("click",this.onClick,true);layer.addEventListener("touchstart",this.onTouchStart,false);layer.addEventListener("touchend",this.onTouchEnd,false);layer.addEventListener("touchcancel",this.onTouchCancel,false);if(!Event.prototype.stopImmediatePropagation){layer.removeEventListener=function(type,callback,capture){var rmv=Node.prototype.removeEventListener;if(type==="click"){rmv.call(layer,type,callback.hijacked||callback,capture)}else{rmv.call(layer,type,callback,capture)}};layer.addEventListener=function(type,callback,capture){var adv=Node.prototype.addEventListener;if(type==="click"){adv.call(layer,type,callback.hijacked||(callback.hijacked=function(event){if(!event.propagationStopped){callback(event)}}),capture)}else{adv.call(layer,type,callback,capture)}}}if(typeof layer.onclick==="function"){oldOnClick=layer.onclick;layer.addEventListener("click",function(event){oldOnClick(event)},false);layer.onclick=null}}FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0;FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent);FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent);FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);FastClick.prototype.needsClick=function(target){"use strict";switch(target.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(target.disabled){return true}break;case"input":if(this.deviceIsIOS&&target.type==="file"||target.disabled){return true}break;case"label":case"video":return true}return/\bneedsclick\b/.test(target.className)};FastClick.prototype.needsFocus=function(target){"use strict";switch(target.nodeName.toLowerCase()){case"textarea":case"select":return true;case"input":switch(target.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return false}return!target.disabled&&!target.readOnly;default:return/\bneedsfocus\b/.test(target.className)}};FastClick.prototype.sendClick=function(targetElement,event){"use strict";var clickEvent,touch;if(document.activeElement&&document.activeElement!==targetElement){document.activeElement.blur()}touch=event.changedTouches[0];clickEvent=document.createEvent("MouseEvents");clickEvent.initMouseEvent("click",true,true,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,false,false,false,false,0,null);clickEvent.forwardedTouchEvent=true;targetElement.dispatchEvent(clickEvent)};FastClick.prototype.focus=function(targetElement){"use strict";var length;if(this.deviceIsIOS&&targetElement.setSelectionRange){length=targetElement.value.length;targetElement.setSelectionRange(length,length)}else{targetElement.focus()}};FastClick.prototype.updateScrollParent=function(targetElement){"use strict";var scrollParent,parentElement;scrollParent=targetElement.fastClickScrollParent;if(!scrollParent||!scrollParent.contains(targetElement)){parentElement=targetElement;do{if(parentElement.scrollHeight>parentElement.offsetHeight){scrollParent=parentElement;targetElement.fastClickScrollParent=parentElement;break}parentElement=parentElement.parentElement}while(parentElement)}if(scrollParent){scrollParent.fastClickLastScrollTop=scrollParent.scrollTop}};FastClick.prototype.getTargetElementFromEventTarget=function(eventTarget){"use strict";if(eventTarget.nodeType===Node.TEXT_NODE){return eventTarget.parentNode}return eventTarget};FastClick.prototype.onTouchStart=function(event){"use strict";var targetElement,touch,selection;if(event.targetTouches.length>1){return true}targetElement=this.getTargetElementFromEventTarget(event.target);touch=event.targetTouches[0];if(this.deviceIsIOS){selection=window.getSelection();if(selection.rangeCount&&!selection.isCollapsed){return true}if(!this.deviceIsIOS4){if(touch.identifier===this.lastTouchIdentifier){event.preventDefault();return false}this.lastTouchIdentifier=touch.identifier;this.updateScrollParent(targetElement)}}this.trackingClick=true;this.trackingClickStart=event.timeStamp;this.targetElement=targetElement;this.touchStartX=touch.pageX;this.touchStartY=touch.pageY;if(event.timeStamp-this.lastClickTime<200){event.preventDefault()}return true};FastClick.prototype.touchHasMoved=function(event){"use strict";var touch=event.changedTouches[0],boundary=this.touchBoundary;if(Math.abs(touch.pageX-this.touchStartX)>boundary||Math.abs(touch.pageY-this.touchStartY)>boundary){return true}return false};FastClick.prototype.findControl=function(labelElement){"use strict";if(labelElement.control!==undefined){return labelElement.control}if(labelElement.htmlFor){return document.getElementById(labelElement.htmlFor)}return labelElement.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")};FastClick.prototype.onTouchEnd=function(event){"use strict";var forElement,trackingClickStart,targetTagName,scrollParent,touch,targetElement=this.targetElement;if(this.touchHasMoved(event)){this.trackingClick=false;this.targetElement=null}if(!this.trackingClick){return true}if(event.timeStamp-this.lastClickTime<200){this.cancelNextClick=true;return true}this.lastClickTime=event.timeStamp;trackingClickStart=this.trackingClickStart;this.trackingClick=false;this.trackingClickStart=0;if(this.deviceIsIOSWithBadTarget){touch=event.changedTouches[0];targetElement=document.elementFromPoint(touch.pageX-window.pageXOffset,touch.pageY-window.pageYOffset)||targetElement;targetElement.fastClickScrollParent=this.targetElement.fastClickScrollParent}targetTagName=targetElement.tagName.toLowerCase();if(targetTagName==="label"){forElement=this.findControl(targetElement);if(forElement){this.focus(targetElement);if(this.deviceIsAndroid){return false}targetElement=forElement}}else if(this.needsFocus(targetElement)){if(event.timeStamp-trackingClickStart>100||this.deviceIsIOS&&window.top!==window&&targetTagName==="input"){this.targetElement=null;return false}this.focus(targetElement);if(!this.deviceIsIOS4||targetTagName!=="select"){this.targetElement=null;event.preventDefault()}return false}if(this.deviceIsIOS&&!this.deviceIsIOS4){scrollParent=targetElement.fastClickScrollParent;if(scrollParent&&scrollParent.fastClickLastScrollTop!==scrollParent.scrollTop){return true}}if(!this.needsClick(targetElement)){event.preventDefault();this.sendClick(targetElement,event)}return false};FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=false;this.targetElement=null};FastClick.prototype.onMouse=function(event){"use strict";if(!this.targetElement){return true}if(event.forwardedTouchEvent){return true}if(!event.cancelable){return true}if(!this.needsClick(this.targetElement)||this.cancelNextClick){if(event.stopImmediatePropagation){event.stopImmediatePropagation()}else{event.propagationStopped=true}event.stopPropagation();event.preventDefault();return false}return true};FastClick.prototype.onClick=function(event){"use strict";var permitted;if(this.trackingClick){this.targetElement=null;this.trackingClick=false;return true}if(event.target.type==="submit"&&event.detail===0){return true}permitted=this.onMouse(event);if(!permitted){this.targetElement=null}return permitted};FastClick.prototype.destroy=function(){"use strict";var layer=this.layer;if(this.deviceIsAndroid){layer.removeEventListener("mouseover",this.onMouse,true);layer.removeEventListener("mousedown",this.onMouse,true);layer.removeEventListener("mouseup",this.onMouse,true)}layer.removeEventListener("click",this.onClick,true);layer.removeEventListener("touchstart",this.onTouchStart,false);layer.removeEventListener("touchend",this.onTouchEnd,false);layer.removeEventListener("touchcancel",this.onTouchCancel,false)};FastClick.notNeeded=function(layer){"use strict";var metaViewport;if(typeof window.ontouchstart==="undefined"){return true}if(/Chrome\/[0-9]+/.test(navigator.userAgent)){if(FastClick.prototype.deviceIsAndroid){metaViewport=document.querySelector("meta[name=viewport]");if(metaViewport&&metaViewport.content.indexOf("user-scalable=no")!==-1){return true}}else{return true}}if(layer.style.msTouchAction==="none"){return true}return false};FastClick.attach=function(layer){"use strict";return new FastClick(layer)};if(typeof define!=="undefined"&&define.amd){define(function(){"use strict";return FastClick})}else if(typeof module!=="undefined"&&module.exports){module.exports=FastClick.attach;module.exports.FastClick=FastClick}else{window.FastClick=FastClick}
\ No newline at end of file
(function() {
// 加载数据
var goInit = function() {
if (window.isGetData == 1) {
Core.init();
} else {
window.isGetData = 1;
}
}
var getData = function(url) {
var params = location.hash.slice(1);
var args = params.match(/app_id=(\w*)&?/);
var start_page = params.match(/mod=(\w*)&?/);
var core_server = params.match(/core_server=(.*)&?/);
var appId = '';
var skin_v = '?' + $('#skin').attr('data-v');
if (args && args.length == 2) {
//匹配出app_id
appId = args[1];
}
if(start_page && start_page.length == 2){
//匹配出启动模块
Core.start_page = start_page[1];
console.log(Core.start_page);
}
if (core_server){
Core.server = core_server[1]
}
location.hash = '';
if (appId == '') {
//刷新地址出错
params = localStorage.getItem('params_' + url);
appId = localStorage.getItem('app_id');
} else {
localStorage.setItem('params_' + url, params);
localStorage.setItem('app_id', appId);
}
Core.params = params;
if (!appId) {
//无法获取到app_id
Core.showTips('无法获取app_id!', false, 3000);
goInit();
$('#loading').hide();
return;
}
Core.Data.app_id = appId;
var setSkin = false;
//先尝试设置皮肤,检查是否自动登录
var tryAutoLogin = false;
var _skin = localStorage.getItem('skin_' + appId);
if (_skin) {
$('#skin').attr('href', Core.server + '/static/sdk/skin/' + _skin + '/skin.css' + skin_v);
setSkin = true;
}
if ($('#login').length != 0) {
var auto = localStorage.getItem('auto');
var auto_time = parseInt(localStorage.getItem('auto_time'));
var d = new Date().getTime();
if (auto == 'true' && (d - auto_time) < 600000) {
tryAutoLogin = false;
} else if (auto == null) {
tryAutoLogin = false;
} else {
tryAutoLogin = true;
}
}
//如果不尝试自动登录,直接初始化界面
if (!tryAutoLogin)
goInit();
Core.ajax({
type: 'GET',
url: url + '?' + params,
dataType: 'json',
success: function(data) {
if (data.code == 0) {
// 成功请求
Core.Data = data.msg;
if (Core.Data.face) {
Core.Data.face = Core.server + data.msg.face;
}
//更新server
var lastServer = localStorage.getItem('last_server');
if (Core.Data.new_server) {
if (lastServer && lastServer == Core.Data.new_server) {
//没有变化
} else {
//需要更新server
var s = 'sdk://changeServer?addr=' + Core.Data.new_server;
localStorage.setItem('last_server', Core.Data.new_server);
location.href = s;
}
}
if (!setSkin && data.skin) {
$('#skin').attr('href', Core.server + '/static/sdk/skin/' + data.skin + '/skin.css' + skin_v);
localStorage.setItem('skin_' + appId, data.skin);
}
localStorage.setItem('data_' + url, JSON.stringify(data.msg));
//模块初始化函数,兼容旧版本sdk
if (typeof(window.initFunc) == "function") {
window.initFunc();
}
// 核心初始化
$('#loading').hide();
if (tryAutoLogin) {
goInit();
} else {
var first_mod = Core.start_page? Core.start_page: 'home';
Core.updateMod(first_mod);
}
} else {
//参数出错,没有游戏服什么的.
$('#loading').hide();
$('<h2 class="error_title">出错了,正在努力抢修中...</h2>').appendTo($('.mask'));
Core.showTips(data.msg, false, 6000);
// 核心初始化
Core.loadFinished();
}
},
error: function(xhr, type) {
// 请求失败,服务器崩溃
//尝试从缓存中获取数据
var data_str = localStorage.getItem('data_' + url);
if (data_str && data_str != '') {
var data = JSON.parse(data_str);
if (typeof data == "object") {
Core.Data = data;
if (tryAutoLogin) {
goInit();
} else {
Core.updateMod('home');
}
}
}
Core.showTips('网络出错,请检查网络状态。', false);
// 核心初始化
$('#loading').hide();
}
});
}
window.getData = getData;
})();
\ No newline at end of file
/*!
** create by zhangxinxu(.com) 2013-07-15
** a simple method for custom scrolling
** it can be used on both mobile and parts desktop browser IE9+/FF/Chrome/...
*/
var simpScroller=(function(){var c=!((window.DocumentTouch&&document instanceof window.DocumentTouch)||"ontouchstart" in window)*1,b={start:["touchstart","mousedown"][c],move:["touchmove","mousemove"][c],end:["touchend","mouseup"][c]};var a=function(e,l,f){var n="top",o="Top",p="height",g="Height",d="pageY";if(l=="horizontal"){n="left";o="Left";p="width";g="Width";d="pageX"}var i=null;if(f.hideScrollBar==false){i=document.createElement("div");i.className="scroller_"+l;f.container.appendChild(i)}var m=e["client"+g],h=0;var j=function(){if(i==null){return}var r=i.style[p].replace("px",""),q=e["scroll"+o]/(h-m)*(m-r);if(m-r-q<=0){q=m-r}i.style[n]=q+"px"};var k={};e.addEventListener(b.start,function(q){h=this["scroll"+g];k[d]=q.touches?q.touches[0][d]:q[d];k[n]=this["scroll"+o];document.moveFollow=true;if(i&&h>m){i.style.opacity=1;i.style[p]=(m*m/h)+"px";j()}c&&q.preventDefault()});e.addEventListener(b.move,function(q){if(c==false||(document.moveFollow==true)){this["scroll"+o]=k[n]+(k[d]-(q.touches?q.touches[0][d]:q[d]));j();f.onScroll.call(this,q)}q.preventDefault()});e.addEventListener(b.end,function(q){i&&(i.style.opacity=0)});if(c==true){document.addEventListener("mouseup",function(){this.moveFollow=false})}};return function(d,f){f=f||{};var j=new Object({verticalScroll:true,horizontalScroll:false,hideScrollBar:false,onScroll:function(){}}),g;for(g in f){j[g]=f[g]}if(window.getComputedStyle(d).position=="static"){d.style.position="relative"}var i=d.childNodes,e=document.createDocumentFragment();[].slice.call(i).forEach(function(k){e.appendChild(k)});var h=document.createElement("div");h.style.height="100%";h.style.width="100%";h.style.overflow="hidden";d.appendChild(h);h.appendChild(e);j.container=d;if(j.verticalScroll==true){a(h,"vertical",j)}if(j.horizontalScroll==true){a(h,"horizontal",j)}}})();
\ No newline at end of file
This diff is collapsed. Click to expand it.
/**
* 动态生成各游戏皮肤下对应的manifest文件。分别将带上修改时间戳的第三方库、业务逻辑js、
* sdk基本样式、指定皮肤样式、皮肤资源文件的路径添加到manifes文件中
* 并将修改时间更新到html文档的资源引用中
* 配置文件:config.js
* 生成文件:skin/xxxx/sdk.manifest
* 运行方法:node makefile.js
**/
var fs = require('fs'),
PATH = require('path'),
config = require('./config.js');
var target = config.target;
var concat_with_mtime = config.concat_with_mtime;
var base_js = config.base_js;
var base_img = config.images;
var htmls = config.htmls;
//读取三个html文件的内容,以便后面更新引用信息
var html_content = [];
for (i = 0, l = htmls.length; i < l; i++) {
html_content.push(fs.readFileSync(htmls[i], 'utf-8'));
}
function formatTime(mtime) {
var date = '';
date += mtime.getFullYear();
var month = mtime.getMonth() + 1;
month < 10 ? date += '0' + month : date += month;
var day = mtime.getDate();
day < 10 ? date += '0' + day : date += day;
var hour = mtime.getHours();
hour < 10 ? date += '0' + hour : date += hour;
var minute = mtime.getMinutes();
minute < 10 ? date += '0' + minute : date += minute;
return date;
}
var content = [];
var path, mtime, jsPath, reg;
content.push('CACHE MANIFEST');
content.push('');
var now = new Date();
content.push('#version=' + formatTime(now));
for(var i=0, l= htmls.length; i<l; i++){
path = htmls[i];
if(PATH.existsSync(path)){
// mtime = formatTime(fs.statSync(path).mtime);
content.push('/static/sdk/' + path);// + '?' + mtime);
}
}
for (i = 0, l = base_js.length; i < l; i++) {
path = base_js[i];
if (PATH.existsSync(path)) {
mtime = formatTime(fs.statSync(path).mtime);
content.push('/static/sdk/' + path + '?' + mtime);
//更新login.html, center.html, pay.html的引用信息的版本号
for (var j = 0, k = html_content.length; j < k; j++) {
reg = new RegExp(path.replace('/', '\\/') + '\\?\\d+')
html_content[j] = html_content[j].replace(reg, path + '?' + mtime);
}
} else {
console.error('指定文件不存在:' + base_js[i]);
}
}
for (i = 0, l = concat_with_mtime.length; i < l; i++) {
path = concat_with_mtime[i];
if (PATH.existsSync(path)) {
mtime = formatTime(fs.statSync(path).mtime);
content.push('/static/sdk/' + path + '?' + mtime);
//更新login.html, center.html, pay.html的引用信息的版本号
for (j = 0, k = html_content.length; j < k; j++) {
reg = new RegExp(path.replace('/', '\\/') + '\\?\\d+')
html_content[j] = html_content[j].replace(reg, path + '?' + mtime);
}
} else {
console.error('指定文件不存在:' + path);
}
}
// 添加sdk基本图片资源
/*
var base_img_files = fs.readdirSync(base_img);
for(i=0,l=base_img_files.length; i<l; i++){
if(base_img_files[i].indexOf('.') == 0) continue;
path = base_img + '/' + base_img_files[i];
content.push('/static/sdk/' + path);
}
*/
//获取皮肤的最大mtime
/*
var skin_mtime = 0;
for(i=0, l= target.length; i<l; i++){
path = 'skin/' + target[i] + '/skin.css';
mtime = parseInt(formatTime(fs.statSync(path).mtime));
if(mtime > skin_mtime) skin_mtime = mtime;
}
*/
//在基础文件上添加对应皮肤的样式和所需要的图片
var skin_content;
for (i = 0, l = target.length; i < l; i++) {
path = 'skin/' + target[i];
skin_content = content.concat();
/*
skin_content.push('/static/sdk/' + path + '/skin.css' + '?' + skin_mtime);
*/
//更新login.html, center.html, pay.html的引用信息的版本号
for (j = 0, k = html_content.length; j < k; j++) {
reg = new RegExp('data-v="\\d+"');
html_content[j] = html_content[j].replace(reg, 'data-v="' + skin_mtime + '"');
}
//push the img fiels if exists
/*
var images = fs.readdirSync(path + '/img');
for (var j = 0, k = images.length; j < k; j++) {
if(images[j].indexOf('.') == 0) continue;
var img_path = path + '/img/' + images[j];
// mtime = formatTime(fs.statSync(img_path).mtime);
skin_content.push('/static/sdk/' + path + '/img/' + images[j]) //+ '?' + mtime);
}
*/
skin_content.push('NETWORK:');
skin_content.push('*');
skin_content = skin_content.join('\n');
fs.writeFileSync(path + '/sdk.manifest', skin_content);
}
content.push('NETWORK:');
content.push('*');
//生成基础的没有皮肤的缓存文件
fs.writeFileSync('skin/sdk.manifest', content.join('\n'));
//将对html文件引用信息的修改写回文件中
for(i=0, l=htmls.length; i<l; i++){
fs.writeFileSync(htmls[i], html_content[i]);
}
\ No newline at end of file
This diff is collapsed. Click to expand it.
date:2017-4-11
author
:lizenghua
instructions
:与星玩SDK同步
date:2017-4-12
author:lizenghua
instructions:修复当账户及密码为空时(本地存储的账号密码数据为空),通过密保找回密码时一直处于加载中无法跳转的问题
date:2017-4-21
author:lizenghua
instructions:
1、当用户是正式用户并绑定了手机后进行实名认证;身份证校验js:identity_id.js
改动的文件有:login.html、login.js(同步在sdk_xingwan、sdk_6)
2、改动注释了pay.js里面的911行到918行:进入sdk要购买的游戏币>0时强制进入渠道充值页面(已同步在sdk_xingwan、sdk_6)
date:2017-4-24
author:lizenghua
instructions:
1、处理绑定手机的手机验证规则(176),
2、手机找回密码中重置密码残留旧密码问题
date:2017-5-3
author:lizenghua
instructions:
1、注释掉pay.html中的“游爱星”兑换入口
2、处理支付方式切换中出现 input_item 为undefind 的bug (将383行的{{?}}移至435行)
3、去掉设置密保中select默认的下拉图标(login.css)
4、如果没有第三方登录则隐藏掉“第三方登录”字眼
date:2017-5-8
author:lizenghua
instructions:处理支付方式点击支付图标出现 input_item 为undefind 的bug(将150行$c改成$(this))
date:2017-5-12
author:lizenghua
instructions:修改充值的界面显示大小
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, user-scalable=no,target-densitydpi=device-dpi" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="format-detection" content="telephone=no">
<meta name="screen-orientation" content="portrait">
<meta name="full-screen" content="yes">
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<link href="skin/new_sdk.min.css?v=20150318002" type="text/css" rel="stylesheet" />
<link id="skin" data-v="20150318001" type="text/css" rel="stylesheet" />
<link href="skin/responsive.min.css?v=20150318001" type="text/css" rel="stylesheet" />
<title>
手游平台登录
</title>
</head>
<body>
<div class="mask">
<div class="container_load" id="loading">
<div class="content">
<div class="circle"></div>
<div class="circle1"></div>
</div>
</div>
<div class="alert alert-success hide" id="alert">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<span></span>
</div>
<section id="home" data-attr="dot" class="hide"></section>
<section id="frame" data-attr="dot" class="hide" ></section>
<script id="frame_template" type="text/x-jquery-tmpl" >
<div class="header">
<span class="title">{{=Core.Data.frame_title}}</span>
<a class="btn pull-left op-back" href="#main">返回</a>
</div>
<div class="container" style="">
<div class="container_load in_frame" id="loading_frame">
<div class="content">
<div class="circle"></div>
<div class="circle1"></div>
</div>
</div>
{{? Core.isIos}}<div class="ios_scroll">{{?}}
<iframe frameborder=0 src="{{=Core.Data.frame_src}}" scrolling="yes" width="100%" height="100%"></iframe>
{{? Core.isIos}}</div>{{?}}
</div>
</script>
<script id="home_template" type="text/x-jquery-tmpl">
<div class="header">
<span class="title">分享游戏</span>
<a class="btn pull-left op-back" href="sdk://exit?action=share">回到游戏</a>
</div>
<div class="container">
<div class="box_info_center">
<div class="share_box1">
<div class="share_game clearfix">
<img class="pull-left game_face" src="{{=Core.Data.icon || ''}}" height="75" width="75">
<textarea class="s_content">{{=Core.Data.content || '这款游戏还不错噢,一起来玩吧!'}}</textarea>
</div>
</div>
<div class="share_box2">
<div class="">
<h3 class="text-info">分享到</h3>
<ul class="other-login inline clearfix">
<li><a href="/sdk/share/game/qq/?app_id={{=Core.Data.app_id || ''}}" class="qq" title="QQ空间分享"></a></li>
<li><a href="/sdk/share/game/sina/?app_id={{=Core.Data.app_id || ''}}" class="sina" title="新浪微博分享"></a></li>
<li><a href="/sdk/share/game/tqq/?app_id={{=Core.Data.app_id || ''}}" class="tqq" title="腾讯微博分享"></a></li>
</ul>
<div class="invite_box">
<h3 class="text-info">奖励说明:</h3>
<p>
1.成功邀请好友一起玩游戏,您可获得<span class="text-info">5{{=Core.Data.game_unit_name}}</span>的奖励。
</p>
<p>
2.好友若充值(限前10),您可获得<span class="text-info">5%</span>充值奖励。
</p>
<p>
3.好友首次充值,因被您邀请可额外获得<span class="text-info">10%</span>充值返利。
</p>
</div>
</div>
</div>
</div>
</div>
</script>
</div>
<script type="text/javascript" src="js/fastclick.min.1.0.js?201309041309"></script>
<script type="text/javascript" src="js/zepto.min.js?201309041309"></script>
<script type="text/javascript" src="js/doT.min.js?201309041309" ></script>
<script type="text/javascript">
window.isGetData = 0;
$(function() {
FastClick.attach(document.body);
});
</script>
<script type="text/javascript" src="js/core.min.js?201403141112" ></script>
<script type="text/javascript">
(function(){
// Home模块
var Home = function(modId) {
Module.call(this, modId);
}
// 继承基础模块
Core.inherit(Home, Module);
Home.prototype.bind = function(){
var that = this;
that.$c.on('click', '.other-login a', function(e){
e.preventDefault();
//分享连接
var $tar = $(e.target);
var content = that.$c.find('.s_content').val();
$tar.attr('params', 'content=' + content);
Core.ajax_do($tar, function(data){
console.log(data);
if(data.code == 0){
if(data.msg.next_url){
// 需要重新授权
var src = data.msg.next_url;
if (Core.isFile) {
src = Core.server + src;
}
Core.Data.frame_title = $tar.attr('title');
Core.Data.frame_src = src;
Core.updateMod('frame');
} else {
//
Core.showTips(data.msg);
}
}
}, that);
});
}
Core.registerMod('home', Home);
var Frame = function(modId) {
Module.call(this, modId);
}
Core.inherit(Frame, Module);
Frame.prototype.show_after = function() {
var that = this;
var _des = Core.last_mod ? Core.last_mod : 'home';
this.$c.find('a.btn.pull-left').attr('href', '#' + _des);
this.$c.find('iframe')[0].onload = function() {
that.$c.find('#loading_frame').hide();
}
}
Core.registerMod('frame', Frame);
})();
</script>
<script type="text/javascript" src="js/loader.min.js?201401151617"></script>
<script type="text/javascript">
(function(){
window.isGetData = 1;
getData('/game/info/');
})();
</script>
</body>
</html>
\ No newline at end of file
CACHE MANIFEST
#version=20151112001
/static/sdk_3/login.html?20151112001
/static/sdk_3/center.html?20151112001
/static/sdk_3/pay.html?20151112001
/static/sdk_3/share.html?20151112001
/static/sdk_3/js/fastclick.min.1.0.js?20151112001
/static/sdk_3/js/zepto.min.js?20151112001
/static/sdk_3/js/doT.min.js?20151112001
/static/sdk_3/js/iscroll.min.1.0.js?20151112001
/static/sdk_3/skin/login.css?20151112001
/static/sdk_3/skin/pay.css?20151112001
/static/sdk_3/js/core.min.js?20151112001
/static/sdk_3/js/loader.min.js?20151112001
/static/sdk_3/js/center.min.js?20151112001
/static/sdk_3/js/pay.min.js?20151112001
/static/sdk_3/js/login.min.js?20151112001
/static/sdk_3/images/login_icon.png?20151112001
/static/sdk_3/images/new-sdk-logo.png?20151112001
NETWORK:
*
\ No newline at end of file
#!/bin/sh
#js css压缩,生成更新包打包
CDN_SERVER='http://sdk.uuufish.com/static'
DIR_PATH="$( cd "$( dirname "$0" )" && pwd )"
echo "$DIR_PATH"
cd $DIR_PATH
VERSION=`cat version.txt`
DIR_NAME=${DIR_PATH##*/}
ZIP_FILE="${DIR_NAME}_${VERSION}.zip"
SAVE_DIR="dst"
MD5=''
echo $DIR_NAME
function make_new_zip_file {
cd $DIR_PATH
mkdir -pv dst
save_zip_file="${SAVE_DIR}/${ZIP_FILE}"
[ -f "$save_zip_file" ] && rm "$save_zip_file" && echo "rm $save_zip_file"
echo "zip $ZIP_FILE"
zip -x 'uglifyjs_sqwish.sh' -x 'v.txt' -x '*.svn/*' -x "${SAVE_DIR}/*" -x "${ZIP_FILE}" -r "${save_zip_file}" ./
MD5=`md5sum dst/${ZIP_FILE} |cut -d ' ' -f1`
}
function make_version_file {
make_new_zip_file
cd $DIR_PATH
URL="${CDN_SERVER}/${DIR_NAME}/${SAVE_DIR}/${ZIP_FILE}"
echo "${VERSION}|${MD5}|${URL}" > v.txt
cat v.txt
}
function uglifyjs_js_css {
cd $DIR_PATH
cd js/
for f in `ls *.js`;do
uglifyjs $f -m -o $f
done
cd ../skin
unalias mv
for f in `ls *.css`;do
if [ -f "$f" ];then
sqwish $f
new_f=`basename $f css`
new_f="$new_f""min.css"
echo " mv $new_f $f"
[ -f "$new_f" ] && mv $new_f $f
fi
done
cd ..
}
uglifyjs_js_css
make_version_file
SERVER_URL=http://sdk.uuufish.com
CDN_SERVER_URL=http://sdk.uuufish.com
SDK_TYPE=.sys_config_youyu
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project name="PoolSdk" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
/** Automatically generated file. DO NOT MODIFY */
package com.youai.poolsdk.demo;
public final class BuildConfig {
public final static boolean DEBUG = true;
}
\ No newline at end of file
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.youai.poolsdk.demo;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int public_sdk_self_demo_btn_login_n=0x7f020000;
public static final int public_sdk_self_demo_btn_login_s=0x7f020001;
public static final int public_sdk_self_demo_btn_main_n=0x7f020002;
public static final int public_sdk_self_demo_btn_main_s=0x7f020003;
public static final int public_sdk_self_demo_main=0x7f020004;
public static final int public_sdk_self_ic_launcher=0x7f020005;
public static final int public_sdk_self_sdk_login_bg=0x7f020006;
public static final int public_sdk_self_ya_bt_selector=0x7f020007;
public static final int public_sdk_self_ya_login_bt_selector=0x7f020008;
}
public static final class id {
public static final int forum_bt=0x7f050005;
public static final int logout_bt=0x7f050004;
public static final int ya_channel_center=0x7f050000;
public static final int ya_enter_game_bt=0x7f050007;
public static final int ya_login_bt=0x7f050006;
public static final int ya_pay_bt=0x7f050001;
public static final int ya_submit_role_data_bt=0x7f050003;
public static final int ya_switch_account_bt=0x7f050002;
}
public static final class layout {
public static final int public_sdk_self_game=0x7f030000;
public static final int public_sdk_self_game_login=0x7f030001;
}
public static final class string {
public static final int app_name=0x7f040000;
}
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type