Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added some hooks so that extras can have their class loaded at startu…

…p, and be given the opportunity to mess with the UI.
  • Loading branch information...
commit 9db46e0460a0a28c6e4eb704800db8839d0fdfdf 1 parent dc79693
@ccgus authored
View
3  src/JSTAppDelegate.m
@@ -24,7 +24,6 @@ @implementation JSTAppDelegate
+ (void)initialize {
-
NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@@ -55,6 +54,8 @@ - (void)awakeFromNib {
// have all the services menus get updated.
//NSUpdateDynamicServices();
+
+ [JSTalk loadPlugins]; // some guys will setup custom UI in the app.
}
- (IBAction)showPrefs:(id)sender {
View
4 src/JSTDocument.m
@@ -44,6 +44,10 @@ - (void)dealloc {
[super dealloc];
}
++ (BOOL)autosavesInPlace {
+ // defaults write org.jstalk.JSTalkEditor autosavesInPlace 1
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"autosavesInPlace"];
+}
- (NSString *)windowNibName {
return @"JSTDocument";
View
1  src/JSTalk.h
@@ -32,6 +32,7 @@
+ (void)listen;
+ (void)resetPlugins;
++ (void)loadPlugins;
+ (void)setShouldLoadJSTPlugins:(BOOL)b;
+ (id)application:(NSString*)app;
+ (id)app:(NSString*)app;
View
8 src/JSTalk.m
@@ -75,7 +75,7 @@ - (void)dealloc {
[super dealloc];
}
-- (void)loadExtraAtPath:(NSString*)fullPath {
++ (void)loadExtraAtPath:(NSString*)fullPath {
Class pluginClass;
@@ -93,6 +93,8 @@ - (void)loadExtraAtPath:(NSString*)fullPath {
return;
}
+ [principalClassName class]; // force loading of it.
+
NSError *err = 0x00;
[pluginBundle loadAndReturnError:&err];
@@ -129,7 +131,7 @@ + (void)resetPlugins {
JSTalkPluginList = 0x00;
}
-- (void)loadPlugins {
++ (void)loadPlugins {
// install plugins that were passed via the command line
int i = 0;
@@ -227,7 +229,7 @@ - (void)deleteObjectWithName:(NSString*)name {
- (id)executeString:(NSString*)str {
if (!JSTalkPluginList && JSTalkShouldLoadJSTPlugins) {
- [self loadPlugins];
+ [JSTalk loadPlugins];
}
if (_shouldPreprocess) {
Please sign in to comment.
Something went wrong with that request. Please try again.