1(function (scope) { 2 3 var AppContext = { 4 isHybridApp: function () { 5 return false; 6 }, 7 getVersion: function () { 8 return "0.0.0"; 9 }, 10 callFunction: function (name, options) { 11 if (this[name]) { 12 var args = []; 13 if (options) { 14 args.push(options); 15 } 16 this[name].apply(this, args); 17 } else { 18 throw new Error('custom method "' + name + '" is not found on Teamwork hybird app bridge'); 19 } 20 } 21 }; 22 23 var WebContext = { 24 getVersion: function(){ 25 return "1.0.0"; 26 }, 27 callFunction: function (name, param, callback) { 28 args = []; 29 if(param && param!=="") { 30 args.push(param); 31 } 32 var result = this[name].apply(this, args); 33 if(callback) { 34 param = JSON.stringify(result); 35 AppContext.callFunction(callback,param); 36 } 37 } 38 }; 39 40 41 // ----------------------- 42 var _TW = { 43 AppContext: AppContext, 44 WebContext: WebContext 45 }; 46 if (!scope._TW) { 47 scope._TW = _TW; 48 } else { 49 throw new Error("Can not initial Teamwork hybird app bridge, namespace has been used already."); 50 } 51 52})(window);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.