_fw.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. var _FW = {
  2. fCreateClass : function() {
  3. return function() {
  4. this.fInitialize.apply(this, arguments);
  5. };
  6. }
  7. };
  8. /**
  9. * bind函数
  10. * @author: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind
  11. */
  12. if (!Function.prototype.bind) {
  13.   Function.prototype.bind = function (oThis) {
  14.     if (typeof this !== "function") {
  15.       // closest thing possible to the ECMAScript 5 internal IsCallable function
  16.       throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  17.     }
  18.  
  19.     var aArgs = Array.prototype.slice.call(arguments, 1),
  20.         fToBind = this,
  21.         fNOP = function () {},
  22.         fBound = function () {
  23.           return fToBind.apply(this instanceof fNOP && oThis
  24.                                  ? this
  25.                                  : oThis,
  26.                                aArgs.concat(Array.prototype.slice.call(arguments)));
  27.         };
  28.  
  29.     fNOP.prototype = this.prototype;
  30.     fBound.prototype = new fNOP();
  31.  
  32.     return fBound;
  33.   };
  34. }
  35. $(function(){
  36. if("V1" === FW_JS_VERSION){
  37. _FW.oFtl = {
  38. fnGetForm : GetForm,
  39. fnAlert : FWalert,
  40. fnLoadScript : loadScript,
  41. fnGetListData : getListData,
  42. fnShowTable : FWshowTable,
  43. fnInitObject : FWinitObject,
  44. fnMouseDownToResize : FWMouseDownToResize,
  45. fnMouseMoveToResize : FWMouseMoveToResize,
  46. fnMouseUpToResize : FWMouseUpToResize,
  47. fnResizeFWObj : FWresizeObject
  48. }
  49. }else if("V2" === FW_JS_VERSION){
  50. _FW.oFtl = {
  51. fnGetForm : CFW.oGt.fnGetForm.bind(CFW.oGt),
  52. fnAlert : CFW.oWin.fnAlert.bind(CFW.oWin),
  53. fnLoadScript : CFW.oComm.fnLoadScript.bind(CFW.oComm),
  54. fnGetListData : CFW.oGlt.fnGetData.bind(CFW.oGlt),
  55. fnShowTable : CFW.oGt._fnShowTable.bind(CFW.oGt),
  56. fnInitObject : CFW.oGt._fnInitObject.bind(CFW.oGt),
  57. fnMouseDownToResize : CFW.oGlt._fnMouseDownToResize.bind(CFW.oGlt),
  58. fnMouseMoveToResize : CFW.oGlt._fnMouseMoveToResize.bind(CFW.oGlt),
  59. fnMouseUpToResize : CFW.oGlt._fnMouseUpToResize.bind(CFW.oGlt),
  60. fnResizeFWObj : CFW.oGt.fnResizeFWObj.bind(CFW.oGt)
  61. }
  62. }
  63. });