Permalink
Browse files

[UPDATES] changed documentation and code and such, to reflect the nam…

…e change from "Extras" to "Plugins" for the loadable bundles.
  • Loading branch information...
1 parent 3b6bfc5 commit 11ffa55bd030c0308c65a628e2065aa72f27d841 @ccgus committed Apr 12, 2009
View
@@ -70,7 +70,14 @@ Give me an example
------------------
Here's an AppleScript example, for adding a new rectangle object to a sketch document:
-tell application "Sketch" tell document 1 set o to make new box set width of o to 100 set height of o to 100 set stroke thickness of o to 10 end tellend tell
+tell application "Sketch"
+ tell document 1
+ set o to make new box
+ set width of o to 100
+ set height of o to 100
+ set stroke thickness of o to 10
+ end tell
+end tell
And here's how you do it with JSTalk, using a doctored version of Sketch(6 lines of code, + the JSTalk framework):
@@ -113,16 +120,14 @@ Although this is great to have, it's not the same as an application natively sup
-JSTalk Extras
--------------
+JSTalk Plugins
+--------------
Aka, loadable bundles which add functionality to JSTalk, via helper classes, wrappers, and categories.
-JSTalk comes with some standard helper categories (which you can currently find in JSTalkExtras.m), but it will also look in your ~/Library/Application Support/JSTalk/Extras/ folder, and load any .jstalkextra bundles it sees. You can turn this off in your application if you don't like that idea, via [JSTalk setShouldLoadExtras:NO];
+JSTalk comes with some standard helper categories (which you can currently find in JSTalkExtras.m), but it will also look in your ~/Library/Application Support/JSTalk/Plug-ins/ folder, and load any .jstplugin bundles it sees. You can turn this off in your application if you don't like that idea, via [JSTalk setShouldLoadJSTPlugins:NO];
-There are two examples with JSTalk, one that just adds a category cocoa's string class: - [NSString reversedString]. The other example is "FMDB.jstalkextra", which loads the FMDB Sqlite classes, for use in JSTalk. This allows you to use sqlite to create, insert, update, etc, sql tables from JSTalk.
-
-I'm thinking of changing the extension for these bundles from .jstalkextra, to something like .jxtra or .jstalkx. Let me know if you have any good ideas!
+There are two examples with JSTalk, one that just adds a category cocoa's string class: - [NSString reversedString]. The other example is "FMDB.jstplugin", which loads the FMDB SQLite classes, for use in JSTalk. This allows you to use sqlite to create, insert, update, etc, sql tables from JSTalk.
@@ -481,15 +481,14 @@
<string>1058C7ACFEA557BF11CA2CBB</string>
<string>19C28FB8FE9D52D311CA2CBB</string>
<string>1C37FBAC04509CD000000102</string>
- <string>CCCFE0FE0F83492C005161C9</string>
- <string>CCCFE0FF0F83492C005161C9</string>
<string>1C37FAAC04509CD000000102</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>10</integer>
+ <integer>3</integer>
+ <integer>1</integer>
<integer>0</integer>
</array>
</array>
@@ -534,7 +533,7 @@
</array>
<key>TableOfContents</key>
<array>
- <string>CCCFE1000F83492C005161C9</string>
+ <string>CCD46E4D0F928A9F004DF671</string>
<string>11E0B1FE06471DED0097A5F4</string>
</array>
<key>ToolbarConfiguration</key>
@@ -550,7 +549,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>260262188.43326101</real>
+ <real>261261976.46967199</real>
<key>ToolbarDisplayMode</key>
<integer>2</integer>
<key>ToolbarIsVisible</key>
@@ -565,9 +564,6 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>CCC7E6100ECA3D78001F3E02</string>
- <string>1CD10A99069EF8BA00B06720</string>
- <string>CCCFE1010F83492C005161C9</string>
<string>/Volumes/srv/Users/gus/Projects/jstalk/extras/acornplugin/jsenabler.xcodeproj</string>
</array>
<key>WindowString</key>
@@ -50,8 +50,8 @@
PBXFileDataSource_Target_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 260261947;
- PBXWorkspaceStateSaveDate = 260261947;
+ PBXPerProjectTemplateStateSaveDate = 261261976;
+ PBXWorkspaceStateSaveDate = 261261976;
};
sourceControlManager = CCC7E60A0ECA3C50001F3E02 /* Source Control */;
userBuildSettings = {
@@ -69,7 +69,7 @@
};
CC726D6B0F1568BC00EB02AF /* JSEnablerPlugIn.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1057, 1456}}";
+ sepNavIntBoundsRect = "{{0, 0}, {973, 1456}}";
sepNavSelRange = "{2352, 0}";
sepNavVisRange = "{0, 2231}";
};
@@ -465,15 +465,13 @@
<string>1058C7AEFEA557BF11CA2CBB</string>
<string>19C28FB8FE9D52D311CA2CBB</string>
<string>1C37FBAC04509CD000000102</string>
- <string>CCCFE0DE0F83481D005161C9</string>
- <string>CCCFE0DF0F83481D005161C9</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>7</integer>
- <integer>5</integer>
+ <integer>3</integer>
+ <integer>1</integer>
<integer>0</integer>
</array>
</array>
@@ -516,7 +514,7 @@
</array>
<key>TableOfContents</key>
<array>
- <string>CCCFE0E00F83481D005161C9</string>
+ <string>CCD46E560F928AAB004DF671</string>
<string>11E0B1FE06471DED0097A5F4</string>
</array>
<key>ToolbarConfiguration</key>
@@ -532,7 +530,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>260261917.712212</real>
+ <real>261261990.312612</real>
<key>ToolbarDisplayMode</key>
<integer>2</integer>
<key>ToolbarIsVisible</key>
@@ -547,8 +545,7 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>CCCFE0E10F83481D005161C9</string>
- <string>CCCFE0BB0F834505005161C9</string>
+ <string>CCD46E570F928AAB004DF671</string>
<string>/Volumes/srv/Users/gus/Projects/jstalk/extras/voodoopadplugin/VPJSTalkPlugin.xcodeproj</string>
</array>
<key>WindowString</key>
@@ -30,8 +30,8 @@
PBXFileDataSource_Target_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 260261068;
- PBXWorkspaceStateSaveDate = 260261068;
+ PBXPerProjectTemplateStateSaveDate = 261261990;
+ PBXWorkspaceStateSaveDate = 261261990;
};
sourceControlManager = CC41A1CB0F5E17780055DBC7 /* Source Control */;
userBuildSettings = {
@@ -67,9 +67,9 @@
};
CC6080570EA410F400A1244C /* JavaScriptPluginEnabler.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1057, 4942}}";
- sepNavSelRange = "{13283, 0}";
- sepNavVisRange = "{11046, 2243}";
+ sepNavIntBoundsRect = "{{0, 0}, {973, 4788}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 2695}";
};
};
}
View
@@ -38,7 +38,7 @@ - (void)awakeFromNib {
[self restoreWorkspace];
}
- [JSTalk setShouldLoadExtras:YES];
+ [JSTalk setShouldLoadJSTPlugins:YES];
[JSTalk listen];
}
View
@@ -26,7 +26,7 @@
- (id) callFunctionNamed:(NSString*)name withArguments:(NSArray*)args;
+ (void) listen;
-+ (void) setShouldLoadExtras:(BOOL)b;
++ (void) setShouldLoadJSTPlugins:(BOOL)b;
+ (id) application:(NSString*)app;
@end
View
@@ -11,8 +11,8 @@
#import "JSTPreprocessor.h"
#import <ScriptingBridge/ScriptingBridge.h>
-static BOOL JSTalkShouldLoadExtras = YES;
-static NSMutableArray *JSTalkExtrasList;
+static BOOL JSTalkShouldLoadJSTPlugins = YES;
+static NSMutableArray *JSTalkPluginList;
@interface JSTalk (Private)
- (void) print:(NSString*)s;
@@ -33,7 +33,11 @@ + (void) listen {
}
+ (void) setShouldLoadExtras:(BOOL)b {
- JSTalkShouldLoadExtras = b;
+ JSTalkShouldLoadJSTPlugins = b;
+}
+
++ (void) setShouldLoadJSTPlugins:(BOOL)b {
+ JSTalkShouldLoadJSTPlugins = b;
}
- (id) init {
@@ -109,8 +113,8 @@ - (void) loadExtraAtPath:(NSString*) fullPath {
}
-- (void) loadExtras {
- JSTalkExtrasList = [[NSMutableArray array] retain];
+- (void) loadPlugins {
+ JSTalkPluginList = [[NSMutableArray array] retain];
NSString *appSupport = @"Library/Application Support/JSTalk/Plug-ins";
NSString *appPath = [[NSBundle mainBundle] builtInPlugInsPath];
@@ -151,8 +155,8 @@ - (void) pushObject:(id)obj withName:(NSString*)name inController:(JSCocoaContro
- (void) executeString:(NSString*) str {
- if (!JSTalkExtrasList && JSTalkShouldLoadExtras) {
- [self loadExtras];
+ if (!JSTalkPluginList && JSTalkShouldLoadJSTPlugins) {
+ [self loadPlugins];
}
str = [JSTPreprocessor preprocessCode:str];

0 comments on commit 11ffa55

Please sign in to comment.