mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Merge branch 'reorg'
This commit is contained in:
commit
b2423530ca
16
Cocoa/.gitignore
vendored
Normal file
16
Cocoa/.gitignore
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
# Xcode
|
||||
build/*
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
*.xcworkspace
|
||||
!default.xcworkspace
|
||||
xcuserdata
|
||||
profile
|
||||
*.moved-aside
|
||||
|
BIN
Cocoa/APPL.icns
Normal file
BIN
Cocoa/APPL.icns
Normal file
Binary file not shown.
@ -7,57 +7,62 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
|
||||
8321C5F11404ADE60029952E /* AtomWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8321C5F01404ADE60029952E /* AtomWindow.xib */; };
|
||||
8321C5F61404ADF00029952E /* AtomicityAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8321C5F31404ADF00029952E /* AtomicityAppDelegate.m */; };
|
||||
8321C5F71404ADF00029952E /* AtomWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8321C5F51404ADF00029952E /* AtomWindowController.m */; };
|
||||
8321C5FB1404AE0C0029952E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8321C5FA1404AE0C0029952E /* main.m */; };
|
||||
832BA38413FE674C00516BD7 /* APPL.icns in Resources */ = {isa = PBXBuildFile; fileRef = 832BA38313FE674C00516BD7 /* APPL.icns */; };
|
||||
83599F9B13FE0F8400AC37E3 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83599F9A13FE0F8400AC37E3 /* WebKit.framework */; };
|
||||
8359A6EE13FE26DA00AC37E3 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8359A6ED13FE26DA00AC37E3 /* JavaScriptCore.framework */; };
|
||||
8359A72213FE270F00AC37E3 /* BridgeSupportController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8359A6F913FE270F00AC37E3 /* BridgeSupportController.m */; };
|
||||
8359A72F13FE270F00AC37E3 /* JSCocoaController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8359A71813FE270F00AC37E3 /* JSCocoaController.m */; };
|
||||
8359A73013FE270F00AC37E3 /* JSCocoaFFIArgument.m in Sources */ = {isa = PBXBuildFile; fileRef = 8359A71A13FE270F00AC37E3 /* JSCocoaFFIArgument.m */; };
|
||||
8359A73113FE270F00AC37E3 /* JSCocoaFFIClosure.m in Sources */ = {isa = PBXBuildFile; fileRef = 8359A71C13FE270F00AC37E3 /* JSCocoaFFIClosure.m */; };
|
||||
8359A73213FE270F00AC37E3 /* JSCocoaLib.m in Sources */ = {isa = PBXBuildFile; fileRef = 8359A71E13FE270F00AC37E3 /* JSCocoaLib.m */; };
|
||||
8359A73313FE270F00AC37E3 /* JSCocoaPrivateObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 8359A72013FE270F00AC37E3 /* JSCocoaPrivateObject.m */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
837D8BA81408FAAA009B6DFA /* AtomicityAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BA51408FAAA009B6DFA /* AtomicityAppDelegate.m */; };
|
||||
837D8BA91408FAAA009B6DFA /* AtomWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BA71408FAAA009B6DFA /* AtomWindowController.m */; };
|
||||
837D8BAC1408FAB4009B6DFA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BAB1408FAB4009B6DFA /* main.m */; };
|
||||
837D8BB41408FAC3009B6DFA /* APPL.icns in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BAD1408FAC3009B6DFA /* APPL.icns */; };
|
||||
837D8BB51408FAC3009B6DFA /* Atomicity-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BAE1408FAC3009B6DFA /* Atomicity-Info.plist */; };
|
||||
837D8BB61408FAC3009B6DFA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BB01408FAC3009B6DFA /* InfoPlist.strings */; };
|
||||
837D8BB71408FAC3009B6DFA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BB21408FAC3009B6DFA /* MainMenu.xib */; };
|
||||
837D8BD51408FAD4009B6DFA /* BridgeSupportController.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BC71408FAD4009B6DFA /* BridgeSupportController.m */; };
|
||||
837D8BD61408FAD4009B6DFA /* class.js in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BC81408FAD4009B6DFA /* class.js */; };
|
||||
837D8BD71408FAD4009B6DFA /* JSCocoaController.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BCB1408FAD4009B6DFA /* JSCocoaController.m */; };
|
||||
837D8BD81408FAD4009B6DFA /* JSCocoaFFIArgument.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BCD1408FAD4009B6DFA /* JSCocoaFFIArgument.m */; };
|
||||
837D8BD91408FAD4009B6DFA /* JSCocoaFFIClosure.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BCF1408FAD4009B6DFA /* JSCocoaFFIClosure.m */; };
|
||||
837D8BDA1408FAD4009B6DFA /* JSCocoaLib.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BD11408FAD4009B6DFA /* JSCocoaLib.m */; };
|
||||
837D8BDB1408FAD4009B6DFA /* JSCocoaPrivateObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BD31408FAD4009B6DFA /* JSCocoaPrivateObject.m */; };
|
||||
837D8BDC1408FAD4009B6DFA /* jslint-jscocoa.js in Sources */ = {isa = PBXBuildFile; fileRef = 837D8BD41408FAD4009B6DFA /* jslint-jscocoa.js */; };
|
||||
837D8BE11408FAF5009B6DFA /* AtomWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BE01408FAF5009B6DFA /* AtomWindow.xib */; };
|
||||
837D8BE91408FB15009B6DFA /* Rakefile in Resources */ = {isa = PBXBuildFile; fileRef = 837D8BE81408FB15009B6DFA /* Rakefile */; };
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
|
||||
1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
256AC3F00F4B6AF500CF3369 /* Atomicity_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Atomicity_Prefix.pch; sourceTree = "<group>"; };
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
8321C5F01404ADE60029952E /* AtomWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = AtomWindow.xib; path = ../Atomicity/xibs/AtomWindow.xib; sourceTree = SOURCE_ROOT; };
|
||||
8321C5F21404ADF00029952E /* AtomicityAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicityAppDelegate.h; path = ../Atomicity/Classes/AtomicityAppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
8321C5F31404ADF00029952E /* AtomicityAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AtomicityAppDelegate.m; path = ../Atomicity/Classes/AtomicityAppDelegate.m; sourceTree = SOURCE_ROOT; };
|
||||
8321C5F41404ADF00029952E /* AtomWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomWindowController.h; path = ../Atomicity/Classes/AtomWindowController.h; sourceTree = SOURCE_ROOT; };
|
||||
8321C5F51404ADF00029952E /* AtomWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AtomWindowController.m; path = ../Atomicity/Classes/AtomWindowController.m; sourceTree = SOURCE_ROOT; };
|
||||
8321C5FA1404AE0C0029952E /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ../Atomicity/main.m; sourceTree = SOURCE_ROOT; };
|
||||
832BA38313FE674C00516BD7 /* APPL.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = APPL.icns; sourceTree = "<group>"; };
|
||||
83599F9A13FE0F8400AC37E3 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
|
||||
8359A6ED13FE26DA00AC37E3 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
|
||||
8359A6F813FE270F00AC37E3 /* BridgeSupportController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgeSupportController.h; sourceTree = "<group>"; };
|
||||
8359A6F913FE270F00AC37E3 /* BridgeSupportController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BridgeSupportController.m; sourceTree = "<group>"; };
|
||||
8359A6FA13FE270F00AC37E3 /* class.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = class.js; sourceTree = "<group>"; };
|
||||
8359A71313FE270F00AC37E3 /* JSCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoa.h; sourceTree = "<group>"; };
|
||||
8359A71713FE270F00AC37E3 /* JSCocoaController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaController.h; sourceTree = "<group>"; };
|
||||
8359A71813FE270F00AC37E3 /* JSCocoaController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaController.m; sourceTree = "<group>"; };
|
||||
8359A71913FE270F00AC37E3 /* JSCocoaFFIArgument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaFFIArgument.h; sourceTree = "<group>"; };
|
||||
8359A71A13FE270F00AC37E3 /* JSCocoaFFIArgument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaFFIArgument.m; sourceTree = "<group>"; };
|
||||
8359A71B13FE270F00AC37E3 /* JSCocoaFFIClosure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaFFIClosure.h; sourceTree = "<group>"; };
|
||||
8359A71C13FE270F00AC37E3 /* JSCocoaFFIClosure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaFFIClosure.m; sourceTree = "<group>"; };
|
||||
8359A71D13FE270F00AC37E3 /* JSCocoaLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaLib.h; sourceTree = "<group>"; };
|
||||
8359A71E13FE270F00AC37E3 /* JSCocoaLib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaLib.m; sourceTree = "<group>"; };
|
||||
8359A71F13FE270F00AC37E3 /* JSCocoaPrivateObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaPrivateObject.h; sourceTree = "<group>"; };
|
||||
8359A72013FE270F00AC37E3 /* JSCocoaPrivateObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaPrivateObject.m; sourceTree = "<group>"; };
|
||||
8359A72113FE270F00AC37E3 /* jslint-jscocoa.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "jslint-jscocoa.js"; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* Atomicity-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Atomicity-Info.plist"; sourceTree = "<group>"; };
|
||||
837D8BA41408FAAA009B6DFA /* AtomicityAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicityAppDelegate.h; path = ../../Atomicity/Cocoa/Classes/AtomicityAppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
837D8BA51408FAAA009B6DFA /* AtomicityAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AtomicityAppDelegate.m; path = ../../Atomicity/Cocoa/Classes/AtomicityAppDelegate.m; sourceTree = SOURCE_ROOT; };
|
||||
837D8BA61408FAAA009B6DFA /* AtomWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomWindowController.h; path = ../../Atomicity/Cocoa/Classes/AtomWindowController.h; sourceTree = SOURCE_ROOT; };
|
||||
837D8BA71408FAAA009B6DFA /* AtomWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AtomWindowController.m; path = ../../Atomicity/Cocoa/Classes/AtomWindowController.m; sourceTree = SOURCE_ROOT; };
|
||||
837D8BAA1408FAB4009B6DFA /* Atomicity_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Atomicity_Prefix.pch; path = ../../Atomicity/Cocoa/Atomicity_Prefix.pch; sourceTree = SOURCE_ROOT; };
|
||||
837D8BAB1408FAB4009B6DFA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ../../Atomicity/Cocoa/main.m; sourceTree = SOURCE_ROOT; };
|
||||
837D8BAD1408FAC3009B6DFA /* APPL.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = APPL.icns; path = ../../Atomicity/Cocoa/APPL.icns; sourceTree = SOURCE_ROOT; };
|
||||
837D8BAE1408FAC3009B6DFA /* Atomicity-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Atomicity-Info.plist"; path = "../../Atomicity/Cocoa/Atomicity-Info.plist"; sourceTree = SOURCE_ROOT; };
|
||||
837D8BB11408FAC3009B6DFA /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = InfoPlist.strings; sourceTree = "<group>"; };
|
||||
837D8BB31408FAC3009B6DFA /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = MainMenu.xib; sourceTree = "<group>"; };
|
||||
837D8BC61408FAD4009B6DFA /* BridgeSupportController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgeSupportController.h; sourceTree = "<group>"; };
|
||||
837D8BC71408FAD4009B6DFA /* BridgeSupportController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BridgeSupportController.m; sourceTree = "<group>"; };
|
||||
837D8BC81408FAD4009B6DFA /* class.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = class.js; sourceTree = "<group>"; };
|
||||
837D8BC91408FAD4009B6DFA /* JSCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoa.h; sourceTree = "<group>"; };
|
||||
837D8BCA1408FAD4009B6DFA /* JSCocoaController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaController.h; sourceTree = "<group>"; };
|
||||
837D8BCB1408FAD4009B6DFA /* JSCocoaController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaController.m; sourceTree = "<group>"; };
|
||||
837D8BCC1408FAD4009B6DFA /* JSCocoaFFIArgument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaFFIArgument.h; sourceTree = "<group>"; };
|
||||
837D8BCD1408FAD4009B6DFA /* JSCocoaFFIArgument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaFFIArgument.m; sourceTree = "<group>"; };
|
||||
837D8BCE1408FAD4009B6DFA /* JSCocoaFFIClosure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaFFIClosure.h; sourceTree = "<group>"; };
|
||||
837D8BCF1408FAD4009B6DFA /* JSCocoaFFIClosure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaFFIClosure.m; sourceTree = "<group>"; };
|
||||
837D8BD01408FAD4009B6DFA /* JSCocoaLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaLib.h; sourceTree = "<group>"; };
|
||||
837D8BD11408FAD4009B6DFA /* JSCocoaLib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaLib.m; sourceTree = "<group>"; };
|
||||
837D8BD21408FAD4009B6DFA /* JSCocoaPrivateObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCocoaPrivateObject.h; sourceTree = "<group>"; };
|
||||
837D8BD31408FAD4009B6DFA /* JSCocoaPrivateObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSCocoaPrivateObject.m; sourceTree = "<group>"; };
|
||||
837D8BD41408FAD4009B6DFA /* jslint-jscocoa.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "jslint-jscocoa.js"; sourceTree = "<group>"; };
|
||||
837D8BE01408FAF5009B6DFA /* AtomWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = AtomWindow.xib; path = ../../Atomicity/Cocoa/xibs/AtomWindow.xib; sourceTree = SOURCE_ROOT; };
|
||||
837D8BE81408FB15009B6DFA /* Rakefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Rakefile; path = ../../Atomicity/Rakefile; sourceTree = SOURCE_ROOT; };
|
||||
8D1107320486CEB800E47090 /* Atomicity.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Atomicity.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
@ -78,10 +83,10 @@
|
||||
080E96DDFE201D6D7F000001 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8321C5F21404ADF00029952E /* AtomicityAppDelegate.h */,
|
||||
8321C5F31404ADF00029952E /* AtomicityAppDelegate.m */,
|
||||
8321C5F41404ADF00029952E /* AtomWindowController.h */,
|
||||
8321C5F51404ADF00029952E /* AtomWindowController.m */,
|
||||
837D8BA41408FAAA009B6DFA /* AtomicityAppDelegate.h */,
|
||||
837D8BA51408FAAA009B6DFA /* AtomicityAppDelegate.m */,
|
||||
837D8BA61408FAAA009B6DFA /* AtomWindowController.h */,
|
||||
837D8BA71408FAAA009B6DFA /* AtomWindowController.m */,
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */,
|
||||
);
|
||||
name = Classes;
|
||||
@ -120,7 +125,7 @@
|
||||
children = (
|
||||
080E96DDFE201D6D7F000001 /* Classes */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
8359A6F713FE270F00AC37E3 /* JSCocoa */,
|
||||
837D8BC51408FAD4009B6DFA /* JSCocoa */,
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */,
|
||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||
);
|
||||
@ -130,8 +135,9 @@
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
256AC3F00F4B6AF500CF3369 /* Atomicity_Prefix.pch */,
|
||||
8321C5FA1404AE0C0029952E /* main.m */,
|
||||
837D8BE81408FB15009B6DFA /* Rakefile */,
|
||||
837D8BAA1408FAB4009B6DFA /* Atomicity_Prefix.pch */,
|
||||
837D8BAB1408FAB4009B6DFA /* main.m */,
|
||||
);
|
||||
name = "Other Sources";
|
||||
sourceTree = "<group>";
|
||||
@ -139,11 +145,11 @@
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
832BA38313FE674C00516BD7 /* APPL.icns */,
|
||||
8D1107310486CEB800E47090 /* Atomicity-Info.plist */,
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
|
||||
1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
|
||||
8321C5F01404ADE60029952E /* AtomWindow.xib */,
|
||||
837D8BAD1408FAC3009B6DFA /* APPL.icns */,
|
||||
837D8BAE1408FAC3009B6DFA /* Atomicity-Info.plist */,
|
||||
837D8BB01408FAC3009B6DFA /* InfoPlist.strings */,
|
||||
837D8BE01408FAF5009B6DFA /* AtomWindow.xib */,
|
||||
837D8BB21408FAC3009B6DFA /* MainMenu.xib */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
@ -157,27 +163,28 @@
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8359A6F713FE270F00AC37E3 /* JSCocoa */ = {
|
||||
837D8BC51408FAD4009B6DFA /* JSCocoa */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8359A6F813FE270F00AC37E3 /* BridgeSupportController.h */,
|
||||
8359A6F913FE270F00AC37E3 /* BridgeSupportController.m */,
|
||||
8359A6FA13FE270F00AC37E3 /* class.js */,
|
||||
8359A71313FE270F00AC37E3 /* JSCocoa.h */,
|
||||
8359A71713FE270F00AC37E3 /* JSCocoaController.h */,
|
||||
8359A71813FE270F00AC37E3 /* JSCocoaController.m */,
|
||||
8359A71913FE270F00AC37E3 /* JSCocoaFFIArgument.h */,
|
||||
8359A71A13FE270F00AC37E3 /* JSCocoaFFIArgument.m */,
|
||||
8359A71B13FE270F00AC37E3 /* JSCocoaFFIClosure.h */,
|
||||
8359A71C13FE270F00AC37E3 /* JSCocoaFFIClosure.m */,
|
||||
8359A71D13FE270F00AC37E3 /* JSCocoaLib.h */,
|
||||
8359A71E13FE270F00AC37E3 /* JSCocoaLib.m */,
|
||||
8359A71F13FE270F00AC37E3 /* JSCocoaPrivateObject.h */,
|
||||
8359A72013FE270F00AC37E3 /* JSCocoaPrivateObject.m */,
|
||||
8359A72113FE270F00AC37E3 /* jslint-jscocoa.js */,
|
||||
837D8BC61408FAD4009B6DFA /* BridgeSupportController.h */,
|
||||
837D8BC71408FAD4009B6DFA /* BridgeSupportController.m */,
|
||||
837D8BC81408FAD4009B6DFA /* class.js */,
|
||||
837D8BC91408FAD4009B6DFA /* JSCocoa.h */,
|
||||
837D8BCA1408FAD4009B6DFA /* JSCocoaController.h */,
|
||||
837D8BCB1408FAD4009B6DFA /* JSCocoaController.m */,
|
||||
837D8BCC1408FAD4009B6DFA /* JSCocoaFFIArgument.h */,
|
||||
837D8BCD1408FAD4009B6DFA /* JSCocoaFFIArgument.m */,
|
||||
837D8BCE1408FAD4009B6DFA /* JSCocoaFFIClosure.h */,
|
||||
837D8BCF1408FAD4009B6DFA /* JSCocoaFFIClosure.m */,
|
||||
837D8BD01408FAD4009B6DFA /* JSCocoaLib.h */,
|
||||
837D8BD11408FAD4009B6DFA /* JSCocoaLib.m */,
|
||||
837D8BD21408FAD4009B6DFA /* JSCocoaPrivateObject.h */,
|
||||
837D8BD31408FAD4009B6DFA /* JSCocoaPrivateObject.m */,
|
||||
837D8BD41408FAD4009B6DFA /* jslint-jscocoa.js */,
|
||||
);
|
||||
path = JSCocoa;
|
||||
sourceTree = "<group>";
|
||||
name = JSCocoa;
|
||||
path = ../../Atomicity/Cocoa/JSCocoa;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
@ -218,7 +225,7 @@
|
||||
);
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* Atomicity */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
projectRoot = Cocoa;
|
||||
targets = (
|
||||
8D1107260486CEB800E47090 /* Atomicity */,
|
||||
);
|
||||
@ -230,10 +237,12 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
|
||||
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
|
||||
832BA38413FE674C00516BD7 /* APPL.icns in Resources */,
|
||||
8321C5F11404ADE60029952E /* AtomWindow.xib in Resources */,
|
||||
837D8BB41408FAC3009B6DFA /* APPL.icns in Resources */,
|
||||
837D8BB51408FAC3009B6DFA /* Atomicity-Info.plist in Resources */,
|
||||
837D8BB61408FAC3009B6DFA /* InfoPlist.strings in Resources */,
|
||||
837D8BB71408FAC3009B6DFA /* MainMenu.xib in Resources */,
|
||||
837D8BE11408FAF5009B6DFA /* AtomWindow.xib in Resources */,
|
||||
837D8BE91408FB15009B6DFA /* Rakefile in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -252,7 +261,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"$PROJECT_DIR/script/compile.sh\" ";
|
||||
shellScript = "rake build";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
@ -262,35 +271,39 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8359A72213FE270F00AC37E3 /* BridgeSupportController.m in Sources */,
|
||||
8359A72F13FE270F00AC37E3 /* JSCocoaController.m in Sources */,
|
||||
8359A73013FE270F00AC37E3 /* JSCocoaFFIArgument.m in Sources */,
|
||||
8359A73113FE270F00AC37E3 /* JSCocoaFFIClosure.m in Sources */,
|
||||
8359A73213FE270F00AC37E3 /* JSCocoaLib.m in Sources */,
|
||||
8359A73313FE270F00AC37E3 /* JSCocoaPrivateObject.m in Sources */,
|
||||
8321C5F61404ADF00029952E /* AtomicityAppDelegate.m in Sources */,
|
||||
8321C5F71404ADF00029952E /* AtomWindowController.m in Sources */,
|
||||
8321C5FB1404AE0C0029952E /* main.m in Sources */,
|
||||
837D8BA81408FAAA009B6DFA /* AtomicityAppDelegate.m in Sources */,
|
||||
837D8BA91408FAAA009B6DFA /* AtomWindowController.m in Sources */,
|
||||
837D8BAC1408FAB4009B6DFA /* main.m in Sources */,
|
||||
837D8BD51408FAD4009B6DFA /* BridgeSupportController.m in Sources */,
|
||||
837D8BD61408FAD4009B6DFA /* class.js in Sources */,
|
||||
837D8BD71408FAD4009B6DFA /* JSCocoaController.m in Sources */,
|
||||
837D8BD81408FAD4009B6DFA /* JSCocoaFFIArgument.m in Sources */,
|
||||
837D8BD91408FAD4009B6DFA /* JSCocoaFFIClosure.m in Sources */,
|
||||
837D8BDA1408FAD4009B6DFA /* JSCocoaLib.m in Sources */,
|
||||
837D8BDB1408FAD4009B6DFA /* JSCocoaPrivateObject.m in Sources */,
|
||||
837D8BDC1408FAD4009B6DFA /* jslint-jscocoa.js in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
|
||||
837D8BB01408FAC3009B6DFA /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C165DFE840E0CC02AAC07 /* English */,
|
||||
837D8BB11408FAC3009B6DFA /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
path = ../../Atomicity/Cocoa/English.lproj;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = {
|
||||
837D8BB21408FAC3009B6DFA /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
1DDD58150DA1D0A300B32029 /* English */,
|
||||
837D8BB31408FAC3009B6DFA /* English */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
path = ../../Atomicity/Cocoa/English.lproj;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
@ -343,13 +356,13 @@
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "";
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = (
|
||||
"-lxml2",
|
||||
"-lffi",
|
||||
);
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@ -360,12 +373,12 @@
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "";
|
||||
OTHER_LDFLAGS = (
|
||||
"-lxml2",
|
||||
"-lffi",
|
||||
);
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
};
|
||||
name = Release;
|
||||
};
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
// Created by Chris Wanstrath on 8/22/11.
|
||||
// Copyright 2011 GitHub. All rights reserved.
|
||||
//
|
||||
//`
|
||||
|
||||
#import "AtomWindowController.h"
|
||||
|
||||
@ -27,24 +27,23 @@
|
||||
[self setShouldCascadeWindows:YES];
|
||||
[self setWindowFrameAutosaveName:@"atomWindow"];
|
||||
|
||||
[webView setFrameLoadDelegate:self];
|
||||
|
||||
if (self.URL) {
|
||||
[webView setMainFrameURL:self.URL];
|
||||
} else {
|
||||
NSURL *bundleURL = [[NSBundle mainBundle] resourceURL];
|
||||
NSURL *htmlURL = [bundleURL URLByAppendingPathComponent:@"HTML"];
|
||||
}
|
||||
else {
|
||||
NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
|
||||
NSString *bootstrapPath = [resourcePath stringByAppendingString:@"/src/bootstrap.js"];
|
||||
JSCocoa* jsc = [[JSCocoa alloc] initWithGlobalContext:[[webView mainFrame] globalContext]];
|
||||
[jsc setObject:self withName:@"WindowController"];
|
||||
[jsc evalJSFile:bootstrapPath];
|
||||
|
||||
NSURL *resourceURL = [[NSBundle mainBundle] resourceURL];
|
||||
NSURL *htmlURL = [resourceURL URLByAppendingPathComponent:@"static"];
|
||||
NSURL *indexURL = [htmlURL URLByAppendingPathComponent:@"index.html"];
|
||||
NSString *html = [NSString stringWithContentsOfURL:indexURL encoding:NSUTF8StringEncoding error:nil];
|
||||
[[webView mainFrame] loadHTMLString:html baseURL:htmlURL];
|
||||
[[webView mainFrame] loadHTMLString:html baseURL:htmlURL];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame {
|
||||
// https://github.com/parmanoir/jscocoa#readme
|
||||
JSCocoa* jsc = [[JSCocoa alloc] initWithGlobalContext:[frame globalContext]];
|
||||
[jsc setObject:self withName:@"WindowController"];
|
||||
}
|
||||
|
||||
|
||||
@end
|
@ -20,10 +20,8 @@
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
||||
NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
|
||||
NSString *bootstrapPath = [resourcePath stringByAppendingString:@"/HTML/lib/bootstrap.js"];
|
||||
JSCocoa* jsc = [[JSCocoa alloc] init];
|
||||
[jsc evalJSFile:bootstrapPath];
|
||||
id c = [[AtomWindowController alloc] initWithWindowNibName:@"AtomWindow"];
|
||||
[c window];
|
||||
}
|
||||
|
||||
@end
|
@ -261,18 +261,20 @@ const JSClassDefinition kJSClassDefinitionEmpty = { 0, 0,
|
||||
[self setObjectNoRetain:self withName:@"__jsc__" attributes:kJSPropertyAttributeReadOnly|kJSPropertyAttributeDontEnum|kJSPropertyAttributeDontDelete];
|
||||
|
||||
// Load class kit
|
||||
if (!_ctx)
|
||||
{
|
||||
useJSLint = NO;
|
||||
id lintPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"jslint-jscocoa" ofType:@"js"];
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:lintPath]) {
|
||||
BOOL b = [self evalJSFile:lintPath];
|
||||
if (!b)
|
||||
NSLog(@"[JSCocoa initWithGlobalContext:] JSLint not loaded");
|
||||
}
|
||||
id classKitPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"class" ofType:@"js"];
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:classKitPath]) [self evalJSFile:classKitPath];
|
||||
}
|
||||
BOOL b;
|
||||
useJSLint = NO;
|
||||
id lintPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"jslint-jscocoa" ofType:@"js"];
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:lintPath]) {
|
||||
b = [self evalJSFile:lintPath];
|
||||
if (!b)
|
||||
NSLog(@"[JSCocoa initWithGlobalContext:] JSLint not loaded");
|
||||
}
|
||||
id classKitPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"class" ofType:@"js"];
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:classKitPath]) {
|
||||
b = [self evalJSFile:classKitPath];
|
||||
if (!b)
|
||||
NSLog(@"[JSCocoa initWithGlobalContext:] class.js not loaded");
|
||||
}
|
||||
|
||||
// Objects can use their own dealloc, normally used up by JSCocoa
|
||||
// JSCocoa registers 'safeDealloc' in place of 'dealloc' and calls it in the next run loop cycle.
|
@ -4,10 +4,10 @@
|
||||
var YES = true
|
||||
var NO = false
|
||||
|
||||
|
||||
var ctx = this
|
||||
if ('OSX' in this)
|
||||
{
|
||||
var JSCocoaController = OSX.JSCocoaController
|
||||
ctx = OSX
|
||||
var NSApp = null
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
{
|
||||
var t = types[i]
|
||||
// use new String to convert from a boxed NSString to a Javascript string
|
||||
encodings[t] = new String(JSCocoaFFIArgument.typeEncodingForType_(t))
|
||||
encodings[t] = new String(ctx.JSCocoaFFIArgument.typeEncodingForType_(t))
|
||||
}
|
||||
encodings['charpointer'] = encodings['char*']
|
||||
encodings['IBAction'] = encodings['void']
|
||||
@ -56,7 +56,7 @@
|
||||
if (encoding.match(/struct \w+/))
|
||||
{
|
||||
var structureName = encoding.split(' ')[1]
|
||||
var structureEncoding = JSCocoaFFIArgument.structureFullTypeEncodingFromStructureName(structureName)
|
||||
var structureEncoding = ctx.JSCocoaFFIArgument.structureFullTypeEncodingFromStructureName(structureName)
|
||||
if (!structureEncoding) throw 'no encoding found for structure ' + structureName
|
||||
|
||||
//
|
||||
@ -66,7 +66,7 @@
|
||||
// becomes
|
||||
// {_NSPoint=ff}
|
||||
//
|
||||
// JSCocoaController.log('*' + structureEncoding + '*' + String(String(structureEncoding).replace(/"[^"]+"/gi, "")) + '*')
|
||||
// ctx.JSCocoaController.log('*' + structureEncoding + '*' + String(String(structureEncoding).replace(/"[^"]+"/gi, "")) + '*')
|
||||
return String(String(structureEncoding).replace(/"[^"]+"/gi, ""))
|
||||
}
|
||||
else
|
||||
@ -102,7 +102,7 @@
|
||||
}
|
||||
}
|
||||
// Structure ?
|
||||
var structureEncoding = JSCocoaFFIArgument.structureFullTypeEncodingFromStructureName(encoding)
|
||||
var structureEncoding = ctx.JSCocoaFFIArgument.structureFullTypeEncodingFromStructureName(encoding)
|
||||
if (structureEncoding) return String(String(structureEncoding).replace(/"[^"]+"/gi, ""))
|
||||
throw 'invalid encoding : "' + encoding + '"'
|
||||
}
|
||||
@ -162,22 +162,22 @@
|
||||
// Get parent class
|
||||
var parentClass = this[parentClassName]
|
||||
if (!parentClass) throw 'Parent class ' + parentClassName + ' not found'
|
||||
// JSCocoaController.log('parentclass=' + parentClass)
|
||||
// ctx.JSCocoaController.log('parentclass=' + parentClass)
|
||||
|
||||
var newClass = JSCocoa.createClass_parentClass_(className, parentClassName)
|
||||
var newClass = ctx.JSCocoa.createClass_parentClass_(className, parentClassName)
|
||||
for (var method in methods)
|
||||
{
|
||||
var isInstanceMethod = parentClass.instancesRespondToSelector(method)
|
||||
var isOverload = parentClass.respondsToSelector(method) || isInstanceMethod
|
||||
// JSCocoaController.log('adding method *' + method + '* to ' + className + ' isOverload=' + isOverload + ' isInstanceMethod=' + isInstanceMethod)
|
||||
// ctx.JSCocoaController.log('adding method *' + method + '* to ' + className + ' isOverload=' + isOverload + ' isInstanceMethod=' + isInstanceMethod)
|
||||
|
||||
if (isOverload)
|
||||
{
|
||||
var fn = methods[method]
|
||||
if (!fn || (typeof fn) != 'function') throw '(overloading) Method ' + method + ' not a function - when overloading, omit encodings as they will be inferred from the existing method'
|
||||
|
||||
if (isInstanceMethod) JSCocoa.overloadInstanceMethod_class_jsFunction_(method, newClass, fn)
|
||||
else JSCocoa.overloadClassMethod_class_jsFunction_(method, newClass, fn)
|
||||
if (isInstanceMethod) ctx.JSCocoa.overloadInstanceMethod_class_jsFunction_(method, newClass, fn)
|
||||
else ctx.JSCocoa.overloadClassMethod_class_jsFunction_(method, newClass, fn)
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -246,12 +246,12 @@
|
||||
if (typeof setter != 'function') throw 'outlet setter not a function (' + setter + ')'
|
||||
fn = setter
|
||||
}
|
||||
JSCocoa.addInstanceMethod_class_jsFunction_encoding_(outletMethod, newClass, fn, encoding)
|
||||
ctx.JSCocoa.addInstanceMethod_class_jsFunction_encoding_(outletMethod, newClass, fn, encoding)
|
||||
|
||||
var fn = new Function('return this.JSValueForJSName("_' + name + '")')
|
||||
var fn = new Function('return this.ctx.JSValueForJSName("_' + name + '")')
|
||||
var encoding = objc_encoding('id')
|
||||
|
||||
JSCocoa.addInstanceMethod_class_jsFunction_encoding_(name, newClass, fn, encoding)
|
||||
ctx.JSCocoa.addInstanceMethod_class_jsFunction_encoding_(name, newClass, fn, encoding)
|
||||
}
|
||||
|
||||
//
|
||||
@ -261,7 +261,7 @@
|
||||
{
|
||||
if (name.charAt(name.length-1) != ':') name += ':'
|
||||
var encoding = objc_encoding('void', 'id')
|
||||
JSCocoa.addInstanceMethod_class_jsFunction_encoding_(name, newClass, fn, encoding)
|
||||
ctx.JSCocoa.addInstanceMethod_class_jsFunction_encoding_(name, newClass, fn, encoding)
|
||||
}
|
||||
|
||||
//
|
||||
@ -270,13 +270,13 @@
|
||||
function class_add_key(newClass, name, getter, setter)
|
||||
{
|
||||
// Get
|
||||
var fn = new Function('return this.JSValueForJSName("_' + name + '")')
|
||||
var fn = new Function('return this.ctx.JSValueForJSName("_' + name + '")')
|
||||
if (getter)
|
||||
{
|
||||
if (typeof getter != 'function') throw 'key getter not a function (' + getter + ')'
|
||||
fn = getter
|
||||
}
|
||||
JSCocoa.addInstanceMethod_class_jsFunction_encoding_(name, newClass, fn, objc_encoding('id'))
|
||||
ctx.JSCocoa.addInstanceMethod_class_jsFunction_encoding_(name, newClass, fn, objc_encoding('id'))
|
||||
|
||||
// Set
|
||||
var setMethod = 'set' + name.substr(0, 1).toUpperCase() + name.substr(1) + ':'
|
||||
@ -287,7 +287,7 @@
|
||||
if (typeof setter != 'function') throw 'key setter not a function (' + setter + ')'
|
||||
fn = setter
|
||||
}
|
||||
JSCocoa.addInstanceMethod_class_jsFunction_encoding_(setMethod, newClass, fn, objc_encoding('void', 'id'))
|
||||
ctx.JSCocoa.addInstanceMethod_class_jsFunction_encoding_(setMethod, newClass, fn, objc_encoding('void', 'id'))
|
||||
}
|
||||
|
||||
//
|
||||
@ -295,14 +295,14 @@
|
||||
//
|
||||
function class_add_instance_method(newClass, name, fn, encoding)
|
||||
{
|
||||
JSCocoa.addInstanceMethod_class_jsFunction_encoding_(name, newClass, fn, encoding)
|
||||
ctx.JSCocoa.addInstanceMethod_class_jsFunction_encoding_(name, newClass, fn, encoding)
|
||||
}
|
||||
//
|
||||
// Vanilla class method add. Wrapper for JSCocoaController's addClassMethod
|
||||
//
|
||||
function class_add_class_method(newClass, name, fn, encoding)
|
||||
{
|
||||
JSCocoa.addClassMethod_class_jsFunction_encoding_(name, newClass, fn, encoding)
|
||||
ctx.JSCocoa.addClassMethod_class_jsFunction_encoding_(name, newClass, fn, encoding)
|
||||
}
|
||||
|
||||
//
|
||||
@ -310,11 +310,11 @@
|
||||
//
|
||||
function class_swizzle_instance_method(newClass, name, fn)
|
||||
{
|
||||
JSCocoa.swizzleInstanceMethod_class_jsFunction_(name, newClass, fn)
|
||||
ctx.JSCocoa.swizzleInstanceMethod_class_jsFunction_(name, newClass, fn)
|
||||
}
|
||||
function class_swizzle_class_method(newClass, name, fn)
|
||||
{
|
||||
JSCocoa.swizzleClassMethod_class_jsFunction_(name, newClass, fn)
|
||||
ctx.JSCocoa.swizzleClassMethod_class_jsFunction_(name, newClass, fn)
|
||||
}
|
||||
|
||||
//
|
||||
@ -371,7 +371,7 @@
|
||||
// Get parent class
|
||||
var parentClass = this[parentClassName]
|
||||
if (!parentClass) throw 'Parent class ' + parentClassName + ' not found'
|
||||
var newClass = JSCocoa.createClass_parentClass_(className, parentClassName)
|
||||
var newClass = ctx.JSCocoa.createClass_parentClass_(className, parentClassName)
|
||||
}
|
||||
|
||||
// Add outlets, actions and keys before methods as methods could override outlet setters and getters
|
||||
@ -402,7 +402,7 @@
|
||||
// log('method.type=' + h.methods[method].type + ' ' + method)
|
||||
var isInstanceMethod = parentClass ? parentClass.instancesRespondToSelector(method) : false
|
||||
var isOverload = parentClass ? parentClass.respondsToSelector(method) || isInstanceMethod : false
|
||||
// JSCocoaController.log('adding method *' + method + '* to ' + className + ' isOverload=' + isOverload + ' isInstanceMethod=' + isInstanceMethod)
|
||||
// ctx.JSCocoaController.log('adding method *' + method + '* to ' + className + ' isOverload=' + isOverload + ' isInstanceMethod=' + isInstanceMethod)
|
||||
|
||||
// Swizzling cancels overloading
|
||||
if (h.methods[method].swizzle)
|
||||
@ -418,8 +418,8 @@
|
||||
var fn = h.methods[method].fn
|
||||
if (!fn || (typeof fn) != 'function') throw 'Method ' + method + ' not a function'
|
||||
|
||||
if (isInstanceMethod) JSCocoa.overloadInstanceMethod_class_jsFunction_(method, newClass, fn)
|
||||
else JSCocoa.overloadClassMethod_class_jsFunction_(method, newClass, fn)
|
||||
if (isInstanceMethod) ctx.JSCocoa.overloadInstanceMethod_class_jsFunction_(method, newClass, fn)
|
||||
else ctx.JSCocoa.overloadClassMethod_class_jsFunction_(method, newClass, fn)
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -591,9 +591,9 @@
|
||||
{
|
||||
// Derive to store some javascript data in the internal hash
|
||||
if (!('outArgument2' in this))
|
||||
JSCocoa.createClass_parentClass_('JSCocoaOutArgument2', 'JSCocoaOutArgument')
|
||||
ctx.JSCocoa.createClass_parentClass_('JSCocoaOutArgument2', 'JSCocoaOutArgument')
|
||||
|
||||
var o = JSCocoaOutArgument2.instance
|
||||
var o = ctx.JSCocoaOutArgument2.instance
|
||||
o.isOutArgument = true
|
||||
if (arguments.length == 2) o.mateWithMemoryBuffer_atIndex_(arguments[0], arguments[1])
|
||||
|
||||
@ -603,7 +603,7 @@
|
||||
|
||||
function memoryBuffer(types)
|
||||
{
|
||||
var o = JSCocoaMemoryBuffer.instanceWithTypes(types)
|
||||
var o = ctx.JSCocoaMemoryBuffer.instanceWithTypes(types)
|
||||
o.isOutArgument = true
|
||||
return o
|
||||
}
|
17702
HTML/ace/ace.js
17702
HTML/ace/ace.js
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
define("ace/keyboard/keybinding/emacs",["require","exports","module","ace/keyboard/state_handler"],function(a,b,c){var d=a("ace/keyboard/state_handler").StateHandler,e=a("ace/keyboard/state_handler").matchCharacterOnly,f={start:[{key:"ctrl-x",then:"c-x"},{regex:["(?:command-([0-9]*))*","(down|ctrl-n)"],exec:"golinedown",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(right|ctrl-f)"],exec:"gotoright",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(up|ctrl-p)"],exec:"golineup",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(left|ctrl-b)"],exec:"gotoleft",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{comment:"This binding matches all printable characters except numbers as long as they are no numbers and print them n times.",regex:["(?:command-([0-9]*))","([^0-9]+)*"],match:e,exec:"inserttext",params:[{name:"times",match:1,type:"number",defaultValue:"1"},{name:"text",match:2}]},{comment:"This binding matches numbers as long as there is no meta_number in the buffer.",regex:["(command-[0-9]*)*","([0-9]+)"],match:e,disallowMatches:[1],exec:"inserttext",params:[{name:"text",match:2,type:"text"}]},{regex:["command-([0-9]*)","(command-[0-9]|[0-9])"],comment:"Stops execution if the regex /meta_[0-9]+/ matches to avoid resetting the buffer."}],"c-x":[{key:"ctrl-g",then:"start"},{key:"ctrl-s",exec:"save",then:"start"}]};b.Emacs=new d(f)}),define("ace/keyboard/state_handler",["require","exports","module"],function(a,b,c){function e(a){this.keymapping=this.$buildKeymappingRegex(a)}var d=!1;e.prototype={$buildKeymappingRegex:function(a){for(state in a)this.$buildBindingsRegex(a[state]);return a},$buildBindingsRegex:function(a){a.forEach(function(a){a.key?a.key=new RegExp("^"+a.key+"$"):Array.isArray(a.regex)?(a.key=new RegExp("^"+a.regex[1]+"$"),a.regex=new RegExp(a.regex.join("")+"$")):a.regex&&(a.regex=new RegExp(a.regex+"$"))})},$composeBuffer:function(a,b,c){if(a.state==null||a.buffer==null)a.state="start",a.buffer="";var d=[];b&1&&d.push("ctrl"),b&8&&d.push("command"),b&2&&d.push("option"),b&4&&d.push("shift"),c&&d.push(c);var e=d.join("-"),f=a.buffer+e;b!=2&&(a.buffer=f);return{bufferToUse:f,symbolicName:e}},$find:function(a,b,c,e,f){var g={};this.keymapping[a.state].some(function(h){var i;if(h.key&&!h.key.test(c))return!1;if(h.regex&&!(i=h.regex.exec(b)))return!1;if(h.match&&!h.match(b,e,f,c))return!1;if(h.disallowMatches)for(var j=0;j<h.disallowMatches.length;j++)if(!!i[h.disallowMatches[j]])return!1;if(h.exec){g.command=h.exec;if(h.params){var k;g.args={},h.params.forEach(function(a){a.match!=null&&i!=null?k=i[a.match]||a.defaultValue:k=a.defaultValue,a.type==="number"&&(k=parseInt(k)),g.args[a.name]=k})}a.buffer=""}h.then&&(a.state=h.then,a.buffer=""),g.command==null&&(g.command="null"),d&&console.log("KeyboardStateMapper#find",h);return!0});if(g.command)return g;a.buffer="";return!1},handleKeyboard:function(a,b,c){if(b==0||c!=""&&c!=String.fromCharCode(0)){var e=this.$composeBuffer(a,b,c),f=e.bufferToUse,g=e.symbolicName;e=this.$find(a,f,g,b,c),d&&console.log("KeyboardStateMapper#match",f,g,e);return e}return null}},b.matchCharacterOnly=function(a,b,c,d){return b==0?!0:b==4&&c.length==1?!0:!1},b.StateHandler=e})
|
@ -1 +0,0 @@
|
||||
define("ace/keyboard/keybinding/vim",["require","exports","module","ace/keyboard/state_handler"],function(a,b,c){var d=a("ace/keyboard/state_handler").StateHandler,e=a("ace/keyboard/state_handler").matchCharacterOnly,f=function(a,b,c){return{regex:["([0-9]*)",a],exec:b,params:[{name:"times",match:1,type:"number",defaultValue:1}],then:c}},g={start:[{key:"i",then:"insertMode"},{key:"d",then:"deleteMode"},{key:"a",exec:"gotoright",then:"insertMode"},{key:"shift-i",exec:"gotolinestart",then:"insertMode"},{key:"shift-a",exec:"gotolineend",then:"insertMode"},{key:"shift-c",exec:"removetolineend",then:"insertMode"},{key:"shift-r",exec:"overwrite",then:"replaceMode"},f("(k|up)","golineup"),f("(j|down)","golinedown"),f("(l|right)","golineright"),f("(h|left)","golineleft"),{key:"shift-g",exec:"gotoend"},f("b","gotowordleft"),f("e","gotowordright"),f("x","del"),f("shift-x","backspace"),f("shift-d","removetolineend"),f("u","undo"),{comment:"Catch some keyboard input to stop it here",match:e}],insertMode:[{key:"esc",then:"start"}],replaceMode:[{key:"esc",exec:"overwrite",then:"start"}],deleteMode:[{key:"d",exec:"removeline",then:"start"}]};b.Vim=new d(g)}),define("ace/keyboard/state_handler",["require","exports","module"],function(a,b,c){function e(a){this.keymapping=this.$buildKeymappingRegex(a)}var d=!1;e.prototype={$buildKeymappingRegex:function(a){for(state in a)this.$buildBindingsRegex(a[state]);return a},$buildBindingsRegex:function(a){a.forEach(function(a){a.key?a.key=new RegExp("^"+a.key+"$"):Array.isArray(a.regex)?(a.key=new RegExp("^"+a.regex[1]+"$"),a.regex=new RegExp(a.regex.join("")+"$")):a.regex&&(a.regex=new RegExp(a.regex+"$"))})},$composeBuffer:function(a,b,c){if(a.state==null||a.buffer==null)a.state="start",a.buffer="";var d=[];b&1&&d.push("ctrl"),b&8&&d.push("command"),b&2&&d.push("option"),b&4&&d.push("shift"),c&&d.push(c);var e=d.join("-"),f=a.buffer+e;b!=2&&(a.buffer=f);return{bufferToUse:f,symbolicName:e}},$find:function(a,b,c,e,f){var g={};this.keymapping[a.state].some(function(h){var i;if(h.key&&!h.key.test(c))return!1;if(h.regex&&!(i=h.regex.exec(b)))return!1;if(h.match&&!h.match(b,e,f,c))return!1;if(h.disallowMatches)for(var j=0;j<h.disallowMatches.length;j++)if(!!i[h.disallowMatches[j]])return!1;if(h.exec){g.command=h.exec;if(h.params){var k;g.args={},h.params.forEach(function(a){a.match!=null&&i!=null?k=i[a.match]||a.defaultValue:k=a.defaultValue,a.type==="number"&&(k=parseInt(k)),g.args[a.name]=k})}a.buffer=""}h.then&&(a.state=h.then,a.buffer=""),g.command==null&&(g.command="null"),d&&console.log("KeyboardStateMapper#find",h);return!0});if(g.command)return g;a.buffer="";return!1},handleKeyboard:function(a,b,c){if(b==0||c!=""&&c!=String.fromCharCode(0)){var e=this.$composeBuffer(a,b,c),f=e.bufferToUse,g=e.symbolicName;e=this.$find(a,f,g,b,c),d&&console.log("KeyboardStateMapper#match",f,g,e);return e}return null}},b.matchCharacterOnly=function(a,b,c,d){return b==0?!0:b==4&&c.length==1?!0:!1},b.StateHandler=e})
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
define("ace/mode/python",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/python_highlight_rules","ace/mode/matching_brace_outdent","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules())};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d};var a={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(b,c,d){if(d!=="\r\n"&&d!=="\r"&&d!=="\n")return!1;var e=this.$tokenizer.getLineTokens(c.trim(),b).tokens;if(!e)return!1;do var f=e.pop();while(f&&(f.type=="comment"||f.type=="text"&&f.value.match(/^\s+$/)));return f?f.type=="keyword"&&a[f.value]:!1},this.autoOutdent=function(a,b,c){c+=1;var d=this.$getIndent(b.getLine(c)),e=b.getTabString();d.slice(-e.length)==e&&b.remove(new i(c,d.length-e.length,c,d.length))}}.call(j.prototype),b.Mode=j}),define("ace/mode/python_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")),b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")),c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),d=e.arrayToMap("".split("|")),f="(?:r|u|ur|R|U|UR|Ur|uR)?",g="(?:(?:[1-9]\\d*)|(?:0))",h="(?:0[oO]?[0-7]+)",i="(?:0[xX][\\dA-Fa-f]+)",j="(?:0[bB][01]+)",k="(?:"+g+"|"+h+"|"+i+"|"+j+")",l="(?:[eE][+-]?\\d+)",m="(?:\\.\\d+)",n="(?:\\d+)",o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))",p="(?:(?:"+o+"|"+n+")"+l+")",q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+'"{3}(?:[^\\\\]|\\\\.)*?"{3}'},{token:"string",merge:!0,regex:f+'"{3}.*$',next:"qqstring"},{token:"string",regex:f+'"(?:[^\\\\]|\\\\.)*?"'},{token:"string",regex:f+"'{3}(?:[^\\\\]|\\\\.)*?'{3}"},{token:"string",merge:!0,regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a.hasOwnProperty(e)?"keyword":b.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"invalid.illegal":c.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:[^\\\\]|\\\\.)*?"{3}',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?'{3}",next:"start"},{token:"string",merge:!0,regex:".+"}]}};d.inherits(g,f),b.PythonHighlightRules=g}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}}).call(e.prototype),b.MatchingBraceOutdent=e})
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
define("ace/mode/textile",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/textile_highlight_rules","ace/mode/matching_brace_outdent","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/textile_highlight_rules").TextileHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.getNextLineIndent=function(a,b,c){return a=="intag"?c:""},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/textile_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"keyword",token:function(a){return a.match(/^h\d$/)?"markup.heading."+a.charAt(1):"markup.heading"},regex:"h1|h2|h3|h4|h5|h6|bq|p|bc|pre",next:"blocktag"},{token:"keyword",regex:"[\\*]+|[#]+"},{token:"text",regex:".+"}],blocktag:[{token:"keyword",regex:"\\. ",next:"start"},{token:"keyword",regex:"\\(",next:"blocktagproperties"}],blocktagproperties:[{token:"keyword",regex:"\\)",next:"blocktag"},{token:"string",regex:"[a-zA-Z0-9\\-_]+"},{token:"keyword",regex:"#"}]}};d.inherits(f,e),b.TextileHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}}).call(e.prototype),b.MatchingBraceOutdent=e})
|
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
define("ace/theme/solarized_dark",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-solarized-dark .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-solarized-dark .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-solarized-dark .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-solarized-dark .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-solarized-dark .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-solarized-dark .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-solarized-dark .ace_scroller {\n background-color: #002B36;\n}\n\n.ace-solarized-dark .ace_text-layer {\n cursor: text;\n color: #93A1A1;\n}\n\n.ace-solarized-dark .ace_cursor {\n border-left: 2px solid #D30102;\n}\n\n.ace-solarized-dark .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #D30102;\n}\n \n.ace-solarized-dark .ace_marker-layer .ace_selection {\n background: #073642;\n}\n\n.ace-solarized-dark .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-solarized-dark .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(147, 161, 161, 0.50);\n}\n\n.ace-solarized-dark .ace_marker-layer .ace_active_line {\n background: #073642;\n}\n\n \n.ace-solarized-dark .ace_invisible {\n color: rgba(147, 161, 161, 0.50);\n}\n\n.ace-solarized-dark .ace_keyword {\n color:#859900;\n}\n\n.ace-solarized-dark .ace_keyword.ace_operator {\n \n}\n\n.ace-solarized-dark .ace_constant {\n \n}\n\n.ace-solarized-dark .ace_constant.ace_language {\n color:#B58900;\n}\n\n.ace-solarized-dark .ace_constant.ace_library {\n \n}\n\n.ace-solarized-dark .ace_constant.ace_numeric {\n color:#D33682;\n}\n\n.ace-solarized-dark .ace_invalid {\n \n}\n\n.ace-solarized-dark .ace_invalid.ace_illegal {\n \n}\n\n.ace-solarized-dark .ace_invalid.ace_deprecated {\n \n}\n\n.ace-solarized-dark .ace_support {\n \n}\n\n.ace-solarized-dark .ace_support.ace_function {\n color:#268BD2;\n}\n\n.ace-solarized-dark .ace_function.ace_buildin {\n \n}\n\n.ace-solarized-dark .ace_string {\n color:#2AA198;\n}\n\n.ace-solarized-dark .ace_string.ace_regexp {\n color:#D30102;\n}\n\n.ace-solarized-dark .ace_comment {\n font-style:italic;\ncolor:#657B83;\n}\n\n.ace-solarized-dark .ace_comment.ace_doc {\n \n}\n\n.ace-solarized-dark .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-solarized-dark .ace_variable {\n \n}\n\n.ace-solarized-dark .ace_variable.ace_language {\n color:#268BD2;\n}\n\n.ace-solarized-dark .ace_xml_pe {\n \n}\n\n.ace-solarized-dark .ace_meta {\n \n}\n\n.ace-solarized-dark .ace_meta.ace_tag {\n \n}\n\n.ace-solarized-dark .ace_meta.ace_tag.ace_input {\n \n}\n\n.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name {\n color:#93A1A1;\n}\n\n.ace-solarized-dark .ace_markup.ace_underline {\n text-decoration:underline;\n}\n\n.ace-solarized-dark .ace_markup.ace_heading {\n \n}\n\n.ace-solarized-dark .ace_markup.ace_heading.ace_1 {\n \n}\n\n.ace-solarized-dark .ace_markup.ace_heading.ace_2 {\n \n}\n\n.ace-solarized-dark .ace_markup.ace_heading.ace_3 {\n \n}\n\n.ace-solarized-dark .ace_markup.ace_heading.ace_4 {\n \n}\n\n.ace-solarized-dark .ace_markup.ace_heading.ace_5 {\n \n}\n\n.ace-solarized-dark .ace_markup.ace_heading.ace_6 {\n \n}\n\n.ace-solarized-dark .ace_markup.ace_list {\n \n}\n\n.ace-solarized-dark .ace_collab.ace_user1 {\n \n}";d.importCssString(e),b.cssClass="ace-solarized-dark"})
|
@ -1 +0,0 @@
|
||||
define("ace/theme/solarized_light",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-solarized-light .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-solarized-light .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-solarized-light .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-solarized-light .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-solarized-light .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-solarized-light .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-solarized-light .ace_scroller {\n background-color: #FDF6E3;\n}\n\n.ace-solarized-light .ace_text-layer {\n cursor: text;\n color: #586E75;\n}\n\n.ace-solarized-light .ace_cursor {\n border-left: 2px solid #000000;\n}\n\n.ace-solarized-light .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #000000;\n}\n \n.ace-solarized-light .ace_marker-layer .ace_selection {\n background: #073642;\n}\n\n.ace-solarized-light .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-solarized-light .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(147, 161, 161, 0.50);\n}\n\n.ace-solarized-light .ace_marker-layer .ace_active_line {\n background: #EEE8D5;\n}\n\n \n.ace-solarized-light .ace_invisible {\n color: rgba(147, 161, 161, 0.50);\n}\n\n.ace-solarized-light .ace_keyword {\n color:#859900;\n}\n\n.ace-solarized-light .ace_keyword.ace_operator {\n \n}\n\n.ace-solarized-light .ace_constant {\n \n}\n\n.ace-solarized-light .ace_constant.ace_language {\n color:#B58900;\n}\n\n.ace-solarized-light .ace_constant.ace_library {\n \n}\n\n.ace-solarized-light .ace_constant.ace_numeric {\n color:#D33682;\n}\n\n.ace-solarized-light .ace_invalid {\n \n}\n\n.ace-solarized-light .ace_invalid.ace_illegal {\n \n}\n\n.ace-solarized-light .ace_invalid.ace_deprecated {\n \n}\n\n.ace-solarized-light .ace_support {\n \n}\n\n.ace-solarized-light .ace_support.ace_function {\n color:#268BD2;\n}\n\n.ace-solarized-light .ace_function.ace_buildin {\n \n}\n\n.ace-solarized-light .ace_string {\n color:#2AA198;\n}\n\n.ace-solarized-light .ace_string.ace_regexp {\n color:#D30102;\n}\n\n.ace-solarized-light .ace_comment {\n color:#93A1A1;\n}\n\n.ace-solarized-light .ace_comment.ace_doc {\n \n}\n\n.ace-solarized-light .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-solarized-light .ace_variable {\n \n}\n\n.ace-solarized-light .ace_variable.ace_language {\n color:#268BD2;\n}\n\n.ace-solarized-light .ace_xml_pe {\n \n}\n\n.ace-solarized-light .ace_meta {\n \n}\n\n.ace-solarized-light .ace_meta.ace_tag {\n \n}\n\n.ace-solarized-light .ace_meta.ace_tag.ace_input {\n \n}\n\n.ace-solarized-light .ace_entity.ace_other.ace_attribute-name {\n color:#93A1A1;\n}\n\n.ace-solarized-light .ace_markup.ace_underline {\n text-decoration:underline;\n}\n\n.ace-solarized-light .ace_markup.ace_heading {\n \n}\n\n.ace-solarized-light .ace_markup.ace_heading.ace_1 {\n \n}\n\n.ace-solarized-light .ace_markup.ace_heading.ace_2 {\n \n}\n\n.ace-solarized-light .ace_markup.ace_heading.ace_3 {\n \n}\n\n.ace-solarized-light .ace_markup.ace_heading.ace_4 {\n \n}\n\n.ace-solarized-light .ace_markup.ace_heading.ace_5 {\n \n}\n\n.ace-solarized-light .ace_markup.ace_heading.ace_6 {\n \n}\n\n.ace-solarized-light .ace_markup.ace_list {\n \n}\n\n.ace-solarized-light .ace_collab.ace_user1 {\n \n}";d.importCssString(e),b.cssClass="ace-solarized-light"})
|
@ -1 +0,0 @@
|
||||
define("ace/theme/textmate",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-tm .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-tm .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-tm .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-tm .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-tm .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-tm .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_text-layer {\n cursor: text;\n}\n\n.ace-tm .ace_cursor {\n border-left: 2px solid black;\n}\n\n.ace-tm .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid black;\n}\n \n.ace-tm .ace_line .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_line .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_line .ace_constant.ace_language {\n color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_line .ace_invalid {\n background-color: rgb(153, 0, 0);\n color: white;\n}\n\n.ace-tm .ace_line .ace_fold {\n background-color: #E4E4E4;\n border-radius: 3px;\n}\n\n.ace-tm .ace_line .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_line .ace_support.ace_constant {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_line .ace_support.ace_type,\n.ace-tm .ace_line .ace_support.ace_class {\n color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_line .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_line .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_line .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_line .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_line .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_line .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_markup.ace_underline {\n text-decoration:underline;\n}\n\n.ace-tm .ace_markup.ace_heading {\n color: rgb(12, 7, 255);\n}\n\n.ace-tm .ace_markup.ace_list {\n color:rgb(185, 6, 144);\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active_line {\n background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-tm .ace_marker-layer .ace_selected_word {\n background: rgb(250, 250, 255);\n border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-tm .ace_meta.ace_tag {\n color:rgb(28, 2, 255);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0)\n}";d.importCssString(e),b.cssClass="ace-tm"})
|
@ -1 +0,0 @@
|
||||
define("ace/theme/twilight",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-twilight .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-twilight .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-twilight .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-twilight .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-twilight .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-twilight .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-twilight .ace_scroller {\n background-color: #141414;\n}\n\n.ace-twilight .ace_text-layer {\n cursor: text;\n color: #F8F8F8;\n}\n\n.ace-twilight .ace_cursor {\n border-left: 2px solid #A7A7A7;\n}\n\n.ace-twilight .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #A7A7A7;\n}\n \n.ace-twilight .ace_marker-layer .ace_selection {\n background: rgba(221, 240, 255, 0.20);\n}\n\n.ace-twilight .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-twilight .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.25);\n}\n\n.ace-twilight .ace_marker-layer .ace_active_line {\n background: rgba(255, 255, 255, 0.031);\n}\n\n \n.ace-twilight .ace_invisible {\n color: rgba(255, 255, 255, 0.25);\n}\n\n.ace-twilight .ace_keyword {\n color:#CDA869;\n}\n\n.ace-twilight .ace_keyword.ace_operator {\n \n}\n\n.ace-twilight .ace_constant {\n color:#CF6A4C;\n}\n\n.ace-twilight .ace_constant.ace_language {\n \n}\n\n.ace-twilight .ace_constant.ace_library {\n \n}\n\n.ace-twilight .ace_constant.ace_numeric {\n \n}\n\n.ace-twilight .ace_invalid {\n \n}\n\n.ace-twilight .ace_invalid.ace_illegal {\n color:#F8F8F8;\nbackground-color:rgba(86, 45, 86, 0.75);\n}\n\n.ace-twilight .ace_invalid.ace_deprecated {\n text-decoration:underline;\nfont-style:italic;\ncolor:#D2A8A1;\n}\n\n.ace-twilight .ace_support {\n color:#9B859D;\n}\n\n.ace-twilight .ace_support.ace_function {\n color:#DAD085;\n}\n\n.ace-twilight .ace_function.ace_buildin {\n \n}\n\n.ace-twilight .ace_string {\n color:#8F9D6A;\n}\n\n.ace-twilight .ace_string.ace_regexp {\n color:#E9C062;\n}\n\n.ace-twilight .ace_comment {\n font-style:italic;\ncolor:#5F5A60;\n}\n\n.ace-twilight .ace_comment.ace_doc {\n \n}\n\n.ace-twilight .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-twilight .ace_variable {\n color:#7587A6;\n}\n\n.ace-twilight .ace_variable.ace_language {\n \n}\n\n.ace-twilight .ace_xml_pe {\n color:#494949;\n}\n\n.ace-twilight .ace_meta {\n \n}\n\n.ace-twilight .ace_meta.ace_tag {\n color:#AC885B;\n}\n\n.ace-twilight .ace_meta.ace_tag.ace_input {\n \n}\n\n.ace-twilight .ace_entity.ace_other.ace_attribute-name {\n \n}\n\n.ace-twilight .ace_markup.ace_underline {\n text-decoration:underline;\n}\n\n.ace-twilight .ace_markup.ace_heading {\n color:#CF6A4C;\n}\n\n.ace-twilight .ace_markup.ace_heading.ace_1 {\n \n}\n\n.ace-twilight .ace_markup.ace_heading.ace_2 {\n \n}\n\n.ace-twilight .ace_markup.ace_heading.ace_3 {\n \n}\n\n.ace-twilight .ace_markup.ace_heading.ace_4 {\n \n}\n\n.ace-twilight .ace_markup.ace_heading.ace_5 {\n \n}\n\n.ace-twilight .ace_markup.ace_heading.ace_6 {\n \n}\n\n.ace-twilight .ace_markup.ace_list {\n color:#F9EE98;\n}\n\n.ace-twilight .ace_collab.ace_user1 {\n \n}";d.importCssString(e),b.cssClass="ace-twilight"})
|
@ -1 +0,0 @@
|
||||
define("ace/theme/vibrant_ink",["require","exports","module"],function(a,b,c){var d=a("pilot/dom"),e=".ace-vibrant-ink .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-vibrant-ink .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-vibrant-ink .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-vibrant-ink .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-vibrant-ink .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-vibrant-ink .ace_print_margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-vibrant-ink .ace_scroller {\n background-color: #0F0F0F;\n}\n\n.ace-vibrant-ink .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-vibrant-ink .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-vibrant-ink .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-vibrant-ink .ace_marker-layer .ace_selection {\n background: #6699CC;\n}\n\n.ace-vibrant-ink .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-vibrant-ink .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #99CC99;\n}\n\n.ace-vibrant-ink .ace_marker-layer .ace_active_line {\n background: #333333;\n}\n\n \n.ace-vibrant-ink .ace_invisible {\n color: #404040;\n}\n\n.ace-vibrant-ink .ace_keyword {\n color:#FF6600;\n}\n\n.ace-vibrant-ink .ace_keyword.ace_operator {\n \n}\n\n.ace-vibrant-ink .ace_constant {\n \n}\n\n.ace-vibrant-ink .ace_constant.ace_language {\n color:#339999;\n}\n\n.ace-vibrant-ink .ace_constant.ace_library {\n \n}\n\n.ace-vibrant-ink .ace_constant.ace_numeric {\n color:#99CC99;\n}\n\n.ace-vibrant-ink .ace_invalid {\n color:#CCFF33;\n background-color:#000000;\n}\n\n.ace-vibrant-ink .ace_invalid.ace_illegal {\n \n}\n\n.ace-vibrant-ink .ace_invalid.ace_deprecated {\n color:#CCFF33;\n background-color:#000000;\n}\n\n.ace-vibrant-ink .ace_support {\n \n}\n\n.ace-vibrant-ink .ace_support.ace_function {\n color:#FFCC00;\n}\n\n.ace-vibrant-ink .ace_function.ace_buildin {\n \n}\n\n.ace-vibrant-ink .ace_string {\n color:#66FF00;\n}\n\n.ace-vibrant-ink .ace_string.ace_regexp {\n color:#44B4CC;\n}\n\n.ace-vibrant-ink .ace_comment {\n color:#9933CC;\n}\n\n.ace-vibrant-ink .ace_comment.ace_doc {\n \n}\n\n.ace-vibrant-ink .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-vibrant-ink .ace_variable {\n \n}\n\n.ace-vibrant-ink .ace_variable.ace_language {\n \n}\n\n.ace-vibrant-ink .ace_xml_pe {\n \n}\n\n.ace-vibrant-ink .ace_meta {\n \n}\n\n.ace-vibrant-ink .ace_meta.ace_tag {\n \n}\n\n.ace-vibrant-ink .ace_meta.ace_tag.ace_input {\n \n}\n\n.ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {\n font-style:italic;\ncolor:#99CC99;\n}\n\n.ace-vibrant-ink .ace_markup.ace_underline {\n text-decoration:underline;\n}\n\n.ace-vibrant-ink .ace_markup.ace_heading {\n \n}\n\n.ace-vibrant-ink .ace_markup.ace_heading.ace_1 {\n \n}\n\n.ace-vibrant-ink .ace_markup.ace_heading.ace_2 {\n \n}\n\n.ace-vibrant-ink .ace_markup.ace_heading.ace_3 {\n \n}\n\n.ace-vibrant-ink .ace_markup.ace_heading.ace_4 {\n \n}\n\n.ace-vibrant-ink .ace_markup.ace_heading.ace_5 {\n \n}\n\n.ace-vibrant-ink .ace_markup.ace_heading.ace_6 {\n \n}\n\n.ace-vibrant-ink .ace_markup.ace_list {\n \n}\n\n.ace-vibrant-ink .ace_collab.ace_user1 {\n \n}";d.importCssString(e),b.cssClass="ace-vibrant-ink"})
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,86 +0,0 @@
|
||||
* { margin: 0; padding: 0; }
|
||||
body {
|
||||
font: 12px "Lucida Grande", Helvetica, Arial, serif;
|
||||
overflow: hidden;
|
||||
}
|
||||
iframe { border: 0; }
|
||||
|
||||
.clearfix:after {
|
||||
visibility: hidden;
|
||||
display: block;
|
||||
font-size: 0;
|
||||
content: " ";
|
||||
clear: both;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
#tabs {
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#EEEEEE), to(#D8D7D8));
|
||||
padding: 3px 0 0 0;
|
||||
}
|
||||
|
||||
#tabs .add a {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
|
||||
margin-top: 2px;
|
||||
margin-left: 10px;
|
||||
padding: 2px;
|
||||
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
text-shadow: #000 1px 1px 0;
|
||||
background: #d8d7d8;
|
||||
border: 1px solid #a0a0a0;
|
||||
border-bottom: none;
|
||||
|
||||
-webkit-border-top-right-radius: 10px 5px;
|
||||
-webkit-border-top-left-radius: 10px 5px;
|
||||
-webkit-box-shadow: inset 0 1px 0 white;
|
||||
}
|
||||
#tabs .add span {
|
||||
display: block;
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
#tabs ul {
|
||||
list-style: none;
|
||||
border-bottom: 1px solid #a0a0a0;
|
||||
}
|
||||
#tabs ul li { display: inline; }
|
||||
|
||||
#tabs ul li.active a {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
height: 8px;
|
||||
|
||||
background: #eee;
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
#tabs ul li a {
|
||||
display: block;
|
||||
float: left;
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
height: 8px;
|
||||
|
||||
padding: 3px 50px 7px;
|
||||
margin: 0 -5px 0 0;
|
||||
color: #222;
|
||||
background: #d8d7d8;
|
||||
|
||||
-webkit-border-top-right-radius: 10px 20px;
|
||||
-webkit-border-top-left-radius: 10px 20px;
|
||||
-webkit-box-shadow: inset 1px 1px 0 white;
|
||||
|
||||
border: 1px solid #a0a0a0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
-webkit-box-shadow: inset 0 1px 0 white;
|
||||
-moz-box-shadow: inset 0 1px 0 white;
|
||||
height: 97%;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#editor {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font: 18px Inconsolada, Monaco, Courier;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="editor"></div>
|
||||
|
||||
<script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="ace/theme-twilight.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="ace/mode-javascript.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="ace/mode-coffee.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="ace/mode-html.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<script src="vendor/underscore.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="vendor/jquery.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="vendor/coffee-script.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<script src="lib/osx.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="lib/atomicity.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
BIN
HTML/gh.png
BIN
HTML/gh.png
Binary file not shown.
Before Width: | Height: | Size: 9.0 KiB |
@ -1,7 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<frameset cols="*" frameborder=no framespacing=0 border=0>
|
||||
<frame src="tabs.html" />
|
||||
</frameset>
|
||||
</html>
|
@ -1,4 +0,0 @@
|
||||
# This file is the first thing loaded on startup.
|
||||
|
||||
c = AtomWindowController.alloc.initWithWindowNibName "AtomWindow"
|
||||
c.window
|
@ -1,38 +0,0 @@
|
||||
# {$} = require 'jQuery'
|
||||
# {Chrome} = require 'lib/osx'
|
||||
|
||||
# awesome hover effect
|
||||
if false
|
||||
$('#tabs ul li:not(".active") a').mousemove (e) ->
|
||||
originalBG = $(this).css("background-color")
|
||||
x = e.pageX - @offsetLeft
|
||||
y = e.pageY - @offsetTop
|
||||
xy = x + " " + y
|
||||
|
||||
bgWebKit = "-webkit-gradient(radial, #{xy}, 0, #{xy}, 100, from(rgba(255,255,255,0.8)), to(rgba(255,255,255,0.0))), #{originalBG}"
|
||||
|
||||
$(this).css background: bgWebKit
|
||||
|
||||
$('#tabs ul li:not(".active") a').mouseleave (e) ->
|
||||
$(this).removeAttr 'style'
|
||||
|
||||
# events
|
||||
$('#tabs ul li:not(.add) a').live 'click', ->
|
||||
$('#tabs ul .active').removeClass()
|
||||
$(this).parents('li').addClass 'active'
|
||||
|
||||
idx = $('#tabs ul a').index this
|
||||
$('.content iframe').hide().eq(idx).show().focus()
|
||||
|
||||
false
|
||||
|
||||
$('#tabs .add a').click ->
|
||||
$('#tabs ul .active').removeClass()
|
||||
$('#tabs ul .add').before '<li><a href="#">untitled</a></li>'
|
||||
|
||||
$('.content iframe').hide()
|
||||
$('.content').append '<iframe src="editor.html" width="100%" height="100%"></iframe>'
|
||||
|
||||
$('#tabs ul .add').prev().addClass 'active'
|
||||
|
||||
false
|
@ -1,26 +0,0 @@
|
||||
<style>
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
li:hover {
|
||||
background-color: grey;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="underscore.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="jquery.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="coffee-script.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="osx.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<script src="project.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<div id='cwd'></div>
|
||||
<ul id='files'></ul>
|
@ -1,24 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<link href="css/tabs.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="tabs">
|
||||
<ul class="clearfix">
|
||||
<li class="active"><a href="#">untitled</a></li>
|
||||
<li class="add"><a href="#"><span>+</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<iframe src="editor.html" width="100%" height="100%"></iframe>
|
||||
</div>
|
||||
|
||||
<script src="vendor/jquery.js"></script>
|
||||
<script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="lib/osx.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="lib/tabs.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
18
HTML/vendor/jquery.js
vendored
18
HTML/vendor/jquery.js
vendored
File diff suppressed because one or more lines are too long
25
Rakefile
Normal file
25
Rakefile
Normal file
@ -0,0 +1,25 @@
|
||||
ENV['PATH'] = "#{ENV['PATH']}:/usr/local/bin/"
|
||||
|
||||
desc "Build the shit."
|
||||
task :build do
|
||||
project_dir = ENV['PROJECT_DIR'] || '.'
|
||||
built_dir = ENV['BUILT_PRODUCTS_DIR'] || '.'
|
||||
contents_dir = ENV['CONTENTS_FOLDER_PATH'].to_s
|
||||
|
||||
dest = File.join(built_dir, contents_dir, "Resources")
|
||||
|
||||
%w( src docs static vendor ).each do |dir|
|
||||
rm_rf File.join(dest, dir)
|
||||
cp_r dir, File.join(dest, dir)
|
||||
end
|
||||
|
||||
Dir['src/**/*.coffee'].each do |file|
|
||||
sh "coffee -c #{dest}/src"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Install the app in /Applications"
|
||||
task :install do
|
||||
rm_rf "/Applications/Atomicity.app"
|
||||
cp_r "Cocoa/build/Debug/Atomicity.app /Applications"
|
||||
end
|
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
SOURCE_SCRIPTS_DIR="$PROJECT_DIR/html"
|
||||
DESTINATION_SCRIPTS_DIR="$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources/"
|
||||
|
||||
PATH="$PATH:/usr/local/bin/"
|
||||
hash coffee 2>&- || { echo >&2 "error: Coffee is required but it's not installed (http://jashkenas.github.com/coffee-script/)."; exit 1; }
|
||||
coffee -o "$DESTINATION_SCRIPTS_DIR/HTML/lib/" HTML/lib/*.coffee
|
||||
|
||||
cp -r "$SOURCE_SCRIPTS_DIR" "$DESTINATION_SCRIPTS_DIR"
|
@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
rm -rf /Applications/Atomicity.app
|
||||
cp -r build/Debug/Atomicity.app /Applications
|
@ -1,9 +1,17 @@
|
||||
# nice!
|
||||
|
||||
Chrome.init()
|
||||
{Chrome, File, Process, Dir} = require 'osx'
|
||||
|
||||
ace = require 'ace/ace'
|
||||
canon = require 'pilot/canon'
|
||||
|
||||
$ = require 'jquery'
|
||||
{CoffeeScript} = require 'coffee-script'
|
||||
|
||||
Chrome.addPane 'main', '<div id="editor"></div>'
|
||||
|
||||
editor = ace.edit "editor"
|
||||
editor.setTheme "ace/theme/twilight"
|
||||
editor.setTheme require "ace/theme/twilight"
|
||||
JavaScriptMode = require("ace/mode/javascript").Mode
|
||||
CoffeeMode = require("ace/mode/coffee").Mode
|
||||
HTMLMode = require("ace/mode/html").Mode
|
||||
@ -12,6 +20,11 @@ editor.getSession().setUseSoftTabs true
|
||||
editor.getSession().setTabSize 2
|
||||
editor.focus()
|
||||
|
||||
# fuuuuu, ui bug
|
||||
setTimeout ->
|
||||
editor.resize()
|
||||
, 50
|
||||
|
||||
if css = File.read "~/.atomicity/twilight.css"
|
||||
head = $('head')[0]
|
||||
style = document.createElement 'style'
|
||||
@ -53,78 +66,87 @@ saveAs = ->
|
||||
filename = file
|
||||
Chrome.title _.last filename.split('/')
|
||||
save()
|
||||
bindKey = (name, shortcut, callback) ->
|
||||
canon.addCommand
|
||||
name: name
|
||||
exec: callback
|
||||
bindKey:
|
||||
win: null
|
||||
mac: shortcut
|
||||
sender: 'editor'
|
||||
|
||||
Chrome.bindKey 'open', 'Command-O', (env, args, request) ->
|
||||
|
||||
bindKey 'open', 'Command-O', (env, args, request) ->
|
||||
if file = Chrome.openPanel()
|
||||
filename = file
|
||||
open()
|
||||
|
||||
Chrome.bindKey 'openURL', 'Command-Shift-O', (env, args, request) ->
|
||||
bindKey 'openURL', 'Command-Shift-O', (env, args, request) ->
|
||||
if url = prompt "Enter URL:"
|
||||
Chrome.openURL url
|
||||
|
||||
Chrome.bindKey 'saveAs', 'Command-Shift-S', (env, args, request) ->
|
||||
bindKey 'saveAs', 'Command-Shift-S', (env, args, request) ->
|
||||
saveAs()
|
||||
|
||||
Chrome.bindKey 'save', 'Command-S', (env, args, request) ->
|
||||
bindKey 'save', 'Command-S', (env, args, request) ->
|
||||
if filename then save() else saveAs()
|
||||
|
||||
Chrome.bindKey 'new', 'Command-N', (env, args, request) ->
|
||||
bindKey 'new', 'Command-N', (env, args, request) ->
|
||||
Chrome.createWindow()
|
||||
|
||||
Chrome.bindKey 'copy', 'Command-C', (env, args, request) ->
|
||||
bindKey 'copy', 'Command-C', (env, args, request) ->
|
||||
text = editor.getSession().doc.getTextRange editor.getSelectionRange()
|
||||
Chrome.writeToPasteboard text
|
||||
|
||||
Chrome.bindKey 'cut', 'Command-X', (env, args, request) ->
|
||||
bindKey 'cut', 'Command-X', (env, args, request) ->
|
||||
text = editor.getSession().doc.getTextRange editor.getSelectionRange()
|
||||
Chrome.writeToPasteboard text
|
||||
editor.session.remove editor.getSelectionRange()
|
||||
|
||||
Chrome.bindKey 'eval', 'Command-R', (env, args, request) ->
|
||||
bindKey 'eval', 'Command-R', (env, args, request) ->
|
||||
eval env.editor.getSession().getValue()
|
||||
|
||||
# textmate
|
||||
|
||||
Chrome.bindKey 'togglecomment', 'Command-/', (env) ->
|
||||
bindKey 'togglecomment', 'Command-/', (env) ->
|
||||
env.editor.toggleCommentLines()
|
||||
|
||||
Chrome.bindKey 'tmoutdent', 'Command-[', (env) ->
|
||||
bindKey 'tmoutdent', 'Command-[', (env) ->
|
||||
env.editor.blockOutdent()
|
||||
|
||||
Chrome.bindKey 'tmindent', 'Command-]', (env) ->
|
||||
bindKey 'tmindent', 'Command-]', (env) ->
|
||||
env.editor.indent()
|
||||
|
||||
# emacs > you
|
||||
|
||||
Chrome.bindKey 'moveforward', 'Alt-F', (env) ->
|
||||
bindKey 'moveforward', 'Alt-F', (env) ->
|
||||
env.editor.navigateWordRight()
|
||||
|
||||
Chrome.bindKey 'moveback', 'Alt-B', (env) ->
|
||||
bindKey 'moveback', 'Alt-B', (env) ->
|
||||
env.editor.navigateWordLeft()
|
||||
|
||||
Chrome.bindKey 'deleteword', 'Alt-D', (env) ->
|
||||
bindKey 'deleteword', 'Alt-D', (env) ->
|
||||
env.editor.removeWordRight()
|
||||
|
||||
Chrome.bindKey 'selectwordright', 'Alt-B', (env) ->
|
||||
bindKey 'selectwordright', 'Alt-B', (env) ->
|
||||
env.editor.navigateWordLeft()
|
||||
|
||||
Chrome.bindKey 'home', 'Alt-Shift-,', (env) ->
|
||||
bindKey 'home', 'Alt-Shift-,', (env) ->
|
||||
env.editor.navigateFileStart()
|
||||
|
||||
Chrome.bindKey 'end', 'Alt-Shift-.', (env) ->
|
||||
bindKey 'end', 'Alt-Shift-.', (env) ->
|
||||
env.editor.navigateFileEnd()
|
||||
|
||||
Chrome.bindKey 'fullscreen', 'Command-Shift-Return', (env) ->
|
||||
bindKey 'fullscreen', 'Command-Shift-Return', (env) ->
|
||||
Chrome.toggleFullscreen()
|
||||
|
||||
|
||||
|
||||
# HAX
|
||||
# this should go in coffee.coffee or something
|
||||
Chrome.bindKey 'consolelog', 'Ctrl-L', (env) ->
|
||||
bindKey 'consolelog', 'Ctrl-L', (env) ->
|
||||
env.editor.insert 'console.log ""'
|
||||
env.editor.navigateLeft()
|
||||
|
||||
Chrome.bindKey 'toggleProjectDrawer', 'Command-Ctrl-N', (env) ->
|
||||
Project.toggle()
|
||||
bindKey 'toggleProjectDrawer', 'Command-Ctrl-N', (env) ->
|
||||
Project.toggle()
|
43
src/bootstrap.coffee
Normal file
43
src/bootstrap.coffee
Normal file
@ -0,0 +1,43 @@
|
||||
# This file is the first thing loaded on startup.
|
||||
|
||||
console.log = (thing) -> OSX.NSLog thing.toString()
|
||||
|
||||
modules = {}
|
||||
paths = ['src', 'vendor']
|
||||
this.require = (file) ->
|
||||
# hack for stupid requirejs
|
||||
if file.indexOf('ace/requirejs/text!') > -1
|
||||
file = file.replace 'ace/requirejs/text!', ''
|
||||
text = true
|
||||
|
||||
return modules[file] if modules[file]
|
||||
|
||||
code = null
|
||||
paths.forEach (path) ->
|
||||
return code if code
|
||||
root = OSX.NSBundle.mainBundle.resourcePath + "/#{path}"
|
||||
fullpath = if text then "#{root}/#{file}" else "#{root}/#{file}.js"
|
||||
code = OSX.NSString.stringWithContentsOfFile fullpath
|
||||
|
||||
if text
|
||||
modules[file] = code.toString()
|
||||
return modules[file]
|
||||
|
||||
exports = {}
|
||||
module = exports: exports
|
||||
|
||||
src = "function define(cb){cb.call(this,require,exports)};"
|
||||
src += """(function(exports, define, module){
|
||||
#{code}
|
||||
}).call(exports, exports, define, module);
|
||||
"""
|
||||
eval src
|
||||
|
||||
modules[file] = module.exports or exports
|
||||
modules[file]
|
||||
|
||||
this.require.paths = paths
|
||||
|
||||
this.require.nameToUrl = (path) -> "#{path}.js"
|
||||
|
||||
this._ = require 'underscore'
|
@ -1,12 +1,28 @@
|
||||
# This is the CoffeeScript API that wraps all of Cocoa.
|
||||
|
||||
# leak
|
||||
canon = require 'pilot/canon'
|
||||
$ = require 'jquery'
|
||||
|
||||
# Handles the UI chrome
|
||||
Chrome =
|
||||
init: ->
|
||||
console.log = OSX.NSLog
|
||||
addPane: (position, html) ->
|
||||
verticalDiv = $('#app-vertical')
|
||||
horizontalDiv = $('#app-horizontal')
|
||||
|
||||
el = document.createElement("div")
|
||||
el.setAttribute('class', "pane " + position)
|
||||
el.innerHTML = html
|
||||
|
||||
switch position
|
||||
when 'top', 'main'
|
||||
verticalDiv.prepend(el)
|
||||
when 'left'
|
||||
horizontalDiv.prepend(el)
|
||||
when 'bottom'
|
||||
verticalDiv.append(el)
|
||||
when 'right'
|
||||
horizontalDiv.append(el)
|
||||
else
|
||||
NSLog("I DON'T KNOW HOW TO DEAL WITH #{position}")
|
||||
|
||||
# path - Optional. The String path to the file to base it on.
|
||||
createWindow: (path) ->
|
||||
@ -29,6 +45,7 @@ Chrome =
|
||||
# Returns null or a file path.
|
||||
openPanel: ->
|
||||
panel = OSX.NSOpenPanel.openPanel
|
||||
panel.setCanChooseDirectories(true)
|
||||
if panel.runModal isnt OSX.NSFileHandlingPanelOKButton
|
||||
return null
|
||||
panel.filenames.lastObject
|
||||
@ -49,23 +66,6 @@ Chrome =
|
||||
window.location = url
|
||||
Chrome.title _.last url.replace(/\/$/,'').split '/'
|
||||
|
||||
# name - Command name, like "Find in file"
|
||||
# shortcut - String command name, e.g.
|
||||
# "Command-T"
|
||||
# "Command-Shift-F"
|
||||
# "Ctrl-I"
|
||||
# callback - (env, args, request)
|
||||
#
|
||||
# Returns nothing.
|
||||
bindKey: (name, shortcut, callback) ->
|
||||
canon.addCommand
|
||||
name: name
|
||||
exec: callback
|
||||
bindKey:
|
||||
win: null
|
||||
mac: shortcut
|
||||
sender: 'editor'
|
||||
|
||||
title: (text) ->
|
||||
WindowController.window.title = text
|
||||
|
||||
@ -120,15 +120,27 @@ File =
|
||||
OSX.NSString.stringWithString(path).stringByExpandingTildeInPath
|
||||
else
|
||||
path
|
||||
isFile: (path) ->
|
||||
isDir = new outArgument
|
||||
exists = OSX.NSFileManager.defaultManager.fileExistsAtPath_isDirectory(path, isDir)
|
||||
exists and not isDir.valueOf()
|
||||
|
||||
Dir =
|
||||
list: (path) ->
|
||||
path = File.expand path
|
||||
_.map OSX.NSFileManager.defaultManager.subpathsAtPath(path), (entry) ->
|
||||
"#{path}/#{entry}"
|
||||
isDir: (path) ->
|
||||
isDir = new outArgument
|
||||
exists = OSX.NSFileManager.defaultManager.fileExistsAtPath_isDirectory(path, isDir)
|
||||
exists and isDir.valueOf()
|
||||
|
||||
Process =
|
||||
cwd: ->
|
||||
OSX.NSFileManager.defaultManager.currentDirectoryPath()
|
||||
cwd: (path) ->
|
||||
if dir?
|
||||
OSX.NSFileManager.defaultManager.changeCurrentDirectoryPath(path)
|
||||
else
|
||||
OSX.NSFileManager.defaultManager.currentDirectoryPath()
|
||||
|
||||
env: ->
|
||||
OSX.NSProcess.processInfo.environment()
|
||||
@ -148,7 +160,9 @@ Project =
|
||||
|
||||
@showing = not @showing
|
||||
|
||||
this.Chrome = Chrome
|
||||
this.File = File
|
||||
this.Dir = Dir
|
||||
this.Project = Project
|
||||
exports ?= this
|
||||
|
||||
exports.Chrome = Chrome
|
||||
exports.File = File
|
||||
exports.Dir = Dir
|
||||
exports.Project = Project
|
@ -1,3 +1,5 @@
|
||||
$ = require 'jquery'
|
||||
|
||||
$ ->
|
||||
dir = OSX.NSFileManager.defaultManager.currentDirectoryPath
|
||||
$('#cwd').text(dir)
|
31
src/tabs.coffee
Normal file
31
src/tabs.coffee
Normal file
@ -0,0 +1,31 @@
|
||||
$ = require 'jquery'
|
||||
|
||||
{Chrome, File, Dir, Process} = require 'osx'
|
||||
|
||||
exports.show = ->
|
||||
root = OSX.NSBundle.mainBundle.resourcePath + '/HTML/'
|
||||
tabs = OSX.NSString.stringWithContentsOfFile "#{root}/tabs.html"
|
||||
edit = OSX.NSString.stringWithContentsOfFile "#{root}/editor.html"
|
||||
|
||||
Chrome.addPane 'main', tabs.replace '<%= editor %>', edit
|
||||
|
||||
# events
|
||||
$('#tabs ul li:not(.add) a').live 'click', ->
|
||||
$('#tabs ul .active').removeClass()
|
||||
$(this).parents('li').addClass 'active'
|
||||
|
||||
idx = $('#tabs ul a').index this
|
||||
$('.content iframe').hide().eq(idx).show().focus()
|
||||
|
||||
false
|
||||
|
||||
$('#tabs .add a').click ->
|
||||
$('#tabs ul .active').removeClass()
|
||||
$('#tabs ul .add').before '<li><a href="#">untitled</a></li>'
|
||||
|
||||
$('.content iframe').hide()
|
||||
$('.content').append '<iframe src="editor.html" width="100%" height="100%"></iframe>'
|
||||
|
||||
$('#tabs ul .add').prev().addClass 'active'
|
||||
|
||||
false
|
19
static/editor.html
Normal file
19
static/editor.html
Normal file
@ -0,0 +1,19 @@
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#editor {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font: 18px Inconsolada, Monaco, Courier;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="editor"></div>
|
||||
|
||||
<script>
|
||||
require('atomicity');
|
||||
</script>
|
BIN
static/images/belt-small.png
Normal file
BIN
static/images/belt-small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.0 KiB |
BIN
static/images/belt.png
Normal file
BIN
static/images/belt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 91 KiB |
78
static/index.html
Normal file
78
static/index.html
Normal file
@ -0,0 +1,78 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#app-horizontal {
|
||||
background-color: orange;
|
||||
display: -webkit-box;
|
||||
height: 100%;
|
||||
|
||||
-webkit-box-orient: horizontal;
|
||||
}
|
||||
|
||||
#app-vertical {
|
||||
background-color: yellow;
|
||||
display: -webkit-box;
|
||||
-webkit-box-flex: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.main {
|
||||
width: 100%;
|
||||
-webkit-box-flex: 1;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
.left {
|
||||
width: 100px;
|
||||
background-color: gray;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 100px;
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.top {
|
||||
height: 100px;
|
||||
background-color: purple;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
height: 100px;
|
||||
background-color: blue;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id='app-horizontal'>
|
||||
<div id='app-vertical'>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#editor {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font: 18px Inconsolada, Monaco, Courier;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
require('atomicity');
|
||||
</script>
|
||||
|
||||
</html>
|
||||
|
22
static/project.html
Normal file
22
static/project.html
Normal file
@ -0,0 +1,22 @@
|
||||
<style>
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
li:hover {
|
||||
background-color: grey;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id='cwd'></div>
|
||||
<ul id='files'></ul>
|
||||
|
||||
<script>
|
||||
require('project');
|
||||
</script>
|
99
static/tabs.html
Normal file
99
static/tabs.html
Normal file
@ -0,0 +1,99 @@
|
||||
<style>
|
||||
* { margin: 0; padding: 0; }
|
||||
body {
|
||||
font: 12px "Lucida Grande", Helvetica, Arial, serif;
|
||||
overflow: hidden;
|
||||
}
|
||||
iframe { border: 0; }
|
||||
|
||||
.clearfix:after {
|
||||
visibility: hidden;
|
||||
display: block;
|
||||
font-size: 0;
|
||||
content: " ";
|
||||
clear: both;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
#tabs {
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#EEEEEE), to(#D8D7D8));
|
||||
padding: 3px 0 0 0;
|
||||
}
|
||||
|
||||
#tabs .add a {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
|
||||
margin-top: 2px;
|
||||
margin-left: 10px;
|
||||
padding: 2px;
|
||||
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
text-shadow: #000 1px 1px 0;
|
||||
background: #d8d7d8;
|
||||
border: 1px solid #a0a0a0;
|
||||
border-bottom: none;
|
||||
|
||||
-webkit-border-top-right-radius: 10px 5px;
|
||||
-webkit-border-top-left-radius: 10px 5px;
|
||||
-webkit-box-shadow: inset 0 1px 0 white;
|
||||
}
|
||||
#tabs .add span {
|
||||
display: block;
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
#tabs ul {
|
||||
list-style: none;
|
||||
border-bottom: 1px solid #a0a0a0;
|
||||
}
|
||||
#tabs ul li { display: inline; }
|
||||
|
||||
#tabs ul li.active a {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
height: 8px;
|
||||
|
||||
background: #eee;
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
#tabs ul li a {
|
||||
display: block;
|
||||
float: left;
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
height: 8px;
|
||||
|
||||
padding: 3px 50px 7px;
|
||||
margin: 0 -5px 0 0;
|
||||
color: #222;
|
||||
background: #d8d7d8;
|
||||
|
||||
-webkit-border-top-right-radius: 10px 20px;
|
||||
-webkit-border-top-left-radius: 10px 20px;
|
||||
-webkit-box-shadow: inset 1px 1px 0 white;
|
||||
|
||||
border: 1px solid #a0a0a0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
-webkit-box-shadow: inset 0 1px 0 white;
|
||||
-moz-box-shadow: inset 0 1px 0 white;
|
||||
height: 97%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="tabs">
|
||||
<ul class="clearfix">
|
||||
<li class="active"><a href="#">untitled</a></li>
|
||||
<li class="add"><a href="#"><span>+</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<%= editor %>
|
||||
</div>
|
80
vendor/ace/ace.js
vendored
Normal file
80
vendor/ace/ace.js
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Skywriter.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Kevin Dangoor (kdangoor@mozilla.com)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
require("pilot/index");
|
||||
require("pilot/fixoldbrowsers");
|
||||
var catalog = require("pilot/plugin_manager").catalog;
|
||||
catalog.registerPlugins([ "pilot/index" ]);
|
||||
|
||||
var Dom = require("pilot/dom");
|
||||
var Event = require("pilot/event");
|
||||
|
||||
var Editor = require("ace/editor").Editor;
|
||||
var EditSession = require("ace/edit_session").EditSession;
|
||||
var UndoManager = require("ace/undomanager").UndoManager;
|
||||
var Renderer = require("ace/virtual_renderer").VirtualRenderer;
|
||||
|
||||
exports.edit = function(el) {
|
||||
if (typeof(el) == "string") {
|
||||
el = document.getElementById(el);
|
||||
}
|
||||
|
||||
var doc = new EditSession(Dom.getInnerText(el));
|
||||
doc.setUndoManager(new UndoManager());
|
||||
el.innerHTML = '';
|
||||
|
||||
var editor = new Editor(new Renderer(el, require("ace/theme/textmate")));
|
||||
editor.setSession(doc);
|
||||
|
||||
var env = require("pilot/environment").create();
|
||||
catalog.startupPlugins({ env: env }).then(function() {
|
||||
env.document = doc;
|
||||
env.editor = editor;
|
||||
editor.resize();
|
||||
Event.addListener(window, "resize", function() {
|
||||
editor.resize();
|
||||
});
|
||||
el.env = env;
|
||||
});
|
||||
// Store env on editor such that it can be accessed later on from
|
||||
// the returned object.
|
||||
editor.env = env;
|
||||
return editor;
|
||||
};
|
||||
});
|
192
vendor/ace/anchor.js
vendored
Normal file
192
vendor/ace/anchor.js
vendored
Normal file
@ -0,0 +1,192 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Ajax.org Code Editor (ACE).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ajax.org B.V.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var oop = require("pilot/oop");
|
||||
var EventEmitter = require("pilot/event_emitter").EventEmitter;
|
||||
|
||||
/**
|
||||
* An Anchor is a floating pointer in the document. Whenever text is inserted or
|
||||
* deleted before the cursor, the position of the cursor is updated
|
||||
*/
|
||||
var Anchor = exports.Anchor = function(doc, row, column) {
|
||||
this.document = doc;
|
||||
|
||||
if (typeof column == "undefined")
|
||||
this.setPosition(row.row, row.column);
|
||||
else
|
||||
this.setPosition(row, column);
|
||||
|
||||
this.$onChange = this.onChange.bind(this);
|
||||
doc.on("change", this.$onChange);
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
||||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.getPosition = function() {
|
||||
return this.$clipPositionToDocument(this.row, this.column);
|
||||
};
|
||||
|
||||
this.getDocument = function() {
|
||||
return this.document;
|
||||
};
|
||||
|
||||
this.onChange = function(e) {
|
||||
var delta = e.data;
|
||||
var range = delta.range;
|
||||
|
||||
if (range.start.row == range.end.row && range.start.row != this.row)
|
||||
return;
|
||||
|
||||
if (range.start.row > this.row)
|
||||
return;
|
||||
|
||||
if (range.start.row == this.row && range.start.column > this.column)
|
||||
return;
|
||||
|
||||
var row = this.row;
|
||||
var column = this.column;
|
||||
|
||||
if (delta.action === "insertText") {
|
||||
if (range.start.row === row && range.start.column <= column) {
|
||||
if (range.start.row === range.end.row) {
|
||||
column += range.end.column - range.start.column;
|
||||
}
|
||||
else {
|
||||
column -= range.start.column;
|
||||
row += range.end.row - range.start.row;
|
||||
}
|
||||
}
|
||||
else if (range.start.row !== range.end.row && range.start.row < row) {
|
||||
row += range.end.row - range.start.row;
|
||||
}
|
||||
} else if (delta.action === "insertLines") {
|
||||
if (range.start.row <= row) {
|
||||
row += range.end.row - range.start.row;
|
||||
}
|
||||
}
|
||||
else if (delta.action == "removeText") {
|
||||
if (range.start.row == row && range.start.column < column) {
|
||||
if (range.end.column >= column)
|
||||
column = range.start.column;
|
||||
else
|
||||
column = Math.max(0, column - (range.end.column - range.start.column));
|
||||
|
||||
} else if (range.start.row !== range.end.row && range.start.row < row) {
|
||||
if (range.end.row == row) {
|
||||
column = Math.max(0, column - range.end.column) + range.start.column;
|
||||
}
|
||||
row -= (range.end.row - range.start.row);
|
||||
}
|
||||
else if (range.end.row == row) {
|
||||
row -= range.end.row - range.start.row;
|
||||
column = Math.max(0, column - range.end.column) + range.start.column;
|
||||
}
|
||||
} else if (delta.action == "removeLines") {
|
||||
if (range.start.row <= row) {
|
||||
if (range.end.row <= row)
|
||||
row -= range.end.row - range.start.row;
|
||||
else {
|
||||
row = range.start.row;
|
||||
column = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setPosition(row, column, true);
|
||||
};
|
||||
|
||||
this.setPosition = function(row, column, noClip) {
|
||||
var pos;
|
||||
if (noClip) {
|
||||
pos = {
|
||||
row: row,
|
||||
column: column
|
||||
};
|
||||
}
|
||||
else {
|
||||
pos = this.$clipPositionToDocument(row, column);
|
||||
}
|
||||
|
||||
if (this.row == pos.row && this.column == pos.column)
|
||||
return;
|
||||
|
||||
var old = {
|
||||
row: this.row,
|
||||
column: this.column
|
||||
};
|
||||
|
||||
this.row = pos.row;
|
||||
this.column = pos.column;
|
||||
this._dispatchEvent("change", {
|
||||
old: old,
|
||||
value: pos
|
||||
});
|
||||
};
|
||||
|
||||
this.detach = function() {
|
||||
this.document.removeEventListener("change", this.$onChange);
|
||||
};
|
||||
|
||||
this.$clipPositionToDocument = function(row, column) {
|
||||
var pos = {};
|
||||
|
||||
if (row >= this.document.getLength()) {
|
||||
pos.row = Math.max(0, this.document.getLength() - 1);
|
||||
pos.column = this.document.getLine(pos.row).length;
|
||||
}
|
||||
else if (row < 0) {
|
||||
pos.row = 0;
|
||||
pos.column = 0;
|
||||
}
|
||||
else {
|
||||
pos.row = row;
|
||||
pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
|
||||
}
|
||||
|
||||
if (column < 0)
|
||||
pos.column = 0;
|
||||
|
||||
return pos;
|
||||
};
|
||||
|
||||
}).call(Anchor.prototype);
|
||||
|
||||
});
|
183
vendor/ace/anchor_test.js
vendored
Normal file
183
vendor/ace/anchor_test.js
vendored
Normal file
@ -0,0 +1,183 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Ajax.org Code Editor (ACE).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ajax.org B.V.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
if (typeof process !== "undefined") {
|
||||
require("../../support/paths");
|
||||
}
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var Document = require("ace/document").Document;
|
||||
var Anchor = require("ace/anchor").Anchor;
|
||||
var Range = require("ace/range").Range;
|
||||
var assert = require("ace/test/assertions");
|
||||
|
||||
module.exports = {
|
||||
|
||||
"test create anchor" : function() {
|
||||
var doc = new Document("juhu");
|
||||
var anchor = new Anchor(doc, 0, 0);
|
||||
|
||||
assert.position(anchor.getPosition(), 0, 0);
|
||||
assert.equal(anchor.getDocument(), doc);
|
||||
},
|
||||
|
||||
"test insert text in same row before cursor should move anchor column": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.insert({row: 1, column: 1}, "123");
|
||||
assert.position(anchor.getPosition(), 1, 7);
|
||||
},
|
||||
|
||||
"test insert lines before cursor should move anchor row": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.insertLines(1, ["123", "456"]);
|
||||
assert.position(anchor.getPosition(), 3, 4);
|
||||
},
|
||||
|
||||
"test insert new line before cursor should move anchor column": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.insertNewLine({row: 0, column: 0});
|
||||
assert.position(anchor.getPosition(), 2, 4);
|
||||
},
|
||||
|
||||
"test insert new line in anchor line before anchor should move anchor column and row": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.insertNewLine({row: 1, column: 2});
|
||||
assert.position(anchor.getPosition(), 2, 2);
|
||||
},
|
||||
|
||||
"test delete text in anchor line before anchor should move anchor column": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.remove(new Range(1, 1, 1, 3));
|
||||
assert.position(anchor.getPosition(), 1, 2);
|
||||
},
|
||||
|
||||
"test remove range which contains the anchor should move the anchor to the start of the range": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 0, 3);
|
||||
|
||||
doc.remove(new Range(0, 1, 1, 3));
|
||||
assert.position(anchor.getPosition(), 0, 1);
|
||||
},
|
||||
|
||||
"test delete character before the anchor should have no effect": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.remove(new Range(1, 4, 1, 5));
|
||||
assert.position(anchor.getPosition(), 1, 4);
|
||||
},
|
||||
|
||||
"test delete lines in anchor line before anchor should move anchor row": function() {
|
||||
var doc = new Document("juhu\n1\n2\nkinners");
|
||||
var anchor = new Anchor(doc, 3, 4);
|
||||
|
||||
doc.removeLines(1, 2);
|
||||
assert.position(anchor.getPosition(), 1, 4);
|
||||
},
|
||||
|
||||
"test remove new line before the cursor": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.removeNewLine(0);
|
||||
assert.position(anchor.getPosition(), 0, 8);
|
||||
},
|
||||
|
||||
"test delete range which contains the anchor should move anchor to the end of the range": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.remove(new Range(0, 2, 1, 2));
|
||||
assert.position(anchor.getPosition(), 0, 4);
|
||||
},
|
||||
|
||||
"test delete line which contains the anchor should move anchor to the end of the range": function() {
|
||||
var doc = new Document("juhu\nkinners\n123");
|
||||
var anchor = new Anchor(doc, 1, 5);
|
||||
|
||||
doc.removeLines(1, 1);
|
||||
assert.position(anchor.getPosition(), 1, 0);
|
||||
},
|
||||
|
||||
"test remove after the anchor should have no effect": function() {
|
||||
var doc = new Document("juhu\nkinners\n123");
|
||||
var anchor = new Anchor(doc, 1, 2);
|
||||
|
||||
doc.remove(new Range(1, 4, 2, 2));
|
||||
assert.position(anchor.getPosition(), 1, 2);
|
||||
},
|
||||
|
||||
"test anchor changes triggered by document changes should emit change event": function(next) {
|
||||
var doc = new Document("juhu\nkinners\n123");
|
||||
var anchor = new Anchor(doc, 1, 5);
|
||||
|
||||
anchor.on("change", function(e) {
|
||||
assert.position(anchor.getPosition(), 0, 0);
|
||||
next();
|
||||
});
|
||||
|
||||
doc.remove(new Range(0, 0, 2, 1));
|
||||
},
|
||||
|
||||
"test only fire change event if position changes": function() {
|
||||
var doc = new Document("juhu\nkinners\n123");
|
||||
var anchor = new Anchor(doc, 1, 5);
|
||||
|
||||
anchor.on("change", function(e) {
|
||||
assert.fail();
|
||||
});
|
||||
|
||||
doc.remove(new Range(2, 0, 2, 1));
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
175
vendor/ace/background_tokenizer.js
vendored
Normal file
175
vendor/ace/background_tokenizer.js
vendored
Normal file
@ -0,0 +1,175 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Ajax.org Code Editor (ACE).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ajax.org B.V.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var oop = require("pilot/oop");
|
||||
var EventEmitter = require("pilot/event_emitter").EventEmitter;
|
||||
|
||||
var BackgroundTokenizer = function(tokenizer, editor) {
|
||||
this.running = false;
|
||||
this.lines = [];
|
||||
this.currentLine = 0;
|
||||
this.tokenizer = tokenizer;
|
||||
|
||||
var self = this;
|
||||
|
||||
this.$worker = function() {
|
||||
if (!self.running) { return; }
|
||||
|
||||
var workerStart = new Date();
|
||||
var startLine = self.currentLine;
|
||||
var doc = self.doc;
|
||||
|
||||
var processedLines = 0;
|
||||
|
||||
var len = doc.getLength();
|
||||
while (self.currentLine < len) {
|
||||
self.lines[self.currentLine] = self.$tokenizeRows(self.currentLine, self.currentLine)[0];
|
||||
self.currentLine++;
|
||||
|
||||
// only check every 5 lines
|
||||
processedLines += 1;
|
||||
if ((processedLines % 5 == 0) && (new Date() - workerStart) > 20) {
|
||||
self.fireUpdateEvent(startLine, self.currentLine-1);
|
||||
self.running = setTimeout(self.$worker, 20);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
self.running = false;
|
||||
|
||||
self.fireUpdateEvent(startLine, len - 1);
|
||||
};
|
||||
};
|
||||
|
||||
(function(){
|
||||
|
||||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.setTokenizer = function(tokenizer) {
|
||||
this.tokenizer = tokenizer;
|
||||
this.lines = [];
|
||||
|
||||
this.start(0);
|
||||
};
|
||||
|
||||
this.setDocument = function(doc) {
|
||||
this.doc = doc;
|
||||
this.lines = [];
|
||||
|
||||
this.stop();
|
||||
};
|
||||
|
||||
this.fireUpdateEvent = function(firstRow, lastRow) {
|
||||
var data = {
|
||||
first: firstRow,
|
||||
last: lastRow
|
||||
};
|
||||
this._dispatchEvent("update", {data: data});
|
||||
};
|
||||
|
||||
this.start = function(startRow) {
|
||||
this.currentLine = Math.min(startRow || 0, this.currentLine,
|
||||
this.doc.getLength());
|
||||
|
||||
// remove all cached items below this line
|
||||
this.lines.splice(this.currentLine, this.lines.length);
|
||||
|
||||
this.stop();
|
||||
// pretty long delay to prevent the tokenizer from interfering with the user
|
||||
this.running = setTimeout(this.$worker, 700);
|
||||
};
|
||||
|
||||
this.stop = function() {
|
||||
if (this.running)
|
||||
clearTimeout(this.running);
|
||||
this.running = false;
|
||||
};
|
||||
|
||||
this.getTokens = function(firstRow, lastRow) {
|
||||
return this.$tokenizeRows(firstRow, lastRow);
|
||||
};
|
||||
|
||||
this.getState = function(row) {
|
||||
return this.$tokenizeRows(row, row)[0].state;
|
||||
};
|
||||
|
||||
this.$tokenizeRows = function(firstRow, lastRow) {
|
||||
if (!this.doc)
|
||||
return [];
|
||||
|
||||
var rows = [];
|
||||
|
||||
// determine start state
|
||||
var state = "start";
|
||||
var doCache = false;
|
||||
if (firstRow > 0 && this.lines[firstRow - 1]) {
|
||||
state = this.lines[firstRow - 1].state;
|
||||
doCache = true;
|
||||
} else if (firstRow == 0) {
|
||||
state = "start";
|
||||
doCache = true;
|
||||
} else if (this.lines.length > 0) {
|
||||
// Guess that we haven't changed state.
|
||||
state = this.lines[this.lines.length-1].state;
|
||||
}
|
||||
|
||||
var lines = this.doc.getLines(firstRow, lastRow);
|
||||
for (var row=firstRow; row<=lastRow; row++) {
|
||||
if (!this.lines[row]) {
|
||||
var tokens = this.tokenizer.getLineTokens(lines[row-firstRow] || "", state);
|
||||
var state = tokens.state;
|
||||
rows.push(tokens);
|
||||
|
||||
if (doCache) {
|
||||
this.lines[row] = tokens;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var tokens = this.lines[row];
|
||||
state = tokens.state;
|
||||
rows.push(tokens);
|
||||
}
|
||||
}
|
||||
return rows;
|
||||
};
|
||||
|
||||
}).call(BackgroundTokenizer.prototype);
|
||||
|
||||
exports.BackgroundTokenizer = BackgroundTokenizer;
|
||||
});
|
368
vendor/ace/commands/default_commands.js
vendored
Normal file
368
vendor/ace/commands/default_commands.js
vendored
Normal file
@ -0,0 +1,368 @@
|
||||
/* vim:ts=4:sts=4:sw=4:
|
||||
* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Ajax.org Code Editor (ACE).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ajax.org B.V.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||
* Julian Viereck <julian.viereck@gmail.com>
|
||||
* Mihai Sucan <mihai.sucan@gmail.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var lang = require("pilot/lang");
|
||||
var canon = require("pilot/canon");
|
||||
|
||||
function bindKey(win, mac) {
|
||||
return {
|
||||
win: win,
|
||||
mac: mac,
|
||||
sender: "editor"
|
||||
};
|
||||
}
|
||||
|
||||
canon.addCommand({
|
||||
name: "null",
|
||||
exec: function(env, args, request) { }
|
||||
});
|
||||
|
||||
canon.addCommand({
|
||||
name: "selectall",
|
||||
bindKey: bindKey("Ctrl-A", "Command-A"),
|
||||
exec: function(env, args, request) { env.editor.selectAll(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "removeline",
|
||||
bindKey: bindKey("Ctrl-D", "Command-D"),
|
||||
exec: function(env, args, request) { env.editor.removeLines(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotoline",
|
||||
bindKey: bindKey("Ctrl-L", "Command-L"),
|
||||
exec: function(env, args, request) {
|
||||
var line = parseInt(prompt("Enter line number:"));
|
||||
if (!isNaN(line)) {
|
||||
env.editor.gotoLine(line);
|
||||
}
|
||||
}
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "togglecomment",
|
||||
bindKey: bindKey("Ctrl-7", "Command-7"),
|
||||
exec: function(env, args, request) { env.editor.toggleCommentLines(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "findnext",
|
||||
bindKey: bindKey("Ctrl-K", "Command-G"),
|
||||
exec: function(env, args, request) { env.editor.findNext(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "findprevious",
|
||||
bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"),
|
||||
exec: function(env, args, request) { env.editor.findPrevious(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "find",
|
||||
bindKey: bindKey("Ctrl-F", "Command-F"),
|
||||
exec: function(env, args, request) {
|
||||
var needle = prompt("Find:", env.editor.getCopyText());
|
||||
env.editor.find(needle);
|
||||
}
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "replace",
|
||||
bindKey: bindKey("Ctrl-R", "Command-Option-F"),
|
||||
exec: function(env, args, request) {
|
||||
var needle = prompt("Find:", env.editor.getCopyText());
|
||||
if (!needle)
|
||||
return;
|
||||
var replacement = prompt("Replacement:");
|
||||
if (!replacement)
|
||||
return;
|
||||
env.editor.replace(replacement, {needle: needle});
|
||||
}
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "replaceall",
|
||||
bindKey: bindKey("Ctrl-Shift-R", "Command-Shift-Option-F"),
|
||||
exec: function(env, args, request) {
|
||||
var needle = prompt("Find:");
|
||||
if (!needle)
|
||||
return;
|
||||
var replacement = prompt("Replacement:");
|
||||
if (!replacement)
|
||||
return;
|
||||
env.editor.replaceAll(replacement, {needle: needle});
|
||||
}
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "undo",
|
||||
bindKey: bindKey("Ctrl-Z", "Command-Z"),
|
||||
exec: function(env, args, request) { env.editor.undo(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "redo",
|
||||
bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"),
|
||||
exec: function(env, args, request) { env.editor.redo(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "overwrite",
|
||||
bindKey: bindKey("Insert", "Insert"),
|
||||
exec: function(env, args, request) { env.editor.toggleOverwrite(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "copylinesup",
|
||||
bindKey: bindKey("Ctrl-Alt-Up", "Command-Option-Up"),
|
||||
exec: function(env, args, request) { env.editor.copyLinesUp(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "movelinesup",
|
||||
bindKey: bindKey("Alt-Up", "Option-Up"),
|
||||
exec: function(env, args, request) { env.editor.moveLinesUp(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selecttostart",
|
||||
bindKey: bindKey("Ctrl-Shift-Home|Alt-Shift-Up", "Command-Shift-Up"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectFileStart(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotostart",
|
||||
bindKey: bindKey("Ctrl-Home|Ctrl-Up", "Command-Home|Command-Up"),
|
||||
exec: function(env, args, request) { env.editor.navigateFileStart(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selectup",
|
||||
bindKey: bindKey("Shift-Up", "Shift-Up"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectUp(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "golineup",
|
||||
bindKey: bindKey("Up", "Up|Ctrl-P"),
|
||||
exec: function(env, args, request) { env.editor.navigateUp(args.times); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "copylinesdown",
|
||||
bindKey: bindKey("Ctrl-Alt-Down", "Command-Option-Down"),
|
||||
exec: function(env, args, request) { env.editor.copyLinesDown(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "movelinesdown",
|
||||
bindKey: bindKey("Alt-Down", "Option-Down"),
|
||||
exec: function(env, args, request) { env.editor.moveLinesDown(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selecttoend",
|
||||
bindKey: bindKey("Ctrl-Shift-End|Alt-Shift-Down", "Command-Shift-Down"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectFileEnd(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotoend",
|
||||
bindKey: bindKey("Ctrl-End|Ctrl-Down", "Command-End|Command-Down"),
|
||||
exec: function(env, args, request) { env.editor.navigateFileEnd(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selectdown",
|
||||
bindKey: bindKey("Shift-Down", "Shift-Down"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectDown(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "golinedown",
|
||||
bindKey: bindKey("Down", "Down|Ctrl-N"),
|
||||
exec: function(env, args, request) { env.editor.navigateDown(args.times); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selectwordleft",
|
||||
bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectWordLeft(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotowordleft",
|
||||
bindKey: bindKey("Ctrl-Left", "Option-Left"),
|
||||
exec: function(env, args, request) { env.editor.navigateWordLeft(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selecttolinestart",
|
||||
bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectLineStart(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotolinestart",
|
||||
bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
|
||||
exec: function(env, args, request) { env.editor.navigateLineStart(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selectleft",
|
||||
bindKey: bindKey("Shift-Left", "Shift-Left"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectLeft(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotoleft",
|
||||
bindKey: bindKey("Left", "Left|Ctrl-B"),
|
||||
exec: function(env, args, request) { env.editor.navigateLeft(args.times); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selectwordright",
|
||||
bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectWordRight(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotowordright",
|
||||
bindKey: bindKey("Ctrl-Right", "Option-Right"),
|
||||
exec: function(env, args, request) { env.editor.navigateWordRight(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selecttolineend",
|
||||
bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectLineEnd(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotolineend",
|
||||
bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"),
|
||||
exec: function(env, args, request) { env.editor.navigateLineEnd(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selectright",
|
||||
bindKey: bindKey("Shift-Right", "Shift-Right"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectRight(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotoright",
|
||||
bindKey: bindKey("Right", "Right|Ctrl-F"),
|
||||
exec: function(env, args, request) { env.editor.navigateRight(args.times); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selectpagedown",
|
||||
bindKey: bindKey("Shift-PageDown", "Shift-PageDown"),
|
||||
exec: function(env, args, request) { env.editor.selectPageDown(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "pagedown",
|
||||
bindKey: bindKey(null, "PageDown"),
|
||||
exec: function(env, args, request) { env.editor.scrollPageDown(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotopagedown",
|
||||
bindKey: bindKey("PageDown", "Option-PageDown|Ctrl-V"),
|
||||
exec: function(env, args, request) { env.editor.gotoPageDown(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selectpageup",
|
||||
bindKey: bindKey("Shift-PageUp", "Shift-PageUp"),
|
||||
exec: function(env, args, request) { env.editor.selectPageUp(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "pageup",
|
||||
bindKey: bindKey(null, "PageUp"),
|
||||
exec: function(env, args, request) { env.editor.scrollPageUp(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "gotopageup",
|
||||
bindKey: bindKey("PageUp", "Option-PageUp"),
|
||||
exec: function(env, args, request) { env.editor.gotoPageUp(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selectlinestart",
|
||||
bindKey: bindKey("Shift-Home", "Shift-Home"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectLineStart(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "selectlineend",
|
||||
bindKey: bindKey("Shift-End", "Shift-End"),
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectLineEnd(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "del",
|
||||
bindKey: bindKey("Delete", "Delete|Ctrl-D"),
|
||||
exec: function(env, args, request) { env.editor.removeRight(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "backspace",
|
||||
bindKey: bindKey(
|
||||
"Ctrl-Backspace|Command-Backspace|Option-Backspace|Shift-Backspace|Backspace",
|
||||
"Ctrl-Backspace|Command-Backspace|Shift-Backspace|Backspace|Ctrl-H"
|
||||
),
|
||||
exec: function(env, args, request) { env.editor.removeLeft(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "removetolinestart",
|
||||
bindKey: bindKey(null, "Option-Backspace"),
|
||||
exec: function(env, args, request) { env.editor.removeToLineStart(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "removetolineend",
|
||||
bindKey: bindKey(null, "Ctrl-K"),
|
||||
exec: function(env, args, request) { env.editor.removeToLineEnd(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "removewordleft",
|
||||
bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
|
||||
exec: function(env, args, request) { env.editor.removeWordLeft(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "removewordright",
|
||||
bindKey: bindKey(null, "Alt-Delete"),
|
||||
exec: function(env, args, request) { env.editor.removeWordRight(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "outdent",
|
||||
bindKey: bindKey("Shift-Tab", "Shift-Tab"),
|
||||
exec: function(env, args, request) { env.editor.blockOutdent(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "indent",
|
||||
bindKey: bindKey("Tab", "Tab"),
|
||||
exec: function(env, args, request) { env.editor.indent(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "inserttext",
|
||||
exec: function(env, args, request) {
|
||||
env.editor.insert(lang.stringRepeat(args.text || "", args.times || 1));
|
||||
}
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "centerselection",
|
||||
bindKey: bindKey(null, "Ctrl-L"),
|
||||
exec: function(env, args, request) { env.editor.centerSelection(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "splitline",
|
||||
bindKey: bindKey(null, "Ctrl-O"),
|
||||
exec: function(env, args, request) { env.editor.splitLine(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "transposeletters",
|
||||
bindKey: bindKey("Ctrl-T", "Ctrl-T"),
|
||||
exec: function(env, args, request) { env.editor.transposeLetters(); }
|
||||
});
|
||||
|
||||
});
|
169
vendor/ace/css/editor.css
vendored
Normal file
169
vendor/ace/css/editor.css
vendored
Normal file
@ -0,0 +1,169 @@
|
||||
@import url(http://fonts.googleapis.com/css?family=Droid+Sans+Mono);
|
||||
|
||||
|
||||
.ace_editor {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
font-family: 'Monaco', 'Menlo', 'Droid Sans Mono', 'Courier New', monospace;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ace_scroller {
|
||||
position: absolute;
|
||||
overflow-x: scroll;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.ace_content {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ace_composition {
|
||||
position: absolute;
|
||||
background: #555;
|
||||
color: #DDD;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.ace_gutter {
|
||||
position: absolute;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ace_gutter-cell.ace_error {
|
||||
background-image: url("data:image/gif,GIF89a%10%00%10%00%D5%00%00%F5or%F5%87%88%F5nr%F4ns%EBmq%F5z%7F%DDJT%DEKS%DFOW%F1Yc%F2ah%CE(7%CE)8%D18E%DD%40M%F2KZ%EBU%60%F4%60m%DCir%C8%16(%C8%19*%CE%255%F1%3FR%F1%3FS%E6%AB%B5%CA%5DI%CEn%5E%F7%A2%9A%C9G%3E%E0a%5B%F7%89%85%F5yy%F6%82%80%ED%82%80%FF%BF%BF%E3%C4%C4%FF%FF%FF%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%25%00%2C%00%00%00%00%10%00%10%00%00%06p%C0%92pH%2C%1A%8F%C8%D2H%93%E1d4%23%E4%88%D3%09mB%1DN%B48%F5%90%40%60%92G%5B%94%20%3E%22%D2%87%24%FA%20%24%C5%06A%00%20%B1%07%02B%A38%89X.v%17%82%11%13q%10%0Fi%24%0F%8B%10%7BD%12%0Ei%09%92%09%0EpD%18%15%24%0A%9Ci%05%0C%18F%18%0B%07%04%01%04%06%A0H%18%12%0D%14%0D%12%A1I%B3%B4%B5IA%00%3B");
|
||||
background-repeat: no-repeat;
|
||||
background-position: 4px center;
|
||||
}
|
||||
|
||||
.ace_gutter-cell.ace_warning {
|
||||
background-image: url("data:image/gif,GIF89a%10%00%10%00%D5%00%00%FF%DBr%FF%DE%81%FF%E2%8D%FF%E2%8F%FF%E4%96%FF%E3%97%FF%E5%9D%FF%E6%9E%FF%EE%C1%FF%C8Z%FF%CDk%FF%D0s%FF%D4%81%FF%D5%82%FF%D5%83%FF%DC%97%FF%DE%9D%FF%E7%B8%FF%CCl%7BQ%13%80U%15%82W%16%81U%16%89%5B%18%87%5B%18%8C%5E%1A%94d%1D%C5%83-%C9%87%2F%C6%84.%C6%85.%CD%8B2%C9%871%CB%8A3%CD%8B5%DC%98%3F%DF%9BB%E0%9CC%E1%A5U%CB%871%CF%8B5%D1%8D6%DB%97%40%DF%9AB%DD%99B%E3%B0p%E7%CC%AE%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%2F%00%2C%00%00%00%00%10%00%10%00%00%06a%C0%97pH%2C%1A%8FH%A1%ABTr%25%87%2B%04%82%F4%7C%B9X%91%08%CB%99%1C!%26%13%84*iJ9(%15G%CA%84%14%01%1A%97%0C%03%80%3A%9A%3E%81%84%3E%11%08%B1%8B%20%02%12%0F%18%1A%0F%0A%03'F%1C%04%0B%10%16%18%10%0B%05%1CF%1D-%06%07%9A%9A-%1EG%1B%A0%A1%A0U%A4%A5%A6BA%00%3B");
|
||||
background-repeat: no-repeat;
|
||||
background-position: 4px center;
|
||||
}
|
||||
|
||||
.ace_editor .ace_sb {
|
||||
position: absolute;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.ace_editor .ace_sb div {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.ace_editor .ace_print_margin_layer {
|
||||
z-index: 0;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ace_editor .ace_print_margin {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ace_editor textarea {
|
||||
position: fixed;
|
||||
z-index: -1;
|
||||
width: 10px;
|
||||
height: 30px;
|
||||
opacity: 0;
|
||||
background: transparent;
|
||||
appearance: none;
|
||||
-moz-appearance: none;
|
||||
border: none;
|
||||
resize: none;
|
||||
outline: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ace_layer {
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ace_text-layer {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ace_cjk {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ace_cursor-layer {
|
||||
z-index: 4;
|
||||
cursor: text;
|
||||
/* setting pointer-events: none; here will break mouse wheel scrolling in Safari */
|
||||
}
|
||||
|
||||
.ace_cursor {
|
||||
z-index: 4;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.ace_cursor.ace_hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.ace_line {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ace_marker-layer {
|
||||
cursor: text;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.ace_marker-layer .ace_step {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.ace_marker-layer .ace_selection {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.ace_marker-layer .ace_bracket {
|
||||
position: absolute;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.ace_marker-layer .ace_active_line {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.ace_marker-layer .ace_selected_word {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ace_line .ace_fold {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ace_dragging .ace_marker-layer, .ace_dragging .ace_text-layer {
|
||||
cursor: move;
|
||||
}
|
51
vendor/ace/defaults.js
vendored
Normal file
51
vendor/ace/defaults.js
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
/* vim:ts=4:sts=4:sw=4:
|
||||
* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Ajax.org Code Editor (ACE).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ajax.org B.V.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var settings = require("ace/settings/default-settings")
|
||||
|
||||
exports.startup = function startup(data, reason) {
|
||||
settings.startup(data, reason)
|
||||
}
|
||||
|
||||
exports.shutdown = function shutdown(data, reason) {
|
||||
settings.shutdown(data, reason)
|
||||
}
|
||||
|
||||
})
|
405
vendor/ace/document.js
vendored
Normal file
405
vendor/ace/document.js
vendored
Normal file
@ -0,0 +1,405 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Ajax.org Code Editor (ACE).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ajax.org B.V.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var oop = require("pilot/oop");
|
||||
var EventEmitter = require("pilot/event_emitter").EventEmitter;
|
||||
var Range = require("ace/range").Range;
|
||||
var Anchor = require("ace/anchor").Anchor;
|
||||
|
||||
var Document = function(text) {
|
||||
this.$lines = [];
|
||||
|
||||
if (Array.isArray(text)) {
|
||||
this.insertLines(0, text);
|
||||
}
|
||||
// There has to be one line at least in the document. If you pass an empty
|
||||
// string to the insert function, nothing will happen. Workaround.
|
||||
else if (text.length == 0) {
|
||||
this.$lines = [""];
|
||||
} else {
|
||||
this.insert({row: 0, column:0}, text);
|
||||
}
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
||||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.setValue = function(text) {
|
||||
var len = this.getLength();
|
||||
this.remove(new Range(0, 0, len, this.getLine(len-1).length));
|
||||
this.insert({row: 0, column:0}, text);
|
||||
};
|
||||
|
||||
this.getValue = function() {
|
||||
return this.getAllLines().join(this.getNewLineCharacter());
|
||||
};
|
||||
|
||||
this.createAnchor = function(row, column) {
|
||||
return new Anchor(this, row, column);
|
||||
};
|
||||
|
||||
// check for IE split bug
|
||||
if ("aaa".split(/a/).length == 0)
|
||||
this.$split = function(text) {
|
||||
return text.replace(/\r\n|\r/g, "\n").split("\n");
|
||||
}
|
||||
else
|
||||
this.$split = function(text) {
|
||||
return text.split(/\r\n|\r|\n/);
|
||||
};
|
||||
|
||||
|
||||
this.$detectNewLine = function(text) {
|
||||
var match = text.match(/^.*?(\r\n|\r|\n)/m);
|
||||
if (match) {
|
||||
this.$autoNewLine = match[1];
|
||||
} else {
|
||||
this.$autoNewLine = "\n";
|
||||
}
|
||||
};
|
||||
|
||||
this.getNewLineCharacter = function() {
|
||||
switch (this.$newLineMode) {
|
||||
case "windows":
|
||||
return "\r\n";
|
||||
|
||||
case "unix":
|
||||
return "\n";
|
||||
|
||||
case "auto":
|
||||
return this.$autoNewLine;
|
||||
}
|
||||
},
|
||||
|
||||
this.$autoNewLine = "\n";
|
||||
this.$newLineMode = "auto";
|
||||
this.setNewLineMode = function(newLineMode) {
|
||||
if (this.$newLineMode === newLineMode)
|
||||
return;
|
||||
|
||||
this.$newLineMode = newLineMode;
|
||||
};
|
||||
|
||||
this.getNewLineMode = function() {
|
||||
return this.$newLineMode;
|
||||
};
|
||||
|
||||
this.isNewLine = function(text) {
|
||||
return (text == "\r\n" || text == "\r" || text == "\n");
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a verbatim copy of the given line as it is in the document
|
||||
*/
|
||||
this.getLine = function(row) {
|
||||
return this.$lines[row] || "";
|
||||
};
|
||||
|
||||
this.getLines = function(firstRow, lastRow) {
|
||||
return this.$lines.slice(firstRow, lastRow + 1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns all lines in the document as string array. Warning: The caller
|
||||
* should not modify this array!
|
||||
*/
|
||||
this.getAllLines = function() {
|
||||
return this.getLines(0, this.getLength());
|
||||
};
|
||||
|
||||
this.getLength = function() {
|
||||
return this.$lines.length;
|
||||
};
|
||||
|
||||
this.getTextRange = function(range) {
|
||||
if (range.start.row == range.end.row) {
|
||||
return this.$lines[range.start.row].substring(range.start.column,
|
||||
range.end.column);
|
||||
}
|
||||
else {
|
||||
var lines = [];
|
||||
lines.push(this.$lines[range.start.row].substring(range.start.column));
|
||||
lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1));
|
||||
lines.push(this.$lines[range.end.row].substring(0, range.end.column));
|
||||
return lines.join(this.getNewLineCharacter());
|
||||
}
|
||||
};
|
||||
|
||||
this.$clipPosition = function(position) {
|
||||
var length = this.getLength();
|
||||
if (position.row >= length) {
|
||||
position.row = Math.max(0, length - 1);
|
||||
position.column = this.getLine(length-1).length;
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
this.insert = function(position, text) {
|
||||
if (text.length == 0)
|
||||
return position;
|
||||
|
||||
position = this.$clipPosition(position);
|
||||
|
||||
if (this.getLength() <= 1)
|
||||
this.$detectNewLine(text);
|
||||
|
||||
var lines = this.$split(text);
|
||||
var firstLine = lines.splice(0, 1)[0];
|
||||
var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0];
|
||||
|
||||
position = this.insertInLine(position, firstLine);
|
||||
if (lastLine !== null) {
|
||||
position = this.insertNewLine(position); // terminate first line
|
||||
position = this.insertLines(position.row, lines);
|
||||
position = this.insertInLine(position, lastLine || "");
|
||||
}
|
||||
return position;
|
||||
};
|
||||
|
||||
this.insertLines = function(row, lines) {
|
||||
if (lines.length == 0)
|
||||
return {row: row, column: 0};
|
||||
|
||||
var args = [row, 0];
|
||||
args.push.apply(args, lines);
|
||||
this.$lines.splice.apply(this.$lines, args);
|
||||
|
||||
var range = new Range(row, 0, row + lines.length, 0);
|
||||
var delta = {
|
||||
action: "insertLines",
|
||||
range: range,
|
||||
lines: lines
|
||||
};
|
||||
this._dispatchEvent("change", { data: delta });
|
||||
return range.end;
|
||||
},
|
||||
|
||||
this.insertNewLine = function(position) {
|
||||
position = this.$clipPosition(position);
|
||||
var line = this.$lines[position.row] || "";
|
||||
|
||||
this.$lines[position.row] = line.substring(0, position.column);
|
||||
this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length));
|
||||
|
||||
var end = {
|
||||
row : position.row + 1,
|
||||
column : 0
|
||||
};
|
||||
|
||||
var delta = {
|
||||
action: "insertText",
|
||||
range: Range.fromPoints(position, end),
|
||||
text: this.getNewLineCharacter()
|
||||
};
|
||||
this._dispatchEvent("change", { data: delta });
|
||||
|
||||
return end;
|
||||
};
|
||||
|
||||
this.insertInLine = function(position, text) {
|
||||
if (text.length == 0)
|
||||
return position;
|
||||
|
||||
var line = this.$lines[position.row] || "";
|
||||
|
||||
this.$lines[position.row] = line.substring(0, position.column) + text
|
||||
+ line.substring(position.column);
|
||||
|
||||
var end = {
|
||||
row : position.row,
|
||||
column : position.column + text.length
|
||||
};
|
||||
|
||||
var delta = {
|
||||
action: "insertText",
|
||||
range: Range.fromPoints(position, end),
|
||||
text: text
|
||||
};
|
||||
this._dispatchEvent("change", { data: delta });
|
||||
|
||||
return end;
|
||||
};
|
||||
|
||||
this.remove = function(range) {
|
||||
// clip to document
|
||||
range.start = this.$clipPosition(range.start);
|
||||
range.end = this.$clipPosition(range.end);
|
||||
|
||||
if (range.isEmpty())
|
||||
return range.start;
|
||||
|
||||
var firstRow = range.start.row;
|
||||
var lastRow = range.end.row;
|
||||
|
||||
if (range.isMultiLine()) {
|
||||
var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1;
|
||||
var lastFullRow = lastRow - 1;
|
||||
|
||||
if (range.end.column > 0)
|
||||
this.removeInLine(lastRow, 0, range.end.column);
|
||||
|
||||
if (lastFullRow >= firstFullRow)
|
||||
this.removeLines(firstFullRow, lastFullRow);
|
||||
|
||||
if (firstFullRow != firstRow) {
|
||||
this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length);
|
||||
this.removeNewLine(range.start.row);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.removeInLine(firstRow, range.start.column, range.end.column);
|
||||
}
|
||||
return range.start;
|
||||
};
|
||||
|
||||
this.removeInLine = function(row, startColumn, endColumn) {
|
||||
if (startColumn == endColumn)
|
||||
return;
|
||||
|
||||
var range = new Range(row, startColumn, row, endColumn);
|
||||
var line = this.getLine(row);
|
||||
var removed = line.substring(startColumn, endColumn);
|
||||
var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length);
|
||||
this.$lines.splice(row, 1, newLine);
|
||||
|
||||
var delta = {
|
||||
action: "removeText",
|
||||
range: range,
|
||||
text: removed
|
||||
};
|
||||
this._dispatchEvent("change", { data: delta });
|
||||
return range.start;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes a range of full lines
|
||||
*
|
||||
* @param firstRow {Integer} The first row to be removed
|
||||
* @param lastRow {Integer} The last row to be removed
|
||||
* @return {String[]} The removed lines
|
||||
*/
|
||||
this.removeLines = function(firstRow, lastRow) {
|
||||
var range = new Range(firstRow, 0, lastRow + 1, 0);
|
||||
var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1);
|
||||
|
||||
var delta = {
|
||||
action: "removeLines",
|
||||
range: range,
|
||||
nl: this.getNewLineCharacter(),
|
||||
lines: removed
|
||||
};
|
||||
this._dispatchEvent("change", { data: delta });
|
||||
return removed;
|
||||
};
|
||||
|
||||
this.removeNewLine = function(row) {
|
||||
var firstLine = this.getLine(row);
|
||||
var secondLine = this.getLine(row+1);
|
||||
|
||||
var range = new Range(row, firstLine.length, row+1, 0);
|
||||
var line = firstLine + secondLine;
|
||||
|
||||
this.$lines.splice(row, 2, line);
|
||||
|
||||
var delta = {
|
||||
action: "removeText",
|
||||
range: range,
|
||||
text: this.getNewLineCharacter()
|
||||
};
|
||||
this._dispatchEvent("change", { data: delta });
|
||||
};
|
||||
|
||||
this.replace = function(range, text) {
|
||||
if (text.length == 0 && range.isEmpty())
|
||||
return range.start;
|
||||
|
||||
// Shortcut: If the text we want to insert is the same as it is already
|
||||
// in the document, we don't have to replace anything.
|
||||
if (text == this.getTextRange(range))
|
||||
return range.end;
|
||||
|
||||
this.remove(range);
|
||||
if (text) {
|
||||
var end = this.insert(range.start, text);
|
||||
}
|
||||
else {
|
||||
end = range.start;
|
||||
}
|
||||
|
||||
return end;
|
||||
};
|
||||
|
||||
this.applyDeltas = function(deltas) {
|
||||
for (var i=0; i<deltas.length; i++) {
|
||||
var delta = deltas[i];
|
||||
var range = Range.fromPoints(delta.range.start, delta.range.end);
|
||||
|
||||
if (delta.action == "insertLines")
|
||||
this.insertLines(range.start.row, delta.lines)
|
||||
else if (delta.action == "insertText")
|
||||
this.insert(range.start, delta.text)
|
||||
else if (delta.action == "removeLines")
|
||||
this.removeLines(range.start.row, range.end.row - 1)
|
||||
else if (delta.action == "removeText")
|
||||
this.remove(range)
|
||||
}
|
||||
};
|
||||
|
||||
this.revertDeltas = function(deltas) {
|
||||
for (var i=deltas.length-1; i>=0; i--) {
|
||||
var delta = deltas[i];
|
||||
|
||||
var range = Range.fromPoints(delta.range.start, delta.range.end);
|
||||
|
||||
if (delta.action == "insertLines")
|
||||
this.removeLines(range.start.row, range.end.row - 1)
|
||||
else if (delta.action == "insertText")
|
||||
this.remove(range)
|
||||
else if (delta.action == "removeLines")
|
||||
this.insertLines(range.start.row, delta.lines)
|
||||
else if (delta.action == "removeText")
|
||||
this.insert(range.start, delta.text)
|
||||
}
|
||||
};
|
||||
|
||||
}).call(Document.prototype);
|
||||
|
||||
exports.Document = Document;
|
||||
});
|
313
vendor/ace/document_test.js
vendored
Normal file
313
vendor/ace/document_test.js
vendored
Normal file
@ -0,0 +1,313 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Ajax.org Code Editor (ACE).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ajax.org B.V.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||
* Julian Viereck <julian.viereck@gmail.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
if (typeof process !== "undefined") {
|
||||
require("../../support/paths");
|
||||
require("ace/test/mockdom");
|
||||
}
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var Document = require("ace/document").Document;
|
||||
var Range = require("ace/range").Range;
|
||||
var assert = require("ace/test/assertions");
|
||||
|
||||
module.exports = {
|
||||
|
||||
"test: insert text in line" : function() {
|
||||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.insert({row: 0, column: 1}, "juhu");
|
||||
assert.equal(doc.getValue(), ["1juhu2", "34"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
doc.revertDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
||||
|
||||
doc.applyDeltas(d);
|
||||
assert.equal(doc.getValue(), ["1juhu2", "34"].join("\n"));
|
||||
},
|
||||
|
||||
"test: insert new line" : function() {
|
||||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.insertNewLine({row: 0, column: 1});
|
||||
assert.equal(doc.getValue(), ["1", "2", "34"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
doc.revertDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
||||
|
||||
doc.applyDeltas(d);
|
||||
assert.equal(doc.getValue(), ["1", "2", "34"].join("\n"));
|
||||
},
|
||||
|
||||
"test: insert lines at the beginning" : function() {
|
||||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.insertLines(0, ["aa", "bb"]);
|
||||
assert.equal(doc.getValue(), ["aa", "bb", "12", "34"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
doc.revertDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
||||
|
||||
doc.applyDeltas(d);
|
||||
assert.equal(doc.getValue(), ["aa", "bb", "12", "34"].join("\n"));
|
||||
},
|
||||
|
||||
"test: insert lines at the end" : function() {
|
||||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.insertLines(2, ["aa", "bb"]);
|
||||
assert.equal(doc.getValue(), ["12", "34", "aa", "bb"].join("\n"));
|
||||
},
|
||||
|
||||
"test: insert lines in the middle" : function() {
|
||||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.insertLines(1, ["aa", "bb"]);
|
||||
assert.equal(doc.getValue(), ["12", "aa", "bb", "34"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
doc.revertDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
||||
|
||||
doc.applyDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12", "aa", "bb", "34"].join("\n"));
|
||||
},
|
||||
|
||||
"test: insert multi line string at the start" : function() {
|
||||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.insert({row: 0, column: 0}, "aa\nbb\ncc");
|
||||
assert.equal(doc.getValue(), ["aa", "bb", "cc12", "34"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
doc.revertDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
||||
|
||||
doc.applyDeltas(d);
|
||||
assert.equal(doc.getValue(), ["aa", "bb", "cc12", "34"].join("\n"));
|
||||
},
|
||||
|
||||
"test: insert multi line string at the end" : function() {
|
||||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.insert({row: 2, column: 0}, "aa\nbb\ncc");
|
||||
assert.equal(doc.getValue(), ["12", "34aa", "bb", "cc"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
doc.revertDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
||||
|
||||
doc.applyDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12", "34aa", "bb", "cc"].join("\n"));
|
||||
},
|
||||
|
||||
"test: insert multi line string in the middle" : function() {
|
||||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.insert({row: 0, column: 1}, "aa\nbb\ncc");
|
||||
assert.equal(doc.getValue(), ["1aa", "bb", "cc2", "34"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
doc.revertDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
||||
|
||||
doc.applyDeltas(d);
|
||||
assert.equal(doc.getValue(), ["1aa", "bb", "cc2", "34"].join("\n"));
|
||||
},
|
||||
|
||||
"test: delete in line" : function() {
|
||||
var doc = new Document(["1234", "5678"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.remove(new Range(0, 1, 0, 3));
|
||||
assert.equal(doc.getValue(), ["14", "5678"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
doc.revertDeltas(d);
|
||||
assert.equal(doc.getValue(), ["1234", "5678"].join("\n"));
|
||||
|
||||
doc.applyDeltas(d);
|
||||
assert.equal(doc.getValue(), ["14", "5678"].join("\n"));
|
||||
},
|
||||
|
||||
"test: delete new line" : function() {
|
||||
var doc = new Document(["1234", "5678"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.remove(new Range(0, 4, 1, 0));
|
||||
assert.equal(doc.getValue(), ["12345678"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
doc.revertDeltas(d);
|
||||
assert.equal(doc.getValue(), ["1234", "5678"].join("\n"));
|
||||
|
||||
doc.applyDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12345678"].join("\n"));
|
||||
},
|
||||
|
||||
"test: delete multi line range line" : function() {
|
||||
var doc = new Document(["1234", "5678", "abcd"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.remove(new Range(0, 2, 2, 2));
|
||||
assert.equal(doc.getValue(), ["12cd"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
doc.revertDeltas(d);
|
||||
assert.equal(doc.getValue(), ["1234", "5678", "abcd"].join("\n"));
|
||||
|
||||
doc.applyDeltas(d);
|
||||
assert.equal(doc.getValue(), ["12cd"].join("\n"));
|
||||
},
|
||||
|
||||
"test: delete full lines" : function() {
|
||||
var doc = new Document(["1234", "5678", "abcd"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
|
||||
doc.remove(new Range(1, 0, 3, 0));
|
||||
assert.equal(doc.getValue(), ["1234", ""].join("\n"));
|
||||
},
|
||||
|
||||
"test: remove lines should return the removed lines" : function() {
|
||||
var doc = new Document(["1234", "5678", "abcd"]);
|
||||
|
||||
var removed = doc.removeLines(1, 2);
|
||||
assert.equal(removed.join("\n"), ["5678", "abcd"].join("\n"));
|
||||
},
|
||||
|
||||
"test: should handle unix style new lines" : function() {
|
||||
var doc = new Document(["1", "2", "3"]);
|
||||
assert.equal(doc.getValue(), ["1", "2", "3"].join("\n"));
|
||||
},
|
||||
|
||||
"test: should handle windows style new lines" : function() {
|
||||
var doc = new Document(["1", "2", "3"].join("\r\n"));
|
||||
|
||||
doc.setNewLineMode("unix");
|
||||
assert.equal(doc.getValue(), ["1", "2", "3"].join("\n"));
|
||||
},
|
||||
|
||||
"test: set new line mode to 'windows' should use '\\r\\n' as new lines": function() {
|
||||
var doc = new Document(["1", "2", "3"].join("\n"));
|
||||
doc.setNewLineMode("windows");
|
||||
assert.equal(doc.getValue(), ["1", "2", "3"].join("\r\n"));
|
||||
},
|
||||
|
||||
"test: set new line mode to 'unix' should use '\\n' as new lines": function() {
|
||||
var doc = new Document(["1", "2", "3"].join("\r\n"));
|
||||
|
||||
doc.setNewLineMode("unix");
|
||||
assert.equal(doc.getValue(), ["1", "2", "3"].join("\n"));
|
||||
},
|
||||
|
||||
"test: set new line mode to 'auto' should detect the incoming nl type": function() {
|
||||
var doc = new Document(["1", "2", "3"].join("\n"));
|
||||
|
||||
doc.setNewLineMode("auto");
|
||||
assert.equal(doc.getValue(), ["1", "2", "3"].join("\n"));
|
||||
|
||||
var doc = new Document(["1", "2", "3"].join("\r\n"));
|
||||
|
||||
doc.setNewLineMode("auto");
|
||||
assert.equal(doc.getValue(), ["1", "2", "3"].join("\r\n"));
|
||||
|
||||
doc.replace(new Range(0, 0, 2, 1), ["4", "5", "6"].join("\n"));
|
||||
assert.equal(["4", "5", "6"].join("\n"), doc.getValue());
|
||||
},
|
||||
|
||||
"test: set value": function() {
|
||||
var doc = new Document("1");
|
||||
assert.equal("1", doc.getValue());
|
||||
|
||||
doc.setValue(doc.getValue());
|
||||
assert.equal("1", doc.getValue());
|
||||
|
||||
var doc = new Document("1\n2");
|
||||
assert.equal("1\n2", doc.getValue());
|
||||
|
||||
doc.setValue(doc.getValue());
|
||||
assert.equal("1\n2", doc.getValue());
|
||||
},
|
||||
|
||||
"test: empty document has to contain one line": function() {
|
||||
var doc = new Document("");
|
||||
assert.equal(doc.$lines.length, 1);
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
1711
vendor/ace/edit_session.js
vendored
Normal file
1711
vendor/ace/edit_session.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
79
vendor/ace/edit_session/fold.js
vendored
Normal file
79
vendor/ace/edit_session/fold.js
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
/* vim:ts=4:sts=4:sw=4:
|
||||
* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Ajax.org Code Editor (ACE).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ajax.org B.V.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Julian Viereck <julian DOT viereck AT gmail DOT com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
/**
|
||||
* Simple fold-data struct.
|
||||
**/
|
||||
var Fold = exports.Fold = function(range, placeholder) {
|
||||
this.foldLine = null;
|
||||
this.placeholder = placeholder;
|
||||
this.range = range;
|
||||
this.start = range.start;
|
||||
this.end = range.end;
|
||||
|
||||
this.sameRow = range.start.row == range.end.row;
|
||||
this.subFolds = [];
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
||||
this.toString = function() {
|
||||
return '"' + this.placeholder + '" ' + this.range.toString();
|
||||
};
|
||||
|
||||
this.setFoldLine = function(foldLine) {
|
||||
this.foldLine = foldLine;
|
||||
this.subFolds.forEach(function(fold) {
|
||||
fold.setFoldLine(foldLine);
|
||||
});
|
||||
};
|
||||
|
||||
this.clone = function() {
|
||||
var range = this.range.clone();
|
||||
var fold = new Fold(range, this.placeholder);
|
||||
this.subFolds.forEach(function(subFold) {
|
||||
fold.subFolds.push(subFold.clone());
|
||||
});
|
||||
return fold;
|
||||
};
|
||||
|
||||
}).call(Fold.prototype);
|
||||
|
||||
});
|
273
vendor/ace/edit_session/fold_line.js
vendored
Normal file
273
vendor/ace/edit_session/fold_line.js
vendored
Normal file
@ -0,0 +1,273 @@
|
||||
/* vim:ts=4:sts=4:sw=4:
|
||||
* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Ajax.org Code Editor (ACE).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ajax.org B.V.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Julian Viereck <julian DOT viereck AT gmail DOT com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var Range = require("ace/range").Range;
|
||||
|
||||
/**
|
||||
* If the an array is passed in, the folds are expected to be sorted already.
|
||||
*/
|
||||
function FoldLine(foldData, folds) {
|
||||
this.foldData = foldData;
|
||||
if (Array.isArray(folds)) {
|
||||
this.folds = folds;
|
||||
} else {
|
||||
folds = this.folds = [ folds ];
|
||||
}
|
||||
|
||||
var last = folds[folds.length - 1]
|
||||
this.range = new Range(folds[0].start.row, folds[0].start.column,
|
||||
last.end.row, last.end.column);
|
||||
this.start = this.range.start;
|
||||
this.end = this.range.end;
|
||||
|
||||
this.folds.forEach(function(fold) {
|
||||
fold.setFoldLine(this);
|
||||
}, this);
|
||||
}
|
||||
|
||||
(function() {
|
||||
/**
|
||||
* Note: This doesn't update wrapData!
|
||||
*/
|
||||
this.shiftRow = function(shift) {
|
||||
this.start.row += shift;
|
||||
this.end.row += shift;
|
||||
this.folds.forEach(function(fold) {
|
||||
fold.start.row += shift;
|
||||
fold.end.row += shift;
|
||||
});
|
||||
}
|
||||
|
||||
this.addFold = function(fold) {
|
||||
if (fold.sameRow) {
|
||||
if (fold.start.row < this.startRow || fold.endRow > this.endRow) {
|
||||
throw "Can't add a fold to this FoldLine as it has no connection";
|
||||
}
|
||||
this.folds.push(fold);
|
||||
this.folds.sort(function(a, b) {
|
||||
return -a.range.compareEnd(b.start.row, b.start.column);
|
||||
});
|
||||
if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) {
|
||||
this.end.row = fold.end.row;
|
||||
this.end.column = fold.end.column;
|
||||
} else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) {
|
||||
this.start.row = fold.start.row;
|
||||
this.start.column = fold.start.column;
|
||||
}
|
||||
} else if (fold.start.row == this.end.row) {
|
||||
this.folds.push(fold);
|
||||
this.end.row = fold.end.row;
|
||||
this.end.column = fold.end.column;
|
||||
} else if (fold.end.row == this.start.row) {
|
||||
this.folds.unshift(fold);
|
||||
this.start.row = fold.start.row;
|
||||
this.start.column = fold.start.column;
|
||||
} else {
|
||||
throw "Trying to add fold to FoldRow that doesn't have a matching row";
|
||||
}
|
||||
fold.foldLine = this;
|
||||
}
|
||||
|
||||
this.containsRow = function(row) {
|
||||
return row >= this.start.row && row <= this.end.row;
|
||||
}
|
||||
|
||||
this.walk = function(callback, endRow, endColumn) {
|
||||
var lastEnd = 0,
|
||||
folds = this.folds,
|
||||
fold,
|
||||
comp, stop, isNewRow = true;
|
||||
|
||||
if (endRow == null) {
|
||||
endRow = this.end.row;
|
||||
endColumn = this.end.column;
|
||||
}
|
||||
|
||||
for (var i = 0; i < folds.length; i++) {
|
||||
fold = folds[i];
|
||||
|
||||
comp = fold.range.compareStart(endRow, endColumn);
|
||||
// This fold is after the endRow/Column.
|
||||
if (comp == -1) {
|
||||
callback(null, endRow, endColumn, lastEnd, isNewRow);
|
||||
return;
|
||||
}
|
||||
|
||||
stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow);
|
||||
stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd);
|
||||
|
||||
// If the user requested to stop the walk or endRow/endColumn is
|
||||
// inside of this fold (comp == 0), then end here.
|
||||
if (stop || comp == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Note the new lastEnd might not be on the same line. However,
|
||||
// it's the callback's job to recognize this.
|
||||
isNewRow = !fold.sameRow;
|
||||
lastEnd = fold.end.column;
|
||||
}
|
||||
callback(null, endRow, endColumn, lastEnd, isNewRow);
|
||||
}
|
||||
|
||||
this.getNextFoldTo = function(row, column) {
|
||||
var fold, cmp;
|
||||
for (var i = 0; i < this.folds.length; i++) {
|
||||
fold = this.folds[i];
|
||||
cmp = fold.range.compareEnd(row, column);
|
||||
if (cmp == -1) {
|
||||
return {
|
||||
fold: fold,
|
||||
kind: "after"
|
||||
};
|
||||
} else if (cmp == 0) {
|
||||
return {
|
||||
fold: fold,
|
||||
kind: "inside"
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
this.addRemoveChars = function(row, column, len) {
|
||||
var ret = this.getNextFoldTo(row, column),
|
||||
fold, folds;
|
||||
if (ret) {
|
||||
fold = ret.fold;
|
||||
if (ret.kind == "inside"
|
||||
&& fold.start.column != column
|
||||
&& fold.start.row != row)
|
||||
{
|
||||
throw "Moving characters inside of a fold should never be reached";
|
||||
} else if (fold.start.row == row) {
|
||||
folds = this.folds;
|
||||
var i = folds.indexOf(fold);
|
||||
if (i == 0) {
|
||||
this.start.column += len;
|
||||
}
|
||||
for (i; i < folds.length; i++) {
|
||||
fold = folds[i];
|
||||
fold.start.column += len;
|
||||
if (!fold.sameRow) {
|
||||
return;
|
||||
}
|
||||
fold.end.column += len;
|
||||
}
|
||||
this.end.column += len;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.split = function(row, column) {
|
||||
var fold = this.getNextFoldTo(row, column).fold,
|
||||
folds = this.folds;
|
||||
var foldData = this.foldData;
|
||||
|
||||
if (!fold) {
|
||||
return null;
|
||||
}
|
||||
var i = folds.indexOf(fold);
|
||||
var foldBefore = folds[i - 1];
|
||||
this.end.row = foldBefore.end.row;
|
||||
this.end.column = foldBefore.end.column;
|
||||
|
||||
// Remove the folds after row/column and create a new FoldLine
|
||||
// containing these removed folds.
|
||||
folds = folds.splice(i, folds.length - i);
|
||||
|
||||
var newFoldLine = new FoldLine(foldData, folds);
|
||||
foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine);
|
||||
return newFoldLine;
|
||||
}
|
||||
|
||||
this.merge = function(foldLineNext) {
|
||||
var folds = foldLineNext.folds;
|
||||
for (var i = 0; i < folds.length; i++) {
|
||||
this.addFold(folds[i]);
|
||||
}
|
||||
// Remove the foldLineNext - no longer needed, as
|
||||
// it's merged now with foldLineNext.
|
||||
var foldData = this.foldData;
|
||||
foldData.splice(foldData.indexOf(foldLineNext), 1);
|
||||
}
|
||||
|
||||
this.toString = function() {
|
||||
var ret = [this.range.toString() + ": [" ];
|
||||
|
||||
this.folds.forEach(function(fold) {
|
||||
ret.push(" " + fold.toString());
|
||||
});
|
||||
ret.push("]")
|
||||
return ret.join("\n");
|
||||
}
|
||||
|
||||
this.idxToPosition = function(idx) {
|
||||
var lastFoldEndColumn = 0;
|
||||
var fold;
|
||||
|
||||
for (var i = 0; i < this.folds.length; i++) {
|
||||
var fold = this.folds[i];
|
||||
|
||||
idx -= fold.start.column - lastFoldEndColumn;
|
||||
if (idx < 0) {
|
||||
return {
|
||||
row: fold.start.row,
|
||||
column: fold.start.column + idx
|
||||
};
|
||||
}
|
||||
|
||||
idx -= fold.placeholder.length;
|
||||
if (idx < 0) {
|
||||
return fold.start;
|
||||
}
|
||||
|
||||
lastFoldEndColumn = fold.end.column;
|
||||
}
|
||||
|
||||
return {
|
||||
row: this.end.row,
|
||||
column: this.end.column + idx
|
||||
};
|
||||
}
|
||||
}).call(FoldLine.prototype);
|
||||
|
||||
exports.FoldLine = FoldLine;
|
||||
});
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user