Skip to content

Commit

Permalink
Balthisar Tidy 4.3.0
Browse files Browse the repository at this point in the history
This is a minor update with lots of small but important changes.

- Native Apple Silicon Support
- New, modern toolbar icons.
- New, modern Preferences icons.
- New, modern UI icons.
- Balthisar Tidy web version get Balthisar Tidy for Work features.
- Balthisar Tidy is now Balthisar Tidy Classic.
- Balthisar Tidy for Work is now Balthisar Tidy.
- Validator Preference panel now simply uses localhost; using the hostname didn't work
  with secure transport.
- Sample AppleScripts are no longer included int the application bundle, but can be
  downloaded from the Help menu.
- Sample AppleScripts have been updated, and the disk image is now notarized.
- Help Book has been updated with modern images and updated content.
- Updated to HTML Tidy 5.7.47.
- Updated to Nu Validator 21.5.16.
- Fix hovering behavior on macOS prior to 10.14
- Alternating Row Colors is no longer the default.
- No longer possible to use system tidy dylibs. Security for macOS is getting tighter
  these days, so we'll just build Tidy directly into Balthisar Tidy.
- Improve the input encoding helper due to issue #8. Thanks @ihemsen.

- Building my own JDK for each of the targets. This allows me to use the hardened
  runtime without code-signing issues. This also also building a mostly-fat JRE
  for Apple Silicon support.
- Most Cocoa dependencies are now via Carthage.
- Spaces won in the spaces vs tab war. Balthisar Tidy is now completely detabbed.
- Updating documentation comments so that they don't look like ass in the
  new, default Xcode appearance.
- Features support have been refactored. In order to migrate to a single "Balthisar Tidy"
  with future in-app purchases to enable pro features, the current hard-coded features
  had to be refactored so that features can be enabled in software rather than compiled
  in.
- All menus now use "Balthisar Tidy," and we will start to remove "for Work" branding.
- Preferences controller demoted to an object that has a MASPreferencesController, so
  that we can re-build the controller at will to add/remove panels.
- AppleScript improvements, including finally fixing a warning, and updating to the
  current, modern SDEF format.
- Add the new EdDSA public key required by Sparkle.
- libtidy now used statically and removed last remnants of dylib support.
- Rename to TidyTableViewController, to disambiguate its purpose.
- Renamed preferences classes and nibs to better reflect current names.
- Moved RTF to NSAttributedString functionality to a category, because I keep using it
  more and more.
- Do better sniffing of possible string encoding mismatches. I thought I'd done this
  back in 1.01, so I'm not sure how this got lost. In any case, MUCH better.
  • Loading branch information
Jim Derry authored and balthisar committed May 16, 2021
1 parent 8d2d649 commit 674a08e
Show file tree
Hide file tree
Showing 1,057 changed files with 8,522 additions and 27,132 deletions.
34 changes: 28 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# OS X
#
# macOS X noise.
#
.DS_Store

# Xcode

#
# Xcode artifacts to ignore.
#
build/
*.pbxuser
!default.pbxuser
Expand All @@ -19,24 +24,41 @@ DerivedData
.idea/
*.hmap
*.xccheckout

*xcworkspace

# CocoaPods
Pods

#
# old skool
#
.svn


#
# Documentation and such.
#
AppleDoc
Distribution

Documentation/Doxygen
Documentation/html


#
# Help Build System built content.
#
Contents\ \(build\)


#
# Auto-gen'd header files.
#
HTMLTidy/xcode-version.h
JSDNuVFramework/xcode-version.h


#
# Stuff brought in by dependency managers.
#
Carthage/
Pods


2 changes: 2 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[submodule "HTMLTidy/tidy-html5"]
path = HTMLTidy/tidy-html5
url = https://github.com/htacg/tidy-html5.git
ignore = dirty
[submodule "JSDNuVFramework/validator"]
path = JSDNuVFramework/validator
url = https://github.com/validator/validator.git
ignore = dirty
44 changes: 44 additions & 0 deletions Balthisar Common/Classes/JSDScriptSuiteRegistry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// JSDScriptSuiteRegistry.h
//
// Copyright © 2019 Jim Derry. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

#pragma mark - class JSDScriptSuiteRegistry

/**
* Override the NSScriptSuiteRegistry so that we can take manual control over the loading of
* scripting suites. This allows Balthisar Tidy to selectively support loading suites or
* not, thus giving a single application the ability to support or not support AppleScript.
*/
@interface JSDScriptSuiteRegistry : NSScriptSuiteRegistry


/**
* Return our current instance type.
*/
+ (instancetype)sharedScriptSuiteRegistry;


/**
* Overridden method that Cocoa calls automatically when an application is started. This
* would normally load the SDEF's for us automatically if SDEF's are present in the bundle,
* but we don't want this to happen if AppleScript support is an add-on feature.
*/
- (void)loadSuitesFromBundle:(NSBundle*)bundle;

/**
* Actually do load the suites. Only to be called once you're sure you want
* to enable AppleScript, because with Cocoa Scripting, there's not any going
* back until the next application run.
*/
- (void)loadSuitesFromMainBundle;


@end

NS_ASSUME_NONNULL_END
31 changes: 31 additions & 0 deletions Balthisar Common/Classes/JSDScriptSuiteRegistry.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// JSDScriptSuiteRegistry.h
//
// Copyright © 2019 Jim Derry. All rights reserved.
//

#import "JSDScriptSuiteRegistry.h"

@implementation JSDScriptSuiteRegistry


+ (instancetype)sharedScriptSuiteRegistry
{
return (JSDScriptSuiteRegistry*)[super sharedScriptSuiteRegistry];
}


- (void)loadSuitesFromMainBundle
{
NSLog(@"%@", @"Balthisar Tidy loading AppScript SDEF's.");
[super loadSuitesFromBundle:[NSBundle mainBundle]];
}

- (void)loadSuitesFromBundle:(NSBundle*)bundle
{
// noop; we don't want CocoaScripting to load resources.
NSLog(@"%@", @"Balthisar Tidy skipping loading AppleScript SDEF's.");
}


@end
12 changes: 5 additions & 7 deletions Balthisar Common/Classes/JSDStringEncodingTools.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/**************************************************************************************************
JSDStringEncodingTools
Copyright © 2003-2018 by Jim Derry. All rights reserved.
**************************************************************************************************/
//
// JSDStringEncodingTools.h
//
// Copyright © 2003-2019 by Jim Derry. All rights reserved.
//

@import Cocoa;

Expand Down
200 changes: 99 additions & 101 deletions Balthisar Common/Classes/JSDStringEncodingTools.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/**************************************************************************************************
JSDStringEncodingTools
Copyright © 2003-2018 by Jim Derry. All rights reserved.
**************************************************************************************************/
//
// JSDStringEncodingTools.m
//
// Copyright © 2003-2019 by Jim Derry. All rights reserved.
//

#import "JSDStringEncodingTools.h"

Expand All @@ -15,124 +13,124 @@ @implementation JSDStringEncodingTools


/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*
allAvailableEncodingLocalizedNames
allAvailableEncodingLocalizedNames
*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
+ (NSArray *)encodingNames
{
static NSArray *encodingNames = nil; // Only do this once
if (!encodingNames)
{
NSMutableArray *tempNames = [[NSMutableArray alloc] init];
const NSStringEncoding *encoding = [NSString availableStringEncodings];
while (*encoding)
{
[tempNames addObject:[NSString localizedNameOfStringEncoding:*encoding]];
encoding++;
}
encodingNames = [tempNames sortedArrayUsingComparator:^(NSString *a, NSString *b) { return [a localizedCaseInsensitiveCompare:b]; }];
}
return encodingNames;
static NSArray *encodingNames = nil; // Only do this once
if (!encodingNames)
{
NSMutableArray *tempNames = [[NSMutableArray alloc] init];
const NSStringEncoding *encoding = [NSString availableStringEncodings];
while (*encoding)
{
[tempNames addObject:[NSString localizedNameOfStringEncoding:*encoding]];
encoding++;
}
encodingNames = [tempNames sortedArrayUsingComparator:^(NSString *a, NSString *b) { return [a localizedCaseInsensitiveCompare:b]; }];
}
return encodingNames;
}


/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*
encodingsByEncoding
encodingsByEncoding
*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
+ (NSDictionary *)encodingsByEncoding
{
static NSMutableDictionary *dictionary = nil; // Only do this once
if (!dictionary)
{
dictionary = [[NSMutableDictionary alloc] init];
const NSStringEncoding *encoding = [NSString availableStringEncodings];
while (*encoding)
{
NSString *currentName = [NSString localizedNameOfStringEncoding:*encoding];
NSNumber *currentIndex = @([[[self class] encodingNames] indexOfObject:currentName]);
NSDictionary *items = @{@"LocalizedName" : currentName,
@"NSStringEncoding" : @(*encoding),
@"LocalizedIndex" : currentIndex};
dictionary[@(*encoding)] = items;
encoding++;
}
}
return dictionary;
static NSMutableDictionary *dictionary = nil; // Only do this once
if (!dictionary)
{
dictionary = [[NSMutableDictionary alloc] init];
const NSStringEncoding *encoding = [NSString availableStringEncodings];
while (*encoding)
{
NSString *currentName = [NSString localizedNameOfStringEncoding:*encoding];
NSNumber *currentIndex = @([[[self class] encodingNames] indexOfObject:currentName]);
NSDictionary *items = @{@"LocalizedName" : currentName,
@"NSStringEncoding" : @(*encoding),
@"LocalizedIndex" : currentIndex};
dictionary[@(*encoding)] = items;
encoding++;
}
}
return dictionary;
}


/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*
encodingsByIndex
encodingsByIndex
*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
+ (NSDictionary *)encodingsByIndex
{
static NSMutableDictionary *dictionary = nil; // Only do this once
if (!dictionary)
{
dictionary = [[NSMutableDictionary alloc] init];
const NSStringEncoding *encoding = [NSString availableStringEncodings];
while (*encoding)
{
NSString *currentName = [NSString localizedNameOfStringEncoding:*encoding];
NSNumber *currentIndex = @([[[self class] encodingNames] indexOfObject:currentName]);

NSDictionary *items = @{@"LocalizedName" : currentName,
@"NSStringEncoding" : @(*encoding),
@"LocalizedIndex" : currentIndex};
dictionary[currentIndex] = items;
encoding++;
}
}
return dictionary;
static NSMutableDictionary *dictionary = nil; // Only do this once
if (!dictionary)
{
dictionary = [[NSMutableDictionary alloc] init];
const NSStringEncoding *encoding = [NSString availableStringEncodings];
while (*encoding)
{
NSString *currentName = [NSString localizedNameOfStringEncoding:*encoding];
NSNumber *currentIndex = @([[[self class] encodingNames] indexOfObject:currentName]);

NSDictionary *items = @{@"LocalizedName" : currentName,
@"NSStringEncoding" : @(*encoding),
@"LocalizedIndex" : currentIndex};
dictionary[currentIndex] = items;
encoding++;
}
}
return dictionary;
}


/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*
encodingsByName
encodingsByName
*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
+ (NSDictionary *)encodingsByName
{
static NSMutableDictionary *dictionary = nil; // Only do this once
if (!dictionary)
{
dictionary = [[NSMutableDictionary alloc] init];
const NSStringEncoding *encoding = [NSString availableStringEncodings];
while (*encoding)
{
NSString *currentName = [NSString localizedNameOfStringEncoding:*encoding];
NSNumber *currentIndex = @([[[self class] encodingNames] indexOfObject:currentName]);
NSDictionary *items = @{@"LocalizedName" : currentName,
@"NSStringEncoding" : @(*encoding),
@"LocalizedIndex" : currentIndex};
dictionary[currentName] = items;

encoding++;
}
}
return dictionary;
static NSMutableDictionary *dictionary = nil; // Only do this once
if (!dictionary)
{
dictionary = [[NSMutableDictionary alloc] init];
const NSStringEncoding *encoding = [NSString availableStringEncodings];
while (*encoding)
{
NSString *currentName = [NSString localizedNameOfStringEncoding:*encoding];
NSNumber *currentIndex = @([[[self class] encodingNames] indexOfObject:currentName]);
NSDictionary *items = @{@"LocalizedName" : currentName,
@"NSStringEncoding" : @(*encoding),
@"LocalizedIndex" : currentIndex};
dictionary[currentName] = items;

encoding++;
}
}
return dictionary;
}


Expand Down
Loading

0 comments on commit 674a08e

Please sign in to comment.