ace.js 760 B

1234567891011121314151617181920212223
  1. o2.widget = o2.widget || {};
  2. o2.widget.ace = {
  3. //"ace": COMMON.contentPath+"/res/framework/ace/src-min/ace.js",
  4. //"tools": COMMON.contentPath+"/res/framework/ace/src-min/ext-language_tools.js",
  5. "callbackList": [],
  6. "load": function(callback){
  7. if (!window.ace){
  8. this.callbackList.push(callback);
  9. if (!this.isLoadding) {
  10. this.isLoadding = true;
  11. o2.load("ace", {"sequence": true}, function(){
  12. this.isLoadding = false;
  13. while (this.callbackList.length){
  14. this.callbackList.shift()();
  15. }
  16. }.bind(this));
  17. }
  18. }else{
  19. if (callback) callback();
  20. }
  21. }
  22. };