This repository was archived by the owner on Jun 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathapi.html
More file actions
98 lines (97 loc) · 8.98 KB
/
api.html
File metadata and controls
98 lines (97 loc) · 8.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html><html lang=""><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>PAG · Portable Animated Graphics</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta name="generator" content="Docusaurus"/><meta name="description" content="Portable Animated Graphics"/><meta property="og:title" content="PAG · Portable Animated Graphics"/><meta property="og:type" content="website"/><meta property="og:url" content="https://pag.io/index.html"/><meta property="og:description" content="Portable Animated Graphics"/><meta property="og:image" content="https://pag.io/img/docusaurus.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://pag.io/img/docusaurus.png"/><link rel="shortcut icon" href="/img/favicon.png"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><script type="text/javascript" src="/javascript/page.js"></script><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdn-go.cn/aegis/aegis-sdk/latest/aegis.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/libpag@latest/lib/libpag.min.js"></script><script src="/js/scrollSpy.js"></script><link rel="stylesheet" href="/css/main.css"/><script src="/js/codetabs.js"></script></head><body><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><img class="logo" src="/img/new_official_website/logo.png" alt="PAG"/><h2 class="headerTitleWithLogo">PAG</h2></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class=""><a href="/" target="_self">首页</a></li><li class=""><a href="/docs/install.html" target="_self">设计师文档</a></li><li class=""><a href="/docs/sdk.html" target="_self">开发者文档</a></li><li class=""><a href="/case.html" target="_self">案例展示</a></li><li class=""><a href="/docs/faq.html" target="_self">FAQ</a></li><li class=""><a href="https://github.com/Tencent/libpag" target="_self">GitHub</a></li><li class=""><a href="https://qm.qq.com/cgi-bin/qm/qr?k=Wa65DTnEKo2hnPsvY-1EgJOF8tvKQ-ZT&jump_from=webapi" target="_self">官方群</a></li><li class=""><a href="/#download" target="_self">免费下载</a></li></ul></nav></div></header></div></div><div class="navPusher"><div><div class="docMainWrapper wrapper" id="js_original_part"><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><h1 class="postHeaderTitle">API参考</h1></header><article><div><span><p>最新版本的API文档请点击如下链接查看:</p><p id="js_ios_doc"><font color="blue">iOS API文档</font></p><p id="js_android_doc"><font color="blue">Android API文档</font></p><p id="js_web_doc"><font color="blue">Web API文档</font></p></span></div></article></div><div class="docs-prevnext"></div></div></div><nav class="onPageNav"></nav></div><div id="js_iframe_part" style="width:100%"><iframe id="iframe" style="width:100%;padding-top:32px"></iframe></div><script>
var iframe = document.getElementById('iframe');
var iosPathname = "/apis/ios/";
var androidPathname = "/apis/android/";
var webPathname = "/apis/web/";
var innerDocClick = false;
var hasInit = false;
var ignore = false;
var android = function (){
return location.hash.indexOf('apis/android')>1;
}
document.onmouseover = function() { innerDocClick = true; }
document.onmouseleave = function() { innerDocClick = false; }
function formatUrl(loc){
return location.pathname + "#" + loc.pathname
}
function updateIframe (url,cb){
iframe.onload = function(){
try{
iframe.contentDocument.getElementById('header-buttons').style.background = '#fff';
iframe.contentDocument.getElementById('header-buttons').children[0].children[0].style.color='#fff';
}catch(e){}
iframe.style.height = Math.max(iframe.contentWindow.document.documentElement.scrollHeight,document.body.clientHeight) + 'px';
hasInit = true;
if(android()){
var subFrame = location.hash.indexOf('allclasses-frame.html')>-1
? 'org/libpag/package-summary.html'
: location.hash.split('/apis/android/')[1];
if(iframe.contentDocument.getElementsByTagName('frameset')[0].children[1]){
iframe.contentDocument.getElementsByTagName('frameset')[0].children[1].src = subFrame
}
}
}
if(hasInit && android()){
return ;
}
iframe.src = android() ? '/apis/android/' :url;
}
if(location.hash){ //初始化
document.getElementById('js_original_part').style.display = 'none';
updateIframe(location.hash.replace('#',''))
}
else{
hasInit = true;
}
// 入口按钮
document.getElementById('js_ios_doc').onclick = ()=>{
document.getElementById('js_original_part').style.display = 'none';
document.getElementById('js_iframe_part').style.display = 'block';
updateIframe(iosPathname)
}
document.getElementById('js_android_doc').onclick = ()=>{
document.getElementById('js_original_part').style.display = 'none';
document.getElementById('js_iframe_part').style.display = 'block';
ignore = true;
updateIframe(androidPathname)
window.location.hash = '#'+androidPathname + 'org/libpag/package-summary.html' ;
}
document.getElementById('js_web_doc').onclick = ()=>{
document.getElementById('js_original_part').style.display = 'none';
document.getElementById('js_iframe_part').style.display = 'block';
updateIframe(webPathname)
}
//监听子页面URL的变化事件,同步到壳的URL
window.addEventListener("message", function(e){
if(!hasInit || !innerDocClick){ //过滤掉浏览器的后退和初始化
return;
}
let url = e.data && e.data.indexOf('iframe_url_change') === -1 ? "#"+e.data : formatUrl(iframe.contentWindow.location);
if(url && url.substr(url.length-1) === "#"){
url = url.substr(0,url.length-1)
}
if(url.indexOf('package-summary.html')>-1
|| url.indexOf('allclasses-frame.html')>-1){
return;
}
location.href = url;
}, false);
//URL的变化更新到Iframe
window.onhashchange = function(){
if(ignore){
ignore = false;
return;
}
if(!innerDocClick || !hasInit){
return;
}
updateIframe(location.hash.replace('#',''))
}
//
var css = document.createElement('style');
css.type = 'text/css';
css.appendChild(document.createTextNode(
'aside #header-buttons{ background: #fff !important;}aside #header-buttons > li > a{ color:transparent !important; }'
));
document.head.appendChild(css)
</script></div><footer class="nav-footer" id="footer"><section class="copyright">Copyright © 2022 pag.io</section></footer></div></body></html>