mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-05 05:07:48 +00:00
GEEKING
This commit is contained in:
@@ -0,0 +1,503 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Source: common/utils.js</title>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content=""/>
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:image" content=""/>
|
||||
|
||||
<meta property="og:url" content=""/>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"></script>
|
||||
<script src="scripts/prettify/lang-css.js"></script>
|
||||
<script src="scripts/jquery.min.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jaguar.css">
|
||||
|
||||
|
||||
<script>
|
||||
var config = {"monospaceLinks":false,"cleverLinks":false,"applicationName":"RobloxHybrid API","disqus":"","googleAnalytics":"","openGraph":{"title":"","type":"website","image":"","site_name":"","url":""},"meta":{"title":"","description":"","keyword":""},"default":{"outputSourceFiles":true},"linenums":true};
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrap" class="clearfix">
|
||||
|
||||
<div class="navigation">
|
||||
<h3 class="applicationName"><a href="index.html">RobloxHybrid API</a></h3>
|
||||
|
||||
<div class="search">
|
||||
<input id="search" type="text" class="form-control input-sm" placeholder="Search Documentations">
|
||||
</div>
|
||||
<ul class="list">
|
||||
|
||||
<li class="item" data-name="module:events.Slot">
|
||||
<span class="title">
|
||||
<a href="module-events.Slot.html">module:events.Slot</a>
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="module:events.Slot#emit"><a href="module-events.Slot.html#emit">emit</a></li>
|
||||
|
||||
<li data-name="module:events.Slot#subscribe"><a href="module-events.Slot.html#subscribe">subscribe</a></li>
|
||||
|
||||
<li data-name="module:events.Slot#unsubscribe"><a href="module-events.Slot.html#unsubscribe">unsubscribe</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="analytics">
|
||||
<span class="title">
|
||||
analytics
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="module:analytics.trackEvent"><a href="module-analytics.html#.trackEvent">trackEvent</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="bridge">
|
||||
<span class="title">
|
||||
bridge
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
<span class="subtitle">Members</span>
|
||||
|
||||
<li data-name="module:bridge.CallbackStatus"><a href="module-bridge.html#.CallbackStatus">CallbackStatus</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="module:bridge.execute"><a href="module-bridge.html#.execute">execute</a></li>
|
||||
|
||||
<li data-name="module:bridge.nativeCallback"><a href="module-bridge.html#.nativeCallback">nativeCallback</a></li>
|
||||
|
||||
<li data-name="module:bridge.nativeCallback"><a href="module-bridge.html#.nativeCallback">nativeCallback</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="camera">
|
||||
<span class="title">
|
||||
camera
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="module:camera.cleanup"><a href="module-camera.html#.cleanup">cleanup</a></li>
|
||||
|
||||
<li data-name="module:camera.getPicture"><a href="module-camera.html#.getPicture">getPicture</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="console">
|
||||
<span class="title">
|
||||
console
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="module:console.error"><a href="module-console.html#.error">error</a></li>
|
||||
|
||||
<li data-name="module:console.log"><a href="module-console.html#.log">log</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="events">
|
||||
<span class="title">
|
||||
events
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="utils">
|
||||
<span class="title">
|
||||
utils
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
<span class="subtitle">Members</span>
|
||||
|
||||
<li data-name="module:utils.extend"><a href="module-utils.html#.extend">extend</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="module:utils.createUUID"><a href="module-utils.html#.createUUID">createUUID</a></li>
|
||||
|
||||
<li data-name="module:utils.isMobile"><a href="module-utils.html#.isMobile">isMobile</a></li>
|
||||
|
||||
<li data-name="module:utils.isMobileApp"><a href="module-utils.html#.isMobileApp">isMobileApp</a></li>
|
||||
|
||||
<li data-name="module:utils.loadScript"><a href="module-utils.html#.loadScript">loadScript</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="chat">
|
||||
<span class="title">
|
||||
chat
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="roblox.module:chat.newMessageNotification"><a href="roblox.module_chat.html#.newMessageNotification">newMessageNotification</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="dialogs">
|
||||
<span class="title">
|
||||
dialogs
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="roblox.module:dialogs.alert"><a href="roblox.module_dialogs.html#.alert">alert</a></li>
|
||||
|
||||
<li data-name="roblox.module:dialogs.confirm"><a href="roblox.module_dialogs.html#.confirm">confirm</a></li>
|
||||
|
||||
<li data-name="roblox.module:dialogs.prompt"><a href="roblox.module_dialogs.html#.prompt">prompt</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="game">
|
||||
<span class="title">
|
||||
game
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="roblox.module:game.launchPartyForPlaceId"><a href="roblox.module_game.html#.launchPartyForPlaceId">launchPartyForPlaceId</a></li>
|
||||
|
||||
<li data-name="roblox.module:game.startWithPlaceID"><a href="roblox.module_game.html#.startWithPlaceID">startWithPlaceID</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="network">
|
||||
<span class="title">
|
||||
network
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
<span class="subtitle">Members</span>
|
||||
|
||||
<li data-name="roblox.module:network.status"><a href="roblox.module_network.html#.status">status</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="roblox.module:network.getStatus"><a href="roblox.module_network.html#.getStatus">getStatus</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="item" data-name="social">
|
||||
<span class="title">
|
||||
social
|
||||
|
||||
</span>
|
||||
<ul class="members itemMembers">
|
||||
|
||||
<span class="subtitle">Members</span>
|
||||
|
||||
<li data-name="roblox.module:social.providers"><a href="roblox.module_social.html#.providers">providers</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="typedefs itemMembers">
|
||||
|
||||
</ul>
|
||||
<ul class="methods itemMembers">
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li data-name="roblox.module:social.login"><a href="roblox.module_social.html#.login">login</a></li>
|
||||
|
||||
<li data-name="roblox.module:social.logout"><a href="roblox.module_social.html#.logout">logout</a></li>
|
||||
|
||||
<li data-name="roblox.module:social.presentShareDialog"><a href="roblox.module_social.html#.presentShareDialog">presentShareDialog</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="main">
|
||||
<h1 class="page-title" data-filename="common_utils.js.html">Source: common/utils.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* Utils module
|
||||
* @module utils
|
||||
*/
|
||||
define("Utils", {}, function(require, exports, module) {
|
||||
|
||||
/**
|
||||
* Returns true if this app is executed in a mobile device, either in a native app or in the browser.
|
||||
*
|
||||
* @returns {Boolean} true if this app is executed in a mobile device, either in a native app or in the browser.
|
||||
* @instance
|
||||
*/
|
||||
exports.isMobile = function() {
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
var keywords = "(iphone;android;midp;240x320;blackberry;netfront;nokia;panasonic;portalmmm;sharp;sie-;sonyericsson;symbian;windows ce;benq;mda;mot-;opera mini;philips;pocket pc;sagem;samsung;htc".split(";");
|
||||
var keyword;
|
||||
for (keyword in keywords) {
|
||||
if (-1 != ua.indexOf(keywords[keyword])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if this app is executed natively ONLY
|
||||
*
|
||||
* @returns {Boolean} true if this app is executed in a mobile device, either in a native app or in the browser.
|
||||
* @instance
|
||||
*/
|
||||
exports.isMobileApp = function() {
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
return ua.indexOf("hybrid") != -1;
|
||||
};
|
||||
|
||||
/**
|
||||
* Loads/injects a script
|
||||
*
|
||||
* @param {string} scriptURL - Script URL to load
|
||||
* @param {Function} callback - Callback to be executed when the script is loaded
|
||||
* @instance
|
||||
*/
|
||||
exports.loadScript = function(scriptURL, callback) {
|
||||
|
||||
var scriptLoaded = false;
|
||||
function onScriptLoaded() {
|
||||
if(!scriptLoaded) {
|
||||
scriptLoaded = true;
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var script = document.createElement('script');
|
||||
script.type= 'text/javascript';
|
||||
script.async = true;
|
||||
script.onreadystatechange= function () {
|
||||
if (this.readyState == 'complete') onScriptLoaded();
|
||||
}
|
||||
script.onload= onScriptLoaded;
|
||||
script.src= scriptURL;
|
||||
|
||||
head.appendChild(script);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Extends a child object from a parent object using classical inheritance
|
||||
* pattern.
|
||||
*
|
||||
* @param {Function} Child - Child class
|
||||
* @param {Function} Parent - Parent class
|
||||
*/
|
||||
exports.extend = (function() {
|
||||
// proxy used to establish prototype chain
|
||||
var F = function() {};
|
||||
// extend Child from Parent
|
||||
return function(Child, Parent) {
|
||||
F.prototype = Parent.prototype;
|
||||
Child.prototype = new F();
|
||||
Child.__super__ = Parent.prototype;
|
||||
Child.prototype.constructor = Child;
|
||||
};
|
||||
}());
|
||||
|
||||
/**
|
||||
* Create a UUID
|
||||
*
|
||||
* @returns A newly random UUID with the format XXXX-XX-XX-XX-XXXXXX
|
||||
*/
|
||||
exports.createUUID = function() {
|
||||
|
||||
function createPart(length) {
|
||||
var uuidpart = "";
|
||||
for (var i=0; i<length; i++) {
|
||||
var uuidchar = parseInt((Math.random() * 256), 10).toString(16);
|
||||
if (uuidchar.length == 1) {
|
||||
uuidchar = "0" + uuidchar;
|
||||
}
|
||||
uuidpart += uuidchar;
|
||||
}
|
||||
return uuidpart;
|
||||
}
|
||||
|
||||
return createPart(4) + '-' +
|
||||
createPart(2) + '-' +
|
||||
createPart(2) + '-' +
|
||||
createPart(2) + '-' +
|
||||
createPart(6);
|
||||
};
|
||||
});
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
RobloxHybrid - Documentation generated on 11/11/2015
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
<script src="scripts/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user