Commit e72d02331ae07d97e7a6f8cf98fa77f1bb936a48
1 parent
dd9a0b54
add plugins
Showing
4 changed files
with
72 additions
and
8 deletions
src/js/cordova_plugins.js
| 1 | cordova.define('cordova/plugin_list', function(require, exports, module) { | 1 | cordova.define('cordova/plugin_list', function(require, exports, module) { |
| 2 | module.exports = [ | 2 | module.exports = [ |
| 3 | - { | 3 | + { |
| 4 | + "file": "plugins/com.gaoxiaobang.share/www/Share.js", | ||
| 5 | + "id": "com.gaoxiaobang.share.MSharePlugin", | ||
| 6 | + "clobbers": [ | ||
| 7 | + "cordova.plugins.MSharePlugin" | ||
| 8 | + ] | ||
| 9 | + }, | ||
| 10 | + { | ||
| 4 | "id": "com.gaoxiaobang.browser.MBrowserPlugin", | 11 | "id": "com.gaoxiaobang.browser.MBrowserPlugin", |
| 5 | "file": "plugins/com.gaoxiaobang.browser/www/MBrowser.js", | 12 | "file": "plugins/com.gaoxiaobang.browser/www/MBrowser.js", |
| 6 | "pluginId": "com.gaoxiaobang.browser", | 13 | "pluginId": "com.gaoxiaobang.browser", |
| @@ -8,6 +15,7 @@ module.exports = [ | @@ -8,6 +15,7 @@ module.exports = [ | ||
| 8 | "cordova.plugins.MBrowserPlugin" | 15 | "cordova.plugins.MBrowserPlugin" |
| 9 | ] | 16 | ] |
| 10 | } | 17 | } |
| 18 | + | ||
| 11 | ]; | 19 | ]; |
| 12 | module.exports.metadata = | 20 | module.exports.metadata = |
| 13 | // TOP OF METADATA | 21 | // TOP OF METADATA |
src/js/gbreplayer.js
| @@ -1266,7 +1266,7 @@ $(function(){ | @@ -1266,7 +1266,7 @@ $(function(){ | ||
| 1266 | $("#resultpanel").height($(window).height() - $resultpanel.top - 16 - 34); | 1266 | $("#resultpanel").height($(window).height() - $resultpanel.top - 16 - 34); |
| 1267 | $(".CodeMirror").height($(window).height() - $recordpanel.top - 290); | 1267 | $(".CodeMirror").height($(window).height() - $recordpanel.top - 290); |
| 1268 | } | 1268 | } |
| 1269 | - if (isAndroid) { | 1269 | + if (!IsPC()) { |
| 1270 | $(".CodeMirror").height($(window).height() - $recordpanel.top - 210); | 1270 | $(".CodeMirror").height($(window).height() - $recordpanel.top - 210); |
| 1271 | } | 1271 | } |
| 1272 | $('#resultoutput').find('.tab-content').height($(window).height() - $resultoutput.top - 40).css({'overflow': "auto"}) | 1272 | $('#resultoutput').find('.tab-content').height($(window).height() - $resultoutput.top - 40).css({'overflow': "auto"}) |
| @@ -2048,7 +2048,21 @@ $(function(){ | @@ -2048,7 +2048,21 @@ $(function(){ | ||
| 2048 | } else { | 2048 | } else { |
| 2049 | $('#readonly').trigger('click'); | 2049 | $('#readonly').trigger('click'); |
| 2050 | } | 2050 | } |
| 2051 | + } | ||
| 2052 | + | ||
| 2051 | 2053 | ||
| 2054 | + function IsPC() { | ||
| 2055 | + var userAgentInfo = navigator.userAgent; | ||
| 2056 | + var Agents = ["Android", "iPhone", | ||
| 2057 | + "SymbianOS", "Windows Phone", "iPod"]; | ||
| 2058 | + var flag = true; | ||
| 2059 | + for (var v = 0; v < Agents.length; v++) { | ||
| 2060 | + if (userAgentInfo.indexOf(Agents[v]) > 0) { | ||
| 2061 | + flag = false; | ||
| 2062 | + break; | ||
| 2063 | + } | ||
| 2064 | + } | ||
| 2065 | + return flag; | ||
| 2052 | } | 2066 | } |
| 2053 | 2067 | ||
| 2054 | 2068 |
src/js/plugins/com.gaoxiaobang.share/www/Share.js
0 → 100644
| 1 | +cordova.define("com.gaoxiaobang.share.MSharePlugin", function(require, exports, module) { | ||
| 2 | +/** | ||
| 3 | + * Created by Ryan on 16/2/24. | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | + | ||
| 7 | +var SharePlugin = function(){}; | ||
| 8 | + | ||
| 9 | +var exec = require('cordova/exec'); | ||
| 10 | + | ||
| 11 | +SharePlugin.prototype.share = function(data){ | ||
| 12 | + | ||
| 13 | + alert("调用share"); | ||
| 14 | + | ||
| 15 | + exec(null,null,"MSharePlugin","share",[data]); | ||
| 16 | + | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +SharePlugin.prototype.login = function(data){ | ||
| 20 | + | ||
| 21 | + exec(null,null,"MSharePlugin","login",[data]); | ||
| 22 | + | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | + | ||
| 26 | +if(!window.plugins){ | ||
| 27 | + window.plugins = {}; | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +if(!window.plugins.SharePlugin){ | ||
| 31 | + window.plugins.SharePlugin = new SharePlugin(); | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +module.exports = new SharePlugin(); | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + | ||
| 39 | +}); |
src/player.html
| @@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
| 22 | var gxb_api = "https://restful.gaoxiaobang.com"; | 22 | var gxb_api = "https://restful.gaoxiaobang.com"; |
| 23 | // var gxb_api = "https://restful.gaoxiaobang.com" | 23 | // var gxb_api = "https://restful.gaoxiaobang.com" |
| 24 | </script> | 24 | </script> |
| 25 | - <script src="js/cordova.js"></script> | 25 | + <!-- <script src="js/cordova.js"></script> --> |
| 26 | <!-- <script src="js/MBrowser.js"></script> --> | 26 | <!-- <script src="js/MBrowser.js"></script> --> |
| 27 | <!-- <script src="https://bigbang.gaoxiaobang.com/wx-qa/IOS/cordova.js"></script> --> | 27 | <!-- <script src="https://bigbang.gaoxiaobang.com/wx-qa/IOS/cordova.js"></script> --> |
| 28 | <script src="js/jquery-1.7.1.js"></script> | 28 | <script src="js/jquery-1.7.1.js"></script> |
| @@ -221,7 +221,7 @@ | @@ -221,7 +221,7 @@ | ||
| 221 | padding-top: 0; | 221 | padding-top: 0; |
| 222 | position: absolute; | 222 | position: absolute; |
| 223 | right: 16px; | 223 | right: 16px; |
| 224 | - bottom: 54px; | 224 | + bottom: 86px; |
| 225 | z-index: 9999; | 225 | z-index: 9999; |
| 226 | } | 226 | } |
| 227 | .comprun{ | 227 | .comprun{ |
| @@ -383,14 +383,17 @@ | @@ -383,14 +383,17 @@ | ||
| 383 | <script src="js/gbdebug/mode/python/python.js"></script> | 383 | <script src="js/gbdebug/mode/python/python.js"></script> |
| 384 | <script> | 384 | <script> |
| 385 | $(function(){ | 385 | $(function(){ |
| 386 | + var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; | ||
| 387 | + if (isAndroid) { | ||
| 388 | + $.getScript(".js/cordova.js"); | ||
| 389 | + } | ||
| 386 | $('.back').click(function(){ | 390 | $('.back').click(function(){ |
| 387 | - alert('plugins----') | ||
| 388 | var gobackData = {} | 391 | var gobackData = {} |
| 389 | - plugins.MBrowserPlugin.goback() | 392 | + document.addEventListener("deviceready", function(){ |
| 393 | + plugins.MBrowserPlugin.goback() | ||
| 394 | + }, false) | ||
| 390 | }) | 395 | }) |
| 391 | $('.share').click(function(){ | 396 | $('.share').click(function(){ |
| 392 | - alert('===========') | ||
| 393 | - alert(plugins) | ||
| 394 | var title = getQuery('title'); | 397 | var title = getQuery('title'); |
| 395 | var shareData = { | 398 | var shareData = { |
| 396 | title: title, | 399 | title: title, |