Changeset 99
- Timestamp:
- 08/17/08 20:48:47 (4 months ago)
- Files:
-
- trunk/lily/lily/chrome/content/exporter.js (modified) (11 diffs)
- trunk/lily/lily/chrome/content/lily.js (modified) (2 diffs)
- trunk/lily/lily/chrome/content/utils/core.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lily/lily/chrome/content/exporter.js
r95 r99 316 316 if( !xulOut.exists() || !xulOut.isDirectory() ) { // if it doesn't exist, create 317 317 xulOut.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); 318 } 318 } 319 320 var configIn = contentIn.clone(); 321 configIn.append("config"); 322 323 //create the config directory 324 var configOut = rootDir.clone(); 325 configOut.append("chrome"); 326 configOut.append("content"); 327 configOut.append("config"); 328 329 if(!configOut.exists()) { // if it doesn't exist, create 330 configOut.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); 331 } 319 332 320 333 //apikey … … 332 345 config["extID"] = (projectName+".id@"+projectName+".com"); 333 346 config["openDebugWin"] = (!obj.hideDebugCbx); 334 var tmpOut = contentOut.clone(); 335 tmpOut.append("config"); 347 var tmpOut = configOut.clone(); 336 348 tmpOut.append("config.txt"); 337 349 LilyUtils.writeFile(tmpOut,config.toSource()); … … 392 404 393 405 //keys.txt 394 var tmp = contentIn.clone(); 395 tmp.append("config"); 406 var tmp = configIn.clone(); 396 407 tmp.append("keys.txt"); 397 tmp.copyTo(con tentOut,null);408 tmp.copyTo(configOut,null); 398 409 399 410 //keys.js … … 403 414 404 415 //font-compat.txt 405 var tmp = contentIn.clone(); 406 tmp.append("config"); 416 var tmp = configIn.clone(); 407 417 tmp.append("font-compat.txt"); 408 tmp.copyTo(con tentOut,null);418 tmp.copyTo(configOut,null); 409 419 410 420 //lib … … 443 453 tmp.append("menus.js"); 444 454 tmp.copyTo(contentOut,null); 445 446 // model.js447 var tmp = contentIn.clone(); 448 tmp.append(" model.js");455 456 //external.js 457 var tmp = contentIn.clone(); 458 tmp.append("externals.js"); 449 459 tmp.copyTo(contentOut,null); 450 451 //object.js 452 var tmp = contentIn.clone(); 453 tmp.append("object.js"); 454 tmp.copyTo(contentOut,null); 455 456 //external.js 457 var tmp = contentIn.clone(); 458 tmp.append("externals.js"); 460 461 //object 462 var tmp = contentIn.clone(); 463 tmp.append("object"); 459 464 tmp.copyTo(contentOut,null); 460 461 //patch.js 462 var tmpIn = contentIn.clone(); 463 tmpIn.append("patch.js"); 464 var tmpOut = contentOut.clone(); 465 tmpOut.append("patch.js"); 466 LilyUtils.writeFile(tmpOut,LilyUtils.readFile(tmpIn).replace(/chrome:\/\/lily/g,("chrome://"+projectName))); 467 465 466 //patch 467 var patchArr = [ 468 "model.js", 469 "base.js", 470 "controller.js", 471 "view.js" 472 ]; 473 474 var patchOut = contentOut.clone(); 475 patchOut.append("patch"); 476 477 if( !patchOut.exists() || !patchOut.isDirectory() ) { // if it doesn't exist, create 478 patchOut.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); 479 } 480 481 for(var i=0;i<patchArr.length;i++) { 482 var tmpIn = contentIn.clone(); 483 tmpIn.append("patch"); 484 tmpIn.append(patchArr[i]); 485 486 var tmpOut = contentOut.clone(); 487 tmpOut.append("patch"); 488 tmpOut.append(patchArr[i]); 489 490 var data = LilyUtils.readFile(tmpIn); 491 data = data.replace(/chrome:\/\/lily/g,("chrome://"+projectName)); 492 LilyUtils.writeFile(tmpOut,data); 493 } 494 468 495 //patch.xhtml 469 496 var tmp = contentIn.clone(); … … 747 774 } 748 775 776 var configIn = contentIn.clone(); 777 configIn.append("config"); 778 779 //create the config directory 780 var configOut = rootDir.clone(); 781 configOut.append("chrome"); 782 configOut.append("content"); 783 configOut.append("config"); 784 785 if(!configOut.exists()) { // if it doesn't exist, create 786 configOut.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); 787 } 788 749 789 //apikey 750 790 var tmp = xulIn.clone(); … … 764 804 config["extID"] = emailValue; 765 805 config["openDebugWin"] = (!obj.hideDebugCbx); 766 var tmpOut = contentOut.clone(); 767 tmpOut.append("config"); 806 var tmpOut = configOut.clone(); 768 807 tmpOut.append("config.txt"); 769 808 LilyUtils.writeFile(tmpOut,config.toSource()); … … 830 869 831 870 //keys.txt 832 var tmp = contentIn.clone(); 833 tmp.append("config"); 871 var tmp = configIn.clone(); 834 872 tmp.append("keys.txt"); 835 tmp.copyTo(con tentOut,null);873 tmp.copyTo(configOut,null); 836 874 837 875 //keys.js … … 841 879 842 880 //font-compat.txt 843 var tmp = con tentIn.clone();881 var tmp = configIn.clone(); 844 882 tmp.append("font-compat.txt"); 845 tmp.copyTo(con tentOut,null);883 tmp.copyTo(configOut,null); 846 884 847 885 //lib … … 881 919 tmp.copyTo(contentOut,null); 882 920 883 //model.js884 var tmp = contentIn.clone();885 tmp.append("model.js");886 tmp.copyTo(contentOut,null);887 888 //object.js889 var tmp = contentIn.clone();890 tmp.append("object.js");891 tmp.copyTo(contentOut,null);892 893 921 //external.js 894 922 var tmp = contentIn.clone(); … … 896 924 tmp.copyTo(contentOut,null); 897 925 898 //patch.js 899 var tmpIn = contentIn.clone(); 900 tmpIn.append("patch.js"); 901 var tmpOut = contentOut.clone(); 902 tmpOut.append("patch.js"); 903 LilyUtils.writeFile(tmpOut,LilyUtils.readFile(tmpIn).replace(/chrome:\/\/lily/g,("chrome://"+projectName))); 926 //object 927 var tmp = contentIn.clone(); 928 tmp.append("object"); 929 tmp.copyTo(contentOut,null); 930 931 //patch 932 var patchArr = [ 933 "model.js", 934 "base.js", 935 "controller.js", 936 "view.js" 937 ]; 938 939 var patchOut = contentOut.clone(); 940 patchOut.append("patch"); 941 942 if( !patchOut.exists() || !patchOut.isDirectory() ) { // if it doesn't exist, create 943 patchOut.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); 944 } 945 946 for(var i=0;i<patchArr.length;i++) { 947 var tmpIn = contentIn.clone(); 948 tmpIn.append("patch"); 949 tmpIn.append(patchArr[i]); 950 951 var tmpOut = contentOut.clone(); 952 tmpOut.append("patch"); 953 tmpOut.append(patchArr[i]); 954 955 var data = LilyUtils.readFile(tmpIn); 956 data = data.replace(/chrome:\/\/lily/g,("chrome://"+projectName)); 957 LilyUtils.writeFile(tmpOut,data); 958 } 904 959 905 960 //patch.xhtml trunk/lily/lily/chrome/content/lily.js
r90 r99 880 880 Lily.getCurrentPatch().patchView.xulWin.openDialog("chrome://lily/content/xul/exportDialog.xul", "lilyExportDialog", "chrome,titlebar,toolbar,centerscreen,modal",exportParams); 881 881 882 Lily.getCurrentPatch().patchView.showWindowStatusActivity(true);883 Lily.getCurrentPatch().patchView.setWindowStatusText("Saving as addon...")884 885 882 if(exportParams.saved) { 883 Lily.getCurrentPatch().patchView.showWindowStatusActivity(true); 884 Lily.getCurrentPatch().patchView.setWindowStatusText("Saving as addon...") 886 885 LilyUtils.runInBackGround(function(){ 887 886 LilyPatchExporter.savePatchAsAddOn(exportParams); … … 907 906 Lily.getCurrentPatch().patchView.xulWin.openDialog("chrome://lily/content/xul/exportDialog.xul", "lilyExportDialog", "chrome,titlebar,toolbar,centerscreen,modal",exportParams); 908 907 909 Lily.getCurrentPatch().patchView.showWindowStatusActivity(true);910 Lily.getCurrentPatch().patchView.setWindowStatusText("Saving as app...")911 912 908 if(exportParams.saved) { 909 Lily.getCurrentPatch().patchView.showWindowStatusActivity(true); 910 Lily.getCurrentPatch().patchView.setWindowStatusText("Saving as app...") 913 911 LilyUtils.runInBackGround(function(){ 914 912 LilyPatchExporter.savePatchAsApp(exportParams); trunk/lily/lily/chrome/content/utils/core.js
r96 r99 557 557 main.dispatch(new mainThread(this.threadID, this.result), 558 558 background.DISPATCH_NORMAL); 559 } catch(err) { 560 Components.utils.reportError(err); 559 } catch(e) { 560 Components.utils.reportError(e); 561 LilyDebugWindow.error(e.name+": "+e.message+" line: "+e.lineNumber+" in "+e.fileName); 561 562 } 562 563 }, … … 582 583 // This is where we react to the completion of the working thread. 583 584 cb(this.threadID,this.result); 584 } catch(err) { 585 Components.utils.reportError(err); 585 } catch(e) { 586 Components.utils.reportError(e); 587 LilyDebugWindow.error(e.name+": "+e.message+" line: "+e.lineNumber+" in "+e.fileName); 586 588 } 587 589 },
