diff --git a/.gitattributes b/.gitattributes index 1172eadb..fdbd29ff 100755 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1 @@ *.pbxproj -crlf -diff -merge -build export-ignore -.gitattributes export-ignore -.gitignore export-ignore -dsa_pub.pem export-ignore diff --git a/.gitignore b/.gitignore index b9052a46..0144ae31 100755 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,53 @@ -# Xcode user-settings files -build/* -*.pbxuser -*.mode1v3 -*.mode1 +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so -# Mac OS X specific +# Packages # +############ +# it's better to unpack these files and commit the raw source +# git has its own built in compression methods +*.7z +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip + +# Logs and databases # +###################### +*.log +*.sql +*.sqlite +*.pbxproj +*.xcworkspace +*.xcuserdatad +*.xcuserstate + +# OS generated files # +###################### +.DS_Store? +thumbs.db +Icon? +Thumbs.db +Notation.xcodeproj/xcuserdata/* +Notation.xcodeproj/project.xcworkspace/* +Loren.* +ttscoff.* +UserInterfaceState.xcuserstate .DS_Store -profile -English.lproj/MainMenu~.nib/classes.nib -English.lproj/MainMenu~.nib/data.dependency -English.lproj/MainMenu~.nib/info.nib -English.lproj/MainMenu~.nib/keyedobjects.nib -scrollbar.acorn -scrollbar2.acorn \ No newline at end of file +<<<<<<< HEAD + +/.DS_Store +======= +<<<<<<< HEAD +/.DS_Store +======= +>>>>>>> 1d5018bacb5c01a694493aca06192b4a5096d9ef +>>>>>>> mmd3 diff --git a/Acknowledgments.txt b/Acknowledgments.txt old mode 100755 new mode 100644 index 52e57c94..1835a603 --- a/Acknowledgments.txt +++ b/Acknowledgments.txt @@ -1,9 +1,17 @@ -nvALT is built on Notational Velocity, copyright Zachary Schneirov, Christian Tietze, the use of which is hereby acknowledged. - Portions of Notational Velocity contain the following copyrighted materials, the use of which is hereby acknowledged. -- +Notational Velocity Icon + +Copyright (c) 2011 Taylor Carrigan. All rights reserved. + +http://taylorcarrigan.com/ + +This icon may not be used for commercial purposes. + +-- + Sparkle Framework Copyright (c) 2006 Andy Matuschak @@ -42,36 +50,6 @@ Copyright 2004-2006 Rainer Brockerhoff. Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License. - --- - -BWToolkit - -Copyright (c) 2010, Brandon Walkin -All rights reserved. -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -* Neither the name of the Brandon Walkin nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -- CiphSafe NSData compression category methods @@ -370,13 +348,296 @@ http://www.opensource.org/licenses/bsd-license.php -- -FullscreenImage +AutoHyperlinks framework + +(c) 2004-2008 by the following: + +Colin Barrett +Graham Booker +Jorge Salvador Caffarena +Evan Schoenberg +Augie Fackler +Stephen Holt +Peter Hosey +Adam Iser +Jeffrey Melloy +Toby Peterson +Eric Richie +David Smith + +/* + * The AutoHyperlinks Framework is the legal property of its developers (DEVELOPERS), whose names are listed in the + * copyright file included with this source distribution. + * + * Copyright (c) 2004-2008 + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AutoHyperlinks Framework nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY ITS DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ITS DEVELOPERS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +-- +ElasticThreads' contributions, including (but not limited to) the fullscreen mode, color scheming, the status bar icon, and the ability to open notes in other text editors are released under the "new" BSD license: + +http://elasticthreads.tumblr.com/nv/ + +Copyright (c) 2011, ElasticThreads +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: +• Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +• Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +• Neither the name of the ElasticThreads nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This is the standard "new" BSD license: +http://www.opensource.org/licenses/bsd-license.php + +-- +Some UI elements (the scrollers, and also the buttons in the markdown preview) are from BWToolkit. + +BWToolKit +http://www.brandonwalkin.com/bwtoolkit/ + +Copyright (c) 2010, Brandon Walkin +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: +• Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +• Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +• Neither the name of the Brandon Walkin nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This is the standard "new" BSD license: +http://www.opensource.org/licenses/bsd-license.php + +-- -Created by Matt Gallagher on 2009/08/14. -Copyright 2009 Matt Gallagher. All rights reserved. +ETTransparentScroller +The main window uses a scroller class are based on the BWTransparentScroller from BWToolKit +http://www.brandonwalkin.com/bwtoolkit/ +(modifications by ElasticThreads on 10/19/2010) + +see BWToolkit above +-- + +BTTransparentScroller +The Markdown preview pane uses a scroller class are based on the BWTransparentScroller from BWToolKit +http://www.brandonwalkin.com/bwtoolkit/ +(but modified by Brett Terpstra on 12/8/10 and again by ElasticThreads on 03/10/11) + +see BWToolkit above + +-- + +The markdown preview uses a popover type window MAAttachedWindow.m +Which was created by Matt Gemmell + + +-- +The markdown preview is based on code from Christian Tietze + +-- +Beautiful Soup +Elixir and Tonic +"The Screen-Scraper's Friend" +http://www.crummy.com/software/BeautifulSoup/ + +Beautiful Soup parses a (possibly invalid) XML or HTML document into a +tree representation. It provides methods and Pythonic idioms that make +it easy to navigate, search, and modify the tree. + +A well-formed XML/HTML document yields a well-formed data +structure. An ill-formed XML/HTML document yields a correspondingly +ill-formed data structure. If your document is only locally +well-formed, you can use this library to find and process the +well-formed part of it. + +Beautiful Soup works with Python 2.2 and up. It has no external +dependencies, but you'll have more success at converting data to UTF-8 +if you also install these three packages: + +* chardet, for auto-detecting character encodings + http://chardet.feedparser.org/ +* cjkcodecs and iconv_codec, which add more encodings to the ones supported + by stock Python. + http://cjkpython.i18n.org/ + +Beautiful Soup defines classes for two main parsing strategies: + + * BeautifulStoneSoup, for parsing XML, SGML, or your domain-specific + language that kind of looks like XML. + + * BeautifulSoup, for parsing run-of-the-mill HTML code, be it valid + or invalid. This class has web browser-like heuristics for + obtaining a sensible parse tree in the face of common HTML errors. + +Beautiful Soup also defines a class (UnicodeDammit) for autodetecting +the encoding of an HTML or XML document, and converting it to +Unicode. Much of this code is taken from Mark Pilgrim's Universal Feed Parser. + +For more than you ever wanted to know about Beautiful Soup, see the +documentation: +http://www.crummy.com/software/BeautifulSoup/documentation.html + +Here, have some legalese: + +Copyright (c) 2004-2009, Leonard Richardson + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the the Beautiful Soup Consortium and All + Night Kosher Bakery nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE, DAMMIT. + +-- + +html2text: Turn HTML into equivalent Markdown-structured text. +__version__ = "2.39" +__author__ = "Aaron Swartz (me@aaronsw.com)" +__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3." +__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"] + +-- + +Markdown is +Copyright (c) 2004, John Gruber + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. + +-- + +MultiMarkdown changes Copyright (c) 2005-2009 Fletcher T. Penney + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name "Markdown" nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. -Permission is given to use this source code file, free of charge, in any -project, commercial or otherwise, entirely at your risk, with the condition -that any redistribution (in part or whole) of source code must retain -this copyright and permission notice. Attribution in compiled projects is -appreciated but not required. \ No newline at end of file + This software is provided by the copyright holders and contributors "as + is" and any express or implied warranties, including, but not limited + to, the implied warranties of merchantability and fitness for a + particular purpose are disclaimed. In no event shall the copyright owner + or contributors be liable for any direct, indirect, incidental, special, + exemplary, or consequential damages (including, but not limited to, + procurement of substitute goods or services; loss of use, data, or + profits; or business interruption) however caused and on any theory of + liability, whether in contract, strict liability, or tort (including + negligence or otherwise) arising in any way out of the use of this + software, even if advised of the possibility of such damage. \ No newline at end of file diff --git a/AlienNoteImporter.h b/AlienNoteImporter.h index 8a953a5e..f50ff9d7 100755 --- a/AlienNoteImporter.h +++ b/AlienNoteImporter.h @@ -36,8 +36,8 @@ extern NSString *RetrievedPasswordKey; id source; NSMutableDictionary *documentSettings; BOOL shouldGrabCreationDates; - - BOOL shouldUseReadability; + + BOOL shouldUseReadability; } //a directory containing notes, a custom bundle, or custom file format in which more than one note could be expected @@ -73,4 +73,4 @@ extern NSString *RetrievedPasswordKey; @interface AlienNoteImporter (DialogDelegate) - (void)noteImporter:(AlienNoteImporter*)importer importedNotes:(NSArray*)notes; -@end \ No newline at end of file +@end diff --git a/AlienNoteImporter.m b/AlienNoteImporter.m index daac54f7..40ea2682 100755 --- a/AlienNoteImporter.m +++ b/AlienNoteImporter.m @@ -23,7 +23,9 @@ #import "GlobalPrefs.h" #import "AttributedPlainText.h" #import "NSData_transformations.h" +#import "NSCollection_utils.h" #import "NSString_NV.h" +#import "NSFileManager_NV.h" #import "NotationPrefs.h" #import "NotationController.h" #import "NoteObject.h" @@ -46,7 +48,6 @@ - (id)init { if ([super init]) { shouldGrabCreationDates = NO; documentSettings = [[NSMutableDictionary alloc] init]; - shouldUseReadability = NO; } return self; } @@ -131,6 +132,7 @@ - (id)initWithStoragePath:(NSString*)filename { - (void)dealloc { [documentSettings release]; [source release]; + [super dealloc]; } @@ -225,16 +227,21 @@ - (void)URLGetter:(URLGetter*)getter returnedDownloadedFile:(NSString*)filename if (filename) { NSArray *notes = [self notesInFile:filename]; if ([notes count]) { - - NSMutableAttributedString *content = [[[[notes lastObject] contentString] mutableCopy] autorelease]; + NSMutableAttributedString *content = [[[GlobalPrefs defaultPrefs] pastePreservesStyle] ? [[[notes lastObject] contentString] mutableCopy] : + [[NSMutableAttributedString alloc] initWithString:[[[notes lastObject] contentString] string]] autorelease]; if ([[[content string] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length]) { //only add string if it has at least one non-whitespace character - [content prefixWithSourceString:[[getter url] absoluteString]]; + NSUInteger prefixedSourceLength = [[content prefixWithSourceString:[[getter url] absoluteString]] length]; [content santizeForeignStylesForImporting]; [[notes lastObject] setContentString:content]; if ([getter userData]) [[notes lastObject] setTitleString:[getter userData]]; + //prefixing should push existing selections forward: + NSRange selRange = [[notes lastObject] lastSelectedRange]; + if (selRange.length && prefixedSourceLength) + [[notes lastObject] setSelectedRange:NSMakeRange(selRange.location + prefixedSourceLength, selRange.length)]; + [receptionDelegate noteImporter:self importedNotes:notes]; foundNotes = YES; @@ -249,7 +256,7 @@ - (void)URLGetter:(URLGetter*)getter returnedDownloadedFile:(NSString*)filename [newString santizeForeignStylesForImporting]; NoteObject *noteObject = [[NoteObject alloc] initWithNoteBody:newString title:[getter userData] ? [getter userData] : urlString - uniqueFilename:nil format:SingleDatabaseFormat]; + delegate:nil format:SingleDatabaseFormat labels:nil]; [receptionDelegate noteImporter:self importedNotes:[NSArray arrayWithObject:noteObject]]; [noteObject autorelease]; @@ -310,113 +317,6 @@ - (NSArray*)notesWithPaths:(NSArray*)paths { return nil; } -- (NSString *) contentUsingReadability: (NSString *)htmlFile -{ - NSBundle *bundle = [NSBundle mainBundle]; - NSString *readabilityPath; - readabilityPath = [bundle pathForAuxiliaryExecutable: @"readability.py"]; - - NSTask *task = [[NSTask alloc] init]; - [task setLaunchPath: readabilityPath]; - - NSArray *arguments; - arguments = [NSArray arrayWithObjects: htmlFile, nil]; - [task setArguments: arguments]; - - NSPipe *rpipe; - rpipe = [NSPipe pipe]; - [task setStandardOutput: rpipe]; - - NSFileHandle *file; - file = [rpipe fileHandleForReading]; - - [task launch]; - - NSData *data; - data = [file readDataToEndOfFile]; - - NSString *string; - string = [[NSString alloc] initWithData: data - encoding: NSUTF8StringEncoding]; - - return [self markdownFromSource:string]; -} - -- (NSString *) markdownFromHTMLFile: (NSString *)htmlFile -{ - NSBundle *bundle = [NSBundle mainBundle]; - NSString *readabilityPath; - readabilityPath = [bundle pathForAuxiliaryExecutable: @"html2text.py"]; - - NSTask *task = [[NSTask alloc] init]; - [task setLaunchPath: readabilityPath]; - - NSArray *arguments; - arguments = [NSArray arrayWithObjects: htmlFile, nil]; - [task setArguments: arguments]; - - NSPipe *rpipe; - rpipe = [NSPipe pipe]; - [task setStandardOutput: rpipe]; - - NSFileHandle *file; - file = [rpipe fileHandleForReading]; - - [task launch]; - - NSData *data; - data = [file readDataToEndOfFile]; - - NSString *string; - string = [[NSString alloc] initWithData: data - encoding: NSUTF8StringEncoding]; - - return string; -} - -- (NSString *) markdownFromSource: (NSString *)htmlString -{ - NSBundle *bundle = [NSBundle mainBundle]; - NSString *readabilityPath; - readabilityPath = [bundle pathForAuxiliaryExecutable: @"html2text.py"]; - - NSTask *task = [[NSTask alloc] init]; - [task setLaunchPath: readabilityPath]; - - NSPipe *readPipe = [NSPipe pipe]; - NSFileHandle *readHandle = [readPipe fileHandleForReading]; - - NSPipe *writePipe = [NSPipe pipe]; - NSFileHandle *writeHandle = [writePipe fileHandleForWriting]; - - [task setStandardInput: writePipe]; - [task setStandardOutput: readPipe]; - - [task launch]; - - [writeHandle writeData: [htmlString dataUsingEncoding: NSASCIIStringEncoding]]; - [writeHandle closeFile]; - - NSMutableData *data = [[NSMutableData alloc] init]; - NSData *readData; - - while ((readData = [readHandle availableData]) - && [readData length]) { - [data appendData: readData]; - } - - NSString *strippedString; - strippedString = [[NSString alloc] - initWithData: data - encoding: NSASCIIStringEncoding]; - - [task release]; - [data release]; - [strippedString autorelease]; - - return (strippedString); -} - //auto-detect based on file type/extension/header //if unable to find, revert to spotlight importer - (NoteObject*)noteWithFile:(NSString*)filename { @@ -427,9 +327,10 @@ - (NoteObject*)noteWithFile:(NSString*)filename { NSString *sourceIdentifierString = nil; NSMutableAttributedString *attributedStringFromData = nil; + if (fileType == HTML_TYPE_ID || [extension isEqualToString:@"htm"] || [extension isEqualToString:@"html"] || [extension isEqualToString:@"shtml"]) { - // convert to text with markdown here - if ([[GlobalPrefs defaultPrefs] useMarkdownImport]) { + //should convert to text with markdown here + if ([[GlobalPrefs defaultPrefs] useMarkdownImport]) { if ([[GlobalPrefs defaultPrefs] useReadability] || [self shouldUseReadability]) { attributedStringFromData = [[NSMutableAttributedString alloc] initWithString:[self contentUsingReadability:filename] attributes:[[GlobalPrefs defaultPrefs] noteBodyAttributes]]; @@ -437,9 +338,10 @@ - (NoteObject*)noteWithFile:(NSString*)filename { attributedStringFromData = [[NSMutableAttributedString alloc] initWithString:[self markdownFromHTMLFile:filename] attributes:[[GlobalPrefs defaultPrefs] noteBodyAttributes]]; } - } else { - attributedStringFromData = [[NSMutableAttributedString alloc] initWithHTML:[NSData uncachedDataFromFile:filename] documentAttributes:NULL]; - } + } else { + attributedStringFromData = [[NSMutableAttributedString alloc] initWithHTML:[NSData uncachedDataFromFile:filename] + options:[NSDictionary optionsDictionaryWithTimeout:10.0] documentAttributes:NULL]; + } } else if (fileType == RTF_TYPE_ID || [extension isEqualToString:@"rtf"] || [extension isEqualToString:@"nvhelp"] || [extension isEqualToString:@"rtx"]) { attributedStringFromData = [[NSMutableAttributedString alloc] initWithRTF:[NSData uncachedDataFromFile:filename] documentAttributes:NULL]; @@ -505,28 +407,34 @@ - (NoteObject*)noteWithFile:(NSString*)filename { if (attributedStringFromData) { [attributedStringFromData trimLeadingWhitespace]; [attributedStringFromData removeAttachments]; - [attributedStringFromData santizeForeignStylesForImporting]; - NSString *processedFilename = [[filename lastPathComponent] stringByDeletingPathExtension]; - - NSUInteger bodyLoc = 0; - NSString *title = [[attributedStringFromData string] syntheticTitleAndSeparatorWithContext:NULL bodyLoc:&bodyLoc oldTitle:nil]; + NSUInteger bodyLoc = 0, prefixedSourceLength = 0; + NSString *title = [[attributedStringFromData string] syntheticTitleAndSeparatorWithContext:NULL bodyLoc:&bodyLoc maxTitleLen:36]; //if the synthetic title (generally the first line of the content) is shorter than the filename itself, just use the filename as the title //(or if this is a special case and we know the filename should be used) - if ([processedFilename length] > [title length] || [extension isEqualToString:@"nvhelp"]) { + if ([processedFilename length] > [title length] || [extension isEqualToString:@"nvhelp"] || [title isAMachineDirective] || + [title isEqualToString:NSLocalizedString(@"Untitled Note", @"Title of a nameless note")]) { title = processedFilename; + bodyLoc = 0; } else { - if (bodyLoc > 0 && [attributedStringFromData length] >= bodyLoc) [attributedStringFromData deleteCharactersInRange:NSMakeRange(0, bodyLoc)]; + title = [title stringByAppendingFormat:@" (%@)", processedFilename]; } if ([sourceIdentifierString length]) - [attributedStringFromData prefixWithSourceString:sourceIdentifierString]; + prefixedSourceLength = [[attributedStringFromData prefixWithSourceString:sourceIdentifierString] length]; + [attributedStringFromData santizeForeignStylesForImporting]; + [attributedStringFromData autorelease]; + //transfer any openmeta tags associated with this file as tags for the new note + NSArray *openMetaTags = [[NSFileManager defaultManager] getOpenMetaTagsAtFSPath:[filename fileSystemRepresentation]]; + //we do not also use filename as uniqueFilename, as we are only importing--not taking ownership - NoteObject *noteObject = [[NoteObject alloc] initWithNoteBody:attributedStringFromData title:title uniqueFilename:nil format:SingleDatabaseFormat]; + NoteObject *noteObject = [[NoteObject alloc] initWithNoteBody:attributedStringFromData title:title delegate:nil + format:SingleDatabaseFormat labels:[openMetaTags componentsJoinedByString:@" "]]; if (noteObject) { + if (bodyLoc > 0 && [attributedStringFromData length] >= bodyLoc + prefixedSourceLength) [noteObject setSelectedRange:NSMakeRange(prefixedSourceLength, bodyLoc)]; if (shouldGrabCreationDates) { [noteObject setDateAdded:CFDateGetAbsoluteTime((CFDateRef)[attributes objectForKey:NSFileCreationDate])]; } @@ -587,6 +495,112 @@ - (NSArray*)notesInFile:(NSString*)filename { return nil; } +- (NSString *) contentUsingReadability: (NSString *)htmlFile +{ + NSBundle *bundle = [NSBundle mainBundle]; + NSString *readabilityPath; + readabilityPath = [bundle pathForAuxiliaryExecutable: @"readability.py"]; + + NSTask *task = [[NSTask alloc] init]; + [task setLaunchPath: readabilityPath]; + + NSArray *arguments; + arguments = [NSArray arrayWithObjects: htmlFile, nil]; + [task setArguments: arguments]; + + NSPipe *rpipe; + rpipe = [NSPipe pipe]; + [task setStandardOutput: rpipe]; + + NSFileHandle *file; + file = [rpipe fileHandleForReading]; + + [task launch]; + + NSData *data; + data = [file readDataToEndOfFile]; + + NSString *string; + string = [[NSString alloc] initWithData: data + encoding: NSUTF8StringEncoding]; + + return [self markdownFromSource:string]; +} + +- (NSString *) markdownFromHTMLFile: (NSString *)htmlFile +{ + NSBundle *bundle = [NSBundle mainBundle]; + NSString *readabilityPath; + readabilityPath = [bundle pathForAuxiliaryExecutable: @"html2text.py"]; + + NSTask *task = [[NSTask alloc] init]; + [task setLaunchPath: readabilityPath]; + + NSArray *arguments; + arguments = [NSArray arrayWithObjects: htmlFile, nil]; + [task setArguments: arguments]; + + NSPipe *rpipe; + rpipe = [NSPipe pipe]; + [task setStandardOutput: rpipe]; + + NSFileHandle *file; + file = [rpipe fileHandleForReading]; + + [task launch]; + + NSData *data; + data = [file readDataToEndOfFile]; + + NSString *string; + string = [[NSString alloc] initWithData: data + encoding: NSUTF8StringEncoding]; + + return string; +} + +- (NSString *) markdownFromSource: (NSString *)htmlString +{ + NSBundle *bundle = [NSBundle mainBundle]; + NSString *readabilityPath; + readabilityPath = [bundle pathForAuxiliaryExecutable: @"html2text.py"]; + + NSTask *task = [[NSTask alloc] init]; + [task setLaunchPath: readabilityPath]; + + NSPipe *readPipe = [NSPipe pipe]; + NSFileHandle *readHandle = [readPipe fileHandleForReading]; + + NSPipe *writePipe = [NSPipe pipe]; + NSFileHandle *writeHandle = [writePipe fileHandleForWriting]; + + [task setStandardInput: writePipe]; + [task setStandardOutput: readPipe]; + + [task launch]; + + [writeHandle writeData: [htmlString dataUsingEncoding: NSASCIIStringEncoding]]; + [writeHandle closeFile]; + + NSMutableData *data = [[NSMutableData alloc] init]; + NSData *readData; + + while ((readData = [readHandle availableData]) + && [readData length]) { + [data appendData: readData]; + } + + NSString *strippedString; + strippedString = [[NSString alloc] + initWithData: data + encoding: NSASCIIStringEncoding]; + + [task release]; + [data release]; + [strippedString autorelease]; + + return (strippedString); +} -(BOOL)shouldUseReadability { return shouldUseReadability; @@ -624,9 +638,10 @@ - (NSArray*)_importStickies:(NSString*)filename { NSMutableAttributedString *attributedString = [[[NSMutableAttributedString alloc] initWithRTFD:[doc RTFDData] documentAttributes:NULL] autorelease]; [attributedString removeAttachments]; [attributedString santizeForeignStylesForImporting]; - NSString *syntheticTitle = [attributedString getLeadingSyntheticTitle]; + NSString *syntheticTitle = [attributedString trimLeadingSyntheticTitle]; - NoteObject *noteObject = [[[NoteObject alloc] initWithNoteBody:attributedString title:syntheticTitle uniqueFilename:nil format:SingleDatabaseFormat] autorelease]; + NoteObject *noteObject = [[[NoteObject alloc] initWithNoteBody:attributedString title:syntheticTitle + delegate:nil format:SingleDatabaseFormat labels:nil] autorelease]; if (noteObject) { [noteObject setDateAdded:CFDateGetAbsoluteTime((CFDateRef)[doc creationDate])]; [noteObject setDateModified:CFDateGetAbsoluteTime((CFDateRef)[doc modificationDate])]; @@ -741,8 +756,9 @@ - (NSArray*)_importDelimitedFile:(NSString*)filename withDelimiter:(NSString*)de NSString *title = [fields objectAtIndex:0]; NSMutableAttributedString *attributedBody = [[[NSMutableAttributedString alloc] initWithString:s attributes:[[GlobalPrefs defaultPrefs] noteBodyAttributes]] autorelease]; [attributedBody addLinkAttributesForRange:NSMakeRange(0, [attributedBody length])]; + [attributedBody addStrikethroughNearDoneTagsForRange:NSMakeRange(0, [attributedBody length])]; - NoteObject *note = [[[NoteObject alloc] initWithNoteBody:attributedBody title:title uniqueFilename:nil format:SingleDatabaseFormat] autorelease]; + NoteObject *note = [[[NoteObject alloc] initWithNoteBody:attributedBody title:title delegate:nil format:SingleDatabaseFormat labels:nil] autorelease]; if (note) { now += 1.0; //to ensure a consistent sort order [note setDateAdded:now]; diff --git a/AppController.h b/AppController.h index 36faf363..202917f1 100755 --- a/AppController.h +++ b/AppController.h @@ -16,8 +16,7 @@ #import "NotationController.h" #import "NotesTableView.h" -#import "WhiteTransparentScroller.h" -#import "BlueTransparentScroller.h" +#import "Spaces.h" @class LinkingEditor; @class EmptyView; @@ -29,9 +28,13 @@ @class RBSplitSubview; @class TitlebarButton; @class LinearDividerShader; +@class TagEditingManager; +@class StatusItemView; +@class DFView; @class PreviewController; -@class WhiteTransparentScroller; -@class BlueTransparentScroller; +@class WordCountToken; +@class AugmentedScrollView; +@class ETContentView; #ifndef MarkdownPreview #define MarkdownPreview 13371 @@ -45,56 +48,78 @@ #define TextilePreview 13373 #endif -@interface AppController : NSObject { - IBOutlet DualField *field; - IBOutlet RBSplitSubview *splitSubview; - IBOutlet RBSplitView *splitView; - IBOutlet RBSplitSubview *notesList; - IBOutlet NotesTableView *notesTableView; - IBOutlet NSBox *horizontalRule; - IBOutlet NSBox *verticalRule; - IBOutlet LinkingEditor *textView; +@interface AppController : NSObject +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +#endif +{ + //NSMenuItem *fsMenuItem; + BOOL wasVert; + BOOL isAutocompleting; + BOOL wasDeleting; + IBOutlet ETContentView *mainView; + DFView *dualFieldView; + StatusItemView *cView; + NSStatusItem *statusItem; + IBOutlet NSMenu *statBarMenu; + TagEditingManager *TagEditer; + NSColor *backgrndColor; + NSColor *foregrndColor; + int userScheme; + NSString *noteFormat; + NSTextView *theFieldEditor; + NSDictionary *fieldAttributes; + NSTimer *modifierTimer; + IBOutlet WordCountToken *wordCounter; + IBOutlet DualField *field; + RBSplitSubview *splitSubview; + RBSplitSubview *notesSubview; + RBSplitView *splitView; + IBOutlet AugmentedScrollView *notesScrollView; + IBOutlet NSScrollView *textScrollView; + IBOutlet NotesTableView *notesTableView; + IBOutlet LinkingEditor *textView; IBOutlet EmptyView *editorStatusView; IBOutlet NSMenuItem *sparkleUpdateItem; - IBOutlet NSWindow *window; + IBOutlet NSWindow *window; IBOutlet NSPanel *syncWaitPanel; IBOutlet NSProgressIndicator *syncWaitSpinner; - IBOutlet NSMenuItem *widescreenToggle; - IBOutlet NSMenuItem *collapseToggle; - IBOutlet WhiteTransparentScroller *otherScroller; - IBOutlet BlueTransparentScroller *noteScroller; NSToolbar *toolbar; NSToolbarItem *dualFieldItem; TitlebarButton *titleBarButton; BOOL waitedForUncommittedChanges; + NSImage *verticalDividerImg; LinearDividerShader *dividerShader; - NSString *URLToSearchOnLaunch; + NSString *URLToInterpretOnLaunch; NSMutableArray *pathsToOpenOnLaunch; - NSUndoManager *windowUndoManager; - PrefsWindowController *prefsWindowController; - GlobalPrefs *prefsController; - NotationController *notationController; + NSUndoManager *windowUndoManager; + PrefsWindowController *prefsWindowController; + GlobalPrefs *prefsController; + NotationController *notationController; + SpaceSwitchingContext spaceSwitchCtx; ViewLocationContext listUpdateViewCtx; BOOL isFilteringFromTyping, typedStringIsCached; BOOL isCreatingANote; NSString *typedString; + NSArray *cTags; NoteObject *currentNote; NSArray *savedSelectedNotes; - - PreviewController *previewController; - IBOutlet NSMenuItem *markdownPreview; - IBOutlet NSMenuItem *multiMarkdownPreview; - IBOutlet NSMenuItem *textilePreview; - NSInteger currentPreviewMode; - - IBOutlet NSWindow *mainWindow; - NSWindow *fullscreenWindow; + + PreviewController *previewController; + // IBOutlet NSMenuItem *markdownPreview; + IBOutlet NSMenuItem *multiMarkdownPreview; + IBOutlet NSMenuItem *textilePreview; + IBOutlet NSMenuItem *previewToggler; + IBOutlet NSMenuItem *lockNoteItem; + IBOutlet NSMenuItem *printPreviewItem; + IBOutlet NSMenuItem *savePreviewItem; + NSInteger currentPreviewMode; } void outletObjectAwoke(id sender); @@ -106,25 +131,29 @@ void outletObjectAwoke(id sender); - (void)runDelayedUIActionsAfterLaunch; - (void)updateNoteMenus; -- (BOOL)addNotesFromPasteboard:(NSPasteboard*)pasteboard; - (IBAction)renameNote:(id)sender; - (IBAction)deleteNote:(id)sender; +- (IBAction)copyNoteLink:(id)sender; - (IBAction)exportNote:(id)sender; +- (IBAction)revealNote:(id)sender; - (IBAction)printNote:(id)sender; - (IBAction)tagNote:(id)sender; - (IBAction)importNotes:(id)sender; +- (IBAction)switchViewLayout:(id)sender; - (IBAction)fieldAction:(id)sender; - (NoteObject*)createNoteIfNecessary; - (void)searchForString:(NSString*)string; -- (NSUInteger)_revealNote:(NoteObject*)note options:(NSUInteger)opts; +- (NSUInteger)revealNote:(NoteObject*)note options:(NSUInteger)opts; - (BOOL)displayContentsForNoteAtIndex:(int)noteIndex; - (void)processChangedSelectionForTable:(NSTableView*)table; - (void)setEmptyViewState:(BOOL)state; - (void)cancelOperation:(id)sender; - (void)_setCurrentNote:(NoteObject*)aNote; -- (void)_expandToolbar; -- (void)_collapseToolbar; +//- (void)_expandToolbar; +//- (void)_collapseToolbar; +- (void)_forceRegeneratePreviewsForTitleColumn; +- (void)_configureDividerForCurrentLayout; - (NoteObject*)selectedNoteObject; - (void)restoreListStateUsingPreferences; @@ -144,19 +173,51 @@ void outletObjectAwoke(id sender); - (IBAction)bringFocusToControlField:(id)sender; - (NSWindow*)window; --(IBAction)togglePreview:(id)sender; --(void)postTextUpdate; --(IBAction)selectPreviewMode:(id)sender; --(IBAction)toggleSourceView:(id)sender; +//elasticwork +- (void)setIsEditing:(BOOL)inBool inCell:(NSCell *)theCell; +- (void)setIsEditing:(BOOL)inBool; +//- (void)focusOnCtrlFld:(id)sender; +- (void)drawNotesTable; +- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; +- (NSMenu *)statBarMenu; +- (BOOL)toggleAttachedWindow:(id)sender; +- (BOOL)toggleAttachedMenu:(id)sender; +- (NSArray *)commonLabels; +- (IBAction)multiTag:(id)sender; +- (void)setDualFieldInToolbar; +- (void)setDualFieldInView; +- (void)setDualFieldIsVisible:(BOOL)isVis; +//- (void)hideDualFieldView; +//- (void)showDualFieldView; +- (BOOL)dualFieldIsVisible; +- (IBAction)toggleCollapse:(id)sender; +- (void)setMaxNoteBodyWidth; +- (IBAction)toggleFullscreen:(id)sender; +- (IBAction)openFileInEditor:(id)sender; +- (NSArray *)getTxtAppList; +- (void)updateTextApp:(id)sender; +- (IBAction)setBWColorScheme:(id)sender; +- (IBAction)setLCColorScheme:(id)sender; +- (IBAction)setUserColorScheme:(id)sender; +- (void)updateFieldAttributes; +- (void)updateColorScheme; +- (NSColor*)_selectionColor; +- (void)setBackgrndColor:(NSColor *)inColor; +- (void)setForegrndColor:(NSColor *)inColor; +- (NSColor *)backgrndColor; +- (NSColor *)foregrndColor; +- (void)updateWordCount:(BOOL)doIt; +- (void)ensurePreviewIsVisible; +- (IBAction)toggleWordCount:(id)sender; +- (IBAction)togglePreview:(id)sender; +- (IBAction)toggleSourceView:(id)sender; - (IBAction)savePreview:(id)sender; - (IBAction)sharePreview:(id)sender; +- (IBAction)lockPreview:(id)sender; +- (IBAction)printPreview:(id)sender; +- (void)postTextUpdate; +- (IBAction)selectPreviewMode:(id)sender; --(void)setMenuItemStates; --(IBAction)toggleLayout:(id)sender; --(IBAction)collapseNotes:(id)sender; - --(void)updateScheme; --(void)updateRTL; - -- (IBAction)toggleFullscreen:(id)sender; +- (void)updateRTL; +- (void)refreshNotesList; @end diff --git a/AppController.m b/AppController.m index 1d4e1124..aebdb09b 100755 --- a/AppController.m +++ b/AppController.m @@ -8,21 +8,24 @@ the distribution. - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. */ +//ET NV4 +//#import "NVTransparentScroller.h" +#import "NSTextFinder.h" #import "AppController.h" -#import "FullscreenWindow.h" #import "NoteObject.h" #import "GlobalPrefs.h" #import "AlienNoteImporter.h" +#import "AppController_Importing.h" #import "NotationPrefs.h" #import "PrefsWindowController.h" #import "NoteAttributeColumn.h" #import "NotationSyncServiceManager.h" #import "NotationDirectoryManager.h" +#import "NotationFileManager.h" #import "NSString_NV.h" -#import "NSCollection_utils.h" -#import "AttributedPlainText.h" +#import "NSFileManager_NV.h" #import "EncodingsManager.h" #import "ExporterManager.h" #import "NSData_transformations.h" @@ -32,63 +35,145 @@ #import "DualField.h" #import "TitlebarButton.h" #import "RBSplitView/RBSplitView.h" +#import "AugmentedScrollView.h" #import "BookmarksController.h" #import "SyncSessionController.h" #import "MultiplePageView.h" #import "InvocationRecorder.h" -#import "URLGetter.h" #import "LinearDividerShader.h" +#import "SecureTextEntryManager.h" +#import "TagEditingManager.h" +#import "NotesTableHeaderCell.h" +#import "DFView.h" +#import "StatusItemView.h" +#import "ETContentView.h" #import "PreviewController.h" -#import -#include -#define NSTextViewChangedNotification @"TextView has changed contents" -#define kDefaultMarkupPreviewMode @"markupPreviewMode" +#define NSApplicationPresentationAutoHideMenuBar (1 << 2) +#define NSApplicationPresentationHideMenuBar (1 << 3) +//#define NSApplicationPresentationAutoHideDock (1 << 0) +#define NSApplicationPresentationHideDock (1 << 1) +//#define NSApplicationActivationPolicyAccessory + +//#define NSTextViewChangedNotification @"TextView has changed contents" +//#define kDefaultMarkupPreviewMode @"markupPreviewMode" + + +NSWindow *normalWindow; +int ModFlagger; +BOOL splitViewAwoke; +BOOL isEd; @implementation AppController //an instance of this class is designated in the nib as the delegate of the window, nstextfield and two nstextviews - +/* + (void)initialize { - NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:MultiMarkdownPreview] - forKey:kDefaultMarkupPreviewMode]; + NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:MultiMarkdownPreview] forKey:kDefaultMarkupPreviewMode]; [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; -} // initialize +} // initialize*/ + - (id)init { - if ([super init]) { - + if ([super init]) { + splitViewAwoke = NO; windowUndoManager = [[NSUndoManager alloc] init]; - - previewController = [[PreviewController alloc] init]; - [[NSNotificationCenter defaultCenter] addObserver:previewController selector:@selector(requestPreviewUpdate:) name:NSTextViewChangedNotification object:self]; - + + previewController = [[PreviewController alloc] init]; + + [[NSNotificationCenter defaultCenter] addObserver:previewController selector:@selector(requestPreviewUpdate:) name:@"TextView has changed contents" object:self]; + + // Setup URL Handling NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager]; [appleEventManager setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; - dividerShader = [[LinearDividerShader alloc] initWithStartColor:[NSColor colorWithCalibratedWhite:1.000 alpha:1.000] - endColor:[NSColor colorWithCalibratedWhite:1.000 alpha:1.000]]; - + // dividerShader = [[LinearDividerShader alloc] initWithStartColor:[NSColor colorWithCalibratedWhite:0.988 alpha:1.0] + // endColor:[NSColor colorWithCalibratedWhite:0.875 alpha:1.0]]; + dividerShader = [[[LinearDividerShader alloc] initWithBaseColors:self] retain]; isCreatingANote = isFilteringFromTyping = typedStringIsCached = NO; typedString = @""; - - } - return self; + } + return self; } - (void)awakeFromNib { - prefsController = [GlobalPrefs defaultPrefs]; + if (![[[NSUserDefaults standardUserDefaults] stringForKey:@"HideDockIcon"] isEqualToString:@"Show Dock Icon"]){ + + if((IsSnowLeopardOrLater)&&([[NSApplication sharedApplication] respondsToSelector: @selector(setActivationPolicy:)])) { + enum {NSApplicationActivationPolicyRegular}; + [[NSApplication sharedApplication] setActivationPolicy:NSApplicationActivationPolicyRegular]; + }else { + ProcessSerialNumber psn = { 0, kCurrentProcess }; + OSStatus returnCode = TransformProcessType(&psn, kProcessTransformToForegroundApplication); + if( returnCode != 0) { + NSLog(@"Could not bring the application to front. Error %d", returnCode); + } + } + } + theFieldEditor = [[[NSTextView alloc]initWithFrame:[window frame]] retain]; + [theFieldEditor setFieldEditor:YES]; + [self updateFieldAttributes]; + + [NSApp setDelegate:self]; + [window setDelegate:self]; + + //ElasticThreads>> set up the rbsplitview programatically to remove dependency on IBPlugin + splitView = [[[RBSplitView alloc] initWithFrame:[mainView frame] andSubviews:2] retain]; + [splitView setAutosaveName:@"centralSplitView" recursively:NO]; + [splitView setDelegate:self]; + NSImage *image = [[[NSImage alloc] initWithSize:NSMakeSize(1.0,1.0)] autorelease]; + [image lockFocus]; + [[NSColor clearColor] set]; + + NSRectFill(NSMakeRect(0.0,0.0,1.0,1.0)); + [image unlockFocus]; + [image setFlipped:YES]; + [splitView setDivider:image]; + + [splitView setDividerThickness:8.75f]; + [splitView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; + [mainView addSubview:splitView]; + //[mainView setNextResponder:field];//<<-- + [splitView setNextKeyView:notesTableView]; + notesSubview = [[splitView subviewAtPosition:0] retain]; + [notesSubview setMinDimension: 80.0 + andMaxDimension:600.0]; + [notesSubview setCanCollapse:YES]; + [notesSubview setAutoresizesSubviews:YES]; + [notesSubview addSubview:notesScrollView]; + splitSubview = [[splitView subviewAtPosition:1] retain]; + [notesScrollView setFrame:[notesSubview frame]]; + [notesScrollView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; + [splitSubview setMinDimension:1 andMaxDimension:0]; + [splitSubview setCanCollapse:NO]; + [splitSubview setAutoresizesSubviews:YES]; + [splitSubview addSubview:textScrollView]; + [textScrollView setFrame:[splitSubview frame]]; + [textScrollView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; + [mainView setNeedsDisplay:YES]; + [splitView adjustSubviews]; + [splitView needsDisplay]; + splitViewAwoke = YES; + + [notesScrollView setBorderType:NSNoBorder]; + [textScrollView setBorderType:NSNoBorder]; + prefsController = [GlobalPrefs defaultPrefs]; + [NSColor setIgnoresAlpha:NO]; + + //For ElasticThreads' fullscreen implementation. delete the next line of code and uncomment the following the block to undo + [self setDualFieldInToolbar]; + /* NSView *dualSV = [field superview]; dualFieldItem = [[NSToolbarItem alloc] initWithItemIdentifier:@"DualField"]; //[[dualSV superview] setFrameSize:NSMakeSize([[dualSV superview] frame].size.width, [[dualSV superview] frame].size.height -1)]; [dualFieldItem setView:dualSV]; [dualFieldItem setMaxSize:NSMakeSize(FLT_MAX, [dualSV frame].size.height)]; [dualFieldItem setMinSize:NSMakeSize(50.0f, [dualSV frame].size.height)]; - [dualFieldItem setLabel:@"Search or Create"]; + [dualFieldItem setLabel:NSLocalizedString(@"Search or Create", @"placeholder text in search/create field")]; toolbar = [[NSToolbar alloc] initWithIdentifier:@"NVToolbar"]; [toolbar setAllowsUserCustomization:NO]; @@ -103,73 +188,105 @@ - (void)awakeFromNib { [window setShowsToolbarButton:NO]; titleBarButton = [[TitlebarButton alloc] initWithFrame:NSMakeRect(0, 0, 17.0, 17.0) pullsDown:YES]; [titleBarButton addToWindow:window]; - - [NSApp setDelegate:self]; + + + + */ + if (IsLeopardOrLater){ + [window setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces]; + } + + [notesTableView setDelegate:self]; - [window setDelegate:self]; [field setDelegate:self]; [textView setDelegate:self]; - [splitView setDelegate:self]; - + //set up temporary FastListDataSource containing false visible notes //this will not make a difference [window useOptimizedDrawing:YES]; + + //[window makeKeyAndOrderFront:self]; //[self setEmptyViewState:YES]; - - [notesList setCanCollapse:YES]; - [self setMenuItemStates]; - // Enable one preview mode by default - NSInteger previewMode = [[NSUserDefaults standardUserDefaults] integerForKey:kDefaultMarkupPreviewMode]; - currentPreviewMode = previewMode; - if (previewMode == MarkdownPreview) { + // Create elasticthreads' NSStatusItem. + if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"StatusBarItem"]) { + float width = 25.0f; + CGFloat height = [[NSStatusBar systemStatusBar] thickness]; + NSRect viewFrame = NSMakeRect(0.0f, 0.0f, width, height); + statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:width] retain]; + cView = [[[StatusItemView alloc] initWithFrame:viewFrame controller:self] autorelease]; + [statusItem setView:cView]; + } + + currentPreviewMode = [[NSUserDefaults standardUserDefaults] integerForKey:@"markupPreviewMode"]; + if (currentPreviewMode == MarkdownPreview) { [multiMarkdownPreview setState:NSOnState]; - } else if (previewMode == MultiMarkdownPreview) { + } else if (currentPreviewMode == MultiMarkdownPreview) { [multiMarkdownPreview setState:NSOnState]; - } else if (previewMode == TextilePreview) { + } else if (currentPreviewMode == TextilePreview) { [textilePreview setState:NSOnState]; - } - + } + + [NSApp setServicesProvider:self]; outletObjectAwoke(self); } //really need make AppController a subclass of NSWindowController and stick this junk in windowDidLoad - (void)setupViewsAfterAppAwakened { static BOOL awakenedViews = NO; + isEd = NO; if (!awakenedViews) { - - if ([prefsController verticalLayout] == YES) { - [splitView setVertical:YES]; - [verticalRule setHidden:NO]; - [horizontalRule setHidden:YES]; - [widescreenToggle setState:NSOnState]; - } else { - [splitView setVertical:NO]; - [verticalRule setHidden:YES]; - [horizontalRule setHidden:NO]; - [widescreenToggle setState:NSOffState]; - } - //NSLog(@"all (hopefully relevant) views awakend!"); + //NSLog(@"all (hopefully relevant) views awakend!"); + [self _configureDividerForCurrentLayout]; [splitView restoreState:YES]; - + if ([notesSubview dimension]<200.0) { + if ([splitView isVertical]) { ///vertical means "Horiz layout"/notes list is to the left of the note body + if (([splitView frame].size.width < 600.0) && ([splitView frame].size.width - 400 > [notesSubview dimension])) { + [notesSubview setDimension:[splitView frame].size.width-400.0]; + }else if ([splitView frame].size.width >= 600.0) { + [notesSubview setDimension:200.0]; + } + }else{ + if (([splitView frame].size.height < 600.0) && ([splitView frame].size.height - 400 > [notesSubview dimension])) { + [notesSubview setDimension:[splitView frame].size.height-450.0]; + }else if ([splitView frame].size.height >= 600.0){ + [notesSubview setDimension:150.0]; + } + } + } + [splitView adjustSubviews]; [splitSubview addSubview:editorStatusView positioned:NSWindowAbove relativeTo:splitSubview]; - - [editorStatusView setFrame:[[textView enclosingScrollView] frame]]; + [editorStatusView setFrame:[textScrollView frame]]; [notesTableView restoreColumns]; [field setNextKeyView:textView]; [textView setNextKeyView:field]; [window setAutorecalculatesKeyViewLoop:NO]; - + + [self updateRTL]; + + [self setMaxNoteBodyWidth]; + + [self setEmptyViewState:YES]; + ModFlagger = 0; + userScheme = [[NSUserDefaults standardUserDefaults] integerForKey:@"ColorScheme"]; + if (userScheme==0) { + [self setBWColorScheme:self]; + }else if (userScheme==1) { + [self setLCColorScheme:self]; + }else if (userScheme==2) { + [self setUserColorScheme:self]; + } //this is necessary on 10.3; keep just in case [splitView display]; - [self updateScheme]; - [self updateRTL]; - + + if (![NSApp isActive]) { + [NSApp activateIgnoringOtherApps:YES]; + } awakenedViews = YES; } } @@ -178,17 +295,17 @@ - (void)setupViewsAfterAppAwakened { void outletObjectAwoke(id sender) { static NSMutableSet *awokenOutlets = nil; if (!awokenOutlets) awokenOutlets = [[NSMutableSet alloc] initWithCapacity:5]; - + + [awokenOutlets addObject:sender]; AppController* appDelegate = (AppController*)[NSApp delegate]; - if (appDelegate && [awokenOutlets containsObject:appDelegate] && + if ((appDelegate) && ([awokenOutlets containsObject:appDelegate] && [awokenOutlets containsObject:appDelegate->notesTableView] && [awokenOutlets containsObject:appDelegate->textView] && - [awokenOutlets containsObject:appDelegate->editorStatusView] && - [awokenOutlets containsObject:appDelegate->splitView]) { - + [awokenOutlets containsObject:appDelegate->editorStatusView]) &&(splitViewAwoke)) { + // && [awokenOutlets containsObject:appDelegate->splitView]) [appDelegate setupViewsAfterAppAwakened]; } } @@ -198,8 +315,11 @@ - (void)runDelayedUIActionsAfterLaunch { [[prefsController bookmarksController] restoreWindowFromSave]; [[prefsController bookmarksController] updateBookmarksUI]; [self updateNoteMenus]; + [textView setupFontMenu]; [prefsController registerAppActivationKeystrokeWithTarget:self selector:@selector(toggleNVActivation:)]; + [notationController updateLabelConnectionsAfterDecoding]; [notationController checkIfNotationIsTrashed]; + [[SecureTextEntryManager sharedInstance] checkForIncompatibleApps]; //connect sparkle programmatically to avoid loading its framework at nib awake; @@ -209,6 +329,9 @@ - (void)runDelayedUIActionsAfterLaunch { id updater = [NSClassFromString(@"SUUpdater") performSelector:@selector(sharedUpdater)]; [sparkleUpdateItem setTarget:updater]; [sparkleUpdateItem setAction:@selector(checkForUpdates:)]; + NSMenuItem *siSparkle = [statBarMenu itemWithTag:902]; + [siSparkle setTarget:updater]; + [siSparkle setAction:@selector(checkForUpdates:)]; if (![[prefsController notationPrefs] firstTimeUsed]) { //don't do anything automatically on the first launch; afterwards, check every 4 days, as specified in Info.plist SEL checksSEL = @selector(setAutomaticallyChecksForUpdates:); @@ -218,15 +341,46 @@ - (void)runDelayedUIActionsAfterLaunch { NSLog(@"Could not load %@!", frameworkPath); } } - - [NSApp setServicesProvider:self]; + // add elasticthreads' menuitems + NSMenuItem *theMenuItem = [[[NSMenuItem alloc] initWithTitle:@"Open Note in TextEdit" + action:@selector(openFileInEditor:) keyEquivalent:@"O"] autorelease]; + if ([prefsController textEditor]) { + [theMenuItem setTitle:[@"Open Note in " stringByAppendingString:[prefsController textEditor]]]; + } + [theMenuItem setTarget:self]; + NSMenu *notesMenu = [[[NSApp mainMenu] itemWithTag:NOTES_MENU_ID] submenu]; + [notesMenu insertItem:theMenuItem atIndex:9]; + theMenuItem = [theMenuItem copy]; + [statBarMenu insertItem:theMenuItem atIndex:4]; + [theMenuItem release]; + //theMenuItem = [[viewMenu itemWithTag:801] copy]; + //[statBarMenu insertItem:theMenuItem atIndex:11]; + //[theMenuItem release]; + if(IsLeopardOrLater){ + NSMenu *viewMenu = [[[NSApp mainMenu] itemWithTag:VIEW_MENU_ID] submenu]; + theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Toggle Fullscreen Mode",@"menu item title for toggling fs") + action:@selector(toggleFullscreen:) keyEquivalent:@"F"] autorelease]; + + [theMenuItem setTarget:self]; + [viewMenu insertItem:theMenuItem atIndex:1]; + theMenuItem = [theMenuItem copy]; + [statBarMenu insertItem:theMenuItem atIndex:11]; + [theMenuItem release]; + } + + if (![prefsController showWordCount]) { + [wordCounter setHidden:NO]; + }else { + [wordCounter setHidden:YES]; + } + // } + - (void)applicationDidFinishLaunching:(NSNotification*)aNote { - //on tiger dualfield is often not ready to add tracking tracks until this point: - [field setTrackingRect]; + [field setTrackingRect]; NSDate *before = [NSDate date]; prefsWindowController = [[PrefsWindowController alloc] init]; @@ -236,6 +390,11 @@ - (void)applicationDidFinishLaunching:(NSNotification*)aNote { NSString *subMessage = @""; + //if the option key is depressed, go straight to picking a new notes folder location + if (kCGEventFlagMaskAlternate == (CGEventSourceFlagsState(kCGEventSourceStateCombinedSessionState) & NSDeviceIndependentModifierFlagsMask)) { + goto showOpenPanel; + } + if (aliasData) { newNotation = [[NotationController alloc] initWithAliasData:aliasData error:&err]; subMessage = NSLocalizedString(@"Please choose a different folder in which to store your notes.",nil); @@ -247,7 +406,7 @@ - (void)applicationDidFinishLaunching:(NSNotification*)aNote { if (err == kPassCanceledErr) goto showOpenPanel; - NSString *location = (aliasData ? [NSString pathCopiedFromAliasData:aliasData] : NSLocalizedString(@"your Application Support directory",nil)); + NSString *location = (aliasData ? [[NSFileManager defaultManager] pathCopiedFromAliasData:aliasData] : NSLocalizedString(@"your Application Support directory",nil)); if (!location) { //fscopyaliasinfo sucks FSRef locationRef; if ([aliasData fsRefAsAlias:&locationRef] && LSCopyDisplayNameForRef(&locationRef, (CFStringRef*)&location) == noErr) { @@ -289,15 +448,13 @@ - (void)applicationDidFinishLaunching:(NSNotification*)aNote { [AlienNoteImporter importBlorOrHelpFilesIfNecessaryIntoNotation:newNotation]; if (pathsToOpenOnLaunch) { - [notationController openFiles:pathsToOpenOnLaunch]; - [pathsToOpenOnLaunch release]; + [notationController openFiles:[pathsToOpenOnLaunch autorelease]]; pathsToOpenOnLaunch = nil; } - if (URLToSearchOnLaunch) { - [self searchForString:[[URLToSearchOnLaunch substringFromIndex:5] stringByReplacingPercentEscapes]]; - [URLToSearchOnLaunch release]; - URLToSearchOnLaunch = nil; + if (URLToInterpretOnLaunch) { + [self interpretNVURL:[URLToInterpretOnLaunch autorelease]]; + URLToInterpretOnLaunch = nil; } //tell us.. @@ -305,81 +462,33 @@ - (void)applicationDidFinishLaunching:(NSNotification*)aNote { @selector(setAliasDataForDefaultDirectory:sender:), //when someone wants to load a new database @selector(setSortedTableColumnKey:reversed:sender:), //when sorting prefs changed @selector(setNoteBodyFont:sender:), //when to tell notationcontroller to restyle its notes + @selector(setForegroundTextColor:sender:), //ditto + @selector(setBackgroundTextColor:sender:), //ditto @selector(setTableFontSize:sender:), //when to tell notationcontroller to regenerate the (now potentially too-short) note-body previews + @selector(addTableColumn:sender:), //ditto + @selector(removeTableColumn:sender:), //ditto @selector(setTableColumnsShowPreview:sender:), //when to tell notationcontroller to generate or disable note-body previews - @selector(setConfirmNoteDeletion:sender:),nil]; //whether "delete note" should have an ellipsis + @selector(setConfirmNoteDeletion:sender:), //whether "delete note" should have an ellipsis + @selector(setAutoCompleteSearches:sender:), nil]; //when to tell notationcontroller to build its title-prefix connections [self performSelector:@selector(runDelayedUIActionsAfterLaunch) withObject:nil afterDelay:0.0]; + + return; terminateApp: [NSApp terminate:self]; } - -// original updateScheme code courtesy of Elastic Threads - -- (void)updateScheme{ - - NSColor *backgroundColor = [prefsController notesListBackgroundColor]; - NSColor *fontColor = [NSColor colorWithCalibratedRed:0.134 green:0.134 blue:0.134 alpha:1.000]; - - CGFloat fWhite; - CGFloat fAlpha; - NSColor *gBack = [backgroundColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace]; - [gBack getWhite:&fWhite alpha:&fAlpha]; - if (fWhite < 0.5) { - fontColor = [NSColor colorWithCalibratedWhite:0.936 alpha:0.95]; - } - - [notesTableView setBackgroundColor:fontColor]; // <--For some reason you need to toggle two colors for the background color to live update correctly. Uncomment this if you want to live update the background color, which is a good idea if you have a preference option to let the user pick a color). - [notesTableView setBackgroundColor:backgroundColor]; //this is just calling a superclass method. nothing else to do - - [noteScroller setBackgroundColor:backgroundColor]; - [splitView setBackground:backgroundColor]; - -} - -- (void)updateRTL -{ - if ([prefsController rtl]) { - [textView setBaseWritingDirection:NSWritingDirectionRightToLeft range:NSMakeRange(0, [[textView string] length])]; - } else { - [textView setBaseWritingDirection:NSWritingDirectionLeftToRight range:NSMakeRange(0, [[textView string] length])]; - } -} - -- (void)tableView: (NSTableView *)aTableView willDisplayCell:(id)aCell - forTableColumn:(NSTableColumn *)aTableColumn row:(int)aRowIndex -{ - if ([aCell isHighlighted]) { - [aCell setTextColor:[NSColor blackColor]]; - } else { - - NSColor *backgroundColor = [prefsController notesListBackgroundColor]; - - CGFloat fWhite; - CGFloat fAlpha; - NSColor *gBack = [backgroundColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace]; - NSColor *fontColor = [NSColor colorWithCalibratedRed:0.134 green:0.134 blue:0.134 alpha:1.000]; - [gBack getWhite:&fWhite alpha:&fAlpha]; - if (fWhite < 0.58f) { - fontColor = [NSColor whiteColor]; - } else { - fontColor = [NSColor blackColor]; - } - [aCell setTextColor:fontColor]; - } -} - - (void)handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent { - NSString *fullURL = [[[event paramDescriptorForKeyword:keyDirectObject] stringValue] retain]; + NSURL *fullURL = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]]; if (notationController) { - [self searchForString:[[fullURL substringFromIndex:5] stringByReplacingPercentEscapes]]; + if (![self interpretNVURL:fullURL]) + NSBeep(); } else { - URLToSearchOnLaunch = fullURL; + URLToInterpretOnLaunch = [fullURL retain]; } } @@ -408,6 +517,7 @@ - (void)setNotationController:(NotationController*)newNotation { } [notationController setSortColumn:[notesTableView noteAttributeColumnForIdentifier:[prefsController sortedTableColumnKey]]]; [notesTableView setDataSource:[notationController notesListDataSource]]; + [notesTableView setLabelsListSource:[notationController labelsListDataSource]]; [notationController setDelegate:self]; //allow resolution of UUIDs to NoteObjects from saved searches @@ -423,9 +533,8 @@ - (void)setNotationController:(NotationController*)newNotation { if ([notationController aliasNeedsUpdating]) { [prefsController setAliasDataForDefaultDirectory:[notationController aliasDataForNoteDirectory] sender:self]; } - if ([[GlobalPrefs defaultPrefs] tableColumnsShowPreview]) { - [notationController regeneratePreviewsForColumn:[notesTableView noteAttributeColumnForIdentifier:NoteTitleColumnString] - visibleFilteredRows:[notesTableView rowsInRect:[notesTableView visibleRect]] forceUpdate:YES]; + if ([prefsController tableColumnsShowPreview] || [prefsController horizontalLayout]) { + [self _forceRegeneratePreviewsForTitleColumn]; [notesTableView setNeedsDisplay:YES]; } [titleBarButton setMenu:[[notationController syncSessionController] syncStatusMenu]]; @@ -434,6 +543,12 @@ - (void)setNotationController:(NotationController*)newNotation { object:[notationController syncSessionController]]; [notationController performSelector:@selector(startSyncServices) withObject:nil afterDelay:0.0]; + if ([[notationController notationPrefs] secureTextEntry]) { + [[SecureTextEntryManager sharedInstance] enableSecureTextEntry]; + } else { + [[SecureTextEntryManager sharedInstance] disableSecureTextEntry]; + } + [field selectText:nil]; [oldNotation autorelease]; @@ -461,10 +576,11 @@ - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)theToolbar { return [NSArray arrayWithObject:@"DualField"]; } + - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { SEL selector = [menuItem action]; int numberSelected = [notesTableView numberOfSelectedRows]; - NSInteger tag = [menuItem tag]; + NSInteger tag = [menuItem tag]; if ((tag == TextilePreview) || (tag == MarkdownPreview) || (tag == MultiMarkdownPreview)) { // Allow only one Preview mode to be selected at every one time @@ -477,14 +593,50 @@ - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { return (numberSelected > 0); - } else if (selector == @selector(renameNote:)) { + } else if (selector == @selector(renameNote:) || + selector == @selector(copyNoteLink:)) { return (numberSelected == 1); + + } else if (selector == @selector(revealNote:)) { + + return (numberSelected == 1) && [notationController currentNoteStorageFormat] != SingleDatabaseFormat; + + } else if (selector == @selector(openFileInEditor:)) { + NSString *defApp = [prefsController textEditor]; + if (![[self getTxtAppList] containsObject:defApp]) { + defApp = @"Default"; + [prefsController setTextEditor:@"Default"]; + } + if (([defApp isEqualToString:@"Default"])||(![[NSFileManager defaultManager] fileExistsAtPath:[[NSWorkspace sharedWorkspace] fullPathForApplication:defApp]])) { + + if (![defApp isEqualToString:@"Default"]) { + [prefsController setTextEditor:@"Default"]; + } + CFStringRef cfFormat = (CFStringRef)noteFormat; + defApp = [(NSString *)LSCopyDefaultRoleHandlerForContentType(cfFormat,kLSRolesEditor) autorelease]; + defApp = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier: defApp]; + defApp = [[NSFileManager defaultManager] displayNameAtPath: defApp]; + } + if ((!defApp)||([defApp isEqualToString:@"Safari"])) { + defApp = @"TextEdit"; + } + [menuItem setTitle:[@"Open Note in " stringByAppendingString:defApp]]; + return (numberSelected == 1) && [notationController currentNoteStorageFormat] != SingleDatabaseFormat; + } else if (selector == @selector(toggleCollapse:)) { + if ([notesSubview isCollapsed]) { + [menuItem setTitle:@"Expand Notes List"]; + }else{ + + [menuItem setTitle:@"Collapse Notes List"]; + + if (!currentNote){ + return NO; + } + } } else if (selector == @selector(fixFileEncoding:)) { - return (currentNote != nil - && (storageFormatOfNote(currentNote) == PlainTextFormat || storageFormatOfNote(currentNote) == MarkupTextFormat) - && ![currentNote contentsWere7Bit]); + return (currentNote != nil && storageFormatOfNote(currentNote) == PlainTextFormat && ![currentNote contentsWere7Bit]); } return YES; @@ -509,7 +661,8 @@ - (void)updateNoteMenus { NSLocalizedString(@"Delete", nil), trailingQualifier]]; } - NSMenu *viewMenu = [[[NSApp mainMenu] itemWithTitle:@"View"] submenu]; + NSMenu *viewMenu = [[[NSApp mainMenu] itemWithTag:VIEW_MENU_ID] submenu]; + menuIndex = [viewMenu indexOfItemWithTarget:notesTableView andAction:@selector(toggleNoteBodyPreviews:)]; NSMenuItem *bodyPreviewItem = nil; if (menuIndex > -1 && (bodyPreviewItem = [viewMenu itemAtIndex:menuIndex])) { @@ -517,128 +670,118 @@ - (void)updateNoteMenus { NSLocalizedString(@"Hide Note Previews in Title", @"menu item in the View menu to turn off note-body previews in the Title column") : NSLocalizedString(@"Show Note Previews in Title", @"menu item in the View menu to turn on note-body previews in the Title column")]; } + menuIndex = [viewMenu indexOfItemWithTarget:self andAction:@selector(switchViewLayout:)]; + NSMenuItem *switchLayoutItem = nil; + NSString *switchStr = [prefsController horizontalLayout] ? + NSLocalizedString(@"Switch to Vertical Layout", @"title of alternate view layout menu item") : + NSLocalizedString(@"Switch to Horizontal Layout", @"title of view layout menu item"); + + if (menuIndex > -1 && (switchLayoutItem = [viewMenu itemAtIndex:menuIndex])) { + [switchLayoutItem setTitle:switchStr]; + } + // add to elasticthreads' statusbar menu + menuIndex = [statBarMenu indexOfItemWithTarget:self andAction:@selector(switchViewLayout:)]; + if (menuIndex>-1) { + NSMenuItem *anxItem = [statBarMenu itemAtIndex:menuIndex]; + [anxItem setTitle:switchStr]; + } } -- (void)createFromSelection:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error { - if (!notationController || ![self addNotesFromPasteboard:pboard]) { - *error = NSLocalizedString(@"Error: Couldn't create a note from the selection.", @"error message to set during a Service call when adding a note failed"); - } +- (void)_forceRegeneratePreviewsForTitleColumn { + [notationController regeneratePreviewsForColumn:[notesTableView noteAttributeColumnForIdentifier:NoteTitleColumnString] + visibleFilteredRows:[notesTableView rowsInRect:[notesTableView visibleRect]] forceUpdate:YES]; } -- (BOOL)addNotesFromPasteboard:(NSPasteboard*)pasteboard { - - NSArray *types = [pasteboard types]; - NSMutableAttributedString *newString = nil; - NoteObject *note = nil; - NSData *data = nil; - - if ([types containsObject:NSFilenamesPboardType]) { - NSArray *files = [pasteboard propertyListForType:NSFilenamesPboardType]; - if ([files isKindOfClass:[NSArray class]]) { - if ([notationController openFiles:files]) return YES; - } - } - - NSString *sourceIdentiferString = nil; - - //webkit URL! - if ([types containsObject:WebArchivePboardType]) { - sourceIdentiferString = [[pasteboard dataForType:WebArchivePboardType] pathURLFromWebArchive]; - //gecko URL! - } else if ([types containsObject:[NSString customPasteboardTypeOfCode:0x4D5A0003]]) { - //lazilly use syntheticTitle to get first line, even though that's not how our API is documented - sourceIdentiferString = [[pasteboard stringForType:[NSString customPasteboardTypeOfCode:0x4D5A0003]] syntheticTitleAndTrimmedBody:NULL]; - unichar nullChar = 0x0; - sourceIdentiferString = [sourceIdentiferString stringByReplacingOccurrencesOfString: - [NSString stringWithCharacters:&nullChar length:1] withString:@""]; - } - - if ([types containsObject:NSURLPboardType]) { - NSURL *url = [NSURL URLFromPasteboard:pasteboard]; - - NSString *potentialURLString = [types containsObject:NSStringPboardType] ? [pasteboard stringForType:NSStringPboardType] : nil; - if (potentialURLString && [[url absoluteString] isEqualToString:potentialURLString]) { - //only begin downloading if we know that there's no other useful string data - //because we've already checked NSFilenamesPboardType - - if ([[url scheme] caseInsensitiveCompare:@"http"] == NSOrderedSame || - [[url scheme] caseInsensitiveCompare:@"https"] == NSOrderedSame || - [[url scheme] caseInsensitiveCompare:@"ftp"] == NSOrderedSame) { - NSString *linkTitleType = [NSString customPasteboardTypeOfCode:0x75726C6E]; - NSString *linkTitle = [types containsObject:linkTitleType] ? [[pasteboard stringForType:linkTitleType] syntheticTitleAndTrimmedBody:NULL] : nil; - if (!linkTitle) { - //try urld instead of urln - linkTitleType = [NSString customPasteboardTypeOfCode:0x75726C64]; - linkTitle = [types containsObject:linkTitleType] ? [[pasteboard stringForType:linkTitleType] syntheticTitleAndTrimmedBody:NULL] : nil; - } - AlienNoteImporter *importer = [[[AlienNoteImporter alloc] init] autorelease]; - NSEvent *event = [window currentEvent]; - if ([event modifierFlags] & NSAlternateKeyMask) { - [importer setShouldUseReadability:YES]; - } - [importer importURLInBackground:url linkTitle:linkTitle receptionDelegate:self]; - return YES; - } - } - } - - //safari on 10.5 does not seem to provide a plain-text equivalent, so we must be able to dumb-down RTF data as well - //should fall-back to plain text if 1) user doesn't want styles and 2) plain text is actually available - BOOL shallUsePlainTextFallback = [types containsObject:NSStringPboardType] && ![prefsController pastePreservesStyle]; - BOOL hasRTFData = NO; +- (void)_configureDividerForCurrentLayout { + + isEd = NO; + BOOL horiz = [prefsController horizontalLayout]; + if ([notesSubview isCollapsed]) { + [notesSubview expand]; + [splitView setVertical:horiz]; + [splitView setDividerThickness:7.0f]; + NSSize size = [notesSubview frame].size; + [notesScrollView setFrame: NSMakeRect(0, 0, size.width, size.height + 1)]; + [notesSubview collapse]; + }else { + [splitView setVertical:horiz]; + if (!verticalDividerImg && [splitView divider]) verticalDividerImg = [[splitView divider] retain]; + [splitView setDivider: verticalDividerImg]; + [splitView setDividerThickness:8.75f]; + NSSize size = [notesSubview frame].size; + [notesScrollView setFrame: horiz? NSMakeRect(0, 0, size.width, size.height) : NSMakeRect(0, 0, size.width, size.height + 1)]; + if (![self dualFieldIsVisible]) { + [self setDualFieldIsVisible:YES]; + } + } + + if (horiz) { + [splitSubview setMinDimension:100.0 andMaxDimension:0.0]; + } +} + +- (IBAction)switchViewLayout:(id)sender { + if ([mainView isInFullScreenMode]) { + wasVert = YES; + } + ViewLocationContext ctx = [notesTableView viewingLocation]; + ctx.pivotRowWasEdge = NO; + CGFloat colW = [notesSubview dimension]; + if (![splitView isVertical]) { + colW += 30.0f; + }else{ + colW -= 30.0f; + } - if ([types containsObject:NVPTFPboardType]) { - if ((data = [pasteboard dataForType:NVPTFPboardType])) - newString = [[NSMutableAttributedString alloc] initWithRTF:data documentAttributes:NULL]; - - } else if ([types containsObject:NSRTFPboardType] && !shallUsePlainTextFallback) { - if ((data = [pasteboard dataForType:NSRTFPboardType])) - newString = [[NSMutableAttributedString alloc] initWithRTF:data documentAttributes:NULL]; - hasRTFData = YES; - } else if ([types containsObject:NSRTFDPboardType] && !shallUsePlainTextFallback) { - if ((data = [pasteboard dataForType:NSRTFDPboardType])) - newString = [[NSMutableAttributedString alloc] initWithRTFD:data documentAttributes:NULL]; - hasRTFData = YES; - } else if ([types containsObject:WebArchivePboardType] && !shallUsePlainTextFallback) { - if ((data = [pasteboard dataForType:WebArchivePboardType])) { - //set a timeout because -[NSHTMLReader _loadUsingWebKit] can sometimes hang - newString = [[NSMutableAttributedString alloc] initWithData:data options:[NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:10.0] forKey:NSTimeoutDocumentOption] - documentAttributes:NULL error:NULL]; - } - hasRTFData = YES; - } else if (([types containsObject:NSStringPboardType])) { + [prefsController setHorizontalLayout:![prefsController horizontalLayout] sender:self]; + [notationController updateDateStringsIfNecessary]; + [self _configureDividerForCurrentLayout]; + // [notesTableView noteFirstVisibleRow]; + [notesSubview setDimension:colW]; + [notationController regenerateAllPreviews]; + [splitView adjustSubviews]; - NSString *pboardString = [pasteboard stringForType:NSStringPboardType]; - if (pboardString) newString = [[NSMutableAttributedString alloc] initWithString:pboardString]; - } + [notesTableView setViewingLocation:ctx]; + [notesTableView makeFirstPreviouslyVisibleRowVisibleIfNecessary]; - [newString autorelease]; - if ([newString length] > 0) { - [newString removeAttachments]; - - if (hasRTFData && ![prefsController pastePreservesStyle]) //fallback scenario - newString = [[[NSMutableAttributedString alloc] initWithString:[newString string]] autorelease]; - - NSString *noteTitle = [newString getLeadingSyntheticTitle]; - if ([sourceIdentiferString length] > 0) { - //add the URL or wherever it was that this piece of text came from - [newString prefixWithSourceString:sourceIdentiferString]; - } - [newString santizeForeignStylesForImporting]; - note = [notationController addNote:newString withTitle:noteTitle]; - [self renameNote:self]; - return note != nil; + [self updateNoteMenus]; + [self setMaxNoteBodyWidth]; + + [notesTableView setBackgroundColor:backgrndColor]; + [notesTableView setNeedsDisplay]; +} + +- (void)createFromSelection:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error { + if (!notationController || ![self addNotesFromPasteboard:pboard]) { + *error = NSLocalizedString(@"Error: Couldn't create a note from the selection.", @"error message to set during a Service call when adding a note failed"); } - - return NO; } + + - (IBAction)renameNote:(id)sender { + if ([notesSubview isCollapsed]) { + [self toggleCollapse:sender]; + } //edit the first selected note + isEd = YES; + /* NSTextView *fieldEditor = (NSTextView *)[window fieldEditor:YES forObject:notesTableView]; + NSColor *selCol = [NSColor colorWithCalibratedHue: 0.6 + saturation: 0.25 + brightness: 0.9 + alpha: 0.27]; + NSDictionary *colDict = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor redColor], NSForegroundColorAttributeName, [NSColor blueColor], NSBackgroundColorAttributeName, nil]; + [fieldEditor setSelectedTextAttributes:colDict]; + [fieldEditor setTextColor:[NSColor greenColor]]; + [fieldEditor setDrawsBackground:YES]; + [fieldEditor setBackgroundColor:[NSColor blackColor]]; + [fieldEditor setNeedsDisplay:YES]; + */ [notesTableView editRowAtColumnWithIdentifier:NoteTitleColumnString]; } -- (void)deleteSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { +- (void)deleteAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { + id retainedDeleteObj = (id)contextInfo; if (returnCode == NSAlertDefaultReturn) { @@ -654,6 +797,10 @@ - (void)deleteSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextIn } else if ([retainedDeleteObj isKindOfClass:[NoteObject class]]) { [notationController removeNote:retainedDeleteObj]; } + + if (IsLeopardOrLater && [[alert suppressionButton] state] == NSOnState) { + [prefsController setConfirmNoteDeletion:NO sender:self]; + } } [retainedDeleteObj release]; } @@ -671,9 +818,13 @@ - (IBAction)deleteNote:(id)sender { NSString *warningMultipleFormatString = NSLocalizedString(@"Delete %d notes?", @"alert title when asked to delete multiple notes"); NSString *warnString = currentNote ? [NSString stringWithFormat:warningSingleFormatString, titleOfNote(currentNote)] : [NSString stringWithFormat:warningMultipleFormatString, [indexes count]]; - NSBeginAlertSheet(warnString, NSLocalizedString(@"Delete", @"name of delete button"), NSLocalizedString(@"Cancel", @"name of cancel button"), - nil, window, self, @selector(deleteSheetDidEnd:returnCode:contextInfo:), NULL, (void*)deleteObj, - NSLocalizedString(@"Press Command-Z to undo this action later.", @"informational delete-this-note? text")); + + NSAlert *alert = [NSAlert alertWithMessageText:warnString defaultButton:NSLocalizedString(@"Delete", @"name of delete button") + alternateButton:NSLocalizedString(@"Cancel", @"name of cancel button") otherButton:nil + informativeTextWithFormat:NSLocalizedString(@"Press Command-Z to undo this action later.", @"informational delete-this-note? text")]; + if (IsLeopardOrLater) [alert setShowsSuppressionButton:YES]; + + [alert beginSheetModalForWindow:window modalDelegate:self didEndSelector:@selector(deleteAlertDidEnd:returnCode:contextInfo:) contextInfo:(void*)deleteObj]; } else { //just delete the notes outright [notationController performSelector:[indexes count] > 1 ? @selector(removeNotes:) : @selector(removeNote:) withObject:deleteObj]; @@ -681,6 +832,15 @@ - (IBAction)deleteNote:(id)sender { } } +- (IBAction)copyNoteLink:(id)sender { + NSIndexSet *indexes = [notesTableView selectedRowIndexes]; + + if ([indexes count] == 1) { + [[[[[notationController notesAtIndexes:indexes] lastObject] + uniqueNoteLink] absoluteString] copyItemToPasteboard:nil]; + } +} + - (IBAction)exportNote:(id)sender { NSIndexSet *indexes = [notesTableView selectedRowIndexes]; @@ -690,6 +850,17 @@ - (IBAction)exportNote:(id)sender { [[ExporterManager sharedManager] exportNotes:notes forWindow:window]; } +- (IBAction)revealNote:(id)sender { + NSIndexSet *indexes = [notesTableView selectedRowIndexes]; + NSString *path = nil; + + if ([indexes count] != 1 || !(path = [[notationController noteObjectAtFilteredIndex:[indexes lastIndex]] noteFilePath])) { + NSBeep(); + return; + } + [[NSWorkspace sharedWorkspace] selectFile:path inFileViewerRootedAtPath:@""]; +} + - (IBAction)printNote:(id)sender { NSIndexSet *indexes = [notesTableView selectedRowIndexes]; @@ -697,21 +868,38 @@ - (IBAction)printNote:(id)sender { } - (IBAction)tagNote:(id)sender { + + if ([notesSubview isCollapsed]) { + [self toggleCollapse:sender]; + } //if single note, add the tag column if necessary and then begin editing NSIndexSet *indexes = [notesTableView selectedRowIndexes]; if ([indexes count] > 1) { - //TODO - //show dialog for multiple notes, add or remove tags from them all using a dialog - //tags to remove is constituted by a union of all selected notes' tags - NSLog(@"multiple rows"); + //Multiple Notes selected, use ElasticThreads' multitagging implementation + TagEditer = [[[TagEditingManager alloc] init] retain]; + [TagEditer setDel:self]; + @try { + cTags = [[[NSArray alloc] initWithArray:[self commonLabels]] retain]; + if ([cTags count]>0) { + [TagEditer setTF:[cTags componentsJoinedByString:@","]]; + }else { + [TagEditer setTF:@""]; + } + [TagEditer popTP:self]; + } + @catch (NSException * e) { + NSLog(@"multitag excep this: %@",[e name]); + } } else if ([indexes count] == 1) { - [notesTableView editRowAtColumnWithIdentifier:NoteLabelsColumnString]; + isEd = YES; + [notesTableView editRowAtColumnWithIdentifier:NoteLabelsColumnString]; } } - (void)noteImporter:(AlienNoteImporter*)importer importedNotes:(NSArray*)notes { + [notationController addNotes:notes]; } - (IBAction)importNotes:(id)sender { @@ -721,7 +909,6 @@ - (IBAction)importNotes:(id)sender { } - (void)settingChangedForSelectorString:(NSString*)selectorString { - if ([selectorString isEqualToString:SEL_STR(setAliasDataForDefaultDirectory:sender:)]) { //defaults changed for the database location -- load the new one! @@ -740,8 +927,8 @@ - (void)settingChangedForSelectorString:(NSString*)selectorString { [prefsController setAliasDataForDefaultDirectory:oldData sender:self]; //display alert with err--could not set notation directory - NSString *location = [[NSString pathCopiedFromAliasData:newData] stringByAbbreviatingWithTildeInPath]; - NSString *oldLocation = [[NSString pathCopiedFromAliasData:oldData] stringByAbbreviatingWithTildeInPath]; + NSString *location = [[[NSFileManager defaultManager] pathCopiedFromAliasData:newData] stringByAbbreviatingWithTildeInPath]; + NSString *oldLocation = [[[NSFileManager defaultManager] pathCopiedFromAliasData:oldData] stringByAbbreviatingWithTildeInPath]; NSString *reason = [NSString reasonStringFromCarbonFSError:err]; NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"Unable to initialize notes database in \n%@ because %@.",nil), location, reason], [NSString stringWithFormat:NSLocalizedString(@"Reverting to current location of %@.",nil), oldLocation], @@ -769,18 +956,46 @@ - (void)settingChangedForSelectorString:(NSString*)selectorString { if (currentNote) { [self contentsUpdatedForNote:currentNote]; } + } else if ([selectorString isEqualToString:SEL_STR(setForegroundTextColor:sender:)]) { + if (userScheme!=2) { + [self setUserColorScheme:self]; + }else { + [self setForegrndColor:[prefsController foregroundTextColor]]; + [self updateColorScheme]; + } + } else if ([selectorString isEqualToString:SEL_STR(setBackgroundTextColor:sender:)]) { + if (userScheme!=2) { + [self setUserColorScheme:self]; + }else { + [self setBackgrndColor:[prefsController backgroundTextColor]]; + [self updateColorScheme]; + } + } else if ([selectorString isEqualToString:SEL_STR(setTableFontSize:sender:)] || [selectorString isEqualToString:SEL_STR(setTableColumnsShowPreview:sender:)]) { + ResetFontRelatedTableAttributes(); [notesTableView updateTitleDereferencorState]; - [notationController regeneratePreviewsForColumn:[notesTableView noteAttributeColumnForIdentifier:NoteTitleColumnString] - visibleFilteredRows:[notesTableView rowsInRect:[notesTableView visibleRect]] forceUpdate:YES]; + [notationController invalidateAllLabelPreviewImages]; + [self _forceRegeneratePreviewsForTitleColumn]; if ([selectorString isEqualToString:SEL_STR(setTableColumnsShowPreview:sender:)]) [self updateNoteMenus]; [notesTableView performSelector:@selector(reloadData) withObject:nil afterDelay:0]; + } else if ([selectorString isEqualToString:SEL_STR(addTableColumn:sender:)] || [selectorString isEqualToString:SEL_STR(removeTableColumn:sender:)]) { + + ResetFontRelatedTableAttributes(); + [self _forceRegeneratePreviewsForTitleColumn]; + [notesTableView performSelector:@selector(reloadDataIfNotEditing) withObject:nil afterDelay:0]; } else if ([selectorString isEqualToString:SEL_STR(setConfirmNoteDeletion:sender:)]) { [self updateNoteMenus]; + } else if ([selectorString isEqualToString:SEL_STR(setAutoCompleteSearches:sender:)]) { + if ([prefsController autoCompleteSearches]) + [notationController updateTitlePrefixConnections]; + + } else if ([selectorString isEqualToString:SEL_STR(setMaxNoteBodyWidth:sender:)]) { + [self setMaxNoteBodyWidth]; + } } @@ -813,9 +1028,15 @@ - (IBAction)showHelpDocument:(id)sender { case 4: //development site [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://notational.net/development"]]; break; - case 5: //nvALT website - [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://brettterpstra.com/code/notational-velocity-alt/"]]; - break; + case 5: //nvALT home + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://brettterpstra.com/project/nvalt/"]]; + break; + case 6: //ElasticThreads + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://elasticthreads.tumblr.com/nv"]]; + break; + case 7: //Brett Terpstra + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://brettterpstra.com"]]; + break; default: NSBeep(); } @@ -831,25 +1052,36 @@ - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames { [NSApp replyToOpenOrPrint:[filenames count] ? NSApplicationDelegateReplySuccess : NSApplicationDelegateReplyFailure]; } +- (void)applicationWillBecomeActive:(NSNotification *)aNotification { + + if (IsLeopardOrLater) { + SpaceSwitchingContext thisSpaceSwitchCtx; + CurrentContextForWindowNumber([window windowNumber], &thisSpaceSwitchCtx); + //what if the app is switched-to in another way? then the last-stored spaceSwitchCtx will cause us to return to the wrong app + //unfortunately this notification occurs only after NV has become the front process, but we can still verify the space number + + if (thisSpaceSwitchCtx.userSpace != spaceSwitchCtx.userSpace || + thisSpaceSwitchCtx.windowSpace != spaceSwitchCtx.windowSpace) { + //forget the last space-switch info if it's effectively different from how we're switching into the app now + bzero(&spaceSwitchCtx, sizeof(SpaceSwitchingContext)); + } + } +} + - (void)applicationDidBecomeActive:(NSNotification *)aNotification { [notationController checkJournalExistence]; if ([notationController currentNoteStorageFormat] != SingleDatabaseFormat) [notationController performSelector:@selector(synchronizeNotesFromDirectory) withObject:nil afterDelay:0.0]; - - if ([[prefsController notationPrefs] secureTextEntry]) { - EnableSecureEventInput(); - } - + [cView setActiveIcon:self]; [notationController updateDateStringsIfNecessary]; } - (void)applicationWillResignActive:(NSNotification *)aNotification { - if ([[prefsController notationPrefs] secureTextEntry]) { - DisableSecureEventInput(); - } //sync note files when switching apps so user doesn't have to guess when they'll be updated [notationController synchronizeNoteChanges:nil]; + [cView setInactiveIcon:self]; + [self resetModTimers]; } - (NSMenu *)applicationDockMenu:(NSApplication *)sender { @@ -869,17 +1101,23 @@ - (void)cancel:(id)sender { - (void)cancelOperation:(id)sender { //simulate a search for nothing - - [field setStringValue:@""]; - typedStringIsCached = NO; - - [notationController filterNotesFromString:@""]; - - [notesTableView deselectAll:sender]; - [self _expandToolbar]; - - [field selectText:sender]; - [[field cell] setShowsClearButton:NO]; + if ([window isKeyWindow]) { + + [field setStringValue:@""]; + typedStringIsCached = NO; + + [notationController filterNotesFromString:@""]; + + [notesTableView deselectAll:sender]; + [self setDualFieldIsVisible:YES]; +// [self _expandToolbar]; + + [field selectText:sender]; + [[field cell] setShowsClearButton:NO]; + } else if ([[TagEditer tagPanel] isKeyWindow]) { //<--this is for ElasticThreads' multitagging window + [TagEditer closeTP:self]; + [TagEditer release]; + } } - (BOOL)control:(NSControl *)control textView:(NSTextView *)aTextView doCommandBySelector:(SEL)command { @@ -909,8 +1147,16 @@ - (BOOL)control:(NSControl *)control textView:(NSTextView *)aTextView doCommandB if ((command == @selector(insertTab:) || command == @selector(insertTabIgnoringFieldEditor:))) { //[self setEmptyViewState:NO]; - - if (![[aTextView string] length] || [textView isHidden]) return YES; + if (![[aTextView string] length]) { + return YES; + } + if (!currentNote && [notationController preferredSelectedNoteIndex] != NSNotFound && [prefsController autoCompleteSearches]) { + //if the current note is deselected and re-searching would auto-complete this search, then allow tab to trigger it + [self searchForString:[self fieldSearchString]]; + return YES; + } else if ([textView isHidden]) { + return YES; + } [window makeFirstResponder:textView]; @@ -967,11 +1213,39 @@ - (BOOL)control:(NSControl *)control textView:(NSTextView *)aTextView doCommandB } } else if (control == (NSControl*)notesTableView) { + if (command == @selector(insertNewline:)) { //hit return in cell [window makeFirstResponder:textView]; return YES; } + } else if (control == [TagEditer tagField]) { + if (command == @selector(insertNewline:)) { + if ([aTextView selectedRange].length>0) { + NSString *theLabels = [TagEditer newMultinoteLabels]; + if (![theLabels hasSuffix:@" "]) { + theLabels = [theLabels stringByAppendingString:@" "]; + } + [TagEditer setTF:theLabels]; + [aTextView setSelectedRange:NSMakeRange(theLabels.length, 0)]; + return YES; + } + }else if (command == @selector(insertTab:)) { + if ([aTextView selectedRange].length>0) { + NSString *theLabels = [TagEditer newMultinoteLabels]; + if (![theLabels hasSuffix:@" "]) { + theLabels = [theLabels stringByAppendingString:@" "]; + } + [TagEditer setTF:theLabels]; + [aTextView setSelectedRange:NSMakeRange(theLabels.length, 0)]; + } + return YES; + }else { + if ((command == @selector(deleteBackward:))||(command == @selector(deleteForward:))) { + wasDeleting = YES; + } + return NO; + } } else NSLog(@"%@/%@ got %@", [control description], [aTextView description], NSStringFromSelector(command)); @@ -1041,8 +1315,7 @@ - (void)controlTextDidChange:(NSNotification *)aNotification { NSUInteger preferredNoteIndex = [notationController preferredSelectedNoteIndex]; //lastLengthReplaced depends on textView:shouldChangeTextInRange:replacementString: being sent before controlTextDidChange: runs - if ([prefsController autoCompleteSearches] && preferredNoteIndex != NSNotFound && - ([field lastLengthReplaced] > 0 /*|| [notationController preferredSelectedNoteMatchesSearchString]*/)) { + if ([prefsController autoCompleteSearches] && preferredNoteIndex != NSNotFound && ([field lastLengthReplaced] > 0)) { [notesTableView selectRowAndScroll:preferredNoteIndex]; @@ -1086,11 +1359,43 @@ - (void)controlTextDidChange:(NSNotification *)aNotification { } isFilteringFromTyping = NO; - } + } else if ([TagEditer isMultitagging]) { //<--for elasticthreads multitagging + if (!isAutocompleting&&!wasDeleting) { + isAutocompleting = YES; + NSTextView *editor = [[TagEditer tagPanel] fieldEditor:YES forObject:[TagEditer tagField]]; + NSRange selRange = [editor selectedRange]; + NSString *tagString = [TagEditer newMultinoteLabels]; + NSString *searchString = tagString; + if (selRange.length>0) { + searchString = [searchString substringWithRange:selRange]; + } + searchString = [[searchString componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@", "]] lastObject]; + selRange = [tagString rangeOfString:searchString options:NSBackwardsSearch]; + NSArray *theTags = [notesTableView labelCompletionsForString:searchString index:0]; + if ((theTags)&&([theTags count]>0)&&(![[theTags objectAtIndex:0] isEqualToString:@""])){ + NSString *useStr; + for (useStr in theTags) { + if ([tagString rangeOfString:useStr].location==NSNotFound) { + break; + } + } + if (useStr) { + tagString = [tagString substringToIndex:selRange.location]; + tagString = [tagString stringByAppendingString:useStr]; + selRange = NSMakeRange(selRange.location + selRange.length, useStr.length - searchString.length ); + [TagEditer setTF:tagString]; + [editor setSelectedRange:selRange]; + } + } + isAutocompleting = NO; + } + wasDeleting = NO; + } } - (void)tableViewSelectionIsChanging:(NSNotification *)aNotification { + BOOL allowMultipleSelection = NO; NSEvent *event = [window currentEvent]; @@ -1128,6 +1433,7 @@ - (void)setTableAllowsMultipleSelection { } - (void)tableViewSelectionDidChange:(NSNotification *)aNotification { + isEd = NO; NSEventType type = [[window currentEvent] type]; if (type != NSKeyDown && type != NSKeyUp) { [self performSelector:@selector(setTableAllowsMultipleSelection) withObject:nil afterDelay:0]; @@ -1161,7 +1467,8 @@ - (void)processChangedSelectionForTable:(NSTableView*)table { //while the user is typing and auto-completion is disabled, so should be OK if (!isFilteringFromTyping) { - if ([toolbar isVisible]) { + // if ([toolbar isVisible]) { + if ([self dualFieldIsVisible]) { if (fieldEditor) { //the field editor has focus--select text, too [fieldEditor setString:titleOfNote(currentNote)]; @@ -1201,8 +1508,9 @@ - (void)processChangedSelectionForTable:(NSTableView*)table { } [textView setString:@""]; } - [self _expandToolbar]; - + //[self _expandToolbar]; + [self setDualFieldIsVisible:YES]; + [mainView setNeedsDisplay:YES]; if (!currentNote) { if (selectedRow == -1 && (!fieldEditor || [window firstResponder] != fieldEditor)) { //don't select the field if we're already there @@ -1215,6 +1523,14 @@ - (void)processChangedSelectionForTable:(NSTableView*)table { //remove snapback-button from dual field here? [field setSnapbackString:nil]; + + if (!numberSelected && savedSelectedNotes) { + //savedSelectedNotes needs to be empty after de-selecting all notes, + //to ensure that any delayed list-resorting does not re-select savedSelectedNotes + + [savedSelectedNotes release]; + savedSelectedNotes = nil; + } } } [self setEmptyViewState:currentNote == nil]; @@ -1224,14 +1540,20 @@ - (void)processChangedSelectionForTable:(NSTableView*)table { - (void)setEmptyViewState:(BOOL)state { //return; - + //int numberSelected = [notesTableView numberOfSelectedRows]; - BOOL enable = /*numberSelected != 1;*/ state; - [textView setHidden:enable]; - [editorStatusView setHidden:!enable]; + //BOOL enable = /*numberSelected != 1;*/ state; + + [self postTextUpdate]; + [self updateWordCount:(![prefsController showWordCount])]; + [textView setHidden:state]; + [editorStatusView setHidden:!state]; - if (enable) { + if (state) { [editorStatusView setLabelStatus:[notesTableView numberOfSelectedRows]]; + if ([notesSubview isCollapsed]) { + [self toggleCollapse:self]; + } } } @@ -1266,12 +1588,13 @@ - (BOOL)displayContentsForNoteAtIndex:(int)noteIndex { //restore string [[textView textStorage] setAttributedString:[note contentString]]; [self postTextUpdate]; - + [self updateWordCount:(![prefsController showWordCount])]; //[textView setAutomaticallySelectedRange:NSMakeRange(0,0)]; //highlight terms--delay this, too if ((unsigned)noteIndex != [notationController preferredSelectedNoteIndex]) - firstFoundTermRange = [textView highlightTermsTemporarilyReturningFirstRange:typedString]; + firstFoundTermRange = [textView highlightTermsTemporarilyReturningFirstRange:typedString avoidHighlight: + ![prefsController highlightSearchTerms]]; //if there was nothing selected, select the first found range if (!noteSelectionRange.length && firstFoundTermRange.location != NSNotFound) @@ -1283,7 +1606,9 @@ - (BOOL)displayContentsForNoteAtIndex:(int)noteIndex { //NSString *words = noteIndex != [notationController preferredSelectedNoteIndex] ? typedString : nil; //[textView setFutureSelectionRange:noteSelectionRange highlightingWords:words]; - [self updateRTL]; + + [self updateRTL]; + return YES; } @@ -1296,7 +1621,8 @@ - (void)textDidChange:(NSNotification *)aNotification { if (textObject == textView) { [currentNote setContentString:[textView textStorage]]; - [self postTextUpdate]; + [self postTextUpdate]; + [self updateWordCount:(![prefsController showWordCount])]; } } @@ -1319,10 +1645,26 @@ - (void)textDidEndEditing:(NSNotification *)aNotification { } } -- (IBAction)fieldAction:(id)sender { - - [self createNoteIfNecessary]; - [window makeFirstResponder:textView]; +- (NSMenu *)textView:(NSTextView *)view menu:(NSMenu *)menu forEvent:(NSEvent *)event atIndex:(NSUInteger)charIndex { + NSInteger idx; + if ((idx = [menu indexOfItemWithTarget:nil andAction:@selector(_removeLinkFromMenu:)]) > -1) + [menu removeItemAtIndex:idx]; + if ((idx = [menu indexOfItemWithTarget:nil andAction:@selector(orderFrontLinkPanel:)]) > -1) + [menu removeItemAtIndex:idx]; + return menu; +} + +- (NSArray *)textView:(NSTextView *)aTextView completions:(NSArray *)words + forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)anIndex { + NSArray *noteTitles = [notationController noteTitlesPrefixedByString:[[aTextView string] substringWithRange:charRange] indexOfSelectedItem:anIndex]; + return noteTitles; +} + + +- (IBAction)fieldAction:(id)sender { + + [self createNoteIfNecessary]; + [window makeFirstResponder:textView]; } @@ -1357,9 +1699,15 @@ - (NoteObject*)createNoteIfNecessary { [textView setFont:[prefsController noteBodyFont]]; isCreatingANote = YES; - NoteObject *newNote = [notationController addNote:[textView textStorage] withTitle:[field stringValue]]; + NSString *title = [[field stringValue] length] ? [field stringValue] : NSLocalizedString(@"Untitled Note", @"Title of a nameless note"); + NSAttributedString *attributedContents = [textView textStorage] ? [textView textStorage] : [[[NSAttributedString alloc] initWithString:@"" attributes: + [prefsController noteBodyAttributes]] autorelease]; + NoteObject *note = [[[NoteObject alloc] initWithNoteBody:attributedContents title:title delegate:notationController + format:[notationController currentNoteStorageFormat] labels:nil] autorelease]; + [notationController addNewNote:note]; + isCreatingANote = NO; - return newNote; + return note; } return currentNote; @@ -1375,12 +1723,12 @@ - (void)restoreListStateUsingPreferences { [notationController refilterNotes]; CFUUIDBytes bytes = [prefsController UUIDBytesOfLastSelectedNote]; - NSUInteger idx = [self _revealNote:[notationController noteForUUIDBytes:&bytes] options:NVDoNotChangeScrollPosition]; + NSUInteger idx = [self revealNote:[notationController noteForUUIDBytes:&bytes] options:NVDoNotChangeScrollPosition]; //scroll using saved scrollbar position [notesTableView scrollRowToVisible:NSNotFound == idx ? 0 : idx withVerticalOffset:[prefsController scrollOffsetOfLastSelectedNote]]; } -- (NSUInteger)_revealNote:(NoteObject*)note options:(NSUInteger)opts { +- (NSUInteger)revealNote:(NoteObject*)note options:(NSUInteger)opts { if (note) { NSUInteger selectedNoteIndex = [notationController indexInFilteredListForNoteIdenticalTo:note]; @@ -1399,9 +1747,18 @@ - (NSUInteger)_revealNote:(NoteObject*)note options:(NSUInteger)opts { } } - if (opts & NVEditNoteToReveal) [window makeFirstResponder:textView]; - if ((opts & NVOrderFrontWindow) && ![window isKeyWindow]) { - [window makeKeyAndOrderFront:nil]; + if (opts & NVEditNoteToReveal) { + [window makeFirstResponder:textView]; + } + if (opts & NVOrderFrontWindow) { + //for external url-handling, often the app will already have been brought to the foreground + if (![NSApp isActive]) { + if (IsLeopardOrLater) + CurrentContextForWindowNumber([window windowNumber], &spaceSwitchCtx); + [NSApp activateIgnoringOtherApps:YES]; + } + if (![window isKeyWindow]) + [window makeKeyAndOrderFront:nil]; } return selectedNoteIndex; } else { @@ -1411,7 +1768,7 @@ - (NSUInteger)_revealNote:(NoteObject*)note options:(NSUInteger)opts { } - (void)notation:(NotationController*)notation revealNote:(NoteObject*)note options:(NSUInteger)opts { - [self _revealNote:note options:opts]; + [self revealNote:note options:opts]; } - (void)notation:(NotationController*)notation revealNotes:(NSArray*)notes { @@ -1434,6 +1791,10 @@ - (void)searchForString:(NSString*)string { //problem: this won't work when the toolbar (and consequently the searchfield) is hidden; //and neither will the controlTextDidChange implementation + //[self _expandToolbar]; + + [self setDualFieldIsVisible:YES]; + [mainView setNeedsDisplay:YES]; [window makeFirstResponder:field]; NSTextView* fieldEditor = (NSTextView*)[field currentEditor]; NSRange fullRange = NSMakeRange(0, [[fieldEditor string] length]); @@ -1449,14 +1810,16 @@ - (void)searchForString:(NSString*)string { - (void)bookmarksController:(BookmarksController*)controller restoreNoteBookmark:(NoteBookmark*)aBookmark inBackground:(BOOL)inBG { if (aBookmark) { [self searchForString:[aBookmark searchString]]; - [self _revealNote:[aBookmark noteObject] options:!inBG ? NVOrderFrontWindow : 0]; + [self revealNote:[aBookmark noteObject] options:!inBG ? NVOrderFrontWindow : 0]; } } + - (void)splitView:(RBSplitView*)sender wasResizedFrom:(CGFloat)oldDimension to:(CGFloat)newDimension { if (sender == splitView) { - [sender adjustSubviewsExcepting:[splitView subviewAtPosition:0]]; + [self setMaxNoteBodyWidth]; + [sender adjustSubviewsExcepting:notesSubview]; } } @@ -1464,57 +1827,79 @@ - (BOOL)splitView:(RBSplitView*)sender shouldHandleEvent:(NSEvent*)theEvent inDi betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing { //if upon the first mousedown, the top selected index is visible, snap to it when resizing [notesTableView noteFirstVisibleRow]; + if ([theEvent clickCount]>1) { + if ((currentNote)||([notesSubview isCollapsed])){ + [self toggleCollapse:sender]; + } + return NO; + } return YES; } //mail.app-like resizing behavior wrt item selections - (void)willAdjustSubviews:(RBSplitView*)sender { - [notesTableView makeFirstPreviouslyVisibleRowVisibleIfNecessary]; + //problem: don't do this if the horizontal splitview is being resized; in horizontal layout, only do this when resizing the window + if (![prefsController horizontalLayout]) { + [notesTableView makeFirstPreviouslyVisibleRowVisibleIfNecessary]; + } } +- (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize { + if ([prefsController horizontalLayout]) { + [notesTableView makeFirstPreviouslyVisibleRowVisibleIfNecessary]; + } + return proposedFrameSize; +} +/* - (void)_expandToolbar { if (![toolbar isVisible]) { [window setTitle:@"Notation"]; if (currentNote) [field setStringValue:titleOfNote(currentNote)]; - [window toggleToolbarShown:nil]; - if (![splitView isDragging]) - [[splitView subviewAtPosition:0] setDimension:100.0]; - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"ToolbarHidden"]; + [toolbar setVisible:YES]; + //[window toggleToolbarShown:nil]; + // if (![splitView isDragging]) + //[[splitView subviewAtPosition:0] setDimension:100.0]; + //[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"ToolbarHidden"]; } + //if ([[splitView subviewAtPosition:0] isCollapsed]) + // [[splitView subviewAtPosition:0] expand]; + } - (void)_collapseToolbar { if ([toolbar isVisible]) { - if (currentNote) - [window setTitle:titleOfNote(currentNote)]; - [window toggleToolbarShown:nil]; - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"ToolbarHidden"]; + // if (currentNote) + // [window setTitle:titleOfNote(currentNote)]; +// [window toggleToolbarShown:nil]; + + [toolbar setVisible:NO]; + //[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"ToolbarHidden"]; } } - +*/ - (BOOL)splitView:(RBSplitView*)sender shouldResizeWindowForDivider:(NSUInteger)divider betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing willGrow:(BOOL)grow { if ([sender isDragging]) { - BOOL toolbarVisible = [toolbar isVisible]; + BOOL toolbarVisible = [self dualFieldIsVisible]; NSPoint mouse = [sender convertPoint:[[window currentEvent] locationInWindow] fromView:nil]; - - if ((toolbarVisible && !grow && mouse.y < -28.0 && ![leading canShrink]) || + CGFloat mouseDim = mouse.y; + if ([splitView isVertical]) { + mouseDim = mouse.x - 50.0; + } + if ((toolbarVisible && !grow && mouseDim < -28.0 && ![leading canShrink]) || (!toolbarVisible && grow)) { - BOOL wasVisible = toolbarVisible; - if (toolbarVisible) { - [self _collapseToolbar]; - } else { - [self _expandToolbar]; - } - - if (!wasVisible && [window firstResponder] == window) { + [self setDualFieldIsVisible:!toolbarVisible]; + + [mainView setNeedsDisplay:YES]; + if (!toolbarVisible && [window firstResponder] == window) { //if dualfield had first responder previously, it might need to be restored //if it had been removed from the view hierarchy due to hiding the toolbar [field selectText:sender]; } - } + } + [self setMaxNoteBodyWidth]; } return NO; @@ -1522,7 +1907,7 @@ - (BOOL)splitView:(RBSplitView*)sender shouldResizeWindowForDivider:(NSUInteger) - (void)tableViewColumnDidResize:(NSNotification *)aNotification { NoteAttributeColumn *col = [[aNotification userInfo] objectForKey:@"NSTableColumn"]; - if (dereferencingFunction(col) == tableTitleOfNote || dereferencingFunction(col) == properlyHighlightingTableTitleOfNote) { + if ([[col identifier] isEqualToString:NoteTitleColumnString]) { [notationController regeneratePreviewsForColumn:col visibleFilteredRows:[notesTableView rowsInRect:[notesTableView visibleRect]] forceUpdate:NO]; [NSObject cancelPreviousPerformRequestsWithTarget:notesTableView selector:@selector(reloadDataIfNotEditing) object:nil]; @@ -1533,11 +1918,27 @@ - (void)tableViewColumnDidResize:(NSNotification *)aNotification { - (NSRect)splitView:(RBSplitView*)sender willDrawDividerInRect:(NSRect)dividerRect betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing withProposedRect:(NSRect)imageRect { - [dividerShader drawDividerInRect:dividerRect withDimpleRect:imageRect]; + [dividerShader drawDividerInRect:dividerRect withDimpleRect:imageRect blendVertically:![prefsController horizontalLayout]]; return NSZeroRect; } +- (NSUInteger)splitView:(RBSplitView*)sender dividerForPoint:(NSPoint)point inSubview:(RBSplitSubview*)subview { + //if ([(AugmentedScrollView*)[notesTableView enclosingScrollView] shouldDragWithPoint:point sender:sender]) { + // return 0; // [firstSplit position], which we assume to be zero + //} + return NSNotFound; +} + +- (BOOL)splitView:(RBSplitView*)sender canCollapse:(RBSplitSubview*)subview { + if ([sender subviewAtPosition:0] == subview) { + return currentNote != nil; + //this is the list view; let it collapse in horizontal layout when a note is being edited + //return [prefsController horizontalLayout] && currentNote != nil; + } + return NO; +} + //the notationcontroller must call notationListShouldChange: first //if it's going to do something that could mess up the tableview's field eidtor @@ -1559,7 +1960,7 @@ - (void)notationListMightChange:(NotationController*)someNotation { if ([notesTableView numberOfSelectedRows] > 0) { NSIndexSet *indexSet = [notesTableView selectedRowIndexes]; - + [savedSelectedNotes release]; savedSelectedNotes = [[someNotation notesAtIndexes:indexSet] retain]; } @@ -1593,7 +1994,8 @@ - (void)notationListDidChange:(NotationController*)someNotation { - (void)titleUpdatedForNote:(NoteObject*)aNoteObject { if (aNoteObject == currentNote) { - if ([toolbar isVisible]) { + // if ([toolbar isVisible]) { + if ([self dualFieldIsVisible]) { [field setStringValue:titleOfNote(currentNote)]; } else { [window setTitle:titleOfNote(currentNote)]; @@ -1606,7 +2008,8 @@ - (void)contentsUpdatedForNote:(NoteObject*)aNoteObject { if (aNoteObject == currentNote) { [[textView textStorage] setAttributedString:[aNoteObject contentString]]; - [self postTextUpdate]; + [self postTextUpdate]; + [self updateWordCount:(![prefsController showWordCount])]; } } @@ -1639,11 +2042,25 @@ - (IBAction)fixFileEncoding:(id)sender { } } +- (void)windowDidResignKey:(NSNotification *)notification{ + if ([notification object] == [TagEditer tagPanel]) { //<--this is for ElasticThreads' multitagging window + + if ([TagEditer isMultitagging]) { + // BOOL tagExists = YES; + [TagEditer closeTP:self]; + if (cTags) { + cTags = nil; + [cTags release]; + } + } + } + +} + - (void)windowWillClose:(NSNotification *)aNotification { -// if ([prefsController quitWhenClosingWindow] && [[aNotification object] isEqual:self]) -// [NSApp terminate:nil]; - if ([prefsController quitWhenClosingWindow]) + if ([prefsController quitWhenClosingWindow]){ [NSApp terminate:nil]; + } } - (void)_finishSyncWait { @@ -1666,9 +2083,6 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sende //otherwise, if there are unsynced notes to send, then push them right now and wait until session is no longer running //use waitForUncommitedChangesWithTarget:selector: and provide a callback to send NSTerminateNow - if (fullscreenWindow) { - [self toggleFullscreen:self]; - } InvocationRecorder *invRecorder = [InvocationRecorder invocationRecorder]; [[invRecorder prepareWithInvocationTarget:self] _finishSyncWait]; @@ -1714,10 +2128,22 @@ - (void)applicationWillTerminate:(NSNotification *)aNotification { } - (void)dealloc { + [mainView release]; + [dualFieldView release]; + [wordCounter release]; + [splitView release]; + [splitSubview release]; + [notesSubview release]; + [notesScrollView release]; + [textScrollView release]; [previewController release]; [windowUndoManager release]; [dividerShader release]; - [self postTextUpdate]; + [[NSStatusBar systemStatusBar] removeStatusItem:statusItem]; + [statusItem release]; + [cView release]; + [statBarMenu release]; + [self postTextUpdate]; [super dealloc]; } @@ -1729,97 +2155,982 @@ - (IBAction)showPreferencesWindow:(id)sender { - (IBAction)toggleNVActivation:(id)sender { if ([NSApp isActive] && [window isMainWindow]) { - [NSApp hide:sender]; + + SpaceSwitchingContext laterSpaceSwitchCtx; + if (IsLeopardOrLater) + CurrentContextForWindowNumber([window windowNumber], &laterSpaceSwitchCtx); + + if (!IsLeopardOrLater || !CompareContextsAndSwitch(&spaceSwitchCtx, &laterSpaceSwitchCtx)) { + //hide only if we didn't need to or weren't able to switch spaces + [NSApp hide:sender]; + } + //clear the space-switch context that we just looked at, to ensure it's not reused inadvertently + bzero(&spaceSwitchCtx, sizeof(SpaceSwitchingContext)); return; } [self bringFocusToControlField:sender]; } - (IBAction)bringFocusToControlField:(id)sender { - [self _expandToolbar]; - + //For ElasticThreads' fullscreen mode use this if/else otherwise uncomment the expand toolbar + if ([notesSubview isCollapsed]) { + [self toggleCollapse:self]; + }else if (![self dualFieldIsVisible]){ + + [self setDualFieldIsVisible:YES]; + } + [field selectText:sender]; - if (![NSApp isActive]) [NSApp activateIgnoringOtherApps:YES]; + if (![NSApp isActive]) { + CurrentContextForWindowNumber([window windowNumber], &spaceSwitchCtx); + [NSApp activateIgnoringOtherApps:YES]; + } if (![window isMainWindow]) [window makeKeyAndOrderFront:sender]; - [self setEmptyViewState:currentNote == nil]; + isEd = NO; } - (NSWindow*)window { return window; } -- (IBAction)toggleLayout:(id)sender -{ - if ([splitView isVertical] == YES) { - [splitView setVertical:NO]; - [verticalRule setHidden:YES]; - [horizontalRule setHidden:NO]; - } else { - [splitView setVertical:YES]; - [verticalRule setHidden:NO]; - [horizontalRule setHidden:YES]; - } - [splitView restoreState:YES]; - [prefsController setVerticalLayout:[splitView isVertical] sender:self]; - [splitView adjustSubviews]; - [self setMenuItemStates]; +#pragma mark ElasticThreads methods + +- (void)setIsEditing:(BOOL)inBool{ + isEd = inBool; } -- (IBAction)collapseNotes:(id)sender + +- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { + //NSUInteger rowInt = rowIndex; + + if ([[notesTableView selectedRowIndexes] containsIndex:rowIndex]) { + if (isEd) { + [aCell setTextColor:foregrndColor]; + }else{ + [aCell setTextColor:[NSColor whiteColor]]; + } + }else { + [aCell setTextColor:foregrndColor]; + } +} + +- (NSMenu *)statBarMenu{ + return statBarMenu; +} + +- (BOOL)toggleAttachedWindow:(id)sender { - if ([notesList isCollapsed] == YES) - { - [collapseToggle setState:NSOffState]; - [notesList expand]; - } else { - [collapseToggle setState:NSOnState]; - [notesList collapse]; + if (![window isKeyWindow]) { + // [self focusOnCtrlFld:self]; + [NSApp activateIgnoringOtherApps:YES]; + }else { + [NSApp hide:sender]; + // [statusItem popUpStatusItemMenu:statBarMenu]; + // return YES; } + return NO; } -- (void)setMenuItemStates + +- (BOOL)toggleAttachedMenu:(id)sender { - if ([splitView isVertical] == YES) { - [widescreenToggle setState:NSOnState]; - } else { - [widescreenToggle setState:NSOffState]; + /*if (![window isKeyWindow]) { + [self focusOnCtrlFld:self]; + }*/ + [statusItem popUpStatusItemMenu:statBarMenu]; + + return YES; +} + + +- (NSArray *)commonLabels{ + NSCharacterSet *tagSeparators = [NSCharacterSet characterSetWithCharactersInString:@", "]; + NSArray *retArray = [[[NSArray alloc]initWithObjects:@"",nil]retain]; + NSIndexSet *indexes = [notesTableView selectedRowIndexes]; + NSString *existTags; + NSSet *tagsForNote; + NSEnumerator *noteEnum = [[[notationController notesAtIndexes:indexes] objectEnumerator] retain]; + NoteObject *aNote; + NSMutableSet *commonTags = [[[NSMutableSet alloc]initWithCapacity:1] retain]; + NSArray *tagArray; + aNote = [noteEnum nextObject]; + existTags = labelsOfNote(aNote); + if (![existTags isEqualToString:@""]) { + tagArray = [existTags componentsSeparatedByCharactersInSet:tagSeparators]; + [commonTags addObjectsFromArray:tagArray]; + + while (((aNote = [noteEnum nextObject]))&&([commonTags count]>0)) { + existTags = labelsOfNote(aNote); + if (![existTags isEqualToString:@""]) { + tagArray = [existTags componentsSeparatedByCharactersInSet:tagSeparators]; + @try { + if ([tagArray count]>0) { + tagsForNote =[NSSet setWithArray:tagArray]; + if ([commonTags intersectsSet:tagsForNote]) { + [commonTags intersectSet:tagsForNote]; + }else { + [commonTags removeAllObjects]; + break; + } + + }else { + [commonTags removeAllObjects]; + break; + } + } + @catch (NSException * e) { + NSLog(@"intersect EXCEPT: %@",[e description]); + [commonTags removeAllObjects]; + break; + } + }else { + [commonTags removeAllObjects]; + break; + } + } + if ([commonTags count]>0) { + retArray = [commonTags allObjects]; + } + } + [noteEnum release]; + [commonTags release]; + + return retArray; +} + +- (IBAction)multiTag:(id)sender { + NSCharacterSet *tagSeparators = [NSCharacterSet characterSetWithCharactersInString:@", "]; + NSString *existTagString; + NSMutableArray *theTags = [[[NSMutableArray alloc] init] autorelease]; + NSString *thisTag = [TagEditer newMultinoteLabels]; + NSArray *newTags = [thisTag componentsSeparatedByCharactersInSet:tagSeparators]; + [thisTag release]; + for (thisTag in newTags) { + if (([thisTag hasPrefix:@" "])||([thisTag hasSuffix:@" "])) { + thisTag = [thisTag stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + } + if (([thisTag hasPrefix:@","])||([thisTag hasSuffix:@","])) { + thisTag = [thisTag stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@","]]; + } + if (![thisTag isEqualToString:@""]) { + [theTags addObject:thisTag]; + } + } + if ([theTags count]<1) { + [theTags addObject:@""]; + } + + NoteObject *aNote; + NSArray *selNotes = [notationController notesAtIndexes:[notesTableView selectedRowIndexes]]; + for (aNote in selNotes) { + existTagString = labelsOfNote(aNote); + NSMutableArray *finalTags = [[[NSMutableArray alloc] init] autorelease]; + [finalTags addObjectsFromArray:theTags]; + NSArray *existingTags = [existTagString componentsSeparatedByCharactersInSet:tagSeparators]; + thisTag = nil; + for (thisTag in existingTags) { + if (([thisTag hasPrefix:@" "])||([thisTag hasSuffix:@" "])) { + thisTag = [thisTag stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + } + + if ((![theTags containsObject:thisTag])&&(![cTags containsObject:thisTag])&&(![thisTag isEqualToString:@""])) { + [finalTags addObject:thisTag]; + } + } + NSString *newTagsString = [finalTags componentsJoinedByString:@" "]; + if (([newTagsString hasPrefix:@","])||([newTagsString hasSuffix:@","])) { + newTagsString = [newTagsString stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@","]]; + } + [aNote setLabelString:newTagsString]; + } + [TagEditer closeTP:self]; + [cTags release]; + [TagEditer release]; +} + +- (void)setDualFieldInToolbar { + NSView *dualSV = [field superview]; + [dualFieldView removeFromSuperviewWithoutNeedingDisplay]; + [dualSV removeFromSuperviewWithoutNeedingDisplay]; + [dualFieldView release]; + dualFieldItem = [[NSToolbarItem alloc] initWithItemIdentifier:@"DualField"]; + [dualFieldItem setView:dualSV]; + [dualFieldItem setMaxSize:NSMakeSize(FLT_MAX, [dualSV frame].size.height)]; + [dualFieldItem setMinSize:NSMakeSize(50.0f, [dualSV frame].size.height)]; + [dualFieldItem setLabel:NSLocalizedString(@"Search or Create", @"placeholder text in search/create field")]; + + toolbar = [[NSToolbar alloc] initWithIdentifier:@"NVToolbar"]; + [toolbar setAllowsUserCustomization:NO]; + [toolbar setAutosavesConfiguration:NO]; + [toolbar setDisplayMode:NSToolbarDisplayModeIconOnly]; + [toolbar setShowsBaselineSeparator:YES]; + [toolbar setDelegate:self]; + [window setToolbar:toolbar]; + + [window setShowsToolbarButton:NO]; + titleBarButton = [[TitlebarButton alloc] initWithFrame:NSMakeRect(0, 0, 17.0, 17.0) pullsDown:YES]; + [titleBarButton addToWindow:window]; + + [field setDelegate:self]; + [self setDualFieldIsVisible:[self dualFieldIsVisible]]; +} + +- (void)setDualFieldInView { + NSView *dualSV = [field superview]; + BOOL dfIsVis = [self dualFieldIsVisible]; + [dualSV removeFromSuperviewWithoutNeedingDisplay]; + //NSView *wView = [window contentView]; + NSSize wSize = [mainView frame].size; + wSize.height = wSize.height - 38; + [splitView setFrameSize:wSize]; + NSRect dfViewFrame = [splitView frame]; + dfViewFrame.size.height = 40; + dfViewFrame.origin.y = [mainView frame].origin.y+[splitView frame].size.height- 1; + dualFieldView = [[[DFView alloc] initWithFrame:dfViewFrame] retain]; + [mainView addSubview:dualFieldView]; + NSRect dsvFrame = [dualSV frame]; + dsvFrame.origin.y +=4; + dsvFrame.size.width = wSize.width * 0.986; + dsvFrame.origin.x = (wSize.width *0.007); + [dualSV setFrame:dsvFrame]; + [dualFieldView addSubview:dualSV]; + [field setDelegate:self]; + [self setDualFieldIsVisible:[self dualFieldIsVisible]]; + + + [toolbar release]; + [titleBarButton release]; +} + +- (void)setDualFieldIsVisible:(BOOL)isVis{ + if (isVis) { + [window setTitle:@"nvALT"]; + if (currentNote) + [field setStringValue:titleOfNote(currentNote)]; + + if ([mainView isInFullScreenMode]) { + NSSize wSize = [mainView frame].size; + wSize.height = wSize.height-38; + [splitView setFrameSize:wSize]; + [dualFieldView setHidden:NO]; + [splitView adjustSubviews]; + [mainView setNeedsDisplay:YES]; + }else { + [toolbar setVisible:YES]; + // [self _expandToolbar]; + } + [window setInitialFirstResponder:field]; + + }else { + if (currentNote) + [window setTitle:titleOfNote(currentNote)]; + + if ([mainView isInFullScreenMode]) { + [dualFieldView setHidden:YES]; + [splitView setFrameSize:[mainView frame].size]; + [splitView adjustSubviews]; + [mainView setNeedsDisplay:YES]; + }else { + // [self _collapseToolbar]; + [toolbar setVisible:NO]; + } + [window setInitialFirstResponder:textView]; + } + + [[NSUserDefaults standardUserDefaults] setBool:!isVis forKey:@"ToolbarHidden"]; + +} + +/*- (void)hideDualFieldView{ + // NSResponder *currentResp = [window firstResponder]; + if ([mainView isInFullScreenMode]) { + [dualFieldView setHidden:YES]; + // NSSize wSize = [[window contentView] frame].size; + + //[splitView setFrameSize:wSize]; + //[mainView setNeedsDisplay:YES]; + }else { + [self _collapseToolbar]; + } + [window setInitialFirstResponder:textView]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"ToolbarHidden"]; + [window setInitialFirstResponder:textView]; +} + +- (void)showDualFieldView{ + if ([mainView isInFullScreenMode]) { + //NSSize wSize = [[window contentView] frame].size; + //wSize.height = wSize.height-38; + //[splitView setFrameSize:wSize]; + [dualFieldView setHidden:NO]; + }else { + [self _expandToolbar]; + } + [window setInitialFirstResponder:field]; + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"ToolbarHidden"]; +}*/ + +- (BOOL)dualFieldIsVisible{ + return ![[NSUserDefaults standardUserDefaults] boolForKey:@"ToolbarHidden"]; +} + +- (IBAction)toggleCollapse:(id)sender{ + + if ([notesSubview isCollapsed]) { + [self setDualFieldIsVisible:YES]; + //[splitView setDivider: verticalDividerImg];//horiz ? nil : verticalDividerImg]; + //BOOL horiz = [prefsController horizontalLayout]; + [splitView setDividerThickness:8.75f]; + [notesSubview expand]; + }else { + [self setDualFieldIsVisible:NO]; + [splitView setDividerThickness: 7.0]; + [notesSubview collapse]; + [window makeFirstResponder:textView]; + } + [splitView adjustSubviews]; + [mainView setNeedsDisplay:YES]; + [self setMaxNoteBodyWidth]; +} + + +- (void)setMaxNoteBodyWidth{ + if ((![mainView isInFullScreenMode])&&(![prefsController managesTextWidthInWindow])) { + [textView setTextContainerInset:NSMakeSize(3.0f,8.0f)]; + }else{ + NSRect winRect = [window frame]; + float winHRatio = 0.93f; + int kMargWidth = 3; + if ([mainView isInFullScreenMode]){ + winRect = [[window screen] frame]; + winHRatio = 0.85f; + kMargWidth = [textView textContainerInset].width; + } + int maxWidth = [prefsController maxNoteBodyWidth]; + int kMargHt = 8; + + if ([splitView isVertical]) { + if ((winRect.size.width - [notesSubview frame].size.width)>maxWidth) { + kMargWidth = (winRect.size.width - [notesSubview frame].size.width - maxWidth)/2; + kMargHt = (winRect.size.height-(winRect.size.height*winHRatio))/2; + } + }else if (winRect.size.width>maxWidth) { + kMargWidth = (winRect.size.width - maxWidth)/2; + kMargHt = (winRect.size.height-(winRect.size.height*winHRatio))/2; + } + if (kMargHt<8) { + kMargHt = 8; + } + if (kMargWidth<3) { + kMargWidth=3; + } + NSSize fullInset = NSMakeSize(kMargWidth,kMargHt); + [textView setTextContainerInset:fullInset]; + } +} + + +- (IBAction)toggleFullscreen:(id)sender +{ + if(IsLeopardOrLater){ + //@try { + + + isEd = NO; + NSResponder *currentResponder = [window firstResponder]; + NSDictionary* options; + if (([[[NSUserDefaults standardUserDefaults] stringForKey:@"HideDockIcon"] isEqualToString:@"Hide Dock Icon"])&&(IsSnowLeopardOrLater)) { + options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:(NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationHideDock)],@"NSFullScreenModeApplicationPresentationOptions", nil]; + }else { + options = [NSDictionary dictionaryWithObjectsAndKeys:nil]; + } + CGFloat colW = [notesSubview dimension]; + if ([mainView isInFullScreenMode]) { + window = normalWindow; + [mainView exitFullScreenModeWithOptions:options]; + [notesSubview setDimension:colW]; + [self setDualFieldInToolbar]; + [splitView setFrameSize:[mainView frame].size]; + if ((!wasVert)&&([splitView isVertical])) { + [self switchViewLayout:self]; + } + [window makeKeyAndOrderFront:self]; + + }else { + [mainView enterFullScreenMode:[window screen] withOptions:options]; + [notesSubview setDimension:colW]; + [self setDualFieldInView]; + if (![splitView isVertical]) { + [self switchViewLayout:self]; + wasVert = NO; + }else { + wasVert = YES; + } + normalWindow = window; + [normalWindow orderOut:self]; + window = [mainView window]; + //[NSApp setDelegate:self]; + [notesTableView setDelegate:self]; + [window setDelegate:self]; + // [window setInitialFirstResponder:field]; + [field setDelegate:self]; + [textView setDelegate:self]; + [splitView setDelegate:self]; + NSSize wSize = [mainView frame].size; + wSize.height = [splitView frame].size.height; + [splitView setFrameSize:wSize]; + } + [window setBackgroundColor:backgrndColor]; + + if ([[currentResponder description] rangeOfString:@"_NSFullScreenWindow"].length>0){ + currentResponder = textView; + } + if (([currentResponder isKindOfClass:[NSTextView class]])&&(![currentResponder isKindOfClass:[LinkingEditor class]])) { + currentResponder = field; + } + + [splitView setNextKeyView:notesTableView]; + [field setNextKeyView:textView]; + [textView setNextKeyView:field]; + [window setAutorecalculatesKeyViewLoop:NO]; + [window makeFirstResponder:currentResponder]; + + [textView switchFindPanelDelegate]; + [textView setUsesFindPanel:YES]; + + [self setMaxNoteBodyWidth]; + [splitView adjustSubviews]; + + [mainView setNeedsDisplay:YES]; + /*} + @catch (NSException * e) { + NSLog(@"fullscreen issues >%@<",[e name]); + }*/ + } +} + +- (IBAction)openFileInEditor:(id)sender { + NSIndexSet *indexes = [notesTableView selectedRowIndexes]; + NSString *path = nil; + + if ([indexes count] != 1 || !(path = [[notationController noteObjectAtFilteredIndex:[indexes lastIndex]] noteFilePath])) { + NSBeep(); + return; + } + NSString *theApp = [prefsController textEditor]; + if (![[self getTxtAppList] containsObject:theApp]) { + theApp = @"Default"; + [prefsController setTextEditor:@"Default"]; + } + if ((![theApp isEqualToString:@"Default"])&&([[NSFileManager defaultManager] fileExistsAtPath:[[NSWorkspace sharedWorkspace] fullPathForApplication:theApp]])) { + [[NSWorkspace sharedWorkspace] openFile:path withApplication:theApp]; + }else { + if (![theApp isEqualToString:@"Default"]) { + [prefsController setTextEditor:@"Default"]; + } + theApp = [(NSString *)LSCopyDefaultRoleHandlerForContentType((CFStringRef)noteFormat,kLSRolesEditor) autorelease]; + theApp = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier: theApp]; + theApp = [[NSFileManager defaultManager] displayNameAtPath: theApp]; + + + if ((!theApp)||([theApp isEqualToString:@"Safari"])) { + theApp = @"TextEdit"; + } + [[NSWorkspace sharedWorkspace] openFile:path withApplication:theApp]; + } + +} + +- (NSArray *)getTxtAppList{ + int format = [notationController currentNoteStorageFormat]; + if (format == 0) { + noteFormat = @"database"; + [prefsController setTextEditor:nil]; + return nil; + }else{ + if (format == 1) { + noteFormat = [@"public.plain-text" retain]; + // + }else if (format == 2) { + noteFormat = [@"public.text" retain]; + // + }else if (format == 3) { + noteFormat = [@"public.html" retain]; + // + } + NSString *path = nil; + NSMutableArray *retArray= [[[NSMutableArray alloc] initWithObjects:nil] autorelease]; + + path = [[notationController noteObjectAtFilteredIndex:0] noteFilePath]; + CFURLRef myURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,(CFStringRef)path,kCFURLPOSIXPathStyle,false); + + NSArray *handlers = [(NSArray *)LSCopyApplicationURLsForURL(myURL,kLSRolesEditor) autorelease]; + CFRelease(myURL); + if ([handlers count]>0) { + for (NSString* fPath in handlers) { + NSString* name = [[fPath lastPathComponent]stringByDeletingPathExtension]; + if ((![name hasPrefix:@"Adobe"])&&(![name isEqualToString:@"Dashcode"])&&(![retArray containsObject:name])&&(name)&&(![name isEqualToString:@"Notational Velocity"])) { + [retArray addObject:name]; + } + } + } + handlers = [(NSArray *)LSCopyAllRoleHandlersForContentType((CFStringRef)noteFormat,kLSRolesEditor) autorelease]; + + if ([handlers count]>0) { + for (NSString* bundleIdentifier in handlers) { + path = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier: bundleIdentifier]; + NSString* name = [[NSFileManager defaultManager] displayNameAtPath: path]; + if ((![name hasPrefix:@"Adobe"])&&(![name isEqualToString:@"Dashcode"])&&(![retArray containsObject:name])&&(name)&&(![name isEqualToString:@"Notational Velocity"])) { + [retArray addObject:name]; + } + } + } + [retArray sortUsingSelector:@selector(caseInsensitiveCompare:)]; + NSString *defApp = [(NSString *)LSCopyDefaultRoleHandlerForContentType((CFStringRef)noteFormat,kLSRolesEditor) autorelease]; + defApp = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier: defApp]; + defApp = [[NSFileManager defaultManager] displayNameAtPath: defApp]; + + if ((!defApp)||([defApp isEqualToString:@"Safari"])) { + [retArray removeObjectAtIndex:[retArray indexOfObject:@"TextEdit"]]; + defApp = @"TextEdit"; + } + defApp = [@"Default (" stringByAppendingString:defApp]; + defApp = [defApp stringByAppendingString:@")"]; + + [retArray insertObject:defApp atIndex:0]; + return retArray; + + } +} + +- (void)updateTextApp:(id)sender{ + [prefsWindowController updateAppList:self]; +} + +- (IBAction)setBWColorScheme:(id)sender{ + userScheme=0; + [[NSUserDefaults standardUserDefaults] setInteger:userScheme forKey:@"ColorScheme"]; + [self setForegrndColor:[NSColor colorWithCalibratedRed:0.0f green:0.0f blue:0.0f alpha:1.0f]]; + [self setBackgrndColor:[NSColor colorWithCalibratedRed:1.0f green:1.0f blue:1.0f alpha:1.0f]]; + NSMenu *mainM = [NSApp mainMenu]; + NSMenu *viewM = [[mainM itemWithTitle:@"View"] submenu]; + mainM = [[viewM itemWithTitle:@"Color Schemes"] submenu]; + viewM = [[statBarMenu itemWithTitle:@"Color Schemes"] submenu]; + [[mainM itemAtIndex:0] setState:1]; + [[mainM itemAtIndex:1] setState:0]; + [[mainM itemAtIndex:2] setState:0]; + + [[viewM itemAtIndex:0] setState:1]; + [[viewM itemAtIndex:1] setState:0]; + [[viewM itemAtIndex:2] setState:0]; + [self updateColorScheme]; +} + +- (IBAction)setLCColorScheme:(id)sender{ + userScheme=1; + [[NSUserDefaults standardUserDefaults] setInteger:userScheme forKey:@"ColorScheme"]; + [self setForegrndColor:[NSColor colorWithCalibratedRed:0.172f green:0.172f blue:0.172f alpha:1.0f]]; + [self setBackgrndColor:[NSColor colorWithCalibratedRed:0.874f green:0.874f blue:0.874f alpha:1.0f]]; + NSMenu *mainM = [NSApp mainMenu]; + NSMenu *viewM = [[mainM itemWithTitle:@"View"] submenu]; + mainM = [[viewM itemWithTitle:@"Color Schemes"] submenu]; + viewM = [[statBarMenu itemWithTitle:@"Color Schemes"] submenu]; + [[mainM itemAtIndex:0] setState:0]; + [[mainM itemAtIndex:1] setState:1]; + [[mainM itemAtIndex:2] setState:0]; + + [[viewM itemAtIndex:0] setState:0]; + [[viewM itemAtIndex:1] setState:1]; + [[viewM itemAtIndex:2] setState:0]; + [self updateColorScheme]; +} + +- (IBAction)setUserColorScheme:(id)sender{ + userScheme=2; + [[NSUserDefaults standardUserDefaults] setInteger:userScheme forKey:@"ColorScheme"]; + [self setForegrndColor:[prefsController foregroundTextColor]]; + [self setBackgrndColor:[prefsController backgroundTextColor]]; + NSMenu *mainM = [NSApp mainMenu]; + NSMenu *viewM = [[mainM itemWithTitle:@"View"] submenu]; + mainM = [[viewM itemWithTitle:@"Color Schemes"] submenu]; + viewM = [[statBarMenu itemWithTitle:@"Color Schemes"] submenu]; + [[mainM itemAtIndex:0] setState:0]; + [[mainM itemAtIndex:1] setState:0]; + [[mainM itemAtIndex:2] setState:1]; + + [[viewM itemAtIndex:0] setState:0]; + [[viewM itemAtIndex:1] setState:0]; + [[viewM itemAtIndex:2] setState:1]; + //NSLog(@"foreground col is: %@",[foregrndColor description]); + //NSLog(@"background col is: %@",[backgrndColor description]); + [self updateColorScheme]; +} + +- (void)updateColorScheme{ + @try { + [mainView setBackgroundColor:backgrndColor]; + [window setBackgroundColor:backgrndColor];//[NSColor blueColor] + [notesTableView setBackgroundColor:backgrndColor]; + [dividerShader updateColors:backgrndColor]; + + [self updateFieldAttributes]; + [NotesTableHeaderCell setForegroundColor:foregrndColor]; + [dualFieldView setBackgroundColor:backgrndColor]; + //[editorStatusView setBackgroundColor:backgrndColor]; + // [editorStatusView setNeedsDisplay:YES]; + // [field setTextColor:foregrndColor]; + [textView updateTextColors]; + [notationController setForegroundTextColor:foregrndColor]; + if (currentNote) { + [self contentsUpdatedForNote:currentNote]; + } + } + @catch (NSException * e) { + NSLog(@"setting SCheme EXception : %@",[e name]); + } +} + +- (void)updateFieldAttributes{ + if (!foregrndColor) { + foregrndColor = [self foregrndColor]; + } + if (!backgrndColor) { + backgrndColor = [self backgrndColor]; + } + if (fieldAttributes) { + [fieldAttributes release]; + } + fieldAttributes = [[NSDictionary dictionaryWithObject:[textView _selectionColorForForegroundColor:foregrndColor backgroundColor:backgrndColor] forKey:NSBackgroundColorAttributeName] retain]; + + if (isEd) { + [theFieldEditor setDrawsBackground:NO]; + // [theFieldEditor setBackgroundColor:backgrndColor]; + [theFieldEditor setSelectedTextAttributes:fieldAttributes]; + [theFieldEditor setInsertionPointColor:foregrndColor]; + // [notesTableView setNeedsDisplay:YES]; + + } + +} + +- (void)setBackgrndColor:(NSColor *)inColor{ + if (backgrndColor) { + [backgrndColor release]; + } + backgrndColor = inColor; + [backgrndColor retain]; +} + +- (void)setForegrndColor:(NSColor *)inColor{ + if (foregrndColor) { + [foregrndColor release]; + } + foregrndColor = inColor; + [foregrndColor retain]; +} + +- (NSColor *)backgrndColor{ + if (!backgrndColor) { + NSColor *theColor;// = [NSColor redColor]; + if (!userScheme) { + userScheme = [[NSUserDefaults standardUserDefaults] integerForKey:@"ColorScheme"]; + } + if (userScheme==0) { + theColor = [NSColor colorWithCalibratedRed:1.0f green:1.0f blue:1.0f alpha:1.0f]; + }else if (userScheme==1) { + theColor = [NSColor colorWithCalibratedRed:0.874f green:0.874f blue:0.874f alpha:1.0f]; + }else if (userScheme==2) { + NSData *theData = [[NSUserDefaults standardUserDefaults] dataForKey:@"BackgroundTextColor"]; + if (theData){ + theColor = (NSColor *)[NSUnarchiver unarchiveObjectWithData:theData]; + }else { + theColor = [prefsController backgroundTextColor]; + } + + } + [self setBackgrndColor:theColor]; + return theColor; + }else { + return backgrndColor; } - if ([notesList isCollapsed] == YES) { - [collapseToggle setState:NSOnState]; - } else { - [collapseToggle setState:NSOffState]; + +} + +- (NSColor *)foregrndColor{ + if (!foregrndColor) { + NSColor *theColor = [NSColor blackColor]; + if (!userScheme) { + userScheme = [[NSUserDefaults standardUserDefaults] integerForKey:@"ColorScheme"]; + } + + if (userScheme==0) { + theColor = [NSColor colorWithCalibratedRed:0.0f green:0.0f blue:0.0f alpha:1.0f]; + }else if (userScheme==1) { + theColor = [NSColor colorWithCalibratedRed:0.142f green:0.142f blue:0.142f alpha:1.0f]; + }else if (userScheme==2) { + + NSData *theData = [[NSUserDefaults standardUserDefaults] dataForKey:@"ForegroundTextColor"]; + if (theData){ + theColor = (NSColor *)[NSUnarchiver unarchiveObjectWithData:theData]; + }else { + theColor = [prefsController foregroundTextColor]; + } + } + [self setForegrndColor:theColor]; + return theColor; + }else { + return foregrndColor; + } + +} + +- (void)updateWordCount:(BOOL)doIt{ + //NSLog(@"updating wordcount"); + if (doIt) { + /* NSArray *selRange = [textView selectedRanges]; + // NSLog(@"selRange is :%@",[selRange description]); + int theCount = 0; + if (([selRange count]>1)||([[selRange objectAtIndex:0] rangeValue].length>0)) { + for (id aRange in selRange) { + NSRange bRange = [aRange rangeValue]; + NSString *aStr = [[textView string] substringWithRange: bRange]; + if ([aStr length]>0) { + aStr = [aStr stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if ([aStr length]>0) { + for (id bStr in [aStr componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]) { + if ([bStr length]>0) { + theCount += 1; + } + } + } + } + } + }else{*/ + + NSTextStorage *noteStorage = [textView textStorage]; + int theCount = [[noteStorage words] count]; + + // } + if (theCount > 0) { + [wordCounter setStringValue:[[NSString stringWithFormat:@"%d", theCount] stringByAppendingString:@" words"]]; + }else { + [wordCounter setStringValue:@""]; + } + } +} + +- (void)popWordCount:(BOOL)showIt{ + if (showIt) { + if (([wordCounter isHidden])&&([prefsController showWordCount])) { + [self updateWordCount:YES]; + [wordCounter setHidden:NO]; + } + }else { + if ((![wordCounter isHidden])&&([prefsController showWordCount])) { + [wordCounter setHidden:YES]; + [wordCounter setStringValue:@""]; + } } } +- (IBAction)toggleWordCount:(id)sender{ + if (ModFlagger==1) { + if ((![wordCounter isHidden])&&([prefsController showWordCount])) { + [wordCounter setHidden:YES]; + [wordCounter setStringValue:@""]; + } + }else { + if ([prefsController showWordCount]) { + [self updateWordCount:YES]; + [wordCounter setHidden:NO]; + }else { + [wordCounter setHidden:YES]; + [wordCounter setStringValue:@""]; + } + if (![[sender className] isEqualToString:@"NSMenuItem"]) { + [prefsController setShowWordCount:![prefsController showWordCount]]; + [prefsController synchronize]; + } + } +} + +- (void)flagsChanged:(NSEvent *)theEvent{ + if (ModFlagger>=0) { + if (([theEvent keyCode]==58)||([theEvent keyCode]==61)) { + if (([theEvent modifierFlags]==524576)||([theEvent modifierFlags]==524608)) { //option down + modifierTimer = [[NSTimer scheduledTimerWithTimeInterval:0.65 + target:self + selector:@selector(updateModifier:) + userInfo:@"option" + repeats:NO] retain]; + }else if ([theEvent modifierFlags]==256) { //option up + + if (modifierTimer) { + if ([modifierTimer isValid]) { + [modifierTimer invalidate]; + }else { + [self performSelector:@selector(popWordCount:) withObject:NO afterDelay:0.35]; + } + modifierTimer = nil; + [modifierTimer release]; + } + ModFlagger = 0; + + } + }else if (([theEvent keyCode]==59)||([theEvent keyCode]==62)) { + if (([theEvent modifierFlags]==262401)||([theEvent modifierFlags]==270592)) { //control down + modifierTimer = [[NSTimer scheduledTimerWithTimeInterval:0.70 + target:self + selector:@selector(updateModifier:) + userInfo:@"control" + repeats:NO] retain]; + + }else if ([theEvent modifierFlags]==256) { //control up + + if (modifierTimer) { + if ([modifierTimer isValid]) { + [modifierTimer invalidate]; + }else { + [self performSelector:@selector(popPreview:) withObject:NO afterDelay:0.46]; + } + modifierTimer = nil; + [modifierTimer release]; + } + ModFlagger = 0; + } + }else if ([theEvent modifierFlags]==256) { + ModFlagger = 0; + if (modifierTimer) { + if ([modifierTimer isValid]) { + [modifierTimer invalidate]; + } + modifierTimer = nil; + [modifierTimer release]; + } + + }else { + ModFlagger = -1; + if (modifierTimer) { + if ([modifierTimer isValid]) { + [modifierTimer invalidate]; + } + modifierTimer = nil; + [modifierTimer release]; + } + NSTimer *disTimer = [NSTimer scheduledTimerWithTimeInterval:0.2f + target:self + selector:@selector(disableKeyMasks:) + userInfo:@"commandorshift" + repeats:NO]; + } + } +} + +- (void)updateModifier:(NSTimer*)theTimer{ + if ([theTimer isValid]) { + if ([[theTimer userInfo] isEqualToString:@"option"]) { + [self popWordCount:YES]; + ModFlagger = 1; + }else if ([[theTimer userInfo] isEqualToString:@"control"]) { + [self popPreview:YES]; + ModFlagger = 2; + } + [theTimer invalidate]; + } +} + +- (void)disableKeyMasks:(NSTimer *)aTimer{ + ModFlagger = 0; + [aTimer invalidate]; + +} + +- (void)resetModTimers{ + if (ModFlagger==1) { + [self performSelector:@selector(popWordCount:) withObject:NO afterDelay:0.35]; + }else if (ModFlagger==2) { + [self performSelector:@selector(popPreview:) withObject:NO afterDelay:0.46]; + } + ModFlagger = 0; +} + + #pragma mark Preview-related and to be extracted into separate files +- (void)popPreview:(BOOL)showIt{ + if ([previewToggler state]==0) { + if (showIt) { + if (![previewController previewIsVisible]) { + [self togglePreview:self]; + } + }else { + if ([previewController previewIsVisible]) { + [self togglePreview:self]; + } + } + } +} + - (IBAction)togglePreview:(id)sender { + BOOL doIt = (currentNote != nil); + if ([previewController previewIsVisible]) { + doIt = YES; + } + if ([[sender className] isEqualToString:@"NSMenuItem"]) { + [sender setState:![sender state]]; + } + if (doIt) { + [previewController togglePreview:self]; + } +} + +- (void)ensurePreviewIsVisible +{ + if (![[previewController window] isVisible]) { [previewController togglePreview:self]; + } } - (IBAction)toggleSourceView:(id)sender { + [self ensurePreviewIsVisible]; [previewController switchTabs:self]; } - (IBAction)savePreview:(id)sender { - if (![[previewController window] isVisible]) { - [previewController togglePreview:self]; - } + [self ensurePreviewIsVisible]; [previewController saveHTML:self]; } - (IBAction)sharePreview:(id)sender { + [self ensurePreviewIsVisible]; [previewController shareAsk:self]; } +- (IBAction)lockPreview:(id)sender +{ + if (![previewController previewIsVisible]) + return; + if ([previewController isPreviewSticky]) { + [previewController makePreviewNotSticky:self]; + } else { + [previewController makePreviewSticky:self]; + } +} + +- (IBAction)printPreview:(id)sender +{ + [self ensurePreviewIsVisible]; + [previewController printPreview:self]; +} + - (void)postTextUpdate { - [[NSNotificationCenter defaultCenter] postNotificationName:NSTextViewChangedNotification object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"TextView has changed contents" object:self]; } - (IBAction)selectPreviewMode:(id)sender @@ -1829,107 +3140,58 @@ - (IBAction)selectPreviewMode:(id)sender // update user defaults [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInt:currentPreviewMode] - forKey:kDefaultMarkupPreviewMode]; + forKey:@"markupPreviewMode"]; [self postTextUpdate]; } -- (IBAction)toggleFullscreen:(id)sender -{ - [textView setHidden:YES]; +- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client{ + if (isEd) { + // NSLog(@"window will return client is :%@",client); + + if (!fieldAttributes) { + [self updateFieldAttributes]; + }else{ + if (!foregrndColor) { + foregrndColor = [self foregrndColor]; + } + if (!backgrndColor) { + backgrndColor = [self backgrndColor]; + } + [theFieldEditor setDrawsBackground:NO]; + // [theFieldEditor setBackgroundColor:backgrndColor]; + [theFieldEditor setSelectedTextAttributes:fieldAttributes]; + [theFieldEditor setInsertionPointColor:foregrndColor]; + + // [notesTableView setNeedsDisplay:YES]; + } + }else {//if (client==field) { + [theFieldEditor setDrawsBackground:NO]; + [theFieldEditor setSelectedTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSColor selectedTextBackgroundColor], NSBackgroundColorAttributeName, nil]]; + [theFieldEditor setInsertionPointColor:[NSColor blackColor]]; + } + // NSLog(@"window first is :%@",[window firstResponder]); + //NSLog(@"client is :%@",client); + //} + + + return theFieldEditor; + //[super windowWillReturnFieldEditor:sender toObject:client]; +} - if (fullscreenWindow) - { - NSView *firstResponder = (NSView *)[fullscreenWindow firstResponder]; - if ([firstResponder isKindOfClass:[NSTextView class]] && - [[(NSTextView *)firstResponder delegate] isKindOfClass:[NSTextField class]]) - { - firstResponder = [(NSTextView *)firstResponder delegate]; - } - else if (![firstResponder isKindOfClass:[NSView class]]) - { - firstResponder = nil; - } - - NSRect newFrame = [fullscreenWindow frameRectForContentRect: - [window contentRectForFrameRect:[window frame]]]; - [fullscreenWindow - setFrame:newFrame - display:YES - animate:YES]; - - NSView *contentView = [[[fullscreenWindow contentView] retain] autorelease]; - [fullscreenWindow setContentView:[[[NSView alloc] init] autorelease]]; - - [window setContentView:contentView]; - if (firstResponder) - { - [window makeFirstResponder:firstResponder]; - } - [window makeKeyAndOrderFront:nil]; - - [fullscreenWindow close]; - fullscreenWindow = nil; - - if ([[window screen] isEqual:[[NSScreen screens] objectAtIndex:0]]) - { - [NSMenu setMenuBarVisible:YES]; - } - - [textView setTextContainerInset:NSMakeSize(20,40)]; - [notesList setHidden:NO]; +- (void)updateRTL +{ + if ([prefsController rtl]) { + [textView setBaseWritingDirection:NSWritingDirectionRightToLeft range:NSMakeRange(0, [[textView string] length])]; + } else { + [textView setBaseWritingDirection:NSWritingDirectionLeftToRight range:NSMakeRange(0, [[textView string] length])]; } - else - { - [notesList setHidden:YES]; - NSView *firstResponder = (NSView *)[window firstResponder]; - if ([firstResponder isKindOfClass:[NSTextView class]] && - [[(NSTextView *)firstResponder delegate] isKindOfClass:[NSTextField class]]) - { - firstResponder = [(NSTextView *)firstResponder delegate]; - } - else if (![firstResponder isKindOfClass:[NSView class]]) - { - firstResponder = nil; - } - - if ([[window screen] isEqual:[[NSScreen screens] objectAtIndex:0]]) - { - [NSMenu setMenuBarVisible:NO]; - } - - [window orderOut:nil]; - fullscreenWindow = [[FullscreenWindow alloc] - initWithContentRect:[window contentRectForFrameRect:[window frame]] - styleMask:NSBorderlessWindowMask - backing:NSBackingStoreBuffered - defer:YES - screen:[window screen]]; - NSView *contentView = [[[window contentView] retain] autorelease]; - [window setContentView:[[[NSView alloc] init] autorelease]]; - - [fullscreenWindow setHidesOnDeactivate:YES]; - [fullscreenWindow setLevel:NSFloatingWindowLevel]; - [fullscreenWindow setContentView:contentView]; - [fullscreenWindow setTitle:[window title]]; - if (firstResponder) - { - [fullscreenWindow makeFirstResponder:firstResponder]; - } - [fullscreenWindow makeKeyAndOrderFront:nil]; - - [fullscreenWindow setFrame: - [fullscreenWindow - frameRectForContentRect:[[fullscreenWindow screen] frame]] - display:YES - animate:YES]; - NSRect screenRect = [textView frame]; - NSSize viewSize = {(screenRect.size.width - 650) / 2,40}; - - [textView setTextContainerInset:viewSize]; - - } - [textView setHidden:NO]; +} + +- (void)refreshNotesList +{ + [notesTableView setBackgroundColor:[prefsController backgroundTextColor]]; + [notesTableView setNeedsDisplay:YES]; } @end diff --git a/AppController_Importing.h b/AppController_Importing.h new file mode 100644 index 00000000..29081dc4 --- /dev/null +++ b/AppController_Importing.h @@ -0,0 +1,28 @@ +// +// AppController_Importing.h +// Notation +// +// Created by Zachary Schneirov on 1/14/11. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + + +#import +#import "AppController.h" + +@interface AppController (Importing) + +- (BOOL)addNotesFromPasteboard:(NSPasteboard*)pasteboard; +- (BOOL)interpretNVURL:(NSURL*)aURL; +- (NSString*)stringWithNoteURLsOnPasteboard:(NSPasteboard*)pboard; + +@end diff --git a/AppController_Importing.m b/AppController_Importing.m new file mode 100644 index 00000000..1d8c43ab --- /dev/null +++ b/AppController_Importing.m @@ -0,0 +1,336 @@ +// +// AppController_Importing.m +// Notation +// +// Created by Zachary Schneirov on 1/14/11. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + + +#import "AppController_Importing.h" +#import "NotationController.h" +#import "NotationFileManager.h" +#import "BookmarksController.h" +#import "DualField.h" +#import "SyncSessionController.h" +#import "NotationSyncServiceManager.h" +#import "NotationDirectoryManager.h" +#import "AlienNoteImporter.h" +#import "NSString_NV.h" +#import +#import "GlobalPrefs.h" +#import "NSData_transformations.h" +#import "AttributedPlainText.h" +#import "NSCollection_utils.h" +#import "NoteObject.h" +#import "NotationPrefs.h" + +@implementation AppController (Importing) + +- (BOOL)addNotesFromPasteboard:(NSPasteboard*)pasteboard { + + NSArray *types = [pasteboard types]; + NSMutableAttributedString *newString = nil; + NSData *data = nil; + BOOL pbHasPlainText = [types containsObject:NSStringPboardType]; + + if ([types containsObject:NSFilenamesPboardType]) { + NSArray *files = [pasteboard propertyListForType:NSFilenamesPboardType]; + if ([files isKindOfClass:[NSArray class]]) { + if ([notationController openFiles:files]) return YES; + } + } + + NSString *sourceIdentifierString = nil; + + //webkit URL! + if ([types containsObject:WebArchivePboardType]) { + sourceIdentifierString = [[pasteboard dataForType:WebArchivePboardType] pathURLFromWebArchive]; + //gecko URL! + } else if ([types containsObject:[NSString customPasteboardTypeOfCode:0x4D5A0003]]) { + //lazilly use syntheticTitle to get first line, even though that's not how our API is documented + sourceIdentifierString = [[pasteboard stringForType:[NSString customPasteboardTypeOfCode:0x4D5A0003]] syntheticTitleAndTrimmedBody:NULL]; + unichar nullChar = 0x0; + sourceIdentifierString = [sourceIdentifierString stringByReplacingOccurrencesOfString: + [NSString stringWithCharacters:&nullChar length:1] withString:@""]; + } + + if ([types containsObject:NSURLPboardType] || (pbHasPlainText && [[pasteboard stringForType:NSStringPboardType] superficiallyResemblesAnHTTPURL])) { + NSURL *url = [NSURL URLFromPasteboard:pasteboard]; + if (!url) url = [NSURL URLWithString:[pasteboard stringForType:NSStringPboardType]]; + + NSString *potentialURLString = pbHasPlainText ? [pasteboard stringForType:NSStringPboardType] : nil; + if (potentialURLString && [[url absoluteString] isEqualToString:potentialURLString]) { + //only begin downloading if we know that there's no other useful string data + //because we've already checked NSFilenamesPboardType + + if ([[url scheme] caseInsensitiveCompare:@"http"] == NSOrderedSame || + [[url scheme] caseInsensitiveCompare:@"https"] == NSOrderedSame || + [[url scheme] caseInsensitiveCompare:@"ftp"] == NSOrderedSame) { + NSString *linkTitleType = [NSString customPasteboardTypeOfCode:0x75726C6E]; + NSString *linkTitle = [types containsObject:linkTitleType] ? [[pasteboard stringForType:linkTitleType] syntheticTitleAndTrimmedBody:NULL] : nil; + if (!linkTitle) { + //try urld instead of urln + linkTitleType = [NSString customPasteboardTypeOfCode:0x75726C64]; + linkTitle = [types containsObject:linkTitleType] ? [[pasteboard stringForType:linkTitleType] syntheticTitleAndTrimmedBody:NULL] : nil; + } + [[[[AlienNoteImporter alloc] init] autorelease] importURLInBackground:url linkTitle:linkTitle receptionDelegate:self]; + return YES; + } + } + } + + //safari on 10.5 does not seem to provide a plain-text equivalent, so we must be able to dumb-down RTF data as well + //should fall-back to plain text if 1) user doesn't want styles and 2) plain text is actually available + BOOL shallUsePlainTextFallback = pbHasPlainText && ![prefsController pastePreservesStyle]; + BOOL hasRTFData = NO; + + if ([types containsObject:NVPTFPboardType]) { + if ((data = [pasteboard dataForType:NVPTFPboardType])) + newString = [[NSMutableAttributedString alloc] initWithRTF:data documentAttributes:NULL]; + + } else if ([types containsObject:NSRTFPboardType] && !shallUsePlainTextFallback) { + if ((data = [pasteboard dataForType:NSRTFPboardType])) + newString = [[NSMutableAttributedString alloc] initWithRTF:data documentAttributes:NULL]; + hasRTFData = YES; + } else if ([types containsObject:NSRTFDPboardType] && !shallUsePlainTextFallback) { + if ((data = [pasteboard dataForType:NSRTFDPboardType])) + newString = [[NSMutableAttributedString alloc] initWithRTFD:data documentAttributes:NULL]; + hasRTFData = YES; + } else if ([types containsObject:WebArchivePboardType] && !shallUsePlainTextFallback) { + if ((data = [pasteboard dataForType:WebArchivePboardType])) { + //set a timeout because -[NSHTMLReader _loadUsingWebKit] can sometimes hang + newString = [[NSMutableAttributedString alloc] initWithData:data options:[NSDictionary optionsDictionaryWithTimeout:10.0] + documentAttributes:NULL error:NULL]; + } + hasRTFData = YES; + + } else if ([types containsObject:NSHTMLPboardType] && !shallUsePlainTextFallback) { + if ((data = [pasteboard dataForType:NSHTMLPboardType])) + newString = [[NSMutableAttributedString alloc] initWithHTML:data documentAttributes:NULL]; + hasRTFData = YES; + } else if (pbHasPlainText) { + + NSString *pboardString = [pasteboard stringForType:NSStringPboardType]; + if (pboardString) newString = [[NSMutableAttributedString alloc] initWithString:pboardString]; + } + + [newString autorelease]; + if ([newString length] > 0) { + [newString removeAttachments]; + + if (hasRTFData && ![prefsController pastePreservesStyle]) //fallback scenario + newString = [[[NSMutableAttributedString alloc] initWithString:[newString string]] autorelease]; + + NSUInteger bodyLoc = 0, prefixedSourceLength = 0; + NSString *noteTitle = [[newString string] syntheticTitleAndSeparatorWithContext:NULL bodyLoc:&bodyLoc maxTitleLen:36]; + if ([sourceIdentifierString length] > 0) { + //add the URL or wherever it was that this piece of text came from + prefixedSourceLength = [[newString prefixWithSourceString:sourceIdentifierString] length]; + } + [newString santizeForeignStylesForImporting]; + + NoteObject *note = [[[NoteObject alloc] initWithNoteBody:newString title:noteTitle delegate:notationController + format:[notationController currentNoteStorageFormat] labels:nil] autorelease]; + if (bodyLoc > 0 && [newString length] >= bodyLoc + prefixedSourceLength) [note setSelectedRange:NSMakeRange(prefixedSourceLength, bodyLoc)]; + [notationController addNewNote:note]; + + return note != nil; + } + + return NO; +} + +- (BOOL)interpretNVURL:(NSURL*)aURL { + // currently supported: + // hostname -> command + // first level -> search term / title + // second level -> sync keys as parameters + // example: nv://find/url%20test/?SN=agtzaW1wbGUtbm90ZXINCxIETm90ZRiY-dEFDA&NV=5WJ0eP3YRaCjyQn%2F8p62iQ%3D%3D + + NSUInteger j, i = 0; + + if ([[aURL host] isEqualToString:@"find"]) { + //dispatch searchForString: and revealNote:options: as appropriate + + //add currentNote to the snapback button back-stack + if (currentNote) { + [field pushFollowedLink:[[[NoteBookmark alloc] initWithNoteObject:currentNote searchString:[self fieldSearchString]] autorelease]]; + } + + NSString *terms = [aURL path]; + [self searchForString:([terms length] && [terms characterAtIndex:0] == '/') ? [terms substringFromIndex:1] : terms]; + + NSArray *params = [[aURL query] componentsSeparatedByString:@"&"]; + NSArray *svcs = [[SyncSessionController class] allServiceNames]; + NoteObject *foundNote = nil; + + for (i=0; i<[params count]; i++) { + NSString *idStr = [params objectAtIndex:i]; + + if ([idStr hasPrefix:@"NV="] && [idStr length] > 3) { + NSData *uuidData = [[[idStr substringFromIndex:3] stringByReplacingPercentEscapes] decodeBase64WithNewlines:NO]; + if ((foundNote = [notationController noteForUUIDBytes:(CFUUIDBytes*)[uuidData bytes]])) + goto handleFound; + } + + for (j=0; j<[svcs count]; j++) { + NSString *serviceName = [svcs objectAtIndex:j]; + if ([idStr hasPrefix:[NSString stringWithFormat:@"%@=", serviceName]] && [idStr length] > [serviceName length] + 1) { + //lookup note with identical key for this service + NSString *key = [[idStr substringFromIndex:[serviceName length] + 1] stringByReplacingPercentEscapes]; + if ((foundNote = [notationController noteForKey:key ofServiceClass:[[SyncSessionController allServiceClasses] objectAtIndex:j]])) + goto handleFound; + } + } + } + handleFound: + //if this search had initiated a clearing of the history, then make sure it doesn't happen + [NSObject cancelPreviousPerformRequestsWithTarget:field selector:@selector(clearFollowedLinks) object:nil]; + + if (foundNote) [self revealNote:foundNote options:NVOrderFrontWindow]; + return YES; + + } else if ([[aURL host] isEqualToString:@"make"]) { + + NSArray *params = [[aURL query] componentsSeparatedByString:@"&"]; + + //parameters: "title" and one of the following for the body: "txt", "html" (maybe "md" for markdown in the future) + //if title is missing, add the body via -[addNotesFromPasteboard:] + NSString *title = nil, *txtBody = nil, *htmlBody = nil, *tags = nil, *urlTxt = nil; + for (i=0; i<[params count]; i++) { + NSString *compStr = [params objectAtIndex:i]; + if ([compStr hasPrefix:@"title="] && [compStr length] > 6) { + title = [[compStr substringFromIndex:6] stringByReplacingPercentEscapes]; + } else if ([compStr hasPrefix:@"txt="] && [compStr length] > 4) { + txtBody = [[compStr substringFromIndex:4] stringByReplacingPercentEscapes]; + } else if ([compStr hasPrefix:@"html="] && [compStr length] > 5) { + htmlBody = [[compStr substringFromIndex:5] stringByReplacingPercentEscapes]; + } else if ([compStr hasPrefix:@"tags="] && [compStr length] > 5) { + tags = [[compStr substringFromIndex:5] stringByReplacingPercentEscapes]; + }else if ([compStr hasPrefix:@"url="] && [compStr length] > 4) { + urlTxt = [[compStr substringFromIndex:4] stringByReplacingPercentEscapes]; + txtBody = nil; + htmlBody = nil; + } + } + if (urlTxt) { + // NSPasteboard *pboard = [NSPasteboard pasteboardWithUniqueName]; + NSURL *theURL = [NSURL URLWithString:urlTxt]; + // NSData *data = [urlTxt dataUsingEncoding:NSUTF8StringEncoding]; + if (theURL) { + // [pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; + //[pboard setData:data forType:NSStringPboardType]; + NSString *linkTitle = nil; + if (title) { + linkTitle = title; + } + [[[[AlienNoteImporter alloc] init] autorelease] importURLInBackground:theURL linkTitle:linkTitle receptionDelegate:self]; + } + return; + }else{ + if (title && (txtBody || htmlBody)) { + NSMutableAttributedString *attributedContents = nil; + + if (htmlBody) { + attributedContents = [[NSMutableAttributedString alloc] initWithHTML:[htmlBody dataUsingEncoding:NSUTF8StringEncoding] + options:[NSDictionary optionsDictionaryWithTimeout:10.0] documentAttributes:NULL]; + } else { + attributedContents = [[NSMutableAttributedString alloc] initWithString:txtBody attributes:[prefsController noteBodyAttributes]]; + } + [attributedContents removeAttachments]; + [attributedContents santizeForeignStylesForImporting]; + + NoteObject *note = [[[NoteObject alloc] initWithNoteBody:[attributedContents autorelease] title:title delegate:notationController + format:[notationController currentNoteStorageFormat] labels:tags] autorelease]; + [notationController addNewNote:note]; + return YES; + } else if (txtBody || htmlBody) { + NSPasteboard *pboard = [NSPasteboard pasteboardWithUniqueName]; + NSData *data = [htmlBody dataUsingEncoding:NSUTF8StringEncoding]; + [pboard declareTypes:[NSArray arrayWithObject: data ? NSHTMLPboardType : NSStringPboardType] owner:nil]; + if (data) { + [pboard setData:data forType:NSHTMLPboardType]; + } else if (txtBody) { + [pboard setString:txtBody forType:NSStringPboardType]; + } else { + NSLog(@"no txt or html to add to pboard"); + return NO; + } + return [self addNotesFromPasteboard:pboard]; + } + } + } else if ([[aURL host] length]) { + //assume find by default + if (currentNote) { + [field pushFollowedLink:[[[NoteBookmark alloc] initWithNoteObject:currentNote searchString:[self fieldSearchString]] autorelease]]; + } + [self searchForString:[aURL host]]; + return YES; + } + + return NO; +} + +- (NSString*)stringWithNoteURLsOnPasteboard:(NSPasteboard*)pboard { + //paste as a file:// URL, so that it can be linked + + NSMutableString *allURLsString = [NSMutableString string]; + + NSArray *files = [pboard propertyListForType:NSFilenamesPboardType]; + if ([files isKindOfClass:[NSArray class]]) { + NSArray *unknownPaths = files; + NSUInteger i; + + if ([notationController currentNoteStorageFormat] != SingleDatabaseFormat) { + //notes are stored as separate files, so if these paths are in the notes folder then NV can create double-bracketed-links to them instead + + NSSet *existingNotes = [notationController notesWithFilenames:files unknownFiles:&unknownPaths]; + if ([existingNotes count]) { + //create double-bracketed links using these notes' titles + NSArray *existingArray = [existingNotes allObjects]; + for (i=0; i<[existingArray count]; i++) { + [allURLsString appendFormat:@"[[%@]]%s", titleOfNote([existingArray objectAtIndex:i]), + (i < [existingArray count] - 1) || [unknownPaths count] ? "\n" : ""]; + } + } + } + //NSLog(@"paths not found in DB: %@", unknownPaths); + + for (i=0; i<[unknownPaths count]; i++) { + NSURL *url = [NSURL fileURLWithPath:[unknownPaths objectAtIndex:i]]; + if (url) { + NSString *linkFormat = @"<%@>%s"; + NSString *pathString = [url absoluteString]; + NSLog(@"%s",pathString); + if ([pathString hasSuffix:@"jpg"] || + [pathString hasSuffix:@"jpeg"] || + [pathString hasSuffix:@"gif"] || + [pathString hasSuffix:@"png"]) + { + currentPreviewMode = [[NSUserDefaults standardUserDefaults] integerForKey:@"markupPreviewMode"]; + if (currentPreviewMode == MarkdownPreview || currentPreviewMode == MultiMarkdownPreview) { + linkFormat = @"![](%@)%s"; + } else if (currentPreviewMode == TextilePreview) { + linkFormat = @"!%@()!%s"; + } + } + [allURLsString appendFormat:linkFormat, + [pathString stringByReplacingOccurrencesOfString:@"file://localhost" withString:@"file://"], + (i < [unknownPaths count] - 1) ? "\n" : ""]; + } + } + } + return allURLsString; +} + +@end diff --git a/AppController_Preview.m b/AppController_Preview.m index d2fb36a1..a563f84c 100755 --- a/AppController_Preview.m +++ b/AppController_Preview.m @@ -15,7 +15,7 @@ -(NSString *)noteContent } -(NSInteger)currentPreviewMode -{ +{ return currentPreviewMode; } diff --git a/AttributedPlainText.h b/AttributedPlainText.h index d0e88634..0844af32 100755 --- a/AttributedPlainText.h +++ b/AttributedPlainText.h @@ -20,20 +20,24 @@ #define SEPARATE_ATTRS 0 +extern NSString *NVHiddenDoneTagAttributeName; +extern NSString *NVHiddenBulletIndentAttributeName; + @interface NSMutableAttributedString (AttributedPlainText) - (void)trimLeadingWhitespace; - (void)removeAttachments; -- (void)prefixWithSourceString:(NSString*)source; +- (NSString*)prefixWithSourceString:(NSString*)source; - (NSString*)trimLeadingSyntheticTitle; -- (NSString*)getLeadingSyntheticTitle; #if SEPARATE_ATTRS + (NSMutableAttributedString*)attributedStringWithString:(NSString*)text attributesByRange:(NSDictionary*)attributes font:(NSFont*)font; #endif - (void)santizeForeignStylesForImporting; - (void)addLinkAttributesForRange:(NSRange)changedRange; +- (void)_addDoubleBracketedNVLinkAttributesForRange:(NSRange)changedRange; +- (void)addStrikethroughNearDoneTagsForRange:(NSRange)changedRange; - (BOOL)restyleTextToFont:(NSFont*)currentFont usingBaseFont:(NSFont*)baseFont; @end @@ -41,7 +45,8 @@ @interface NSAttributedString (AttributedPlainText) -+ (NSCharacterSet*)antiURLCharacterSet; +- (BOOL)attribute:(NSString*)anAttribute existsInRange:(NSRange)aRange; + - (NSArray*)allLinks; - (id)findNextLinkAtIndex:(unsigned int)startIndex effectiveRange:(NSRange *)range; #if SEPARATE_ATTRS diff --git a/AttributedPlainText.m b/AttributedPlainText.m index 3fc1b8b9..81e445c9 100755 --- a/AttributedPlainText.m +++ b/AttributedPlainText.m @@ -20,6 +20,13 @@ #import "NSCollection_utils.h" #import "GlobalPrefs.h" #import "NSString_NV.h" +#import + + +NSString *NVHiddenDoneTagAttributeName = @"NVDoneTag"; +NSString *NVHiddenBulletIndentAttributeName = @"NVBulletIndentTag"; + +static BOOL _StringWithRangeIsProbablyObjC(NSString *string, NSRange blockRange); @implementation NSMutableAttributedString (AttributedPlainText) @@ -64,24 +71,17 @@ - (void)removeAttachments { - (NSString*)trimLeadingSyntheticTitle { NSUInteger bodyLoc = 0; - NSString *title = [[self string] syntheticTitleAndSeparatorWithContext:NULL bodyLoc:&bodyLoc oldTitle:nil]; + NSString *title = [[self string] syntheticTitleAndSeparatorWithContext:NULL bodyLoc:&bodyLoc maxTitleLen:60]; if (bodyLoc > 0 && [self length] >= bodyLoc) [self deleteCharactersInRange:NSMakeRange(0, bodyLoc)]; return title; } -- (NSString*)getLeadingSyntheticTitle { - NSUInteger bodyLoc = 0; - - NSString *title = [[self string] syntheticTitleAndSeparatorWithContext:NULL bodyLoc:&bodyLoc oldTitle:nil]; - - return title; -} - -- (void)prefixWithSourceString:(NSString*)source { - source = [NSString stringWithFormat:@"From <%@>:\n\n", source]; - [self insertAttributedString:[[[NSAttributedString alloc] initWithString:source] autorelease] atIndex:0]; +- (NSString*)prefixWithSourceString:(NSString*)source { + NSString *sourceWContext = [NSString stringWithFormat:@"%@ <%@>:\n\n", NSLocalizedString(@"From", @"prefix for source-URLs inserted into imported notes; e.g., 'From : ...'"), source]; + [self insertAttributedString:[[[NSAttributedString alloc] initWithString:sourceWContext] autorelease] atIndex:0]; + return sourceWContext; } - (void)santizeForeignStylesForImporting { @@ -89,6 +89,7 @@ - (void)santizeForeignStylesForImporting { [self removeAttribute:NSLinkAttributeName range:range]; [self restyleTextToFont:[[GlobalPrefs defaultPrefs] noteBodyFont] usingBaseFont:nil]; [self addLinkAttributesForRange:range]; + [self addStrikethroughNearDoneTagsForRange:range]; } - (BOOL)restyleTextToFont:(NSFont*)currentFont usingBaseFont:(NSFont*)baseFont { @@ -100,7 +101,7 @@ - (BOOL)restyleTextToFont:(NSFont*)currentFont usingBaseFont:(NSFont*)baseFont { NSAssert(currentFont != nil, @"restyleTextToFont needs a current font!"); - NS_DURING + @try { while (NSMaxRange(effectiveRange) < stringLength) { // Get the attributes for the current range @@ -163,55 +164,178 @@ - (BOOL)restyleTextToFont:(NSFont*)currentFont usingBaseFont:(NSFont*)baseFont { rangesChanged++; } - - NS_HANDLER - NSLog(@"Error trying to re-style text (%@, %@)", [localException name], [localException reason]); - NS_ENDHANDLER + } + @catch (NSException *e) { + NSLog(@"Error trying to re-style text (%@, %@)", [e name], [e reason]); + } return rangesChanged > 0; } - (void)addLinkAttributesForRange:(NSRange)changedRange { - NSCharacterSet *antiURLSpace = [NSAttributedString antiURLCharacterSet]; - NSString *string = [self string]; - NSRange totalRange = NSMakeRange(0, [string length]); - NSString *substring = string; - if (!NSEqualRanges(totalRange, changedRange)) { - substring = [string substringWithRange:changedRange]; + if (!changedRange.length) + return; + + //lazily loads Adium's BSD-licensed Auto-Hyperlinks: + //http://trac.adium.im/wiki/AutoHyperlinksFramework + + static Class AHHyperlinkScanner = Nil; + static Class AHMarkedHyperlink = Nil; + if (!AHHyperlinkScanner || !AHMarkedHyperlink) { + if (![[NSBundle bundleWithPath:[[[NSBundle mainBundle] privateFrameworksPath] stringByAppendingPathComponent:@"AutoHyperlinks.framework"]] load]) { + NSLog(@"Could not load AutoHyperlinks framework"); + return; + } + AHHyperlinkScanner = NSClassFromString(@"AHHyperlinkScanner"); + AHMarkedHyperlink = NSClassFromString(@"AHMarkedHyperlink"); } + + id scanner = [AHHyperlinkScanner hyperlinkScannerWithString:[[self string] substringWithRange:changedRange]]; + id markedLink = nil; + while ((markedLink = [scanner nextURI])) { + NSURL *markedLinkURL = nil; + if ((markedLinkURL = [markedLink URL]) && !([markedLinkURL isFileURL] && [[markedLinkURL absoluteString] + rangeOfString:@"/.file/" options:NSLiteralSearch].location != NSNotFound)) { + [self addAttribute:NSLinkAttributeName value:markedLinkURL + range:NSMakeRange([markedLink range].location + changedRange.location, [markedLink range].length)]; + } + } + + //also detect double-bracketed URLs here + [self _addDoubleBracketedNVLinkAttributesForRange:changedRange]; +} + +- (void)_addDoubleBracketedNVLinkAttributesForRange:(NSRange)changedRange { + //add link attributes for [[wiki-style links to other notes or search terms]] + + static NSMutableCharacterSet *antiInteriorSet = nil; + if (!antiInteriorSet) { + antiInteriorSet = [[NSMutableCharacterSet characterSetWithCharactersInString:@"[]"] retain]; + [antiInteriorSet formUnionWithCharacterSet:[NSCharacterSet whitespaceCharacterSet]]; + [antiInteriorSet formUnionWithCharacterSet:[NSCharacterSet illegalCharacterSet]]; + [antiInteriorSet formUnionWithCharacterSet:[NSCharacterSet controlCharacterSet]]; + } + + NSString *string = [self string]; + NSUInteger nextScanLoc = 0; + NSRange scanRange = changedRange; + + while (NSMaxRange(scanRange) <= NSMaxRange(changedRange)) { - if ([substring rangeOfCharacterFromSet:antiURLSpace options:NSLiteralSearch].location == NSNotFound) - substring = [substring stringByAppendingString:@" "]; + NSUInteger begin = [string rangeOfString:@"[[" options:NSLiteralSearch range:scanRange].location; + if (begin == NSNotFound) break; + begin += 2; + NSUInteger end = [string rangeOfString:@"]]" options:NSLiteralSearch + range:NSMakeRange(begin, changedRange.length - (begin - changedRange.location))].location; + if (end == NSNotFound) break; + + NSRange blockRange = NSMakeRange(begin, (end - begin)); + + //double-braces must directly abut the search terms + //capture inner invalid "[["s, but not inner invalid "]]"s; + //because scanning, which is left to right, could be cancelled prematurely otherwise + if ([antiInteriorSet characterIsMember:[string characterAtIndex:begin]]) { + nextScanLoc = begin; + goto nextBlock; + } + //when encountering a newline in the midst of opposing double-brackets, + //continue scanning after the newline instead of after the end-brackets; avoid certain traps that change the behavior of multi- vs single-line scans + NSRange newlineRange = [string rangeOfCharacterFromSet:[NSCharacterSet newlineCharacterSet] options:NSLiteralSearch range:blockRange]; + if (newlineRange.location != NSNotFound) { + nextScanLoc = newlineRange.location + 1; + goto nextBlock; + } + + if (![antiInteriorSet characterIsMember:[string characterAtIndex:NSMaxRange(blockRange) - 1]] && !_StringWithRangeIsProbablyObjC(string, blockRange)) { + + [self addAttribute:NSLinkAttributeName value: + [NSURL URLWithString:[@"nv://find/" stringByAppendingString:[[string substringWithRange:blockRange] stringWithPercentEscapes]]] range:blockRange]; + } + //continue the scan starting at the end of the current block + nextScanLoc = NSMaxRange(blockRange) + 2; + + nextBlock: + scanRange = NSMakeRange(nextScanLoc, changedRange.length - (nextScanLoc - changedRange.location)); + } +} + +static BOOL _StringWithRangeIsProbablyObjC(NSString *string, NSRange blockRange) { + //assuming this range is bookended with matching double-brackets, + //does the block contain unbalanced inner square brackets? + NSUInteger rightBracketLoc = [string rangeOfString:@"]" options:NSLiteralSearch range:blockRange].location; + NSUInteger leftBracketLoc = [string rangeOfString:@"[" options:NSLiteralSearch range:blockRange].location; - NSScanner *wordScanner = [NSScanner scannerWithString:substring]; + //no brackets of either variety + if (rightBracketLoc == NSNotFound && leftBracketLoc == NSNotFound) return NO; - //loop until end of string - while (![wordScanner isAtEnd]) { - NSRange wordRange = NSMakeRange(NSNotFound, 0); - NSString *word = nil; + //has balanced inner brackets; right bracket exists and is actually to the right of the left bracket + if (rightBracketLoc != NSNotFound && rightBracketLoc > leftBracketLoc) return NO; + + //no right bracket or no left bracket + return YES; + + //this still doesn't catch something like "[[content prefixWithSourceString:[[getter url] absoluteString]] length];" + //an improvement would be to use rangeOfCharacterFromSet:@"[]" to count all the left and right brackets from left to right; + //a leftbracket would increment a count, a right bracket would decrement it; at the end of blockRange, the count should be 0 + //this is left as an exercise to the anal-retentive reader +} + +- (void)addStrikethroughNearDoneTagsForRange:(NSRange)changedRange { + //scan line by line + //if the line ends in " @done", then strikethrough everything prior and add NVHiddenDoneTagAttributeName + //if the line doesn't end in " @done", and it has NVHiddenDoneTagAttributeName + NSStrikethroughStyleAttributeName, + // then remove both attributes + //all other NSStrikethroughStyleAttributeName by itself will be ignored + + if (![[GlobalPrefs defaultPrefs] autoFormatsDoneTag]) + return; - while ([wordScanner scanUpToCharactersFromSet:antiURLSpace intoString:&word]) { - if (word) { - wordRange.length = [word length]; - wordRange.location = changedRange.location + [wordScanner scanLocation] - wordRange.length; + NSString *doneTag = @" @done"; + NSCharacterSet *newlineSet = [NSCharacterSet newlineCharacterSet]; + + NSRange lineEndRange, scanRange = changedRange; + + @try { + do { + if ((lineEndRange = [[self string] rangeOfCharacterFromSet:newlineSet options:NSLiteralSearch range:scanRange]).location == NSNotFound) { + //no newline; this is the end of the range, so set line-end to an imaginary position there + lineEndRange = NSMakeRange(NSMaxRange(scanRange), 1); + } + + NSRange thisLineRange = NSMakeRange(scanRange.location, lineEndRange.location - scanRange.location); + + //this detection is not good enough; it can't handle the case of @done(date) + if ([[[self string] substringWithRange:thisLineRange] hasSuffix:doneTag]) { - NSAssert([word isEqualToString:[string substringWithRange:wordRange]], @"derived range is wrong!"); + //add strikethrough and NVHiddenDoneTagAttributeName attributes, because this line ends in @done + [self addAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:NSUnderlineStyleSingle], + NSStrikethroughStyleAttributeName, [NSNull null], NVHiddenDoneTagAttributeName, nil] + range:NSMakeRange(thisLineRange.location, thisLineRange.length - [doneTag length])]; + //and the done tag itself should never be struck-through; remove that just in case typing attributes had carried over from elsewhere + [self removeAttribute:NSStrikethroughStyleAttributeName range:NSMakeRange(NSMaxRange(thisLineRange) - [doneTag length], [doneTag length])]; - NSURL *url = nil; - if (wordRange.length && NSMaxRange(wordRange) <= [string length] && (url = [word linkForWord])) { - if (url) [self addAttribute:NSLinkAttributeName value:url range:wordRange]; - } + } else if ([self attribute:NVHiddenDoneTagAttributeName existsInRange:thisLineRange]) { + + //assume that this line was previously struck-through by NV due to the presence of a @done tag; remove those attrs now + [self removeAttribute:NVHiddenDoneTagAttributeName range:thisLineRange]; + [self removeAttribute:NSStrikethroughStyleAttributeName range:thisLineRange]; } - } - unsigned int newLocation = [wordScanner scanLocation] + 1; - if (newLocation >= [substring length]) - break; - [wordScanner setScanLocation:newLocation]; + //if scanRange has a non-zero length, then advance it further + if ((scanRange = NSMakeRange(NSMaxRange(thisLineRange), changedRange.length - (NSMaxRange(thisLineRange) - changedRange.location))).length) + scanRange = NSMakeRange(scanRange.location + 1, scanRange.length - 1); + else { + break; + } + } while (NSMaxRange(scanRange) <= NSMaxRange(changedRange)); + } + @catch (NSException *e) { + NSLog(@"_%s(%@): %@", _cmd, NSStringFromRange(changedRange), e); } } + #if SEPARATE_ATTRS #define VLISTBUFCOUNT 32 @@ -259,16 +383,18 @@ + (NSMutableAttributedString*)attributedStringWithString:(NSString*)text attribu @implementation NSAttributedString (AttributedPlainText) -+ (NSCharacterSet*)antiURLCharacterSet { - static NSMutableCharacterSet *antiURLSpace = nil; - if (!antiURLSpace) { - antiURLSpace = [[NSMutableCharacterSet alloc] init]; - [antiURLSpace formUnionWithCharacterSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - [antiURLSpace addCharactersInString:@"<>[]\"()"]; + +- (BOOL)attribute:(NSString*)anAttribute existsInRange:(NSRange)aRange { + NSRange effectiveRange = NSMakeRange(aRange.location, 0); + + while (NSMaxRange(effectiveRange) < NSMaxRange(aRange)) { + if ([self attribute:anAttribute atIndex:NSMaxRange(effectiveRange) effectiveRange:&effectiveRange]) { + return YES; + } } - return antiURLSpace; -} + return NO; +} - (NSArray*)allLinks { NSRange range; diff --git a/AugmentedScrollView.h b/AugmentedScrollView.h new file mode 100755 index 00000000..0924d925 --- /dev/null +++ b/AugmentedScrollView.h @@ -0,0 +1,34 @@ +/* AugmentedScrollView */ + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + + +#import +/* +@interface DragSquareView : NSView +{ + NSImage *dragImage; +} + +@end +*/ + +@interface AugmentedScrollView : NSScrollView +{ + //BOOL showDragSquare; + //DragSquareView *dragSquare; +} + +//- (BOOL)shouldDragWithPoint:(NSPoint)point sender:(id)sender; +//- (void)_positionDragSquare; + +@end diff --git a/AugmentedScrollView.m b/AugmentedScrollView.m new file mode 100755 index 00000000..daeff913 --- /dev/null +++ b/AugmentedScrollView.m @@ -0,0 +1,125 @@ +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + +#import "ETTransparentScroller.h" +#import "AugmentedScrollView.h" +#import "GlobalPrefs.h" + + + +/* +@implementation DragSquareView + +- (id)initWithFrame:(NSRect)frameRect { + if ((self = [super initWithFrame:frameRect]) != nil) { + dragImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"ListDividerDrag.png"]]; + } + return self; +} + +- (void)drawRect:(NSRect)rect { + [dragImage compositeToPoint:rect.origin operation:NSCompositeCopy]; + +} + +- (void)resetCursorRects { + [self addCursorRect:[self bounds] cursor: [NSCursor resizeLeftRightCursor]]; +} + +- (BOOL)isOpaque { + return YES; +} + +- (void)dealloc { + [dragImage release]; + [super dealloc]; +} + +@end +*/ + +@implementation AugmentedScrollView + + +- (void)awakeFromNib { + + //dragSquare = [[DragSquareView alloc] initWithFrame:NSMakeRect(0, 0, 15.0, 15.0)]; + [[GlobalPrefs defaultPrefs] registerForSettingChange:@selector(setHorizontalLayout:sender:) withTarget:self]; + if (!IsLionOrLater) { + [self setVerticalScroller:[[ETTransparentScroller alloc]init]]; + } + /* + if ((showDragSquare = [[GlobalPrefs defaultPrefs] horizontalLayout])) { + //add dragsquare subview to this view + [self addSubview:dragSquare positioned:NSWindowAbove relativeTo:self]; + [self _positionDragSquare]; + }*/ +} + +- (void)settingChangedForSelectorString:(NSString*)selectorString { + + if ([selectorString isEqualToString:SEL_STR(setHorizontalLayout:sender:)]) { + + /*if ((showDragSquare = [[GlobalPrefs defaultPrefs] horizontalLayout])) { + //add drag square + [self addSubview:dragSquare positioned:NSWindowAbove relativeTo:self]; + } else { + //remove drag square + [dragSquare removeFromSuperview]; + }*/ + [self tile]; + } +} + +- (void)dealloc { + + //[dragSquare release]; + [super dealloc]; +} +/* +- (BOOL)shouldDragWithPoint:(NSPoint)point sender:(id)sender { + BOOL inRect = NSMouseInRect([dragSquare convertPoint:point fromView:sender], + [dragSquare bounds], [dragSquare isFlipped]); + + return showDragSquare && inRect; +} + +- (void)_positionDragSquare { + NSSize oldSize = [[self verticalScroller] frame].size; + NSSize dragSize = [dragSquare frame].size; + + [[self verticalScroller] setFrameSize:NSMakeSize(oldSize.width, oldSize.height - dragSize.height)]; + + NSRect newFrame = [[self verticalScroller] frame]; + [dragSquare setFrameOrigin:NSMakePoint(NSMaxX(newFrame) - dragSize.width, NSMaxY(newFrame))]; + + +}*/ + +- (void)tile { + [super tile]; + if (![[self verticalScroller] isHidden]) { + NSRect vsRect = [[self verticalScroller] frame]; + NSRect conRect = [[self contentView] frame]; + NSView *wdContent = [[self contentView] retain]; + conRect.size.width = conRect.size.width + vsRect.size.width; + [wdContent setFrame:conRect]; + [wdContent release]; + [[self verticalScroller] setFrame:vsRect]; + + } + /*if (showDragSquare) { + [self _positionDragSquare]; + }*/ +} + + +@end diff --git a/BTTransparentScroller.h b/BTTransparentScroller.h index b6dbff03..bb5940f5 100644 --- a/BTTransparentScroller.h +++ b/BTTransparentScroller.h @@ -1,14 +1,20 @@ // -// BTTransparentScroller.h -// Modified from BWToolkit by Brandon Walkin (www.brandonwalkin.com) +// BTTransparentScroller.m +// +// Created by Brandon Walkin (www.brandonwalkin.com) // All code is provided under the New BSD license. // +// Modified by Brett Terpstra on 12/8/10. +// Copyright 2010 Circle Six Design. All rights reserved. +// +// Modified again by ElasticThreads on 03/10/11 #import -@interface BTTransparentScroller : NSScroller -{ +@interface BTTransparentScroller : NSScroller { BOOL isVertical; + } +-(void)setBackgroundColor:(NSColor*)bgcolor; @end diff --git a/BTTransparentScroller.m b/BTTransparentScroller.m index fd1289ef..53058630 100644 --- a/BTTransparentScroller.m +++ b/BTTransparentScroller.m @@ -1,28 +1,33 @@ // // BTTransparentScroller.m -// BWToolkit // // Created by Brandon Walkin (www.brandonwalkin.com) // All code is provided under the New BSD license. // +// Modified by Brett Terpstra on 12/8/10. +// Copyright 2010 Circle Six Design. All rights reserved. +// +// Modified again by ElasticThreads on 03/10/11 + #import "BTTransparentScroller.h" + // Vertical scroller static NSImage *knobTop, *knobVerticalFill, *knobBottom, *slotTop, *slotVerticalFill, *slotBottom; -static float verticalPaddingLeft = 6.0; -static float verticalPaddingRight = 2.0; -static float verticalPaddingTop = 4.0; -static float verticalPaddingBottom = 4.0; +static float verticalPaddingLeft = 4.0f; +static float verticalPaddingRight = 5.0f; +static float verticalPaddingTop = 8.0f; +static float verticalPaddingBottom = 8.0f; static float minKnobHeight; // Horizontal scroller -static NSImage *knobLeft, *knobHorizontalFill, *knobRight, *slotLeft, *slotHorizontalFill, *slotRight; +/*static NSImage *knobLeft, *knobHorizontalFill, *knobRight, *slotLeft, *slotHorizontalFill, *slotRight; static float horizontalPaddingLeft = 2.0; static float horizontalPaddingRight = 2.0; static float horizontalPaddingTop = 0.0; static float horizontalPaddingBottom = 1.0; -static float minKnobWidth; +static float minKnobWidth;*/ static NSColor *backgroundColor; @@ -41,24 +46,22 @@ + (void)initialize NSBundle *bundle = [NSBundle mainBundle]; // Vertical scroller - knobTop = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerKnobTop.tif"]]; - knobVerticalFill = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerKnobVerticalFill.tif"]]; - knobBottom = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerKnobBottom.tif"]]; + knobTop = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"greyscrollerverttop3.tif"]]; + knobVerticalFill = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"greyscrollervertfill3.tif"]]; + knobBottom = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"greyscrollervertbottom3.tif"]]; slotTop = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerSlotTop.tif"]]; - slotVerticalFill = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerSlotVerticalFill.tif"]]; + slotVerticalFill = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"scrollbarblue.tif"]]; slotBottom = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerSlotBottom.tif"]]; - // Horizontal scroller - knobLeft = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerKnobLeft.tif"]]; - knobHorizontalFill = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerKnobHorizontalFill.tif"]]; - knobRight = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerKnobRight.tif"]]; - slotLeft = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerSlotLeft.tif"]]; - slotHorizontalFill = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerSlotHorizontalFill.tif"]]; - slotRight = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"BTransparentScrollerSlotRight.tif"]]; - - backgroundColor = [[NSColor colorWithCalibratedRed:0.931 green:0.909 blue:0.884 alpha:1.000] retain]; + backgroundColor = [[NSColor whiteColor] retain]; minKnobHeight = knobTop.size.height + knobVerticalFill.size.height + knobBottom.size.height + 40; - minKnobWidth = knobLeft.size.width + knobHorizontalFill.size.width + knobRight.size.width + 10; + //minKnobWidth = knobLeft.size.width + knobHorizontalFill.size.width + knobRight.size.width + 10; +} + +- (void)setBackgroundColor:(NSColor*)bgcolor; +{ + [backgroundColor release]; + backgroundColor = [bgcolor retain]; } - (id)initWithFrame:(NSRect)frameRect; @@ -71,8 +74,10 @@ - (id)initWithFrame:(NSRect)frameRect; isVertical = YES; else isVertical = NO; + + // NSLog(@"isVertical1 is :%d",isVertical); } - + return self; } @@ -86,6 +91,8 @@ - (id)initWithCoder:(NSCoder *)decoder; isVertical = YES; else isVertical = NO; + + // NSLog(@"isVertical2 is :%d",isVertical); } return self; @@ -114,33 +121,36 @@ - (void)drawRect:(NSRect)aRect; if ([self knobProportion] > 0.0) [self drawKnob]; } - else if (!isVertical && ([self bounds].size.width - horizontalPaddingLeft - horizontalPaddingRight + 1) > minKnobWidth) + /*else if (!isVertical && ([self bounds].size.width - horizontalPaddingLeft - horizontalPaddingRight + 1) > minKnobWidth) { [self drawKnobSlot]; - + if ([self knobProportion] > 0.0) [self drawKnob]; - } + }*/ } - (void)drawKnobSlot; { -// NSRect slotRect = [self rectForPart:NSScrollerKnobSlot]; - -// if (isVertical) -// NSDrawThreePartImage(slotRect, slotTop, slotVerticalFill, slotBottom, YES, NSCompositeSourceOver, 1, NO); -// else -// NSDrawThreePartImage(slotRect, slotLeft, slotHorizontalFill, slotRight, NO, NSCompositeSourceOver, 1, NO); + NSRect slotRect = [self rectForPart:NSScrollerKnobSlot]; + if (isVertical){ + NSDrawThreePartImage(slotRect, slotVerticalFill, slotVerticalFill, slotVerticalFill, YES, NSCompositeSourceOver, 1.0f, NO); + } + + /*else + NSDrawThreePartImage(slotRect, slotLeft, slotHorizontalFill, slotRight, NO, NSCompositeSourceOver, 1, NO);*/ } - (void)drawKnob; { NSRect knobRect = [self rectForPart:NSScrollerKnob]; - if (isVertical) - NSDrawThreePartImage(knobRect, knobTop, knobVerticalFill, knobBottom, YES, NSCompositeSourceOver, 1, NO); - else - NSDrawThreePartImage(knobRect, knobLeft, knobHorizontalFill, knobRight, NO, NSCompositeSourceOver, 1, NO); + if (isVertical){ + NSDrawThreePartImage(knobRect, knobTop, knobVerticalFill, knobBottom, YES, NSCompositeSourceOver, 1.0f, NO); + } + //else + /*NSDrawThreePartImage(knobRect, knobLeft, knobHorizontalFill, knobRight, NO, NSCompositeSourceOver, 1, NO);*/ + } - (NSRect)_drawingRectForPart:(NSScrollerPart)aPart; @@ -174,7 +184,7 @@ - (NSRect)rectForPart:(NSScrollerPart)aPart; float knobY = slotRect.origin.y + roundf((slotRect.size.height - knobHeight) * [self floatValue]); knobRect = NSMakeRect(verticalPaddingLeft, knobY, slotRect.size.width, knobHeight); } - else + /*else { float knobWidth = roundf(slotRect.size.width * [self knobProportion]); @@ -183,7 +193,7 @@ - (NSRect)rectForPart:(NSScrollerPart)aPart; float knobX = slotRect.origin.x + roundf((slotRect.size.width - knobWidth) * [self floatValue]); knobRect = NSMakeRect(knobX, horizontalPaddingTop, knobWidth, slotRect.size.height); - } + }*/ return knobRect; } @@ -194,8 +204,9 @@ - (NSRect)rectForPart:(NSScrollerPart)aPart; if (isVertical) slotRect = NSMakeRect(verticalPaddingLeft, verticalPaddingTop, [self bounds].size.width - verticalPaddingLeft - verticalPaddingRight, [self bounds].size.height - verticalPaddingTop - verticalPaddingBottom); - else - slotRect = NSMakeRect(horizontalPaddingLeft, horizontalPaddingTop, [self bounds].size.width - horizontalPaddingLeft - horizontalPaddingRight, [self bounds].size.height - horizontalPaddingTop - horizontalPaddingBottom); + + /*else + slotRect = NSMakeRect(horizontalPaddingLeft, horizontalPaddingTop, [self bounds].size.width - horizontalPaddingLeft - horizontalPaddingRight, [self bounds].size.height - horizontalPaddingTop - horizontalPaddingBottom);*/ return slotRect; } @@ -218,11 +229,11 @@ - (NSRect)rectForPart:(NSScrollerPart)aPart; float knobY = knobRect.origin.y + knobRect.size.height; incrementPageRect = NSMakeRect(verticalPaddingLeft, knobY, knobRect.size.width, slotRect.size.height - knobRect.size.height - decPageRect.size.height); } - else + /*else { float knobX = knobRect.origin.x + knobRect.size.width; incrementPageRect = NSMakeRect(knobX, horizontalPaddingTop, (slotRect.size.width + horizontalPaddingLeft) - knobX, knobRect.size.height); - } + }*/ return incrementPageRect; } @@ -232,11 +243,12 @@ - (NSRect)rectForPart:(NSScrollerPart)aPart; NSRect decrementPageRect; NSRect knobRect = [self rectForPart:NSScrollerKnob]; - if (isVertical) + if (isVertical){ decrementPageRect = NSMakeRect(verticalPaddingLeft, verticalPaddingTop, knobRect.size.width, knobRect.origin.y - verticalPaddingTop); - else - decrementPageRect = NSMakeRect(horizontalPaddingLeft, horizontalPaddingTop, knobRect.origin.x - horizontalPaddingLeft, knobRect.size.height); - + } + //else + //decrementPageRect = NSMakeRect(horizontalPaddingLeft, horizontalPaddingTop, knobRect.origin.x - horizontalPaddingLeft, knobRect.size.height); + return decrementPageRect; } break; @@ -247,4 +259,6 @@ - (NSRect)rectForPart:(NSScrollerPart)aPart; return NSZeroRect; } + + @end diff --git a/BlorPasswordRetriever.h b/BlorPasswordRetriever.h index 4830de49..1922136f 100755 --- a/BlorPasswordRetriever.h +++ b/BlorPasswordRetriever.h @@ -55,4 +55,4 @@ - (void)decryptNextBytesOfLength:(long)length; - (id)nextNote; -@end \ No newline at end of file +@end diff --git a/BlorPasswordRetriever.m b/BlorPasswordRetriever.m index 6480b438..5197d9c8 100755 --- a/BlorPasswordRetriever.m +++ b/BlorPasswordRetriever.m @@ -117,9 +117,7 @@ - (NSData*)validPasswordHashData { [helpStringField setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Please enter the passphrase to import old notes at %@.",nil), [path stringByAbbreviatingWithTildeInPath]]]; - EnableSecureEventInput(); int result = [NSApp runModalForWindow:window]; - DisableSecureEventInput(); NSString *passwordString = [passphraseField stringValue]; passwordData = [passwordString dataUsingEncoding:[NSString defaultCStringEncoding] allowLossyConversion:NO]; @@ -270,7 +268,8 @@ - (id)nextNote { NSMutableAttributedString *attributedBody = [[NSMutableAttributedString alloc] initWithString:bodyString attributes:[[GlobalPrefs defaultPrefs] noteBodyAttributes]]; [attributedBody addLinkAttributesForRange:NSMakeRange(0, [attributedBody length])]; - NoteObject *note = [[NoteObject alloc] initWithNoteBody:attributedBody title:titleString uniqueFilename:nil format:SingleDatabaseFormat]; + [attributedBody addStrikethroughNearDoneTagsForRange:NSMakeRange(0, [attributedBody length])]; + NoteObject *note = [[NoteObject alloc] initWithNoteBody:attributedBody title:titleString delegate:nil format:SingleDatabaseFormat labels:nil]; [bodyString release]; [attributedBody release]; @@ -281,4 +280,4 @@ - (id)nextNote { return [note autorelease]; } -@end \ No newline at end of file +@end diff --git a/BookmarksController.h b/BookmarksController.h index ba00dd5f..5aa0ace3 100755 --- a/BookmarksController.h +++ b/BookmarksController.h @@ -62,7 +62,11 @@ @class GlobalPrefs; -@interface BookmarksController : NSObject { +@interface BookmarksController : NSObject +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +#endif +{ //model NSMutableArray *bookmarks; diff --git a/BookmarksController.m b/BookmarksController.m index 0c5dc15f..8a6b3200 100755 --- a/BookmarksController.m +++ b/BookmarksController.m @@ -227,20 +227,36 @@ - (void)regenerateBookmarksMenu { while ([bookmarksMenu numberOfItems]) { [bookmarksMenu removeItemAtIndex:0]; } + + + NSMenu *menu2 = [appController statBarMenu]; + NSMenu *bkSubMenu = [[menu2 itemWithTag:901] submenu]; + while ([bkSubMenu numberOfItems]) { + [bkSubMenu removeItemAtIndex:0]; + } NSMenuItem *theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Show Bookmarks",@"menu item title for showing bookmarks") action:@selector(showBookmarks:) keyEquivalent:@"0"] autorelease]; [theMenuItem setTarget:self]; [bookmarksMenu addItem:theMenuItem]; - + theMenuItem = [theMenuItem copy]; + [bkSubMenu addItem:theMenuItem]; + [theMenuItem release]; [bookmarksMenu addItem:[NSMenuItem separatorItem]]; + [bkSubMenu addItem:[NSMenuItem separatorItem]]; theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Add to Bookmarks",@"menu item title for bookmarking a note") action:@selector(addBookmark:) keyEquivalent:@"D"] autorelease]; [theMenuItem setTarget:self]; [bookmarksMenu addItem:theMenuItem]; + theMenuItem = [theMenuItem copy]; + [bkSubMenu addItem:theMenuItem]; + [theMenuItem release]; - if ([bookmarks count] > 0) [bookmarksMenu addItem:[NSMenuItem separatorItem]]; + if ([bookmarks count] > 0) { + [bookmarksMenu addItem:[NSMenuItem separatorItem]]; + [bkSubMenu addItem:[NSMenuItem separatorItem]]; + } unsigned int i; for (i=0; i<[bookmarks count]; i++) { @@ -255,6 +271,9 @@ - (void)regenerateBookmarksMenu { [theMenuItem setRepresentedObject:bookmark]; [theMenuItem setTarget:self]; [bookmarksMenu addItem:theMenuItem]; + theMenuItem = [theMenuItem copy]; + [bkSubMenu addItem:theMenuItem]; + [theMenuItem release]; } } } @@ -418,6 +437,7 @@ - (BOOL)tableView:(NSTableView*)tv acceptDrop:(id )info row:(NSI return YES; } + [object release]; return NO; } diff --git a/BufferUtils.c b/BufferUtils.c index 21aa5557..c8de3d35 100755 --- a/BufferUtils.c +++ b/BufferUtils.c @@ -48,7 +48,15 @@ static const unsigned char gsToLowerMap[256] = { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -#define MIN(a, b) (((a)<(b))?(a):(b)) +#if !defined(MIN) +#define MIN(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __a : __b; }) +#endif + +#if !defined(MAX) +#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; }) +#endif + +static u_int32_t u8_nextchar(const char *s, size_t *i); char *replaceString(char *oldString, const char *newString) { size_t newLen = strlen(newString) + 1; @@ -60,12 +68,13 @@ char *replaceString(char *oldString, const char *newString) { return resizedString; } -void ResizeBuffer(void ***buffer, unsigned int objCount, unsigned int *bufSize) { - assert(buffer && bufSize); + +void _ResizeBuffer(void ***buffer, unsigned int objCount, unsigned int *bufObjCount, unsigned int elemSize) { + assert(buffer && bufObjCount); - if (*bufSize < objCount || !*buffer) { - *buffer = (void **)realloc(*buffer, sizeof(void*) * objCount); - *bufSize = objCount; + if (*bufObjCount < objCount || !*buffer) { + *buffer = (void **)realloc(*buffer, elemSize * objCount); + *bufObjCount = objCount; } } @@ -124,8 +133,55 @@ void modp_tolower_copy(char* dest, const char* str, int len) { } } -void replace_breaks(char *str, size_t up_to_len) { +static const u_int32_t offsetsFromUTF8[6] = { + 0x00000000UL, 0x00003080UL, 0x000E2080UL, + 0x03C82080UL, 0xFA082080UL, 0x82082080UL +}; + +#define isutf(c) (((c)&0xC0)!=0x80) + +/* reads the next utf-8 sequence out of a string, updating an index */ +static force_inline u_int32_t u8_nextchar(const char *s, size_t *i) { + u_int32_t ch = 0; + size_t sz = 0; + + do { + ch <<= 6; + ch += (unsigned char)s[(*i)]; + sz++; + } while (s[*i] && (++(*i)) && !isutf(s[*i])); + ch -= offsetsFromUTF8[sz-1]; + + return ch; +} + + +void replace_breaks_utf8(char *s, size_t up_to_len) { + //needed to detect NSLineSeparatorCharacter and NSParagraphSeparatorCharacter + + if (!s) return; + + size_t i = 0, lasti = 0; + u_int32_t c; + while (i < up_to_len && s[i]) { + c = u8_nextchar(s, &i); + + //get rid of any kind of funky whitespace-esq character + if (c == 0x0009 || c == 0x000a || c == 0x000d || c == 0x0003 || c == 0x2029 || c == 0x2028 || c == 0x000c) { + //fill in the entire UTF sequence with spaces + char *cur_s = (char*)&s[lasti]; +// printf("\n"); + do { +// printf("%X ", (u_int32_t)*cur_s); + *cur_s = ' '; + } while (++cur_s < &s[i]); + } + lasti = i; + } +} + +void replace_breaks(char *str, size_t up_to_len) { //traverses string to up_to_len chars or NULL, whichever comes first //replaces any occurance of \n, \r, or \t with a space @@ -136,7 +192,7 @@ void replace_breaks(char *str, size_t up_to_len) { char *s = str; do { c = *s; - if ('\n' == c || '\t' == c || '\r' == c) { + if (c == 0x0009 || c == 0x000a || c == 0x000d || c == 0x0003 || c == 0x000c) { *s = ' '; } } while (++i < up_to_len && *(s++) != 0); @@ -217,27 +273,6 @@ void QuickSortBuffer(void **buffer, unsigned int objCount, int (*compar)(const v qsort_r((void *)buffer, (size_t)objCount, sizeof(void*), compar, (int (*)(void *, const void *, const void *))genericSortContextFirst); } -/* -CFStringRef CopyReasonFromFSErr(OSStatus err) { - - size_t codeCount = sizeof(errorCodes) / sizeof(OSStatus); - size_t stringCount = sizeof(errorStrings) / sizeof(char*); - assert(stringCount == codeCount); - - unsigned int i; - - if (err < 0) { - - for (i=0; i +#define ResizeArray(__DirectBuffer, __objCount, __bufObjCount) _ResizeBuffer((void***)(__DirectBuffer), (__objCount), (__bufObjCount), sizeof(typeof(**(__DirectBuffer)))) + +#define UTCDateTimeIsEmpty(__UTCDT) (*(int64_t*)&((__UTCDT)) == 0LL) + +typedef struct _PerDiskInfo { + + //index in a table of disk UUIDs; should be the disk from which this time was gathered + //the disk UUIDs table is tracked separately in FrozenNotation; it should only ever be appended-to + UInt32 diskIDIndex; + + //catalog node ID of a file + UInt32 nodeID; + + //the attribute modification time of a file + UTCDateTime attrTime; + +} PerDiskInfo; + char *replaceString(char *oldString, const char *newString); -void ResizeBuffer(void ***buffer, unsigned int objCount, unsigned int *bufSize); +void _ResizeBuffer(void ***buffer, unsigned int objCount, unsigned int *bufSize, unsigned int elemSize); int IsZeros(const void *s1, size_t n); int ContainsUInteger(const NSUInteger *uintArray, size_t count, NSUInteger auint); void modp_tolower_copy(char* dest, const char* str, int len); +void replace_breaks_utf8(char *s, size_t up_to_len); void replace_breaks(char *str, size_t up_to_len); int ContainsHighAscii(const void *s1, size_t n); CFStringRef CFStringFromBase10Integer(int quantity); @@ -31,6 +50,11 @@ unsigned DumbWordCount(const void *s1, size_t len); NSInteger genericSortContextFirst(int (*context) (void*, void*), void* one, void* two); NSInteger genericSortContextLast(void* one, void* two, int (*context) (void*, void*)); void QuickSortBuffer(void **buffer, unsigned int objCount, int (*compar)(const void *, const void *)); + +void RemovePerDiskInfoWithTableIndex(UInt32 diskIndex, PerDiskInfo **perDiskGroups, unsigned int *groupCount); +unsigned int SetPerDiskInfoWithTableIndex(UTCDateTime *dateTime, UInt32 *nodeID, UInt32 diskIndex, PerDiskInfo **perDiskGroups, unsigned int *groupCount); +void CopyPerDiskInfoGroupsToOrder(PerDiskInfo **flippedGroups, unsigned int *existingCount, PerDiskInfo *perDiskGroups, size_t bufferSize, int toHostOrder); + CFStringRef CreateRandomizedFileName(); OSStatus FSCreateFileIfNotPresentInDirectory(FSRef *directoryRef, FSRef *childRef, CFStringRef filename, Boolean *created); OSStatus FSRefMakeInDirectoryWithString(FSRef *directoryRef, FSRef *childRef, CFStringRef filename, UniChar* charsBuffer); diff --git a/COPYING.txt b/COPYING.txt new file mode 100755 index 00000000..20d40b6b --- /dev/null +++ b/COPYING.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/Credits.html b/Credits.html new file mode 100644 index 00000000..c0888317 --- /dev/null +++ b/Credits.html @@ -0,0 +1,8 @@ +
+

© ElasticThreads and Brett Terpstra, 2011

+ +

based on NV 2.0 β4 +Copyright © 2011 Zachary Schneirov

+ +

All Rights Reserved.

+
\ No newline at end of file diff --git a/DFView.h b/DFView.h new file mode 100644 index 00000000..a568c16a --- /dev/null +++ b/DFView.h @@ -0,0 +1,18 @@ +// +// DFView.m +// Notation +// +// Created by ElasticThreads on 2/15/11. +// + +#import + + +@interface DFView : NSView { + + NSColor *vColor; +} + +- (void)setBackgroundColor:(NSColor *)inColor; + +@end diff --git a/DFView.m b/DFView.m new file mode 100644 index 00000000..3145d578 --- /dev/null +++ b/DFView.m @@ -0,0 +1,59 @@ +// +// DFView.m +// Notation +// +// Created by ElasticThreads on 2/15/11. +// + +#import "DFView.h" +#import "AppController.h" + + +@implementation DFView + +- (id)initWithFrame:(NSRect)frame { + self = [super initWithFrame:frame]; + if (self) { + if (!vColor) { + [self setBackgroundColor:[[NSApp delegate] backgrndColor]]; + } + // Initialization code here. + } + return self; +} + +- (void)dealloc{ + [vColor release]; + [super dealloc]; +} + +- (void)drawRect:(NSRect)rect { + NSRect bounds = [self bounds]; + bounds.origin.x -=2.0f; + bounds.origin.y +=1.0f; + bounds.size.width +=4.0f; + [vColor set]; + NSFrameRect(bounds); +} + +- (void)setBackgroundColor:(NSColor *)inColor{ + if (vColor) { + [vColor release]; + } + CGFloat fWhite; + + fWhite = [[inColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace] whiteComponent]; + if (fWhite < 0.75f) { + if (fWhite<0.25f) { + fWhite += 0.22f; + }else { + fWhite += 0.16f; + } + }else { + fWhite -= 0.20f; + } + vColor = [NSColor colorWithCalibratedWhite:fWhite alpha:1.0f]; + [vColor retain]; +} + +@end diff --git a/DeletionManager.h b/DeletionManager.h index ac75f107..f3e2f594 100755 --- a/DeletionManager.h +++ b/DeletionManager.h @@ -21,23 +21,25 @@ { IBOutlet NSTableView *tableView; IBOutlet NSPanel *window; - NSWindow *mainWindow; + IBOutlet NSButton *confirmDeletionButton; NSMutableArray *deletedNotes; NotationController* notationController; - - BOOL needsToShowSheet; + BOOL hasDeletedNotes; } - (id)initWithNotationController:(NotationController*)aNotationController; - (NotationController*)notationController; +- (IBAction)changeConfirmDeletion:(id)sender; - (BOOL)noteFileIsAlreadyDeleted:(NoteObject*)aNote; - (void)addDeletedNotes:(NSArray*)array; - (void)addDeletedNote:(NoteObject*)aNote; +- (NSRect)windowSizeForNotesFromSender:(id)sender; +void updateForVerifiedDeletedNote(DeletionManager *self, NoteObject *missingNote); +void updateForVerifiedExistingNote(DeletionManager *self, NoteObject *goodNote); - (void)processDeletedNotes; - (void)removeDeletedNotes; -- (NSRect)windowSizeForNotes; -- (void)_updateSheetForNotes; -- (void)showSheetForDeletedNotes; +- (void)_updatePanelForNotes; +- (void)showPanelForDeletedNotes; - (void)cancelPanelReturningCode:(NSInteger)code; - (IBAction)deleteAction:(id)sender; - (IBAction)restoreAction:(id)sender; diff --git a/DeletionManager.m b/DeletionManager.m index 95c38250..67d4ce3f 100755 --- a/DeletionManager.m +++ b/DeletionManager.m @@ -14,8 +14,8 @@ #import "DeletionManager.h" #import "NoteObject.h" #import "NotationController.h" +#import "NotationDirectoryManager.h" #import "NotationPrefs.h" -#import "GlobalPrefs.h" #import "NSCollection_utils.h" //class for managing notifications of external deletion of note files @@ -25,8 +25,6 @@ @implementation DeletionManager - (id)init { if ([super init]) { deletedNotes = [[NSMutableArray alloc] init]; - - needsToShowSheet = NO; } return self; } @@ -41,11 +39,10 @@ - (id)initWithNotationController:(NotationController*)aNotationController { - (void)awakeFromNib { //[window setMaxSize:NSMakeSize(371, 0)]; - NSAssert(notationController != nil, @"attempting to awake DeletionManager without a NotationController"); + NSAssert(notationController != nil, @"attempting to awake DeletionManager without a NotationController"); - mainWindow = [[notationController delegate] window]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidEndSheet:) - name:NSWindowDidEndSheetNotification object:mainWindow]; + [window setFloatingPanel:YES]; + [window setDelegate:self]; } - (void)dealloc { @@ -78,6 +75,9 @@ - (BOOL)noteFileIsAlreadyDeleted:(NoteObject*)aNote { - (void)addDeletedNotes:(NSArray*)array { if ([array count] > 0) { if (![deletedNotes count]) { + //canceling the delayed selector would not be necessary if updateForVerifiedExistingNote + //did not have the potential to clear out deletedNotes before the selector posted to the next run loop + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(processDeletedNotes) object:nil]; [self performSelector:@selector(processDeletedNotes) withObject:nil afterDelay:0]; } @@ -94,62 +94,96 @@ - (void)addDeletedNotes:(NSArray*)array { [array makeObjectsPerformSelector:@selector(invalidateFSRef)]; if (didAddDeletedNote) { - [self _updateSheetForNotes]; + [self _updatePanelForNotes]; } } + hasDeletedNotes = [deletedNotes count] != 0; } - (void)addDeletedNote:(NoteObject*)aNote { if (aNote) { if (![deletedNotes count]) { + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(processDeletedNotes) object:nil]; [self performSelector:@selector(processDeletedNotes) withObject:nil afterDelay:0]; } //filter dups or remove these notes from allNotes before adding them here! if (![self noteFileIsAlreadyDeleted:aNote]) { [deletedNotes addObject:aNote]; - [self _updateSheetForNotes]; + [self _updatePanelForNotes]; } //clear fsref to ensure that files are re-created if they are restored //if they are to be deleted, we don't care about them, anyway--they should already be gone [aNote invalidateFSRef]; } + hasDeletedNotes = [deletedNotes count] != 0; } -- (void)_updateSheetForNotes { +- (void)_updatePanelForNotes { [tableView reloadData]; - [window setFrame:[self windowSizeForNotes] display:[window isVisible] animate:[window isVisible]]; + [window setFrame:[self windowSizeForNotesFromSender:window] display:NO]; +} + +void updateForVerifiedDeletedNote(DeletionManager *self, NoteObject *missingNote) { + //called from [NotationController removeNote:] + + //just to underscore that this is really the same type of operation, call through to the other method + updateForVerifiedExistingNote(self, missingNote); +} + +void updateForVerifiedExistingNote(DeletionManager *self, NoteObject *goodNote) { + //if there are deleted notes currently being shown and goodNote is among them, then update the dialog appropriately, dismissing it if necessary + + if (!self->hasDeletedNotes) return; + + NSUInteger priorNoteCount = [self->deletedNotes count]; + [self->deletedNotes removeObjectIdenticalTo:goodNote]; + NSUInteger latterNoteCount = [self->deletedNotes count]; + + self->hasDeletedNotes = latterNoteCount != 0; + + if (latterNoteCount != priorNoteCount) { + [self _updatePanelForNotes]; + if (!self->hasDeletedNotes) { + [self cancelPanelReturningCode:1]; + } + } } - (void)processDeletedNotes { - if ([[[GlobalPrefs defaultPrefs] notationPrefs] confirmFileDeletion]) { - [self showSheetForDeletedNotes]; + if ([[notationController notationPrefs] confirmFileDeletion]) { + [self showPanelForDeletedNotes]; } else { [self removeDeletedNotes]; } } -- (NSRect)windowSizeForNotes { +- (NSRect)windowSizeForNotesFromSender:(id)sender { float oldHeight = 0.0; float newHeight = 0.0; - NSRect newFrame = [window frame]; + NSRect newFrame = [sender frame]; NSSize intercellSpacing = [tableView intercellSpacing]; int numRows = MIN(20, [tableView numberOfRows]); newHeight = MAX(2, numRows) * ([tableView rowHeight] + intercellSpacing.height); oldHeight = [[[tableView enclosingScrollView] contentView] frame].size.height; - newHeight = [window frame].size.height - oldHeight + newHeight; + newHeight = [sender frame].size.height - oldHeight + newHeight; newFrame.origin.y = newFrame.origin.y + newFrame.size.height - newHeight; newFrame.size.height = newHeight; - return newFrame; + return newFrame; } -- (void)showSheetForDeletedNotes { +- (void)showPanelForDeletedNotes { + + if (![deletedNotes count]) { + NSLog(@"showPanelForDeletedNotes was asked to display without deleted notes"); + return; + } if (!window) { if (![NSBundle loadNibNamed:@"DeletionManager" owner:self]) { @@ -157,26 +191,19 @@ - (void)showSheetForDeletedNotes { NSBeep(); return; } - } + } + [confirmDeletionButton setState:![[notationController notationPrefs] confirmFileDeletion]]; //sort notes by title [deletedNotes sortUnstableUsingFunction:compareTitleString]; - needsToShowSheet = YES; + [window setFrame:[self windowSizeForNotesFromSender:window] display:NO]; - [window setFrame:[self windowSizeForNotes] display:NO]; - - [NSApp beginSheet:window modalForWindow:mainWindow modalDelegate:self - didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:NULL]; + if (![window isVisible]) + [window center]; + [window makeKeyAndOrderFront:nil]; [NSApp cancelUserAttentionRequest:0]; - - if ([mainWindow attachedSheet] == window) - needsToShowSheet = NO; -} - -- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { - } - (void)removeDeletedNotes { @@ -184,7 +211,7 @@ - (void)removeDeletedNotes { //for purposes of generating useful undo messages if ([deletedNotes count] > 1) { - [notationController removeNotes:deletedNotes]; + [notationController removeNotes:[[deletedNotes copy] autorelease]]; } else if ([deletedNotes count] == 1) { @@ -193,48 +220,37 @@ - (void)removeDeletedNotes { } else { NSLog(@"No deleted notes?!"); } - - [deletedNotes removeAllObjects]; } - (void)cancelPanelReturningCode:(NSInteger)code { - if (window) { - [NSApp endSheet:window returnCode:code]; - [window close]; - } + [window close]; +} + +- (IBAction)changeConfirmDeletion:(id)sender { + [[notationController notationPrefs] setConfirmsFileDeletion:![confirmDeletionButton state]]; + [[NSNotificationCenter defaultCenter] postNotificationName:NotationPrefsDidChangeNotification object:nil]; } - (IBAction)deleteAction:(id)sender { [self removeDeletedNotes]; - - [self cancelPanelReturningCode:1]; } - (IBAction)restoreAction:(id)sender { + //force-write the files unsigned int i; for (i=0; i<[deletedNotes count]; i++) { [[deletedNotes objectAtIndex:i] makeNoteDirtyUpdateTime:NO updateFile:YES]; } [notationController synchronizeNoteChanges:nil]; - //cancel any file synchronization that's about to run after the sheet to make sure that it doesn't catch files before rewriting + //force-synchronize directory to get notationcontroller to tell DeletionManager that the file now exists via updateForVerifiedExistingNote + //if restoring the file did not result in the dialog being dismissed, then it was not actually restored [NSObject cancelPreviousPerformRequestsWithTarget:notationController selector:@selector(synchronizeNotesFromDirectory) object:nil]; - - [deletedNotes removeAllObjects]; - - [self cancelPanelReturningCode:0]; + [notationController synchronizeNotesFromDirectory]; } -- (void)windowDidEndSheet:(NSNotification *)aNotification { - - if (needsToShowSheet) { - //we didn't show ourselves and we still need to--now's the time! - NSLog(@"trying to show sheet again"); - [self showSheetForDeletedNotes]; - } -} - (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { return NO; @@ -252,4 +268,9 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView { return [deletedNotes count]; } +- (NSRect)windowWillUseStandardFrame:(NSWindow *)sender defaultFrame:(NSRect)defaultFrame { + return [self windowSizeForNotesFromSender:sender]; +} + + @end diff --git a/DiskUUIDEntry.h b/DiskUUIDEntry.h new file mode 100644 index 00000000..c16484e9 --- /dev/null +++ b/DiskUUIDEntry.h @@ -0,0 +1,31 @@ +// +// DiskUUIDEntry.h +// Notation +// +// Created by Zachary Schneirov on 1/17/11. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + +#import + + +@interface DiskUUIDEntry : NSObject { + + NSDate *lastAccessed; + CFUUIDRef uuidRef; +} + +- (id)initWithUUIDRef:(CFUUIDRef)aUUIDRef; +- (void)see; +- (CFUUIDRef)uuidRef; +- (NSDate*)lastAccessed; +@end diff --git a/DiskUUIDEntry.m b/DiskUUIDEntry.m new file mode 100644 index 00000000..7a2aae35 --- /dev/null +++ b/DiskUUIDEntry.m @@ -0,0 +1,90 @@ +// +// DiskUUIDEntry.m +// Notation +// +// Created by Zachary Schneirov on 1/17/11. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + + +#import "DiskUUIDEntry.h" + + +@implementation DiskUUIDEntry + +- (id)initWithUUIDRef:(CFUUIDRef)aUUIDRef { + if ([super init]) { + NSAssert(aUUIDRef != nil, @"need a real UUID"); + uuidRef = CFRetain(aUUIDRef); + lastAccessed = [[NSDate date] retain]; + } + return self; +} + +- (void)dealloc { + + [lastAccessed release]; + CFRelease(uuidRef); + [super dealloc]; +} +- (void)encodeWithCoder:(NSCoder *)coder { + NSAssert([coder allowsKeyedCoding], @"keyed-encoding only!"); + + [coder encodeObject:lastAccessed forKey:VAR_STR(lastAccessed)]; + + CFUUIDBytes bytes = CFUUIDGetUUIDBytes(uuidRef); + [coder encodeBytes:(const uint8_t *)&bytes length:sizeof(CFUUIDBytes) forKey:VAR_STR(uuidRef)]; + +} +- (id)initWithCoder:(NSCoder*)decoder { + NSAssert([decoder allowsKeyedCoding], @"keyed-decoding only!"); + + if ([super init]) { + + lastAccessed = [[decoder decodeObjectForKey:VAR_STR(lastAccessed)] retain]; + + NSUInteger decodedByteCount = 0; + const uint8_t *bytes = [decoder decodeBytesForKey:VAR_STR(uuidRef) returnedLength:&decodedByteCount]; + if (bytes && decodedByteCount) { + uuidRef = CFUUIDCreateFromUUIDBytes(NULL, *(CFUUIDBytes*)bytes); + } + + if (!uuidRef) return nil; + } + return self; +} + +- (void)see { + [lastAccessed release]; + lastAccessed = [[NSDate date] retain]; +} + +- (CFUUIDRef)uuidRef { + return uuidRef; +} + +- (NSDate*)lastAccessed { + return lastAccessed; +} + +- (NSString*)description { + return [NSString stringWithFormat:@"DiskUUIDEntry(%@, %@)", lastAccessed, [(id)CFUUIDCreateString(NULL, uuidRef) autorelease]]; +} + +- (NSUInteger)hash { + return CFHash(uuidRef); +} +- (BOOL)isEqual:(id)otherEntry { + return CFEqual(uuidRef, [otherEntry uuidRef]); +} + +@end diff --git a/DualField.h b/DualField.h index 8b9c7ac9..625464a4 100755 --- a/DualField.h +++ b/DualField.h @@ -34,6 +34,8 @@ enum { BUTTON_HIDDEN, BUTTON_NORMAL, BUTTON_PRESSED }; @end +@class NoteBookmark; + @interface DualField : NSTextField { IBOutlet NSTableView *notesTable; unsigned int lastLengthReplaced; @@ -43,6 +45,13 @@ enum { BUTTON_HIDDEN, BUTTON_NORMAL, BUTTON_PRESSED }; NSTrackingRectTag docIconRectTag; BOOL showsDocumentIcon; + + //cleared when doing a new manual search + NSMutableArray *followedLinks; + + NSCursor *IBeamCursor; + + NSTimer *modifierTimer; } - (void)setTrackingRect; @@ -50,13 +59,17 @@ enum { BUTTON_HIDDEN, BUTTON_NORMAL, BUTTON_PRESSED }; - (void)setShowsDocumentIcon:(BOOL)showsIcon; - (BOOL)showsDocumentIcon; +- (BOOL)hasFollowedLinks; +- (void)clearFollowedLinks; +- (void)pushFollowedLink:(NoteBookmark*)aBM; +- (NoteBookmark*)popLastFollowedLink; + - (void)setSnapbackString:(NSString*)string; - (NSString*)snapbackString; + (NSImage*)snapbackImageWithString:(NSString*)string; -- (void)deselectAll:(id)sender; +- (void)snapback:(id)sender; - (unsigned int)lastLengthReplaced; -+ (NSBezierPath*)bezierPathWithRoundRectInRect:(NSRect)aRect radius:(float)radius; @end diff --git a/DualField.m b/DualField.m index 97fd7ae0..c02a297d 100755 --- a/DualField.m +++ b/DualField.m @@ -14,8 +14,10 @@ #import "NoteObject.h" #import "GlobalPrefs.h" #import "NotationPrefs.h" +#import "NSBezierPath_NV.h" #import "LinearDividerShader.h" #import "AppController.h" +#import "BookmarksController.h" #define BORDER_TOP_OFFSET 3.0 #define BORDER_LEFT_OFFSET 3.0 @@ -56,7 +58,7 @@ - (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSTex - (NSText *)setUpFieldEditorAttributes:(NSText *)textObj { NSTextView *textView = (NSTextView*)[super setUpFieldEditorAttributes:textObj]; [textView setDrawsBackground:NO]; - + return textView; } @@ -141,7 +143,7 @@ - (BOOL)handleMouseDown:(NSEvent *)theEvent { NSEventType type = [theEvent type]; if (type == NSLeftMouseUp || type == NSRightMouseUp) { if (BUTTON_PRESSED == snapbackButtonState) { - [controlView deselectAll:nil]; + [controlView snapback:nil]; } else if (BUTTON_PRESSED == clearButtonState) { [NSApp tryToPerform:@selector(cancelOperation:) with:nil]; } @@ -164,7 +166,9 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { if (BUTTON_HIDDEN != snapbackButtonState) { NSRect snRect = [self snapbackButtonRectForBounds:cellFrame]; NSEraseRect(centeredRectInRect(snRect, NSMakeSize(MAX_STATE_IMG_DIM, MAX_STATE_IMG_DIM))); - NSImage *snapImg = [NSImage imageNamed:(snapbackButtonState == BUTTON_NORMAL ? @"SnapBack" : @"SnapBackPressed") ]; + NSImage *snapImg = [NSImage imageNamed: + [(DualField *)controlView hasFollowedLinks] ? (snapbackButtonState == BUTTON_NORMAL ? @"LinkBack" : @"LinkBackPressed") : + (snapbackButtonState == BUTTON_NORMAL ? @"SnapBack" : @"SnapBackPressed") ]; [snapImg drawCenteredInRect:snRect]; } } @@ -200,6 +204,11 @@ - (void)awakeFromNib { [myCell setAllowsUndo:NO]; [myCell setLineBreakMode:NSLineBreakByCharWrapping]; + + //remember this now to make sure we always use the same one, in case +IBeamCursor just happens to return a different object later (hint hint) + IBeamCursor = [[NSCursor IBeamCursor] retain]; + + followedLinks = [[NSMutableArray alloc] init]; } - (void)setTrackingRect { @@ -211,6 +220,7 @@ - (void)setTrackingRect { - (void)dealloc { [snapbackString release]; [[NSNotificationCenter defaultCenter] removeObserver:self]; + [followedLinks release]; [super dealloc]; } @@ -221,21 +231,23 @@ - (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPo if (tag == docIconTag) { //should be conditional on whether snapback exists, and include the snapback string if ([[self cell] snapbackButtonIsVisible]) { - return [NSString stringWithFormat:NSLocalizedString(@"Go back to search; press %@-D to deselect", nil), [NSString stringWithCharacters:&ch length:1]]; + return [NSString stringWithFormat:NSLocalizedString(@"Go back to search; press %@-D to deselect", @"tooltip string for search/title field"), + [NSString stringWithCharacters:&ch length:1]]; } else { - return @"Now searching for this text"; + return NSLocalizedString(@"Now searching for this text", @"tooltip string for search/title field"); } } else if (tag == clearButtonTag) { if ([[self cell] clearButtonIsVisible]) { - return @"Clear the search; press ESC"; + return NSLocalizedString(@"Clear the search; press ESC", @"tooltip string for search/title field"); } else { - return @"Type any text to search; press Return to create a note"; + return NSLocalizedString(@"Type any text to search; press Return to create a note", @"tooltip string for search/title field"); } } else if (tag == textAreaTag) { if ([self showsDocumentIcon]) { - return [NSString stringWithFormat:@"Now editing this note; rename it with %@-R", [NSString stringWithCharacters:&ch length:1]]; + return [NSString stringWithFormat:NSLocalizedString(@"Now editing this note; rename it with %@-R", @"tooltip string for search/title field"), + [NSString stringWithCharacters:&ch length:1]]; } else { - return @"Type any text to search; press Return to create a note"; + return NSLocalizedString(@"Type any text to search; press Return to create a note", @"tooltip string for search/title field"); } } return nil; @@ -270,7 +282,7 @@ - (void)resetCursorRects { } else { textArea = NSUnionRect(textArea, clearButtonArea); } - [self addCursorRect: textArea cursor: [NSCursor IBeamCursor]]; + [self addCursorRect: textArea cursor: IBeamCursor]; [self removeAllToolTips]; textAreaTag = [self addToolTipRect:textArea owner:self userData:NULL]; @@ -284,11 +296,37 @@ - (void)reflectScrolledClipView:(NSClipView *)aClipView { } - (void)mouseDown:(NSEvent*)anEvent { + [[NSApp delegate] setIsEditing:NO]; if ([[self cell] handleMouseDown:anEvent]) return; [super mouseDown:anEvent]; + +} + +- (BOOL)hasFollowedLinks { + return [followedLinks count] != 0; +} +- (void)pushFollowedLink:(NoteBookmark*)aBM { + + [followedLinks addObject:aBM]; +} + +- (NoteBookmark*)popLastFollowedLink { + + NoteBookmark *aBookmark = [[followedLinks lastObject] retain]; + [followedLinks removeLastObject]; + + [[NSApp delegate] searchForString:[aBookmark searchString]]; + [[NSApp delegate] revealNote:[aBookmark noteObject] options:0]; + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(clearFollowedLinks) object:nil]; + + return [aBookmark autorelease]; +} + +- (void)clearFollowedLinks { + [followedLinks removeAllObjects]; } - (void)setSnapbackString:(NSString*)string { @@ -302,6 +340,7 @@ - (void)setSnapbackString:(NSString*)string { if (![proposedString length]) { [[self cell] setShowsSnapbackButton:NO]; } + [self performSelector:@selector(clearFollowedLinks) withObject:nil afterDelay:0]; } - (NSString*)snapbackString { return snapbackString; @@ -339,8 +378,12 @@ - (unsigned int)lastLengthReplaced { return lastLengthReplaced; } -- (void)deselectAll:(id)sender { - [notesTable deselectAll:sender]; +- (void)snapback:(id)sender { + if ([self hasFollowedLinks]) { + [self popLastFollowedLink]; + } else { + [notesTable deselectAll:sender]; + } } + (NSImage*)snapbackImageWithString:(NSString*)string { @@ -365,18 +408,18 @@ + (NSImage*)snapbackImageWithString:(NSString*)string { NSImage *image = [[NSImage alloc] initWithSize:wordRect.size]; [image lockFocus]; - NSBezierPath *backgroundPath = [DualField bezierPathWithRoundRectInRect:NSInsetRect(wordRect, 1.5, 1.5) radius:1.5f]; + NSBezierPath *backgroundPath = [NSBezierPath bezierPathWithRoundRectInRect:NSInsetRect(wordRect, 1.5, 1.5) radius:1.5f]; static LinearDividerShader *snapbackShader = nil; if (!snapbackShader) { - snapbackShader = [[LinearDividerShader alloc] initWithStartColor:[NSColor colorWithCalibratedWhite:1.000 alpha:1.000] - endColor:[NSColor colorWithCalibratedWhite:1.000 alpha:1.000]]; + snapbackShader = [[LinearDividerShader alloc] initWithStartColor:[NSColor colorWithDeviceRed:0.8 green:0.386 blue:0.019 alpha:1.0] + endColor:[NSColor colorWithDeviceRed:1.0 green:0.486 blue:0.039 alpha:1.0]]; } [[NSGraphicsContext currentContext] saveGraphicsState]; [backgroundPath addClip]; - [snapbackShader drawDividerInRect:wordRect withDimpleRect:NSZeroRect]; + [snapbackShader drawDividerInRect:wordRect withDimpleRect:NSZeroRect blendVertically:YES]; [[NSGraphicsContext currentContext] restoreGraphicsState]; [[NSColor colorWithDeviceRed:0.63 green:0.20 blue:0.0 alpha:1.0] set]; @@ -389,22 +432,8 @@ + (NSImage*)snapbackImageWithString:(NSString*)string { return [image autorelease]; } - -+ (NSBezierPath*)bezierPathWithRoundRectInRect:(NSRect)aRect radius:(float)radius { - NSBezierPath* path = [NSBezierPath bezierPath]; - float smallestEdge = MIN(NSWidth(aRect), NSHeight(aRect)); - radius = MIN(radius, 0.5f * smallestEdge); - NSRect rect = NSInsetRect(aRect, radius, radius); - [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMinY(rect)) radius:radius startAngle:180.0 endAngle:270.0]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMinY(rect)) radius:radius startAngle:270.0 endAngle:360.0]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMaxY(rect)) radius:radius startAngle: 0.0 endAngle: 90.0]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMaxY(rect)) radius:radius startAngle: 90.0 endAngle:180.0]; - [path closePath]; - return path; -} - - (void)drawRect:(NSRect)rect { - //[super drawRect:rect]; +// [super drawRect:rect]; NSWindow *window = [self window]; BOOL isActiveWin = [window isMainWindow]; @@ -461,11 +490,17 @@ - (void)drawRect:(NSRect)rect { NSRect focusRect = NSInsetRect(tBounds, 0.0f, 0.5f); focusRect.origin.y -= 0.5f; //drawing could be sped up by a measurable amount if this were cached in a (partially transparent) image - [[DualField bezierPathWithRoundRectInRect:focusRect radius:1.0f] fill]; + [[NSBezierPath bezierPathWithRoundRectInRect:focusRect radius:1.0f] fill]; [NSGraphicsContext restoreGraphicsState]; } - } + } + } +//elasticwork +- (void)flagsChanged:(NSEvent *)theEvent{ + [[NSApp delegate] flagsChanged:theEvent]; +} + @end diff --git a/ETContentView.h b/ETContentView.h new file mode 100644 index 00000000..795151ea --- /dev/null +++ b/ETContentView.h @@ -0,0 +1,18 @@ +// +// ETContentView.m +// Notation +// +// Created by elasticthreads on 3/15/11. +// + +#import + + +@interface ETContentView : NSView { + NSColor *backColor; +} + +- (void)setBackgroundColor:(NSColor *)inCol; +- (NSColor *)backgroundColor; + +@end diff --git a/ETContentView.m b/ETContentView.m new file mode 100644 index 00000000..aa7fe0c2 --- /dev/null +++ b/ETContentView.m @@ -0,0 +1,54 @@ +// +// ETContentView.m +// Notation +// +// Created by elasticthreads on 3/15/11. +// + +#import "ETContentView.h" +#import "AppController.h" + +@implementation ETContentView + +- (id)initWithFrame:(NSRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code here. + } + + return self; +} + +- (void)dealloc +{ + [super dealloc]; +} + +- (void)drawRect:(NSRect)dirtyRect +{ + [super drawRect:dirtyRect]; + if (!backColor) { + backColor = [[[NSApp delegate] backgrndColor] retain]; + } + [backColor set]; + NSRectFill([self bounds]); + +} + +- (void)setBackgroundColor:(NSColor *)inCol{ + if (backColor) { + [backColor release]; + } + backColor = inCol; + [backColor retain]; +} + +- (NSColor *)backgroundColor{ + if (!backColor) { + backColor = [[[NSApp delegate] backgrndColor] retain]; + } + return backColor; +} + +@end diff --git a/ETScrollView.h b/ETScrollView.h new file mode 100644 index 00000000..82076e08 --- /dev/null +++ b/ETScrollView.h @@ -0,0 +1,15 @@ +// +// ETScrollView.m +// Notation +// +// Created by elasticthreads on 3/14/11. +// + +#import + + +@interface ETScrollView : NSScrollView { + +} + +@end diff --git a/ETScrollView.m b/ETScrollView.m new file mode 100644 index 00000000..6376df00 --- /dev/null +++ b/ETScrollView.m @@ -0,0 +1,94 @@ +// +// ETScrollView.m +// Notation +// +// Created by elasticthreads on 3/14/11. +// + +#import "ETScrollView.h" +#import "ETTransparentScroller.h" + +@implementation ETScrollView + +- (id)init +{ + self = [super init]; + if (self) { + // Initialization code here. + } + + return self; +} + +- (void)dealloc +{ + [super dealloc]; +} + +- (NSView *)hitTest:(NSPoint)aPoint{ + if (NSPointInRect (aPoint,[[self verticalScroller] frame])) { + return [self verticalScroller]; + }else{ + return [self documentView]; + } +} + + + + +- (void)awakeFromNib{ + if (!IsLionOrLater) { + // ETTransparentScroller *tScroll = [[[ETTransparentScroller alloc]init] retain]; + [self setVerticalScroller:[[ETTransparentScroller alloc]init]]; + // [tScroll release]; + } +} +/* +- (void)drawRect:(NSRect)rect{ + [super drawRect:rect]; + // rect = [self frame]; + NSRect cornerRect = [[self verticalScroller] frame]; + cornerRect.size.height = cornerRect.size.width; + cornerRect.origin.x = rect.origin.x + rect.size.width - cornerRect.size.width; + cornerRect.origin.y += [[self verticalScroller] frame].size.height; + cornerRect.origin.y -= 5;//cornerRect.size.height; + + [[NSColor redColor] setFill]; + NSRectFill(cornerRect); + + +} + + - (void)tile{ + [super tile]; + if ([self hasVerticalScroller]) { + // NSLog(@"subviwes are: %@",[[self subviews] description]); + //NSRect docRect = [self frame]; + // docRect.size.width -=40; + //[self setFrame:docRect]; + // NSRect docRect = [self frame]; + // NSRect clipRect = [[self contentView] frame]; + // NSRect scrollRect = [[self verticalScroller] frame]; + //NSRect bRect = [self frame]; + //bRect.size.width +=28; + // [self setFrame:bRect]; + // cornerRect.size.height = cornerRect.size.width; + // cornerRect.origin.x -=200; + // cornerRect.origin.y +=200; + // clipRect.size.width -=280; + // docRect.size.width +=15; + // [self setFrame:docRect]; + // clipRect.size.width -=55; + //[[self contentView] setFrame:clipRect]; + //scrollRect.origin.x +=15; + // [[self verticalScroller]setFrame:scrollRect]; + // [[self horizontalScroller]setFrame:cornerRect]; + //[[NSColor redColor] setFill]; + // NSRectFill(cornerRect); + //[self setNeedsDisplay:YES]; + } + //} +}*/ + + +@end diff --git a/ETTransparentButton.h b/ETTransparentButton.h new file mode 100644 index 00000000..b4354568 --- /dev/null +++ b/ETTransparentButton.h @@ -0,0 +1,18 @@ +// +// ETTransparentButton based on +// BWTransparentButton.m +// BWToolkit +// +// Created by Brandon Walkin (www.brandonwalkin.com) +// All code is provided under the New BSD license. +// + +#import + + +@interface ETTransparentButton : NSButton +{ + +} + +@end diff --git a/ETTransparentButton.m b/ETTransparentButton.m new file mode 100644 index 00000000..1cc62853 --- /dev/null +++ b/ETTransparentButton.m @@ -0,0 +1,32 @@ +// +// ETTransparentButton based on +// BWTransparentButton.m +// BWToolkit +// +// Created by Brandon Walkin (www.brandonwalkin.com) +// All code is provided under the New BSD license. +// + +#import "ETTransparentButton.h" +#import "ETTransparentButtonCell.h" + +@implementation ETTransparentButton + +- (id)initWithFrame:(NSRect)frameRect{ + if ((self = [super initWithFrame:frameRect])) + { + ETTransparentButtonCell *newCell = [[ETTransparentButtonCell alloc] init]; + [newCell setBezeled:YES]; + [newCell setBezelStyle:NSRecessedBezelStyle]; + [self setCell:newCell]; + [newCell release]; + } + return self; +} + ++ (Class) cellClass +{ + return [ETTransparentButtonCell class]; +} + +@end diff --git a/ETTransparentButtonCell.h b/ETTransparentButtonCell.h new file mode 100644 index 00000000..087cb932 --- /dev/null +++ b/ETTransparentButtonCell.h @@ -0,0 +1,19 @@ +// +// BWTransparentButtonCell.h +// BWToolkit +// +// Created by Brandon Walkin (www.brandonwalkin.com) +// All code is provided under the New BSD license. +// + +#import +#import "ETTransparentButton.h" + +@interface ETTransparentButtonCell : NSButtonCell +{ + +} + +- (NSImage *)bwTintedImage:(NSImage *)anImage WithColor:(NSColor *)tint; + +@end diff --git a/ETTransparentButtonCell.m b/ETTransparentButtonCell.m new file mode 100644 index 00000000..76141104 --- /dev/null +++ b/ETTransparentButtonCell.m @@ -0,0 +1,122 @@ +// +// ETTransparentButtonCell.m +// BWToolkit +// +// Created by Brandon Walkin (www.brandonwalkin.com) +// All code is provided under the New BSD license. +// + +#import "ETTransparentButtonCell.h" + +static NSImage *buttonLeftN, *buttonFillN, *buttonRightN, *buttonLeftP, *buttonFillP, *buttonRightP; +static NSColor *disabledColor, *enabledColor; + +@interface NSCell (BWTBCPrivate) +- (NSDictionary *)_textAttributes; +@end + +@interface ETTransparentButtonCell (BWTBCPrivate) +- (NSColor *)interiorColor; +@end + +@implementation ETTransparentButtonCell + ++ (void)initialize; +{ + NSBundle *bundle = [NSBundle bundleForClass:[ETTransparentButtonCell class]]; + + buttonLeftN = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentButtonLeftN.tiff"]]; + buttonFillN = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentButtonFillN.tiff"]]; + buttonRightN = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentButtonRightN.tiff"]]; + buttonLeftP = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentButtonLeftP.tiff"]]; + buttonFillP = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentButtonFillP.tiff"]]; + buttonRightP = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentButtonRightP.tiff"]]; + + enabledColor = [[NSColor whiteColor] retain]; + disabledColor = [[NSColor colorWithCalibratedWhite:0.6 alpha:1] retain]; +} + +- (void)drawBezelWithFrame:(NSRect)cellFrame inView:(NSView *)controlView +{ + + cellFrame.size.height = buttonFillN.size.height; + + if ([self isHighlighted]) + NSDrawThreePartImage(cellFrame, buttonLeftP, buttonFillP, buttonRightP, NO, NSCompositeSourceOver, 1, YES); + else + NSDrawThreePartImage(cellFrame, buttonLeftN, buttonFillN, buttonRightN, NO, NSCompositeSourceOver, 1, YES); + +} + +- (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView +{ + frame.origin.y -= 2; + + if ([[image name] isEqualToString:@"NSActionTemplate"]) + [image setSize:NSMakeSize(10,10)]; + + NSImage *newImage = image; + if ([image isTemplate]) + newImage = [self bwTintedImage:image WithColor:[self interiorColor]]; + + [super drawImage:newImage withFrame:frame inView:controlView]; +} + +- (NSRect)drawTitle:(NSAttributedString *)title withFrame:(NSRect)frame inView:(NSView *)controlView +{ + frame.origin.y -= 4; + + return [super drawTitle:title withFrame:frame inView:controlView]; +} + +- (NSDictionary *)_textAttributes +{ + NSMutableDictionary *attributes = [[[NSMutableDictionary alloc] init] autorelease]; + [attributes addEntriesFromDictionary:[super _textAttributes]]; + [attributes setObject:[NSFont systemFontOfSize:11] forKey:NSFontAttributeName]; + [attributes setObject:[self interiorColor] forKey:NSForegroundColorAttributeName]; + + return attributes; +} + +- (NSColor *)interiorColor +{ + NSColor *interiorColor; + + if ([self isEnabled]) + interiorColor = enabledColor; + else + interiorColor = disabledColor; + + return interiorColor; +} + +- (NSControlSize)controlSize +{ + return NSSmallControlSize; +} + +- (void)setControlSize:(NSControlSize)size +{ + +} + +- (NSImage *)bwTintedImage:(NSImage *)anImage WithColor:(NSColor *)tint +{ + + NSSize size = [anImage size]; + NSRect imageBounds = NSMakeRect(0, 0, size.width, size.height); + + NSImage *copiedImage = [anImage copy]; + + [copiedImage lockFocus]; + + [tint set]; + NSRectFillUsingOperation(imageBounds, NSCompositeSourceAtop); + + [copiedImage unlockFocus]; + + return [copiedImage autorelease]; +} + +@end diff --git a/ETTransparentScroller.h b/ETTransparentScroller.h new file mode 100644 index 00000000..d0d2778a --- /dev/null +++ b/ETTransparentScroller.h @@ -0,0 +1,40 @@ +// +// ETTransparentScroller.h +// +// Created by Brandon Walkin (www.brandonwalkin.com) +// All code is provided under the New BSD license. +// +// Modified by elasticthreads 10/19/2010 +// + +#import +//#import "LinkingEditor.h" + + + +@interface ETTransparentScroller : NSScroller +{ + #if DELAYED_LAYOUT + float actualProportion, actualPosition; + id contentViewDelegate; + NSRect rectForSuppressedUpdate; + BOOL disableUpdating; + #endif + //NSColor *scrollBackgroundColor; + //BOOL lionStyle; +} +#if DELAYED_LAYOUT +- (void)setDisableUpdating:(BOOL)disable; + +- (void)clearSuppressedRects; +- (void)restoreSuppressedRects; + +- (void)setContentViewDelegate:(id)aDelegate; +- (id)contentViewDelegate; + +#endif +//- (void)setLionStyle:(BOOL)isLion; +//- (void)setBackgroundColor:(NSColor *)inColor; + +@end + diff --git a/ETTransparentScroller.m b/ETTransparentScroller.m new file mode 100644 index 00000000..3202fa54 --- /dev/null +++ b/ETTransparentScroller.m @@ -0,0 +1,246 @@ +// +// ETTransparentScroller.h +// +// Created by Brandon Walkin (www.brandonwalkin.com) +// All code is provided under the New BSD license. +// +// Modified by elasticthreads 10/19/2010 +// + +#import "ETTransparentScroller.h" +#import "ETContentView.h" + +static NSImage *knobTop, *knobVerticalFill, *knobBottom, *slotTop, *slotVerticalFill, *slotBottom; +static float verticalPaddingLeft = 3.1f; +static float verticalPaddingRight = 3.1f; +static float verticalPaddingTop = 2.5f; +static float verticalPaddingBottom = 2.5f; +static float minKnobHeight; + +//static NSColor *scrollBackgroundColor; + +@interface ETTransparentScroller (NVTSPrivate) +- (void)drawKnobSlot; +@end + +@interface NSScroller (NVTSPrivate) +- (NSRect)_drawingRectForPart:(NSScrollerPart)aPart; +@end + +@implementation ETTransparentScroller + ++ (void)initialize +{ + NSBundle *bundle = [NSBundle bundleForClass:[ETTransparentScroller class]]; + + knobTop = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentScrollerKnobTop.tif"]]; + knobVerticalFill = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentScrollerKnobVerticalFill.tif"]]; + knobBottom = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentScrollerKnobBottom.tif"]]; + slotTop = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentScrollerSlotTop.tif"]]; + slotVerticalFill = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentScrollerSlotVerticalFill.tif"]]; + slotBottom = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"TransparentScrollerSlotBottom.tif"]]; + + //bwBackgroundColor = [[NSColor colorWithCalibratedWhite:0.13 alpha:0.855] retain]; + //scrollBackgroundColor = [[NSColor colorWithCalibratedRed:0.948f green:0.948f blue:0.948f alpha:1.0f]retain]; + minKnobHeight = knobTop.size.height + knobVerticalFill.size.height + knobBottom.size.height + 10; +} + +- (id)init{ + if ([super init]) { + [self setArrowsPosition:NSScrollerArrowsNone]; + } + return self; +} +/* +- (void)awakeFromNib{ + //lionStyle = YES; + //scrollBackgroundColor = [[NSColor colorWithCalibratedRed:0.948f green:0.948f blue:0.948f alpha:1.0f]retain]; +}*/ + ++ (CGFloat)scrollerWidth +{ + return slotVerticalFill.size.width + verticalPaddingLeft + verticalPaddingRight; +} + ++ (CGFloat)scrollerWidthForControlSize:(NSControlSize)controlSize +{ + return slotVerticalFill.size.width + verticalPaddingLeft + verticalPaddingRight; +} +/* +- (void)setBackgroundColor:(NSColor *)inColor { + NSLog(@"unnecessary"); + if (scrollBackgroundColor) { + [scrollBackgroundColor release]; + } + scrollBackgroundColor = inColor; + [scrollBackgroundColor retain]; + //[[self enclosingScrollView] setNeedsDisplay:YES]; +} + +- (void)setLionStyle:(BOOL)isLion{ + NSLog(@"setting lionstyle: %d",isLion); + lionStyle = isLion; +}*/ + +- (void)drawRect:(NSRect)aRect; +{ + + if ([[[self superview] className] isEqualToString:@"ETScrollView"]) { + // NSLog(@"notlion"); + NSDrawWindowBackground([self bounds]); + // [[[[self window] contentView] backgroundColor] setFill]; + // NSRectFill([self bounds]); + } + //NSRectFillUsingOperation(aRect,NSCompositeSourceOut);//([self bounds]); + // Only draw if the slot is larger than the knob + if (([self bounds].size.height - verticalPaddingTop - verticalPaddingBottom + 1) > minKnobHeight) + { + [self drawKnobSlot]; + + if ([self knobProportion] > 0.0) + [self drawKnob]; + } + +} + +- (void)drawKnobSlot; +{ + NSRect slotRect = [self rectForPart:NSScrollerKnobSlot]; + NSDrawThreePartImage(slotRect, slotTop, slotVerticalFill, slotBottom, YES, NSCompositeSourceOver, 0.25f, NO); +} + +- (void)drawKnob; +{ + NSRect knobRect = [self rectForPart:NSScrollerKnob]; + NSDrawThreePartImage(knobRect, knobTop, knobVerticalFill, knobBottom, YES, NSCompositeSourceOver, 0.5, NO); +} + +- (NSRect)_drawingRectForPart:(NSScrollerPart)aPart; +{ + // Call super even though we're not using its value (has some side effects we need) + [super _drawingRectForPart:aPart]; + + // Return our own rects rather than use the default behavior + return [self rectForPart:aPart]; +} + +- (NSRect)rectForPart:(NSScrollerPart)aPart; +{ + + switch (aPart) + { + case NSScrollerNoPart: + return [self bounds]; + break; + case NSScrollerKnob: + { + NSRect knobRect; + NSRect slotRect = [self rectForPart:NSScrollerKnobSlot]; + //NSLog(@"knobproportion is : %f",[self knobProportion]); + + float knobHeight = roundf(slotRect.size.height * [self knobProportion]*.993); + + if (knobHeight < minKnobHeight) + knobHeight = minKnobHeight; + + float knobY = slotRect.origin.y + roundf((slotRect.size.height - knobHeight) * [self floatValue]); + knobRect = NSMakeRect(verticalPaddingLeft, knobY, slotRect.size.width, knobHeight); + + + return knobRect; + } + break; + case NSScrollerKnobSlot: + { + NSRect slotRect; + + + slotRect = NSMakeRect(verticalPaddingLeft, verticalPaddingTop, [self bounds].size.width - verticalPaddingLeft - verticalPaddingRight, [self bounds].size.height - verticalPaddingTop - verticalPaddingBottom); + + slotRect.origin.y = (slotRect.origin.y + (slotRect.size.height * .0035)); + slotRect.size.height = (slotRect.size.height * .993); + return slotRect; + } + break; + case NSScrollerIncrementLine: + return NSZeroRect; + break; + case NSScrollerDecrementLine: + return NSZeroRect; + break; + case NSScrollerIncrementPage: + { + NSRect incrementPageRect; + NSRect knobRect = [self rectForPart:NSScrollerKnob]; + NSRect slotRect = [self rectForPart:NSScrollerKnobSlot]; + NSRect decPageRect = [self rectForPart:NSScrollerDecrementPage]; + + float knobY = knobRect.origin.y + knobRect.size.height; + incrementPageRect = NSMakeRect(verticalPaddingLeft, knobY, knobRect.size.width, slotRect.size.height - knobRect.size.height - decPageRect.size.height); + + return incrementPageRect; + } + break; + case NSScrollerDecrementPage: + { + NSRect decrementPageRect; + NSRect knobRect = [self rectForPart:NSScrollerKnob]; + + + decrementPageRect = NSMakeRect(verticalPaddingLeft, verticalPaddingTop, knobRect.size.width, knobRect.origin.y - verticalPaddingTop); + + return decrementPageRect; + } + break; + default: + break; + } + + return NSZeroRect; +} + +#if DELAYED_LAYOUT +- (void)mouseDown:(NSEvent*)event { + if (![contentViewDelegate readyToDraw]) { + [contentViewDelegate _setFutureSelectionRangeWithinIndex:[[contentViewDelegate string] length]]; + } + + [super mouseDown:event]; +} + +- (void)displayIfNeededInRect:(NSRect)aRect { + if (![contentViewDelegate readyToDraw]) { + rectForSuppressedUpdate = NSUnionRect(rectForSuppressedUpdate, aRect); + } else { + [super displayIfNeededInRect:aRect]; + } +} + +- (void)setNeedsDisplayInRect:(NSRect)invalidRect { + if (![contentViewDelegate readyToDraw]) { + rectForSuppressedUpdate = NSUnionRect(rectForSuppressedUpdate, invalidRect); + } else { + [super setNeedsDisplayInRect:invalidRect]; + } +} + +- (void)clearSuppressedRects { + rectForSuppressedUpdate = NSZeroRect; +} + +- (void)restoreSuppressedRects { + [super setNeedsDisplayInRect:rectForSuppressedUpdate]; +} + +- (void)setDisableUpdating:(BOOL)disable { + disableUpdating = disable; +} +- (void)setContentViewDelegate:(id)aDelegate { + contentViewDelegate = aDelegate; +} +- (id)contentViewDelegate { + return contentViewDelegate; +} +#endif + +@end diff --git a/EmptyView.h b/EmptyView.h index 13b7b5c7..c6f949e2 100755 --- a/EmptyView.h +++ b/EmptyView.h @@ -18,8 +18,10 @@ { IBOutlet NSTextField *labelText; int lastNotesNumber; + NSColor *bgCol; } - (void)setLabelStatus:(int)notesNumber; +- (void)setBackgroundColor:(NSColor *)inColor; @end diff --git a/EmptyView.m b/EmptyView.m index d9659847..dbd98b47 100755 --- a/EmptyView.m +++ b/EmptyView.m @@ -11,7 +11,7 @@ #import "EmptyView.h" -#import "AppController.h" +//#import "AppController.h" @implementation EmptyView @@ -26,6 +26,15 @@ - (id)initWithFrame:(NSRect)frameRect { - (void)awakeFromNib { outletObjectAwoke(self); + /* + if (!bgCol) { + bgCol = [[[NSApp delegate] backgrndColor] retain]; + }*/ + +} + +- (void)mouseDown:(NSEvent*)anEvent { + [[NSApp delegate] performSelector:@selector(bringFocusToControlField:) withObject:nil]; } - (void)setLabelStatus:(int)notesNumber { @@ -44,15 +53,30 @@ - (void)setLabelStatus:(int)notesNumber { } } +- (void)resetCursorRects { + [self addCursorRect:[self bounds] cursor: [NSCursor arrowCursor]]; +} + +- (BOOL)isOpaque { + return NO; +} +/* +- (void)setBackgroundColor:(NSColor *)inColor{ + if (bgCol) { + [bgCol release]; + } + bgCol = inColor; + [bgCol retain]; +} + - (void)drawRect:(NSRect)rect { - NSRect bounds = [self bounds]; - - [[NSColor whiteColor] set]; - NSRectFill(bounds); - - [[NSColor grayColor] set]; - NSFrameRect(bounds); - + //NSRect bounds = [self bounds]; + if (!bgCol) { + bgCol = [[[NSApp delegate] backgrndColor] retain]; + } + //[bgCol set]; + //NSRectFill(bounds); } +*/ @end diff --git a/EncodingsManager.m b/EncodingsManager.m index e13b629d..2fff465a 100755 --- a/EncodingsManager.m +++ b/EncodingsManager.m @@ -200,17 +200,8 @@ - (void)setFileEncodingFromMenu:(id)sender { if (![self tryToUpdateTextForEncoding:newEncoding]) { //set it back to the current encoding--this one doesn't work - int encodingIndex = [encodingsPopUpButton indexOfItemWithTag:(int)currentEncoding]; - if (encodingIndex > -1) - [encodingsPopUpButton selectItemAtIndex:encodingIndex]; - else - NSLog(@"(setting it back) encoding %u not found", currentEncoding); - } - - //if ([[[self contentString] string] canBeConvertedToEncoding:encoding]) { - - - //} + [encodingsPopUpButton selectItemWithTag:(int)currentEncoding]; + } } else { NSLog(@"Unknown class sent msg to change encoding: %@", [sender description]); } @@ -230,16 +221,13 @@ - (BOOL)tryToUpdateTextForEncoding:(NSStringEncoding)encoding { currentEncoding = encoding; - int encodingIndex = [encodingsPopUpButton indexOfItemWithTag:(int)currentEncoding]; - if (encodingIndex > -1) - [encodingsPopUpButton selectItemAtIndex:encodingIndex]; - else - NSLog(@"encoding %u not found", currentEncoding); + [encodingsPopUpButton selectItemWithTag:(int)currentEncoding]; return YES; } else { NSRunAlertPanel([NSString stringWithFormat:@"%@ is not a valid encoding for this text file.", - [NSString localizedNameOfStringEncoding:encoding]], @"Please try another encoding.", @"OK", NULL, NULL); + [NSString localizedNameOfStringEncoding:encoding]], NSLocalizedString(@"Please try another encoding.", @"prompt for choosing an incompatible text encoding"), + NSLocalizedString(@"OK",nil), NULL, NULL); } diff --git a/English.lproj/BlorPasswordRetriever.nib/designable.nib b/English.lproj/BlorPasswordRetriever.nib/designable.nib old mode 100755 new mode 100644 diff --git a/English.lproj/BlorPasswordRetriever.nib/keyedobjects.nib b/English.lproj/BlorPasswordRetriever.nib/keyedobjects.nib old mode 100755 new mode 100644 diff --git a/English.lproj/Contact Information.nvhelp b/English.lproj/Contact Information.nvhelp index be9c0231..03edcdb3 100755 --- a/English.lproj/Contact Information.nvhelp +++ b/English.lproj/Contact Information.nvhelp @@ -1,4 +1,4 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf250 +{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww9000\viewh8400\viewkind0 @@ -11,9 +11,9 @@ \b \ Development: \b0 \ - http://wiki.github.com/scrod/nv/\ + https://github.com/scrod/nv/wiki/\ \ \b Contact: \b0 \ - scrod@indy.rr.com} \ No newline at end of file + Zachary Schneirov } \ No newline at end of file diff --git a/English.lproj/DeletionManager.nib/designable.nib b/English.lproj/DeletionManager.nib/designable.nib old mode 100755 new mode 100644 index e288e9c1..862fbd29 --- a/English.lproj/DeletionManager.nib/designable.nib +++ b/English.lproj/DeletionManager.nib/designable.nib @@ -1,15 +1,11 @@ - + 1030 - 10C540 - 740 - 1038.25 - 458.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 740 - + 9L31a + 680 + 949.54 + 353.00 YES @@ -20,7 +16,7 @@ YES - + YES @@ -39,10 +35,10 @@ NSApplication - 11 + 9 2 - {{568, 541}, {371, 291}} - 1886912512 + {{568, 610}, {371, 222}} + 1886913536 Notes Deleted Externally NSPanel @@ -50,7 +46,7 @@ View - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} {371, 200} @@ -60,16 +56,18 @@ 266 - {{17, 199}, {337, 72}} + {{102, 138}, {252, 68}} YES 67239424 272629760 - The following files no longer exist in the notes folder—restore them to disk or delete them from Notational Velocity, too? + VGhlIGZvbGxvd2luZyBmaWxlcyBubyBsb25nZXIgZXhpc3QgaW4gdGhlIG5vdGVzIGZvbGRlcuKAlHJl +c3RvcmUgdGhlbSB0byBkaXNrIG9yIGRlbGV0ZSB0aGVtIGZyb20gTm90YXRpb25hbCBWZWxvY2l0eSwg +dG9vPw LucidaGrande - 13 + 1.300000e+01 1044 @@ -79,7 +77,7 @@ controlColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2OQA @@ -93,6 +91,38 @@ + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{24, 144}, {62, 62}} + + YES + + 130560 + 33554432 + + NSImage + NSApplicationIcon + + 0 + 1 + 0 + NO + + YES + 274 @@ -106,7 +136,7 @@ 256 - {314, 129} + {314, 38} YES @@ -117,16 +147,16 @@ YES - 311 - 40 - 1000 + 3.110000e+02 + 4.000000e+01 + 1.000000e+03 75628096 2048 LucidaGrande - 11 + 1.100000e+01 3100 @@ -159,8 +189,8 @@ - 3 - 2 + 3.000000e+00 + 2.000000e+00 3 MQA @@ -174,18 +204,15 @@ MC41AA - 17 + 1.700000e+01 306184192 - - 4 15 0 YES - 0 - {{1, 1}, {314, 129}} + {{1, 1}, {314, 38}} @@ -195,11 +222,11 @@ 256 - {{315, 1}, {15, 129}} + {{315, 1}, {15, 38}} _doScroller: - 0.67894738912582397 + 9.473684e-01 @@ -209,10 +236,10 @@ 1 _doScroller: - 0.99047619104385376 + 9.904762e-01 - {{20, 60}, {331, 131}} + {{20, 82}, {331, 40}} 18 @@ -263,13 +290,36 @@ 25 + + + 288 + {{18, 58}, {297, 18}} + + YES + + 67239424 + 0 + Do not show this message again + + + 1211912703 + 2 + + NSSwitch + + + + 200 + 25 + + - {371, 291} + {371, 222} {{0, 0}, {1440, 878}} {371, 222} - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} externallyDeletedNotesTable @@ -324,32 +374,50 @@ 341 + + + confirmDeletionButton + + + + 353 + + + + changeConfirmDeletion: + + + + 354 + YES 0 - + + YES + -2 - - File's Owner + + RmlsZSdzIE93bmVyA -1 - + First Responder -3 - + Application @@ -359,7 +427,7 @@ YES - + Multiple Note External Deletion @@ -368,9 +436,11 @@ YES + - + + @@ -460,17 +530,45 @@ + + 349 + + + YES + + + + + + 350 + + + + + 351 + + + YES + + + + + + 352 + + + YES - + YES + -1.IBPluginDependency + -2.IBPluginDependency -3.IBPluginDependency -3.ImportedFromIB2 328.IBEditorWindowLastContentRect - 328.IBPluginDependency - 328.IBPropertyAccessControl 328.IBWindowTemplateEditedContentRect 328.ImportedFromIB2 328.windowTemplate.hasMinSize @@ -491,45 +589,71 @@ 335.IBPluginDependency 335.IBPropertyAccessControl 335.ImportedFromIB2 + 343.IBPluginDependency + 344.IBPluginDependency + 345.IBPluginDependency + 346.IBPluginDependency 346.IBShouldRemoveOnLegacySave + 347.IBPluginDependency 347.IBShouldRemoveOnLegacySave + 348.IBPluginDependency 348.IBShouldRemoveOnLegacySave + 349.IBPluginDependency + 349.ImportedFromIB2 + 350.IBPluginDependency + 351.IBPluginDependency + 351.ImportedFromIB2 + 352.IBPluginDependency YES com.apple.InterfaceBuilder.CocoaPlugin - - {{357, 288}, {371, 291}} com.apple.InterfaceBuilder.CocoaPlugin - - {{357, 288}, {371, 291}} - - + com.apple.InterfaceBuilder.CocoaPlugin + + {{363, 663}, {371, 222}} + {{363, 663}, {371, 222}} + + {371, 200} com.apple.InterfaceBuilder.CocoaPlugin - + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - + + com.apple.InterfaceBuilder.CocoaPlugin - + + com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - - - - + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin YES - + + YES + YES @@ -537,13 +661,15 @@ YES - + + YES + YES - 348 + 354 @@ -553,8 +679,9 @@ NSObject YES - + YES + changeConfirmDeletion: deleteAction: restoreAction: @@ -562,19 +689,20 @@ YES id id + id YES - + YES - delegate + confirmDeletionButton tableView window YES - id + NSButton NSTableView NSPanel @@ -594,6 +722,7 @@ FirstResponder + NSObject : id @@ -610,6 +739,13 @@ BookmarksController.h + + NSObject + + IBProjectSource + FastListDataSource.h + + NSObject @@ -649,7 +785,7 @@ NSObject YES - + YES didAdjustSubviews: willAdjustSubviews: @@ -754,595 +890,8 @@ - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - PrintCore.framework/Headers/PDEPluginInterface.h - - - - NSObject - - IBFrameworkSource - SecurityInterface.framework/Headers/SFAuthorizationView.h - - - - NSObject - - IBFrameworkSource - SecurityInterface.framework/Headers/SFCertificatePanel.h - - - - NSObject - - IBFrameworkSource - SecurityInterface.framework/Headers/SFChooseIdentityPanel.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUAppcast.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUUpdater.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebDownload.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebEditingDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebFrameLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebJavaPlugIn.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPlugin.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPluginContainer.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPolicyDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebResourceLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebScriptObject.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebUIDelegate.h - - - - NSPanel - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSPanel.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSScrollView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSScrollView.h - - - - NSScroller - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSScroller.h - - - - NSTableColumn - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableColumn.h - - - - NSTableView - NSControl - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - 0 - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES ../Notation.xcodeproj 3 diff --git a/English.lproj/DeletionManager.nib/keyedobjects.nib b/English.lproj/DeletionManager.nib/keyedobjects.nib old mode 100755 new mode 100644 index 045e933b..c1b26c23 Binary files a/English.lproj/DeletionManager.nib/keyedobjects.nib and b/English.lproj/DeletionManager.nib/keyedobjects.nib differ diff --git a/English.lproj/EncodingsManager.nib/designable.nib b/English.lproj/EncodingsManager.nib/designable.nib old mode 100755 new mode 100644 diff --git a/English.lproj/EncodingsManager.nib/keyedobjects.nib b/English.lproj/EncodingsManager.nib/keyedobjects.nib old mode 100755 new mode 100644 diff --git a/English.lproj/Excruciatingly Useful Shortcuts.nvhelp b/English.lproj/Excruciatingly Useful Shortcuts.nvhelp index acf63037..ba171d1f 100755 --- a/English.lproj/Excruciatingly Useful Shortcuts.nvhelp +++ b/English.lproj/Excruciatingly Useful Shortcuts.nvhelp @@ -1,7 +1,7 @@ -{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540 +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 \readonlydoc1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaGrande;} {\colortbl;\red255\green255\blue255;} -\margl1440\margr1440\vieww6880\viewh9280\viewkind0 +\margl1440\margr1440\vieww7060\viewh10060\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs24 \cf0 \CocoaLigature0 In the order of most to least useful:\ @@ -38,6 +38,11 @@ Tab Move insertion point between text areas\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f1 \cf0 \uc0\u8984 +\f0 +\f1 \uc0\u8679 T +\f0 Tag the selected note\ + +\f1 \uc0\u8984 \f0 G Find next occurrence of search text\ \f1 \uc0\u8984 @@ -93,5 +98,5 @@ Text formatting shortcuts:\ \f0 I Italicize\ \f1 \uc0\u8984 -\f0 U Underline\ +\f0 Y Strikethrough\ } \ No newline at end of file diff --git a/English.lproj/FindPanel.nib/classes.nib b/English.lproj/FindPanel.nib/classes.nib new file mode 100755 index 00000000..d67f2798 --- /dev/null +++ b/English.lproj/FindPanel.nib/classes.nib @@ -0,0 +1,26 @@ +{ + IBClasses = ( + { + ACTIONS = {"" = id; }; + CLASS = FirstResponder; + LANGUAGE = ObjC; + SUPERCLASS = NSObject; + }, + { + ACTIONS = {changeEntirePhrase = id; findNext = id; findPrevious = id; }; + CLASS = MultiTextFinder; + LANGUAGE = ObjC; + OUTLETS = { + entirePhraseButton = NSButton; + findStringField = NSTextField; + ignoreCaseButton = NSButton; + nextButton = NSButton; + previousButton = NSButton; + window = NSPanel; + }; + SUPERCLASS = NSObject; + }, + {CLASS = NSDatePicker; LANGUAGE = ObjC; SUPERCLASS = NSControl; } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/English.lproj/TagEditingManager.nib/info.nib b/English.lproj/FindPanel.nib/info.nib similarity index 86% rename from English.lproj/TagEditingManager.nib/info.nib rename to English.lproj/FindPanel.nib/info.nib index 11e610e9..bd3ca866 100755 --- a/English.lproj/TagEditingManager.nib/info.nib +++ b/English.lproj/FindPanel.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 293 53 356 240 0 0 1680 1028 + 261 98 356 240 0 0 1680 1028 IBFramework Version 446.1 IBLockedTabItems @@ -12,7 +12,7 @@ IBOpenObjects - 354 + 342 IBSystem Version 8L127 diff --git a/English.lproj/FindPanel.nib/keyedobjects.nib b/English.lproj/FindPanel.nib/keyedobjects.nib old mode 100644 new mode 100755 index ab61897d..db6b8e2e Binary files a/English.lproj/FindPanel.nib/keyedobjects.nib and b/English.lproj/FindPanel.nib/keyedobjects.nib differ diff --git a/English.lproj/ImporterAccessory.nib/classes.nib b/English.lproj/ImporterAccessory.nib/classes.nib old mode 100755 new mode 100644 diff --git a/English.lproj/ImporterAccessory.nib/info.nib b/English.lproj/ImporterAccessory.nib/info.nib old mode 100755 new mode 100644 diff --git a/English.lproj/ImporterAccessory.nib/keyedobjects.nib b/English.lproj/ImporterAccessory.nib/keyedobjects.nib old mode 100755 new mode 100644 diff --git a/English.lproj/InfoPlist.strings b/English.lproj/InfoPlist.strings index 9d5d4c84..75e35967 100755 Binary files a/English.lproj/InfoPlist.strings and b/English.lproj/InfoPlist.strings differ diff --git a/English.lproj/KeyDerivationManager.nib/designable.nib b/English.lproj/KeyDerivationManager.nib/designable.nib old mode 100755 new mode 100644 diff --git a/English.lproj/KeyDerivationManager.nib/keyedobjects.nib b/English.lproj/KeyDerivationManager.nib/keyedobjects.nib old mode 100755 new mode 100644 diff --git a/English.lproj/Localizable.strings b/English.lproj/Localizable.strings index 1aa84e84..c32c17a6 100755 Binary files a/English.lproj/Localizable.strings and b/English.lproj/Localizable.strings differ diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib deleted file mode 100644 index f2c7c635..00000000 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and /dev/null differ diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib new file mode 100644 index 00000000..24a73bbb --- /dev/null +++ b/English.lproj/MainMenu.xib @@ -0,0 +1,6113 @@ + + + + 1040 + 10J869 + 1305 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1305 + + + YES + NSTextView + NSScroller + NSTableHeaderView + NSMenuItem + NSMenu + NSTextFieldCell + NSButtonCell + NSButton + NSTokenField + NSProgressIndicator + NSTokenFieldCell + NSScrollView + NSTableView + NSCustomView + NSCustomObject + NSView + NSWindowTemplate + NSTextField + NSUserDefaultsController + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + 4111 + 2 + {{280, 392}, {397, 464}} + 1618477056 + nvALT + NSWindow + + View + + {213, 107} + + + 256 + {{7, 11}, {397, 464}} + + + + {{0, 0}, {1920, 1058}} + {213, 129} + {1e+13, 1e+13} + NotationWindow + + + MainMenu + + YES + + + nvALT + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + nvALT + + YES + + + About nvALT + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Check for Updates… + + 1048576 + 2147483647 + + + 88 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + + Services + + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide nvALT + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit nvALT + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + Note + + 1048576 + 2147483647 + + + submenuAction: + 89 + + Note + + YES + + + Rename + r + 1048576 + 2147483647 + + + 90 + + + + Tag + T + 1048576 + 2147483647 + + + 92 + + + + Delete + CA + 1048576 + 2147483647 + + + 91 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Search or Create… + l + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Import… + + 1048576 + 2147483647 + + + 93 + + + + Export… + e + 1048576 + 2147483647 + + + 94 + + + + Show in Finder + R + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup… + P + 1048576 + 2147483647 + + + 95 + + + + Print… + p + 1048576 + 2147483647 + + + 96 + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + + Edit + + + YES + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Copy URL + c + 1572864 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Paste as New Note + V + 1048576 + 2147483647 + + + + + + Clear + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + + Find + + + YES + + + Find… + f + 1048576 + 2147483647 + + + 1 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1048576 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + + + + Spelling + + 1048576 + 2147483647 + + + submenuAction: + + Spelling + + YES + + + Spelling… + : + 1048576 + 2147483647 + + + + + + Check Spelling + ; + 1048576 + 2147483647 + + + + + + Check Spelling as You Type + + 1048576 + 2147483647 + + + + + + + + + Transformations + + 1048576 + 2147483647 + + + submenuAction: + + Transformations + + YES + + + Make Upper Case + + 1048576 + 2147483647 + + + + + + Make Lower Case + + 1048576 + 2147483647 + + + + + + Capitalize + + 1048576 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + 99 + + View + + YES + + + Switch to Horizontal Layout + l + 1572864 + 2147483647 + + + + + + Collapse Notes List + C + 1048576 + 2147483647 + + + + + + Color Schemes + + 2147483647 + + + submenuAction: + + Color Schemes + + YES + + + B/W + 1 + 1572864 + 2147483647 + 1 + + + + + + Low Contrast + 2 + 1572864 + 2147483647 + + + + + + User Scheme + 3 + 1572864 + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Columns + + 1048576 + 2147483647 + + + submenuAction: + 97 + + Columns + + YES + + + Item + + 1048576 + 2147483647 + 1 + + + + + + + + + Sort By + + 1048576 + 2147483647 + + + submenuAction: + 98 + + Sort By + + YES + + + Item + + 1048576 + 2147483647 + + + + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + YES + Show Word Count + K + 1048576 + 2147483647 + + + + + + Show Note-Previews in List + p + 1572864 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Next Note + j + 1048576 + 2147483647 + + + 106 + + + + Previous Note + k + 1048576 + 2147483647 + + + 107 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Deselect Note(s) + d + 1048576 + 2147483647 + + + 101 + + + + + + + Bookmarks + + 1048576 + 2147483647 + + + submenuAction: + 103 + + Bookmarks + + YES + + + Item + + 1048576 + 2147483647 + + + + + + + + + Format + + 1048576 + 2147483647 + + + submenuAction: + + + Format + + + YES + + + Plain Text Style + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + Bold + + YES + + YES + NSFont + NSOriginalFont + + + YES + + LucidaGrande-Bold + 14 + 16 + + + + + + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + Italic + + YES + + YES + NSFont + NSObliqueness + NSParagraphStyle + + + YES + + LucidaGrande + 14 + 16 + + + + 4 + + YES + + 28 + + + 56 + + + 84 + + + 112 + + + 140 + + + 168 + + + 196 + + + 224 + + + 252 + + + 280 + + + 308 + + + 336 + + + + + + + + + + Strikethrough + y + 1048576 + 2147483647 + + + + Strikethrough + + YES + + YES + NSFont + NSOriginalFont + NSStrikethrough + + + YES + + + + + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Shift Left + [ + 1048576 + 2147483647 + + + + + + Shift Right + ] + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Fix Text Encoding… + + 1048576 + 2147483647 + + + 102 + + + + + + + Preview + + 2147483647 + + + submenuAction: + + Preview + + YES + + + (Multi)Markdown + + 2147483647 + + + 13372 + + + + Textile + + 2147483647 + + + 13373 + + + + YES + YES + + + 2147483647 + + + + + + Toggle Preview Window + p + 1310720 + 2147483647 + + + + + + Toggle Source View + u + 1048576 + 2147483647 + + + + + + Lock Note to Preview + L + 1572864 + 2147483647 + + + + + + Print Preview / PDF + P + 1572864 + 2147483647 + + + + + + Save Preview HTML + S + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + + Window + + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 1048576 + 2147483647 + + + submenuAction: + + Help + + YES + + + Keyboard Shortcuts + + 2147483647 + + + 1 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + nvALT Home + + 2147483647 + + + 5 + + + + ElasticThreads Web Site + + 2147483647 + + + 6 + + + + Brett Terpstra Web Site + + 2147483647 + + + 7 + + + + Notational Velocity Web Site + + 2147483647 + + + 3 + + + + Development Web Site + + 2147483647 + + + 4 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Acknowledgments + + 2147483647 + + + 2 + + + + + + _NSMainMenu + + + AppController + + + + 274 + + YES + + + 319 + {{0, 43}, {147, 23}} + + + YES + + 67239424 + 138412032 + No Note Selected + + Helvetica + 18 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 3 + MC40OTU5Njc3NDU4AA + + + + + {147, 102} + + + EmptyView + NSView + + + NSFontManager + + + + 258 + + YES + + + 257 + + YES + + YES + NSStringPboardType + + + {{206, 6}, {145, 14}} + + + YES + + 67239424 + 67239936 + + LucidaGrande + 11 + 3100 + + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + 0.0 + 0 + + 2 + + + + 266 + {381, 23} + + + YES + + -1804468671 + 268436480 + + + LucidaGrande + 13 + 1044 + + + YES + + + 6 + System + textColor + + + + + + {381, 23} + + + + NSView + + NSResponder + + + 1 + 2 + {{454, 634}, {353, 106}} + -260571136 + + NSPanel + + View + + {213, 107} + + + 256 + + YES + + + 256 + {{240, 12}, {99, 32}} + + YES + + 67239424 + 134217728 + Quit Now + + + -2038284033 + 1 + + + DQ + 200 + 25 + + + + + 1280 + + {{20, 54}, {32, 32}} + + + 20490 + 100 + + + + 256 + {{70, 60}, {266, 20}} + + + YES + + 67239424 + 272629760 + Waiting for changes to finish uploading… + + + + + + + + {{7, 11}, {353, 106}} + + + {{0, 0}, {1920, 1058}} + {213, 129} + {1e+13, 1e+13} + + + barMenu + + YES + + + Bookmarks + + 1048576 + 2147483647 + + + submenuAction: + 901 + + Bookmarks + + YES + + + Item + + 1048576 + 2147483647 + + + + + + + + + Format + + 1048576 + 2147483647 + + + submenuAction: + + + Format + + + YES + + + Plain Text Style + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + Bold + + + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + Italic + + + + + + Strikethrough + y + 1048576 + 2147483647 + + + + Strikethrough + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Shift Left + [ + 1048576 + 2147483647 + + + + + + Shift Right + ] + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Fix Text Encoding… + + 1048576 + 2147483647 + + + 102 + + + + + + + YES + YES + + + 2147483647 + + + + + + Search or Create… + l + 1048576 + 2147483647 + + + + + + Show in Finder + R + 1048576 + 2147483647 + + + + + + Rename + r + 1048576 + 2147483647 + + + 90 + + + + Tag + T + 1048576 + 2147483647 + + + 92 + + + + Delete + CA + 1048576 + 2147483647 + + + 91 + + + + YES + YES + + + 2147483647 + + + + + + Switch to Horizontal Layout + l + 1572864 + 2147483647 + + + + + + Collapse Notes List + C + 1048576 + 2147483647 + + + + + + Color Schemes + + 2147483647 + + + submenuAction: + + Color Schemes + + YES + + + YES + B/W + 1 + 1572864 + 2147483647 + 1 + + + + + + YES + Low Contrast + 2 + 1572864 + 2147483647 + + + + + + YES + User Scheme + 3 + 1572864 + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + Check for Updates… + + 1048576 + 2147483647 + + + 902 + + + + Quit Notational Velocity + q + 1048576 + 2147483647 + + + + + + + + 268 + {163, 96} + StatusItemView + + + YES + + + + 274 + + YES + + + 2304 + + YES + + + 2322 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + + + {399, 14} + + + + + + + + + + + + YES + + + 6 + + + + 399 + 1 + + + 12007 + 0 + + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + + + 6 + System + selectedTextColor + + + + + + + YES + + YES + NSColor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + + + + + 6 + {781, 1e+07} + {80, 0} + + + + {399, 304} + + + + + 1 + MSAwLjA0OTMwMjU1MjY4IDAuMDYxMDkyMTM5MQA + + + {4, -5} + 1 + + + + + -2147479296 + {{384, 0}, {15, 304}} + + 2 + + _doScroller: + 1 + + + + -2147479296 + {{-100, -100}, {384, 15}} + + + 1 + 2 + + _doScroller: + 1 + 0.94565218687057495 + + + {399, 304} + + 528 + + + + + + + 274 + + YES + + + 2304 + + YES + + + 4352 + {399, 136} + + + YES + + + 256 + {399, 17} + + + + + + + -2147483392 + {{383, 0}, {16, 17}} + + + + + YES + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 14 + -633307136 + + + 1 + 15 + 0 + YES + 0 + + + {{0, 17}, {399, 136}} + + + + + 6 + System + controlBackgroundColor + + + + + + -2147483392 + {{383, 17}, {15, 135}} + + 2 + + _doScroller: + 0.99259259259259258 + + + + -2147483392 + {{-100, -100}, {382, 15}} + + + 1 + 2 + + _doScroller: + 0.96598637104034424 + + + + 2304 + + YES + + + {399, 17} + + + + + 4 + + + + {399, 153} + + 528 + + + + + + QSAAAEEgAABBgAAAQYAAAA + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + runPageLayout: + + + + 87 + + + + terminate: + + + + 139 + + + + hideOtherApplications: + + + + 146 + + + + hide: + + + + 152 + + + + unhideAllApplications: + + + + 153 + + + + cut: + + + + 175 + + + + paste: + + + + 176 + + + + redo: + + + + 178 + + + + selectAll: + + + + 179 + + + + undo: + + + + 180 + + + + copy: + + + + 181 + + + + showGuessPanel: + + + + 188 + + + + checkSpelling: + + + + 190 + + + + toggleContinuousSpellChecking: + + + + 192 + + + + performZoom: + + + + 198 + + + + window + + + + 217 + + + + delegate + + + + 219 + + + + editorStatusView + + + + 348 + + + + labelText + + + + 350 + + + + showPreferencesWindow: + + + + 381 + + + + performClose: + + + + 496 + + + + renameNote: + + + + 526 + + + + fixFileEncoding: + + + + 536 + + + + bringFocusToControlField: + + + + 555 + + + + shiftLeftAction: + + + + 568 + + + + shiftRightAction: + + + + 569 + + + + delete: + + + + 773 + + + + defaultStyle: + + + + 978 + + + + bold: + + + + 981 + + + + italic: + + + + 982 + + + + importNotes: + + + + 986 + + + + printNote: + + + + 987 + + + + exportNote: + + + + 988 + + + + tagNote: + + + + 995 + + + + delegate + + + + 1020 + + + + notesTableView + + + + 1021 + + + + delegate + + + + 1024 + + + + nextKeyView + + + + 1025 + + + + notesTableView + + + + 1027 + + + + textView + + + + 1030 + + + + incrementNoteSelection: + + + + 1035 + + + + incrementNoteSelection: + + + + 1036 + + + + paste: + + + + 1037 + + + + deselectAll: + + + + 1038 + + + + delegate + + + + 1040 + + + + delegate + + + + 1041 + + + + sparkleUpdateItem + + + + 1052 + + + + toggleNoteBodyPreviews: + + + + 1065 + + + + delegate + + + + 1068 + + + + nextKeyView + + + + 1069 + + + + notesTable + + + + 1070 + + + + fieldAction: + + + + 1071 + + + + controlField + + + + 1072 + + + + controlField + + + + 1073 + + + + field + + + + 1074 + + + + initialFirstResponder + + + + 1075 + + + + nextKeyView + + + + 1076 + + + + nextKeyView + + + + 1077 + + + + nextKeyView + + + + 1078 + + + + syncWaitSpinner + + + + 1084 + + + + syncWaitPanel + + + + 1085 + + + + syncWaitQuit: + + + + 1086 + + + + showHelpDocument: + + + + 1089 + + + + showHelpDocument: + + + + 1090 + + + + showHelpDocument: + + + + 1091 + + + + showHelpDocument: + + + + 1092 + + + + uppercaseWord: + + + + 1098 + + + + lowercaseWord: + + + + 1099 + + + + capitalizeWord: + + + + 1100 + + + + strikethroughNV: + + + + 1112 + + + + deleteNote: + + + + 1114 + + + + switchViewLayout: + + + + 1117 + + + + copyNoteLink: + + + + 1119 + + + + toggleCollapse: + + + + 1129 + + + + delegate + + + + 1164 + + + + statBarMenu + + + + 1165 + + + + bringFocusToControlField: + + + + 1167 + + + + tagNote: + + + + 1169 + + + + renameNote: + + + + 1171 + + + + deleteNote: + + + + 1173 + + + + toggleCollapse: + + + + 1175 + + + + switchViewLayout: + + + + 1177 + + + + showPreferencesWindow: + + + + 1181 + + + + terminate: + + + + 1184 + + + + defaultStyle: + + + + 1196 + + + + fixFileEncoding: + + + + 1197 + + + + strikethroughNV: + + + + 1198 + + + + shiftRightAction: + + + + 1199 + + + + shiftLeftAction: + + + + 1200 + + + + italic: + + + + 1201 + + + + bold: + + + + 1202 + + + + revealNote: + + + + 1208 + + + + revealNote: + + + + 1222 + + + + setBWColorScheme: + + + + 1223 + + + + setBWColorScheme: + + + + 1224 + + + + setLCColorScheme: + + + + 1225 + + + + setLCColorScheme: + + + + 1226 + + + + setUserColorScheme: + + + + 1227 + + + + setUserColorScheme: + + + + 1228 + + + + performFindPanelAction: + + + + 1233 + + + + performFindPanelAction: + + + + 1234 + + + + performFindPanelAction: + + + + 1235 + + + + performFindPanelAction: + + + + 1236 + + + + togglePreview: + + + + 1245 + + + + toggleSourceView: + + + + 1246 + + + + savePreview: + + + + 1247 + + + + selectPreviewMode: + + + + 1248 + + + + textilePreview + + + + 1250 + + + + multiMarkdownPreview + + + + 1251 + + + + selectPreviewMode: + + + + 1252 + + + + orderFrontStandardAboutPanel: + + + + 1254 + + + + toggleWordCount: + + + + 1257 + + + + value: values.ShowWordCount + + + + + + value: values.ShowWordCount + value + values.ShowWordCount + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 1268 + + + + wordCounter + + + + 1272 + + + + delegate + + + + 1273 + + + + previewToggler + + + + 1274 + + + + notesScrollView + + + + 1275 + + + + textScrollView + + + + 1276 + + + + mainView + + + + 1283 + + + + showHelpDocument: + + + + 1289 + + + + showHelpDocument: + + + + 1290 + + + + showHelpDocument: + + + + 1291 + + + + printPreview: + + + + 1294 + + + + printPreviewItem + + + + 1295 + + + + lockPreview: + + + + 1296 + + + + lockNoteItem + + + + 1297 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 21 + + + YES + + + + notation + + + 2 + + + YES + + + + + 29 + + + YES + + + + + + + + + + + + MainMenu + + + 19 + + + YES + + + + + + 24 + + + YES + + + + + + + + + + 5 + + + + + 23 + + + + + 92 + + + + + 197 + + + + + 489 + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + + + 58 + + + + + 129 + + + + + 131 + + + YES + + + + + + 130 + + + + + 134 + + + + + 136 + + + + + 143 + + + + + 144 + + + + + 145 + + + + + 149 + + + + + 150 + + + + + 196 + + + + + 990 + + + + + 991 + + + + + 83 + + + YES + + + + + + 81 + + + YES + + + + + + + + + + + + + + + + + 77 + + + + + 78 + + + + + 79 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + + + 553 + + + + + 554 + + + + + 994 + + + + + 103 + + + YES + + + + + + 106 + + + YES + + + + + + + + + + + + + + 111 + + + + + 1053 + + + + + 1055 + + + + + 1057 + + + + + 1058 + + + + + 1087 + + + + + 163 + + + YES + + + + + + 169 + + + YES + + + + + + + + + + + + + + + + + + + + 156 + + + + + 157 + + + + + 158 + + + + + 160 + + + + + 168 + + + YES + + + + + + 159 + + + YES + + + + + + + + + 154 + + + + + 161 + + + + + 162 + + + + + 167 + + + + + 171 + + + + + 172 + + + + + 173 + + + + + 184 + + + YES + + + + + + 185 + + + YES + + + + + + + + 187 + + + + + 189 + + + + + 191 + + + + + 550 + + + + + 557 + + + + + 771 + + + + + 1000 + + + + + 1093 + + + YES + + + + + + 1094 + + + YES + + + + + + + + 1095 + + + + + 1096 + + + + + 1097 + + + + + 382 + + + YES + + + + + + 383 + + + YES + + + + + + + + + + + + + + + + + + + 386 + + + YES + + + + + + 387 + + + YES + + + + + + 388 + + + + + 389 + + + YES + + + + + + 390 + + + YES + + + + + + 391 + + + + + 507 + + + + + 508 + + + + + 520 + + + + + 521 + + + + + 522 + + + + + 1061 + + + + + 1062 + + + + + 397 + + + YES + + + + + + 398 + + + YES + + + + + + + + + + + + + + 534 + + + + + 563 + + + + + 564 + + + + + 565 + + + + + 574 + + + + + 575 + + + + + 576 + + + + + 577 + + + + + 977 + + + + + 996 + + + YES + + + + + + 997 + + + YES + + + + + + 998 + + + + + 213 + + + AppController + + + 341 + + + YES + + + + editorStatus + + + 342 + + + YES + + + + + + 452 + + + Font Manager + + + 1066 + + + YES + + + + + fieldcustomview + + + 1067 + + + YES + + + + + + 1079 + + + YES + + + + quit waiting + + + 1080 + + + YES + + + + + + + + 1081 + + + YES + + + + + + 1082 + + + + + 1083 + + + YES + + + + + + 1102 + + + + + 1103 + + + + + 1104 + + + + + 1105 + + + + + -3 + + + Application + + + 1115 + + + + + 1116 + + + + + 1118 + + + + + 1127 + + + + + 1130 + + + YES + + + + + + + + + + + + + + + + + + + + + 1131 + + + YES + + + + + + 1135 + + + + + 1138 + + + + + 1139 + + + + + 1159 + + + YES + + + + + + + + 1160 + + + + + 1161 + + + + + 1162 + + + + + 1163 + + + + + 1166 + + + + + 1168 + + + + + 1170 + + + + + 1172 + + + + + 1176 + + + + + 1180 + + + + + 1183 + + + + + 1185 + + + YES + + + + + + 1186 + + + YES + + + + + + + + + + + + + + 1187 + + + + + 1188 + + + + + 1189 + + + + + 1190 + + + + + 1191 + + + + + 1192 + + + + + 1193 + + + + + 1194 + + + + + 1195 + + + + + 1203 + + + YES + + + + + + 1204 + + + YES + + + + + + 1205 + + + + + 1206 + + + + + 1207 + + + + + 1210 + + + YES + + + + + + 1211 + + + YES + + + + + + + + 1212 + + + + + 1213 + + + + + 1214 + + + + + 1221 + + + + + 1237 + + + YES + + + + + + 1238 + + + YES + + + + + + + + + + + + + 1239 + + + + + 1240 + + + + + 1241 + + + + + 1242 + + + + + 1243 + + + + + 1244 + + + + + 1255 + + + + + 1258 + + + + + 1270 + + + YES + + + + Word Count Token + + + 1271 + + + + + 1016 + + + YES + + + + + + Scroll View - Linking Editor + + + 1017 + + + Linking Editor + + + 1109 + + + Scroller + + + 1110 + + + + + 1013 + + + YES + + + + + + + + + 1014 + + + + + 1106 + + + + + 1107 + + + + + 1108 + + + + + 1174 + + + + + 1284 + + + + + 1285 + + + + + 1286 + + + + + 1292 + + + + + 1293 + + + + + + + YES + + YES + -3.IBPluginDependency + 1000.IBPluginDependency + 1000.ImportedFromIB2 + 1013.CustomClassName + 1013.IBPluginDependency + 1013.IBViewBoundsToFrameTransform + 1013.ImportedFromIB2 + 1014.CustomClassName + 1014.IBPluginDependency + 1014.ImportedFromIB2 + 1016.CustomClassName + 1016.IBPluginDependency + 1016.IBViewBoundsToFrameTransform + 1016.ImportedFromIB2 + 1017.CustomClassName + 1017.IBPluginDependency + 1017.ImportedFromIB2 + 103.IBPluginDependency + 103.ImportedFromIB2 + 1053.IBPluginDependency + 1053.ImportedFromIB2 + 1055.IBPluginDependency + 1055.ImportedFromIB2 + 1057.IBPluginDependency + 1057.ImportedFromIB2 + 1058.IBPluginDependency + 1058.ImportedFromIB2 + 106.IBPluginDependency + 106.ImportedFromIB2 + 1061.IBPluginDependency + 1061.ImportedFromIB2 + 1062.IBPluginDependency + 1062.ImportedFromIB2 + 1066.IBEditorWindowLastContentRect + 1066.IBPluginDependency + 1066.ImportedFromIB2 + 1067.CustomClassName + 1067.IBPluginDependency + 1067.ImportedFromIB2 + 1079.IBEditorWindowLastContentRect + 1079.IBPluginDependency + 1079.IBWindowTemplateEditedContentRect + 1079.ImportedFromIB2 + 1080.IBPluginDependency + 1080.ImportedFromIB2 + 1081.IBPluginDependency + 1081.ImportedFromIB2 + 1082.IBPluginDependency + 1082.ImportedFromIB2 + 1083.IBPluginDependency + 1083.ImportedFromIB2 + 1087.IBPluginDependency + 1087.ImportedFromIB2 + 1093.IBPluginDependency + 1093.ImportedFromIB2 + 1094.IBPluginDependency + 1094.ImportedFromIB2 + 1095.IBPluginDependency + 1095.ImportedFromIB2 + 1096.IBPluginDependency + 1096.ImportedFromIB2 + 1097.IBPluginDependency + 1097.ImportedFromIB2 + 1102.IBPluginDependency + 1103.IBPluginDependency + 1104.IBPluginDependency + 1105.IBPluginDependency + 1106.IBPluginDependency + 1106.IBShouldRemoveOnLegacySave + 1107.IBPluginDependency + 1107.IBShouldRemoveOnLegacySave + 1108.CustomClassName + 1108.IBPluginDependency + 1108.IBShouldRemoveOnLegacySave + 1109.IBPluginDependency + 1109.IBShouldRemoveOnLegacySave + 111.IBPluginDependency + 111.ImportedFromIB2 + 1110.IBPluginDependency + 1110.IBShouldRemoveOnLegacySave + 1115.IBPluginDependency + 1116.IBPluginDependency + 1118.IBPluginDependency + 1127.IBPluginDependency + 1130.IBEditorWindowLastContentRect + 1130.IBPluginDependency + 1131.IBPluginDependency + 1135.IBPluginDependency + 1138.IBPluginDependency + 1139.IBPluginDependency + 1159.IBEditorWindowLastContentRect + 1159.IBPluginDependency + 1160.IBPluginDependency + 1160.ImportedFromIB2 + 1161.IBPluginDependency + 1161.ImportedFromIB2 + 1162.IBPluginDependency + 1162.ImportedFromIB2 + 1163.IBEditorWindowLastContentRect + 1163.IBPluginDependency + 1163.IBViewBoundsToFrameTransform + 1166.IBPluginDependency + 1166.ImportedFromIB2 + 1168.IBPluginDependency + 1168.ImportedFromIB2 + 1170.IBPluginDependency + 1170.ImportedFromIB2 + 1172.IBPluginDependency + 1172.ImportedFromIB2 + 1174.IBPluginDependency + 1176.IBPluginDependency + 1180.IBPluginDependency + 1180.ImportedFromIB2 + 1183.IBPluginDependency + 1183.ImportedFromIB2 + 1185.IBPluginDependency + 1185.ImportedFromIB2 + 1186.IBEditorWindowLastContentRect + 1186.IBPluginDependency + 1186.ImportedFromIB2 + 1187.IBPluginDependency + 1187.ImportedFromIB2 + 1188.IBPluginDependency + 1188.ImportedFromIB2 + 1189.IBPluginDependency + 1189.ImportedFromIB2 + 1190.IBPluginDependency + 1190.ImportedFromIB2 + 1191.IBPluginDependency + 1191.ImportedFromIB2 + 1192.IBPluginDependency + 1192.ImportedFromIB2 + 1193.IBPluginDependency + 1193.ImportedFromIB2 + 1194.IBPluginDependency + 1194.ImportedFromIB2 + 1195.IBPluginDependency + 1195.ImportedFromIB2 + 1203.IBPluginDependency + 1203.ImportedFromIB2 + 1204.IBEditorWindowLastContentRect + 1204.IBPluginDependency + 1204.ImportedFromIB2 + 1205.IBPluginDependency + 1205.ImportedFromIB2 + 1206.IBPluginDependency + 1206.ImportedFromIB2 + 1207.IBPluginDependency + 1210.IBPluginDependency + 1211.IBEditorWindowLastContentRect + 1211.IBPluginDependency + 1212.IBPluginDependency + 1212.ImportedFromIB2 + 1213.IBPluginDependency + 1213.ImportedFromIB2 + 1214.IBPluginDependency + 1214.ImportedFromIB2 + 1221.IBPluginDependency + 1237.IBPluginDependency + 1238.IBEditorWindowLastContentRect + 1238.IBPluginDependency + 1239.IBPluginDependency + 1240.IBPluginDependency + 1241.IBPluginDependency + 1242.IBPluginDependency + 1243.IBPluginDependency + 1244.IBPluginDependency + 1255.IBPluginDependency + 1255.ImportedFromIB2 + 1270.CustomClassName + 1270.IBPluginDependency + 1270.IBViewBoundsToFrameTransform + 1271.IBPluginDependency + 1284.IBPluginDependency + 1285.IBPluginDependency + 1286.IBPluginDependency + 129.IBPluginDependency + 129.ImportedFromIB2 + 1292.IBPluginDependency + 1293.IBPluginDependency + 130.IBPluginDependency + 130.ImportedFromIB2 + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 154.IBPluginDependency + 154.ImportedFromIB2 + 156.IBPluginDependency + 156.ImportedFromIB2 + 157.IBPluginDependency + 157.ImportedFromIB2 + 158.IBPluginDependency + 158.ImportedFromIB2 + 159.IBEditorWindowLastContentRect + 159.IBPluginDependency + 159.ImportedFromIB2 + 160.IBPluginDependency + 160.ImportedFromIB2 + 161.IBPluginDependency + 161.ImportedFromIB2 + 162.IBPluginDependency + 162.ImportedFromIB2 + 163.IBPluginDependency + 163.ImportedFromIB2 + 167.IBPluginDependency + 167.ImportedFromIB2 + 168.IBPluginDependency + 168.ImportedFromIB2 + 169.IBEditorWindowLastContentRect + 169.IBPluginDependency + 169.ImportedFromIB2 + 171.IBPluginDependency + 171.ImportedFromIB2 + 172.IBPluginDependency + 172.ImportedFromIB2 + 173.IBPluginDependency + 173.ImportedFromIB2 + 184.IBPluginDependency + 184.ImportedFromIB2 + 185.IBPluginDependency + 185.ImportedFromIB2 + 187.IBPluginDependency + 187.ImportedFromIB2 + 189.IBPluginDependency + 189.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 191.IBPluginDependency + 191.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 197.IBPluginDependency + 197.ImportedFromIB2 + 2.CustomClassName + 2.IBPluginDependency + 2.ImportedFromIB2 + 21.IBEditorWindowLastContentRect + 21.IBPluginDependency + 21.IBWindowTemplateEditedContentRect + 21.ImportedFromIB2 + 21.NSWindowTemplate.visibleAtLaunch + 213.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 24.IBEditorWindowLastContentRect + 24.IBPluginDependency + 24.ImportedFromIB2 + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 341.IBPluginDependency + 341.ImportedFromIB2 + 342.IBPluginDependency + 342.ImportedFromIB2 + 382.IBPluginDependency + 382.ImportedFromIB2 + 383.IBEditorWindowLastContentRect + 383.IBPluginDependency + 383.ImportedFromIB2 + 386.IBPluginDependency + 386.ImportedFromIB2 + 387.IBEditorWindowLastContentRect + 387.IBPluginDependency + 387.ImportedFromIB2 + 388.IBPluginDependency + 388.ImportedFromIB2 + 389.IBPluginDependency + 389.ImportedFromIB2 + 390.IBEditorWindowLastContentRect + 390.IBPluginDependency + 390.ImportedFromIB2 + 391.IBPluginDependency + 391.ImportedFromIB2 + 392.IBPluginDependency + 392.ImportedFromIB2 + 393.IBPluginDependency + 393.ImportedFromIB2 + 394.IBPluginDependency + 394.ImportedFromIB2 + 395.IBPluginDependency + 395.ImportedFromIB2 + 396.IBPluginDependency + 396.ImportedFromIB2 + 397.IBPluginDependency + 397.ImportedFromIB2 + 398.IBEditorWindowLastContentRect + 398.IBPluginDependency + 398.ImportedFromIB2 + 452.ImportedFromIB2 + 489.IBPluginDependency + 489.ImportedFromIB2 + 5.IBPluginDependency + 5.ImportedFromIB2 + 507.IBPluginDependency + 507.ImportedFromIB2 + 508.IBPluginDependency + 508.ImportedFromIB2 + 520.IBPluginDependency + 520.ImportedFromIB2 + 521.IBPluginDependency + 521.ImportedFromIB2 + 522.IBPluginDependency + 522.ImportedFromIB2 + 534.IBPluginDependency + 534.ImportedFromIB2 + 550.IBPluginDependency + 550.ImportedFromIB2 + 553.IBPluginDependency + 553.ImportedFromIB2 + 554.IBPluginDependency + 554.ImportedFromIB2 + 557.IBPluginDependency + 557.ImportedFromIB2 + 56.IBPluginDependency + 56.ImportedFromIB2 + 563.IBPluginDependency + 563.ImportedFromIB2 + 564.IBPluginDependency + 564.ImportedFromIB2 + 565.IBPluginDependency + 565.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 574.IBPluginDependency + 574.ImportedFromIB2 + 575.IBPluginDependency + 575.ImportedFromIB2 + 576.IBPluginDependency + 576.ImportedFromIB2 + 577.IBPluginDependency + 577.ImportedFromIB2 + 58.IBPluginDependency + 58.ImportedFromIB2 + 77.IBPluginDependency + 77.ImportedFromIB2 + 771.IBPluginDependency + 771.ImportedFromIB2 + 78.IBPluginDependency + 78.ImportedFromIB2 + 79.IBPluginDependency + 79.ImportedFromIB2 + 81.IBEditorWindowLastContentRect + 81.IBPluginDependency + 81.ImportedFromIB2 + 83.IBPluginDependency + 83.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + 977.IBPluginDependency + 977.ImportedFromIB2 + 990.IBPluginDependency + 990.ImportedFromIB2 + 991.IBPluginDependency + 991.ImportedFromIB2 + 994.IBPluginDependency + 994.ImportedFromIB2 + 996.IBPluginDependency + 996.ImportedFromIB2 + 997.IBEditorWindowLastContentRect + 997.IBPluginDependency + 997.ImportedFromIB2 + 998.IBPluginDependency + 998.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + AugmentedScrollView + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAAAAAAAAwxcAAA + + + NotesTableView + com.apple.InterfaceBuilder.CocoaPlugin + + ETScrollView + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAAAAAAAAw5cAAA + + + LinkingEditor + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{212, 748}, {381, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + DualField + com.apple.InterfaceBuilder.CocoaPlugin + + {{329, 739}, {353, 106}} + com.apple.InterfaceBuilder.CocoaPlugin + {{329, 739}, {353, 106}} + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + HeaderViewWithMenu + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{502, 140}, {283, 293}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{785, 190}, {180, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{1277, 760}, {163, 96}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{856, 673}, {210, 163}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{785, 410}, {97, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{575, 370}, {180, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{508, 655}, {249, 113}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + WordCountToken + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAAAAAAAAwaAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{459, 180}, {238, 83}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{254, 495}, {214, 273}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + ETContentView + com.apple.InterfaceBuilder.CocoaPlugin + + {{702, 301}, {397, 464}} + com.apple.InterfaceBuilder.CocoaPlugin + {{702, 301}, {397, 464}} + + + + com.apple.InterfaceBuilder.CocoaPlugin + + {{578, 675}, {194, 93}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{37, 768}, {673, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{298, 525}, {277, 243}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{575, 675}, {97, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{563, 646}, {97, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{442, 605}, {210, 163}} + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{49, 555}, {264, 213}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{204, 555}, {222, 213}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{348, 745}, {97, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + + + + YES + + + + + 1297 + + + + YES + + AppController + NSObject + + YES + + YES + bringFocusToControlField: + copyNoteLink: + deleteNote: + exportNote: + fieldAction: + importNotes: + multiTag: + openFileInEditor: + printNote: + printPreview: + renameNote: + revealNote: + savePreview: + selectPreviewMode: + setBWColorScheme: + setLCColorScheme: + setUserColorScheme: + sharePreview: + showHelpDocument: + showPreferencesWindow: + switchViewLayout: + syncWaitQuit: + tagNote: + toggleCollapse: + toggleFullscreen: + toggleNVActivation: + togglePreview: + toggleSourceView: + toggleWordCount: + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + bringFocusToControlField: + copyNoteLink: + deleteNote: + exportNote: + fieldAction: + importNotes: + multiTag: + openFileInEditor: + printNote: + printPreview: + renameNote: + revealNote: + savePreview: + selectPreviewMode: + setBWColorScheme: + setLCColorScheme: + setUserColorScheme: + sharePreview: + showHelpDocument: + showPreferencesWindow: + switchViewLayout: + syncWaitQuit: + tagNote: + toggleCollapse: + toggleFullscreen: + toggleNVActivation: + togglePreview: + toggleSourceView: + toggleWordCount: + + + YES + + bringFocusToControlField: + id + + + copyNoteLink: + id + + + deleteNote: + id + + + exportNote: + id + + + fieldAction: + id + + + importNotes: + id + + + multiTag: + id + + + openFileInEditor: + id + + + printNote: + id + + + printPreview: + id + + + renameNote: + id + + + revealNote: + id + + + savePreview: + id + + + selectPreviewMode: + id + + + setBWColorScheme: + id + + + setLCColorScheme: + id + + + setUserColorScheme: + id + + + sharePreview: + id + + + showHelpDocument: + id + + + showPreferencesWindow: + id + + + switchViewLayout: + id + + + syncWaitQuit: + id + + + tagNote: + id + + + toggleCollapse: + id + + + toggleFullscreen: + id + + + toggleNVActivation: + id + + + togglePreview: + id + + + toggleSourceView: + id + + + toggleWordCount: + id + + + + + YES + + YES + editorStatusView + field + mainView + multiMarkdownPreview + notesScrollView + notesTableView + previewToggler + printPreviewItem + savePreviewItem + sparkleUpdateItem + statBarMenu + syncWaitPanel + syncWaitSpinner + textScrollView + textView + textilePreview + window + wordCounter + + + YES + EmptyView + DualField + ETContentView + NSMenuItem + AugmentedScrollView + NotesTableView + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenu + NSPanel + NSProgressIndicator + NSScrollView + LinkingEditor + NSMenuItem + NSWindow + WordCountToken + + + + YES + + YES + editorStatusView + field + mainView + multiMarkdownPreview + notesScrollView + notesTableView + previewToggler + printPreviewItem + savePreviewItem + sparkleUpdateItem + statBarMenu + syncWaitPanel + syncWaitSpinner + textScrollView + textView + textilePreview + window + wordCounter + + + YES + + editorStatusView + EmptyView + + + field + DualField + + + mainView + ETContentView + + + multiMarkdownPreview + NSMenuItem + + + notesScrollView + AugmentedScrollView + + + notesTableView + NotesTableView + + + previewToggler + NSMenuItem + + + printPreviewItem + NSMenuItem + + + savePreviewItem + NSMenuItem + + + sparkleUpdateItem + NSMenuItem + + + statBarMenu + NSMenu + + + syncWaitPanel + NSPanel + + + syncWaitSpinner + NSProgressIndicator + + + textScrollView + NSScrollView + + + textView + LinkingEditor + + + textilePreview + NSMenuItem + + + window + NSWindow + + + wordCounter + WordCountToken + + + + + IBProjectSource + ./Classes/AppController.h + + + + AugmentedScrollView + NSScrollView + + IBProjectSource + ./Classes/AugmentedScrollView.h + + + + DualField + NSTextField + + notesTable + NSTableView + + + notesTable + + notesTable + NSTableView + + + + IBProjectSource + ./Classes/DualField.h + + + + ETContentView + NSView + + IBProjectSource + ./Classes/ETContentView.h + + + + ETScrollView + NSScrollView + + IBProjectSource + ./Classes/ETScrollView.h + + + + EmptyView + NSView + + labelText + NSTextField + + + labelText + + labelText + NSTextField + + + + IBProjectSource + ./Classes/EmptyView.h + + + + FirstResponder + + YES + + YES + bold: + defaultStyle: + deleteToBeginningOfLine: + deleteWordBackward: + italic: + shiftLeftAction: + shiftRightAction: + strikethroughNV: + + + YES + id + id + id + id + id + id + id + id + + + + YES + + YES + bold: + defaultStyle: + deleteToBeginningOfLine: + deleteWordBackward: + italic: + shiftLeftAction: + shiftRightAction: + strikethroughNV: + + + YES + + bold: + id + + + defaultStyle: + id + + + deleteToBeginningOfLine: + id + + + deleteWordBackward: + id + + + italic: + id + + + shiftLeftAction: + id + + + shiftRightAction: + id + + + strikethroughNV: + id + + + + + IBUserSource + + + + + HeaderViewWithMenu + NSTableHeaderView + + IBProjectSource + ./Classes/HeaderViewWithMenu.h + + + + LinkingEditor + NSTextView + + YES + + YES + shiftLeftAction: + shiftRightAction: + + + YES + id + id + + + + YES + + YES + shiftLeftAction: + shiftRightAction: + + + YES + + shiftLeftAction: + id + + + shiftRightAction: + id + + + + + YES + + YES + controlField + notesTableView + + + YES + NSTextField + NotesTableView + + + + YES + + YES + controlField + notesTableView + + + YES + + controlField + NSTextField + + + notesTableView + NotesTableView + + + + + IBProjectSource + ./Classes/LinkingEditor.h + + + + NSDocument + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + + printDocument: + id + + + revertDocumentToSaved: + id + + + runPageLayout: + id + + + saveDocument: + id + + + saveDocumentAs: + id + + + saveDocumentTo: + id + + + + + IBProjectSource + ./Classes/NSDocument.h + + + + NotesTableView + NSTableView + + YES + + YES + actionHideShowColumn: + toggleNoteBodyPreviews: + + + YES + id + id + + + + YES + + YES + actionHideShowColumn: + toggleNoteBodyPreviews: + + + YES + + actionHideShowColumn: + id + + + toggleNoteBodyPreviews: + id + + + + + controlField + NSTextField + + + controlField + + controlField + NSTextField + + + + IBProjectSource + ./Classes/NotesTableView.h + + + + StatusItemView + NSView + + IBProjectSource + ./Classes/StatusItemView.h + + + + WebView + + reloadFromOrigin: + id + + + reloadFromOrigin: + + reloadFromOrigin: + id + + + + IBProjectSource + ./Classes/WebView.h + + + + WordCountToken + NSTokenField + + IBProjectSource + ./Classes/WordCountToken.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/English.lproj/MarkupPreview.xib b/English.lproj/MarkupPreview.xib new file mode 100644 index 00000000..67bd4650 --- /dev/null +++ b/English.lproj/MarkupPreview.xib @@ -0,0 +1,1211 @@ + + + + 1050 + 10J869 + 1305 + 1038.35 + 461.00 + + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + YES + 1305 + 30 + + + + YES + NSTextView + NSScroller + NSButton + NSScrollView + NSButtonCell + NSTextFieldCell + NSTabView + WebView + NSCustomObject + NSTabViewItem + NSWindowTemplate + NSView + NSTextField + NSCustomView + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + YES + + YES + + + + + YES + + PreviewController + + + FirstResponder + + + NSApplication + + + + 268 + + YES + + + 268 + {{4, 61}, {12, 13}} + + + YES + + 67239424 + 134512640 + + + LucidaGrande + 9 + 3614 + + + 138690815 + 6 + + NSImage + TabClose_Front_Rollover + + + NSImage + TabClose_Front_Pressed + + + Gw + 400 + 75 + + + + + 264 + {{0, 47}, {256, 14}} + + + YES + + 68288064 + 138544128 + URL in clipboard + + LucidaGrande + 11 + 3100 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 1 + MC45OTk5MDMwODI4IDEgMC45OTk4MzAwMDc2AA + + + + + {256, 78} + + + NSView + + + + 268 + + YES + + + 268 + {{-3, 43}, {244, 14}} + + + YES + + 68288064 + 138544128 + Share note online via Peggd? + + + + + 1 + MC45OTk5MDMwODI4IDEgMC45OTk4MzAwMDc2AA + + + + + {238, 65} + + + NSView + + + 27 + 2 + {{948, 217}, {445, 528}} + -461896704 + Preview + NSPanel + + {350, 400} + + + 256 + + YES + + + 4114 + {{0, 34}, {445, 494}} + + + + YES + + 1 + + + 256 + + YES + + + 274 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple URL pasteboard type + Apple Web Archive pasteboard type + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + WebURLsWithTitlesPboardType + public.png + public.url + public.url-name + + + {445, 494} + + + + + + previewWebView + + YES + + + + + NO + YES + + + {445, 494} + + + + Preview + + + + + 2 + + + 256 + + YES + + + 274 + + YES + + + 2304 + + YES + + + 2322 + {{0, 61}, {445, 14}} + + + + + + + + + + + + YES + + + 134 + + + + 445 + 1 + + + 11521 + 0 + + + 3 + MQA + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + + + 6 + System + selectedTextColor + + 3 + MAA + + + + + + + YES + + YES + NSColor + NSCursor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + + 6 + {463, 1e+07} + {223, 0} + + + + {445, 494} + + + + + + {4, -5} + 1 + + 4 + + + + -2147483392 + {{429, 1}, {15, 492}} + + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {445, 494} + + + 528 + + + + + + {445, 494} + + + Source + + + + + + + LucidaGrande + 13 + 1044 + + 6 + YES + + YES + + + + + + 289 + {{295, 7}, {33, 19}} + + + YES + 0.80000000000000004 + 2 + YES + + 67239424 + 134217728 + + + LucidaGrande-Bold + 12 + 16 + + + -1228128001 + 402653357 + + NSImage + HUDIconLock + + + L + 400 + 75 + + + + + 289 + {{403, 6}, {29, 19}} + + + YES + 0.80000000000000004 + 2 + YES + + 67239424 + 134217728 + + + + -2033958657 + 268435693 + + NSImage + HUDIconSave + + + S + 400 + 75 + + + + + 289 + {{365, 6}, {33, 19}} + + + YES + 0.80000000000000004 + 2 + YES + + 67239424 + 134217728 + + + + -2033958657 + 173 + + NSImage + HUDIconShare + + + + 400 + 75 + + + + + 289 + {{329, 6}, {33, 19}} + + + YES + 0.80000000000000004 + 2 + YES + + 67239424 + 134217728 + + + + -2033958657 + 402653357 + + NSImage + HUDIconPrint + + + P + 400 + 75 + + + + + 292 + {{10, 7}, {99, 19}} + + + YES + + -2080244224 + 134217728 + View Source + + LucidaGrande + 12 + 16 + + + -2038021889 + 164 + + + + 400 + 75 + + + + {{7, 11}, {445, 528}} + + + + {{0, 0}, {1920, 1058}} + {350, 416} + {1e+13, 1e+13} + PreviewPanel + + + + + YES + + + shareNotification + + + + 138 + + + + shareConfirmation + + + + 169 + + + + urlTextField + + + + 191 + + + + hideShareURL: + + + + 194 + + + + delegate + + + + 241 + + + + window + + + + 242 + + + + tabView + + + + 243 + + + + frameLoadDelegate + + + + 244 + + + + policyDelegate + + + + 245 + + + + resourceLoadDelegate + + + + 246 + + + + UIDelegate + + + + 247 + + + + preview + + + + 248 + + + + sourceView + + + + 249 + + + + makePreviewSticky: + + + + 269 + + + + saveHTML: + + + + 274 + + + + shareAsk: + + + + 275 + + + + printPreview: + + + + 278 + + + + printPreviewButton + + + + 280 + + + + shareButton + + + + 281 + + + + saveButton + + + + 282 + + + + stickyPreviewButton + + + + 283 + + + + switchTabs: + + + + 286 + + + + tabSwitcher + + + + 287 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 133 + + + YES + + + + + Share URL + + + 157 + + + YES + + + + Confirm Share + + + 189 + + + YES + + + + + + 190 + + + + + 192 + + + YES + + + + + + 193 + + + + + 200 + + + YES + + + + + + 201 + + + + + 214 + + + YES + + + + Panel - Preview + + + 215 + + + YES + + + + + + + + + + + 216 + + + YES + + + + + + + 217 + + + YES + + + + + + 218 + + + YES + + + + + + 219 + + + YES + + + + + + 220 + + + YES + + + + + + 225 + + + YES + + + + + + + + 226 + + + + + 227 + + + + + 228 + + + + + 229 + + + + + 261 + + + YES + + + + + + 262 + + + + + 263 + + + YES + + + + + + 264 + + + + + 265 + + + YES + + + + + + 266 + + + + + 267 + + + YES + + + + + + 268 + + + + + 284 + + + YES + + + + + + 285 + + + + + + + YES + + YES + -2.IBAttributePlaceholdersKey + 133.IBEditorWindowLastContentRect + 133.IBPluginDependency + 133.IBViewBoundsToFrameTransform + 157.IBEditorWindowLastContentRect + 157.IBPluginDependency + 157.IBViewBoundsToFrameTransform + 189.IBPluginDependency + 189.IBViewBoundsToFrameTransform + 190.IBPluginDependency + 192.IBPluginDependency + 192.IBViewBoundsToFrameTransform + 193.IBPluginDependency + 200.IBPluginDependency + 200.IBViewBoundsToFrameTransform + 201.IBPluginDependency + 214.IBPluginDependency + 214.NSWindowTemplate.visibleAtLaunch + 215.IBPluginDependency + 216.IBPluginDependency + 217.IBPluginDependency + 218.IBPluginDependency + 225.IBPluginDependency + 226.IBPluginDependency + 227.IBPluginDependency + 228.IBPluginDependency + 229.IBPluginDependency + 261.IBAttributePlaceholdersKey + 261.IBPluginDependency + 261.IBViewIntegration.shadowBlurRadius + 261.IBViewIntegration.shadowColor + 261.IBViewIntegration.shadowOffsetHeight + 261.IBViewIntegration.shadowOffsetWidth + 262.IBPluginDependency + 263.IBAttributePlaceholdersKey + 263.IBPluginDependency + 264.IBPluginDependency + 265.IBAttributePlaceholdersKey + 265.IBPluginDependency + 266.IBPluginDependency + 267.IBAttributePlaceholdersKey + 267.IBPluginDependency + 268.IBPluginDependency + 284.IBPluginDependency + 285.IBPluginDependency + + + YES + + YES + + + + {{471, 675}, {206, 55}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{499, 564}, {238, 65}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCPAAAwjAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDNAAAwkAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAADAQAAAwlwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + ToolTip + + ToolTip + + Lock note to preview + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Save Preview + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Share on Peggd + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Print/PDF + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 287 + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + HUDIconLock + HUDIconPrint + HUDIconSave + HUDIconShare + TabClose_Front_Pressed + TabClose_Front_Rollover + + + YES + {25, 24} + {25, 24} + {25, 24} + {25, 24} + {12, 13} + {12, 13} + + + + diff --git a/English.lproj/NotationPrefsView.nib/designable.nib b/English.lproj/NotationPrefsView.nib/designable.nib old mode 100755 new mode 100644 index 4cdf0c75..61a031f8 --- a/English.lproj/NotationPrefsView.nib/designable.nib +++ b/English.lproj/NotationPrefsView.nib/designable.nib @@ -2,25 +2,30 @@ 1030 - 10F569 - 804 - 1038.29 - 461.00 + 10J567 + 740 + 1038.35 + 462.00 com.apple.InterfaceBuilder.CocoaPlugin - 804 + 740 YES - + YES com.apple.InterfaceBuilder.CocoaPlugin - PluginDependencyRecalculationVersion - + YES + + YES + + + YES + YES @@ -48,7 +53,7 @@ sync - + 256 YES @@ -452,6 +457,7 @@ {{10, 33}, {373, 316}} + Synchronization @@ -460,7 +466,7 @@ storage - + 256 YES @@ -840,6 +846,36 @@ 25 + + + 292 + {{124, 42}, {23, 22}} + + YES + + 604110336 + 134217728 + + + + 138690815 + 6 + + NSImage + MakeDefault + + + NSImage + MakeDefault_Pressed + + + + + + 200 + 25 + + 292 @@ -952,16 +988,16 @@ 400 75 - + - Zettelkasten (Markup Text Files) * + Single Database (Allow Encryption) + 1048576 2147483647 1 _popUpItemAction: - 6 YES @@ -971,17 +1007,7 @@ YES - - - Single Database (Allow Encryption) - - 1048576 - 2147483647 - - - _popUpItemAction: - - + YES @@ -1008,7 +1034,6 @@ 1 - Rich Text Format Files * @@ -1035,7 +1060,6 @@ - 3 3 YES YES @@ -1044,7 +1068,6 @@ {{10, 33}, {373, 316}} - Storage @@ -1431,14 +1454,14 @@ AAA - + 0 YES YES YES - + @@ -1856,34 +1879,48 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A 262 + + + makeDefaultExtensionButton + + + + 266 + + + + makeDefaultExtension: + + + + 267 + YES 0 - - YES - + -2 - + File's Owner -1 - + First Responder -3 - + Application @@ -1893,7 +1930,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A YES - + View @@ -1932,6 +1969,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A + @@ -2381,7 +2419,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A YES - + web hosting options @@ -2595,7 +2633,6 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A - @@ -2716,8 +2753,17 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A 263 - - + + + YES + + + + + + 264 + + @@ -2876,7 +2922,10 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A 26.IBPluginDependency 26.ImportedFromIB2 260.IBPluginDependency + 263.IBAttributePlaceholdersKey 263.IBPluginDependency + 263.ImportedFromIB2 + 264.IBPluginDependency 29.IBPluginDependency 29.ImportedFromIB2 30.IBPluginDependency @@ -2905,7 +2954,6 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A 5.IBPluginDependency 5.ImportedFromIB2 6.IBPluginDependency - 6.IBViewBoundsToFrameTransform 6.ImportedFromIB2 7.IBPluginDependency 7.ImportedFromIB2 @@ -2919,7 +2967,6 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A 93.ImportedFromIB2 98.IBPluginDependency 98.ImportedFromIB2 - 99.IBEditorWindowLastContentRect 99.IBPluginDependency 99.ImportedFromIB2 @@ -2984,7 +3031,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A ToolTip - Create an account. + Add new file type com.apple.InterfaceBuilder.CocoaPlugin @@ -3002,7 +3049,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A ToolTip - Remove an account. + Remove file extension com.apple.InterfaceBuilder.CocoaPlugin @@ -3026,7 +3073,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A ToolTip - Create an account. + Add new file extension com.apple.InterfaceBuilder.CocoaPlugin @@ -3036,7 +3083,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A ToolTip - Remove an account. + Remove file type com.apple.InterfaceBuilder.CocoaPlugin @@ -3104,6 +3151,16 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Set as default file extension for new notes + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3119,7 +3176,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A YES - + YES @@ -3135,13 +3192,10 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSSecureTextField com.apple.InterfaceBuilder.CocoaPlugin - {{418, 306}, {368, 346}} + {{390, 475}, {368, 346}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAADBQAAAw68AAA - com.apple.InterfaceBuilder.CocoaPlugin @@ -3155,14 +3209,13 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A com.apple.InterfaceBuilder.CocoaPlugin - {{447, 469}, {301, 113}} com.apple.InterfaceBuilder.CocoaPlugin YES - + YES @@ -3170,13 +3223,13 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A YES - + YES - 263 + 267 @@ -3188,13 +3241,6 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A storageFormatPopupButton NSPopUpButton - - storageFormatPopupButton - - storageFormatPopupButton - NSPopUpButton - - IBProjectSource NotationPrefsViewController.h @@ -3223,6 +3269,13 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A BookmarksController.h + + NSObject + + IBProjectSource + FastListDataSource.h + + NSObject @@ -3273,25 +3326,6 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A RBSplitView - - YES - - YES - didAdjustSubviews: - willAdjustSubviews: - - - YES - - didAdjustSubviews: - RBSplitView - - - willAdjustSubviews: - RBSplitView - - - IBProjectSource RBSplitView/RBSplitView.h @@ -3371,6 +3405,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A changedKeyLength: changedKeychainSettings: changedSecureTextEntry: + makeDefaultExtension: removeFromKeychain: removedExtension: removedType: @@ -3396,90 +3431,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A id id id - - - - YES - - YES - addedExtension: - addedType: - changePassphrase: - changedFileDeletionWarningSettings: - changedFileStorageFormat: - changedKeyLength: - changedKeychainSettings: - changedSecureTextEntry: - removeFromKeychain: - removedExtension: - removedType: - syncFrequencyChange: - toggledEncryption: - toggledSyncing: - visitSimplenoteSite: - - - YES - - addedExtension: - id - - - addedType: - id - - - changePassphrase: - id - - - changedFileDeletionWarningSettings: - id - - - changedFileStorageFormat: - id - - - changedKeyLength: - id - - - changedKeychainSettings: - id - - - changedSecureTextEntry: - id - - - removeFromKeychain: - id - - - removedExtension: - id - - - removedType: - id - - - syncFrequencyChange: - id - - - toggledEncryption: - id - - - toggledSyncing: - id - - - visitSimplenoteSite: - id - + id @@ -3495,6 +3447,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A fileAttributesHelpText keyLengthField keyLengthStepper + makeDefaultExtensionButton newExtensionButton newTypeButton passwordSettingsMatrix @@ -3526,6 +3479,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSStepper NSButton NSButton + NSButton NSMatrix NSButton NSButton @@ -3543,145 +3497,6 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSWindow - - YES - - YES - allowedExtensionsTable - allowedTypesTable - changePasswordButton - confirmFileDeletionButton - enableEncryptionButton - enabledSyncButton - fileAttributesHelpText - keyLengthField - keyLengthStepper - newExtensionButton - newTypeButton - passwordSettingsMatrix - removeExtensionButton - removeFromKeychainButton - removeTypeButton - secureTextEntryButton - storageFormatPopupButton - syncAccountField - syncEncAlertField - syncEncAlertView - syncPasswordField - syncingFrequency - verifyStatusField - verifyStatusImageView - view - webOptionsWindow - - - YES - - allowedExtensionsTable - NSTableView - - - allowedTypesTable - NSTableView - - - changePasswordButton - NSButton - - - confirmFileDeletionButton - NSButton - - - enableEncryptionButton - NSButton - - - enabledSyncButton - NSButton - - - fileAttributesHelpText - NSTextField - - - keyLengthField - NSTextField - - - keyLengthStepper - NSStepper - - - newExtensionButton - NSButton - - - newTypeButton - NSButton - - - passwordSettingsMatrix - NSMatrix - - - removeExtensionButton - NSButton - - - removeFromKeychainButton - NSButton - - - removeTypeButton - NSButton - - - secureTextEntryButton - NSButton - - - storageFormatPopupButton - NSPopUpButton - - - syncAccountField - NSTextField - - - syncEncAlertField - NSTextField - - - syncEncAlertView - NSImageView - - - syncPasswordField - NSTextField - - - syncingFrequency - NSPopUpButton - - - verifyStatusField - NSTextField - - - verifyStatusImageView - NSImageView - - - view - NSView - - - webOptionsWindow - NSWindow - - - @@ -3722,13 +3537,6 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A delegate id - - delegate - - delegate - id - - @@ -3757,21 +3565,21 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSApplication NSResponder - + IBFrameworkSource AppKit.framework/Headers/NSApplication.h NSApplication - + IBFrameworkSource AppKit.framework/Headers/NSApplicationScripting.h NSApplication - + IBFrameworkSource AppKit.framework/Headers/NSColorPanel.h @@ -3797,13 +3605,6 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - NSApplication - - IBFrameworkSource - BWToolkitFramework.framework/Headers/NSApplication+BWAdditions.h - - NSBox NSView @@ -3839,7 +3640,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSControl NSView - + IBFrameworkSource AppKit.framework/Headers/NSControl.h @@ -3879,7 +3680,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSMenu NSObject - + IBFrameworkSource AppKit.framework/Headers/NSMenu.h @@ -3887,7 +3688,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSMenuItem NSObject - + IBFrameworkSource AppKit.framework/Headers/NSMenuItem.h @@ -3909,19 +3710,19 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSObject - + NSObject - + NSObject - + NSObject - + NSObject @@ -3960,7 +3761,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSObject - + NSObject @@ -3992,7 +3793,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSObject - + IBFrameworkSource AppKit.framework/Headers/NSTableView.h @@ -4006,7 +3807,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSObject - + IBFrameworkSource AppKit.framework/Headers/NSView.h @@ -4370,7 +4171,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSTableView NSControl - + NSTextField @@ -4397,7 +4198,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSView - + NSView @@ -4409,14 +4210,7 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A NSView NSResponder - - - - NSView - - IBFrameworkSource - BWToolkitFramework.framework/Headers/NSView+BWAdditions.h - + NSWindow @@ -4440,24 +4234,16 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A AppKit.framework/Headers/NSWindowScripting.h - - NSWindow - - IBFrameworkSource - BWToolkitFramework.framework/Headers/NSWindow+BWAdditions.h - - 0 - IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx com.apple.InterfaceBuilder.CocoaPlugin.macosx - + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 @@ -4466,32 +4252,5 @@ ZSB0aGlzIEhUTUwgdGVtcGxhdGU6A YES ../Notation.xcodeproj 3 - - YES - - YES - Add - Add_Pressed - NSMenuCheckmark - NSMenuMixedState - NSSwitch - Remove - Remove_Pressed - TinyAlert - statusError - - - YES - {23, 22} - {23, 22} - {9, 8} - {7, 2} - {15, 15} - {22, 22} - {22, 22} - {18, 18} - {16, 16} - - diff --git a/English.lproj/NotationPrefsView.nib/keyedobjects.nib b/English.lproj/NotationPrefsView.nib/keyedobjects.nib old mode 100755 new mode 100644 index 8eba0ca0..2f43e20e Binary files a/English.lproj/NotationPrefsView.nib/keyedobjects.nib and b/English.lproj/NotationPrefsView.nib/keyedobjects.nib differ diff --git a/English.lproj/PassphraseChanger.nib/designable.nib b/English.lproj/PassphraseChanger.nib/designable.nib old mode 100755 new mode 100644 diff --git a/English.lproj/PassphraseChanger.nib/keyedobjects.nib b/English.lproj/PassphraseChanger.nib/keyedobjects.nib old mode 100755 new mode 100644 diff --git a/English.lproj/PassphrasePicker.nib/designable.nib b/English.lproj/PassphrasePicker.nib/designable.nib old mode 100755 new mode 100644 diff --git a/English.lproj/PassphrasePicker.nib/keyedobjects.nib b/English.lproj/PassphrasePicker.nib/keyedobjects.nib old mode 100755 new mode 100644 diff --git a/English.lproj/PassphraseRetriever.nib/designable.nib b/English.lproj/PassphraseRetriever.nib/designable.nib old mode 100755 new mode 100644 index f4bf0a65..30fb240a --- a/English.lproj/PassphraseRetriever.nib/designable.nib +++ b/English.lproj/PassphraseRetriever.nib/designable.nib @@ -1,15 +1,11 @@ - + 1040 - 10C540 - 740 - 1038.25 - 458.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 740 - + 9L31a + 680 + 949.54 + 353.00 YES @@ -20,7 +16,7 @@ YES - + YES @@ -48,7 +44,7 @@ View - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} {378, 110} @@ -67,7 +63,7 @@ Please enter the passphrase to access notes in BLAH BLAH BLAH BLAH PATH BLAH BLAH LucidaGrande - 13 + 1.300000e+01 1044 @@ -77,7 +73,7 @@ controlColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2OQA @@ -138,7 +134,7 @@ 268 YES - + YES Apple PDF pasteboard type Apple PICT pasteboard type @@ -159,7 +155,7 @@ NSApplicationIcon 0 - 0 + 1 0 NO @@ -267,7 +263,7 @@ {{0, 0}, {1920, 1178}} {378, 132} - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} @@ -359,26 +355,28 @@ YES 0 - + + YES + -2 - - File's Owner + + RmlsZSdzIE93bmVyA -1 - + First Responder -3 - + Application @@ -388,7 +386,7 @@ YES - + get passphrase @@ -523,13 +521,13 @@ YES - + YES + -1.IBPluginDependency + -2.IBPluginDependency -3.IBPluginDependency -3.ImportedFromIB2 307.IBEditorWindowLastContentRect - 307.IBPluginDependency - 307.IBPropertyAccessControl 307.IBWindowTemplateEditedContentRect 307.ImportedFromIB2 307.windowTemplate.hasMinSize @@ -546,7 +544,6 @@ 320.IBPropertyAccessControl 320.ImportedFromIB2 328.IBPluginDependency - 328.IBPropertyAccessControl 328.ImportedFromIB2 330.IBPluginDependency 330.IBPropertyAccessControl @@ -561,50 +558,67 @@ 336.IBPluginDependency 336.IBPropertyAccessControl 336.ImportedFromIB2 + 341.IBPluginDependency + 342.IBPluginDependency + 343.IBPluginDependency + 344.IBPluginDependency + 345.IBPluginDependency + 346.IBPluginDependency + 347.IBPluginDependency + 348.IBPluginDependency YES com.apple.InterfaceBuilder.CocoaPlugin - - {{203, 226}, {507, 194}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin + + {{203, 226}, {507, 194}} {{203, 226}, {507, 194}} - - + + {378, 110} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - - + + com.apple.InterfaceBuilder.CocoaPlugin - - + + com.apple.InterfaceBuilder.CocoaPlugin - - + + com.apple.InterfaceBuilder.CocoaPlugin - - + com.apple.InterfaceBuilder.CocoaPlugin - - + + NSSecureTextField com.apple.InterfaceBuilder.CocoaPlugin - - + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - YES - + + YES + YES @@ -612,7 +626,9 @@ YES - + + YES + YES @@ -625,6 +641,7 @@ YES FirstResponder + NSObject : id @@ -641,6 +658,13 @@ BookmarksController.h + + NSObject + + IBProjectSource + FastListDataSource.h + + NSObject @@ -680,7 +704,7 @@ NSObject YES - + YES didAdjustSubviews: willAdjustSubviews: @@ -722,7 +746,7 @@ NSObject YES - + YES cancelAction: differentNotes: @@ -737,7 +761,7 @@ YES - + YES cancelButton differentFolderButton @@ -816,590 +840,8 @@ - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSImageCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSImageCell.h - - - - NSImageView - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSImageView.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - PrintCore.framework/Headers/PDEPluginInterface.h - - - - NSObject - - IBFrameworkSource - SecurityInterface.framework/Headers/SFAuthorizationView.h - - - - NSObject - - IBFrameworkSource - SecurityInterface.framework/Headers/SFCertificatePanel.h - - - - NSObject - - IBFrameworkSource - SecurityInterface.framework/Headers/SFChooseIdentityPanel.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUAppcast.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUUpdater.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebDownload.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebEditingDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebFrameLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebJavaPlugIn.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPlugin.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPluginContainer.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPolicyDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebResourceLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebScriptObject.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebUIDelegate.h - - - - NSPanel - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSPanel.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSSecureTextField - NSTextField - - IBFrameworkSource - AppKit.framework/Headers/NSSecureTextField.h - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - 0 - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES ../Notation.xcodeproj 3 diff --git a/English.lproj/PassphraseRetriever.nib/keyedobjects.nib b/English.lproj/PassphraseRetriever.nib/keyedobjects.nib old mode 100755 new mode 100644 index 69da7190..6e748b11 Binary files a/English.lproj/PassphraseRetriever.nib/keyedobjects.nib and b/English.lproj/PassphraseRetriever.nib/keyedobjects.nib differ diff --git a/English.lproj/Preferences.nib/keyedobjects.nib b/English.lproj/Preferences.nib/keyedobjects.nib deleted file mode 100644 index 22330019..00000000 Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and /dev/null differ diff --git a/English.lproj/Preferences.xib b/English.lproj/Preferences.xib new file mode 100644 index 00000000..bf314393 --- /dev/null +++ b/English.lproj/Preferences.xib @@ -0,0 +1,4701 @@ + + + + 1050 + 10J869 + 1305 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1305 + + + YES + NSColorWell + NSMenu + NSSliderCell + NSButton + NSCustomObject + NSSlider + NSCustomView + NSComboBox + NSComboBoxCell + NSTextField + NSWindowTemplate + NSTextFieldCell + NSButtonCell + NSBox + NSView + NSPopUpButtonCell + NSUserDefaultsController + NSPopUpButton + NSMenuItem + NSMatrix + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + PrefsWindowController + + + FirstResponder + + + NSApplication + + + 7 + 2 + {{322, 522}, {399, 334}} + 1886912512 + Preferences + + NSWindow + + + View + + {399, 107} + + + 256 + {{7, 11}, {399, 334}} + + + + + {{0, 0}, {1920, 1058}} + {399, 129} + {1e+13, 1e+13} + + + + 256 + + YES + + + 12 + {{0, 39}, {368, 5}} + + + + {0, 0} + + 67239424 + 0 + Box + + LucidaGrande + 13 + 1044 + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + + + + 268 + {{160, 15}, {192, 14}} + + + + YES + + 68288064 + 272630784 + This will immediately restart nvALT + + LucidaGrande + 11 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 264 + {{34, 9}, {121, 25}} + + + + YES + + 67239424 + 134217728 + Hide Dock Icon + + + -2038284033 + 35 + + + + + + 200 + 25 + + + + + 264 + {{32, 48}, {269, 18}} + + + + YES + + 67239424 + 0 + Show menu bar icon (restart required) + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + + 264 + {{68, 239}, {101, 17}} + + + + YES + + 67239424 + 71303168 + List Text Size: + + + + + + + + + 264 + {{171, 233}, {95, 26}} + + + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + + + + + 400 + 75 + + + Other… + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + 3 + + + YES + + OtherViews + + YES + + + Small + + 1048576 + 2147483647 + + + _popUpItemAction: + 1 + + + + + Large + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + YES + YES + + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 3 + 3 + YES + YES + 1 + + + + + 264 + {{32, 97}, {242, 18}} + + + + YES + + -2080244224 + 0 + Confirm note deletion + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{32, 72}, {223, 18}} + + + + YES + + -2080244224 + 0 + Quit when closing window + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{32, 160}, {286, 18}} + + + + YES + + -2080244224 + 0 + Auto-select notes by title when searching + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + -2147483384 + {{271, 237}, {61, 22}} + + + + YES + + -1804468671 + 272630784 + + + Size + + YES + + + 6 + System + textColor + + + + + + + 264 + {{8, 195}, {161, 20}} + + + + YES + + 67239424 + 71303168 + Bring-to-Front Hotkey: + + + + + + + + + 264 + {{174, 196}, {89, 22}} + + + + YES + + -2072904127 + 272630784 + + + (None) + + YES + + + + + + + 264 + {{265, 188}, {73, 32}} + + + + YES + + 67239424 + 134217728 + Set… + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + + 264 + {{49, 121}, {286, 33}} + + + + YES + + 67239424 + 272629760 + Automatically selecting very long notes may affect responsiveness. + + LucidaGrande + 11 + 3100 + + + + + + + + {368, 277} + + + + NSView + NSResponder + + + + 256 + + YES + + + 256 + {{17, 368}, {154, 17}} + + + + YES + + 67239424 + 71303168 + Read notes from folder: + + + + + + + + + 256 + {{173, 362}, {178, 26}} + + + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + + + + + 400 + 75 + + + Item1 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + YES + + + + Item2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 3 + YES + YES + 1 + + + + + 256 + {368, 346} + + + + + NSView + + NSResponder + + + {368, 406} + + + + + NSView + + NSResponder + + + + 256 + + YES + + + 264 + {{118, 83}, {247, 42}} + + + + YES + + 67239424 + 272629760 + Hold down Option while dragging a link to the notes list to temporarily enable Readability. + + + + + + + + + 268 + {{17, 22}, {134, 17}} + + + + YES + + 67239424 + 272629760 + External Text Editor: + + LucidaGrande + 13 + 16 + + + + + + + + + 268 + {{166, 16}, {178, 26}} + + + + YES + + 74579521 + 272630784 + + + + YES + + + 5 + YES + + + + 274 + {15, 0} + + + YES + + YES + + + 12 + 10 + 1000 + + 75628032 + 0 + + + LucidaGrande + 12 + 16 + + + 3 + MC4zMzMzMzI5ODU2AA + + + + + 338820672 + 1024 + + + YES + + 6 + System + controlBackgroundColor + + + + + 3 + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 19 + tableViewAction: + -767524864 + + + + 1 + 15 + 0 + YES + 0 + + + + + + 264 + {{100, 302}, {219, 38}} + + + + YES + 2 + 1 + + YES + + 67239424 + 0 + Indent lines + + + 1211912703 + 2 + + NSRadioButton + + + + 200 + 25 + + + -2080244224 + 0 + Move typing focus to next field + + + 1 + 1211912703 + 2 + + + + 200 + 25 + + + {219, 18} + {4, 2} + 1143472128 + NSActionCell + + 67239424 + 0 + Radio + + 1211912703 + 0 + + 549453824 + {18, 18} + + YES + + YES + + + + TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw +IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/ +29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5 +dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA +AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG +AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/ +0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/ +7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/ +5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/ +3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD +AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns +AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/ +6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/ +/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/ +///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl +YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA +AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD +AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu +AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB +AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAA3oAAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAN6GFw +cGwCAAAAbW50clJHQiBYWVogB9YAAgAUAAkAJQANYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAPbWAAEAAAAA0y1hcHBsFJOBBrYKo+osFI6rc4AAXwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAOclhZWgAAASwAAAAUZ1hZWgAAAUAAAAAUYlhZWgAAAVQAAAAUd3RwdAAAAWgAAAAUY2hhZAAA +AXwAAAAsclRSQwAAAagAAAAOZ1RSQwAAAbgAAAAOYlRSQwAAAcgAAAAOdmNndAAAAdgAAAMSbmRpbgAA +BOwAAAY+ZGVzYwAACywAAABkZHNjbQAAC5AAAAH+bW1vZAAADZAAAAAoY3BydAAADbgAAAAtWFlaIAAA +AAAAAHEwAABEvAAAD2VYWVogAAAAAAAAYbkAAKGYAAApKFhZWiAAAAAAAAAj7QAAGccAAJqYWFlaIAAA +AAAAAPNSAAEAAAABFs9zZjMyAAAAAAABDEIAAAXe///zJgAAB5IAAP2R///7ov///aMAAAPcAADAbGN1 +cnYAAAAAAAAAAQHNAABjdXJ2AAAAAAAAAAEBzQAAY3VydgAAAAAAAAABAc0AAHZjZ3QAAAAAAAAAAAAD +AQAAAQADBAYICQsMDg8REhMVFxgaGxweHyEiJCUnKCorLC4vMTIzNTY4OTo8PT5AQUJERUdISUpMTU5Q +UVJUVVZYWVpbXF5fYGFiY2VmZ2hpamttbm9wcXJzdHV3eHl6e3x9fn+AgoOEhYaHiImKi4yNjo+QkZKT +lJWWl5iZmpucnZ6foKGio6SlpqanqKmqq6ysra6vsLGxsrO0tba2t7i5urq7vL29vr/AwMHCw8PExcbG +x8jJycrLy8zNzs7P0NDR0tLT1NTV1tbX19jZ2drb29zd3d7e3+Dg4eLi4+Tk5ebm5+jp6err6+zt7u7v +8PHx8vP09fb29/j5+vr7/P3+/v8AAwUHCAoLDQ8QEhMVFhgaGx0eICEjJCYnKSorLS4wMTM0NTc4OTs8 +PT9AQUNERUZISUpLTU5PUFJTVFVWWFlaW1xeX2BhYmNkZWZoaWprbG1ub3Bxc3R1dnd4eXp7fH1+f4CB +goOEhYaHiImKi4yNjo+QkZKTlJWWl5eYmZqbnJ2en6CgoaKjpKWmpqeoqaqrrK2trq+wsbKys7S1tre3 +uLm6u7y8vb6/wMHBwsPExcXGx8jJycrLzM3Nzs/Q0dHS09PU1dbW19jY2dra29zd3d7f3+Dh4uLj5OTl +5ufn6Onp6uvs7O3u7u/w8fHy8/T09fb29/j5+fr7/Pz9/v7/AAIDBAUGCAkKCwwNDg8QERITFBUWFxgZ +GhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpKS0xNTk9QUVJT +VFRVVldYWVpbXF1dXl9gYWJjZGRlZmdoaWpqa2xtbm9wcHFyc3R1dXZ3eHl6e3t8fX5/gIGCgoOEhYaH +iIiJiouMjY6Oj5CRkpOUlJWWl5iZmZqbnJ2enp+goaKjpKSlpqeoqamqq6ytrq6vsLGys7S1tba3uLm6 +uru8vb6/v8DBwsPExcXGx8jJysvMzc7P0dLT1NXX2Nnb3d7g4uPl5+nr7O7x8/X3+fz+/wAAbmRpbgAA +AAAAAAY2AACNngAAV2UAAE0oAACGwgAAKCEAABpHAABQDQAAVDkAAvMzAAKj1wABoUcAAwEAAAIAAAAA +AAEAAwAIAA4AFgAfACoANgBEAFMAZAB1AIcAmwCzAMwA5AD+ARkBNgFSAW8BjgGvAdAB8wIYAj4CZQKR +ArsC5QMSAz8DbAObA8sD/AQvBGEElQTLBQMFQAV/BbsF+AY2BnMGswb1BzcHeQe+CAUITAiVCOUJOQmF +CdUKJQp2CskLHgtzC8kMIAx4DNENLA2cDf0OXQ6+DyAPgw/oEE8QsxEdEYcR8hJeEtATPxOvFCMUmhUa +FZ0WIhaqFzIXuxhIGNgZahn8GpAbJxu9HFUc6R2FHiEevR9bH/0goSFJIfQimCNBI/EkoSVSJgQmtSdn +KB8o3CmSKlIrFSvVLJktYS4pLvEvvjCPMWAyMzMHM9w0vjWVNnc3Wjg+OSI6BjrsO9k8yj27Pqw/nkCU +QYtCg0OBRIVFiUaMR45Imkm6SutMFk1VTotPwFD5UjlTg1TMVhVXXlivWgFbWFy3Xh9fhWDqYlRj02VH +Zr5oQGnKa1Fs5G52cBVxtHNYdQR2tnhpeh97532uf32BTIMbhO2G0oi5ipyMi46EkHuSb5RolnSYlprc +nTmfj6HtpEamqakIq12txbAksoq08rdYuba8Fb54wN3DPMWYx/bKTsyrzvzRVdOq1fvYR9qV3N/eu+EJ +41HlOOdp6a/rtO3L8BTyOfQy9nn4wfqh/QT//wAAAAAAAQADAAYADAASABoAJAAvADsASABXAGcAdwCJ +AJwAsADFANwA9AEOASkBRAFgAX0BnAG8Ad0CAAIkAkoCcAKWAr4C6AMUA0EDbgOdA80D/wQyBGUEmgTR +BQoFQwV9BboF+QY4BncGuwcAB0UHiQfSCBwIaAi1CQMJUwmlCfsKTwqmCv8LWgu2DBMMcAzPDS8NlA37 +DmMOyw80D54QDBB5EOgRWRHMEkAStxMvE6cUIhShFSUVqhYzFr0XSRfVGGUY+RmPGiQavRtYG/IcjR0q +HcoeaR8LH7EgWyEHIbYiZCMTI8ckfyU3JfAmqidkKCYo6ymqKnYrRSwMLN4tsy6DL1owNjEUMfMy1DO3 +NKM1ijZ5N2w4XzlROkQ7ODw6PTs+PD89QEJBSUJRQ19Ec0WIRpxHr0jKSfpLNUxsTaxO6FAhUWJSolPz +VT1WhlfSWR9ablvFXSFegF/dYTdimGQJZW9m12hIab9rLWyobiRvo3Ercqd0MXW/d0943np0fBF9r39V +gPmCm4RAhfCHp4laiw+M0Y6YkF2SHZPclbWXlJl/m5mdrp/Boduj7qYVqDSqVax6rp2wxrL2tSm3X7mP +u8O9/MA+woHEuMb+yTrLhs3I0BXSZdSz1vzZR9uf3fDgSeKd5PHnUemg6/vuV/C/8yL1ifft+lz82/// +AAAAAQADAAkAEwAgAC8AQgBXAG8AiQCpANEA9AEaAUIBawGWAcQB9QIoAl4CqgLkAyIDYQOiA+UEKwRw +BLoFBwVzBcYGGgZuBscHIgd9B9sIPAifCSwJlQoBCm8K3wtTC8cMPQy0DTMN4A5hDuQPaA/vEHgRAxGQ +EiAStBNJE+AUfBUdFcAWaxcTF78YbxkkGdoakxtPHAocxh2GHkYfCB/PIJshayI7Iwsj4SS7JZUmcSdH +KC0pESn3KuMr0CzBLbYupS+hMJ8xnjKfM6M0sDW2Nsk33DjwOgQ7GDw6PV0+gD+kQNBB8kMlRFxFlUbP +R/5JN0ptS6JM2k4UT09Qf1HBUwZUT1WXVtpYK1l0WsJcGF1zXtNgKWGDYulkU2W1ZxtojGn9a2xs425Y +b9RxU3LMdE511HdbeOB6a3v7fY1/JIC6gkyD34V5hxuIvYpai/+NrY9bkQaSq5RWlg2XuplSmvKci55C +n/ChpaNipSmm9qi9qpGsbK5FsByx77PDtZ63cLlNuxi85761wHXCJ8PWxYjHM8jLymbL/M1/zvnQcdHk +01HUvdYU12XYttoD20Xcfd2N3oLfn+DF4eXjCeQW5PPl4ub36AHpB+oP6wHrzOye7Znuku+H8HPxWPIo +8unzs/SX9Xr2WPc1+A/45vmg+lr7Ivvy/Mr9q/63//8AAGRlc2MAAAAAAAAACkNvbG9yIExDRAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAABtbHVjAAAAAAAAAA8AAAAMaXRJVAAAABQAAADEZnJGUgAAAEIAAADYbmJOTwAA +ABIAAAEaZXNFUwAAABIAAAEsZmlGSQAAABAAAAE+cHRQVAAAABgAAAFOemhUVwAAAA4AAAFmamFKUAAA +AA4AAAF0bmxOTAAAABYAAAGCZGVERQAAABAAAAGYa29LUgAAAAwAAAGoZW5VUwAAABIAAAG0c3ZTRQAA +ABAAAAHGZGFESwAAABwAAAHWemhDTgAAAAwAAAHyAEwAQwBEACAAYwBvAGwAbwByAGkAyQBjAHIAYQBu +ACAA4AAgAGMAcgBpAHMAdABhAHUAeAAgAGwAaQBxAHUAaQBkAGUAcwAgAGMAbwB1AGwAZQB1AHIARgBh +AHIAZwBlAC0ATABDAEQATABDAEQAIABjAG8AbABvAHIAVgDkAHIAaQAtAEwAQwBEAEwAQwBEACAAYwBv +AGwAbwByAGkAZABvX2mCcm2yZnaYb3k6VmgwqzDpMPwAIABMAEMARABLAGwAZQB1AHIAZQBuAC0ATABD +AEQARgBhAHIAYgAtAEwAQwBEzuy37AAgAEwAQwBEAEMAbwBsAG8AcgAgAEwAQwBEAEYA5AByAGcALQBM +AEMARABMAEMARAAtAGYAYQByAHYAZQBzAGsA5gByAG1faYJyACAATABDAEQAAG1tb2QAAAAAAAAGEAAA +nCoAAAAAuE1yAAAAAAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwg +SW5jLiwgMjAwNQAAAAA + + + + + + 3 + MCAwAA + + + + 400 + 75 + + 1 + + + + + + + + 264 + {{32, 318}, {65, 22}} + + + + YES + + 67239424 + 71303168 + Tab Key: + + + + + + + + + 264 + {{118, 266}, {229, 30}} + + + + YES + + 67239424 + 272629760 + Option-Tab always indents and Shift-Tab always moves the focus backward. + + + + + + + + + 264 + {{100, 57}, {146, 18}} + + + + YES + + 67239424 + 0 + Right-To-Left (RTL) + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 264 + {{20, 58}, {77, 17}} + + + + YES + + 67239424 + 71303168 + Direction: + + + + + + + + + 264 + {{100, 351}, {137, 18}} + + + + YES + + -2080244224 + 0 + Check as you type + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 264 + {{100, 375}, {246, 18}} + + + + YES + + 67239424 + 0 + Copy basic styles from other apps + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{17, 371}, {80, 22}} + + + + YES + + 67239424 + 71303168 + Styled Text: + + + + + + + + + 264 + {{39, 348}, {58, 21}} + + + + YES + + 67239424 + 71303168 + Spelling: + + + + + + + + + 264 + {{17, 133}, {80, 34}} + + + + YES + + 67239424 + 71303168 + URL Import: + + + + + + + + + 264 + {{100, 129}, {235, 18}} + + + + YES + + 67239424 + 0 + Process with Readability + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 264 + {{100, 149}, {255, 18}} + + + + YES + + 67239424 + 0 + Convert imported URLs to Markdown + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{39, 203}, {58, 17}} + + + + YES + + 67239424 + 71303168 + Links: + + + + + + + + + 264 + {{100, 182}, {242, 18}} + + + + YES + + 67239424 + 0 + Suggest titles for note-links + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 264 + {{100, 237}, {157, 18}} + + + + YES + + -2080244224 + 0 + Soft tabs (spaces) + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{100, 202}, {183, 18}} + + + + YES + + 67239424 + 0 + Make URLs clickable links + + + 1211912703 + 2 + + + + + 200 + 25 + + + + {368, 413} + + + + + NSView + + NSResponder + + + + 256 + + YES + + + 268 + {{92, 78}, {172, 18}} + + + + YES + + -2080244224 + 67108864 + Alternating Row Colors: + + + 1210864127 + 2 + + + + + 200 + 25 + + + + + 268 + {{95, 98}, {169, 18}} + + + + YES + + -2080244224 + 67108864 + Show Grid Lines in List: + + + 1210864127 + 2 + + + + + 200 + 25 + + + + + 264 + {{346, 22}, {38, 13}} + + + + YES + + 67239424 + 4194304 + pixels + + + + + + + + + 264 + {{317, 22}, {36, 13}} + + + + YES + + 67763712 + 4194304 + 1000 + + + + + + + + + 264 + {{50, 20}, {149, 17}} + + + + YES + + 67239424 + 4194304 + Max. Note Body Width: + + + + + + + + + 268 + {{200, 20}, {113, 15}} + + + + YES + + -2079981824 + 131072 + + + 1000 + 350 + 604.16666666666663 + 0.0 + 0 + 1 + NO + NO + + + + + 268 + {{50, 45}, {212, 17}} + + + + YES + + 67239424 + 4194304 + Keep Note Body Width Readable: + + + + + + + + + 264 + {{259, 43}, {22, 18}} + + + + YES + + 67239424 + 0 + + + + 1215582719 + 2 + + + + 200 + 25 + + + + + 264 + {{35, 130}, {326, 14}} + + + + YES + + 67239424 + 4194304 + Text and Background Colors affect User Color Scheme only. + + + + + + + + + 268 + {{115, 229}, {130, 18}} + + + + YES + + -2080244224 + 0 + Search Highlight: + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{35, 275}, {76, 20}} + + + + YES + + 67239424 + 71303168 + Body Font: + + + + + + + + + 264 + {{315, 268}, {72, 32}} + + + + YES + + -2080244224 + 134217728 + Set… + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + + 266 + {{116, 275}, {197, 23}} + + + + YES + + 71433728 + 272630272 + Helvetica 12 + + + YES + + 3 + MQA + + 2 + + + + + + + + 264 + {{151, 156}, {94, 17}} + + + + YES + + 67239424 + 71303168 + Background: + + + + + + + + + 264 + + YES + + YES + + NSColor pasteboard type + + + + {{251, 152}, {52, 24}} + + + + YES + YES + + + + + 264 + {{122, 188}, {123, 17}} + + + + YES + + 67239424 + 71303168 + Foreground Text: + + + + + + + + + 264 + + YES + + YES + + NSColor pasteboard type + + + + {{251, 184}, {52, 24}} + + + + YES + YES + + + + + 264 + + YES + + YES + + NSColor pasteboard type + + + + {{251, 226}, {52, 24}} + + + + YES + YES + + 1 + MC4wNTgxMzA0OTg5OCAwLjA1NTU0MTg5OTA2IDEAA + + + + {420, 319} + + + + NSView + NSResponder + + + YES + + + + + YES + + + generalView + + + + 236 + + + + window + + + + 238 + + + + changedQuitBehavior: + + + + 239 + + + + changedNoteDeletion: + + + + 240 + + + + changedTitleCompletion: + + + + 241 + + + + changedTableText: + + + + 245 + + + + tableTextSizeField + + + + 246 + + + + tableTextMenuButton + + + + 249 + + + + notationPrefsView + + + + 258 + + + + databaseView + + + + 259 + + + + folderLocationsMenuButton + + + + 260 + + + + changedNotesFolderLocation: + + + + 263 + + + + completeNoteTitlesButton + + + + 265 + + + + confirmDeletionButton + + + + 266 + + + + quitWhenClosingButton + + + + 267 + + + + setAppShortcut: + + + + 290 + + + + appShortcutField + + + + 291 + + + + checkSpellingButton + + + + 293 + + + + tabKeyRadioMatrix + + + + 294 + + + + changedSpellChecking: + + + + 296 + + + + changedTabBehavior: + + + + 297 + + + + editingView + + + + 298 + + + + autoSuggestLinksButton + + + + 299 + + + + styledTextButton + + + + 300 + + + + changedStyledTextBehavior: + + + + 301 + + + + changedAutoSuggestLinks: + + + + 302 + + + + softTabsButton + + + + 309 + + + + changedSoftTabs: + + + + 310 + + + + makeURLsClickable + + + + 312 + + + + changedMakeURLsClickable: + + + + 313 + + + + changedSearchHighlightColorWell: + + + + 382 + + + + bodyTextFontField + + + + 394 + + + + changeBodyFont: + + + + 395 + + + + searchHighlightColorWell + + + + 412 + + + + highlightSearchTermsButton + + + + 419 + + + + changedBackgroundTextColorWell: + + + + 420 + + + + changedForegroundTextColorWell: + + + + 421 + + + + changedHighlightSearchTerms: + + + + 422 + + + + backgroundColorWell + + + + 423 + + + + foregroundColorWell + + + + 424 + + + + fontsColorsView + + + + 425 + + + + value: values.StatusBarItem + + + + + + value: values.StatusBarItem + value + values.StatusBarItem + 2 + + + 437 + + + + value: values.KeepsMaxTextWidth + + + + + + value: values.KeepsMaxTextWidth + value + values.KeepsMaxTextWidth + 2 + + + 448 + + + + togDockButton + + + + 450 + + + + togDockLabel + + + + 451 + + + + appList + + + + 462 + + + + delegate + + + + 464 + + + + toggleKeepsTextWidthInWindow: + + + + 469 + + + + setMaxWidth: + + + + 479 + + + + maxWidthSlider + + + + 480 + + + + hidden: values.TextEditor + + + + + + hidden: values.TextEditor + hidden + values.TextEditor + + NSValueTransformerName + NSIsNil + + 2 + + + 500 + + + + hidden: values.TextEditor + + + + + + hidden: values.TextEditor + hidden + values.TextEditor + + NSValueTransformerName + NSIsNil + + 2 + + + 505 + + + + title: values.HideDockIcon + + + + + + title: values.HideDockIcon + title + values.HideDockIcon + 2 + + + 506 + + + + toggleHideDockIcon: + + + + 507 + + + + value: values.NoteBodyMaxWidth + + + + + + value: values.NoteBodyMaxWidth + value + values.NoteBodyMaxWidth + 2 + + + 508 + + + + hidden: values.KeepsMaxTextWidth + + + + + + hidden: values.KeepsMaxTextWidth + hidden + values.KeepsMaxTextWidth + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 517 + + + + hidden: values.KeepsMaxTextWidth + + + + + + hidden: values.KeepsMaxTextWidth + hidden + values.KeepsMaxTextWidth + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 519 + + + + hidden: values.KeepsMaxTextWidth + + + + + + hidden: values.KeepsMaxTextWidth + hidden + values.KeepsMaxTextWidth + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 520 + + + + hidden: values.KeepsMaxTextWidth + + + + + + hidden: values.KeepsMaxTextWidth + hidden + values.KeepsMaxTextWidth + + NSValueTransformerName + NSNegateBoolean + + 2 + + + 521 + + + + changedUseMarkdownImport: + + + + 530 + + + + changedUseReadability: + + + + 531 + + + + useMarkdownImportButton + + + + 532 + + + + useReadabilityButton + + + + 533 + + + + readabilityHint + + + + 538 + + + + changedRTL: + + + + 547 + + + + rtlButton + + + + 548 + + + + changedShowGrid: + + + + 557 + + + + changedAltRows: + + + + 558 + + + + showGridButton + + + + 559 + + + + altRowsButton + + + + 560 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 5 + + + YES + + + + Preferences Window + + + 6 + + + + + 155 + + + YES + + + + + + + + + + + + + + + + + general view + + + 157 + + + YES + + + + + + 158 + + + YES + + + + + + 172 + + + YES + + + + + + 174 + + + YES + + + + + + 175 + + + YES + + + + + + 178 + + + YES + + + + + + 287 + + + YES + + + + + + 288 + + + YES + + + + + + 289 + + + YES + + + + + + 323 + + + YES + + + + + + 250 + + + YES + + + + + + database view + + + 251 + + + YES + + + + + + 252 + + + YES + + + + + + 257 + + + + + 268 + + + YES + + + + + + + + + + + + + + + + + + + + + + editing view + + + 271 + + + YES + + + + + + + + 272 + + + + + 273 + + + + + 274 + + + YES + + + + + + 275 + + + YES + + + + + + 276 + + + YES + + + + + + 278 + + + YES + + + + + + 279 + + + YES + + + + + + 280 + + + YES + + + + + + 282 + + + YES + + + + + + 283 + + + YES + + + + + + 307 + + + YES + + + + + + 311 + + + YES + + + + + + 325 + + + + + 326 + + + YES + + + + + + 327 + + + + + 328 + + + + + 329 + + + + + 330 + + + + + 331 + + + + + 332 + + + + + 333 + + + + + 335 + + + + + 336 + + + + + 337 + + + YES + + + + + + 340 + + + + + 341 + + + + + 342 + + + + + 344 + + + + + 345 + + + + + 346 + + + + + 347 + + + + + 348 + + + + + 349 + + + + + 350 + + + + + 351 + + + + + 159 + + + YES + + + + + + + + + 163 + + + + + 162 + + + + + 161 + + + + + 160 + + + + + 253 + + + YES + + + + + + + + 256 + + + + + 255 + + + + + 254 + + + + + 352 + + + YES + + + + + + + + + + + + + + + + + + + + + fonts colors view + + + 387 + + + YES + + + + + + 388 + + + YES + + + + + + 389 + + + YES + + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 429 + + + YES + + + + + + 430 + + + YES + + + + + + 431 + + + YES + + + + + + 432 + + + + + 433 + + + + + 434 + + + + + 435 + + + + + 436 + + + + + 452 + + + YES + + + + + + 453 + + + + + 454 + + + YES + + + + + + 455 + + + + + 467 + + + YES + + + + + + 468 + + + + + 354 + + + + + 415 + + + YES + + + + + + 416 + + + + + 400 + + + + + 396 + + + + + 397 + + + YES + + + + + + 398 + + + + + 401 + + + YES + + + + + + 402 + + + + + 440 + + + YES + + + + + + 443 + + + + + 441 + + + YES + + + + + + 442 + + + + + 470 + + + YES + + + + + + 471 + + + + + 472 + + + YES + + + + + + 473 + + + + + 487 + + + YES + + + + + + 488 + + + + + 492 + + + YES + + + + + + 493 + + + + + 522 + + + YES + + + + + + 523 + + + YES + + + + + + 524 + + + YES + + + + + + 525 + + + + + 526 + + + + + 527 + + + + + 536 + + + YES + + + + + + 537 + + + + + 542 + + + YES + + + + + + 543 + + + YES + + + + + + 544 + + + + + 545 + + + + + 549 + + + YES + + + + + + 550 + + + + + 552 + + + YES + + + + + + 553 + + + + + + + YES + + YES + -3.IBPluginDependency + -3.ImportedFromIB2 + 155.IBEditorWindowLastContentRect + 155.IBPluginDependency + 155.ImportedFromIB2 + 157.IBPluginDependency + 157.IBPropertyAccessControl + 157.ImportedFromIB2 + 158.IBPluginDependency + 158.IBPropertyAccessControl + 158.ImportedFromIB2 + 159.IBEditorWindowLastContentRect + 159.IBPluginDependency + 159.ImportedFromIB2 + 160.IBPluginDependency + 160.ImportedFromIB2 + 161.IBPluginDependency + 161.ImportedFromIB2 + 162.IBPluginDependency + 162.ImportedFromIB2 + 163.IBPluginDependency + 163.ImportedFromIB2 + 172.IBPluginDependency + 172.IBPropertyAccessControl + 172.ImportedFromIB2 + 174.IBPluginDependency + 174.IBPropertyAccessControl + 174.ImportedFromIB2 + 175.IBPluginDependency + 175.IBPropertyAccessControl + 175.ImportedFromIB2 + 178.IBPluginDependency + 178.ImportedFromIB2 + 250.IBEditorWindowLastContentRect + 250.IBPluginDependency + 250.IBPropertyAccessControl + 250.ImportedFromIB2 + 251.IBPluginDependency + 251.ImportedFromIB2 + 252.IBPluginDependency + 252.IBPropertyAccessControl + 252.ImportedFromIB2 + 253.IBPluginDependency + 253.ImportedFromIB2 + 254.IBPluginDependency + 254.ImportedFromIB2 + 255.IBPluginDependency + 255.ImportedFromIB2 + 256.IBPluginDependency + 256.ImportedFromIB2 + 257.IBPluginDependency + 257.ImportedFromIB2 + 268.IBEditorWindowLastContentRect + 268.IBPluginDependency + 268.ImportedFromIB2 + 271.IBPluginDependency + 271.IBViewBoundsToFrameTransform + 271.ImportedFromIB2 + 272.IBPluginDependency + 272.ImportedFromIB2 + 273.IBPluginDependency + 273.ImportedFromIB2 + 274.IBPluginDependency + 274.IBViewBoundsToFrameTransform + 274.ImportedFromIB2 + 275.IBPluginDependency + 275.IBViewBoundsToFrameTransform + 275.ImportedFromIB2 + 276.IBPluginDependency + 276.ImportedFromIB2 + 278.IBPluginDependency + 278.ImportedFromIB2 + 279.IBPluginDependency + 279.IBViewBoundsToFrameTransform + 279.ImportedFromIB2 + 280.IBPluginDependency + 280.ImportedFromIB2 + 282.IBPluginDependency + 282.IBViewBoundsToFrameTransform + 282.ImportedFromIB2 + 283.IBPluginDependency + 283.IBViewBoundsToFrameTransform + 283.ImportedFromIB2 + 287.IBPluginDependency + 287.IBPropertyAccessControl + 287.ImportedFromIB2 + 288.IBPluginDependency + 288.IBPropertyAccessControl + 288.ImportedFromIB2 + 289.IBPluginDependency + 289.ImportedFromIB2 + 307.IBPluginDependency + 307.IBViewBoundsToFrameTransform + 307.ImportedFromIB2 + 311.IBPluginDependency + 311.IBViewBoundsToFrameTransform + 311.ImportedFromIB2 + 323.IBPluginDependency + 323.IBPropertyAccessControl + 323.ImportedFromIB2 + 325.IBPluginDependency + 326.IBPluginDependency + 327.IBPluginDependency + 328.IBPluginDependency + 329.IBPluginDependency + 330.IBPluginDependency + 331.IBPluginDependency + 332.IBPluginDependency + 333.IBPluginDependency + 335.IBPluginDependency + 336.IBPluginDependency + 337.IBPluginDependency + 340.IBPluginDependency + 341.IBPluginDependency + 342.IBPluginDependency + 344.IBPluginDependency + 345.IBPluginDependency + 346.IBPluginDependency + 347.IBPluginDependency + 348.IBPluginDependency + 349.IBPluginDependency + 350.IBPluginDependency + 351.IBPluginDependency + 352.IBEditorWindowLastContentRect + 352.IBPluginDependency + 352.IBViewBoundsToFrameTransform + 352.ImportedFromIB2 + 354.IBPluginDependency + 354.IBPropertyAccessControl + 354.IBViewBoundsToFrameTransform + 354.ImportedFromIB2 + 387.IBPluginDependency + 387.IBPropertyAccessControl + 387.IBViewBoundsToFrameTransform + 387.ImportedFromIB2 + 388.IBPluginDependency + 388.IBPropertyAccessControl + 388.IBViewBoundsToFrameTransform + 388.ImportedFromIB2 + 389.IBPluginDependency + 389.IBPropertyAccessControl + 389.IBViewBoundsToFrameTransform + 389.ImportedFromIB2 + 390.IBPluginDependency + 391.IBPluginDependency + 392.IBPluginDependency + 396.IBPluginDependency + 396.IBPropertyAccessControl + 396.IBViewBoundsToFrameTransform + 396.ImportedFromIB2 + 397.IBPluginDependency + 397.IBPropertyAccessControl + 397.IBViewBoundsToFrameTransform + 397.ImportedFromIB2 + 398.IBPluginDependency + 400.IBPluginDependency + 400.IBPropertyAccessControl + 400.IBViewBoundsToFrameTransform + 400.ImportedFromIB2 + 401.IBPluginDependency + 401.IBPropertyAccessControl + 401.IBViewBoundsToFrameTransform + 401.ImportedFromIB2 + 402.IBPluginDependency + 415.IBPluginDependency + 415.IBViewBoundsToFrameTransform + 416.IBPluginDependency + 429.IBPluginDependency + 429.IBPropertyAccessControl + 429.IBViewBoundsToFrameTransform + 429.ImportedFromIB2 + 430.IBPluginDependency + 430.IBViewBoundsToFrameTransform + 430.ImportedFromIB2 + 431.IBPluginDependency + 431.IBViewBoundsToFrameTransform + 432.IBPluginDependency + 432.IBViewBoundsToFrameTransform + 433.IBPluginDependency + 434.IBPluginDependency + 435.IBPluginDependency + 440.IBPluginDependency + 440.IBViewBoundsToFrameTransform + 440.ImportedFromIB2 + 441.IBPluginDependency + 441.IBViewBoundsToFrameTransform + 442.IBPluginDependency + 443.IBPluginDependency + 452.IBPluginDependency + 452.IBViewBoundsToFrameTransform + 453.IBPluginDependency + 454.IBPluginDependency + 454.IBViewBoundsToFrameTransform + 455.IBPluginDependency + 467.IBPluginDependency + 467.IBPropertyAccessControl + 467.IBViewBoundsToFrameTransform + 467.ImportedFromIB2 + 468.IBPluginDependency + 470.IBPluginDependency + 470.IBViewBoundsToFrameTransform + 471.IBPluginDependency + 472.IBPluginDependency + 472.IBViewBoundsToFrameTransform + 472.ImportedFromIB2 + 473.IBPluginDependency + 487.IBPluginDependency + 487.IBViewBoundsToFrameTransform + 487.ImportedFromIB2 + 488.IBPluginDependency + 492.IBPluginDependency + 492.IBViewBoundsToFrameTransform + 492.ImportedFromIB2 + 493.IBPluginDependency + 5.IBEditorWindowLastContentRect + 5.IBPluginDependency + 5.IBPropertyAccessControl + 5.IBWindowTemplateEditedContentRect + 5.ImportedFromIB2 + 522.IBPluginDependency + 522.IBViewBoundsToFrameTransform + 522.ImportedFromIB2 + 523.IBPluginDependency + 523.IBViewBoundsToFrameTransform + 523.ImportedFromIB2 + 524.IBPluginDependency + 524.IBViewBoundsToFrameTransform + 524.ImportedFromIB2 + 525.IBPluginDependency + 526.IBPluginDependency + 527.IBPluginDependency + 536.IBPluginDependency + 536.IBViewBoundsToFrameTransform + 536.ImportedFromIB2 + 537.IBPluginDependency + 542.IBPluginDependency + 542.ImportedFromIB2 + 543.IBPluginDependency + 543.ImportedFromIB2 + 544.IBPluginDependency + 545.IBPluginDependency + 549.IBPluginDependency + 549.IBViewBoundsToFrameTransform + 550.IBPluginDependency + 552.IBPluginDependency + 552.IBViewBoundsToFrameTransform + 553.IBPluginDependency + 6.IBPluginDependency + 6.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + {{92, 271}, {368, 277}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + {{520, 405}, {122, 73}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + {{369, 230}, {368, 406}} + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{196, 240}, {368, 290}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCyAAAw2QAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCAAAAw2QAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABC7AAAwzgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAw3AAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCHAAAwtgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCyAAAwqgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCyAAAww8AAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCyAAAwtgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{96, 240}, {420, 265}} + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + AUNcAABCAAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + + P4AAAL+AAABC5AAAwkwAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + + P4AAAL+AAABDgoAAwlQAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + + P4AAAL+AAABCBAAAwkAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + AUNcAABDGgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + + P4AAAL+AAABCgAAAwy0AAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + AUNcAABC9AAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + + P4AAAL+AAABC3gAAww0AAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCqAAAwkwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + P4AAAL+AAABCAAAAwoAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCCAAAwgAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDIAAAwdgAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + AQAAAABCHAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDggAAwlgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCTAAAwlwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDKQAAwhQAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBoAAAwggAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + P4AAAL+AAABCDAAAwrAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDSQAAweAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCTAAAwfAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDnwAAweAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDrYAAweAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + {{329, 268}, {399, 334}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{329, 268}, {399, 334}} + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCyAAAwtgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCyAAAwqgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCHAAAwtgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABC7AAAwzgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCqAAAwkwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCqAAAwkwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + + + + YES + + + + + 560 + + + + YES + + FirstResponder + + : + id + + + : + + : + id + + + + IBUserSource + + + + + NotationPrefsViewController + NSObject + + YES + + YES + addedExtension: + addedType: + changePassphrase: + changedFileDeletionWarningSettings: + changedFileStorageFormat: + changedKeyLength: + changedKeychainSettings: + changedSecureTextEntry: + makeDefaultExtension: + removeFromKeychain: + removedExtension: + removedType: + syncFrequencyChange: + toggledEncryption: + toggledSyncing: + visitSimplenoteSite: + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + addedExtension: + addedType: + changePassphrase: + changedFileDeletionWarningSettings: + changedFileStorageFormat: + changedKeyLength: + changedKeychainSettings: + changedSecureTextEntry: + makeDefaultExtension: + removeFromKeychain: + removedExtension: + removedType: + syncFrequencyChange: + toggledEncryption: + toggledSyncing: + visitSimplenoteSite: + + + YES + + addedExtension: + id + + + addedType: + id + + + changePassphrase: + id + + + changedFileDeletionWarningSettings: + id + + + changedFileStorageFormat: + id + + + changedKeyLength: + id + + + changedKeychainSettings: + id + + + changedSecureTextEntry: + id + + + makeDefaultExtension: + id + + + removeFromKeychain: + id + + + removedExtension: + id + + + removedType: + id + + + syncFrequencyChange: + id + + + toggledEncryption: + id + + + toggledSyncing: + id + + + visitSimplenoteSite: + id + + + + + YES + + YES + allowedExtensionsTable + allowedTypesTable + changePasswordButton + confirmFileDeletionButton + enableEncryptionButton + enabledSyncButton + fileAttributesHelpText + keyLengthField + keyLengthStepper + makeDefaultExtensionButton + newExtensionButton + newTypeButton + passwordSettingsMatrix + removeExtensionButton + removeFromKeychainButton + removeTypeButton + secureTextEntryButton + storageFormatPopupButton + syncAccountField + syncEncAlertField + syncEncAlertView + syncPasswordField + syncingFrequency + verifyStatusField + verifyStatusImageView + view + webOptionsWindow + + + YES + NSTableView + NSTableView + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSStepper + NSButton + NSButton + NSButton + NSMatrix + NSButton + NSButton + NSButton + NSButton + NSPopUpButton + NSTextField + NSTextField + NSImageView + NSTextField + NSPopUpButton + NSTextField + NSImageView + NSView + NSWindow + + + + YES + + YES + allowedExtensionsTable + allowedTypesTable + changePasswordButton + confirmFileDeletionButton + enableEncryptionButton + enabledSyncButton + fileAttributesHelpText + keyLengthField + keyLengthStepper + makeDefaultExtensionButton + newExtensionButton + newTypeButton + passwordSettingsMatrix + removeExtensionButton + removeFromKeychainButton + removeTypeButton + secureTextEntryButton + storageFormatPopupButton + syncAccountField + syncEncAlertField + syncEncAlertView + syncPasswordField + syncingFrequency + verifyStatusField + verifyStatusImageView + view + webOptionsWindow + + + YES + + allowedExtensionsTable + NSTableView + + + allowedTypesTable + NSTableView + + + changePasswordButton + NSButton + + + confirmFileDeletionButton + NSButton + + + enableEncryptionButton + NSButton + + + enabledSyncButton + NSButton + + + fileAttributesHelpText + NSTextField + + + keyLengthField + NSTextField + + + keyLengthStepper + NSStepper + + + makeDefaultExtensionButton + NSButton + + + newExtensionButton + NSButton + + + newTypeButton + NSButton + + + passwordSettingsMatrix + NSMatrix + + + removeExtensionButton + NSButton + + + removeFromKeychainButton + NSButton + + + removeTypeButton + NSButton + + + secureTextEntryButton + NSButton + + + storageFormatPopupButton + NSPopUpButton + + + syncAccountField + NSTextField + + + syncEncAlertField + NSTextField + + + syncEncAlertView + NSImageView + + + syncPasswordField + NSTextField + + + syncingFrequency + NSPopUpButton + + + verifyStatusField + NSTextField + + + verifyStatusImageView + NSImageView + + + view + NSView + + + webOptionsWindow + NSWindow + + + + + IBProjectSource + ./Classes/NotationPrefsViewController.h + + + + PrefsWindowController + NSObject + + YES + + YES + changeBodyFont: + changedAltRows: + changedAutoSuggestLinks: + changedBackgroundTextColorWell: + changedForegroundTextColorWell: + changedHighlightSearchTerms: + changedMakeURLsClickable: + changedNoteDeletion: + changedNotesFolderLocation: + changedQuitBehavior: + changedRTL: + changedSearchHighlightColorWell: + changedShowGrid: + changedSoftTabs: + changedSpellChecking: + changedStyledTextBehavior: + changedTabBehavior: + changedTableText: + changedTitleCompletion: + changedUseMarkdownImport: + changedUseReadability: + setAppShortcut: + setMaxWidth: + toggleHideDockIcon: + toggleKeepsTextWidthInWindow: + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + changeBodyFont: + changedAltRows: + changedAutoSuggestLinks: + changedBackgroundTextColorWell: + changedForegroundTextColorWell: + changedHighlightSearchTerms: + changedMakeURLsClickable: + changedNoteDeletion: + changedNotesFolderLocation: + changedQuitBehavior: + changedRTL: + changedSearchHighlightColorWell: + changedShowGrid: + changedSoftTabs: + changedSpellChecking: + changedStyledTextBehavior: + changedTabBehavior: + changedTableText: + changedTitleCompletion: + changedUseMarkdownImport: + changedUseReadability: + setAppShortcut: + setMaxWidth: + toggleHideDockIcon: + toggleKeepsTextWidthInWindow: + + + YES + + changeBodyFont: + id + + + changedAltRows: + id + + + changedAutoSuggestLinks: + id + + + changedBackgroundTextColorWell: + id + + + changedForegroundTextColorWell: + id + + + changedHighlightSearchTerms: + id + + + changedMakeURLsClickable: + id + + + changedNoteDeletion: + id + + + changedNotesFolderLocation: + id + + + changedQuitBehavior: + id + + + changedRTL: + id + + + changedSearchHighlightColorWell: + id + + + changedShowGrid: + id + + + changedSoftTabs: + id + + + changedSpellChecking: + id + + + changedStyledTextBehavior: + id + + + changedTabBehavior: + id + + + changedTableText: + id + + + changedTitleCompletion: + id + + + changedUseMarkdownImport: + id + + + changedUseReadability: + id + + + setAppShortcut: + id + + + setMaxWidth: + id + + + toggleHideDockIcon: + id + + + toggleKeepsTextWidthInWindow: + id + + + + + YES + + YES + altRowsButton + appList + appShortcutField + autoSuggestLinksButton + backgroundColorWell + bodyTextFontField + checkSpellingButton + completeNoteTitlesButton + confirmDeletionButton + databaseView + editingView + folderLocationsMenuButton + fontsColorsView + foregroundColorWell + generalView + highlightSearchTermsButton + makeURLsClickable + maxWidthSlider + notationPrefsView + notationPrefsViewController + quitWhenClosingButton + rtlButton + searchHighlightColorWell + showGridButton + softTabsButton + styledTextButton + tabKeyRadioMatrix + tableTextMenuButton + tableTextSizeField + togDockButton + togDockLabel + useMarkdownImportButton + useReadabilityButton + window + + + YES + NSButton + NSComboBox + NSTextField + NSButton + NSColorWell + NSTextField + NSButton + NSButton + NSButton + NSView + NSView + NSPopUpButton + NSView + NSColorWell + NSView + NSButton + NSButton + NSSlider + NSView + NotationPrefsViewController + NSButton + NSButton + NSColorWell + NSButton + NSButton + NSButton + NSMatrix + NSPopUpButton + NSTextField + NSButton + NSTextField + NSButton + NSButton + NSWindow + + + + YES + + YES + altRowsButton + appList + appShortcutField + autoSuggestLinksButton + backgroundColorWell + bodyTextFontField + checkSpellingButton + completeNoteTitlesButton + confirmDeletionButton + databaseView + editingView + folderLocationsMenuButton + fontsColorsView + foregroundColorWell + generalView + highlightSearchTermsButton + makeURLsClickable + maxWidthSlider + notationPrefsView + notationPrefsViewController + quitWhenClosingButton + rtlButton + searchHighlightColorWell + showGridButton + softTabsButton + styledTextButton + tabKeyRadioMatrix + tableTextMenuButton + tableTextSizeField + togDockButton + togDockLabel + useMarkdownImportButton + useReadabilityButton + window + + + YES + + altRowsButton + NSButton + + + appList + NSComboBox + + + appShortcutField + NSTextField + + + autoSuggestLinksButton + NSButton + + + backgroundColorWell + NSColorWell + + + bodyTextFontField + NSTextField + + + checkSpellingButton + NSButton + + + completeNoteTitlesButton + NSButton + + + confirmDeletionButton + NSButton + + + databaseView + NSView + + + editingView + NSView + + + folderLocationsMenuButton + NSPopUpButton + + + fontsColorsView + NSView + + + foregroundColorWell + NSColorWell + + + generalView + NSView + + + highlightSearchTermsButton + NSButton + + + makeURLsClickable + NSButton + + + maxWidthSlider + NSSlider + + + notationPrefsView + NSView + + + notationPrefsViewController + NotationPrefsViewController + + + quitWhenClosingButton + NSButton + + + rtlButton + NSButton + + + searchHighlightColorWell + NSColorWell + + + showGridButton + NSButton + + + softTabsButton + NSButton + + + styledTextButton + NSButton + + + tabKeyRadioMatrix + NSMatrix + + + tableTextMenuButton + NSPopUpButton + + + tableTextSizeField + NSTextField + + + togDockButton + NSButton + + + togDockLabel + NSTextField + + + useMarkdownImportButton + NSButton + + + useReadabilityButton + NSButton + + + window + NSWindow + + + + + IBProjectSource + ./Classes/PrefsWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + NSSwitch + + + YES + {9, 8} + {7, 2} + {15, 15} + + + + diff --git a/English.lproj/SaveHTMLPreview.nib/designable.nib b/English.lproj/SaveHTMLPreview.nib/designable.nib new file mode 100644 index 00000000..f39809b5 --- /dev/null +++ b/English.lproj/SaveHTMLPreview.nib/designable.nib @@ -0,0 +1,462 @@ + + + + 1050 + 10J869 + 1305 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1305 + + + YES + NSCustomView + NSTextField + NSButtonCell + NSTextFieldCell + NSButton + NSCustomObject + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + + + YES + + PreviewController + + + FirstResponder + + + NSApplication + + + + 268 + + YES + + + 268 + {{25, 9}, {244, 34}} + + + + YES + + 67239424 + 138412032 + Select this to embed the ouput within your current preview HTML and CSS + + LucidaGrande + 11 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 1 + MC40MTMwNDM0NzgzIDAuNDEzMDQzNDc4MyAwLjQxMzA0MzQ3ODMAA + + + + + + 268 + {{26, 49}, {242, 18}} + + + + YES + + -2080244224 + 0 + Include preview template in output + + LucidaGrande + 13 + 1044 + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + {286, 75} + + + + NSView + + + + + YES + + + accessoryView + + + + 41 + + + + includeTemplate + + + + 44 + + + + templateNote + + + + 47 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 7 + + + YES + + + + + View + + + 42 + + + YES + + + + + + 43 + + + + + 45 + + + YES + + + + + + 46 + + + + + + + YES + + YES + 42.IBPluginDependency + 42.IBViewBoundsToFrameTransform + 43.IBPluginDependency + 45.IBPluginDependency + 46.IBPluginDependency + 7.IBEditorWindowLastContentRect + 7.IBPluginDependency + 7.IBUserGuides + 7.WindowOrigin + 7.editorWindowContentRectSynchronizationRect + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCiAAAwggAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{297, 274}, {286, 58}} + com.apple.InterfaceBuilder.CocoaPlugin + + YES + + {332, 343} + {{403, 401}, {264, 327}} + + + + YES + + + + + + YES + + + + + 47 + + + + YES + + PreviewController + NSWindowController + + YES + + YES + cancelShare: + hideShareURL: + openShareURL: + saveHTML: + shareAsk: + shareNote: + switchTabs: + + + YES + id + id + id + id + id + id + id + + + + YES + + YES + cancelShare: + hideShareURL: + openShareURL: + saveHTML: + shareAsk: + shareNote: + switchTabs: + + + YES + + cancelShare: + id + + + hideShareURL: + id + + + openShareURL: + id + + + saveHTML: + id + + + shareAsk: + id + + + shareNote: + id + + + switchTabs: + id + + + + + YES + + YES + accessoryView + includeTemplate + preview + shareConfirmation + shareNotification + sourceView + tabView + templateNote + urlTextField + + + YES + NSView + NSButton + WebView + NSView + NSView + NSTextView + NSTabView + NSTextField + NSTextField + + + + YES + + YES + accessoryView + includeTemplate + preview + shareConfirmation + shareNotification + sourceView + tabView + templateNote + urlTextField + + + YES + + accessoryView + NSView + + + includeTemplate + NSButton + + + preview + WebView + + + shareConfirmation + NSView + + + shareNotification + NSView + + + sourceView + NSTextView + + + tabView + NSTabView + + + templateNote + NSTextField + + + urlTextField + NSTextField + + + + + IBProjectSource + ./Classes/PreviewController.h + + + + WebView + + reloadFromOrigin: + id + + + reloadFromOrigin: + + reloadFromOrigin: + id + + + + IBProjectSource + ./Classes/WebView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + NSSwitch + {15, 15} + + + diff --git a/English.lproj/SaveHTMLPreview.nib/keyedobjects.nib b/English.lproj/SaveHTMLPreview.nib/keyedobjects.nib new file mode 100644 index 00000000..08a0f01f Binary files /dev/null and b/English.lproj/SaveHTMLPreview.nib/keyedobjects.nib differ diff --git a/English.lproj/SavedSearches.nib/designable.nib b/English.lproj/SavedSearches.nib/designable.nib index 6422c7a0..d6485b9b 100644 --- a/English.lproj/SavedSearches.nib/designable.nib +++ b/English.lproj/SavedSearches.nib/designable.nib @@ -1,52 +1,45 @@ - + 1060 - 10H574 - 823 + 10J869 + 1305 1038.35 461.00 - YES - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.brandonwalkin.BWToolkit - - - YES - 823 - 1.2.5 - + com.apple.InterfaceBuilder.CocoaPlugin + 1305 - - YES - - - - YES + + NSView + NSCustomObject + NSScrollView + NSWindowTemplate + NSTextFieldCell + NSButtonCell + NSTableColumn + NSButton + NSScroller + NSTableView + + com.apple.InterfaceBuilder.CocoaPlugin - com.brandonwalkin.BWToolkit - - - PluginDependencyRecalculationVersion - - - - YES - + + + + SavedSearchesController - + FirstResponder - + NSApplication - + 8219 2 - {{817, 594}, {319, 215}} + {{495, 324}, {317, 207}} -260571136 Note Bookmarks @@ -55,96 +48,40 @@ View - {1.79769e+308, 1.79769e+308} {255, 64} - + 256 - - YES - - - 257 - {{243, 11}, {29, 25}} - - YES - - -2080244224 - 134217728 - - - LucidaGrande - 13 - 1044 - - - -2033434369 - 163 - - NSImage - NSAddOnTexture - - - - 400 - 75 - - - - - 257 - {{277, 11}, {29, 25}} - - YES - - -2080244224 - 134217728 - - - - -2033434369 - 163 - - NSImage - NSRemoveOnTexture - - - - 400 - 75 - - - - - 4370 - - YES - - + + + + 274 + + + 2304 - - YES - - - 4370 - {322, 172} - + + + + 256 + {286, 159} + + YES - -2147483392 - {{-26, 0}, {16, 17}} + 256 + {{285, 0}, {12, 17}} - - YES - + + description - 266 + 228 40 1000 - 75628032 - 0 + 75628096 + 2048 Bookmark LucidaGrande @@ -155,27 +92,26 @@ 3 MC4zMzMzMzI5OQA - + 6 System headerTextColor - + 3 MAA - - 67239488 + + 337772096 2048 - Text Cell - - LucidaGrande-Bold - 12 - 16 + + LucidaGrande + 13 + 1044 - - + + 6 System controlBackgroundColor @@ -184,21 +120,23 @@ MC42NjY2NjY2NjY3AA - - 1 - MSAxIDEAA + + 6 + System + controlTextColor + - 3 + 1 YES YES - + - + keyEquiv - 50 - 50 - 50 + 52.056640625 + 23.056640625 + 1000 75628096 2048 @@ -208,48 +146,29 @@ 6 System headerColor - + 3 MQA - + - - 67239424 - 0 - Field - - LucidaGrande - 12 - 4883 - - - - 6 - System - textBackgroundColor - - - - 6 - System - controlTextColor - - + + 337772096 + 67110912 + + + + - 3 + 1 YES - YES - + - + 3 2 - - 4 - MSAwLjE0AA - + 6 System @@ -259,1184 +178,361 @@ MC41AA - 20 - 314572800 + 17 + 306184192 5 15 0 - NO + YES 0 - - {317, 172} - - - - + + {286, 159} + + + + + 4 - - - -2147483392 - {{-100, -100}, {15, 120}} - - 2 - + + + 256 + {{286, 0}, {11, 159}} + + + 256 + _doScroller: - 0.99264705882352944 + 0.82631576061248779 - - + + -2147483392 - {{-100, -100}, {225, 15}} - - YES - 1 - + {{-100, -100}, {132, 11}} + + + 257 + _doScroller: - 0.57142859697341919 + 0.99047619104385376 + + {{10, 39}, {297, 159}} + + + + 16 + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 292 + {{9, 6}, {25, 25}} + + + + YES + + 67239424 + 134217728 + + + + + -2038152961 + 35 + + + + + 200 + 25 - {{1, 43}, {317, 172}} - - - 656 - - - - QSAAAEEgAABBsAAAQbAAAA - - {319, 215} + + + 292 + {{36, 6}, {23, 25}} + + + YES + + 604110336 + 134217728 + - + + + -2038152961 + 35 + + + + + 200 + 25 + + + + {{7, 11}, {317, 207}} + {{0, 0}, {1920, 1058}} {255, 83} - {1.79769e+308, 1.79769e+308} + {1e+13, 1e+13} bookmarksWindow - + - - YES + - window - - + nextKeyView + + - 375 + 369 - nextKeyView - - + addBookmarkButton + + - 397 + 372 - - addBookmark: - - + + removeBookmarkButton + + - 398 + 373 - - removeBookmark: - - + + bookmarksTableView + + - 399 + 374 - bookmarksTableView - - + window + + - 415 + 375 - + + + addBookmark: + + + + 376 + + + + removeBookmark: + + + + 377 + + - - YES + 0 - - YES - - + + -2 - + File's Owner -1 - + First Responder 354 - - - YES - - + + + + Panel 355 - - - YES - - - - - + + + + + + + - -3 - - - Application + 363 + + + + + + + - 393 - - - YES - - - + 364 + + + + + + - 394 - - + 366 + + + + + - 395 - - - YES - - - + 378 + + + + + - 396 - - + 367 + + + + + - 405 - - - YES - - - - - + 368 + + + + + - 406 - - + 383 + + - 407 - - + 384 + + - 408 - - - YES - - - - + 385 + + - 409 - - - YES - - - + 386 + + - 410 - - + 387 + + - 411 - - - YES - - - + 388 + + - 413 - - - - - - - YES - - YES - 354.IBEditorWindowLastContentRect - 354.IBPluginDependency - 354.IBWindowTemplateEditedContentRect - 354.ImportedFromIB2 - 354.windowTemplate.hasMaxSize - 354.windowTemplate.hasMinSize - 354.windowTemplate.maxSize - 354.windowTemplate.minSize - 355.IBPluginDependency - 355.ImportedFromIB2 - 393.IBPluginDependency - 394.IBPluginDependency - 395.IBPluginDependency - 396.IBPluginDependency - 405.IBPluginDependency - 405.IBViewBoundsToFrameTransform - 406.IBPluginDependency - 407.IBPluginDependency - 408.IBPluginDependency - 409.IBPluginDependency - 410.IBPluginDependency - - - YES - {{817, 594}, {319, 215}} - com.apple.InterfaceBuilder.CocoaPlugin - {{817, 594}, {319, 215}} - - - - {319, 215} - {255, 64} - com.apple.InterfaceBuilder.CocoaPlugin - - com.brandonwalkin.BWToolkit - com.brandonwalkin.BWToolkit - com.brandonwalkin.BWToolkit - com.brandonwalkin.BWToolkit - com.brandonwalkin.BWToolkit - - P4AAAL+AAAA/gAAAwxIAAA + -3 + + + Application - com.brandonwalkin.BWToolkit - com.brandonwalkin.BWToolkit - com.brandonwalkin.BWToolkit - com.brandonwalkin.BWToolkit - com.brandonwalkin.BWToolkit - - - - YES - - - YES - + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + BookmarksTable + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + ToolTip + + ToolTip + + Create an account. + + + com.apple.InterfaceBuilder.CocoaPlugin + + + ToolTip + + ToolTip + + Remove an account. + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + - - YES - - - YES - - + - 415 + 388 - - YES - - FirstResponder - NSObject - - : - id - - - : - - : - id - - - - IBUserSource - - - - - NSObject - - IBProjectSource - BookmarksController.h - - - - NSObject - - IBProjectSource - GlobalPrefs.h - - - - NSObject - - IBProjectSource - NotationController.h - - - - NSObject - - IBProjectSource - NotationFileManager.h - - - - NSObject - - IBProjectSource - NoteObject.h - - - - NSObject - - IBProjectSource - PassphrasePicker.h - - - - NSObject - - YES - - YES - didAdjustSubviews: - willAdjustSubviews: - - - YES - RBSplitView - RBSplitView - - - - YES - - YES - didAdjustSubviews: - willAdjustSubviews: - - - YES - - didAdjustSubviews: - RBSplitView - - - willAdjustSubviews: - RBSplitView - - - - - IBProjectSource - RBSplitView/RBSplitView.h - - - - NSObject - - IBProjectSource - SyncResponseFetcher.h - - - - NSObject - - IBProjectSource - SyncServiceSessionProtocol.h - - - - NSTableView - - IBProjectSource - NotesTableView.h - - - - RBSplitSubview - NSView - - IBProjectSource - RBSplitView/RBSplitSubview.h - - - - RBSplitSubview - - IBProjectSource - RBSplitView/RBSplitViewPrivateDefines.h - - - - RBSplitView - RBSplitSubview - - delegate - id - - - delegate - - delegate - id - - - - - - RBSplitView - - - - SavedSearchesController - NSObject - - YES - - YES - addBookmark: - removeBookmark: - - - YES - id - id - - - - YES - - YES - addBookmark: - removeBookmark: - - - YES - - addBookmark: - id - - - removeBookmark: - id - - - - - YES - - YES - addBookmarkButton - bookmarksTableView - removeBookmarkButton - window - - - YES - NSButton - NSTableView - NSButton - NSPanel - - - - YES - - YES - addBookmarkButton - bookmarksTableView - removeBookmarkButton - window - - - YES - - addBookmarkButton - NSButton - - - bookmarksTableView - NSTableView - - - removeBookmarkButton - NSButton - - - window - NSPanel - - - - - IBUserSource - - - - - - YES - - BWTransparentScrollView - NSScrollView - - IBFrameworkSource - BWToolkitFramework.framework/Headers/BWTransparentScrollView.h - - - - BWTransparentScroller - NSScroller - - IBFrameworkSource - BWToolkitFramework.framework/Headers/BWTransparentScroller.h - - + - BWTransparentTableView + BookmarksTable NSTableView - IBFrameworkSource - BWToolkitFramework.framework/Headers/BWTransparentTableView.h - - - - BWTransparentTableViewCell - NSTextFieldCell - - IBFrameworkSource - BWToolkitFramework.framework/Headers/BWTransparentTableViewCell.h - - - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSApplication - - IBFrameworkSource - BWToolkitFramework.framework/Headers/NSApplication+BWAdditions.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h + IBProjectSource + ./Classes/BookmarksTable.h - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - PrintCore.framework/Headers/PDEPluginInterface.h - - - - NSObject - - IBFrameworkSource - SecurityInterface.framework/Headers/SFAuthorizationView.h - - - - NSObject - - IBFrameworkSource - SecurityInterface.framework/Headers/SFCertificatePanel.h - - - - NSObject - - IBFrameworkSource - SecurityInterface.framework/Headers/SFChooseIdentityPanel.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUAppcast.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUUpdater.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebDownload.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebEditingDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebFrameLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebJavaPlugIn.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPlugin.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPluginContainer.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPolicyDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebResourceLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebScriptObject.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebUIDelegate.h - - - - NSPanel - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSPanel.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSScrollView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSScrollView.h - - - - NSScroller - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSScroller.h - - - - NSTableColumn - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableColumn.h - - - - NSTableView - NSControl - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSView - - IBFrameworkSource - BWToolkitFramework.framework/Headers/NSView+BWAdditions.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - NSWindow - - IBFrameworkSource - BWToolkitFramework.framework/Headers/NSWindow+BWAdditions.h - - - + 0 IBCocoaFramework @@ -1444,29 +540,7 @@ com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - YES - ../Notation.xcodeproj 3 - - YES - - YES - NSAddOnTexture - NSRemoveOnTexture - - - YES - {11, 11} - {11, 11} - - diff --git a/English.lproj/SavedSearches.nib/keyedobjects.nib b/English.lproj/SavedSearches.nib/keyedobjects.nib index 397fee71..96c90868 100644 Binary files a/English.lproj/SavedSearches.nib/keyedobjects.nib and b/English.lproj/SavedSearches.nib/keyedobjects.nib differ diff --git a/English.lproj/TagEditingManager.nib/classes.nib b/English.lproj/TagEditingManager.nib/classes.nib deleted file mode 100755 index 5d2363b2..00000000 --- a/English.lproj/TagEditingManager.nib/classes.nib +++ /dev/null @@ -1,19 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {"" = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - {CLASS = NSDatePicker; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, - { - ACTIONS = {}; - CLASS = TagEditingManager; - LANGUAGE = ObjC; - OUTLETS = {}; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/English.lproj/TagEditingManager.nib/keyedobjects.nib b/English.lproj/TagEditingManager.nib/keyedobjects.nib deleted file mode 100755 index de7996e2..00000000 Binary files a/English.lproj/TagEditingManager.nib/keyedobjects.nib and /dev/null differ diff --git a/English.lproj/TagEditingManager.xib b/English.lproj/TagEditingManager.xib new file mode 100644 index 00000000..50353374 --- /dev/null +++ b/English.lproj/TagEditingManager.xib @@ -0,0 +1,630 @@ + + + + 1050 + 10J869 + 1306 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1306 + + + NSTextField + NSTextFieldCell + NSWindowTemplate + NSView + NSCustomObject + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + TagEditingManager + + + FirstResponder + + + NSApplication + + + 8219 + 2 + {{122, 324}, {322, 55}} + -461896704 + Modify or Add Tags to Selected Notes: + NSPanel + + {2000, 55} + {150, 55} + + + 256 + + + + 268 + {{20, 20}, {282, 22}} + + + + YES + + -1804468671 + 268436480 + + + LucidaGrande + 13 + 1044 + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + 3 + MAA + + + + + + {{7, 11}, {322, 55}} + + + + + {{0, 0}, {1440, 878}} + {150, 74} + {2000, 74} + + + + + + + tagField + + + + 412 + + + + tagPanel + + + + 413 + + + + multiTag: + + + + 425 + + + + initialFirstResponder + + + + 436 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 370 + + + + + + + + 371 + + + + + + + + 372 + + + + + + + + 373 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + {{625, 720}, {322, 55}} + com.apple.InterfaceBuilder.CocoaPlugin + {{625, 720}, {322, 55}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 436 + + + + + AppController + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + bringFocusToControlField: + id + + + copyNoteLink: + id + + + deleteNote: + id + + + exportNote: + id + + + fieldAction: + id + + + importNotes: + id + + + multiTag: + id + + + openFileInEditor: + id + + + printNote: + id + + + renameNote: + id + + + revealNote: + id + + + savePreview: + id + + + selectPreviewMode: + id + + + setBWColorScheme: + id + + + setLCColorScheme: + id + + + setUserColorScheme: + id + + + sharePreview: + id + + + showHelpDocument: + id + + + showPreferencesWindow: + id + + + switchViewLayout: + id + + + syncWaitQuit: + id + + + tagNote: + id + + + toggleCollapse: + id + + + toggleFullscreen: + id + + + toggleNVActivation: + id + + + togglePreview: + id + + + toggleSourceView: + id + + + toggleWordCount: + id + + + + EmptyView + DualField + ETContentView + NSMenuItem + AugmentedScrollView + NotesTableView + NSMenuItem + NSMenuItem + NSMenu + NSPanel + NSProgressIndicator + NSScrollView + LinkingEditor + NSMenuItem + NSWindow + WordCountToken + + + + editorStatusView + EmptyView + + + field + DualField + + + mainView + ETContentView + + + multiMarkdownPreview + NSMenuItem + + + notesScrollView + AugmentedScrollView + + + notesTableView + NotesTableView + + + previewToggler + NSMenuItem + + + sparkleUpdateItem + NSMenuItem + + + statBarMenu + NSMenu + + + syncWaitPanel + NSPanel + + + syncWaitSpinner + NSProgressIndicator + + + textScrollView + NSScrollView + + + textView + LinkingEditor + + + textilePreview + NSMenuItem + + + window + NSWindow + + + wordCounter + WordCountToken + + + + IBProjectSource + ./Classes/AppController.h + + + + AugmentedScrollView + NSScrollView + + IBProjectSource + ./Classes/AugmentedScrollView.h + + + + DualField + NSTextField + + notesTable + NSTableView + + + notesTable + + notesTable + NSTableView + + + + IBProjectSource + ./Classes/DualField.h + + + + ETContentView + NSView + + IBProjectSource + ./Classes/ETContentView.h + + + + EmptyView + NSView + + labelText + NSTextField + + + labelText + + labelText + NSTextField + + + + IBProjectSource + ./Classes/EmptyView.h + + + + FirstResponder + + : + id + + + : + + : + id + + + + IBUserSource + + + + + LinkingEditor + NSTextView + + id + id + + + + shiftLeftAction: + id + + + shiftRightAction: + id + + + + NSTextField + NotesTableView + + + + controlField + NSTextField + + + notesTableView + NotesTableView + + + + IBProjectSource + ./Classes/LinkingEditor.h + + + + NotesTableView + NSTableView + + id + id + + + + actionHideShowColumn: + id + + + toggleNoteBodyPreviews: + id + + + + controlField + NSTextField + + + controlField + + controlField + NSTextField + + + + IBProjectSource + ./Classes/NotesTableView.h + + + + TagEditingManager + NSObject + + NSTextField + NSPanel + + + + tagField + NSTextField + + + tagPanel + NSPanel + + + + IBProjectSource + ./Classes/TagEditingManager.h + + + + WordCountToken + NSTokenField + + IBProjectSource + ./Classes/WordCountToken.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + 3 + + diff --git a/English.lproj/This is the title of a note.nvhelp b/English.lproj/This is the title of a note.nvhelp index 9a6d368e..513652a8 100755 --- a/English.lproj/This is the title of a note.nvhelp +++ b/English.lproj/This is the title of a note.nvhelp @@ -10,9 +10,11 @@ This is the body of a note. Your notes can be as long or as short as you want, a \b embolden \b0 , \i italicize -\i0 , or \ul underline\ulnone them. \ +\i0 , or \strike \strikec0 strike\strike0\striked0 them.\ \ -You can create as many notes as you want--NV can hold thousands of them and works best when information is distributed.\ +Create links between notes: [[How does this thing work?]].\ +\ +You can create as many notes as you want--NV can hold thousands of them and works best when content is distributed.\ \ If you enable encryption (Preferences > Notes > Security) you can even store passwords and other sensitive information without giving a second thought to computer forensics laboratories.\ \ diff --git a/English.lproj/URLGetter.nib/designable.nib b/English.lproj/URLGetter.nib/designable.nib old mode 100755 new mode 100644 diff --git a/English.lproj/URLGetter.nib/keyedobjects.nib b/English.lproj/URLGetter.nib/keyedobjects.nib old mode 100755 new mode 100644 diff --git a/ExporterManager.m b/ExporterManager.m index 1c05b9b8..25e2fcee 100755 --- a/ExporterManager.m +++ b/ExporterManager.m @@ -28,10 +28,7 @@ + (ExporterManager *)sharedManager { - (void)awakeFromNib { int storageFormat = [[[GlobalPrefs defaultPrefs] notationPrefs] notesStorageFormat]; - int itemIndex = [formatSelectorPopup indexOfItemWithTag:storageFormat]; - - if (itemIndex > -1) - [formatSelectorPopup selectItemAtIndex:itemIndex]; + [formatSelectorPopup selectItemWithTag:storageFormat]; } - (IBAction)formatSelectorChanged:(id)sender { diff --git a/FSExchangeObjectsCompat.c b/FSExchangeObjectsCompat.c index 8c9e864e..235226c5 100755 --- a/FSExchangeObjectsCompat.c +++ b/FSExchangeObjectsCompat.c @@ -29,12 +29,6 @@ __private_extern__ u_int32_t volumeCapabilities(const char *path) return (0); } -Boolean VolSupportsFSExchangeObjects(u_int32_t volCapabilities) -{ - return ( 0 != (volCapabilities & VOL_CAP_INT_EXCHANGEDATA)); -} - - static OSErr GenerateUniqueHFSUniStr(long *startSeed, const FSRef *dir1, const FSRef *dir2, HFSUniStr255 *uniqueName) { OSErr result; long i; @@ -93,22 +87,6 @@ static OSErr GenerateUniqueHFSUniStr(long *startSeed, const FSRef *dir1, const F return ( result ); } -Boolean VolumeOfFSRefSupportsExchangeObjects(const FSRef *fsRef) { - /* get source volume's path */ - char path[PATH_MAX+1]; - (void)FSRefMakePath(fsRef, (UInt8*)path, PATH_MAX); - - char root[PATH_MAX+1]; - root[0] = root[PATH_MAX] = 0; - struct statfs sb; - if (0 == statfs(path, &sb)) { - bcopy(sb.f_mntonname, root, MIN(PATH_MAX, sizeof(sb.f_mntonname))); - } - - /* see if that volume supports FSExchangeObjects */ - return (VolSupportsFSExchangeObjects(volumeCapabilities(root))); -} - OSErr FSExchangeObjectsEmulate(const FSRef *sourceRef, const FSRef *destRef, FSRef *newSourceRef, FSRef *newDestRef) { enum { diff --git a/FastListDataSource.h b/FastListDataSource.h index dd0db0c0..ca3a922d 100755 --- a/FastListDataSource.h +++ b/FastListDataSource.h @@ -18,6 +18,8 @@ #import +@class NoteAttributeColumn; + @interface FastListDataSource : NSObject { id *objects; NSUInteger count; @@ -40,3 +42,10 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView; @end + +@interface NSObject (FastListDataSourceColumnEditing) + +- (SEL)attributeSetterForColumn:(NoteAttributeColumn*)col; + +@end + diff --git a/FastListDataSource.m b/FastListDataSource.m index 3fd2f8a2..221079a6 100755 --- a/FastListDataSource.m +++ b/FastListDataSource.m @@ -124,13 +124,16 @@ - (void)sortStableUsingFunction:(NSInteger (*)(id *, id *))compare { - (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { - [objects[rowIndex] performSelector:columnAttributeMutator((NoteAttributeColumn*)aTableColumn) withObject:anObject]; + //allow the tableview to override the selector destination for this object value + SEL colAttributeMutator = [(NotesTableView*)aTableView attributeSetterForColumn:(NoteAttributeColumn*)aTableColumn]; + + [objects[rowIndex] performSelector:colAttributeMutator ? colAttributeMutator : columnAttributeMutator((NoteAttributeColumn*)aTableColumn) withObject:anObject]; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { - return columnAttributeForObject((NotesTableView*)aTableView, (NoteAttributeColumn*)aTableColumn, objects[rowIndex]); + return columnAttributeForObject((NotesTableView*)aTableView, (NoteAttributeColumn*)aTableColumn, objects[rowIndex], rowIndex); } - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView { diff --git a/FrozenNotation.h b/FrozenNotation.h index 731380d5..4a8e5f92 100755 --- a/FrozenNotation.h +++ b/FrozenNotation.h @@ -26,9 +26,8 @@ NotationPrefs *prefs; } - (id)initWithNotes:(NSMutableArray*)notes deletedNotes:(NSMutableSet*)antiNotes prefs:(NotationPrefs*)prefs; -+ (NSData*)frozenDataWithExistingNotes:(NSMutableArray*)notes - deletedNotes:(NSMutableSet*)antiNotes - prefs:(NotationPrefs*)prefs; + ++ (NSData*)frozenDataWithExistingNotes:(NSMutableArray*)notes deletedNotes:(NSMutableSet*)antiNotes prefs:(NotationPrefs*)prefs; - (NSMutableArray*)unpackedNotesWithPrefs:(NotationPrefs*)somePrefs returningError:(OSStatus*)err; - (NSMutableArray*)unpackedNotesReturningError:(OSStatus*)err; - (NSMutableSet*)deletedNotes; //these won't need to be encrypted diff --git a/GlobalPrefs.h b/GlobalPrefs.h index e3171a24..71836577 100755 --- a/GlobalPrefs.h +++ b/GlobalPrefs.h @@ -33,6 +33,13 @@ extern NSString *NVPTFPboardType; @class PTKeyCombo; @class PTHotKey; +enum { NoteTitleColumn, NoteLabelsColumn, NoteDateModifiedColumn, NoteDateCreatedColumn }; + +#define ColumnIsSet(__ColumnEnum, __columnsBitmap) (((1 << (__ColumnEnum)) & (__columnsBitmap)) != 0) + + +BOOL ColorsEqualWith8BitChannels(NSColor *c1, NSColor *c2); + @interface GlobalPrefs : NSObject { NSUserDefaults *defaults; @@ -44,14 +51,13 @@ extern NSString *NVPTFPboardType; BookmarksController *bookmarksController; NotationPrefs *notationPrefs; - NSDictionary *noteBodyAttributes, *searchTermHighlightAttributes, *notesListBackgroundColorAttributes; + NSDictionary *noteBodyAttributes, *searchTermHighlightAttributes; NSMutableParagraphStyle *noteBodyParagraphStyle; NSFont *noteBodyFont; - NSColor *searchTermHighlightColor; - NSColor *notesListBackgroundColor; BOOL autoCompleteSearches; - BOOL verticalLayout; + NSMutableArray *tableColumns; + unsigned int tableColsBitmap; } + (GlobalPrefs *)defaultPrefs; @@ -67,6 +73,7 @@ extern NSString *NVPTFPboardType; - (void)removeTableColumn:(NSString*)columnKey sender:(id)sender; - (void)addTableColumn:(NSString*)columnKey sender:(id)sender; - (NSArray*)visibleTableColumns; +- (unsigned int)tableColumnsBitmap; - (void)setSortedTableColumnKey:(NSString*)sortedKey reversed:(BOOL)reversed sender:(id)sender; - (NSString*)sortedTableColumnKey; @@ -76,13 +83,18 @@ extern NSString *NVPTFPboardType; - (void)setTableColumnsShowPreview:(BOOL)showPreview sender:(id)sender; - (void)resolveNoteBodyFontFromNotationPrefsFromSender:(id)sender; -- (void)_setNoteBodyFont:(NSFont*)aFont; - (void)setNoteBodyFont:(NSFont*)aFont sender:(id)sender; +- (void)_setNoteBodyFont:(NSFont*)aFont; - (NSFont*)noteBodyFont; - (NSDictionary*)noteBodyAttributes; - (NSParagraphStyle*)noteBodyParagraphStyle; - (BOOL)_bodyFontIsMonospace; +- (void)setForegroundTextColor:(NSColor*)aColor sender:(id)sender; +- (NSColor*)foregroundTextColor; +- (void)setBackgroundTextColor:(NSColor*)aColor sender:(id)sender; +- (NSColor*)backgroundTextColor; + - (void)setTabIndenting:(BOOL)value sender:(id)sender; - (BOOL)tabKeyIndents; @@ -106,48 +118,41 @@ extern NSString *NVPTFPboardType; - (void)setPastePreservesStyle:(BOOL)value sender:(id)sender; - (BOOL)pastePreservesStyle; +- (void)setAutoFormatsDoneTag:(BOOL)value sender:(id)sender; +- (BOOL)autoFormatsDoneTag; + +- (BOOL)autoIndentsNewLines; +- (void)setAutoIndentsNewLines:(BOOL)value sender:(id)sender; + +- (BOOL)autoFormatsListBullets; +- (void)setAutoFormatsListBullets:(BOOL)value sender:(id)sender; + - (void)setLinksAutoSuggested:(BOOL)value sender:(id)sender; - (BOOL)linksAutoSuggested; - (void)setMakeURLsClickable:(BOOL)value sender:(id)sender; - (BOOL)URLsAreClickable; -- (void)setRTL:(BOOL)value sender:(id)sender; -- (BOOL)rtl; - -- (void)setUseMarkdownImport:(BOOL)value sender:(id)sender; -- (BOOL)useMarkdownImport; - -- (void)setUseReadability:(BOOL)value sender:(id)sender; -- (BOOL)useReadability; - -- (void)setAlternatingRows:(BOOL)value sender:(id)sender; -- (BOOL)alternatingRows; - +- (void)setShouldHighlightSearchTerms:(BOOL)shouldHighlight sender:(id)sender; +- (BOOL)highlightSearchTerms; - (void)setSearchTermHighlightColor:(NSColor*)color sender:(id)sender; - (NSDictionary*)searchTermHighlightAttributes; -- (NSColor*)searchTermHighlightColor; - -- (void)setNotesListBackgroundColor:(NSColor*)color sender:(id)sender; -- (NSDictionary*)notesListBackgroundColorAttributes; -- (NSColor*)notesListBackgroundColor; +- (NSColor*)searchTermHighlightColorRaw:(BOOL)isRaw; - (void)setSoftTabs:(BOOL)value sender:(id)sender; - (BOOL)softTabs; - (int)numberOfSpacesInTab; -- (BOOL)drawFocusRing; - - (float)tableFontSize; - (void)setTableFontSize:(float)fontSize sender:(id)sender; +- (void)setHorizontalLayout:(BOOL)value sender:(id)sender; +- (BOOL)horizontalLayout; + - (BOOL)autoCompleteSearches; - (void)setAutoCompleteSearches:(BOOL)value sender:(id)sender; -- (BOOL)verticalLayout; -- (void)setVerticalLayout:(BOOL)value sender:(id)sender; - - (NSString*)lastSelectedPreferencesPane; - (void)setLastSelectedPreferencesPane:(NSString*)pane sender:(id)sender; @@ -171,10 +176,26 @@ extern NSString *NVPTFPboardType; - (void)synchronize; +// +- (NSString *)textEditor; +- (void)setTextEditor:(NSString *)inApp; +- (BOOL)managesTextWidthInWindow; +- (int)maxNoteBodyWidth; +- (void)setMaxNoteBodyWidth:(int)maxWidth; +- (void)setRTL:(BOOL)value sender:(id)sender; +- (BOOL)rtl; +- (BOOL)showWordCount; +- (void)setShowWordCount:(BOOL)value; +- (void)setUseMarkdownImport:(BOOL)value sender:(id)sender; +- (BOOL)useMarkdownImport; +- (void)setUseReadability:(BOOL)value sender:(id)sender; +- (BOOL)useReadability; +- (void)setShowGrid:(BOOL)value sender:(id)sender; +- (BOOL)showGrid; +- (void)setAlternatingRows:(BOOL)value sender:(id)sender; +- (BOOL)alternatingRows; @end @interface NSObject (GlobalPrefsDelegate) - (void)settingChangedForSelectorString:(NSString*)selectorString; @end - - diff --git a/GlobalPrefs.m b/GlobalPrefs.m index df4c43cf..eb389db4 100755 --- a/GlobalPrefs.m +++ b/GlobalPrefs.m @@ -15,7 +15,10 @@ - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. */ +/*[NSArchiver archivedDataWithRootObject:[NSColor colorWithCalibratedRed:0.74f green:0.74f blue:0.74f alpha:1.0f]], ForegroundTextColorKey, + [NSArchiver archivedDataWithRootObject:[NSColor colorWithCalibratedRed:0.082f green:0.082f blue:0.082f alpha:1.0f]], BackgroundTextColorKey,*/ +#import "AppController.h" #import "GlobalPrefs.h" #import "NSData_transformations.h" #import "NotationPrefs.h" @@ -33,8 +36,7 @@ static NSString *TriedToImportBlorKey = @"TriedToImportBlor"; static NSString *DirectoryAliasKey = @"DirectoryAlias"; static NSString *AutoCompleteSearchesKey = @"AutoCompleteSearches"; -static NSString *VerticalLayoutKey = @"VerticalLayout"; -static NSString *TableColumnsVisibleKey = @"TableColumnsVisible"; +static NSString *NoteAttributesVisibleKey = @"NoteAttributesVisible"; static NSString *TableFontSizeKey = @"TableFontPointSize"; static NSString *TableSortColumnKey = @"TableSortColumn"; static NSString *TableIsReverseSortedKey = @"TableIsReverseSorted"; @@ -46,25 +48,39 @@ static NSString *QuitWhenClosingMainWindowKey = @"QuitWhenClosingMainWindow"; static NSString *TabKeyIndentsKey = @"TabKeyIndents"; static NSString *PastePreservesStyleKey = @"PastePreservesStyle"; +static NSString *AutoFormatsDoneTagKey = @"AutoFormatsDoneTag"; +static NSString *AutoFormatsListBulletsKey = @"AutoFormatsListBullets"; static NSString *AutoSuggestLinksKey = @"AutoSuggestLinks"; +static NSString *AutoIndentsNewLinesKey = @"AutoIndentsNewLines"; +static NSString *HighlightSearchTermsKey = @"HighlightSearchTerms"; static NSString *SearchTermHighlightColorKey = @"SearchTermHighlightColor"; -static NSString *NotesListBackgroundColorKey = @"NotesListBackGroundColor"; +static NSString *ForegroundTextColorKey = @"ForegroundTextColor"; +static NSString *BackgroundTextColorKey = @"BackgroundTextColor"; static NSString *UseSoftTabsKey = @"UseSoftTabs"; static NSString *NumberOfSpacesInTabKey = @"NumberOfSpacesInTab"; -static NSString *DrawFocusRingKey = @"DrawFocusRing"; static NSString *MakeURLsClickableKey = @"MakeURLsClickable"; -static NSString *RTLKey = @"rtl"; -static NSString *UseMarkdownImportKey = @"UseMarkdownImport"; -static NSString *UseReadabilityKey = @"UseReadability"; -static NSString *AlternatingRowsKey = @"AlternatingRows"; static NSString *AppActivationKeyCodeKey = @"AppActivationKeyCode"; static NSString *AppActivationModifiersKey = @"AppActivationModifiers"; +static NSString *HorizontalLayoutKey = @"HorizontalLayout"; static NSString *BookmarksKey = @"Bookmarks"; static NSString *LastScrollOffsetKey = @"LastScrollOffset"; static NSString *LastSearchStringKey = @"LastSearchString"; static NSString *LastSelectedNoteUUIDBytesKey = @"LastSelectedNoteUUIDBytes"; static NSString *LastSelectedPreferencesPaneKey = @"LastSelectedPrefsPane"; - +//elasticthreads prefs +static NSString *StatusBarItem = @"StatusBarItem"; +static NSString *HideDockIcon = @"HideDockIcon"; +static NSString *KeepsMaxTextWidth = @"KeepsMaxTextWidth"; +static NSString *NoteBodyMaxWidth = @"NoteBodyMaxWidth"; +static NSString *ColorScheme = @"ColorScheme"; +static NSString *TextEditor = @"TextEditor"; +static NSString *UseMarkdownImportKey = @"UseMarkdownImport"; +static NSString *UseReadabilityKey = @"UseReadability"; +static NSString *ShowGridKey = @"ShowGrid"; +static NSString *AlternatingRowsKey = @"AlternatingRows"; +static NSString *RTLKey = @"rtl"; +static NSString *ShowWordCount = @"ShowWordCount"; +static NSString *markupPreviewMode = @"markupPreviewMode"; //static NSString *PasteClipboardOnNewNoteKey = @"PasteClipboardOnNewNote"; //these 4 strings manually localized @@ -80,6 +96,7 @@ NSString *HotKeyAppToFrontName = @"bring Notational Velocity to the foreground"; + @implementation GlobalPrefs static void sendCallbacksForGlobalPrefs(GlobalPrefs* self, SEL selector, id originalSender) { @@ -101,7 +118,10 @@ - (id)init { tableColumns = nil; [defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:NO], AutoSuggestLinksKey, + [NSNumber numberWithBool:YES], AutoSuggestLinksKey, + [NSNumber numberWithBool:YES], AutoFormatsDoneTagKey, + [NSNumber numberWithBool:YES], AutoIndentsNewLinesKey, + [NSNumber numberWithBool:YES], AutoFormatsListBulletsKey, [NSNumber numberWithBool:NO], UseSoftTabsKey, [NSNumber numberWithInt:4], NumberOfSpacesInTabKey, [NSNumber numberWithBool:YES], PastePreservesStyleKey, @@ -110,35 +130,42 @@ - (id)init { [NSNumber numberWithBool:YES], CheckSpellingInNoteBodyKey, [NSNumber numberWithBool:NO], TextReplacementInNoteBodyKey, [NSNumber numberWithBool:YES], AutoCompleteSearchesKey, - [NSNumber numberWithBool:NO], VerticalLayoutKey, - [NSNumber numberWithBool:YES], QuitWhenClosingMainWindowKey, + [NSNumber numberWithBool:YES], QuitWhenClosingMainWindowKey, [NSNumber numberWithBool:NO], TriedToImportBlorKey, - [NSNumber numberWithBool:NO], DrawFocusRingKey, + [NSNumber numberWithBool:NO], HorizontalLayoutKey, [NSNumber numberWithBool:YES], MakeURLsClickableKey, - [NSNumber numberWithBool:NO], RTLKey, - [NSNumber numberWithBool:NO], UseMarkdownImportKey, - [NSNumber numberWithBool:NO], UseReadabilityKey, - [NSNumber numberWithBool:YES], AlternatingRowsKey, + [NSNumber numberWithBool:YES], HighlightSearchTermsKey, [NSNumber numberWithBool:YES], TableColumnsHaveBodyPreviewKey, [NSNumber numberWithDouble:0.0], LastScrollOffsetKey, @"General", LastSelectedPreferencesPaneKey, + [NSNumber numberWithBool:NO], StatusBarItem, + [NSNumber numberWithBool:NO], KeepsMaxTextWidth, + [NSNumber numberWithInt:600], NoteBodyMaxWidth, + [NSNumber numberWithInt:2], ColorScheme, + @"Hide Dock Icon",HideDockIcon, + [NSNumber numberWithBool:NO], RTLKey, + [NSNumber numberWithBool:YES], ShowWordCount, + [NSNumber numberWithInt:MultiMarkdownPreview], markupPreviewMode, + [NSNumber numberWithBool:NO], UseMarkdownImportKey, + [NSNumber numberWithBool:NO], UseReadabilityKey, + [NSNumber numberWithBool:YES], ShowGridKey, + [NSNumber numberWithBool:NO], AlternatingRowsKey, [NSArchiver archivedDataWithRootObject: [NSFont fontWithName:@"Helvetica" size:12.0f]], NoteBodyFontKey, - //[NSArchiver archivedDataWithRootObject: - // [NSColor colorWithCalibratedRed:0.9340 green:0.91415775 blue:0.81043575 alpha:1.0f]], SearchTermHighlightColorKey, + [NSArchiver archivedDataWithRootObject:[NSColor blackColor]], ForegroundTextColorKey, + [NSArchiver archivedDataWithRootObject:[NSColor whiteColor]], BackgroundTextColorKey, + [NSArchiver archivedDataWithRootObject: [NSColor colorWithCalibratedRed:0.945 green:0.702 blue:0.702 alpha:1.0f]], SearchTermHighlightColorKey, - [NSArchiver archivedDataWithRootObject: - [NSColor colorWithCalibratedWhite:1.000 alpha:1.000]], NotesListBackgroundColorKey, + [NSNumber numberWithFloat:[NSFont smallSystemFontSize]], TableFontSizeKey, - [NSArray arrayWithObjects:NoteTitleColumnString, NoteDateModifiedColumnString, nil], TableColumnsVisibleKey, + [NSArray arrayWithObjects:NoteTitleColumnString, NoteLabelsColumnString, NoteDateModifiedColumnString, nil], NoteAttributesVisibleKey, NoteDateModifiedColumnString, TableSortColumnKey, [NSNumber numberWithBool:YES], TableIsReverseSortedKey, nil]]; autoCompleteSearches = [defaults boolForKey:AutoCompleteSearchesKey]; - verticalLayout = [defaults boolForKey:VerticalLayoutKey]; } return self; } @@ -240,17 +267,6 @@ - (void)setAutoCompleteSearches:(BOOL)value sender:(id)sender { SEND_CALLBACKS(); } -- (BOOL)verticalLayout { - return verticalLayout; -} - -- (void)setVerticalLayout:(BOOL)value sender:(id)sender { - verticalLayout = value; - [defaults setBool:value forKey:VerticalLayoutKey]; - - SEND_CALLBACKS(); -} - - (void)setTabIndenting:(BOOL)value sender:(id)sender { [defaults setBool:value forKey:TabKeyIndentsKey]; @@ -297,6 +313,7 @@ - (void)setQuitWhenClosingWindow:(BOOL)value sender:(id)sender { - (BOOL)quitWhenClosingWindow { return [defaults boolForKey:QuitWhenClosingMainWindowKey]; } + - (void)setAppActivationKeyCombo:(PTKeyCombo*)aCombo sender:(id)sender { if (aCombo) { [appActivationKeyCombo release]; @@ -351,6 +368,32 @@ - (BOOL)pastePreservesStyle { return [defaults boolForKey:PastePreservesStyleKey]; } +- (void)setAutoFormatsDoneTag:(BOOL)value sender:(id)sender { + [defaults setBool:value forKey:AutoFormatsDoneTagKey]; + + SEND_CALLBACKS(); +} +- (BOOL)autoFormatsDoneTag { + return [defaults boolForKey:AutoFormatsDoneTagKey]; +} +- (BOOL)autoFormatsListBullets { + return [defaults boolForKey:AutoFormatsListBulletsKey]; +} +- (void)setAutoFormatsListBullets:(BOOL)value sender:(id)sender { + [defaults setBool:value forKey:AutoFormatsListBulletsKey]; + + SEND_CALLBACKS(); +} + +- (BOOL)autoIndentsNewLines { + return [defaults boolForKey:AutoIndentsNewLinesKey]; +} +- (void)setAutoIndentsNewLines:(BOOL)value sender:(id)sender { + [defaults setBool:value forKey:AutoIndentsNewLinesKey]; + + SEND_CALLBACKS(); +} + - (void)setLinksAutoSuggested:(BOOL)value sender:(id)sender { [defaults setBool:value forKey:AutoSuggestLinksKey]; @@ -368,6 +411,7 @@ - (void)setMakeURLsClickable:(BOOL)value sender:(id)sender { - (BOOL)URLsAreClickable { return [defaults boolForKey:MakeURLsClickableKey]; } + - (void)setRTL:(BOOL)value sender:(id)sender { [defaults setBool:value forKey:RTLKey]; @@ -376,6 +420,15 @@ - (void)setRTL:(BOOL)value sender:(id)sender { - (BOOL)rtl { return [defaults boolForKey:RTLKey]; } + +- (BOOL)showWordCount{ + return [defaults boolForKey:ShowWordCount]; +} + +- (void)setShowWordCount:(BOOL)value{ + [defaults setBool:value forKey:ShowWordCount]; +} + - (void)setUseMarkdownImport:(BOOL)value sender:(id)sender { [defaults setBool:value forKey:UseMarkdownImportKey]; @@ -393,6 +446,14 @@ - (BOOL)useReadability { return [defaults boolForKey:UseReadabilityKey]; } +- (void)setShowGrid:(BOOL)value sender:(id)sender { + [defaults setBool:value forKey:ShowGridKey]; + + SEND_CALLBACKS(); +} +- (BOOL)showGrid { + return [defaults boolForKey:ShowGridKey]; +} - (void)setAlternatingRows:(BOOL)value sender:(id)sender { [defaults setBool:value forKey:AlternatingRowsKey]; @@ -401,79 +462,55 @@ - (void)setAlternatingRows:(BOOL)value sender:(id)sender { - (BOOL)alternatingRows { return [defaults boolForKey:AlternatingRowsKey]; } + + +- (void)setShouldHighlightSearchTerms:(BOOL)shouldHighlight sender:(id)sender { + [defaults setBool:shouldHighlight forKey:HighlightSearchTermsKey]; + + SEND_CALLBACKS(); +} +- (BOOL)highlightSearchTerms { + return [defaults boolForKey:HighlightSearchTermsKey]; +} + - (void)setSearchTermHighlightColor:(NSColor*)color sender:(id)sender { if (color) { - [searchTermHighlightColor autorelease]; - searchTermHighlightColor = [color retain]; [searchTermHighlightAttributes release]; searchTermHighlightAttributes = nil; - [defaults setObject:[NSArchiver archivedDataWithRootObject:color] - forKey:SearchTermHighlightColorKey]; + [defaults setObject:[NSArchiver archivedDataWithRootObject:color] forKey:SearchTermHighlightColorKey]; SEND_CALLBACKS(); } } -- (NSColor*)searchTermHighlightColor { +- (NSColor*)searchTermHighlightColorRaw:(BOOL)isRaw { - if (!searchTermHighlightColor) { - NSData *theData = [defaults dataForKey:SearchTermHighlightColorKey]; - if (theData) - searchTermHighlightColor = (NSColor *)[[NSUnarchiver unarchiveObjectWithData:theData] retain]; + NSData *theData = [defaults dataForKey:SearchTermHighlightColorKey]; + if (theData) { + NSColor *color = (NSColor *)[NSUnarchiver unarchiveObjectWithData:theData]; + if (isRaw) return color; + if (color) { + //nslayoutmanager temporary attributes don't seem to like alpha components, so synthesize translucency using the bg color + NSColor *fauxAlphaSTHC = [[color colorUsingColorSpaceName:NSCalibratedRGBColorSpace] colorWithAlphaComponent:1.0]; + return [fauxAlphaSTHC blendedColorWithFraction:(1.0 - [color alphaComponent]) ofColor:[self backgroundTextColor]]; + } } - - return searchTermHighlightColor; + + return nil; } - (NSDictionary*)searchTermHighlightAttributes { - NSColor *highlightColor = [self searchTermHighlightColor]; + NSColor *highlightColor = nil; - if (!searchTermHighlightAttributes && highlightColor) { + if (!searchTermHighlightAttributes && (highlightColor = [self searchTermHighlightColorRaw:NO])) { searchTermHighlightAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:highlightColor, NSBackgroundColorAttributeName, nil] retain]; } return searchTermHighlightAttributes; } -- (void)setNotesListBackgroundColor:(NSColor*)color sender:(id)sender { - if (color) { - [notesListBackgroundColor autorelease]; - notesListBackgroundColor = [color retain]; - - [notesListBackgroundColorAttributes release]; - notesListBackgroundColorAttributes = nil; - - [defaults setObject:[NSArchiver archivedDataWithRootObject:color] - forKey:NotesListBackgroundColorKey]; - - SEND_CALLBACKS(); - } -} - -- (NSColor*)notesListBackgroundColor { - - if (!notesListBackgroundColor) { - NSData *theData = [defaults dataForKey:NotesListBackgroundColorKey]; - if (theData) - notesListBackgroundColor = (NSColor *)[[NSUnarchiver unarchiveObjectWithData:theData] retain]; - } - - return notesListBackgroundColor; -} - -- (NSDictionary*)notesListBackgroundColorAttributes { - NSColor *backgroundColor = [self notesListBackgroundColor]; - - if (!notesListBackgroundColorAttributes && backgroundColor) { - notesListBackgroundColorAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:backgroundColor, NSBackgroundColorAttributeName, nil] retain]; - } - return notesListBackgroundColorAttributes; - -} - - - (void)setSoftTabs:(BOOL)value sender:(id)sender { [defaults setBool:value forKey:UseSoftTabsKey]; @@ -488,8 +525,16 @@ - (int)numberOfSpacesInTab { return [defaults integerForKey:NumberOfSpacesInTabKey]; } -- (BOOL)drawFocusRing { - return [defaults boolForKey:DrawFocusRingKey]; +BOOL ColorsEqualWith8BitChannels(NSColor *c1, NSColor *c2) { + //sometimes floating point numbers really don't like to be compared to each other + + CGFloat pRed, pGreen, pBlue, gRed, gGreen, gBlue, pAlpha, gAlpha; + [[c1 colorUsingColorSpaceName:NSCalibratedRGBColorSpace] getRed:&pRed green:&pGreen blue:&pBlue alpha:&pAlpha]; + [[c2 colorUsingColorSpaceName:NSCalibratedRGBColorSpace] getRed:&gRed green:&gGreen blue:&gBlue alpha:&gAlpha]; + +#define SCR(__ch) ((int)roundf(((__ch) * 255.0))) + + return (SCR(pRed) == SCR(gRed) && SCR(pBlue) == SCR(gBlue) && SCR(pGreen) == SCR(gGreen) && SCR(pAlpha) == SCR(gAlpha)); } - (void)resolveNoteBodyFontFromNotationPrefsFromSender:(id)sender { @@ -565,16 +610,42 @@ - (NSFont*)noteBodyFont { - (NSDictionary*)noteBodyAttributes { NSFont *bodyFont = [self noteBodyFont]; - if (!noteBodyAttributes && bodyFont) { - BOOL monospace = [self _bodyFontIsMonospace]; + //NSLog(@"notebody att2"); + + NSMutableDictionary *attrs = [[NSMutableDictionary dictionaryWithObjectsAndKeys:bodyFont, NSFontAttributeName, nil] retain]; - noteBodyAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:bodyFont, NSFontAttributeName, - [NSNumber numberWithInt:0], NSLigatureAttributeName, - monospace ? [self noteBodyParagraphStyle] : nil, NSParagraphStyleAttributeName, - /*[NSColor blackColor], NSForegroundColorAttributeName, - [NSColor whiteColor], NSBackgroundColorAttributeName,*/ nil] retain]; + //not storing the foreground color in each note will make the database smaller, and black is assumed when drawing text + //NSColor *fgColor = [self foregroundTextColor]; + NSColor *fgColor = [[NSApp delegate] foregrndColor]; + + if (!ColorsEqualWith8BitChannels([NSColor blackColor], fgColor)) { + // NSLog(@"golly1"); + [attrs setObject:fgColor forKey:NSForegroundColorAttributeName]; + } + // background text color is handled directly by the NSTextView subclass and so does not need to be stored here + if ([self _bodyFontIsMonospace]) { + + // NSLog(@"notebody att3"); + NSParagraphStyle *pStyle = [self noteBodyParagraphStyle]; + if (pStyle) + [attrs setObject:pStyle forKey:NSParagraphStyleAttributeName]; + } + /*NSTextWritingDirectionEmbedding*/ + //[NSArray arrayWithObjects:[NSNumber numberWithInt:0], [NSNumber numberWithInt:0], nil], @"NSWritingDirection", //for auto-LTR-RTL text + noteBodyAttributes = attrs; + }else { + //NSLog(@"notebody att4"); + NSMutableDictionary *attrs = [[NSMutableDictionary dictionaryWithObjectsAndKeys:bodyFont, NSFontAttributeName, nil] retain]; + NSColor *fgColor = [[NSApp delegate] foregrndColor]; + + // if (!ColorsEqualWith8BitChannels([NSColor blackColor], fgColor)) { + //NSLog(@"golly122"); + [attrs setObject:fgColor forKey:NSForegroundColorAttributeName]; + noteBodyAttributes = attrs; + // } } + return noteBodyAttributes; } @@ -613,6 +684,47 @@ - (NSParagraphStyle*)noteBodyParagraphStyle { return noteBodyParagraphStyle; } +- (void)setForegroundTextColor:(NSColor*)aColor sender:(id)sender { + if (aColor) { + [noteBodyAttributes release]; + noteBodyAttributes = nil; + + [defaults setObject:[NSArchiver archivedDataWithRootObject:aColor] forKey:ForegroundTextColorKey]; + + SEND_CALLBACKS(); + } +} + +- (NSColor*)foregroundTextColor { + NSData *theData = [defaults dataForKey:ForegroundTextColorKey]; + if (theData) return (NSColor *)[NSUnarchiver unarchiveObjectWithData:theData]; + return nil; +} + +- (void)setBackgroundTextColor:(NSColor*)aColor sender:(id)sender { + + if (aColor) { + //highlight color is based on blended-alpha version of background color + //(because nslayoutmanager temporary attributes don't seem to like alpha components) + //so it's necessary to invalidate the effective cache of that computed highlight color + [searchTermHighlightAttributes release]; + searchTermHighlightAttributes = nil; + + [defaults setObject:[NSArchiver archivedDataWithRootObject:aColor] forKey:BackgroundTextColorKey]; + + SEND_CALLBACKS(); + } +} + +- (NSColor*)backgroundTextColor { + //don't need to cache the unarchived color, as it's not used in a random-access pattern + + NSData *theData = [defaults dataForKey:BackgroundTextColorKey]; + if (theData) return (NSColor *)[NSUnarchiver unarchiveObjectWithData:theData]; + + return nil; +} + - (BOOL)tableColumnsShowPreview { return [defaults boolForKey:TableColumnsHaveBodyPreviewKey]; } @@ -635,22 +747,28 @@ - (void)setTableFontSize:(float)fontSize sender:(id)sender { - (void)removeTableColumn:(NSString*)columnKey sender:(id)sender { [tableColumns removeObject:columnKey]; - [defaults setObject:tableColumns forKey:TableColumnsVisibleKey]; + tableColsBitmap = 0U; + + [defaults setObject:tableColumns forKey:NoteAttributesVisibleKey]; SEND_CALLBACKS(); } - (void)addTableColumn:(NSString*)columnKey sender:(id)sender { if (![tableColumns containsObject:columnKey]) { [tableColumns addObject:columnKey]; - [defaults setObject:tableColumns forKey:TableColumnsVisibleKey]; + tableColsBitmap = 0U; + + [defaults setObject:tableColumns forKey:NoteAttributesVisibleKey]; SEND_CALLBACKS(); } } - (NSArray*)visibleTableColumns { - if (!tableColumns) - tableColumns = [[NSMutableArray arrayWithArray:[defaults arrayForKey:TableColumnsVisibleKey]] retain]; + if (!tableColumns) { + tableColumns = [[NSMutableArray arrayWithArray:[defaults arrayForKey:NoteAttributesVisibleKey]] retain]; + tableColsBitmap = 0U; + } if (![tableColumns count]) [self addTableColumn:NoteTitleColumnString sender:self]; @@ -658,6 +776,21 @@ - (NSArray*)visibleTableColumns { return tableColumns; } + +- (unsigned int)tableColumnsBitmap { + if (tableColsBitmap == 0U) { + if ([tableColumns containsObject:NoteTitleColumnString]) + tableColsBitmap = (tableColsBitmap | (1 << NoteTitleColumn)); + if ([tableColumns containsObject:NoteLabelsColumnString]) + tableColsBitmap = (tableColsBitmap | (1 << NoteLabelsColumn)); + if ([tableColumns containsObject:NoteDateModifiedColumnString]) + tableColsBitmap = (tableColsBitmap | (1 << NoteDateModifiedColumn)); + if ([tableColumns containsObject:NoteDateCreatedColumnString]) + tableColsBitmap = (tableColsBitmap | (1 << NoteDateCreatedColumn)); + } + return tableColsBitmap; +} + - (void)setSortedTableColumnKey:(NSString*)sortedKey reversed:(BOOL)reversed sender:(id)sender { [defaults setBool:reversed forKey:TableIsReverseSortedKey]; [defaults setObject:sortedKey forKey:TableSortColumnKey]; @@ -673,6 +806,17 @@ - (BOOL)tableIsReverseSorted { return [defaults boolForKey:TableIsReverseSortedKey]; } +- (void)setHorizontalLayout:(BOOL)value sender:(id)sender { + if ([self horizontalLayout] != value) { + [defaults setBool:value forKey:HorizontalLayoutKey]; + + SEND_CALLBACKS(); + } +} +- (BOOL)horizontalLayout { + return [defaults boolForKey:HorizontalLayoutKey]; +} + - (NSString*)lastSelectedPreferencesPane { return [defaults stringForKey:LastSelectedPreferencesPaneKey]; } @@ -838,4 +982,37 @@ - (void)synchronize { [defaults synchronize]; } +//elasticthreads' work + +- (NSString *)textEditor{ + NSString *theData = [defaults stringForKey:TextEditor]; + if (theData){ + return theData; + } else { + //[self setTextEditor:@"Default"]; + //return @"Default"; + return nil; + } +} + +- (void)setTextEditor:(NSString *)inApp{ + //if (inApp) { + [defaults setObject:inApp forKey:TextEditor]; + [defaults synchronize]; + //} +} + +- (BOOL)managesTextWidthInWindow{ + return [defaults boolForKey:KeepsMaxTextWidth]; +} + +- (int)maxNoteBodyWidth{ + return [defaults integerForKey:NoteBodyMaxWidth]; +} + +- (void)setMaxNoteBodyWidth:(int)maxWidth{ + [defaults setInteger:maxWidth forKey:NoteBodyMaxWidth]; + [defaults synchronize]; +} + @end diff --git a/Images/Clear.tif b/Images/Clear.tif old mode 100755 new mode 100644 diff --git a/Images/ClearPressed.tif b/Images/ClearPressed.tif old mode 100755 new mode 100644 diff --git a/Images/DFCapLeftRounded.png b/Images/DFCapLeftRounded.png old mode 100755 new mode 100644 diff --git a/Images/DFCapLeftRoundedInactive.png b/Images/DFCapLeftRoundedInactive.png old mode 100755 new mode 100644 diff --git a/Images/DFCapRight.png b/Images/DFCapRight.png old mode 100755 new mode 100644 diff --git a/Images/DFCapRightInactive.png b/Images/DFCapRightInactive.png old mode 100755 new mode 100644 diff --git a/Images/Editing.tiff b/Images/Editing.tiff old mode 100644 new mode 100755 index 5d8d5deb..a851c96a Binary files a/Images/Editing.tiff and b/Images/Editing.tiff differ diff --git a/Images/Fonts & Colors.tiff b/Images/Fonts & Colors.tiff new file mode 100644 index 00000000..335b9307 Binary files /dev/null and b/Images/Fonts & Colors.tiff differ diff --git a/Images/General.tiff b/Images/General.tiff old mode 100644 new mode 100755 index fa025c61..5fd226bc Binary files a/Images/General.tiff and b/Images/General.tiff differ diff --git a/Images/HUDIconLock.png b/Images/HUDIconLock.png new file mode 100644 index 00000000..78ab214e Binary files /dev/null and b/Images/HUDIconLock.png differ diff --git a/Images/HUDIconPrint.png b/Images/HUDIconPrint.png new file mode 100644 index 00000000..b9d70aa2 Binary files /dev/null and b/Images/HUDIconPrint.png differ diff --git a/Images/HUDIconSave.png b/Images/HUDIconSave.png new file mode 100644 index 00000000..3ad741c4 Binary files /dev/null and b/Images/HUDIconSave.png differ diff --git a/Images/HUDIconShare.png b/Images/HUDIconShare.png new file mode 100644 index 00000000..b3546834 Binary files /dev/null and b/Images/HUDIconShare.png differ diff --git a/Images/IBeamInverted.png b/Images/IBeamInverted.png new file mode 100644 index 00000000..db228ee0 Binary files /dev/null and b/Images/IBeamInverted.png differ diff --git a/Images/LinkBack.tif b/Images/LinkBack.tif new file mode 100644 index 00000000..fd7a1c48 Binary files /dev/null and b/Images/LinkBack.tif differ diff --git a/Images/LinkBackPressed.tif b/Images/LinkBackPressed.tif new file mode 100644 index 00000000..5c96f27b Binary files /dev/null and b/Images/LinkBackPressed.tif differ diff --git a/Images/ListDividerDrag.png b/Images/ListDividerDrag.png new file mode 100644 index 00000000..93ccb1e4 Binary files /dev/null and b/Images/ListDividerDrag.png differ diff --git a/Images/MakeDefault.tiff b/Images/MakeDefault.tiff new file mode 100644 index 00000000..6dc5d232 Binary files /dev/null and b/Images/MakeDefault.tiff differ diff --git a/Images/MakeDefault_Pressed.tiff b/Images/MakeDefault_Pressed.tiff new file mode 100644 index 00000000..8c6cfcc8 Binary files /dev/null and b/Images/MakeDefault_Pressed.tiff differ diff --git a/Images/Notes.tiff b/Images/Notes.tiff old mode 100644 new mode 100755 index b371ca3b..dc917e4c Binary files a/Images/Notes.tiff and b/Images/Notes.tiff differ diff --git a/Images/Pencil.png b/Images/Pencil.png old mode 100755 new mode 100644 diff --git a/Images/Search.png b/Images/Search.png old mode 100755 new mode 100644 diff --git a/Images/SnapBack.tif b/Images/SnapBack.tif old mode 100755 new mode 100644 diff --git a/Images/SnapBackPressed.tif b/Images/SnapBackPressed.tif old mode 100755 new mode 100644 diff --git a/Images/TBAlert.png b/Images/TBAlert.png old mode 100755 new mode 100644 diff --git a/Images/TBAlertWhite.png b/Images/TBAlertWhite.png old mode 100755 new mode 100644 diff --git a/Images/TBDownArrow.png b/Images/TBDownArrow.png old mode 100755 new mode 100644 diff --git a/Images/TBDownArrowWhite.png b/Images/TBDownArrowWhite.png old mode 100755 new mode 100644 diff --git a/Images/TBMousedownBG.png b/Images/TBMousedownBG.png old mode 100755 new mode 100644 diff --git a/Images/TBRolloverBG.png b/Images/TBRolloverBG.png old mode 100755 new mode 100644 diff --git a/Images/TBSynchronizing.png b/Images/TBSynchronizing.png old mode 100755 new mode 100644 diff --git a/Images/TBSynchronizingWhite.png b/Images/TBSynchronizingWhite.png old mode 100755 new mode 100644 diff --git a/Images/TinyAlert.tif b/Images/TinyAlert.tif old mode 100755 new mode 100644 diff --git a/Images/nvMenu.bak.png b/Images/nvMenu.bak.png new file mode 100644 index 00000000..1e063c6f Binary files /dev/null and b/Images/nvMenu.bak.png differ diff --git a/Images/nvMenu.png b/Images/nvMenu.png new file mode 100644 index 00000000..dbc7c493 Binary files /dev/null and b/Images/nvMenu.png differ diff --git a/Images/nvMenuC.bak.png b/Images/nvMenuC.bak.png new file mode 100644 index 00000000..c73b62e8 Binary files /dev/null and b/Images/nvMenuC.bak.png differ diff --git a/Images/nvMenuC.png b/Images/nvMenuC.png new file mode 100644 index 00000000..039c17e3 Binary files /dev/null and b/Images/nvMenuC.png differ diff --git a/Images/nvMenuDark.bak.png b/Images/nvMenuDark.bak.png new file mode 100644 index 00000000..4dbabcaa Binary files /dev/null and b/Images/nvMenuDark.bak.png differ diff --git a/Images/nvMenuDark.png b/Images/nvMenuDark.png new file mode 100644 index 00000000..483bad6d Binary files /dev/null and b/Images/nvMenuDark.png differ diff --git a/Images/statusError.png b/Images/statusError.png old mode 100755 new mode 100644 diff --git a/Images/statusInProgress.png b/Images/statusInProgress.png old mode 100755 new mode 100644 diff --git a/Images/statusValidated.png b/Images/statusValidated.png old mode 100755 new mode 100644 diff --git a/Info.plist b/Info.plist index 5b3ea17e..31da990d 100755 --- a/Info.plist +++ b/Info.plist @@ -101,8 +101,6 @@ text utf8 utxt - md - markdown CFBundleTypeName NSStringPboardType @@ -132,40 +130,57 @@ CFBundleExecutable - Notational Velocity + nvALT CFBundleGetInfoString - nvALT 1.0 by Brett Terpstra, based on NV 2.0 β3mmd2, Copyright © 2010 Zachary Schneirov, Christian Tietze, All Rights Reserved. + nvALT by ElasticThreads and Brett Terpstra, based on NV 2.0 β4 Copyright © 2010 Zachary Schneirov, All Rights Reserved. CFBundleIconFile - Notality + Notality.icns CFBundleIdentifier - net.brettterpstra.nvalt + net.elasticthreads.nv CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType APPL CFBundleShortVersionString - 1.0.7 + 2.1b CFBundleSignature N†l√ + CFBundleURLTypes + + + CFBundleURLName + net.elasticthreads.nv + + + CFBundleURLSchemes + + nv + + + CFBundleVersion - 1.0.7 + 60 + LSApplicationCategoryType + public.app-category.productivity + LSArchitecturePriority + + x86_64 + i386 + ppc + LSMinimumSystemVersion - 10.5 + 10.4.4 LSMinimumSystemVersionByArchitecture i386 - 10.5 + 10.4.4 x86_64 10.6.0 - ppc - 10.5 - LSArchitecturePriority - - x86_64 - i386 - ppc - + LSUIElement + + NSAppleScriptEnabled + NSMainNibFile MainMenu NSPrincipalClass @@ -181,12 +196,12 @@ NSMenuItem default - NV: New Note With Selection + nvALT: New Note With Selection NSMessage createFromSelection NSPortName - Notational Velocity + nvALT NSSendTypes NSRTFDPboardType @@ -199,34 +214,23 @@ + OSAScriptingDefinition + Notation.sdef SUCheckAtStartup - SUScheduledCheckInterval - 345600 SUFeedURL http://abyss.designheresy.com/nvalt/updates.xml SUPublicDSAKeyFile dsa_pub.pem - NSAppleScriptEnabled - - OSAScriptingDefinition - Notation.sdef - CFBundleURLTypes - - - CFBundleURLName - net.notational.velocity - - - CFBundleURLSchemes - - nv - - - + SUScheduledCheckInterval + 345600 SmartCrashReports_CompanyName Notational.net SmartCrashReports_EmailTicket SCR-51ED0F7B2A + UTExportedTypeDeclarations + + UTImportedTypeDeclarations + diff --git a/InvocationRecorder.h b/InvocationRecorder.h old mode 100755 new mode 100644 diff --git a/InvocationRecorder.m b/InvocationRecorder.m old mode 100755 new mode 100644 index 081dcab8..072c1117 --- a/InvocationRecorder.m +++ b/InvocationRecorder.m @@ -107,4 +107,4 @@ - (NSString*)description { return [NSString stringWithFormat:@"%@: %s", [self target], [self selector]]; } -@end \ No newline at end of file +@end diff --git a/Italian.lproj/BlorPasswordRetriever.nib/designable.nib b/Italian.lproj/BlorPasswordRetriever.nib/designable.nib new file mode 100644 index 00000000..eb29bcad --- /dev/null +++ b/Italian.lproj/BlorPasswordRetriever.nib/designable.nib @@ -0,0 +1,641 @@ + + + + 1060 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + BlorPasswordRetriever + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{181, 320}, {507, 172}} + 1886912512 + Inserisci la parola d'ordine + NSPanel + + View + + {1.79769e+308, 1.79769e+308} + {378, 110} + + + 256 + + YES + + + 266 + {{92, 90}, {398, 62}} + + YES + + 69336577 + 272629760 + Per favore, inserisci la parola d'ordine per importare le vecchie note da BLAH BLAH BLAH BLAH PATH BLAH BLAH + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 289 + {{403, 12}, {90, 32}} + + YES + + 604110336 + 134217728 + Importa + + + -2038284033 + 1 + + + DQ + 200 + 25 + + + + + 289 + {{315, 12}, {88, 32}} + + YES + + 67239424 + 134217728 + Annulla + + + -2038284033 + 268435457 + + + q + 200 + 25 + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{20, 90}, {62, 62}} + + YES + + 130560 + 33554432 + + NSImage + NSApplicationIcon + + 0 + 0 + 0 + NO + + YES + + + + 256 + {{52, 62}, {104, 17}} + + YES + + 67239424 + 71303168 + Parola d'ordine: + + + + + + + + + 290 + {{161, 60}, {326, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + + + {507, 172} + + + {{0, 0}, {1680, 1028}} + {378, 132} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + window + + + + 309 + + + + importAction: + + + + 321 + + + + cancelAction: + + + + 322 + + + + importButton + + + + 326 + + + + helpStringField + + + + 327 + + + + passphraseField + + + + 333 + + + + cancelButton + + + + 339 + + + + initialFirstResponder + + + + 340 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 307 + + + YES + + + + get passphrase + + + 308 + + + YES + + + + + + + + + + + 318 + + + YES + + + + + + 319 + + + YES + + + + + + 320 + + + YES + + + + + + 328 + + + YES + + + + + + 330 + + + YES + + + + + + 331 + + + YES + + + + + + 342 + + + + + 343 + + + + + 344 + + + + + 345 + + + + + 346 + + + + + 347 + + + + + -3 + + + Application + + + + + YES + + YES + -3.IBPluginDependency + 307.IBEditorWindowLastContentRect + 307.IBPluginDependency + 307.IBPropertyAccessControl + 307.IBWindowTemplateEditedContentRect + 307.ImportedFromIB2 + 307.windowTemplate.hasMinSize + 307.windowTemplate.minSize + 308.IBPluginDependency + 308.IBPropertyAccessControl + 308.ImportedFromIB2 + 318.IBPluginDependency + 318.IBPropertyAccessControl + 318.ImportedFromIB2 + 319.IBPluginDependency + 319.IBPropertyAccessControl + 319.ImportedFromIB2 + 320.IBPluginDependency + 320.IBPropertyAccessControl + 320.ImportedFromIB2 + 328.IBPluginDependency + 328.IBPropertyAccessControl + 328.ImportedFromIB2 + 330.IBPluginDependency + 330.IBPropertyAccessControl + 330.ImportedFromIB2 + 331.CustomClassName + 331.IBPluginDependency + 331.IBPropertyAccessControl + 331.ImportedFromIB2 + 342.IBPluginDependency + 343.IBPluginDependency + 344.IBPluginDependency + 345.IBPluginDependency + 346.IBPluginDependency + 347.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + {{221, 370}, {507, 172}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{221, 370}, {507, 172}} + + + {378, 110} + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + NSSecureTextField + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 347 + + + + YES + + BlorPasswordRetriever + NSObject + + YES + + YES + cancelAction: + importAction: + + + YES + id + id + + + + YES + + YES + cancelButton + helpStringField + importButton + passphraseField + window + + + YES + NSButton + NSTextField + NSButton + NSTextField + NSWindow + + + + IBProjectSource + ./Classes/BlorPasswordRetriever.h + + + + FirstResponder + NSObject + + : + id + + + IBUserSource + + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + ./Classes/NSObject.h + + + + RBSplitSubview + NSView + + IBProjectSource + ./Classes/RBSplitSubview.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + IBProjectSource + ./Classes/RBSplitView.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Italian.lproj/BlorPasswordRetriever.nib/keyedobjects.nib b/Italian.lproj/BlorPasswordRetriever.nib/keyedobjects.nib new file mode 100644 index 00000000..3ba86296 Binary files /dev/null and b/Italian.lproj/BlorPasswordRetriever.nib/keyedobjects.nib differ diff --git a/Italian.lproj/CarbonErrorStrings.plist b/Italian.lproj/CarbonErrorStrings.plist new file mode 100755 index 00000000..0d52c559 --- /dev/null +++ b/Italian.lproj/CarbonErrorStrings.plist @@ -0,0 +1,166 @@ + + + + + -33 + la directory è piena + -34 + il disco è pieno + -35 + il volume non esiste + -36 + si è verificato un errore durante il tentativo di accedere al disco + -37 + il nome non è corretto + -38 + il documento non è aperto + -39 + è stata raggiunta la fine del file + -40 + la posizione del file è stata indicata come offset negativo + -41 + il documento non entrerebbe in memoria + -42 + ci sono troppi documenti aperti + -43 + non ho trovato il documento + -44 + il disco è protetto da scrittura + -45 + il documento è protetto + -46 + il volume è protetto + -47 + il documento è ancora in uso + -48 + esiste già un documento con lo stesso nome + -49 + il documento è già aperto e disponibile per la scrittura + -50 + c'è un parametro non valido + -51 + il numero di riferimento del documento non è corretto + -52 + non è stato possibile ottenere l'offset della posizione del file + -53 + il volume non è più disponibile + -54 + il documento è protetto + -55 + il disco è già montato + -56 + si è fatto riferimento ad un disco non esistente + -57 + il disco non è in formato Mac + -58 + il tipo di file system del volume non è supportato + -59 + si è verificato un problema durante la modifica del nome + -60 + il master directory block è danneggiato + -61 + i permessi del documento non consentono la scrittura + -64 + il disco non è installato + -120 + non ho trovato la directory + -121 + ci sono troppe cartelle di lavoro aperte + -122 + non è possibile spostare le cartelle in cartelle in esse contenute + -123 + il volume è di tipo non corretto + -124 + il server del volume è scollegato + -127 + si è verificato un problema con il driver del file system + -128 + l'operazione è stata annullata + -818 + non è stato possibile deserializzare i dati + -819 + non è stato possibile inizializzare il file Interim Note-Changes + -820 + non è stato possibile appendere il file Interim Note-Changes + -821 + autenticazione non riuscita + -822 + non è stato possibile decomprimere i dati + -823 + non hai inserito la parola d'ordine + -824 + non è stato possibile formattare correttamente i dati + -825 + le note presentano dei valori non coincidenti dopo la decodifica + -1300 + non ho trovato l'ID del documento specificato nel file system + -1301 + l'ID del documento esiste già nel file system + -1302 + uno dei documenti era in realtà una cartella + -1303 + i documenti sono su volumi diversi + -1304 + il catalogo è cambiato inaspettatamente + -1306 + si è verificato un tentativo di scambiare il contenuto del documento con se stesso + -1307 + il documento non coincide con il numero di ID del documento + -1308 + il volume è stato rimontato in modo non corretto + -1309 + l'accesso al file è avvenuto "out of bounds" + -1310 + il documento o il volume è troppo grande + -1311 + il volume è in uso da parte del sottosistema della memoria virtuale + -1327 + si è verificato un accesso non corretto alla control block table del file + -1400 + la chiamata al file system è sconosciuta + -1401 + il riferimento al file system non è più valido + -1402 + è stato specificato un fork name non valido + -1403 + un buffer è rimasto non inizializzato + -1404 + è stato specificato un fork number non valido + -1405 + è stata richiesta un'informazione di file catalog non valida + -1406 + il catalog information buffer è rimasto non inizializzato + -1407 + una cartella era in realtà un file + -1409 + la fork del file richiesta non essite + -1410 + il nome richiesto è troppo lungo per essere valido + -1411 + il file non ha un nome + -1412 + è stato specificato un modo di posizionamento non valido per l'accesso al file + -1413 + il file è stato allocato in maniera impropria + -1417 + non c'erano altri elementi da trovare + -1418 + non sono stati richiesti elementi da leggere nella directory + -1419 + i parametri di ricerca non sono validi + -1420 + i riferimenti al file system sono diversi + -1421 + il file ha già una fork + -1422 + sono stato passati parametri non validi durante l'iterazione sulla directory + -1423 + il directory iterator specificato non è valido + -1424 + il directory iterator è stato usato in modo improprio + -1425 + hai oltrepassato la quota disco che ti è riservata + -5000 + il tuo account non ha i permessi necessari per accedere alla directory + + diff --git a/Italian.lproj/Come funziona questa cosa?.nvhelp b/Italian.lproj/Come funziona questa cosa?.nvhelp new file mode 100755 index 00000000..2d35525f --- /dev/null +++ b/Italian.lproj/Come funziona questa cosa?.nvhelp @@ -0,0 +1,24 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\margl1440\margr1440\vieww9000\viewh8400\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural + +\f0\fs24 \cf0 Si deve sempre iniziare a digitare nel campo di ricerca che appare in alto. Se si preme Invio si aggiunge una nuova nota che ha come titolo il testo inserito. Durante la digitazione, NV cerca le note che contengono (nel corpo o nel titolo) le parole digitate. Come si vede, assegnare un nome ad una nuova nota e cercare una nota gi\'e0 esistente sono operazioni che avvengono sempre allo stesso tempo.\ +\ +Quando si seleziona una delle note trovate (per esempio, usando i tasti cursore Su/Gi\'f9) NV ne mostra il contenuto nell'area in basso (o a destra) dedicata al testo (cio\'e8 l'area in cui ora stai leggendo questa nota).\ +\ +Se si inizia a digitare il titolo di una nota, NV seleziona automaticamente quella nota.\ +\ +Per creare una nuova nota, basta iniziare a digitare nuovamente nel campo di ricerca (usa la combinazione di tasti +\f1 \uc0\u8984 +\f0 -L per portare il cursore in quel campo). Non c'\'e8 da preoccuparsi: la nota non verr\'e0 rinominata -- per rinominare una nota occorre fare doppio clic sul suo titolo nell'elenco delle note, oppure occorre digitare la combinazione di tasti +\f1 \uc0\u8984 +\f0 -R.\ +\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural + +\i \cf0 NV non mi permette di salvare le modifiche! +\i0 \ +NV salva continuamente su disco le modifiche durante la creazione di una nuova nota o la modifica di una nota gi\'e0 esistente, quindi non c'\'e8 bisogno di eseguire manualmente il salvataggio.\ +} \ No newline at end of file diff --git a/Italian.lproj/Contatti.nvhelp b/Italian.lproj/Contatti.nvhelp new file mode 100755 index 00000000..f6e33017 --- /dev/null +++ b/Italian.lproj/Contatti.nvhelp @@ -0,0 +1,19 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\margl1440\margr1440\vieww9000\viewh8400\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural + +\f0\b\fs24 \cf0 Pagina web: +\b0 \ + http://www.notational.net/\ + +\b \ +Sviluppo: +\b0 \ + https://github.com/scrod/nv/wiki/\ +\ + +\b Contatto: +\b0 \ + Zachary Schneirov } \ No newline at end of file diff --git a/Italian.lproj/DeletionManager.nib/designable.nib b/Italian.lproj/DeletionManager.nib/designable.nib new file mode 100644 index 00000000..2ace568d --- /dev/null +++ b/Italian.lproj/DeletionManager.nib/designable.nib @@ -0,0 +1,779 @@ + + + + 1030 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + DeletionManager + + + FirstResponder + + + NSApplication + + + 9 + 2 + {{568, 601}, {371, 231}} + 1886913536 + Note cancellate esternamente + + NSPanel + + + View + + {1.79769e+308, 1.79769e+308} + {371, 200} + + + 256 + + YES + + + 266 + {{102, 130}, {252, 85}} + + YES + + 67239424 + 272629760 + I seguenti documenti non esistono più nella cartella delle note — vuoi che siano rimesse nel disco o che siano cancellate anche da Notational Velocity? + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{24, 153}, {62, 62}} + + YES + + 130560 + 33554432 + + NSImage + NSApplicationIcon + + 0 + 1 + 0 + NO + + YES + + + + 274 + + YES + + + 2304 + + YES + + + 256 + {314, 38} + + YES + + + 256 + {{129, 0}, {16, 17}} + + + YES + + 311 + 40 + 1000 + + 75628096 + 2048 + + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + + + + 337772096 + 2048 + + + + 6 + System + controlBackgroundColor + + + + + 3 + YES + YES + + + + 3 + 2 + + 3 + MQA + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + 306184192 + + + 4 + 15 + 0 + YES + 0 + + + {{1, 1}, {314, 38}} + + + + + 4 + + + + 256 + {{315, 1}, {15, 38}} + + + _doScroller: + 0.9473684 + + + + -2147483392 + {{-100, -100}, {128, 15}} + + 1 + + _doScroller: + 0.99047620000000003 + + + {{20, 82}, {331, 40}} + + + 18 + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 289 + {{96, 12}, {104, 32}} + + YES + + 67239424 + 134217728 + Cancellale + + + -2038284033 + 1 + + + + 200 + 25 + + + + + 289 + {{200, 12}, {157, 32}} + + YES + + 67239424 + 134217728 + Rimettile nel disco + + + -2038284033 + 1 + + + DQ + 200 + 25 + + + + + 288 + {{18, 58}, {335, 18}} + + YES + + 67239424 + 0 + Non mostrare più questo messaggio + + + 1211912703 + 2 + + NSSwitch + + + + 200 + 25 + + + + {371, 231} + + + {{0, 0}, {1440, 878}} + {371, 222} + {1.79769e+308, 1.79769e+308} + externallyDeletedNotesTable + + + + + YES + + + tableView + + + + 336 + + + + window + + + + 337 + + + + deleteAction: + + + + 338 + + + + restoreAction: + + + + 339 + + + + dataSource + + + + 340 + + + + delegate + + + + 341 + + + + confirmDeletionButton + + + + 353 + + + + changeConfirmDeletion: + + + + 354 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 328 + + + YES + + + + Multiple Note External Deletion + + + 329 + + + YES + + + + + + + + + + + 330 + + + YES + + + + + + + + 331 + + + YES + + + + + + 332 + + + YES + + + + + + 333 + + + YES + + + + + + 334 + + + YES + + + + + + 335 + + + YES + + + + + + 343 + + + + + 344 + + + + + 345 + + + + + 346 + + + + + 347 + + + + + 348 + + + + + 349 + + + YES + + + + + + 350 + + + + + 351 + + + YES + + + + + + 352 + + + + + + + YES + + YES + -3.IBPluginDependency + -3.ImportedFromIB2 + 328.IBEditorWindowLastContentRect + 328.IBPluginDependency + 328.IBWindowTemplateEditedContentRect + 328.ImportedFromIB2 + 328.windowTemplate.hasMinSize + 328.windowTemplate.minSize + 329.IBPluginDependency + 329.ImportedFromIB2 + 330.IBPluginDependency + 330.ImportedFromIB2 + 331.IBPluginDependency + 331.ImportedFromIB2 + 332.IBPluginDependency + 332.ImportedFromIB2 + 333.IBPluginDependency + 333.ImportedFromIB2 + 334.IBPluginDependency + 334.IBPropertyAccessControl + 334.ImportedFromIB2 + 335.IBPluginDependency + 335.IBPropertyAccessControl + 335.ImportedFromIB2 + 343.IBPluginDependency + 344.IBPluginDependency + 345.IBPluginDependency + 346.IBPluginDependency + 346.IBShouldRemoveOnLegacySave + 347.IBPluginDependency + 347.IBShouldRemoveOnLegacySave + 348.IBPluginDependency + 348.IBShouldRemoveOnLegacySave + 349.IBPluginDependency + 349.ImportedFromIB2 + 350.IBPluginDependency + 351.IBPluginDependency + 351.ImportedFromIB2 + 352.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + {{363, 654}, {371, 231}} + com.apple.InterfaceBuilder.CocoaPlugin + {{363, 654}, {371, 231}} + + + {371, 200} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 354 + + + + YES + + DeletionManager + NSObject + + YES + + YES + changeConfirmDeletion: + deleteAction: + restoreAction: + + + YES + id + id + id + + + + YES + + YES + confirmDeletionButton + tableView + window + + + YES + NSButton + NSTableView + NSPanel + + + + IBProjectSource + ./Classes/DeletionManager.h + + + + FirstResponder + NSObject + + : + id + + + IBUserSource + + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + ./Classes/NSObject.h + + + + RBSplitSubview + NSView + + IBProjectSource + ./Classes/RBSplitSubview.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + IBProjectSource + ./Classes/RBSplitView.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Italian.lproj/DeletionManager.nib/keyedobjects.nib b/Italian.lproj/DeletionManager.nib/keyedobjects.nib new file mode 100644 index 00000000..df788bef Binary files /dev/null and b/Italian.lproj/DeletionManager.nib/keyedobjects.nib differ diff --git a/Italian.lproj/EncodingsManager.nib/designable.nib b/Italian.lproj/EncodingsManager.nib/designable.nib new file mode 100644 index 00000000..8ccc5c83 --- /dev/null +++ b/Italian.lproj/EncodingsManager.nib/designable.nib @@ -0,0 +1,825 @@ + + + + 1050 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + EncodingsManager + + + FirstResponder + + + NSApplication + + + 11 + 2 + {{473, 509}, {412, 366}} + 1886912512 + Panel + + NSPanel + + + View + + {1.79769e+308, 1.79769e+308} + {378, 210} + + + 256 + + YES + + + 274 + + YES + + + 2304 + + YES + + + 2322 + {370, 14} + + + + + + + + + + + YES + + + 6 + + + + 370 + 1 + + + 2913 + 0 + + + 3 + MQA + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + selectedTextColor + + 3 + MAA + + + + + + + YES + + YES + NSColor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + + + + + 6 + {742, 1e+07} + {114, 0} + + + + {{1, 1}, {370, 185}} + + + + + + {4, -5} + 1 + + 4 + + + + -2147483392 + {{-30, 1}, {15, 174}} + + + _doScroller: + 1 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{20, 60}, {372, 187}} + + + 530 + + + + + + + 266 + {{17, 263}, {378, 26}} + + YES + + -2076049856 + 2048 + + LucidaGrande + 13 + 1044 + + + 109199615 + 1 + + + + + + 400 + 75 + + + Item1 + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + + OtherViews + + + YES + + + + Item2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 3 + YES + YES + 1 + + + + + 266 + {{17, 295}, {378, 51}} + + YES + + 67239424 + 272629760 + Notational Velocity ritiene che il documento “%@” sia stato salvato con la codifica: + + + + 6 + System + controlColor + + + + 6 + System + controlTextColor + + + + + + + 289 + {{280, 12}, {118, 32}} + + YES + + 67239424 + 134217728 + Sembra di sì + + + -2038284033 + 1 + + + DQ + 200 + 25 + + + + + 289 + {{192, 12}, {88, 32}} + + YES + + 67239424 + 134217728 + Annulla + + + -2038284033 + 1 + + + Gw + 200 + 25 + + + + {412, 366} + + + {{0, 0}, {1440, 878}} + {378, 232} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + window + + + + 309 + + + + okAction: + + + + 321 + + + + cancelAction: + + + + 322 + + + + encodingsPopUpButton + + + + 323 + + + + chooseEncoding: + + + + 324 + + + + textView + + + + 325 + + + + okButton + + + + 326 + + + + helpStringField + + + + 327 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 307 + + + YES + + + + Panel + + + 308 + + + YES + + + + + + + + + + 311 + + + YES + + + + + + + + 312 + + + + + 313 + + + YES + + + + + + 318 + + + YES + + + + + + 319 + + + YES + + + + + + 320 + + + YES + + + + + + 329 + + + YES + + + + + + 330 + + + + + 331 + + + + + 332 + + + + + 314 + + + YES + + + + + + + + 317 + + + + + 316 + + + + + 315 + + + + + 333 + + + + + 334 + + + + + + + YES + + YES + -3.IBPluginDependency + -3.ImportedFromIB2 + 307.IBEditorWindowLastContentRect + 307.IBPluginDependency + 307.IBPropertyAccessControl + 307.IBWindowTemplateEditedContentRect + 307.ImportedFromIB2 + 307.windowTemplate.hasMinSize + 307.windowTemplate.minSize + 308.IBPluginDependency + 308.IBPropertyAccessControl + 308.ImportedFromIB2 + 311.IBPluginDependency + 311.ImportedFromIB2 + 312.IBPluginDependency + 312.ImportedFromIB2 + 313.IBPluginDependency + 313.ImportedFromIB2 + 314.IBPluginDependency + 314.ImportedFromIB2 + 315.IBPluginDependency + 315.ImportedFromIB2 + 316.IBPluginDependency + 316.ImportedFromIB2 + 317.IBPluginDependency + 317.ImportedFromIB2 + 318.IBPluginDependency + 318.IBPropertyAccessControl + 318.ImportedFromIB2 + 319.IBPluginDependency + 319.IBPropertyAccessControl + 319.ImportedFromIB2 + 320.IBPluginDependency + 320.IBPropertyAccessControl + 320.ImportedFromIB2 + 329.IBPluginDependency + 330.IBPluginDependency + 331.IBPluginDependency + 332.IBPluginDependency + 333.IBPluginDependency + 333.IBShouldRemoveOnLegacySave + 334.IBPluginDependency + 334.IBShouldRemoveOnLegacySave + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + {{316, 314}, {412, 366}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{316, 314}, {412, 366}} + + + {378, 210} + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 334 + + + + YES + + EncodingsManager + NSObject + + YES + + YES + cancelAction: + chooseEncoding: + okAction: + + + YES + id + id + id + + + + YES + + YES + encodingsPopUpButton + helpStringField + okButton + textView + window + + + YES + NSPopUpButton + NSTextField + NSButton + NSTextView + NSPanel + + + + IBProjectSource + ./Classes/EncodingsManager.h + + + + FirstResponder + NSObject + + : + id + + + IBUserSource + + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + ./Classes/NSObject.h + + + + NSTextView + + moveToLeftEndOfLine: + id + + + IBProjectSource + ./Classes/NSTextView.h + + + + RBSplitSubview + NSView + + IBProjectSource + ./Classes/RBSplitSubview.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + IBProjectSource + ./Classes/RBSplitView.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Italian.lproj/EncodingsManager.nib/keyedobjects.nib b/Italian.lproj/EncodingsManager.nib/keyedobjects.nib new file mode 100644 index 00000000..181105d9 Binary files /dev/null and b/Italian.lproj/EncodingsManager.nib/keyedobjects.nib differ diff --git a/Italian.lproj/ExporterManager.nib/designable.nib b/Italian.lproj/ExporterManager.nib/designable.nib new file mode 100644 index 00000000..989bdfe5 --- /dev/null +++ b/Italian.lproj/ExporterManager.nib/designable.nib @@ -0,0 +1,1023 @@ + + + + 1060 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + ExporterManager + + + FirstResponder + + + NSApplication + + + + + + + 256 + {{155, 16}, {189, 26}} + + YES + + -2076049856 + 2048 + + LucidaGrande + 13 + 1044 + + + 109199615 + 1 + + LucidaGrande + 13 + 16 + + + + + + 400 + 75 + + + Solo testo (Plain Text) + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + 1 + + + YES + + + OtherViews + + + + + + RTF (Rich Text Format) + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + Documento HTML + + 1048576 + 2147483647 + + + _popUpItemAction: + 3 + + + + + Documento Microsoft Word + + 1048576 + 2147483647 + + + _popUpItemAction: + 4 + + + + + Documento Microsoft Word XML + + 1048576 + 2147483647 + + + _popUpItemAction: + 5 + + + + + 3 + YES + YES + 1 + + + + + 256 + {{17, 22}, {136, 17}} + + YES + + 67239424 + 71303168 + Formato documento: + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + {361, 60} + + + NSView + + NSResponder + + + + + + + accessoryView + + + + 350 + + + + formatSelectorPopup + + + + 351 + + + + formatSelectorChanged: + + + + 353 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 341 + + + + + + + View + + + 342 + + + + + + + + 347 + + + + + + + + 355 + + + + + + + + 356 + + + + + 343 + + + + + + + + + + + + 349 + + + + + 348 + + + + + 346 + + + + + 345 + + + + + 344 + + + + + -3 + + + Application + + + + + com.apple.InterfaceBuilder.CocoaPlugin + {{84, 810}, {361, 60}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 356 + + + + + ExporterManager + NSObject + + formatSelectorChanged: + id + + + NSView + NSPopUpButton + + + IBProjectSource + ExporterManager.h + + + + NSObject + + IBProjectSource + BookmarksController.h + + + + NSObject + + IBProjectSource + FastListDataSource.h + + + + NSObject + + IBProjectSource + GlobalPrefs.h + + + + NSObject + + IBProjectSource + NotationController.h + + + + NSObject + + IBProjectSource + NotationFileManager.h + + + + NSObject + + IBProjectSource + NoteObject.h + + + + NSObject + + IBProjectSource + PassphrasePicker.h + + + + NSObject + + RBSplitView + RBSplitView + + + IBProjectSource + RBSplitView/RBSplitView.h + + + + NSObject + + IBProjectSource + SyncResponseFetcher.h + + + + NSObject + + IBProjectSource + SyncServiceSessionProtocol.h + + + + RBSplitSubview + NSView + + IBProjectSource + RBSplitView/RBSplitSubview.h + + + + RBSplitSubview + + IBProjectSource + RBSplitView/RBSplitViewPrivateDefines.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + + + RBSplitView + + + + + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + PrintCore.framework/Headers/PDEPluginInterface.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFAuthorizationView.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFCertificatePanel.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFChooseIdentityPanel.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + ../Notation.xcodeproj + 3 + + diff --git a/Italian.lproj/ExporterManager.nib/keyedobjects.nib b/Italian.lproj/ExporterManager.nib/keyedobjects.nib new file mode 100644 index 00000000..3f301956 Binary files /dev/null and b/Italian.lproj/ExporterManager.nib/keyedobjects.nib differ diff --git a/Italian.lproj/FindPanel.nib/designable.nib b/Italian.lproj/FindPanel.nib/designable.nib new file mode 100644 index 00000000..24035b65 --- /dev/null +++ b/Italian.lproj/FindPanel.nib/designable.nib @@ -0,0 +1,471 @@ + + + + 1060 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + MultiTextFinder + + + FirstResponder + + + NSApplication + + + 19 + 2 + {{696, 526}, {488, 92}} + -260571136 + Cerca tra le note filtrate + NSPanel + + View + + {1.79769e+308, 1.79769e+308} + {300, 92} + + + + + + 268 + {{17, 51}, {36, 18}} + + YES + + 67239424 + 71303168 + Q2VyY2E6Cg + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 266 + {{58, 49}, {253, 23}} + + YES + + -1804468671 + 272630784 + + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + + + + 265 + {{321, 44}, {153, 32}} + + YES + + 67239424 + 134217728 + Parola seguente + + + -2038284033 + 1 + + LucidaGrande + 13 + 16 + + + + 200 + 25 + + + + + 265 + {{321, 12}, {153, 32}} + + YES + + 67239424 + 134217728 + Parola precedente + + + -2038284033 + 1 + + + + 200 + 25 + + + + + 264 + {{72, 21}, {97, 18}} + + YES + + -2080244224 + 0 + Ignora Maiuscole/Minuscole + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + + 264 + {{187, 21}, {112, 18}} + + YES + + 67239424 + 0 + Intera frase + + + 1211912703 + 2 + + + + + 200 + 25 + + + + {488, 92} + + + {{0, 0}, {1680, 1028}} + {300, 108} + {1.79769e+308, 1.79769e+308} + + + + + + + window + + + + 344 + + + + initialFirstResponder + + + + 367 + + + + findStringField + + + + 369 + + + + ignoreCaseButton + + + + 370 + + + + entirePhraseButton + + + + 371 + + + + nextButton + + + + 372 + + + + previousButton + + + + 373 + + + + findNext: + + + + 374 + + + + findPrevious: + + + + 375 + + + + changeEntirePhrase: + + + + 376 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 342 + + + + + + Panel + + + 343 + + + + + + + + + + + + + 345 + + + + + + + + 347 + + + + + + + + 349 + + + + + + + + 350 + + + + + + + + 355 + + + + + + + + 362 + + + + + + + + 378 + + + + + 379 + + + + + 380 + + + + + 381 + + + + + 382 + + + + + 383 + + + + + -3 + + + Application + + + + + com.apple.InterfaceBuilder.CocoaPlugin + {{21, 853}, {488, 92}} + com.apple.InterfaceBuilder.CocoaPlugin + {{21, 853}, {488, 92}} + + + {300, 92} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 383 + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + + 3 + + diff --git a/Italian.lproj/FindPanel.nib/keyedobjects.nib b/Italian.lproj/FindPanel.nib/keyedobjects.nib new file mode 100644 index 00000000..a432c1b1 Binary files /dev/null and b/Italian.lproj/FindPanel.nib/keyedobjects.nib differ diff --git a/Italian.lproj/FindPanel.strings b/Italian.lproj/FindPanel.strings new file mode 100644 index 00000000..a2863de5 Binary files /dev/null and b/Italian.lproj/FindPanel.strings differ diff --git a/Italian.lproj/ImporterAccessory.nib/designable.nib b/Italian.lproj/ImporterAccessory.nib/designable.nib new file mode 100644 index 00000000..042afdf8 --- /dev/null +++ b/Italian.lproj/ImporterAccessory.nib/designable.nib @@ -0,0 +1,177 @@ + + + + 1030 + 10J567 + 1294 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1294 + + + NSCustomView + NSButtonCell + NSButton + NSCustomObject + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + AlienNoteImporter + + + FirstResponder + + + NSApplication + + + + 256 + + + + 268 + {{18, 18}, {244, 18}} + + YES + + 67239424 + 0 + Importa data creazione documento + + LucidaGrande + 13 + 1044 + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + {280, 54} + + NSView + + NSResponder + + + + + + + grabCreationDatesButton + + + + 361 + + + + importAccessoryView + + + + 362 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 341 + + + + + + View + + + 357 + + + + + + + + 365 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {{42, 862}, {280, 54}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 365 + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + 3 + + NSSwitch + {15, 15} + + + diff --git a/Italian.lproj/ImporterAccessory.nib/keyedobjects.nib b/Italian.lproj/ImporterAccessory.nib/keyedobjects.nib new file mode 100644 index 00000000..e4dd6430 Binary files /dev/null and b/Italian.lproj/ImporterAccessory.nib/keyedobjects.nib differ diff --git a/Italian.lproj/InfoPlist.strings b/Italian.lproj/InfoPlist.strings new file mode 100755 index 00000000..fdf8eae4 Binary files /dev/null and b/Italian.lproj/InfoPlist.strings differ diff --git a/Italian.lproj/KeyDerivationManager.nib/designable.nib b/Italian.lproj/KeyDerivationManager.nib/designable.nib new file mode 100644 index 00000000..b3d29aba --- /dev/null +++ b/Italian.lproj/KeyDerivationManager.nib/designable.nib @@ -0,0 +1,540 @@ + + + + 1030 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + KeyDerivationManager + + + FirstResponder + + + NSApplication + + + + 256 + + YES + + + 256 + {{141, 46}, {272, 25}} + + YES + + 67501824 + 0 + + + + + Helvetica + 12 + 16 + + + 1 + 0.01 + 0.29999999999999999 + 0.0 + 10 + 0 + NO + NO + + + + + 256 + {{-3, 41}, {139, 34}} + + YES + + 67239424 + 71303168 + Velocità inserimento chiave di accesso: + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 256 + {{138, 6}, {48, 32}} + + YES + + 67239424 + 138412032 + Avvio rapido + + LucidaGrande + 11 + 3100 + + + + + + + + + 256 + {{354, 0}, {59, 38}} + + YES + + 67239424 + 138412032 + Maggior sicurezza + + + + + + + + + 256 + {{181, 12}, {179, 26}} + + YES + + 68288064 + 138413056 + 672 ms + + + + + + + + + 1280 + + {{117, 17}, {16, 16}} + + 28938 + 16 + 100 + + + {413, 75} + + + NSView + + NSResponder + + + + + YES + + + view + + + + 334 + + + + slider + + + + 335 + + + + hashDurationField + + + + 336 + + + + sliderChanged: + + + + 337 + + + + iterationEstimatorProgress + + + + 345 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 328 + + + YES + + + + + + + + + View + + + 329 + + + YES + + + + + + 330 + + + YES + + + + + + 331 + + + YES + + + + + + 332 + + + YES + + + + + + 333 + + + YES + + + + + + 344 + + + + + 347 + + + + + 348 + + + + + 349 + + + + + 350 + + + + + 351 + + + + + + + YES + + YES + -3.IBPluginDependency + -3.ImportedFromIB2 + 328.IBEditorWindowLastContentRect + 328.IBPluginDependency + 328.IBPropertyAccessControl + 328.ImportedFromIB2 + 329.CustomClassName + 329.IBPluginDependency + 329.ImportedFromIB2 + 330.IBPluginDependency + 330.IBPropertyAccessControl + 330.ImportedFromIB2 + 331.IBPluginDependency + 331.IBPropertyAccessControl + 331.ImportedFromIB2 + 332.IBPluginDependency + 332.IBPropertyAccessControl + 332.ImportedFromIB2 + 333.IBPluginDependency + 333.ImportedFromIB2 + 344.IBPluginDependency + 344.ImportedFromIB2 + 347.IBPluginDependency + 348.IBPluginDependency + 349.IBPluginDependency + 350.IBPluginDependency + 351.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + {{246, 416}, {413, 75}} + com.apple.InterfaceBuilder.CocoaPlugin + + + KeyDerivationDelaySlider + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 351 + + + + YES + + FirstResponder + NSObject + + : + id + + + IBUserSource + + + + + KeyDerivationDelaySlider + NSSlider + + delegate + id + + + IBProjectSource + ./Classes/KeyDerivationDelaySlider.h + + + + KeyDerivationManager + NSObject + + sliderChanged: + id + + + YES + + YES + hashDurationField + iterationEstimatorProgress + slider + view + + + YES + NSTextField + NSProgressIndicator + KeyDerivationDelaySlider + NSView + + + + IBProjectSource + ./Classes/KeyDerivationManager.h + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + ./Classes/NSObject.h + + + + RBSplitSubview + NSView + + IBProjectSource + ./Classes/RBSplitSubview.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + IBProjectSource + ./Classes/RBSplitView.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Italian.lproj/KeyDerivationManager.nib/keyedobjects.nib b/Italian.lproj/KeyDerivationManager.nib/keyedobjects.nib new file mode 100644 index 00000000..9f12cd68 Binary files /dev/null and b/Italian.lproj/KeyDerivationManager.nib/keyedobjects.nib differ diff --git a/Italian.lproj/Localizable.strings b/Italian.lproj/Localizable.strings new file mode 100755 index 00000000..43345e5c Binary files /dev/null and b/Italian.lproj/Localizable.strings differ diff --git a/Italian.lproj/MainMenu.nib/designable.nib b/Italian.lproj/MainMenu.nib/designable.nib new file mode 100644 index 00000000..2407c077 --- /dev/null +++ b/Italian.lproj/MainMenu.nib/designable.nib @@ -0,0 +1,5135 @@ + + + + 1030 + 10J567 + 740 + 1038.35 + 462.00 + + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + net.brockerhoff.RBSplitView.IBPlugin + + + YES + 740 + 1.2 + + + + YES + + + + YES + net.brockerhoff.RBSplitView.IBPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + 4111 + 2 + {{280, 392}, {397, 464}} + 1618477056 + Notation + NSWindow + + View + + {1.79769e+308, 1.79769e+308} + {213, 107} + + + 256 + + YES + + + 18 + + YES + + + + YES + + + 274 + + YES + + + 2304 + + YES + + + 4352 + {382, 135} + + YES + + + 256 + {382, 17} + + + + + + 256 + {{383, 0}, {16, 17}} + + + + YES + + 3 + 2 + + 3 + MQA + + + 6 + System + gridColor + + 3 + MC41AA + + + 14 + -633307136 + + + 1 + 15 + 0 + YES + 0 + + + {{1, 17}, {382, 135}} + + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + 4 + + + + 256 + {{383, 17}, {15, 135}} + + + _doScroller: + 0.46875 + + + + -2147483392 + {{-100, -100}, {382, 15}} + + 1 + + _doScroller: + 0.96598637104034424 + + + + 2304 + + YES + + + {{1, 0}, {382, 17}} + + + + + 4 + + + + {399, 153} + + + 18 + + + + + + QSAAAEEgAABBgAAAQYAAAA + + + {399, 153} + + + 0 + 1 + 1000000 + 0.33553063242072767 + NO + + + + + YES + + + 274 + + YES + + + 2304 + + YES + + + 2322 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + + + {382, 14} + + + + + + + + + + + YES + + + 6 + + + + 382 + 1 + + + 12263 + 0 + + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + + + 6 + System + selectedTextColor + + 3 + MAA + + + + + + + YES + + YES + NSColor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + + + + + 6 + {781, 1e+07} + {382, 0} + + + + {{1, 1}, {382, 303}} + + + + + + {4, -5} + 1 + + 4 + + + + 256 + {{383, 1}, {15, 303}} + + + _doScroller: + 1 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{0, -1}, {399, 305}} + + + 18 + + + + + + {{0, 161}, {399, 304}} + + + 0 + 1 + 1000000 + -0.33553063242072767 + NO + + + {{-1, 0}, {399, 465}} + + + 0 + 1 + 1000000 + 0.0 + NO + + centralSplitView + + TU0AKgAAAUz///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AAoKChkUFBSAFBQU6xQUFIALCwsX////AP///wD///8A +////ABwcHIA4ODj/PT49/zg4OP8cHByA////AP///wD///8A////AFlZWeuenp7/vL68/56env9ZWVnr +////AP///wD///8A////AKenp4D5+fn///////n5+f+np6eA////AP///wD///8A////AP///xj///+A +////6////4H///8Z////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wAADgEAAAMAAAABAAkAAAEBAAMAAAABAAkAAAEC +AAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAESAAMAAAABAAEAAAEV +AAMAAAABAAQAAAEWAAMAAAABAAkAAAEXAAQAAAABAAABRAEcAAMAAAABAAEAAAFSAAMAAAABAAIAAAFT +AAMAAAAEAAACAodzAAcAAALMAAACCgAAAAAACAAIAAgACAABAAEAAQABAAACzGFwcGwCAAAAbW50clJH +QiBYWVogB9cAAQAfAAAAAAAAYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPbWAAEAAAAA +0y1hcHBswLZrvcthU7+wXwc4u0MCPgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMclhZWgAA +ARQAAAAUZ1hZWgAAASgAAAAUYlhZWgAAATwAAAAUd3RwdAAAAVAAAAAUY2hhZAAAAWQAAAAsclRSQwAA +AZAAAAAOZ1RSQwAAAaAAAAAOYlRSQwAAAbAAAAAOdmNndAAAAcAAAAAwbmRpbgAAAfAAAAA4ZGVzYwAA +AigAAAB0Y3BydAAAApwAAAAtWFlaIAAAAAAAAHRLAAA+HQAAA8xYWVogAAAAAAAAWnMAAKymAAAXJlhZ +WiAAAAAAAAAoGAAAFVcAALgzWFlaIAAAAAAAAPNRAAEAAAABFsxzZjMyAAAAAAABDEIAAAXe///zJgAA +B5MAAP2Q///7ov///aMAAAPcAADAbmN1cnYAAAAAAAAAAQHRAABjdXJ2AAAAAAAAAAEB0QAAY3VydgAA +AAAAAAABAdEAAHZjZ3QAAAAAAAAAAQABAAAAAAAAAAEAAAABAAAAAAAAAAEAAAABAAAAAAAAAAEAAG5k +aW4AAAAAAAAAMAAAoUgAAFcKAABLhQAAmuEAACeuAAATtgAAUA0AAFQ5AAHRdAAB0XQAAdF0ZGVzYwAA +AAAAAAAaQ2FsaWJyYXRlZCBSR0IgQ29sb3JzcGFjZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0ZXh0AAAAAENv +cHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA + + + 8 + YES + YES + + + {397, 464} + + {{0, 0}, {1920, 1178}} + {213, 129} + {1.79769e+308, 1.79769e+308} + NotationWindow + + + MainMenu + + YES + + + Notational Velocity + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + Notational Velocity + + YES + + + Info su Notational Velocity + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferenze… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Controlla aggiornamenti… + + 1048576 + 2147483647 + + + 88 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Servizi + + 1048576 + 2147483647 + + + submenuAction: + + Servizi + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Nascondi Notational Velocity + h + 1048576 + 2147483647 + + + + + + Nascondi altre + h + 1572864 + 2147483647 + + + + + + Mostra tutte + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Esci da Notational Velocity + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + Nota + + 1048576 + 2147483647 + + + submenuAction: + 89 + + Nota + + YES + + + Modifica nome + r + 1048576 + 2147483647 + + + 90 + + + + Modifica etichetta + T + 1048576 + 2147483647 + + + 92 + + + + Cancella + CA + 1048576 + 2147483647 + + + 91 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cerca o crea nota… + l + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Importa… + + 1048576 + 2147483647 + + + 93 + + + + Esporta… + e + 1048576 + 2147483647 + + + 94 + + + + Mostra nel Finder + R + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Formato di stampa… + P + 1048576 + 2147483647 + + + 95 + + + + Stampa… + p + 1048576 + 2147483647 + + + 96 + + + + + + + Modifica + + 1048576 + 2147483647 + + + submenuAction: + + Modifica + + YES + + + Annulla + z + 1048576 + 2147483647 + + + + + + Ripeti + Z + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Taglia + x + 1048576 + 2147483647 + + + + + + Copia + c + 1048576 + 2147483647 + + + + + + Copia URL + c + 1572864 + 2147483647 + + + + + + Incolla + v + 1048576 + 2147483647 + + + + + + Incolla come nuova nota + V + 1048576 + 2147483647 + + + + + + Cancella + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Seleziona tutto + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cerca + + 1048576 + 2147483647 + + + submenuAction: + + Cerca + + YES + + + Cerca… + f + 1048576 + 2147483647 + + + 1 + + + + Cerca prossimo + g + 1048576 + 2147483647 + + + 2 + + + + Cerca precedente + G + 1048576 + 2147483647 + + + 3 + + + + Usa selezione per ricerca + e + 1048576 + 2147483647 + + + 7 + + + + + + + Ortografia + + 1048576 + 2147483647 + + + submenuAction: + + Ortografia + + YES + + + Ortografia… + : + 1048576 + 2147483647 + + + + + + Controlla ortografia + ; + 1048576 + 2147483647 + + + + + + Controlla ortografia durante la digitazione + + 1048576 + 2147483647 + + + + + + + + + Cambia + + 1048576 + 2147483647 + + + submenuAction: + + Cambia + + YES + + + Cambia in MAIUSCOLE + + 1048576 + 2147483647 + + + + + + Cambia in minuscole + + 1048576 + 2147483647 + + + + + + Iniziali In Maiuscolo + + 1048576 + 2147483647 + + + + + + + + + + + + Vista + + 1048576 + 2147483647 + + + submenuAction: + 99 + + Vista + + YES + + + Passa a disposizione orizzontale + l + 1572864 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Colonne + + 1048576 + 2147483647 + + + submenuAction: + 97 + + Colonne + + YES + + + Elemento + + 1048576 + 2147483647 + 1 + + + + + + + + + Ordina per + + 1048576 + 2147483647 + + + submenuAction: + 98 + + Ordina per + + YES + + + Elemento + + 1048576 + 2147483647 + + + + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Mostra nota - Precedente nell'elenco + p + 1572864 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Nota successiva + j + 1048576 + 2147483647 + + + 106 + + + + Nota precedente + k + 1048576 + 2147483647 + + + 107 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Deseleziona nota(e) + d + 1048576 + 2147483647 + + + 101 + + + + + + + Segnalibri + + 1048576 + 2147483647 + + + submenuAction: + 103 + + Segnalibri + + YES + + + Elemento + + 1048576 + 2147483647 + + + + + + + + + Formato + + 1048576 + 2147483647 + + + submenuAction: + + Formato + + YES + + + Testo piano + t + 1048576 + 2147483647 + + + + + + Neretto + b + 1048576 + 2147483647 + + + 2 + + Neretto + + YES + + YES + NSFont + NSOriginalFont + + + YES + + LucidaGrande-Bold + 14 + 16 + + + + + + + + + Corsivo + i + 1048576 + 2147483647 + + + 1 + + Corsivo + + YES + + YES + NSFont + NSObliqueness + NSParagraphStyle + + + YES + + LucidaGrande + 14 + 16 + + + + 4 + + YES + + 28 + + + 56 + + + 84 + + + 112 + + + 140 + + + 168 + + + 196 + + + 224 + + + 252 + + + 280 + + + 308 + + + 336 + + + + + + + + + + Barrato + y + 1048576 + 2147483647 + + + + Barrato + + YES + + YES + NSFont + NSOriginalFont + NSStrikethrough + + + YES + + + + + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Riduci il rientro + [ + 1048576 + 2147483647 + + + + + + Aumenta il rientro + ] + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Correggi codifica testo… + + 1048576 + 2147483647 + + + 102 + + + + + + + Finestra + + 1048576 + 2147483647 + + + submenuAction: + + Finestra + + YES + + + Contrai + m + 1048576 + 2147483647 + + + + + + Chiudi + w + 1048576 + 2147483647 + + + + + + Ingrandimento + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Porta tutto in primo piano + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Aiuto + + 1048576 + 2147483647 + + + submenuAction: + + Aiuto + + YES + + + Scorciatoie di tastiera + + 2147483647 + + + 1 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Sito web di Notational Velocity + + 2147483647 + + + 3 + + + + Sito web dello sviluppatore + + 2147483647 + + + 4 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Ringraziamenti + + 2147483647 + + + 2 + + + + + + _NSMainMenu + + + AppController + + + + 274 + + YES + + + 319 + {{-3, 29}, {147, 46}} + + YES + + 67239424 + 138412032 + Nessuna nota selezionata + + Helvetica + 18 + 16 + + + + 6 + System + controlColor + + + + 3 + MC40OTU5Njc3NDU4AA + + + + + {147, 102} + EmptyView + NSView + + + NSFontManager + + + + 258 + + YES + + + 266 + {381, 23} + + YES + + -1804468671 + 268436480 + + + LucidaGrande + 13 + 1044 + + + YES + + 6 + System + textBackgroundColor + + + + 6 + System + textColor + + + + + + {381, 23} + + NSView + + NSResponder + + + 1 + 2 + {{454, 634}, {353, 106}} + -260571136 + + NSPanel + + View + + {1.79769e+308, 1.79769e+308} + {213, 107} + + + 256 + + YES + + + 256 + {{240, 12}, {99, 32}} + + YES + + 67239424 + 134217728 + Esci + + + -2038284033 + 1 + + + DQ + 200 + 25 + + + + + 1280 + + {{20, 54}, {32, 32}} + + 20490 + 100 + + + + 256 + {{70, 46}, {266, 34}} + + YES + + 67239424 + 272629760 + Attendo completamento invio modifiche… + + + + + 6 + System + controlTextColor + + + + + + {353, 106} + + {{0, 0}, {1920, 1178}} + {213, 129} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + runPageLayout: + + + + 87 + + + + terminate: + + + + 139 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + hideOtherApplications: + + + + 146 + + + + hide: + + + + 152 + + + + unhideAllApplications: + + + + 153 + + + + cut: + + + + 175 + + + + paste: + + + + 176 + + + + redo: + + + + 178 + + + + selectAll: + + + + 179 + + + + undo: + + + + 180 + + + + copy: + + + + 181 + + + + showGuessPanel: + + + + 188 + + + + checkSpelling: + + + + 190 + + + + toggleContinuousSpellChecking: + + + + 192 + + + + performZoom: + + + + 198 + + + + window + + + + 217 + + + + delegate + + + + 219 + + + + editorStatusView + + + + 348 + + + + labelText + + + + 350 + + + + showPreferencesWindow: + + + + 381 + + + + performClose: + + + + 496 + + + + renameNote: + + + + 526 + + + + fixFileEncoding: + + + + 536 + + + + bringFocusToControlField: + + + + 555 + + + + shiftLeftAction: + + + + 568 + + + + shiftRightAction: + + + + 569 + + + + delete: + + + + 773 + + + + defaultStyle: + + + + 978 + + + + bold: + + + + 981 + + + + italic: + + + + 982 + + + + performFindPanelAction: + + + + 985 + + + + importNotes: + + + + 986 + + + + printNote: + + + + 987 + + + + exportNote: + + + + 988 + + + + tagNote: + + + + 995 + + + + delegate + + + + 1020 + + + + notesTableView + + + + 1021 + + + + delegate + + + + 1024 + + + + nextKeyView + + + + 1025 + + + + notesTableView + + + + 1027 + + + + splitSubview + + + + 1028 + + + + splitView + + + + 1029 + + + + textView + + + + 1030 + + + + delegate + + + + 1033 + + + + incrementNoteSelection: + + + + 1035 + + + + incrementNoteSelection: + + + + 1036 + + + + paste: + + + + 1037 + + + + deselectAll: + + + + 1038 + + + + nextKeyView + + + + 1039 + + + + delegate + + + + 1040 + + + + delegate + + + + 1041 + + + + performFindPanelAction: + + + + 1042 + + + + performFindPanelAction: + + + + 1043 + + + + performFindPanelAction: + + + + 1044 + + + + sparkleUpdateItem + + + + 1052 + + + + toggleNoteBodyPreviews: + + + + 1065 + + + + delegate + + + + 1068 + + + + nextKeyView + + + + 1069 + + + + notesTable + + + + 1070 + + + + fieldAction: + + + + 1071 + + + + controlField + + + + 1072 + + + + controlField + + + + 1073 + + + + field + + + + 1074 + + + + initialFirstResponder + + + + 1075 + + + + nextKeyView + + + + 1076 + + + + nextKeyView + + + + 1077 + + + + nextKeyView + + + + 1078 + + + + syncWaitSpinner + + + + 1084 + + + + syncWaitPanel + + + + 1085 + + + + syncWaitQuit: + + + + 1086 + + + + showHelpDocument: + + + + 1089 + + + + showHelpDocument: + + + + 1090 + + + + showHelpDocument: + + + + 1091 + + + + showHelpDocument: + + + + 1092 + + + + uppercaseWord: + + + + 1098 + + + + lowercaseWord: + + + + 1099 + + + + capitalizeWord: + + + + 1100 + + + + strikethroughNV: + + + + 1112 + + + + deleteNote: + + + + 1114 + + + + switchViewLayout: + + + + 1117 + + + + copyNoteLink: + + + + 1119 + + + + revealNote: + + + + 1121 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 21 + + + YES + + + + notation + + + 2 + + + YES + + + + + + 1010 + + + YES + + + + + + + 1011 + + + YES + + + + + + 1013 + + + YES + + + + + + + + + 1014 + + + + + 1012 + + + YES + + + + + + 1016 + + + YES + + + + + + + + 1017 + + + + + 29 + + + YES + + + + + + + + + + + MainMenu + + + 19 + + + YES + + + + + + 24 + + + YES + + + + + + + + + + 5 + + + + + 23 + + + + + 92 + + + + + 197 + + + + + 489 + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + + + 58 + + + + + 129 + + + + + 131 + + + YES + + + + + + 130 + + + + + 134 + + + + + 136 + + + + + 143 + + + + + 144 + + + + + 145 + + + + + 149 + + + + + 150 + + + + + 196 + + + + + 990 + + + + + 991 + + + + + 83 + + + YES + + + + + + 81 + + + YES + + + + + + + + + + + + + + + + + 77 + + + + + 78 + + + + + 79 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + + + 553 + + + + + 554 + + + + + 994 + + + + + 103 + + + YES + + + + + + 106 + + + YES + + + + + + + + + + + 111 + + + + + 1053 + + + + + 1055 + + + + + 1057 + + + + + 1058 + + + + + 1087 + + + + + 163 + + + YES + + + + + + 169 + + + YES + + + + + + + + + + + + + + + + + + + + 156 + + + + + 157 + + + + + 158 + + + + + 160 + + + + + 168 + + + YES + + + + + + 159 + + + YES + + + + + + + + + 154 + + + + + 161 + + + + + 162 + + + + + 167 + + + + + 171 + + + + + 172 + + + + + 173 + + + + + 184 + + + YES + + + + + + 185 + + + YES + + + + + + + + 187 + + + + + 189 + + + + + 191 + + + + + 550 + + + + + 557 + + + + + 771 + + + + + 1000 + + + + + 1093 + + + YES + + + + + + 1094 + + + YES + + + + + + + + 1095 + + + + + 1096 + + + + + 1097 + + + + + 382 + + + YES + + + + + + 383 + + + YES + + + + + + + + + + + + + + + + 386 + + + YES + + + + + + 387 + + + YES + + + + + + 388 + + + + + 389 + + + YES + + + + + + 390 + + + YES + + + + + + 391 + + + + + 507 + + + + + 508 + + + + + 520 + + + + + 521 + + + + + 522 + + + + + 1061 + + + + + 1062 + + + + + 397 + + + YES + + + + + + 398 + + + YES + + + + + + + + + + + + + + 534 + + + + + 563 + + + + + 564 + + + + + 565 + + + + + 574 + + + + + 575 + + + + + 576 + + + + + 577 + + + + + 977 + + + + + 996 + + + YES + + + + + + 997 + + + YES + + + + + + 998 + + + + + 213 + + + AppController + + + 341 + + + YES + + + + editorStatus + + + 342 + + + YES + + + + + + 452 + + + Font Manager + + + 1066 + + + YES + + + + fieldcustomview + + + 1067 + + + YES + + + + + + 1079 + + + YES + + + + quit waiting + + + 1080 + + + YES + + + + + + + + 1081 + + + YES + + + + + + 1082 + + + + + 1083 + + + YES + + + + + + 1102 + + + + + 1103 + + + + + 1104 + + + + + 1105 + + + + + 1106 + + + + + 1107 + + + + + 1108 + + + + + 1109 + + + + + 1110 + + + + + -3 + + + Application + + + 1115 + + + + + 1116 + + + + + 1118 + + + + + 1120 + + + + + + + YES + + YES + -3.IBPluginDependency + 1000.IBPluginDependency + 1000.ImportedFromIB2 + 1010.IBPluginDependency + 1010.ImportedFromIB2 + 1011.IBPluginDependency + 1011.ImportedFromIB2 + 1012.IBPluginDependency + 1012.ImportedFromIB2 + 1013.CustomClassName + 1013.IBPluginDependency + 1013.ImportedFromIB2 + 1014.CustomClassName + 1014.IBPluginDependency + 1014.ImportedFromIB2 + 1016.IBPluginDependency + 1016.ImportedFromIB2 + 1017.CustomClassName + 1017.IBPluginDependency + 1017.ImportedFromIB2 + 103.IBPluginDependency + 103.ImportedFromIB2 + 1053.IBPluginDependency + 1053.ImportedFromIB2 + 1055.IBPluginDependency + 1055.ImportedFromIB2 + 1057.IBPluginDependency + 1057.ImportedFromIB2 + 1058.IBPluginDependency + 1058.ImportedFromIB2 + 106.IBPluginDependency + 106.ImportedFromIB2 + 1061.IBPluginDependency + 1061.ImportedFromIB2 + 1062.IBPluginDependency + 1062.ImportedFromIB2 + 1066.IBEditorWindowLastContentRect + 1066.IBPluginDependency + 1066.ImportedFromIB2 + 1067.CustomClassName + 1067.IBPluginDependency + 1067.ImportedFromIB2 + 1079.IBEditorWindowLastContentRect + 1079.IBPluginDependency + 1079.IBWindowTemplateEditedContentRect + 1079.ImportedFromIB2 + 1079.windowTemplate.hasMinSize + 1079.windowTemplate.minSize + 1080.IBPluginDependency + 1080.ImportedFromIB2 + 1081.IBPluginDependency + 1081.ImportedFromIB2 + 1082.IBPluginDependency + 1082.ImportedFromIB2 + 1083.IBPluginDependency + 1083.ImportedFromIB2 + 1087.IBPluginDependency + 1087.ImportedFromIB2 + 1093.IBPluginDependency + 1093.ImportedFromIB2 + 1094.IBPluginDependency + 1094.ImportedFromIB2 + 1095.IBPluginDependency + 1095.ImportedFromIB2 + 1096.IBPluginDependency + 1096.ImportedFromIB2 + 1097.IBPluginDependency + 1097.ImportedFromIB2 + 1102.IBPluginDependency + 1103.IBPluginDependency + 1104.IBPluginDependency + 1105.IBPluginDependency + 1106.IBPluginDependency + 1106.IBShouldRemoveOnLegacySave + 1107.IBPluginDependency + 1107.IBShouldRemoveOnLegacySave + 1108.IBPluginDependency + 1108.IBShouldRemoveOnLegacySave + 1109.IBPluginDependency + 1109.IBShouldRemoveOnLegacySave + 111.IBPluginDependency + 111.ImportedFromIB2 + 1110.IBPluginDependency + 1110.IBShouldRemoveOnLegacySave + 1115.IBPluginDependency + 1116.IBPluginDependency + 1118.IBPluginDependency + 1120.IBPluginDependency + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 154.IBPluginDependency + 154.ImportedFromIB2 + 156.IBPluginDependency + 156.ImportedFromIB2 + 157.IBPluginDependency + 157.ImportedFromIB2 + 158.IBPluginDependency + 158.ImportedFromIB2 + 159.IBPluginDependency + 159.ImportedFromIB2 + 160.IBPluginDependency + 160.ImportedFromIB2 + 161.IBPluginDependency + 161.ImportedFromIB2 + 162.IBPluginDependency + 162.ImportedFromIB2 + 163.IBPluginDependency + 163.ImportedFromIB2 + 167.IBPluginDependency + 167.ImportedFromIB2 + 168.IBPluginDependency + 168.ImportedFromIB2 + 169.IBEditorWindowLastContentRect + 169.IBPluginDependency + 169.ImportedFromIB2 + 171.IBPluginDependency + 171.ImportedFromIB2 + 172.IBPluginDependency + 172.ImportedFromIB2 + 173.IBPluginDependency + 173.ImportedFromIB2 + 184.IBPluginDependency + 184.ImportedFromIB2 + 185.IBPluginDependency + 185.ImportedFromIB2 + 187.IBPluginDependency + 187.ImportedFromIB2 + 189.IBPluginDependency + 189.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 191.IBPluginDependency + 191.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 197.IBPluginDependency + 197.ImportedFromIB2 + 2.IBPluginDependency + 2.ImportedFromIB2 + 21.IBEditorWindowLastContentRect + 21.IBPluginDependency + 21.IBWindowTemplateEditedContentRect + 21.ImportedFromIB2 + 21.NSWindowTemplate.visibleAtLaunch + 21.windowTemplate.hasMinSize + 21.windowTemplate.maxSize + 21.windowTemplate.minSize + 213.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 24.IBEditorWindowLastContentRect + 24.IBPluginDependency + 24.ImportedFromIB2 + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 341.IBEditorWindowLastContentRect + 341.IBPluginDependency + 341.ImportedFromIB2 + 342.IBPluginDependency + 342.ImportedFromIB2 + 382.IBPluginDependency + 382.ImportedFromIB2 + 383.IBEditorWindowLastContentRect + 383.IBPluginDependency + 383.ImportedFromIB2 + 386.IBPluginDependency + 386.ImportedFromIB2 + 387.IBEditorWindowLastContentRect + 387.IBPluginDependency + 387.ImportedFromIB2 + 388.IBPluginDependency + 388.ImportedFromIB2 + 389.IBPluginDependency + 389.ImportedFromIB2 + 390.IBEditorWindowLastContentRect + 390.IBPluginDependency + 390.ImportedFromIB2 + 391.IBPluginDependency + 391.ImportedFromIB2 + 392.IBPluginDependency + 392.ImportedFromIB2 + 393.IBPluginDependency + 393.ImportedFromIB2 + 394.IBPluginDependency + 394.ImportedFromIB2 + 395.IBPluginDependency + 395.ImportedFromIB2 + 396.IBPluginDependency + 396.ImportedFromIB2 + 397.IBPluginDependency + 397.ImportedFromIB2 + 398.IBEditorWindowLastContentRect + 398.IBPluginDependency + 398.ImportedFromIB2 + 452.ImportedFromIB2 + 489.IBPluginDependency + 489.ImportedFromIB2 + 5.IBPluginDependency + 5.ImportedFromIB2 + 507.IBPluginDependency + 507.ImportedFromIB2 + 508.IBPluginDependency + 508.ImportedFromIB2 + 520.IBPluginDependency + 520.ImportedFromIB2 + 521.IBPluginDependency + 521.ImportedFromIB2 + 522.IBPluginDependency + 522.ImportedFromIB2 + 534.IBPluginDependency + 534.ImportedFromIB2 + 550.IBPluginDependency + 550.ImportedFromIB2 + 553.IBPluginDependency + 553.ImportedFromIB2 + 554.IBPluginDependency + 554.ImportedFromIB2 + 557.IBPluginDependency + 557.ImportedFromIB2 + 56.IBPluginDependency + 56.ImportedFromIB2 + 563.IBPluginDependency + 563.ImportedFromIB2 + 564.IBPluginDependency + 564.ImportedFromIB2 + 565.IBPluginDependency + 565.ImportedFromIB2 + 57.IBPluginDependency + 57.ImportedFromIB2 + 574.IBPluginDependency + 574.ImportedFromIB2 + 575.IBPluginDependency + 575.ImportedFromIB2 + 576.IBPluginDependency + 576.ImportedFromIB2 + 577.IBPluginDependency + 577.ImportedFromIB2 + 58.IBPluginDependency + 58.ImportedFromIB2 + 77.IBPluginDependency + 77.ImportedFromIB2 + 771.IBPluginDependency + 771.ImportedFromIB2 + 78.IBPluginDependency + 78.ImportedFromIB2 + 79.IBPluginDependency + 79.ImportedFromIB2 + 81.IBEditorWindowLastContentRect + 81.IBPluginDependency + 81.ImportedFromIB2 + 83.IBPluginDependency + 83.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + 977.IBPluginDependency + 977.ImportedFromIB2 + 990.IBPluginDependency + 990.ImportedFromIB2 + 991.IBPluginDependency + 991.ImportedFromIB2 + 994.IBPluginDependency + 994.ImportedFromIB2 + 996.IBPluginDependency + 996.ImportedFromIB2 + 997.IBEditorWindowLastContentRect + 997.IBPluginDependency + 997.ImportedFromIB2 + 998.IBPluginDependency + 998.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + net.brockerhoff.RBSplitView.IBPlugin + + net.brockerhoff.RBSplitView.IBPlugin + + net.brockerhoff.RBSplitView.IBPlugin + + AugmentedScrollView + com.apple.InterfaceBuilder.CocoaPlugin + + NotesTableView + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + LinkingEditor + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{329, 799}, {381, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + DualField + com.apple.InterfaceBuilder.CocoaPlugin + + {{329, 739}, {353, 106}} + com.apple.InterfaceBuilder.CocoaPlugin + {{329, 739}, {353, 106}} + + + {213, 107} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{257, 556}, {255, 273}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{329, 356}, {397, 464}} + com.apple.InterfaceBuilder.CocoaPlugin + {{329, 356}, {397, 464}} + + + + {1.79769e+308, 1.79769e+308} + {213, 107} + + com.apple.InterfaceBuilder.CocoaPlugin + + {{786, 650}, {255, 93}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{40, 829}, {645, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{63, 791}, {147, 102}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{333, 646}, {339, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{563, 666}, {97, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{563, 646}, {97, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{711, 580}, {210, 163}} + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{207, 616}, {238, 213}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{625, 720}, {129, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 1121 + + + + YES + + AppController + NSObject + + YES + + YES + bringFocusToControlField: + cancelOperation: + copyNoteLink: + deleteNote: + exportNote: + fieldAction: + importNotes: + printNote: + renameNote: + revealNote: + showHelpDocument: + showPreferencesWindow: + switchViewLayout: + syncWaitQuit: + tagNote: + toggleNVActivation: + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + editorStatusView + field + notesTableView + sparkleUpdateItem + splitSubview + splitView + syncWaitPanel + syncWaitSpinner + textView + window + + + YES + EmptyView + DualField + NotesTableView + NSMenuItem + RBSplitSubview + RBSplitView + NSPanel + NSProgressIndicator + LinkingEditor + NSWindow + + + + IBProjectSource + AppController.h + + + + AppController + + IBProjectSource + AppController_Importing.h + + + + AppController + NSObject + + YES + + YES + fixFileEncoding: + newNoteWithClipboard: + + + YES + id + id + + + + IBUserSource + + + + + AugmentedScrollView + NSScrollView + + IBProjectSource + AugmentedScrollView.h + + + + DualField + NSTextField + + snapback: + id + + + notesTable + NSTableView + + + IBProjectSource + DualField.h + + + + DualField + NSTextField + + IBUserSource + + + + + EmptyView + NSView + + labelText + NSTextField + + + IBProjectSource + EmptyView.h + + + + EmptyView + NSView + + IBUserSource + + + + + FirstResponder + NSObject + + YES + + YES + bold: + defaultStyle: + deleteToBeginningOfLine: + deleteWordBackward: + italic: + shiftLeftAction: + shiftRightAction: + strikethroughNV: + + + YES + id + id + id + id + id + id + id + id + + + + IBUserSource + + + + + LinkingEditor + NSTextView + + YES + + YES + bold: + defaultStyle: + italic: + strikethroughNV: + + + YES + id + id + id + id + + + + YES + + YES + controlField + notesTableView + + + YES + NSTextField + NotesTableView + + + + IBProjectSource + LinkingEditor.h + + + + LinkingEditor + + YES + + YES + shiftLeftAction: + shiftRightAction: + + + YES + id + id + + + + IBProjectSource + LinkingEditor_Indentation.h + + + + LinkingEditor + NSTextView + + underlineNV: + id + + + IBUserSource + + + + + NSObject + + IBProjectSource + BookmarksController.h + + + + NSObject + + IBProjectSource + FastListDataSource.h + + + + NSObject + + IBProjectSource + GlobalPrefs.h + + + + NSObject + + IBProjectSource + NotationController.h + + + + NSObject + + IBProjectSource + NotationFileManager.h + + + + NSObject + + IBProjectSource + NoteObject.h + + + + NSObject + + IBProjectSource + PassphrasePicker.h + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + RBSplitView/RBSplitView.h + + + + NSObject + + IBProjectSource + SyncResponseFetcher.h + + + + NSObject + + IBProjectSource + SyncServiceSessionProtocol.h + + + + NSTableHeaderView + + IBProjectSource + HeaderViewWIthMenu.h + + + + NSTableView + + IBProjectSource + NotesTableView.h + + + + NSTextView + + YES + + YES + moveToLeftEndOfLine: + toggleAutomaticTextReplacement: + + + YES + id + id + + + + + + NSTextView + NSText + + performFindPanelAction: + id + + + IBUserSource + + + + + NotesTableView + NSTableView + + YES + + YES + actionHideShowColumn: + incrementNoteSelection: + toggleNoteBodyPreviews: + + + YES + id + id + id + + + + YES + + YES + controlField + labelsListSource + + + YES + NSTextField + id + + + + + + NotesTableView + NSTableView + + paste: + id + + + IBUserSource + + + + + RBSplitSubview + NSView + + IBProjectSource + RBSplitView/RBSplitSubview.h + + + + RBSplitSubview + + IBProjectSource + RBSplitView/RBSplitViewPrivateDefines.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + + + RBSplitView + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSBrowser + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSBrowser.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSDocument + NSObject + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocument.h + + + + NSDocument + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentScripting.h + + + + NSFontManager + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMatrix + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSMatrix.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMovieView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMovieView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + PrintCore.framework/Headers/PDEPluginInterface.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFAuthorizationView.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFCertificatePanel.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFChooseIdentityPanel.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSPanel + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSPanel.h + + + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSTableHeaderView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTableHeaderView.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + WebView + NSView + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + id + id + id + id + id + id + id + id + id + id + id + + + + IBFrameworkSource + WebKit.framework/Headers/WebView.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../Notation.xcodeproj + 3 + + diff --git a/Italian.lproj/MainMenu.nib/keyedobjects.nib b/Italian.lproj/MainMenu.nib/keyedobjects.nib new file mode 100644 index 00000000..3fe28972 Binary files /dev/null and b/Italian.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/Italian.lproj/NotationPrefsView.nib/designable.nib b/Italian.lproj/NotationPrefsView.nib/designable.nib new file mode 100644 index 00000000..f6d4da1b --- /dev/null +++ b/Italian.lproj/NotationPrefsView.nib/designable.nib @@ -0,0 +1,4215 @@ + + + + 1040 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + NotationPrefsViewController + + + FirstResponder + + + NSApplication + + + + 256 + + YES + + + 274 + {{-12, -10}, {489, 362}} + + + + YES + + sync + + + 256 + + YES + + + 256 + {{177, 237}, {244, 22}} + + + YES + + -1804468671 + 272630784 + + + LucidaGrande + 13 + 1044 + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + 3 + MAA + + + + + + + 256 + {{72, 239}, {100, 17}} + + + YES + + 67239424 + 71303168 + Nome (Login): + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + + + + 256 + {{60, 205}, {112, 19}} + + + YES + + 67239424 + 71303168 + Parole d'ordine: + + + + + + + + + 256 + {{177, 205}, {244, 22}} + + + YES + + -1804468671 + 272630784 + + + + YES + + + + + + + 256 + {{258, 56}, {193, 32}} + + + YES + + 67239424 + 134217728 + Maggiori informazioni… + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + + 256 + {{24, 132}, {421, 5}} + + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 2 + 0 + NO + + + + 256 + {{21, 92}, {427, 34}} + + + YES + + 67239424 + 272629760 + Le note saranno sincronizzate con l'applicazione per iPhone e con il sito web di Simplenote. + + + + + + + + + -2147483380 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{429, 240}, {16, 16}} + + + YES + + 130560 + 33554432 + + NSImage + statusError + + 0 + 2 + 0 + NO + + YES + + + + 268 + {{26, 183}, {398, 14}} + + + YES + + 68288064 + 71435264 + + + LucidaGrande + 11 + 3100 + + + + + 6 + System + disabledControlTextColor + + 3 + MC4zMzMzMzMzMzMzAA + + + + + + + 268 + {{356, 151}, {92, 26}} + + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + + 400 + 75 + + + minuto + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + 1 + + + YES + + OtherViews + + YES + + + + 5 minuti + + 1048576 + 2147483647 + + + _popUpItemAction: + 5 + + + + + 10 minuti + + 1048576 + 2147483647 + + + _popUpItemAction: + 10 + + + + + 30 minuti + + 1048576 + 2147483647 + + + _popUpItemAction: + 30 + + + + + 1 + YES + YES + 2 + + + + + 268 + {{21, 157}, {336, 17}} + + + YES + + 67239424 + 71303168 + Controlla modifiche ai documenti sincronizzati ogni: + + + + + + + + + 268 + {{27, 279}, {218, 18}} + + + YES + + 67239424 + 0 + Sincronizza con Simplenote: + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{29, 17}, {18, 18}} + + + YES + + 130560 + 33554432 + + NSImage + TinyAlert + + 0 + 2 + 0 + NO + + YES + + + + 268 + {{52, 19}, {383, 14}} + + + YES + + 67239424 + 272760832 + Attenzione: Il contenuto delle note sarà inviato come [semplice testo]. + + + + + + + + {{10, 33}, {469, 316}} + + + + Sincronizzazione + + + + + storage + + + 256 + + YES + + + 256 + + YES + + + 2304 + + YES + + + 256 + {77, 74} + + + YES + + + 256 + {77, 17} + + + + + + + 256 + {{78, 0}, {12, 17}} + + + + + YES + + 73.755369999999999 + 60.147950000000002 + 77 + + 75628096 + 2048 + Estensione + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + + + + 337772096 + 2048 + + + + 6 + System + controlBackgroundColor + + + + + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 14 + 306184192 + + + 4 + 15 + 0 + YES + 0 + + + {{1, 17}, {77, 74}} + + + + + 4 + + + + 256 + {{78, 17}, {11, 74}} + + + 256 + + _doScroller: + 0.46250000000000002 + + + + -2147483392 + {{-100, -100}, {128, 15}} + + 257 + + _doScroller: + 0.99047620000000003 + + + + 2304 + + YES + + + {{1, 0}, {77, 17}} + + + + + 4 + + + + {{125, 73}, {90, 92}} + + + 18 + + + + + + QSAAAEEgAABBgAAAQYAAAA + + + + 256 + + YES + + + 2304 + + YES + + + 256 + {90, 74} + + + YES + + + 256 + {90, 17} + + + + + + + 256 + {{78, 0}, {12, 17}} + + + + + YES + + 87.126949999999994 + 55.62012 + 87.126949999999994 + + 75628096 + 2048 + Tipo documento + + + 3 + MC4zMzMzMzI5OQA + + + + + 337772096 + 2048 + + + + + + YES + + + + 3 + 2 + + + 14 + 308281344 + + + 4 + 15 + 0 + YES + 0 + + + {{1, 17}, {77, 74}} + + + + + 4 + + + + 256 + {{78, 17}, {11, 74}} + + + 256 + + _doScroller: + 0.46250000000000002 + + + + -2147483392 + {{-100, -100}, {128, 15}} + + YES + 257 + + _doScroller: + 0.99047620000000003 + + + + 2304 + + YES + + + {{1, 0}, {77, 17}} + + + + + 4 + + + + {{251, 73}, {90, 92}} + + + 146 + + + + + + QSAAAEEgAABBgAAAQYAAAA + + + + 256 + {{62, 173}, {342, 22}} + + + YES + + 67239424 + 4194304 + Riconosci documenti separati con i seguenti attributi: + + + + + + + + + 256 + {{51, 209}, {364, 28}} + + + YES + + 67239424 + 272629760 + * L'uso di documenti separati consente la ricerca con Spotlight, ma richiede più spazio su disco. + + + + + + + + + 292 + {{125, 48}, {23, 22}} + + + YES + + 604110336 + 134217728 + + + + 138690815 + 6 + + NSImage + Add + + + NSImage + Add_Pressed + + + + + + 200 + 25 + + + + + 292 + {{147, 48}, {23, 22}} + + + YES + + 604110336 + 134217728 + + + + 138690815 + 6 + + NSImage + Remove + + + NSImage + Remove_Pressed + + + + + + 200 + 25 + + + + + 292 + {{251, 48}, {23, 22}} + + + YES + + 604110336 + 134217728 + + + + 138690815 + 6 + + + + + + + 200 + 25 + + + + + 292 + {{273, 48}, {23, 22}} + + + YES + + 604110336 + 134217728 + + + + 138690815 + 6 + + + + + + + 200 + 25 + + + + + 256 + {{51, 280}, {364, 17}} + + + YES + + 67239424 + 4194304 + Memorizza e leggi le note su disco come: + + + + + + + + + 256 + {{57, 15}, {351, 18}} + + + YES + + 604110336 + 0 + Conferma rimozione delle note dal Finder + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{51, 248}, {364, 26}} + + + 4 + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + + + + + 400 + 75 + + + Singolo archivio (può essere protetto) + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + + OtherViews + + + YES + + + + YES + YES + + + 1048576 + 2147483647 + + + _popUpItemAction: + -1 + + + + + Documenti di solo testo * + + 1048576 + 2147483647 + + + _popUpItemAction: + 1 + + + + + Documenti RTF (Rich Text Format) * + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + Documenti in formato HTML * + + 1048576 + 2147483647 + + + _popUpItemAction: + 3 + + + + + 3 + YES + YES + 1 + + + + + 292 + {{169, 48}, {23, 22}} + + YES + + 604110336 + 134217728 + + + + 138690815 + 6 + + NSImage + MakeDefault + + + NSImage + MakeDefault_Pressed + + + + + + 200 + 25 + + + + {{10, 33}, {469, 316}} + + + Dispositivo + + + + + security + + + 256 + + YES + + + 256 + {{49, 280}, {93, 17}} + + + YES + + 67239424 + 71303168 + Protezione: + + + + + + + + + 256 + {{147, 179}, {231, 38}} + + + YES + 2 + 1 + + YES + + -2080244224 + 0 + Memorizza nel Portachiavi + + + 1211912703 + 0 + + NSImage + NSRadioButton + + + NSRadioButton + + + + + + 200 + 25 + + + 67239424 + 0 + Chiedi ogni volta + + + 1 + 1211912703 + 0 + + + + + 200 + 25 + + + {231, 18} + {4, 2} + 1143472128 + NSActionCell + + 67239424 + 0 + Radio + + 1211912703 + 0 + + 549453824 + {18, 18} + + YES + + YES + + + + TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw +IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/ +29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5 +dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA +AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG +AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/ +0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/ +7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/ +5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/ +3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD +AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns +AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/ +6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/ +/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/ +///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl +YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA +AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD +AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu +AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB +AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAAksAAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAJLGFw +cGwCAAAAbW50clJHQiBYWVogB9UAAwALABYABAAmYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAPbWAAEAAAAA0y1iZXJnGIxw8W4jzRphRSyje/thewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAMZGVzYwAAARQAAABDY3BydAAAAVgAAAAsclhZWgAAAYQAAAAUZ1hZWgAAAZgAAAAUYlhZWgAA +AawAAAAUd3RwdAAAAcAAAAAUYmtwdAAAAdQAAAAUclRSQwAAAegAAAAOZ1RSQwAAAfgAAAAOYlRSQwAA +AggAAAAOdmNndAAAAhgAAAMSYmVyaAAABSwAAAQAZGVzYwAAAAAAAAAWRGVsbDIwMDVGUFdDYWxpYnJh +dGVkAAAAAAAAAAAAAAAWRGVsbDIwMDVGUFdDYWxpYnJhdGVkAAB0ZXh0AAAAAENvcHlyaWdodCAxOTk4 +LTIwMDEgYmVyZ2Rlc2lnbiBpbmMuAFhZWiAAAAAAAABvoAAAOPUAAAORWFlaIAAAAAAAAGKXAAC3hwAA +GNpYWVogAAAAAAAAJJ8AAA+EAAC2w1hZWiAAAAAAAADzUAABAAAAARbMWFlaIAAAAAAAAAAAAAAAAAAA +AABjdXJ2AAAAAAAAAAEBzAAAY3VydgAAAAAAAAABAcwAAGN1cnYAAAAAAAAAAQHMAAB2Y2d0AAAAAAAA +AAAAAwEAAAEABwcICQoLDQ4QERMVFxkaHB4fISIkJSYoKSorLC0vMDEyMzQ1Njc4OTs8PT4/QEFCQ0VG +R0hJSktMTU9QUVJTVFVWV1hZW1xdXl9gYWJjZGVnaGlqa2xtbm9wcnN0dXZ3eHl6fH1+f4CBgoOEhYaH +iImKi4yNjo+QkZKTk5SVlpeYmZmam5ydnp6foKGio6Okpaamp6ipqqqrrK2trq+wsLGys7S0tba3t7i5 +urq7vL29vr/AwcHCw8TFxcbHyMjJysvMzM3Oz9DR0dLT1NXV1tfY2dra29zd3t/f4OHi4+Tk5ebn6Onq +6uvs7e7v8PHx8vP09fb3+Pn6+vv8/f7/AAUFBQUGBgcICQoLDA0ODxASExQWFxkaHB4fISIkJicpKywu +LzEyNDU3ODo7PT4/QUJDRUZHSElLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpa2xtbm9wcXJz +dXZ3eHl7fH1+f4GCg4SFhoeIiYqLjI2Njo+QkZGSk5OUlZaWl5iZmpqbnJ2enp+goaKio6SlpqanqKmq +q6usra6vr7CxsrOztLW2t7e4ubq6u7y9vb6/wMDBwsPDxMXGx8fIycrLy8zNzs/P0NHS09TU1dbX2NnZ +2tvc3d7f4OHh4uPk5ebn6Onq6+zs7e7v8PHy8/T19vf4+fr7/P3+/wAGBwcICQoLDQ4QERMVFhgaGx0f +ICIjJCYnKCorLC0uMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSUpLTE1OT1BRUlRVVldYWVpbXV5fYGFi +Y2RmZ2hpamtsbW5wcXJzdHV2d3h5ent8fX5/gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaWl5iZmpucnZ2e +n6ChoqKjpKWlpqeoqKmqqqusra2ur6+wsbKys7S0tba3uLi5uru8vb6/v8DBwsPExcbHyMnKy8zNzs/Q +0dLT1NXW19fY2drb3N3e3t/g4eLj5OTl5ufo6Onq6+zt7e7v8PHx8vP09fX29/j5+fr7/P39/v8AAGJl +cmgAAAAAY2hhbgAAAAQAAAADb3JpZwAAAAT/////ZHN0cAAAAAQAAAACY3RybAAAAAwAAAABAAAAAAAA +AGRyZXNvAAAACAAABpAAAAQaZnJlcQAAAAQAAAA8Yml0ZAAAAAgAAAABAAAAIGRhdGUAAAAkAAAAJgAA +AAQAAAAWAAAACwAAAAIAAABpAAAABQAAAEUAAAAAZ2FtYQAAAAQ/5mZmcmltZAAAA1QAAAEAAAAACjzn +H0w/gAAAAAAAAAAAAAcAAAAGAAAABQAAAAQAAAADAAAACQAAAAIAAAAIAAAAAQAAAAA8gICBPQCAgT2A +gIE+AICBPoCAgT7AwME/AAAAP0BAQD+AAAAAAAAAPg6WYT5E6Aw+io71PsRx8D8Lq+w/JalpPzmllT9e +HCM/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPQCAgT5FCM0AAAAAAAAAAD2AgIE+ipQHAAAAAAAA +AAA+AICBPsRyHAAAAAAAAAAAPoCAgT8Lq/wAAAAAAAAAAD8AgIE/OgygAAAAAAAAAAA/QMDBP15iJAAA +AAAAAAAAP4AAAD+AAAA/AICBPzn01T+AAAA/gAAAP4AAAD+AAAA/gAAAP4AAAAAAAAk8nlyOP4AAAAAA +AAAAAAAFAAAABAAAAAcAAAADAAAABgAAAAIAAAAIAAAAAQAAAAA9gICBPgCAgT4wsLE+gICBPpCQkT8A +AAA/EBAQP4AAAAAAAAA+jFZwPsKkaD7lZjo/C2z0PxGgTT84CrM/QRCVP4AAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAD4AgIE+wqR9AAAAAAAAAAA+gICBPwttCz2AgIE+jGjmPpCQkT8RmaQAAAAAAAAAAD8A +gIE/OHMcPYCAgT6MZiM/AICBPzhVzAAAAAAAAAAAP4AAAD+AAAA+AICBPsKjVD+AAAA/gAAAP4AAAD+A +AAA/gAAAP4AAAAAAAAo80bjYP4AAAAAAAAAAAAAJAAAACAAAAAYAAAAFAAAAAwAAAAcAAAACAAAABAAA +AAEAAAAAPICAgT0AgIE9gICBPgCAgT6AgIE+wMDBPwAAAD8gICA/gAAAAAAAAD4KEPo+Qk7bPoYqQj7B +E58/CUbSPyQEBT82+Mc/TUERP4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD0AgIE+QkepAAAAAAAA +AAA9gICBPoYsGQAAAAAAAAAAPgCAgT7BE7wAAAAAAAAAAD6AgIE/CUbrAAAAAAAAAAA/AICBPzdiEz4A +gIE+wROVPyCgoT9NlUsAAAAAAAAAAD+AAAA/gAAAPoCAgT8JRt8/gAAAP4AAAD+AAAA/gAAAP4AAAD+A +AAA + + + + + + 3 + MCAwAA + + + + 400 + 75 + + + + + + + + + 256 + {{141, 269}, {275, 32}} + + + YES + + 67239424 + 134217728 + Attiva protezione… + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + + 256 + {{141, 229}, {106, 32}} + + + YES + + 604110336 + 134217728 + Cambia… + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + + 256 + {{31, 239}, {111, 17}} + + + YES + + 67239424 + 71303168 + Parola d'ordine: + + + + + + + + + -2147483392 + {{43, 6}, {174, 51}} + + + YES + + 67239424 + 71303168 + Bit nella chiave: + + + + + + + + + -2147483392 + {{201, 8}, {19, 27}} + + + YES + + 537787936 + 0 + + 256 + 64 + 2048 + 64 + YES + + + + + -2147483392 + {{134, 11}, {67, 22}} + + + YES + + -1536033215 + 272630784 + 256 + + + YES + + + + + + + 256 + {{43, 145}, {99, 17}} + + + YES + + 67239424 + 71303168 + Chiave: + + + + + + + + + 256 + {{145, 144}, {235, 18}} + + + YES + + 67239424 + 0 + Inserimento sicuro del testo + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{144, 124}, {269, 14}} + + + YES + + 67239424 + 272629760 + Può bloccare i programmi di keystroke logging. + + + + + + + + + -2147483392 + {{116, 57}, {195, 32}} + + YES + + 604110336 + 134217728 + Cancella dal Portachiavi + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + {{10, 33}, {469, 316}} + + + Sicurezza + + + + + + + 0 + YES + YES + + YES + + + + + {464, 346} + + + NSView + NSResponder + + + 3 + 2 + {{695, 282}, {360, 240}} + 1886912512 + Web Hosting Options + + NSPanel + + + View + + {1.79769e+308, 1.79769e+308} + {213, 107} + + + 256 + + YES + + + 256 + {{17, 20}, {326, 200}} + + YES + + 67239424 + 272629760 + W3hdIFJlbmRyZSBwdWJsaXF1ZXMgbGVzIG5vdGVzIGF5YW50IGNlcyDDqXRpcXVldHRlcyA6CgpbeF0g +UmVuZHJlIHRvdXRlcyBsZXMgbm90ZXMgcHVibGlxdWVzLCBzYXVmIGNlbGxlcyBheWFudCBjZXMgw6l0 +aXF1ZXR0ZXMgOgoKW3hdIEV4aWdlciB1biBtb3QgZGUgcGFzc2UgcG91ciB2b2lyIGxlcyBub3RlcyBz +dXIgbGUgV2ViLgoKW3hdIFV0aWxpc2VyIGNlIGdhYmFyaXQgSFRNTCA6A + + + + + + + + {360, 240} + + {{0, 0}, {1920, 1178}} + {213, 129} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + nextKeyView + + + + 51 + + + + nextKeyView + + + + 54 + + + + allowedExtensionsTable + + + + 58 + + + + allowedTypesTable + + + + 59 + + + + newExtensionButton + + + + 60 + + + + removeExtensionButton + + + + 61 + + + + newTypeButton + + + + 62 + + + + removeTypeButton + + + + 63 + + + + changePasswordButton + + + + 64 + + + + passwordSettingsMatrix + + + + 65 + + + + view + + + + 71 + + + + enableEncryptionButton + + + + 73 + + + + addedExtension: + + + + 75 + + + + removedExtension: + + + + 76 + + + + addedType: + + + + 77 + + + + removedType: + + + + 78 + + + + toggledEncryption: + + + + 79 + + + + changePassphrase: + + + + 80 + + + + changedKeychainSettings: + + + + 81 + + + + changedFileDeletionWarningSettings: + + + + 95 + + + + confirmFileDeletionButton + + + + 97 + + + + storageFormatPopupButton + + + + 104 + + + + changedFileStorageFormat: + + + + 105 + + + + storageFormatPopupButton + + + + 106 + + + + storageFormatPopupButton + + + + 107 + + + + keyLengthField + + + + 114 + + + + keyLengthStepper + + + + 115 + + + + changedKeyLength: + + + + 116 + + + + webOptionsWindow + + + + 123 + + + + secureTextEntryButton + + + + 131 + + + + changedSecureTextEntry: + + + + 132 + + + + removeFromKeychainButton + + + + 134 + + + + removeFromKeychain: + + + + 135 + + + + fileAttributesHelpText + + + + 138 + + + + verifyStatusImageView + + + + 181 + + + + verifyStatusField + + + + 186 + + + + visitSimplenoteSite: + + + + 187 + + + + syncPasswordField + + + + 203 + + + + syncAccountField + + + + 204 + + + + syncingFrequency + + + + 205 + + + + syncFrequencyChange: + + + + 206 + + + + enabledSyncButton + + + + 207 + + + + toggledSyncing: + + + + 208 + + + + syncEncAlertField + + + + 261 + + + + syncEncAlertView + + + + 262 + + + + makeDefaultExtensionButton + + + + 265 + + + + makeDefaultExtension: + + + + 266 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 5 + + + YES + + + + View + + + 6 + + + YES + + + + + + + + 7 + + + YES + + + + + + 8 + + + YES + + + + + + + + + + + + + + + + + 9 + + + YES + + + + + + + + + 10 + + + YES + + + + + + 11 + + + YES + + + + + + 12 + + + YES + + + + + + + + + 13 + + + YES + + + + + + 14 + + + YES + + + + + + 15 + + + YES + + + + + + 16 + + + YES + + + + + + 18 + + + YES + + + + + + 19 + + + YES + + + + + + 20 + + + YES + + + + + + 21 + + + YES + + + + + + 92 + + + YES + + + + + + 93 + + + YES + + + + + + 98 + + + YES + + + + + + 22 + + + YES + + + + + + 23 + + + YES + + + + + + + + + + + + + + + + + 24 + + + YES + + + + + + + + 25 + + + + + 26 + + + + + 29 + + + YES + + + + + + 30 + + + YES + + + + + + 32 + + + YES + + + + + + 34 + + + YES + + + + + + 110 + + + YES + + + + + + 111 + + + YES + + + + + + 112 + + + YES + + + + + + 128 + + + YES + + + + + + 129 + + + YES + + + + + + 130 + + + YES + + + + + + 133 + + + YES + + + + + + 36 + + + YES + + + + + + 37 + + + YES + + + + + + + + + + + + + + + + + + + 39 + + + YES + + + + + + 40 + + + YES + + + + + + 41 + + + YES + + + + + + 42 + + + YES + + + + + + 43 + + + YES + + + + + + 108 + + + YES + + + 256 + {{2, 2}, {125, 1}} + + + + + + + 109 + + + + + 113 + + + YES + + + + + + 179 + + + YES + + + + + + 184 + + + YES + + + + + + 188 + + + YES + + + + + + 194 + + + YES + + + + + + 199 + + + YES + + + + + + 121 + + + YES + + + + web hosting options + + + 122 + + + YES + + + + + + 125 + + + YES + + + + + + 216 + + + + + 217 + + + + + 218 + + + + + 219 + + + + + 220 + + + + + 221 + + + + + 222 + + + + + 223 + + + + + 224 + + + YES + + + + + + 225 + + + + + 226 + + + + + 227 + + + + + 228 + + + + + 229 + + + + + 230 + + + + + 231 + + + + + 232 + + + + + 233 + + + + + 234 + + + + + 235 + + + + + 236 + + + + + 237 + + + + + 238 + + + + + 239 + + + + + 240 + + + + + 241 + + + + + 242 + + + + + 243 + + + + + 244 + + + YES + + + + + + 245 + + + + + 246 + + + + + 247 + + + + + 248 + + + + + 249 + + + + + 250 + + + + + 99 + + + YES + + + + + + + + + + 127 + + + + + 103 + + + + + 102 + + + + + 101 + + + + + 100 + + + + + 190 + + + YES + + + + + + + + + 196 + + + + + 193 + + + + + 192 + + + + + 191 + + + + + 251 + + + + + 252 + + + + + 253 + + + + + 254 + + + + + 255 + + + + + 256 + + + + + 257 + + + YES + + + + + + 258 + + + + + 259 + + + YES + + + + + + 260 + + + + + 263 + + + YES + + + + + + 264 + + + + + + + YES + + YES + -3.IBPluginDependency + -3.ImportedFromIB2 + 10.CustomClassName + 10.IBPluginDependency + 10.ImportedFromIB2 + 100.IBPluginDependency + 100.ImportedFromIB2 + 101.IBPluginDependency + 101.ImportedFromIB2 + 102.IBPluginDependency + 102.ImportedFromIB2 + 103.IBPluginDependency + 103.ImportedFromIB2 + 108.IBPluginDependency + 108.ImportedFromIB2 + 109.IBPluginDependency + 109.ImportedFromIB2 + 11.IBPluginDependency + 11.ImportedFromIB2 + 110.IBPluginDependency + 110.ImportedFromIB2 + 111.IBPluginDependency + 111.ImportedFromIB2 + 112.IBPluginDependency + 112.ImportedFromIB2 + 113.IBPluginDependency + 113.ImportedFromIB2 + 12.IBPluginDependency + 12.ImportedFromIB2 + 121.IBEditorWindowLastContentRect + 121.IBPluginDependency + 121.IBWindowTemplateEditedContentRect + 121.ImportedFromIB2 + 121.windowTemplate.hasMinSize + 121.windowTemplate.minSize + 122.IBPluginDependency + 122.ImportedFromIB2 + 125.IBPluginDependency + 125.ImportedFromIB2 + 127.IBPluginDependency + 127.ImportedFromIB2 + 128.IBPluginDependency + 128.ImportedFromIB2 + 129.IBPluginDependency + 129.ImportedFromIB2 + 13.CustomClassName + 13.IBPluginDependency + 13.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 133.IBPluginDependency + 133.ImportedFromIB2 + 14.IBPluginDependency + 14.ImportedFromIB2 + 15.IBPluginDependency + 15.ImportedFromIB2 + 16.IBAttributePlaceholdersKey + 16.IBPluginDependency + 16.ImportedFromIB2 + 179.IBPluginDependency + 179.ImportedFromIB2 + 18.IBPluginDependency + 18.ImportedFromIB2 + 184.IBPluginDependency + 184.ImportedFromIB2 + 188.IBPluginDependency + 188.ImportedFromIB2 + 19.IBAttributePlaceholdersKey + 19.IBPluginDependency + 19.ImportedFromIB2 + 190.IBEditorWindowLastContentRect + 190.IBPluginDependency + 190.ImportedFromIB2 + 191.IBPluginDependency + 191.ImportedFromIB2 + 192.IBPluginDependency + 192.ImportedFromIB2 + 193.IBPluginDependency + 193.ImportedFromIB2 + 194.IBPluginDependency + 194.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 199.IBPluginDependency + 199.ImportedFromIB2 + 20.IBAttributePlaceholdersKey + 20.IBPluginDependency + 20.ImportedFromIB2 + 21.IBAttributePlaceholdersKey + 21.IBPluginDependency + 21.ImportedFromIB2 + 216.IBPluginDependency + 217.IBPluginDependency + 218.IBPluginDependency + 219.IBPluginDependency + 22.IBPluginDependency + 22.ImportedFromIB2 + 220.IBPluginDependency + 221.IBPluginDependency + 222.IBPluginDependency + 223.IBPluginDependency + 224.IBPluginDependency + 225.IBPluginDependency + 226.IBPluginDependency + 227.IBPluginDependency + 228.IBPluginDependency + 229.IBPluginDependency + 23.IBPluginDependency + 23.ImportedFromIB2 + 230.IBPluginDependency + 231.IBPluginDependency + 232.IBPluginDependency + 233.IBPluginDependency + 234.IBPluginDependency + 235.IBPluginDependency + 236.IBPluginDependency + 237.IBPluginDependency + 238.IBPluginDependency + 239.IBPluginDependency + 24.IBPluginDependency + 24.ImportedFromIB2 + 240.IBPluginDependency + 241.IBPluginDependency + 242.IBPluginDependency + 243.IBPluginDependency + 244.IBPluginDependency + 245.IBPluginDependency + 246.IBPluginDependency + 247.IBPluginDependency + 248.IBPluginDependency + 249.IBPluginDependency + 249.IBShouldRemoveOnLegacySave + 25.IBPluginDependency + 25.ImportedFromIB2 + 250.IBPluginDependency + 250.IBShouldRemoveOnLegacySave + 251.IBPluginDependency + 251.IBShouldRemoveOnLegacySave + 252.IBPluginDependency + 252.IBShouldRemoveOnLegacySave + 253.IBPluginDependency + 253.IBShouldRemoveOnLegacySave + 254.IBPluginDependency + 254.IBShouldRemoveOnLegacySave + 255.IBPluginDependency + 255.IBShouldRemoveOnLegacySave + 256.IBPluginDependency + 256.IBShouldRemoveOnLegacySave + 257.IBPluginDependency + 258.IBPluginDependency + 259.IBPluginDependency + 26.IBPluginDependency + 26.ImportedFromIB2 + 260.IBPluginDependency + 263.IBAttributePlaceholdersKey + 263.IBPluginDependency + 263.ImportedFromIB2 + 264.IBPluginDependency + 29.IBPluginDependency + 29.ImportedFromIB2 + 30.IBPluginDependency + 30.ImportedFromIB2 + 32.IBPluginDependency + 32.ImportedFromIB2 + 34.IBPluginDependency + 34.ImportedFromIB2 + 36.IBPluginDependency + 36.ImportedFromIB2 + 37.IBPluginDependency + 37.ImportedFromIB2 + 39.IBAttributePlaceholdersKey + 39.IBPluginDependency + 39.ImportedFromIB2 + 40.IBPluginDependency + 40.ImportedFromIB2 + 41.IBPluginDependency + 41.ImportedFromIB2 + 42.IBPluginDependency + 42.ImportedFromIB2 + 43.CustomClassName + 43.IBPluginDependency + 43.ImportedFromIB2 + 5.IBEditorWindowLastContentRect + 5.IBPluginDependency + 5.ImportedFromIB2 + 6.IBPluginDependency + 6.ImportedFromIB2 + 7.IBPluginDependency + 7.ImportedFromIB2 + 8.IBPluginDependency + 8.ImportedFromIB2 + 9.IBPluginDependency + 9.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + 93.IBPluginDependency + 93.ImportedFromIB2 + 98.IBPluginDependency + 98.ImportedFromIB2 + 99.IBEditorWindowLastContentRect + 99.IBPluginDependency + 99.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + FileKindListView + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{407, 494}, {360, 240}} + com.apple.InterfaceBuilder.CocoaPlugin + {{407, 494}, {360, 240}} + + + {213, 107} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + FileKindListView + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + ToolTip + + ToolTip + + Aggiungi nuovo tipo di documento + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + ToolTip + + ToolTip + + Rimuovi estensione nome documento + + + com.apple.InterfaceBuilder.CocoaPlugin + + {{630, 408}, {132, 83}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + ToolTip + + ToolTip + + Aggiungi nuova estensione nome documento + + + com.apple.InterfaceBuilder.CocoaPlugin + + + ToolTip + + ToolTip + + Rimuovi tipo di documento + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Usa come estensione nome documento per le nuove note + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + ToolTip + + ToolTip + + Inscrivez-vous sur notational.net + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + NSSecureTextField + com.apple.InterfaceBuilder.CocoaPlugin + + {{221, 311}, {464, 346}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{428, 551}, {413, 93}} + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 266 + + + + YES + + FileKindListView + NSTableView + + storageFormatPopupButton + NSPopUpButton + + + IBProjectSource + NotationPrefsViewController.h + + + + NSObject + + IBProjectSource + BookmarksController.h + + + + NSObject + + IBProjectSource + FastListDataSource.h + + + + NSObject + + IBProjectSource + GlobalPrefs.h + + + + NSObject + + IBProjectSource + NotationController.h + + + + NSObject + + IBProjectSource + NotationFileManager.h + + + + NSObject + + IBProjectSource + NoteObject.h + + + + NSObject + + IBProjectSource + PassphrasePicker.h + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + RBSplitView/RBSplitView.h + + + + NSObject + + IBProjectSource + SyncResponseFetcher.h + + + + NSObject + + IBProjectSource + SyncServiceSessionProtocol.h + + + + NSTableHeaderView + + IBProjectSource + HeaderViewWIthMenu.h + + + + NSTableView + + IBProjectSource + NotesTableView.h + + + + NotationPrefsViewController + NSObject + + YES + + YES + addedExtension: + addedType: + changePassphrase: + changedFileDeletionWarningSettings: + changedFileStorageFormat: + changedKeyLength: + changedKeychainSettings: + changedSecureTextEntry: + makeDefaultExtension: + removeFromKeychain: + removedExtension: + removedType: + syncFrequencyChange: + toggledEncryption: + toggledSyncing: + visitSimplenoteSite: + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + allowedExtensionsTable + allowedTypesTable + changePasswordButton + confirmFileDeletionButton + enableEncryptionButton + enabledSyncButton + fileAttributesHelpText + keyLengthField + keyLengthStepper + makeDefaultExtensionButton + newExtensionButton + newTypeButton + passwordSettingsMatrix + removeExtensionButton + removeFromKeychainButton + removeTypeButton + secureTextEntryButton + storageFormatPopupButton + syncAccountField + syncEncAlertField + syncEncAlertView + syncPasswordField + syncingFrequency + verifyStatusField + verifyStatusImageView + view + webOptionsWindow + + + YES + NSTableView + NSTableView + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSStepper + NSButton + NSButton + NSButton + NSMatrix + NSButton + NSButton + NSButton + NSButton + NSPopUpButton + NSTextField + NSTextField + NSImageView + NSTextField + NSPopUpButton + NSTextField + NSImageView + NSView + NSWindow + + + + + + RBSplitSubview + NSView + + IBProjectSource + RBSplitView/RBSplitSubview.h + + + + RBSplitSubview + + IBProjectSource + RBSplitView/RBSplitViewPrivateDefines.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + + + RBSplitView + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSBox + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSBox.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMatrix + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSMatrix.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + PrintCore.framework/Headers/PDEPluginInterface.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFAuthorizationView.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFCertificatePanel.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFChooseIdentityPanel.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSPanel + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSPanel.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSecureTextField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSecureTextField.h + + + + NSStepper + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSStepper.h + + + + NSStepperCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSStepperCell.h + + + + NSTabView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTabView.h + + + + NSTabViewItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTabViewItem.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableHeaderView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTableHeaderView.h + + + + NSTableView + NSControl + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../Notation.xcodeproj + 3 + + diff --git a/Italian.lproj/NotationPrefsView.nib/keyedobjects.nib b/Italian.lproj/NotationPrefsView.nib/keyedobjects.nib new file mode 100644 index 00000000..595c0b57 Binary files /dev/null and b/Italian.lproj/NotationPrefsView.nib/keyedobjects.nib differ diff --git a/Italian.lproj/PTKeyComboPanel.nib/designable.nib b/Italian.lproj/PTKeyComboPanel.nib/designable.nib new file mode 100644 index 00000000..b1e443f7 --- /dev/null +++ b/Italian.lproj/PTKeyComboPanel.nib/designable.nib @@ -0,0 +1,1371 @@ + + + + 1050 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PTKeyComboPanel + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{290, 345}, {394, 165}} + 1886912512 + + NSWindow + + View + + {1.79769e+308, 1.79769e+308} + {213, 107} + + + 256 + + YES + + + 256 + {{171, 62}, {100, 22}} + + YES + + -2072904127 + 138413056 + (Aucune) + + LucidaGrande + 13 + 1044 + + nessuno + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + 3 + MAA + + + + + + + 256 + {{112, 12}, {94, 32}} + + YES + + 67239424 + 137887744 + Nessuna + + + -2038284033 + 1 + + Helvetica + 13 + 16 + + + + + + 200 + 25 + + + + + 256 + {{206, 12}, {90, 32}} + + YES + + 67239424 + 137887744 + Annulla + + + -2038284033 + 1 + + + + 200 + 25 + + + + + 256 + {{69, 90}, {308, 55}} + + YES + + 67239424 + 4194304 + Digita una combinazione di tasti per portare Notational Velocity in primo piano. + + LucidaGrande-Bold + 13 + 2072 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + + + + 256 + {{17, 64}, {149, 17}} + + YES + + 67239424 + 71303168 + Combinazione di tasti: + + + + + + + + + 256 + {{296, 12}, {84, 32}} + + YES + + 67239424 + 134217728 + OK + + + -2038284033 + 1 + + + + 200 + 25 + + + + + 256 + {{44, 60}, {22, 20}} + + YES + + 67239424 + 0 + + + + 1211945471 + 2 + + NSImage + NSRadioButton + + + NSRadioButton + + + + + + 200 + 25 + + + + + 256 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{20, 113}, {32, 32}} + + YES + + 130560 + 33554432 + + NSImage + PTKeyboardIcon + + 0 + 2 + 0 + NO + + YES + + + {394, 165} + + + {{0, 0}, {1280, 778}} + {213, 129} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + ok: + + + + 31 + + + + clear: + + + + 34 + + + + window + + + + 41 + + + + mKeyBcaster + + + + 45 + + + + mComboField + + + + 46 + + + + mTitleField + + + + 47 + + + + cancel: + + + + 51 + + + + initialFirstResponder + + + + 52 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 19 + + + YES + + + + Panel + + + 20 + + + YES + + + + + + + + + + + + + 22 + + + YES + + + + + + 23 + + + YES + + + + + + 24 + + + YES + + + + + + 26 + + + YES + + + + + + 27 + + + YES + + + + + + 28 + + + YES + + + + + + 33 + + + YES + + + + + + 48 + + + YES + + + + + + 54 + + + + + 55 + + + + + 56 + + + + + 57 + + + + + 58 + + + + + 59 + + + + + 60 + + + + + 61 + + + + + + + YES + + YES + -3.IBPluginDependency + -3.ImportedFromIB2 + 19.IBEditorWindowLastContentRect + 19.IBPluginDependency + 19.IBWindowTemplateEditedContentRect + 19.ImportedFromIB2 + 19.windowTemplate.hasMinSize + 19.windowTemplate.minSize + 20.IBPluginDependency + 20.ImportedFromIB2 + 22.IBPluginDependency + 22.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 24.IBPluginDependency + 24.ImportedFromIB2 + 26.IBPluginDependency + 26.ImportedFromIB2 + 27.IBPluginDependency + 27.ImportedFromIB2 + 28.IBPluginDependency + 28.ImportedFromIB2 + 33.CustomClassName + 33.IBAttributePlaceholdersKey + 33.IBPluginDependency + 33.ImportedFromIB2 + 48.IBPluginDependency + 48.ImportedFromIB2 + 54.IBPluginDependency + 55.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency + 58.IBPluginDependency + 59.IBPluginDependency + 60.IBPluginDependency + 61.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + {{291, 580}, {394, 165}} + com.apple.InterfaceBuilder.CocoaPlugin + {{291, 580}, {394, 165}} + + + {213, 107} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + PTKeyBroadcaster + + ToolTip + + ToolTip + + CkJhc2VkIG9uIENvY29hSG90S2V5TGliCmh0dHA6Ly93d3cucm9ndWVhbW9lYmEuY29tLwo + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 61 + + + + YES + + NSObject + + IBProjectSource + BookmarksController.h + + + + NSObject + + IBProjectSource + FastListDataSource.h + + + + NSObject + + IBProjectSource + GlobalPrefs.h + + + + NSObject + + IBProjectSource + NotationController.h + + + + NSObject + + IBProjectSource + NotationFileManager.h + + + + NSObject + + IBProjectSource + NoteObject.h + + + + NSObject + + IBProjectSource + PassphrasePicker.h + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + RBSplitView/RBSplitView.h + + + + NSObject + + IBProjectSource + SyncResponseFetcher.h + + + + NSObject + + IBProjectSource + SyncServiceSessionProtocol.h + + + + PTKeyBroadcaster + NSButton + + IBProjectSource + PTHotKeys/PTKeyBroadcaster.h + + + + PTKeyComboPanel + NSWindowController + + YES + + YES + cancel: + clear: + ok: + + + YES + id + id + id + + + + YES + + YES + currentModalDelegate + mComboField + mKeyBcaster + mTitleField + + + YES + id + NSTextField + PTKeyBroadcaster + NSTextField + + + + IBProjectSource + PTHotKeys/PTKeyComboPanel.h + + + + RBSplitSubview + NSView + + IBProjectSource + RBSplitView/RBSplitSubview.h + + + + RBSplitSubview + + IBProjectSource + RBSplitView/RBSplitViewPrivateDefines.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + + + RBSplitView + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + PrintCore.framework/Headers/PDEPluginInterface.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFAuthorizationView.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFCertificatePanel.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFChooseIdentityPanel.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../Notation.xcodeproj + 3 + + diff --git a/Italian.lproj/PTKeyComboPanel.nib/keyedobjects.nib b/Italian.lproj/PTKeyComboPanel.nib/keyedobjects.nib new file mode 100644 index 00000000..8776799a Binary files /dev/null and b/Italian.lproj/PTKeyComboPanel.nib/keyedobjects.nib differ diff --git a/Italian.lproj/PassphraseChanger.nib/designable.nib b/Italian.lproj/PassphraseChanger.nib/designable.nib new file mode 100644 index 00000000..11a0ae02 --- /dev/null +++ b/Italian.lproj/PassphraseChanger.nib/designable.nib @@ -0,0 +1,1182 @@ + + + + 1060 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PassphraseChangerController + + + FirstResponder + + + NSApplication + + + SFPasswordAssistantInspectorController + + + 3 + 2 + {{449, 381}, {506, 215}} + 1886912512 + Seleziona una nuova parola d'ordine + + NSPanel + + + View + + {1.79769e+308, 1.79769e+308} + {213, 107} + + + 256 + + YES + + + 264 + + YES + + + 266 + {{17, 257}, {472, 23}} + + YES + + 67239424 + 272629760 + Scegli una nuova parola d'ordine per proteggere le tue note. + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 256 + {{17, 197}, {149, 19}} + + YES + + 67239424 + 71303168 + Nuova parola d'ordine: + + + + + + + + + 256 + {{110, 164}, {56, 22}} + + YES + + 67239424 + 71303168 + Verifica: + + + + + + + + + 256 + {{463, 197}, {23, 22}} + + YES + + 67239424 + 134217728 + + + LucidaGrande + 10 + 16 + + + -2042347265 + 2 + + NSImage + PasswordAssistantButton + + + NSImage + PasswordAssistantButtonPressed + + + + 400 + 75 + + + + + 256 + {{171, 197}, {288, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + + + + 256 + {{171, 167}, {315, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + + + + + + 256 + {{18, 143}, {345, 18}} + + YES + + 67239424 + 0 + Memorizza la nuova parola d'ordine nel Portachiavi + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + + 256 + {{88, 224}, {78, 22}} + + YES + + 67239424 + 71303168 + Attuale: + + + + + + + + + 256 + {{171, 227}, {315, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + + + + + + 264 + {{20, 105}, {13, 13}} + + YES + + 67239424 + 0 + + + + -1198636801 + 5 + + + + + + 200 + 25 + + + + + 264 + {{38, 102}, {146, 17}} + + YES + + 67239424 + 272629760 + Altre opzioni di sicurezza + + LucidaGrande + 11 + 3100 + + + + + + + + + -2147483392 + {{46, 20}, {413, 74}} + + NSView + NSResponder + + + {{0, -85}, {506, 300}} + + NSView + + + + 289 + + YES + + + 256 + {{96, 12}, {82, 32}} + + YES + + 604110336 + 134217728 + OK + + + -2038284033 + 1 + + + DQ + 200 + 25 + + + + + 256 + {{8, 12}, {88, 32}} + + YES + + 67239424 + 134217728 + Annulla + + + -2038284033 + 1 + + + Gw + 200 + 25 + + + + {{314, 0}, {192, 60}} + + NSView + + + {506, 215} + + + {{0, 0}, {1920, 1178}} + {213, 129} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + showPasswordAssistantPanel: + + + + 361 + + + + okNewPassword: + + + + 362 + + + + cancelNewPassword: + + + + 363 + + + + rememberChangeButton + + + + 364 + + + + cancelChangedButton + + + + 365 + + + + okChangeButton + + + + 366 + + + + verifyChangedPasswordField + + + + 367 + + + + newPasswordField + + + + 368 + + + + changePassphraseWindow + + + + 369 + + + + _newPassword + + + + 370 + + + + _verifyPassword + + + + 371 + + + + _baseWindow + + + + 372 + + + + currentPasswordField + + + + 375 + + + + _originalPassword + + + + 376 + + + + initialFirstResponder + + + + 377 + + + + nextKeyView + + + + 378 + + + + nextKeyView + + + + 379 + + + + nextKeyView + + + + 380 + + + + disclosureButton + + + + 386 + + + + dismissalButtonsView + + + + 387 + + + + upperButtonsView + + + + 388 + + + + advancedHelpField + + + + 389 + + + + advancedView + + + + 390 + + + + discloseAdvancedSettings: + + + + 391 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 342 + + + SFPasswordAssistantInspectorController + + + 343 + + + YES + + + + Select a passphrase + + + 344 + + + YES + + + + + + + 384 + + + YES + + + + + + + 354 + + + YES + + + + + + 355 + + + YES + + + + + + 385 + + + YES + + + + + + + + + + + + + + + + + 346 + + + YES + + + + + + 351 + + + YES + + + + + + 353 + + + YES + + + + + + 356 + + + YES + + + + + + 357 + + + YES + + + + + + 358 + + + YES + + + + + + 360 + + + YES + + + + + + 373 + + + YES + + + + + + 374 + + + YES + + + + + + 381 + + + YES + + + + + + 382 + + + YES + + + + + + 383 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + + + 397 + + + + + 398 + + + + + 399 + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 404 + + + + + 405 + + + + + -3 + + + Application + + + + + YES + + YES + -3.IBPluginDependency + 342.ImportedFromIB2 + 343.IBEditorWindowLastContentRect + 343.IBPluginDependency + 343.IBPropertyAccessControl + 343.IBWindowTemplateEditedContentRect + 343.ImportedFromIB2 + 343.windowTemplate.hasMinSize + 343.windowTemplate.minSize + 344.IBPluginDependency + 344.ImportedFromIB2 + 346.IBPluginDependency + 346.IBPropertyAccessControl + 346.ImportedFromIB2 + 351.IBPluginDependency + 351.IBPropertyAccessControl + 351.ImportedFromIB2 + 353.IBPluginDependency + 353.IBPropertyAccessControl + 353.ImportedFromIB2 + 354.IBPluginDependency + 354.IBPropertyAccessControl + 354.ImportedFromIB2 + 355.IBPluginDependency + 355.IBPropertyAccessControl + 355.ImportedFromIB2 + 356.IBPluginDependency + 356.ImportedFromIB2 + 357.CustomClassName + 357.IBPluginDependency + 357.ImportedFromIB2 + 358.CustomClassName + 358.IBPluginDependency + 358.ImportedFromIB2 + 360.IBPluginDependency + 360.IBPropertyAccessControl + 360.ImportedFromIB2 + 373.IBPluginDependency + 373.IBPropertyAccessControl + 373.ImportedFromIB2 + 374.CustomClassName + 374.IBPluginDependency + 374.ImportedFromIB2 + 381.IBPluginDependency + 381.ImportedFromIB2 + 382.IBPluginDependency + 382.IBPropertyAccessControl + 382.ImportedFromIB2 + 383.IBPluginDependency + 383.ImportedFromIB2 + 384.IBPluginDependency + 384.IBPropertyAccessControl + 384.ImportedFromIB2 + 385.IBPluginDependency + 385.ImportedFromIB2 + 393.IBPluginDependency + 394.IBPluginDependency + 395.IBPluginDependency + 396.IBPluginDependency + 397.IBPluginDependency + 398.IBPluginDependency + 399.IBPluginDependency + 400.IBPluginDependency + 401.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 404.IBPluginDependency + 405.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + {{262, 525}, {506, 215}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{262, 525}, {506, 215}} + + + {213, 107} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + NSSecureTextField + com.apple.InterfaceBuilder.CocoaPlugin + + NSSecureTextField + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + NSSecureTextField + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 405 + + + + YES + + FirstResponder + NSObject + + : + id + + + IBUserSource + + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + ./Classes/NSObject.h + + + + PassphraseChangerController + NSObject + + YES + + YES + cancelNewPassword: + discloseAdvancedSettings: + okNewPassword: + + + YES + id + id + id + + + + YES + + YES + advancedHelpField + advancedView + cancelChangedButton + changePassphraseWindow + currentPasswordField + disclosureButton + dismissalButtonsView + newPasswordField + okChangeButton + rememberChangeButton + upperButtonsView + verifyChangedPasswordField + + + YES + NSTextField + NSView + NSButton + NSPanel + NSSecureTextField + NSButton + NSView + NSSecureTextField + NSButton + NSButton + NSView + NSSecureTextField + + + + IBProjectSource + ./Classes/PassphraseChangerController.h + + + + RBSplitSubview + NSView + + IBProjectSource + ./Classes/RBSplitSubview.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + IBProjectSource + ./Classes/RBSplitView.h + + + + SFPasswordAssistantInspectorController + NSObject + + showPasswordAssistantPanel: + id + + + YES + + YES + _baseWindow + _newPassword + _originalPassword + _verifyPassword + + + YES + NSWindow + NSTextField + NSTextField + NSTextField + + + + IBProjectSource + ./Classes/SFPasswordAssistantInspectorController.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Italian.lproj/PassphraseChanger.nib/keyedobjects.nib b/Italian.lproj/PassphraseChanger.nib/keyedobjects.nib new file mode 100644 index 00000000..a2d290df Binary files /dev/null and b/Italian.lproj/PassphraseChanger.nib/keyedobjects.nib differ diff --git a/Italian.lproj/PassphrasePicker.nib/designable.nib b/Italian.lproj/PassphrasePicker.nib/designable.nib new file mode 100644 index 00000000..005a189c --- /dev/null +++ b/Italian.lproj/PassphrasePicker.nib/designable.nib @@ -0,0 +1,1110 @@ + + + + 1050 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PassphrasePickerController + + + FirstResponder + + + NSApplication + + + SFPasswordAssistantInspectorController + + + 3 + 2 + {{378, 572}, {474, 243}} + 1886912512 + Scegli una parola d'ordine + NSPanel + + View + + {1.79769e+308, 1.79769e+308} + {214.545, 107} + + + 256 + + YES + + + 264 + + YES + + + 289 + + YES + + + 256 + {{100, 12}, {82, 32}} + + YES + + 604110336 + 134217728 + OK + + LucidaGrande + 13 + 1044 + + + -2038284033 + 1 + + + DQ + 200 + 25 + + + + + 256 + {{12, 12}, {88, 32}} + + YES + + 67239424 + 134217728 + Annulla + + + -2038284033 + 1 + + + Gw + 200 + 25 + + + + {{278, 115}, {196, 60}} + + NSView + + + + 266 + {{17, 288}, {440, 60}} + + YES + + 67239424 + 272629760 + Per favore, scegli una parola d'ordine per proteggere le tue note. Attenzione però a non dimenticarla, perché potrebbe diventare impossibile recuperare le note. + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 264 + {{17, 263}, {339, 17}} + + YES + + 67239424 + 272629760 + La parola d'ordine può contenere qualsiasi carattere. + + + + + + + + + 264 + {{20, 286}, {434, 5}} + + {0, 0} + + 67239424 + 0 + Box + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 2 + 0 + NO + + + + 264 + {{18, 224}, {103, 22}} + + YES + + 67239424 + 71303168 + Parola d'ordine: + + + + + + + + + 264 + {{30, 182}, {91, 34}} + + YES + + 67239424 + 71303168 + Verifica: + + + + + + + + + 264 + {{431, 227}, {23, 22}} + + YES + + 67239424 + 134217728 + + + LucidaGrande + 10 + 16 + + + -2042347265 + 2 + + NSImage + PasswordAssistantButton + + + NSImage + PasswordAssistantButtonPressed + + + + 400 + 75 + + + + + 264 + {{126, 227}, {301, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + + 6 + System + textColor + + + + + + + 264 + {{126, 197}, {328, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + + + + + + 264 + {{124, 173}, {314, 18}} + + YES + + 67239424 + 0 + Memorizza la parola d'ordine nel Portachiavi + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + + 264 + {{20, 135}, {13, 13}} + + YES + + 67239424 + 0 + + + + -1198636801 + 5 + + + + + + 200 + 25 + + + + + 264 + {{38, 132}, {162, 17}} + + YES + + 67239424 + 272629760 + Altre opzioni di sicurezza + + LucidaGrande + 11 + 3100 + + + + + + + + + -2147483392 + {{41, 50}, {413, 74}} + + NSView + + + {{0, -115}, {474, 358}} + + NSView + + + {474, 243} + + + {{0, 0}, {1280, 778}} + {214.545, 129} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + showPasswordAssistantPanel: + + + + 361 + + + + okNewPassword: + + + + 362 + + + + cancelNewPassword: + + + + 363 + + + + rememberNewButton + + + + 364 + + + + cancelNewButton + + + + 365 + + + + okNewButton + + + + 366 + + + + verifyNewPasswordField + + + + 367 + + + + newPasswordField + + + + 368 + + + + newPassphraseWindow + + + + 369 + + + + _newPassword + + + + 370 + + + + _verifyPassword + + + + 371 + + + + _baseWindow + + + + 372 + + + + discloseAdvancedSettings: + + + + 386 + + + + disclosureButton + + + + 387 + + + + dismissalButtonsView + + + + 388 + + + + upperButtonsView + + + + 390 + + + + window + + + + 391 + + + + nextKeyView + + + + 392 + + + + nextKeyView + + + + 393 + + + + initialFirstResponder + + + + 394 + + + + advancedView + + + + 395 + + + + advancedHelpField + + + + 396 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 342 + + + SFPasswordAssistantInspectorController + + + 343 + + + YES + + + + Select a passphrase + + + 344 + + + YES + + + + + + 389 + + + YES + + + + + + + + + + + + + + + + + + 346 + + + YES + + + + + + 347 + + + YES + + + + + + 348 + + + YES + + + 256 + {{2, 2}, {125, 1}} + + + + + + 349 + + + + + 351 + + + YES + + + + + + 353 + + + YES + + + + + + 356 + + + YES + + + + + + 357 + + + YES + + + + + + 358 + + + YES + + + + + + 360 + + + YES + + + + + + 374 + + + YES + + + + + + 375 + + + YES + + + + + + 385 + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 404 + + + + + 405 + + + + + 406 + + + + + 407 + + + + + 408 + + + + + 409 + + + + + 376 + + + YES + + + + + + + 355 + + + YES + + + + + + 354 + + + YES + + + + + + 398 + + + + + 399 + + + + + + + YES + + YES + -3.IBPluginDependency + -3.ImportedFromIB2 + 342.ImportedFromIB2 + 343.IBEditorWindowLastContentRect + 343.IBPluginDependency + 343.IBWindowTemplateEditedContentRect + 343.ImportedFromIB2 + 343.windowTemplate.hasMinSize + 343.windowTemplate.minSize + 344.IBPluginDependency + 344.ImportedFromIB2 + 346.IBPluginDependency + 346.ImportedFromIB2 + 347.IBPluginDependency + 347.ImportedFromIB2 + 348.IBPluginDependency + 348.ImportedFromIB2 + 349.IBPluginDependency + 349.ImportedFromIB2 + 351.IBPluginDependency + 351.ImportedFromIB2 + 353.IBPluginDependency + 353.ImportedFromIB2 + 354.IBPluginDependency + 354.ImportedFromIB2 + 355.IBPluginDependency + 355.ImportedFromIB2 + 356.IBPluginDependency + 356.ImportedFromIB2 + 357.CustomClassName + 357.IBPluginDependency + 357.ImportedFromIB2 + 358.CustomClassName + 358.IBPluginDependency + 358.ImportedFromIB2 + 360.IBPluginDependency + 360.ImportedFromIB2 + 374.IBPluginDependency + 374.ImportedFromIB2 + 375.IBPluginDependency + 375.ImportedFromIB2 + 376.IBPluginDependency + 376.ImportedFromIB2 + 385.IBPluginDependency + 385.ImportedFromIB2 + 389.IBPluginDependency + 389.ImportedFromIB2 + 398.IBPluginDependency + 399.IBPluginDependency + 400.IBPluginDependency + 401.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 404.IBPluginDependency + 405.IBPluginDependency + 406.IBPluginDependency + 407.IBPluginDependency + 408.IBPluginDependency + 409.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + {{119, 763}, {474, 243}} + com.apple.InterfaceBuilder.CocoaPlugin + {{119, 763}, {474, 243}} + + + {214.545, 107} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + NSSecureTextField + com.apple.InterfaceBuilder.CocoaPlugin + + NSSecureTextField + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 409 + + + + YES + + FirstResponder + NSObject + + : + id + + + IBUserSource + + + + + PassphrasePickerController + NSObject + + YES + + YES + cancelNewPassword: + discloseAdvancedSettings: + okNewPassword: + + + YES + id + id + id + + + + YES + + YES + advancedHelpField + advancedView + cancelNewButton + disclosureButton + dismissalButtonsView + newPassphraseWindow + newPasswordField + okNewButton + rememberNewButton + upperButtonsView + verifyNewPasswordField + window + + + YES + NSTextField + NSView + NSButton + NSButton + NSView + NSPanel + NSSecureTextField + NSButton + NSButton + NSView + NSSecureTextField + NSPanel + + + + IBProjectSource + ./Classes/PassphrasePickerController.h + + + + SFPasswordAssistantInspectorController + NSObject + + showPasswordAssistantPanel: + id + + + YES + + YES + _baseWindow + _newPassword + _originalPassword + _verifyPassword + + + YES + NSWindow + NSTextField + NSTextField + NSTextField + + + + IBProjectSource + ./Classes/SFPasswordAssistantInspectorController.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Italian.lproj/PassphrasePicker.nib/keyedobjects.nib b/Italian.lproj/PassphrasePicker.nib/keyedobjects.nib new file mode 100644 index 00000000..04dbc9ff Binary files /dev/null and b/Italian.lproj/PassphrasePicker.nib/keyedobjects.nib differ diff --git a/Italian.lproj/PassphraseRetriever.nib/designable.nib b/Italian.lproj/PassphraseRetriever.nib/designable.nib new file mode 100644 index 00000000..377fd3e9 --- /dev/null +++ b/Italian.lproj/PassphraseRetriever.nib/designable.nib @@ -0,0 +1,751 @@ + + + + 1040 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PassphraseRetriever + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{510, 376}, {507, 194}} + 1886912512 + Inserisci la parola d'ordine + NSPanel + + View + + {1.79769e+308, 1.79769e+308} + {378, 110} + + + 256 + + YES + + + 266 + {{92, 112}, {398, 62}} + + YES + + 69336577 + 272629760 + Please enter the passphrase to access notes in BLAH BLAH BLAH BLAH PATH BLAH BLAH + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 289 + {{411, 12}, {82, 32}} + + YES + + 604110336 + 134217728 + OK + + + -2038284033 + 1 + + + DQ + 200 + 25 + + + + + 289 + {{323, 12}, {88, 32}} + + YES + + 67239424 + 134217728 + Annulla + + + -2038284033 + 268435457 + + + q + 200 + 25 + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{20, 112}, {62, 62}} + + YES + + 130560 + 33554432 + + NSImage + NSApplicationIcon + + 0 + 1 + 0 + NO + + YES + + + + 256 + {{42, 82}, {114, 19}} + + YES + + 67239424 + 71303168 + Parola d'ordine: + + + + + + + + + 290 + {{161, 82}, {326, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + + + + 292 + {{159, 58}, {330, 18}} + + YES + + 67239424 + 0 + Memorizza la parola d'ordine nel Portachiavi + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + + -2147483356 + {{14, 12}, {145, 32}} + + YES + + 67239424 + 134217728 + Usa note diverse + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + {507, 194} + + + {{0, 0}, {1920, 1178}} + {378, 132} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + window + + + + 309 + + + + okAction: + + + + 321 + + + + cancelAction: + + + + 322 + + + + okButton + + + + 326 + + + + helpStringField + + + + 327 + + + + passphraseField + + + + 333 + + + + rememberKeychainButton + + + + 334 + + + + differentNotes: + + + + 337 + + + + differentFolderButton + + + + 338 + + + + cancelButton + + + + 339 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 307 + + + YES + + + + get passphrase + + + 308 + + + YES + + + + + + + + + + + + + 318 + + + YES + + + + + + 319 + + + YES + + + + + + 320 + + + YES + + + + + + 328 + + + YES + + + + + + 330 + + + YES + + + + + + 331 + + + YES + + + + + + 332 + + + YES + + + + + + 336 + + + YES + + + + + + 341 + + + + + 342 + + + + + 343 + + + + + 344 + + + + + 345 + + + + + 346 + + + + + 347 + + + + + 348 + + + + + + + YES + + YES + -3.IBPluginDependency + -3.ImportedFromIB2 + 307.IBEditorWindowLastContentRect + 307.IBPluginDependency + 307.IBWindowTemplateEditedContentRect + 307.ImportedFromIB2 + 307.windowTemplate.hasMinSize + 307.windowTemplate.minSize + 308.IBPluginDependency + 308.ImportedFromIB2 + 318.IBPluginDependency + 318.IBPropertyAccessControl + 318.ImportedFromIB2 + 319.IBPluginDependency + 319.IBPropertyAccessControl + 319.ImportedFromIB2 + 320.IBPluginDependency + 320.IBPropertyAccessControl + 320.ImportedFromIB2 + 328.IBPluginDependency + 328.ImportedFromIB2 + 330.IBPluginDependency + 330.IBPropertyAccessControl + 330.ImportedFromIB2 + 331.CustomClassName + 331.IBPluginDependency + 331.IBPropertyAccessControl + 331.ImportedFromIB2 + 332.IBPluginDependency + 332.IBPropertyAccessControl + 332.ImportedFromIB2 + 336.IBPluginDependency + 336.IBPropertyAccessControl + 336.ImportedFromIB2 + 341.IBPluginDependency + 342.IBPluginDependency + 343.IBPluginDependency + 344.IBPluginDependency + 345.IBPluginDependency + 346.IBPluginDependency + 347.IBPluginDependency + 348.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + {{203, 226}, {507, 194}} + com.apple.InterfaceBuilder.CocoaPlugin + {{203, 226}, {507, 194}} + + + {378, 110} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + NSSecureTextField + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 348 + + + + YES + + FirstResponder + NSObject + + : + id + + + IBUserSource + + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + ./Classes/NSObject.h + + + + PassphraseRetriever + NSObject + + YES + + YES + cancelAction: + differentNotes: + okAction: + + + YES + id + id + id + + + + YES + + YES + cancelButton + differentFolderButton + helpStringField + okButton + passphraseField + rememberKeychainButton + window + + + YES + NSButton + NSButton + NSTextField + NSButton + NSTextField + NSButton + NSPanel + + + + IBProjectSource + ./Classes/PassphraseRetriever.h + + + + RBSplitSubview + NSView + + IBProjectSource + ./Classes/RBSplitSubview.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + IBProjectSource + ./Classes/RBSplitView.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Italian.lproj/PassphraseRetriever.nib/keyedobjects.nib b/Italian.lproj/PassphraseRetriever.nib/keyedobjects.nib new file mode 100644 index 00000000..6d6d58a5 Binary files /dev/null and b/Italian.lproj/PassphraseRetriever.nib/keyedobjects.nib differ diff --git a/Italian.lproj/Preferences.nib/designable.nib b/Italian.lproj/Preferences.nib/designable.nib new file mode 100644 index 00000000..96393e19 --- /dev/null +++ b/Italian.lproj/Preferences.nib/designable.nib @@ -0,0 +1,3293 @@ + + + + 1050 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + PrefsWindowController + + + FirstResponder + + + NSApplication + + + 7 + 2 + {{322, 522}, {399, 334}} + 1886912512 + Preferenze + + NSWindow + + + View + + {1.79769e+308, 1.79769e+308} + {399, 107} + + + 256 + {399, 334} + + {{0, 0}, {1280, 778}} + {399, 129} + {1.79769e+308, 1.79769e+308} + + + + 256 + + YES + + + 264 + {{41, 177}, {177, 34}} + + YES + + 67239424 + 71303168 + Dimensione testo elenco: + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 264 + {{220, 188}, {102, 26}} + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + + + + + 400 + 75 + + + Piccolo + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + 1 + + + YES + + OtherViews + + YES + + + + Grande + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + YES + YES + + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Altro… + + 1048576 + 2147483647 + + + _popUpItemAction: + 3 + + + + + 3 + YES + YES + 1 + + + + + 264 + {{18, 43}, {269, 18}} + + YES + + -2080244224 + 0 + Conferma cancellazione nota + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + + 264 + {{18, 18}, {260, 18}} + + YES + + -2080244224 + 0 + Esci alla chiusura della finestra + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{18, 87}, {428, 18}} + + YES + + -2080244224 + 0 + Seleziona automaticamente le note durante la ricerca + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + -2147483384 + {{327, 191}, {61, 22}} + + YES + + -1804468671 + 272630784 + Taille + + Dimensioni + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + + + + 264 + {{17, 152}, {327, 17}} + + YES + + 67239424 + 71303168 + Combinazione tasti per Porta tutto in primo piano: + + + + + + + + + 264 + {{223, 122}, {96, 22}} + + YES + + -2072904127 + 272630784 + (aucun) + + (Nessuno) + + YES + + + + + + + 264 + {{321, 115}, {104, 32}} + + YES + + 67239424 + 134217728 + Imposta… + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + + 264 + {{36, 67}, {411, 14}} + + YES + + 67239424 + 272629760 + La selezione automatica di note molto lunghe può rallentare il programma. + + LucidaGrande + 11 + 3100 + + + + + + + + {464, 233} + NSView + NSResponder + + + + 256 + + YES + + + 256 + {{45, 368}, {170, 17}} + + + YES + + 67239424 + 71303168 + Leggi note dalla cartella: + + + + + + + + + 256 + {{217, 362}, {192, 26}} + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + + + + + 400 + 75 + + + Item1 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + YES + + + + Item2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 3 + YES + YES + 1 + + + + + 256 + {464, 346} + + + NSView + + NSResponder + + + {464, 406} + + NSView + + NSResponder + + + + 256 + + YES + + + 264 + {{137, 137}, {289, 38}} + + YES + 2 + 1 + + YES + + 67239424 + 0 + Rientro righe + + + 1211912703 + 2 + + NSImage + NSRadioButton + + + NSRadioButton + + + + 200 + 25 + + + -2080244224 + 0 + Porta il cursore al campo successivo + + + 1 + 1211912703 + 2 + + + + + 200 + 25 + + + {289, 18} + {4, 2} + 1143472128 + NSActionCell + + 67239424 + 0 + Radio + + 1211912703 + 0 + + + + 400 + 75 + + 1 + + + + + + + + 264 + {{50, 153}, {84, 22}} + + YES + + 67239424 + 71303168 + Tasto Tab: + + + + + + + + + 264 + {{155, 101}, {272, 28}} + + YES + + 67239424 + 272629760 + Opzione-Tab fa sempre rientrare il testo e Maiuscole-Tab sposta sempre indietro il cursore. + + + + + + + + + 264 + {{137, 193}, {309, 18}} + + YES + + -2080244224 + 0 + Controlla durante la digitazione + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{137, 218}, {309, 18}} + + YES + + 67239424 + 0 + Copia gli stili di base da altre applicazioni + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{32, 214}, {102, 22}} + + YES + + 67239424 + 71303168 + Testo con stili: + + + + + + + + + 264 + {{26, 190}, {108, 21}} + + YES + + 67239424 + 71303168 + Ortografia: + + + + + + + + + 264 + {{38, 39}, {96, 17}} + + YES + + 67239424 + 71303168 + Collegamenti: + + + + + + + + + 264 + {{137, 18}, {309, 18}} + + YES + + 67239424 + 0 + Suggerisci titolo delle note con soli link + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{137, 72}, {253, 18}} + + YES + + -2080244224 + 0 + Tabulatore sostituito da spazi + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{137, 38}, {309, 18}} + + YES + + 67239424 + 0 + Trasforma le URL in collegamenti cliccabili + + + 1211912703 + 2 + + + + + 200 + 25 + + + + {464, 256} + + + NSView + + NSResponder + + + + 256 + + YES + + + 264 + + YES + + YES + + NSColor pasteboard type + + + + {{295, 87}, {52, 24}} + + YES + YES + + 1 + MC4wNTgxMzA0OTg5OCAwLjA1NTU0MTg5OTA2IDEAA + + + + + 264 + {{29, 23}, {137, 17}} + + YES + + 67239424 + 71303168 + Font del corpo testo: + + + + + + + + + 264 + {{339, 13}, {104, 32}} + + YES + + 67239424 + 134217728 + Imposta… + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + + 266 + {{171, 20}, {166, 23}} + + YES + + 71433728 + 272630272 + Helvetica 12 + + + YES + + 3 + MQA + + 2 + + + + + + + + 268 + {{122, 90}, {167, 18}} + + YES + + -2080244224 + 0 + Evidenziazione ricerca: + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 264 + {{237, 123}, {53, 17}} + + YES + + 67239424 + 71303168 + Sfondo: + + + + + + + + + 264 + + YES + + YES + + NSColor pasteboard type + + + + {{295, 119}, {52, 24}} + + YES + YES + + + + + 264 + {{148, 155}, {142, 17}} + + YES + + 67239424 + 71303168 + Testo in primo piano: + + + + + + + + + 264 + + YES + + YES + + NSColor pasteboard type + + + + {{295, 151}, {52, 24}} + + YES + YES + + + + {464, 195} + NSView + NSResponder + + + + + YES + + + generalView + + + + 236 + + + + window + + + + 238 + + + + changedQuitBehavior: + + + + 239 + + + + changedNoteDeletion: + + + + 240 + + + + changedTitleCompletion: + + + + 241 + + + + changedTableText: + + + + 245 + + + + tableTextSizeField + + + + 246 + + + + tableTextMenuButton + + + + 249 + + + + notationPrefsView + + + + 258 + + + + databaseView + + + + 259 + + + + folderLocationsMenuButton + + + + 260 + + + + changedNotesFolderLocation: + + + + 263 + + + + completeNoteTitlesButton + + + + 265 + + + + confirmDeletionButton + + + + 266 + + + + quitWhenClosingButton + + + + 267 + + + + setAppShortcut: + + + + 290 + + + + appShortcutField + + + + 291 + + + + checkSpellingButton + + + + 293 + + + + tabKeyRadioMatrix + + + + 294 + + + + changedSpellChecking: + + + + 296 + + + + changedTabBehavior: + + + + 297 + + + + editingView + + + + 298 + + + + autoSuggestLinksButton + + + + 299 + + + + styledTextButton + + + + 300 + + + + changedStyledTextBehavior: + + + + 301 + + + + changedAutoSuggestLinks: + + + + 302 + + + + softTabsButton + + + + 309 + + + + changedSoftTabs: + + + + 310 + + + + makeURLsClickable + + + + 312 + + + + changedMakeURLsClickable: + + + + 313 + + + + changeBodyFont: + + + + 374 + + + + changedSearchHighlightColorWell: + + + + 378 + + + + backgroundColorWell + + + + 379 + + + + bodyTextFontField + + + + 380 + + + + fontsColorsView + + + + 381 + + + + foregroundColorWell + + + + 382 + + + + highlightSearchTermsButton + + + + 383 + + + + searchHighlightColorWell + + + + 384 + + + + changedHighlightSearchTerms: + + + + 385 + + + + changedBackgroundTextColorWell: + + + + 386 + + + + changedForegroundTextColorWell: + + + + 387 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 5 + + + YES + + + + Preferences Window + + + 6 + + + + + 155 + + + YES + + + + + + + + + + + + + general view + + + 157 + + + YES + + + + + + 158 + + + YES + + + + + + 172 + + + YES + + + + + + 174 + + + YES + + + + + + 175 + + + YES + + + + + + 178 + + + YES + + + + + + 287 + + + YES + + + + + + 288 + + + YES + + + + + + 289 + + + YES + + + + + + 323 + + + YES + + + + + + 250 + + + YES + + + + + + database view + + + 251 + + + YES + + + + + + 252 + + + YES + + + + + + 257 + + + + + 268 + + + YES + + + + + + + + + + + + + + editing view + + + 271 + + + YES + + + + + + + + 272 + + + + + 273 + + + + + 274 + + + YES + + + + + + 275 + + + YES + + + + + + 276 + + + YES + + + + + + 278 + + + YES + + + + + + 279 + + + YES + + + + + + 280 + + + YES + + + + + + 282 + + + YES + + + + + + 283 + + + YES + + + + + + 307 + + + YES + + + + + + 311 + + + YES + + + + + + 325 + + + + + 326 + + + YES + + + + + + 327 + + + + + 328 + + + + + 329 + + + + + 330 + + + + + 331 + + + + + 332 + + + + + 333 + + + + + 335 + + + + + 336 + + + + + 337 + + + YES + + + + + + 340 + + + + + 341 + + + + + 342 + + + + + 344 + + + + + 345 + + + + + 346 + + + + + 347 + + + + + 348 + + + + + 349 + + + + + 350 + + + + + 351 + + + + + 159 + + + YES + + + + + + + + + 163 + + + + + 162 + + + + + 161 + + + + + 160 + + + + + 253 + + + YES + + + + + + + + 256 + + + + + 255 + + + + + 254 + + + + + 352 + + + YES + + + + + + + + + + + + fonts colors view + + + 357 + + + YES + + + + + + 358 + + + + + 359 + + + + + 360 + + + YES + + + + + + 361 + + + YES + + + + + + 362 + + + + + 363 + + + + + 364 + + + + + 368 + + + YES + + + + + + 369 + + + YES + + + + + + 370 + + + YES + + + + + + 371 + + + + + 372 + + + + + 373 + + + + + 375 + + + + + + + YES + + YES + -3.IBPluginDependency + -3.ImportedFromIB2 + 155.IBEditorWindowLastContentRect + 155.IBPluginDependency + 155.ImportedFromIB2 + 157.IBPluginDependency + 157.ImportedFromIB2 + 158.IBPluginDependency + 158.ImportedFromIB2 + 159.IBEditorWindowLastContentRect + 159.IBPluginDependency + 159.ImportedFromIB2 + 160.IBPluginDependency + 160.ImportedFromIB2 + 161.IBPluginDependency + 161.ImportedFromIB2 + 162.IBPluginDependency + 162.ImportedFromIB2 + 163.IBPluginDependency + 163.ImportedFromIB2 + 172.IBPluginDependency + 172.IBViewBoundsToFrameTransform + 172.ImportedFromIB2 + 174.IBPluginDependency + 174.IBViewBoundsToFrameTransform + 174.ImportedFromIB2 + 175.IBPluginDependency + 175.IBViewBoundsToFrameTransform + 175.ImportedFromIB2 + 178.IBPluginDependency + 178.ImportedFromIB2 + 250.IBEditorWindowLastContentRect + 250.IBPluginDependency + 250.ImportedFromIB2 + 251.IBPluginDependency + 251.ImportedFromIB2 + 252.IBPluginDependency + 252.ImportedFromIB2 + 253.IBEditorWindowLastContentRect + 253.IBPluginDependency + 253.ImportedFromIB2 + 254.IBPluginDependency + 254.ImportedFromIB2 + 255.IBPluginDependency + 255.ImportedFromIB2 + 256.IBPluginDependency + 256.ImportedFromIB2 + 257.IBPluginDependency + 257.ImportedFromIB2 + 268.IBEditorWindowLastContentRect + 268.IBPluginDependency + 268.ImportedFromIB2 + 271.IBPluginDependency + 271.IBViewBoundsToFrameTransform + 271.ImportedFromIB2 + 272.IBPluginDependency + 272.ImportedFromIB2 + 273.IBPluginDependency + 273.ImportedFromIB2 + 274.IBPluginDependency + 274.IBViewBoundsToFrameTransform + 274.ImportedFromIB2 + 275.IBPluginDependency + 275.IBViewBoundsToFrameTransform + 275.ImportedFromIB2 + 276.IBPluginDependency + 276.IBViewBoundsToFrameTransform + 276.ImportedFromIB2 + 278.IBPluginDependency + 278.IBViewBoundsToFrameTransform + 278.ImportedFromIB2 + 279.IBPluginDependency + 279.IBViewBoundsToFrameTransform + 279.ImportedFromIB2 + 280.IBPluginDependency + 280.IBViewBoundsToFrameTransform + 280.ImportedFromIB2 + 282.IBPluginDependency + 282.IBViewBoundsToFrameTransform + 282.ImportedFromIB2 + 283.IBPluginDependency + 283.IBViewBoundsToFrameTransform + 283.ImportedFromIB2 + 287.IBPluginDependency + 287.IBViewBoundsToFrameTransform + 287.ImportedFromIB2 + 288.IBPluginDependency + 288.IBViewBoundsToFrameTransform + 288.ImportedFromIB2 + 289.IBPluginDependency + 289.IBViewBoundsToFrameTransform + 289.ImportedFromIB2 + 307.IBPluginDependency + 307.IBViewBoundsToFrameTransform + 307.ImportedFromIB2 + 311.IBPluginDependency + 311.IBViewBoundsToFrameTransform + 311.ImportedFromIB2 + 323.IBPluginDependency + 323.IBViewBoundsToFrameTransform + 323.ImportedFromIB2 + 325.IBPluginDependency + 326.IBPluginDependency + 327.IBPluginDependency + 328.IBPluginDependency + 329.IBPluginDependency + 330.IBPluginDependency + 331.IBPluginDependency + 332.IBPluginDependency + 333.IBPluginDependency + 335.IBPluginDependency + 336.IBPluginDependency + 337.IBPluginDependency + 340.IBPluginDependency + 341.IBPluginDependency + 342.IBPluginDependency + 344.IBPluginDependency + 345.IBPluginDependency + 346.IBPluginDependency + 347.IBPluginDependency + 348.IBPluginDependency + 349.IBPluginDependency + 350.IBPluginDependency + 351.IBPluginDependency + 352.IBEditorWindowLastContentRect + 352.IBPluginDependency + 352.IBViewBoundsToFrameTransform + 352.ImportedFromIB2 + 357.IBPluginDependency + 357.IBViewBoundsToFrameTransform + 358.IBPluginDependency + 358.IBPropertyAccessControl + 358.IBViewBoundsToFrameTransform + 358.ImportedFromIB2 + 359.IBPluginDependency + 359.IBPropertyAccessControl + 359.IBViewBoundsToFrameTransform + 359.ImportedFromIB2 + 360.IBPluginDependency + 360.IBPropertyAccessControl + 360.IBViewBoundsToFrameTransform + 360.ImportedFromIB2 + 361.IBPluginDependency + 361.IBPropertyAccessControl + 361.IBViewBoundsToFrameTransform + 361.ImportedFromIB2 + 362.IBPluginDependency + 363.IBPluginDependency + 364.IBPluginDependency + 368.IBPluginDependency + 368.IBViewBoundsToFrameTransform + 368.ImportedFromIB2 + 369.IBPluginDependency + 369.IBViewBoundsToFrameTransform + 369.ImportedFromIB2 + 370.IBPluginDependency + 370.IBViewBoundsToFrameTransform + 370.ImportedFromIB2 + 371.IBPluginDependency + 372.IBPluginDependency + 373.IBPluginDependency + 375.IBPluginDependency + 375.IBViewBoundsToFrameTransform + 375.ImportedFromIB2 + 5.IBEditorWindowLastContentRect + 5.IBPluginDependency + 5.IBWindowTemplateEditedContentRect + 5.ImportedFromIB2 + 5.windowTemplate.hasMinSize + 5.windowTemplate.minSize + 6.IBPluginDependency + 6.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + {{219, 508}, {464, 233}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{506, 632}, {115, 73}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABB8AAAwnAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABB8AAAwgwAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABB8AAAwtAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + {{221, 415}, {464, 406}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{576, 618}, {178, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{221, 570}, {464, 256}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDHQAAww8AAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCjAAAww8AAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDLwAAwsIAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDHQAAwzMAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDHQAAw0wAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAw0wAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCOAAAwzMAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCwAAAwggAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDHQAAwfgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCJAAAwzsAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDXwAAwz4AAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDoIAAw0EAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDHQAAwmgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDHQAAwggAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCQAAAwqAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{221, 546}, {464, 195}} + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCUAAAwtAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + + AUNcAABC6gAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + + AUNcAABDFQAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + + P4AAAL+AAABC9gAAwwgAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + + P4AAAL+AAABCtgAAwygAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABC5AAAwpAAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDlIAAwiwAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABByAAAwooAAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + AUNcAABCqgAAA + + + {{278, 522}, {399, 334}} + com.apple.InterfaceBuilder.CocoaPlugin + {{278, 522}, {399, 334}} + + + {399, 107} + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 387 + + + + YES + + FirstResponder + NSObject + + : + id + + + IBUserSource + + + + + NSObject + + IBProjectSource + BookmarksController.h + + + + NSObject + + IBProjectSource + FastListDataSource.h + + + + NSObject + + IBProjectSource + GlobalPrefs.h + + + + NSObject + + IBProjectSource + NotationController.h + + + + NSObject + + IBProjectSource + NotationFileManager.h + + + + NSObject + + IBProjectSource + NoteObject.h + + + + NSObject + + IBProjectSource + PassphrasePicker.h + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + RBSplitView/RBSplitView.h + + + + NSObject + + IBProjectSource + SyncResponseFetcher.h + + + + NSObject + + IBProjectSource + SyncServiceSessionProtocol.h + + + + NSTableView + + IBProjectSource + NotesTableView.h + + + + NotationPrefsViewController + NSObject + + YES + + YES + addedExtension: + addedType: + changePassphrase: + changedFileDeletionWarningSettings: + changedFileStorageFormat: + changedKeyLength: + changedKeychainSettings: + changedSecureTextEntry: + makeDefaultExtension: + removeFromKeychain: + removedExtension: + removedType: + syncFrequencyChange: + toggledEncryption: + toggledSyncing: + visitSimplenoteSite: + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + allowedExtensionsTable + allowedTypesTable + changePasswordButton + confirmFileDeletionButton + enableEncryptionButton + enabledSyncButton + fileAttributesHelpText + keyLengthField + keyLengthStepper + makeDefaultExtensionButton + newExtensionButton + newTypeButton + passwordSettingsMatrix + removeExtensionButton + removeFromKeychainButton + removeTypeButton + secureTextEntryButton + storageFormatPopupButton + syncAccountField + syncEncAlertField + syncEncAlertView + syncPasswordField + syncingFrequency + verifyStatusField + verifyStatusImageView + view + webOptionsWindow + + + YES + NSTableView + NSTableView + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSStepper + NSButton + NSButton + NSButton + NSMatrix + NSButton + NSButton + NSButton + NSButton + NSPopUpButton + NSTextField + NSTextField + NSImageView + NSTextField + NSPopUpButton + NSTextField + NSImageView + NSView + NSWindow + + + + IBProjectSource + NotationPrefsViewController.h + + + + PrefsWindowController + NSObject + + YES + + YES + changeBodyFont: + changedAutoSuggestLinks: + changedBackgroundTextColorWell: + changedForegroundTextColorWell: + changedHighlightSearchTerms: + changedMakeURLsClickable: + changedNoteDeletion: + changedNotesFolderLocation: + changedQuitBehavior: + changedSearchHighlightColorWell: + changedSoftTabs: + changedSpellChecking: + changedStyledTextBehavior: + changedTabBehavior: + changedTableText: + changedTitleCompletion: + setAppShortcut: + showWindow: + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + appShortcutField + autoSuggestLinksButton + backgroundColorWell + bodyTextFontField + checkSpellingButton + completeNoteTitlesButton + confirmDeletionButton + databaseView + editingView + folderLocationsMenuButton + fontsColorsView + foregroundColorWell + generalView + highlightSearchTermsButton + makeURLsClickable + notationPrefsView + notationPrefsViewController + quitWhenClosingButton + searchHighlightColorWell + softTabsButton + styledTextButton + tabKeyRadioMatrix + tableTextMenuButton + tableTextSizeField + window + + + YES + NSTextField + NSButton + NSColorWell + NSTextField + NSButton + NSButton + NSButton + NSView + NSView + NSPopUpButton + NSView + NSColorWell + NSView + NSButton + NSButton + NSView + NotationPrefsViewController + NSButton + NSColorWell + NSButton + NSButton + NSMatrix + NSPopUpButton + NSTextField + NSWindow + + + + IBProjectSource + PrefsWindowController.h + + + + RBSplitSubview + NSView + + IBProjectSource + RBSplitView/RBSplitSubview.h + + + + RBSplitSubview + + IBProjectSource + RBSplitView/RBSplitViewPrivateDefines.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + + + RBSplitView + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSColorWell + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSColorWell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMatrix + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSMatrix.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + PrintCore.framework/Headers/PDEPluginInterface.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFAuthorizationView.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFCertificatePanel.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFChooseIdentityPanel.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSStepper + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSStepper.h + + + + NSTableView + NSControl + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../Notation.xcodeproj + 3 + + diff --git a/Italian.lproj/Preferences.nib/keyedobjects.nib b/Italian.lproj/Preferences.nib/keyedobjects.nib new file mode 100644 index 00000000..95d836d8 Binary files /dev/null and b/Italian.lproj/Preferences.nib/keyedobjects.nib differ diff --git "a/Italian.lproj/Questo e\314\200 il titolo di una nota.nvhelp" "b/Italian.lproj/Questo e\314\200 il titolo di una nota.nvhelp" new file mode 100755 index 00000000..a373abb7 --- /dev/null +++ "b/Italian.lproj/Questo e\314\200 il titolo di una nota.nvhelp" @@ -0,0 +1,22 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww9000\viewh8400\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural + +\f0\fs24 \cf0 \CocoaLigature0 Benvenuto/a a Notational Velocity!\ +\ +Questo \'e8 il corpo della nota selezionata. La nota pu\'f2 avere qualsiasi lunghezza, e pu\'f2 contenere testo in +\b neretto +\b0 , +\i corsivo +\i0 , o \strike \strikec0 barrato\strike0\striked0 .\ +\ +\'c8 possibile creare collegamenti tra le note: [[Come funziona questa cosa?]].\ +\ +\'c8 possibile creare qualsiasi numero di note -- NV pu\'f2 gestire migliaia di note, e funziona meglio se il contenuto \'e8 distribuito tra note diverse.\ +\ +Se si attiva la cifratura (Preferenze > Note > Sicurezza) \'e8 possibile anche memorizzare parole d'ordine e altri dati sensibili senza dare preoccupazioni agli esperti di sicurezza.\ +\ + +\i Queste note sono state incluse per consentire di iniziare a lavorare con Notational Velocity. Possono essere cancellate senza nessun problema.} \ No newline at end of file diff --git a/Italian.lproj/SavedSearches.nib/designable.nib b/Italian.lproj/SavedSearches.nib/designable.nib new file mode 100644 index 00000000..06717ecb --- /dev/null +++ b/Italian.lproj/SavedSearches.nib/designable.nib @@ -0,0 +1,1340 @@ + + + + 1050 + 10J567 + 740 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 740 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + SavedSearchesController + + + FirstResponder + + + NSApplication + + + 27 + 2 + {{495, 324}, {317, 207}} + -260571136 + Segnalibri note + + NSPanel + + + View + + {1.79769e+308, 1.79769e+308} + {255, 64} + + + 256 + + YES + + + 274 + + YES + + + 2304 + + YES + + + 256 + {284, 157} + + YES + + + 256 + {{285, 0}, {12, 17}} + + + YES + + description + 226 + 40 + 1000 + + 75628096 + 2048 + Segnalibro + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 337772096 + 2048 + + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + 1 + YES + YES + + + + keyEquiv + 52.056640625 + 23.056640625 + 1000 + + 75628096 + 2048 + Chiave + + + 6 + System + headerColor + + 3 + MQA + + + + + + 337772096 + 67110912 + + + + + + + 1 + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + 306184192 + + + 5 + 15 + 0 + YES + 0 + + + {{1, 1}, {284, 157}} + + + + + 4 + + + + 256 + {{285, 1}, {11, 157}} + + 256 + + _doScroller: + 0.82631576061248779 + + + + -2147483392 + {{-100, -100}, {132, 11}} + + 257 + + _doScroller: + 0.99047619104385376 + + + {{10, 39}, {297, 159}} + + + 18 + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 292 + {{10, 9}, {23, 22}} + + + YES + + 67239424 + 134217728 + + + + 138690815 + 6 + + NSImage + Add + + + NSImage + Add_Pressed + + + + + + 200 + 25 + + + + + 292 + {{32, 9}, {23, 22}} + + YES + + 604110336 + 134217728 + + + + 139215103 + 6 + + NSImage + Remove + + + NSImage + Remove_Pressed + + + + + + 200 + 25 + + + + {317, 207} + + + {{0, 0}, {1280, 778}} + {255, 80} + {1.79769e+308, 1.79769e+308} + bookmarksWindow + + + + + YES + + + nextKeyView + + + + 369 + + + + addBookmarkButton + + + + 372 + + + + removeBookmarkButton + + + + 373 + + + + bookmarksTableView + + + + 374 + + + + window + + + + 375 + + + + addBookmark: + + + + 376 + + + + removeBookmark: + + + + 377 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 354 + + + YES + + + + Panel + + + 355 + + + YES + + + + + + + + 363 + + + YES + + + + + + + + 364 + + + YES + + + + + + + 366 + + + YES + + + + + + 378 + + + YES + + + + + + 367 + + + YES + + + + + + 368 + + + YES + + + + + + 383 + + + + + 384 + + + + + 385 + + + + + 386 + + + + + 387 + + + + + 388 + + + + + + + YES + + YES + -3.IBPluginDependency + -3.ImportedFromIB2 + 354.IBEditorWindowLastContentRect + 354.IBPluginDependency + 354.IBWindowTemplateEditedContentRect + 354.ImportedFromIB2 + 354.windowTemplate.hasMinSize + 354.windowTemplate.minSize + 355.IBPluginDependency + 355.ImportedFromIB2 + 363.IBPluginDependency + 363.ImportedFromIB2 + 364.CustomClassName + 364.IBPluginDependency + 364.ImportedFromIB2 + 366.IBPluginDependency + 366.ImportedFromIB2 + 367.IBAttributePlaceholdersKey + 367.IBPluginDependency + 367.ImportedFromIB2 + 368.IBAttributePlaceholdersKey + 368.IBPluginDependency + 368.ImportedFromIB2 + 378.IBPluginDependency + 378.ImportedFromIB2 + 383.IBPluginDependency + 384.IBPluginDependency + 385.IBPluginDependency + 385.IBShouldRemoveOnLegacySave + 386.IBPluginDependency + 386.IBShouldRemoveOnLegacySave + 387.IBPluginDependency + 387.IBShouldRemoveOnLegacySave + 388.IBPluginDependency + 388.IBShouldRemoveOnLegacySave + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + {{368, 521}, {317, 207}} + com.apple.InterfaceBuilder.CocoaPlugin + {{368, 521}, {317, 207}} + + + {255, 64} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + BookmarksTable + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + + YES + + + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + + YES + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 388 + + + + YES + + BookmarksTable + NSTableView + + IBProjectSource + BookmarksTable.h + + + + FirstResponder + NSObject + + : + id + + + IBUserSource + + + + + NSObject + + IBProjectSource + BookmarksController.h + + + + NSObject + + IBProjectSource + FastListDataSource.h + + + + NSObject + + IBProjectSource + GlobalPrefs.h + + + + NSObject + + IBProjectSource + NotationController.h + + + + NSObject + + IBProjectSource + NotationFileManager.h + + + + NSObject + + IBProjectSource + NoteObject.h + + + + NSObject + + IBProjectSource + PassphrasePicker.h + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + IBProjectSource + RBSplitView/RBSplitView.h + + + + NSObject + + IBProjectSource + SyncResponseFetcher.h + + + + NSObject + + IBProjectSource + SyncServiceSessionProtocol.h + + + + NSTableView + + IBProjectSource + NotesTableView.h + + + + RBSplitSubview + NSView + + IBProjectSource + RBSplitView/RBSplitSubview.h + + + + RBSplitSubview + + IBProjectSource + RBSplitView/RBSplitViewPrivateDefines.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + + + RBSplitView + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + PrintCore.framework/Headers/PDEPluginInterface.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFAuthorizationView.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFCertificatePanel.h + + + + NSObject + + IBFrameworkSource + SecurityInterface.framework/Headers/SFChooseIdentityPanel.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSPanel + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSPanel.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableView + NSControl + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + + 3 + + diff --git a/Italian.lproj/SavedSearches.nib/keyedobjects.nib b/Italian.lproj/SavedSearches.nib/keyedobjects.nib new file mode 100644 index 00000000..09d8f542 Binary files /dev/null and b/Italian.lproj/SavedSearches.nib/keyedobjects.nib differ diff --git a/Italian.lproj/Scorciatoie terribilmente utili.nvhelp b/Italian.lproj/Scorciatoie terribilmente utili.nvhelp new file mode 100755 index 00000000..363ede84 --- /dev/null +++ b/Italian.lproj/Scorciatoie terribilmente utili.nvhelp @@ -0,0 +1,104 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +\readonlydoc1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;} +{\info +{\author Paolo Tramannoni}}\margl1440\margr1440\vieww10200\viewh10800\viewkind0 +\deftab720 +\pard\pardeftab720\ql\qnatural + +\f0\fs24 \cf0 In ordine di utilit\'e0\'a0 decrescente:\ +\ + +\f1 \uc0\u8984 +\f0 L Porta il cursore nel campo di ricerca/inserimento titolo\ +Escape Cancella la ricerca corrente\ +Return Attiva la modifica di una nota, o se necessario la crea\ +Tab Porta il cursore in un\'92area di testo diversa\ + +\f1 \uc0\u8984 +\f0 K Seleziona la nota precedente nell\'92elenco\ + +\f1 \uc0\u8984 +\f0 J Seleziona la nota successiva nell\'92elenco\ + +\f1 \uc0\u8984 +\f0 D Deseleziona la nota corrente, ripristinando il testo della ricerca\ + +\f1 \uc0\u8984 +\f0 +\f1 \uc0\u8679 +\f0 V Incolla il contenuto degli appunti come nuova nota\ + +\f1 \uc0\u8984 +\f0 R Rinomina la nota selezionata\ +\pard\tx1440\pardeftab720\ql\qnatural + +\f1 \cf0 \uc0\u8984 +\f0 +\f1 \uc0\u9003 +\f0 Deseleziona la nota o le note selezionate\ +\pard\pardeftab720\ql\qnatural + +\f1 \cf0 \uc0\u8984 +\f0 +\f1 \uc0\u8679 T +\f0 Etichetta la nota selezionata\ + +\f1 \uc0\u8984 +\f0 G Trova la prossima ricorrenza del testo cercato\ + +\f1 \uc0\u8984 +\f0 +\f1 \uc0\u8679 +\f0 G Trova la precedente ricorrenza del testo cercato\ + +\f1 \uc0\u8984 +\f0 +\f1 \uc0\u8617 +\f0 Apre la URL su cui si trova il cursore di inserimento\ + +\f1 \uc0\u8984 +\f0 +\f1 \uc0\u8592 +\f0 Porta il cursore nel campo del titolo quando si trova all\'92inizio del corpo della nota\ + +\f1 \uc0\u8984 +\f0 +\f1 \uc0\u8594 +\f0 Porta il cursore nel corpo della nota quando si trova alla fine del titolo\ + +\f1 \uc0\u8984 +\f0 +\f1 \uc0\u8679 +\f0 D Aggiunge un segnalibro alla nota selezionata\ + +\f1 \uc0\u8984 +\f0 P Stampa la nota o le note selezionate\ + +\f1 \uc0\u8984 +\f0 E Esporta la nota o le note selezionate in altri formati\ +\ +Combinazioni di tasti per la formattazione del testo:\ +\ + +\f1 \uc0\u8984 +\f0 [ (parentesi quadra aperta) Riduce il rientro di una o pi\'f9 righe\ + +\f1 \uc0\u8984 +\f0 ] (parentesi quadra chiusa) Aumenta il rientro di una o pi\'f9 righe\ + +\f1 \uc0\u8997 +\f0 Tab Rientro\ + +\f1 \uc0\u8984 +\f0 T Rimuove gli stili dal testo (trasformandolo in testo piano)\ + +\f1 \uc0\u8984 +\f0 B Neretto\ + +\f1 \uc0\u8984 +\f0 I Corsivo\ + +\f1 \uc0\u8984 +\f0 Y Barrato\ +} \ No newline at end of file diff --git a/Italian.lproj/ServicesMenu.strings b/Italian.lproj/ServicesMenu.strings new file mode 100644 index 00000000..da8b49a4 --- /dev/null +++ b/Italian.lproj/ServicesMenu.strings @@ -0,0 +1 @@ +"NV: New Note With Selection" = "NV: Nuova nota con testo selezionato"; \ No newline at end of file diff --git a/Italian.lproj/URLGetter.nib/designable.nib b/Italian.lproj/URLGetter.nib/designable.nib new file mode 100644 index 00000000..2484e7c4 --- /dev/null +++ b/Italian.lproj/URLGetter.nib/designable.nib @@ -0,0 +1,596 @@ + + + + 1060 + 10J567 + 1294 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1294 + + + YES + NSTextField + NSView + NSWindowTemplate + NSProgressIndicator + NSTextFieldCell + NSButtonCell + NSButton + NSCustomObject + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + + + YES + + URLGetter + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{566, 537}, {460, 122}} + 1886912512 + Download in corso + + NSPanel + + + View + + {213, 107} + + + 256 + + YES + + + 1282 + + {{18, 18}, {346, 20}} + + 16396 + 1 + + + + 258 + {{17, 68}, {426, 34}} + + YES + + 67239424 + 272629760 + aHR0cDovL3d3dy5hcHBsZS5jb20vQmFjb24ucGRmCmFub3RoZXIgbGluZQ + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 258 + {{17, 46}, {326, 14}} + + YES + + 67239424 + 272629760 + Downloading: 90KB of 25MB + + LucidaGrande + 11 + 3100 + + + + + + + + + 256 + {{364, 12}, {82, 32}} + + YES + + 67239424 + 134217728 + Stop + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + {460, 122} + + {{0, 0}, {1920, 1178}} + {213, 129} + {1e+13, 1e+13} + + + + + YES + + + progress + + + + 335 + + + + progressStatus + + + + 336 + + + + objectURLStatus + + + + 337 + + + + cancelButton + + + + 338 + + + + window + + + + 339 + + + + cancelDownload: + + + + 340 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 328 + + + YES + + + + Panel + + + 329 + + + YES + + + + + + + + + 331 + + + + + 332 + + + YES + + + + + + 333 + + + YES + + + + + + 334 + + + YES + + + + + + 342 + + + + + 343 + + + + + 344 + + + + + -3 + + + Application + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 328.IBEditorWindowLastContentRect + 328.IBPluginDependency + 328.IBPropertyAccessControl + 328.IBWindowTemplateEditedContentRect + 328.ImportedFromIB2 + 329.IBPluginDependency + 329.ImportedFromIB2 + 331.IBPluginDependency + 331.IBPropertyAccessControl + 331.ImportedFromIB2 + 332.IBPluginDependency + 332.IBPropertyAccessControl + 332.ImportedFromIB2 + 333.IBPluginDependency + 333.IBPropertyAccessControl + 333.ImportedFromIB2 + 334.IBPluginDependency + 334.IBPropertyAccessControl + 334.ImportedFromIB2 + 342.IBPluginDependency + 343.IBPluginDependency + 344.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{268, 535}, {460, 122}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{268, 535}, {460, 122}} + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 344 + + + + YES + + FirstResponder + + : + id + + + : + + : + id + + + + IBUserSource + + + + + NSObject + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + RBSplitView + RBSplitView + + + + YES + + YES + didAdjustSubviews: + willAdjustSubviews: + + + YES + + didAdjustSubviews: + RBSplitView + + + willAdjustSubviews: + RBSplitView + + + + + IBProjectSource + ./Classes/NSObject.h + + + + RBSplitSubview + NSView + + IBProjectSource + ./Classes/RBSplitSubview.h + + + + RBSplitView + RBSplitSubview + + delegate + id + + + delegate + + delegate + id + + + + IBProjectSource + ./Classes/RBSplitView.h + + + + URLGetter + NSObject + + YES + + YES + cancelDownload: + startProgressIndication: + + + YES + id + id + + + + YES + + YES + cancelDownload: + startProgressIndication: + + + YES + + cancelDownload: + id + + + startProgressIndication: + id + + + + + YES + + YES + cancelButton + delegate + objectURLStatus + progress + progressStatus + userData + window + + + YES + NSButton + id + NSTextField + NSProgressIndicator + NSTextField + id + NSPanel + + + + YES + + YES + cancelButton + delegate + objectURLStatus + progress + progressStatus + userData + window + + + YES + + cancelButton + NSButton + + + delegate + id + + + objectURLStatus + NSTextField + + + progress + NSProgressIndicator + + + progressStatus + NSTextField + + + userData + id + + + window + NSPanel + + + + + IBProjectSource + ./Classes/URLGetter.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/Italian.lproj/URLGetter.nib/keyedobjects.nib b/Italian.lproj/URLGetter.nib/keyedobjects.nib new file mode 100644 index 00000000..5ce8cbe2 Binary files /dev/null and b/Italian.lproj/URLGetter.nib/keyedobjects.nib differ diff --git a/KeyDerivationDelaySlider.h b/KeyDerivationDelaySlider.h index 30f40aff..01e4d886 100755 --- a/KeyDerivationDelaySlider.h +++ b/KeyDerivationDelaySlider.h @@ -39,4 +39,4 @@ - (void)mouseUpForKeyDerivationDelaySlider:(KeyDerivationDelaySlider*)aSlider; -@end \ No newline at end of file +@end diff --git a/LabelColumnCell.h b/LabelColumnCell.h new file mode 100644 index 00000000..9d6178df --- /dev/null +++ b/LabelColumnCell.h @@ -0,0 +1,29 @@ +// +// LabelColumnCell.h +// Notation +// +// Created by Zachary Schneirov on 1/18/11. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + +#import + +@class NoteObject; + +@interface LabelColumnCell : NSTextFieldCell { + NoteObject *noteObject; +} + +- (NoteObject*)noteObject; +- (void)setNoteObject:(NoteObject*)obj; + +@end diff --git a/LabelColumnCell.m b/LabelColumnCell.m new file mode 100644 index 00000000..292a587b --- /dev/null +++ b/LabelColumnCell.m @@ -0,0 +1,74 @@ +// +// LabelColumnCell.m +// Notation +// +// Created by Zachary Schneirov on 1/18/11. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + +#import "LabelColumnCell.h" +#import "NotesTableView.h" +#import "NoteObject.h" +#import "GlobalPrefs.h" + +@implementation LabelColumnCell + +- (id)init { + if ([super init]) { + [self setEditable:YES]; + + [self setFocusRingType: NSFocusRingTypeExterior]; + } + return self; +} + +- (BOOL)isScrollable { + return YES; +} + + +- (NoteObject*)noteObject { + return noteObject; +} + +- (void)setNoteObject:(NoteObject*)obj { + [noteObject autorelease]; + noteObject = [obj retain]; +} + +- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { + NotesTableView *tv = (NotesTableView *)controlView; + + NSInteger col = [tv editedColumn]; + BOOL isEditing = [self isHighlighted] && [tv currentEditor] && + (col > -1 && [[[[tv tableColumns] objectAtIndex:col] identifier] isEqualToString:NoteLabelsColumnString]); + + if (isEditing) { + [super drawWithFrame:cellFrame inView:controlView]; + } + + if (!isEditing) { + NSImage *img = ([self isHighlighted] && [tv isActiveStyle]) ? [noteObject highlightedLabelsPreviewImage] : [noteObject labelsPreviewImage]; + if (img) { + [[NSGraphicsContext currentContext] saveGraphicsState]; + + + NSRectClip(cellFrame); + NSPoint imgSpot = NSMakePoint(NSMinX(cellFrame), NSMaxY(cellFrame) - ceilf(((cellFrame.size.height + 1.0) - [img size].height)/2.0)); + [img compositeToPoint:imgSpot operation:NSCompositeSourceOver]; + [[NSGraphicsContext currentContext] restoreGraphicsState]; + } + } + +} + +@end diff --git a/LabelObject.h b/LabelObject.h index d5254224..650fa744 100755 --- a/LabelObject.h +++ b/LabelObject.h @@ -28,7 +28,7 @@ unsigned int lowercaseHash; } -force_inline NSString* titleOfLabel(LabelObject *label); +NSString* titleOfLabel(LabelObject *label); int compareLabel(const void *one, const void *two); - (id)initWithTitle:(NSString*)name; diff --git a/LabelObject.m b/LabelObject.m index 4462472f..0764b649 100755 --- a/LabelObject.m +++ b/LabelObject.m @@ -91,6 +91,10 @@ - (NSSet*)noteSet { return notes; } +- (NSString*)description { + return [labelName stringByAppendingFormat:@" (used by %@)", notes]; +} + /*- (NSArray*)notesSharedWithSet:(NSSet*)filteredSet { NSMutableSet *intersectedSet = [NSMutableSet setWithSet:notes]; diff --git a/LabelsListController.h b/LabelsListController.h index 4b9df5c9..8d2d908c 100755 --- a/LabelsListController.h +++ b/LabelsListController.h @@ -31,6 +31,8 @@ - (void)filterLabelSet:(NSSet*)labelSet; - (void)recomputeListFromFilteredSet; +- (NSArray*)labelTitlesPrefixedByString:(NSString*)prefixString indexOfSelectedItem:(NSInteger *)anIndex minusWordSet:(NSSet*)antiSet; + - (NSSet*)notesAtFilteredIndex:(int)labelIndex; - (NSSet*)notesAtFilteredIndexes:(NSIndexSet*)anIndexSet; diff --git a/LabelsListController.m b/LabelsListController.m index 609f1242..b8daa984 100755 --- a/LabelsListController.m +++ b/LabelsListController.m @@ -61,6 +61,34 @@ - (void)recomputeListFromFilteredSet { mergesort((void *)objects, (size_t)count, sizeof(id), (int (*)(const void *, const void *))compareLabel); } +- (NSArray*)labelTitlesPrefixedByString:(NSString*)prefixString indexOfSelectedItem:(NSInteger *)anIndex minusWordSet:(NSSet*)antiSet { + + NSMutableArray *objs = [[[allLabels allObjects] mutableCopy] autorelease]; + NSMutableArray *titles = [NSMutableArray arrayWithCapacity:[allLabels count]]; + + [objs sortUnstableUsingFunction:(NSInteger (*)(id *, id *))compareLabel]; + + CFStringRef prefix = (CFStringRef)prefixString; + NSUInteger i, titleLen, j = 0, shortestTitleLen = UINT_MAX; + + for (i=0; i<[objs count]; i++) { + CFStringRef title = (CFStringRef)titleOfLabel((LabelObject*)[objs objectAtIndex:i]); + + if (CFStringFindWithOptions(title, prefix, CFRangeMake(0, CFStringGetLength(prefix)), kCFCompareAnchored | kCFCompareCaseInsensitive, NULL)) { + + if (![antiSet containsObject:(id)title]) { + [titles addObject:(id)title]; + if (anIndex && (titleLen = CFStringGetLength(title)) < shortestTitleLen) { + *anIndex = j; + shortestTitleLen = titleLen; + } + j++; + } + } + } + return titles; +} + //NotationController will probably want to filter these further if there is already a search in progress - (NSSet*)notesAtFilteredIndex:(int)labelIndex { diff --git a/LinearDividerShader.h b/LinearDividerShader.h old mode 100755 new mode 100644 index ae3cc3ec..ad1f8be2 --- a/LinearDividerShader.h +++ b/LinearDividerShader.h @@ -31,14 +31,17 @@ NSRect centeredRectInRect(NSRect rect, NSSize size); @interface LinearDividerShader : NSObject { CGColorSpaceRef colorSpaceRef; CGFunctionRef axialShadingFunction; - + NSColor *borderCol; + NSColor *backCol; ColorSet colors; NSImage *dimpleImage; } - (id)initWithStartColor:(NSColor*)start endColor:(NSColor*)end; - -- (void)drawDividerInRect:(NSRect)aRect withDimpleRect:(NSRect)dimpleRect; +- (id)initWithBaseColors:(id)sender; +- (void)updateColors:(NSColor *)startColor; +- (void)drawDividerInRect:(NSRect)aRect withDimpleRect:(NSRect)dimpleRect blendVertically:(BOOL)v; +- (void)setBackColor:(NSColor *)inColor; @end diff --git a/LinearDividerShader.m b/LinearDividerShader.m old mode 100755 new mode 100644 index 3c26f79e..2b74eaf1 --- a/LinearDividerShader.m +++ b/LinearDividerShader.m @@ -20,7 +20,7 @@ @implementation LinearDividerShader - (id)initWithStartColor:(NSColor*)start endColor:(NSColor*)end { if ((self = [super init])) { - + colorSpaceRef = CGColorSpaceCreateDeviceRGB(); [[start colorUsingColorSpaceName:NSDeviceRGBColorSpace] getRed: &colors.firstColor.redComp green:&colors.firstColor.greenComp @@ -34,35 +34,177 @@ - (id)initWithStartColor:(NSColor*)start endColor:(NSColor*)end { axialShadingFunction = CGFunctionCreate(&colors, 1, validIntervals, 4, validIntervals, &cgFunctionCallbacks); - dimpleImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"SplitViewDimple.tif"]]; + //dimpleImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"SplitViewDimple.tif"]]; } return self; } +- (id)initWithBaseColors:(id)sender { + if ((self = [super init])) { + NSColor *endColor = [NSColor colorWithCalibratedWhite:0.875 alpha:1.0f]; + NSColor *oneColor = [NSColor colorWithCalibratedWhite:0.988 alpha:1.0f]; + + colorSpaceRef = CGColorSpaceCreateDeviceRGB(); + + [[oneColor colorUsingColorSpaceName:NSDeviceRGBColorSpace] getRed: &colors.firstColor.redComp green:&colors.firstColor.greenComp + blue:&colors.firstColor.blueComp alpha:&colors.firstColor.alphaComp]; + + [[endColor colorUsingColorSpaceName:NSDeviceRGBColorSpace] getRed: &colors.secondColor.redComp green:&colors.secondColor.greenComp + blue:&colors.secondColor.blueComp alpha:&colors.secondColor.alphaComp]; + + static const CGFloat validIntervals[8] = { 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 }; + static const CGFunctionCallbacks cgFunctionCallbacks = { 0, &ColorBlendFunction, nil }; + + axialShadingFunction = CGFunctionCreate(&colors, 1, validIntervals, 4, validIntervals, &cgFunctionCallbacks); + + //dimpleImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"SplitViewDimple.tif"]]; + } + return self; +} + - (void)dealloc { CGFunctionRelease(axialShadingFunction); CGColorSpaceRelease(colorSpaceRef); [dimpleImage release]; - + [borderCol release]; + [backCol release]; [super dealloc]; } -- (void)drawDividerInRect:(NSRect)aRect withDimpleRect:(NSRect)dimpleRect { - - CGShadingRef cgShading = CGShadingCreateAxial(colorSpaceRef, CGPointMake(aRect.origin.x, aRect.origin.y), - CGPointMake(NSMinX(aRect), NSMaxY(aRect)), axialShadingFunction, NO, NO); +- (void)updateColors:(NSColor *)startColor{ + + + [backCol release]; + [borderCol release]; + backCol = [startColor retain]; + borderCol = [startColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace]; + CGFloat fWhite; + fWhite = [borderCol whiteComponent]; + + NSColor *endColor; + //CGFloat fWhite; + //fWhite = [[startColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace] whiteComponent]; + dimpleImage = nil; + [dimpleImage release]; + if (fWhite < 0.75f) { + if (fWhite<0.15f) { + fWhite += 0.2f; + endColor = [NSColor colorWithCalibratedWhite:0.05f alpha:1.0f]; + startColor = [NSColor colorWithCalibratedWhite:0.18f alpha:1.0f]; + }else if (fWhite < 0.33) { + fWhite += 0.2f; + endColor = [NSColor colorWithCalibratedWhite:(fWhite - 0.12f) alpha:1.0f]; + startColor = [NSColor colorWithCalibratedWhite:(fWhite + 0.07f) alpha:1.0f]; + }else if (fWhite < 0.52) { + fWhite += 0.16f; + endColor = [NSColor colorWithCalibratedWhite:(fWhite - 0.15f) alpha:1.0f]; + startColor = [NSColor colorWithCalibratedWhite:(fWhite + 0.05f) alpha:1.0f]; + }else { + fWhite += 0.16f; + endColor = [NSColor colorWithCalibratedWhite:(fWhite - 0.2f) alpha:1.0f]; + startColor = [NSColor colorWithCalibratedWhite:(fWhite + 0.02f) alpha:1.0f]; + } + }else { + startColor = [NSColor colorWithCalibratedWhite:0.988 alpha:1.0f]; + endColor = [NSColor colorWithCalibratedWhite:0.875 alpha:1.0f]; + fWhite -= 0.25f; + //dimpleImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"SplitViewDimple.tif"]]; + } + + borderCol = [[NSColor colorWithCalibratedWhite:fWhite alpha:1.0f] retain]; + colorSpaceRef = CGColorSpaceCreateDeviceRGB(); + + [[startColor colorUsingColorSpaceName:NSDeviceRGBColorSpace] getRed: &colors.firstColor.redComp green:&colors.firstColor.greenComp + blue:&colors.firstColor.blueComp alpha:&colors.firstColor.alphaComp]; - CGContextDrawShading((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], cgShading); + [[endColor colorUsingColorSpaceName:NSDeviceRGBColorSpace] getRed: &colors.secondColor.redComp green:&colors.secondColor.greenComp + blue:&colors.secondColor.blueComp alpha:&colors.secondColor.alphaComp]; - CGShadingRelease(cgShading); + static const CGFloat validIntervals[8] = { 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 }; + static const CGFunctionCallbacks cgFunctionCallbacks = { 0, &ColorBlendFunction, nil }; + + axialShadingFunction = CGFunctionCreate(&colors, 1, validIntervals, 4, validIntervals, &cgFunctionCallbacks); + +// dimpleImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"SplitViewDimple.tif"]]; +} + +- (void)drawDividerInRect:(NSRect)aRect withDimpleRect:(NSRect)dimpleRect blendVertically:(BOOL)v { + if (!borderCol) { + borderCol =[[NSColor grayColor] retain]; + } - if (!NSIsEmptyRect(dimpleRect)) { - [dimpleImage drawCenteredInRect:dimpleRect]; + if ((aRect.origin.x==0)&&(aRect.origin.y==0)) { + if (!backCol) { + backCol = [[NSColor lightGrayColor] retain]; + } + [backCol set]; + NSRectFill(aRect); + + if (aRect.size.width < aRect.size.height) { + aRect.origin.y -=2; + aRect.size.height += 4; + aRect.origin.x -=1; + aRect.size.width += 1; + }else { + aRect.origin.y -=1; + aRect.size.height += 1; + aRect.origin.x -=2; + aRect.size.width += 4; + } + + + [borderCol set]; + NSFrameRectWithWidth(aRect,0.9f); + + }else { + CGShadingRef cgShading = CGShadingCreateAxial(colorSpaceRef, CGPointMake(aRect.origin.x, aRect.origin.y), + CGPointMake(v ? NSMinX(aRect) : NSMaxX(aRect), v ? NSMaxY(aRect) : NSMinY(aRect)), + axialShadingFunction, NO, NO); + CGContextDrawShading((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], cgShading); + + CGShadingRelease(cgShading); + if (aRect.size.width < aRect.size.height) { + aRect.origin.y -=2; + aRect.size.height += 4; + }else { + aRect.origin.x -=2; + aRect.size.width += 4; + } + + + [borderCol set]; + NSFrameRectWithWidth(aRect,0.8f); + /* + if (!NSIsEmptyRect(dimpleRect)&&(dimpleImage)) { + [dimpleImage drawCenteredInRect:dimpleRect]; + }*/ } + + } +- (void)setBackColor:(NSColor *)inColor{ + [backCol release]; + [borderCol release]; + backCol = [inColor retain]; + borderCol = [inColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace]; + CGFloat fWhite; + fWhite = [borderCol whiteComponent]; + if (fWhite < 0.75f) { + if (fWhite<0.25f) { + fWhite += 0.2f; + }else { + fWhite += 0.16f; + } + }else { + fWhite -= 0.25f; + } + borderCol = [[NSColor colorWithCalibratedWhite:fWhite alpha:1.0f] retain]; +} + + @end NSRect centeredRectInRect(NSRect rect, NSSize size) { diff --git a/LinkingEditor.h b/LinkingEditor.h index cb98047d..73a25341 100755 --- a/LinkingEditor.h +++ b/LinkingEditor.h @@ -13,70 +13,75 @@ #import +#import @class NotesTableView; @class NoteObject; @class GlobalPrefs; - -#define DELAYED_LAYOUT 0 +//@class ETTransparentScroller; @interface LinkingEditor : NSTextView -{ +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +#endif +{ IBOutlet NSTextField *controlField; IBOutlet NotesTableView *notesTableView; - + + //ETTransparentScroller *nvTextScroller; GlobalPrefs *prefsController; -#if DELAYED_LAYOUT - NSTimer *timer; - BOOL inhibitingUpdates; - BOOL didSetFutureRange, didInvalidateLayout, didRenderFully; - NSRange futureRange; - NSString *futureWordsToHighlight; - unsigned int lastHighlightedIndex; - NSRect rectForSuppressedUpdate; -#else BOOL didRenderFully; -#endif BOOL didChangeIntoAutomaticRange; NSRange lastAutomaticallySelectedRange; NSRange changedRange; + BOOL isAutocompleting, wasDeleting; + + BOOL backgroundIsDark, mouseInside; //ludicrous ivars used to hack NSTextFinder. just write your own, damnit! NSRange selectedRangeDuringFind; NSString *lastImportedFindString; NSString *stringDuringFind; NoteObject *noteDuringFind; + + IMP defaultIBeamCursorIMP, whiteIBeamCursorIMP; } - +//- (IBAction)performNVFindPanelAction:(id)sender; +- (NSColor*)_insertionPointColorForForegroundColor:(NSColor*)fgColor backgroundColor:(NSColor*)bgColor; +- (NSColor*)_linkColorForForegroundColor:(NSColor*)fgColor backgroundColor:(NSColor*)bgColor; +- (NSColor*)_selectionColorForForegroundColor:(NSColor*)fgColor backgroundColor:(NSColor*)bgColor; - (NSDictionary*)preferredLinkAttributes; +- (void)updateTextColors; - (NSRange)selectedRangeWasAutomatic:(BOOL*)automatic; - (void)setAutomaticallySelectedRange:(NSRange)newRange; - (void)removeHighlightedTerms; - (void)highlightRangesTemporarily:(CFArrayRef)ranges; -- (NSRange)highlightTermsTemporarilyReturningFirstRange:(NSString*)typedString; +- (NSRange)highlightTermsTemporarilyReturningFirstRange:(NSString*)typedString avoidHighlight:(BOOL)noHighlight; - (void)defaultStyle:(id)sender; -- (void)underlineNV:(id)sender; +- (void)strikethroughNV:(id)sender; - (void)bold:(id)sender; - (void)italic:(id)sender; - (void)applyStyleOfTrait:(NSFontTraitMask)trait alternateAttributeName:(NSString*)attrName alternateAttributeValue:(id)value; -//- (void)suggestComplete:(id)sender; - (id)highlightLinkAtIndex:(unsigned)givenIndex; - (BOOL)jumpToRenaming; - (void)indicateRange:(NSValue*)rangeValue; - (void)fixTypingAttributesForSubstitutedFonts; +- (void)fixCursorForBackgroundUpdatingMouseInside:(BOOL)setMouseInside; + +- (BOOL)_selectionAbutsBulletIndentRange; +- (BOOL)_rangeIsAutoIdentedBullet:(NSRange)aRange; + +- (void)setupFontMenu; -#if DELAYED_LAYOUT -- (void)_updateHighlightedRangesToIndex:(unsigned)loc; -- (void)_setFutureSelectionRangeWithinIndex:(unsigned)loc; -- (void)setFutureSelectionRange:(NSRange)aRange highlightingWords:(NSString*)words; -- (BOOL)readyToDraw; -- (void)beginInhibitingUpdates; -#else - (BOOL)didRenderFully; -#endif + +//elasticwork +- (void)switchFindPanelDelegate; +- (IBAction)findInFullscreen; +// @end @interface NSTextView (Private) @@ -88,6 +93,4 @@ - (void)moveToLeftEndOfLine:(id)sender; #endif -- (void)_checkSpellingForRange:(struct _NSRange)fp8 excludingRange:(struct _NSRange)fp16; - @end diff --git a/LinkingEditor.m b/LinkingEditor.m index e8299d92..5fe38549 100755 --- a/LinkingEditor.m +++ b/LinkingEditor.m @@ -9,17 +9,16 @@ - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. */ - +//#import "ETTransparentScroller.h" #import "LinkingEditor.h" #import "GlobalPrefs.h" #import "AppController.h" +#import "AppController_Importing.h" #import "NotesTableView.h" -#import "FocusRingScrollView.h" #import "NSTextFinder.h" #import "LinkingEditor_Indentation.h" #import "NSCollection_utils.h" #import "AttributedPlainText.h" -#import "BodyScroller.h" #import "NSString_NV.h" #import "NVPasswordGenerator.h" @@ -34,8 +33,28 @@ static long (*GetGetScriptManagerVariablePointer())(short); #endif + +@interface NSCursor (WhiteIBeamCursor) ++ (NSCursor*)whiteIBeamCursor; +@end + +@implementation NSCursor (WhiteIBeamCursor) + ++ (NSCursor*)whiteIBeamCursor { + static NSCursor *invertedIBeamCursor = nil; + if (!invertedIBeamCursor) { + invertedIBeamCursor = [[NSCursor alloc] initWithImage:[NSImage imageNamed:@"IBeamInverted"] hotSpot:NSMakePoint(4,5)]; + } + return invertedIBeamCursor; +} + +@end + + @implementation LinkingEditor +CGFloat _perceptualDarkness(NSColor*a); + - (void)awakeFromNib { prefsController = [GlobalPrefs defaultPrefs]; @@ -50,107 +69,32 @@ - (void)awakeFromNib { @selector(setUseTextReplacement:sender:), @selector(setNoteBodyFont:sender:), @selector(setMakeURLsClickable:sender:), - @selector(setSearchTermHighlightColor:sender:), - @selector(setNotesListBackgroundColor:sender:), nil]; + @selector(setSearchTermHighlightColor:sender:), + @selector(setShouldHighlightSearchTerms:sender:), nil]; + // @selector(setBackgroundTextColor:sender:), + // @selector(setForegroundTextColor:sender:), - [self setTextContainerInset:NSMakeSize(20, 40)]; + [self setTextContainerInset:NSMakeSize(3, 8)]; [self setSmartInsertDeleteEnabled:NO]; [self setUsesRuler:NO]; [self setUsesFontPanel:NO]; - -#if DELAYED_LAYOUT - rectForSuppressedUpdate = NSZeroRect; - inhibitingUpdates = didSetFutureRange = didRenderFully = didInvalidateLayout = NO; - //should go in outletawoke method - [(BodyScroller*)[[self enclosingScrollView] verticalScroller] setContentViewDelegate:self]; -#else - didRenderFully = NO; -#endif - [[self layoutManager] setDelegate:self]; - - [self setLinkTextAttributes:[self preferredLinkAttributes]]; - - NSMenu *theMenu = [[[NSMenu alloc] initWithTitle:@"NVFontMenu"] autorelease]; - - NSMenuItem *theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Cut",@"cut menu item title") action:@selector(cut:) keyEquivalent:@""] autorelease]; - [theMenuItem setTarget:self]; - [theMenu addItem:theMenuItem]; - - theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Copy",@"copy menu item title") action:@selector(copy:) keyEquivalent:@""] autorelease]; - [theMenuItem setTarget:self]; - [theMenu addItem:theMenuItem]; - - theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Paste",@"paste menu item title") action:@selector(paste:) keyEquivalent:@""] autorelease]; - [theMenuItem setTarget:self]; - [theMenu addItem:theMenuItem]; - - [theMenu addItem:[NSMenuItem separatorItem]]; - - NSMenu *formatMenu = [[[NSMenu alloc] initWithTitle:NSLocalizedString(@"Format", nil)] autorelease]; - - theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Plain Text Style",nil) - action:@selector(defaultStyle:) keyEquivalent:@""] autorelease]; - [theMenuItem setTarget:self]; - [formatMenu addItem:theMenuItem]; - - theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Bold",nil) action:@selector(bold:) keyEquivalent:@""] autorelease]; - [theMenuItem setTarget:self]; - [formatMenu addItem:theMenuItem]; - - theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Italic",nil) action:@selector(italic:) keyEquivalent:@""] autorelease]; - [theMenuItem setTarget:self]; - [formatMenu addItem:theMenuItem]; - - theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Underline",nil) action:@selector(underlineNV:) keyEquivalent:@""] autorelease]; - [theMenuItem setTarget:self]; - [formatMenu addItem:theMenuItem]; - - theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Format",@"format submenu title") action:NULL keyEquivalent:@""] autorelease]; - [theMenu addItem:theMenuItem]; - [theMenu setSubmenu:formatMenu forItem:theMenuItem]; - - - [self setMenu:theMenu]; + [self setDrawsBackground:NO]; - // Insert Password menus - static BOOL additionalEditItems = YES; - - if (additionalEditItems) { - additionalEditItems = NO; - - NSMenu *editMenu = [[NSApp mainMenu] numberOfItems] > 2 ? [[[NSApp mainMenu] itemAtIndex:2] submenu] : nil; - - if (IsSnowLeopardOrLater) { - theMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Use Automatic Text Replacement", "use-text-replacement command in the edit menu") - action:@selector(toggleAutomaticTextReplacement:) keyEquivalent:@""]; - [theMenuItem setTarget:self]; - [editMenu addItem:theMenuItem]; - [theMenuItem release]; - } - - [editMenu addItem:[NSMenuItem separatorItem]]; - - #if PASSWORD_SUGGESTIONS - theMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"New Password...", "new password command in the edit menu") - action:@selector(showGeneratedPasswords:) keyEquivalent:@"\\"]; - [theMenuItem setKeyEquivalentModifierMask:NSCommandKeyMask]; - [theMenuItem setTarget:nil]; // First Responder being the current Link Editor - [editMenu addItem:theMenuItem]; - [theMenuItem release]; - #endif - - theMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Insert New Password", "insert new password command in the edit menu") - action:@selector(insertGeneratedPassword:) keyEquivalent:@"\\"]; - #if PASSWORD_SUGGESTIONS - [theMenuItem setAlternate:YES]; - #endif - [theMenuItem setKeyEquivalentModifierMask:NSCommandKeyMask|NSAlternateKeyMask]; - [theMenuItem setTarget:nil]; // First Responder being the current Link Editor - [editMenu addItem:theMenuItem]; - [theMenuItem release]; - } + [self updateTextColors]; + [[self window] setAcceptsMouseMovedEvents:YES]; + if (IsLeopardOrLater) { + defaultIBeamCursorIMP = method_getImplementation(class_getClassMethod([NSCursor class], @selector(IBeamCursor))); + whiteIBeamCursorIMP = method_getImplementation(class_getClassMethod([NSCursor class], @selector(whiteIBeamCursor))); + } + didRenderFully = NO; + [[self layoutManager] setDelegate:self]; + NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; + [center addObserver:self selector:@selector(windowBecameOrResignedMain:) name:NSWindowDidBecomeMainNotification object:[self window]]; + [center addObserver:self selector:@selector(windowBecameOrResignedMain:) name:NSWindowDidResignMainNotification object:[self window]]; + //[center addObserver:self selector:@selector(updateTextColors) name:NSSystemColorsDidChangeNotification object:nil]; // recreate gradient if needed +// NoMods = YES; outletObjectAwoke(self); } @@ -170,15 +114,33 @@ - (void)settingChangedForSelectorString:(NSString*)selectorString { [self setTypingAttributes:[prefsController noteBodyAttributes]]; //[textView setFont:[prefsController noteBodyFont]]; } else if ([selectorString isEqualToString:SEL_STR(setMakeURLsClickable:sender:)]) { + [self setLinkTextAttributes:[self preferredLinkAttributes]]; - } else if ([selectorString isEqualToString:SEL_STR(setSearchTermHighlightColor:sender:)]) { - NSString *typedString = [[NSApp delegate] typedString]; - if (typedString) [self highlightTermsTemporarilyReturningFirstRange:typedString]; + + //} else if ([selectorString isEqualToString:SEL_STR(setBackgroundTextColor:sender:)]) { + + //link-color is derived both from foreground and background colors + //[self updateTextColors]; + + //} else if ([selectorString isEqualToString:SEL_STR(setForegroundTextColor:sender:)]) { + + //[self updateTextColors]; + //[self setTypingAttributes:[prefsController noteBodyAttributes]]; + + } else if ([selectorString isEqualToString:SEL_STR(setSearchTermHighlightColor:sender:)] || + [selectorString isEqualToString:SEL_STR(setShouldHighlightSearchTerms:sender:)]) { + + if (![prefsController highlightSearchTerms]) { + [self removeHighlightedTerms]; + } else { + NSString *typedString = [[NSApp delegate] typedString]; + if (typedString) + [self highlightTermsTemporarilyReturningFirstRange:typedString avoidHighlight:NO]; + } } } - (BOOL)becomeFirstResponder { - [(FocusRingScrollView*)[self enclosingScrollView] setHasFocus:YES]; [notesTableView setShouldUseSecondaryHighlightColor:YES]; if ([[[self window] currentEvent] type] == NSKeyDown && [[[self window] currentEvent] firstCharacter] == '\t') { @@ -190,10 +152,10 @@ - (BOOL)becomeFirstResponder { } } -#if DELAYED_LAYOUT - [self _setFutureSelectionRangeWithinIndex:[[self string] length]]; -#endif - + [self setTypingAttributes:[prefsController noteBodyAttributes]]; + + [self performSelector:@selector(_fixCursorForBackgroundUpdatingMouseInside:) withObject:[NSNumber numberWithBool:YES] afterDelay:0.0]; + return [super becomeFirstResponder]; } @@ -204,9 +166,10 @@ - (void)indicateRange:(NSValue*)rangeValue { } - (BOOL)resignFirstResponder { - [(FocusRingScrollView*)[self enclosingScrollView] setHasFocus:NO]; [notesTableView setShouldUseSecondaryHighlightColor:NO]; + [self performSelector:@selector(_fixCursorForBackgroundUpdatingMouseInside:) withObject:[NSNumber numberWithBool:YES] afterDelay:0.0]; + return [super resignFirstResponder]; } @@ -215,181 +178,162 @@ - (void)changeColor:(id)sender { return; } -- (NSDictionary*)preferredLinkAttributes { - if (![prefsController URLsAreClickable]) - return [NSDictionary dictionary]; - - return [NSDictionary dictionaryWithObjectsAndKeys: - [NSCursor pointingHandCursor], NSCursorAttributeName, - [NSNumber numberWithInt:NSUnderlineStyleSingle], NSUnderlineStyleAttributeName, - [NSColor blueColor], NSForegroundColorAttributeName, nil]; +- (void)setBackgroundColor:(NSColor*)aColor { +// backgroundIsDark = (_perceptualDarkness([aColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace]) > 0.5); +// [super setBackgroundColor:aColor]; } -/* -- (BOOL)acceptsFirstResponder { - - return ([[controlField stringValue] length] > 0); -}*/ - -- (void)toggleAutomaticTextReplacement:(id)sender { - - [super toggleAutomaticTextReplacement:sender]; - - [prefsController setUseTextReplacement:[self isAutomaticTextReplacementEnabled] sender:self]; +- (void)updateTextColors { + NSColor *fgColor = [[NSApp delegate] foregrndColor]; + NSColor *bgColor = [[NSApp delegate] backgrndColor]; + //[self setBackgroundColor:bgColor]; + //[nvTextScroller setBackgroundColor:bgColor]; + //[[self enclosingScrollView] setNeedsDisplay:YES]; + [self setInsertionPointColor:[self _insertionPointColorForForegroundColor:fgColor backgroundColor:bgColor]]; + [self setLinkTextAttributes:[self preferredLinkAttributes]]; + [self setSelectedTextAttributes:[NSDictionary dictionaryWithObject:[self _selectionColorForForegroundColor:fgColor backgroundColor:bgColor] + forKey:NSBackgroundColorAttributeName]]; + [self setTypingAttributes:[prefsController noteBodyAttributes]]; } -- (void)toggleContinuousSpellChecking:(id)sender { - - [super toggleContinuousSpellChecking:sender]; +#define _CM(__ch) ((__ch) * 255.0) +CGFloat _perceptualDarkness(NSColor*a) { + //0 to 1; the higher the darker - [prefsController setCheckSpellingAsYouType:[self isContinuousSpellCheckingEnabled] sender:self]; -} + CGFloat aRed, aGreen, aBlue; + [a getRed:&aRed green:&aGreen blue:&aBlue alpha:NULL]; -- (BOOL)isContinuousSpellCheckingEnabled { - //optimization so that we don't spell-check while scrolling through notes that don't have focus - NSView *responder = (NSView*)[[self window] firstResponder]; - - return (responder == self && [super isContinuousSpellCheckingEnabled]); + return 1 - (0.299 * _CM(aRed) + 0.587 * _CM(aGreen) + 0.114 * _CM(aBlue))/255; +} +CGFloat _perceptualColorDifference(NSColor*a, NSColor*b) { + //acceptable: 500 + CGFloat aRed, aGreen, aBlue, bRed, bGreen, bBlue; + [a getRed:&aRed green:&aGreen blue:&aBlue alpha:NULL]; + [b getRed:&bRed green:&bGreen blue:&bBlue alpha:NULL]; + + return (MAX(_CM(aRed), _CM(bRed)) - MIN(_CM(aRed), _CM(bRed))) + (MAX(_CM(aGreen), _CM(bGreen)) - MIN(_CM(aGreen), _CM(bGreen))) + + (MAX(_CM(aBlue), _CM(bBlue)) - MIN(_CM(aBlue), _CM(bBlue))); } -#if DELAYED_LAYOUT +- (NSColor*)_linkColorForForegroundColor:(NSColor*)fgColor backgroundColor:(NSColor*)bgColor { + //if fgColor is black, choose blue; otherwise, rotate hue (keeping the same sat.) until color is different enough + + fgColor = [fgColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; + bgColor = [bgColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; + + CGFloat hue, brightness, saturation, alpha, diffInc = 0.5; + NSUInteger rotationsLeft = 25; + [fgColor getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha]; -- (void)progressTowardFutureRange:(id)sender { - unsigned int farthestLoc = [[self layoutManager] firstUnlaidCharacterIndex]; + //if foreground color is too dark for hue changes to matter, then just use blue + if (brightness <= 0.24) + return [NSColor blueColor]; - //highlight all words from lastHighlightedIndex to farthestLoc, setting futureRange to range of first occurring found word - [self _updateHighlightedRangesToIndex:farthestLoc]; + brightness = _perceptualDarkness(bgColor) > 0.5 ? MAX(0.75, brightness) : MIN(0.35, brightness); - if (futureRange.location <= farthestLoc) { + saturation = MAX(0.5, saturation); + + //adjust hue until the perceptual differences between the proposed link + //and current foreground and background colors are great enough + NSColor *proposedLinkColor = nil; + do { + hue -= diffInc; + if (hue < 0.0) + hue += 1.0; - [self _setFutureSelectionRangeWithinIndex:farthestLoc]; - } + proposedLinkColor = [NSColor colorWithCalibratedHue:hue saturation:saturation brightness:brightness alpha:alpha]; + + diffInc = rotationsLeft > 15 ? 0.125 : 0.0625; + + } while ((_perceptualColorDifference(proposedLinkColor, bgColor) < 360.0 || + _perceptualColorDifference(proposedLinkColor, fgColor) < 170.0) && --rotationsLeft > 0); + return proposedLinkColor; } -- (void)beginInhibitingUpdates { - inhibitingUpdates = YES; - - rectForSuppressedUpdate = NSZeroRect; - if (!didRenderFully) { - rectForSuppressedUpdate = NSUnionRect(rectForSuppressedUpdate, [self visibleRect]); - NSLog(@"probably dirty, so updating everything"); - } -} +- (NSColor*)_selectionColorForForegroundColor:(NSColor*)fgColor backgroundColor:(NSColor*)bgColor { + fgColor = [fgColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; + bgColor = [bgColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; -- (void)setFutureSelectionRange:(NSRange)aRange highlightingWords:(NSString*)words { - futureRange = aRange; - didSetFutureRange = didInvalidateLayout = NO; - lastHighlightedIndex = 0; + NSColor *proposedBlend = [fgColor blendedColorWithFraction:0.5 ofColor:bgColor]; + NSColor *defaultColor = [[NSColor selectedTextBackgroundColor] colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; - [futureWordsToHighlight release]; - futureWordsToHighlight = [words retain]; + float fgDiff = _perceptualColorDifference(proposedBlend, fgColor); + float fgSelDiff = _perceptualColorDifference(defaultColor, fgColor); - //rectForSuppressedUpdate = NSZeroRect; - [(BodyScroller*)[[self enclosingScrollView] verticalScroller] clearSuppressedRects]; + //selection color should be between foreground and background in terms of brightness + //but the selection-color-difference from the foreground text needs to be great enough as well, + //and the proposed-color-difference from the foreground can't be too poor + //this heuristic chooses all the system-highlight colors in default fg/bg combinations and fg/bg blends in all others - //if we have focus, just force-scroll? - if ([[self window] firstResponder] == self) { - [self _setFutureSelectionRangeWithinIndex:[[self string] length]]; - } else if (!timer && [[self string] length] > 10*1024) { - timer = [NSTimer scheduledTimerWithTimeInterval:0.08 target:self selector:@selector(progressTowardFutureRange:) userInfo:nil repeats:YES]; - } - //need to draw loading status here somehow +// NSLog(@"fg diff of proposed: %g fg diff of sel: %g", fgDiff, fgSelDiff); + if ((_perceptualDarkness(fgColor) > _perceptualDarkness(defaultColor) && + _perceptualDarkness(defaultColor) > _perceptualDarkness(bgColor) && fgSelDiff > 300.0) || fgDiff < 170.0) + return defaultColor; + + //amplify the background balance after testing + return [fgColor blendedColorWithFraction:0.69 ofColor:bgColor]; } -- (void)_updateHighlightedRangesToIndex:(unsigned)loc { - //unsigned loc = [[self string] length]; + +- (NSColor*)_insertionPointColorForForegroundColor:(NSColor*)fgColor backgroundColor:(NSColor*)bgColor { + fgColor = [fgColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; + bgColor = [bgColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; + + CGFloat hue, brightness, saturation; + [fgColor getHue:&hue saturation:&saturation brightness:&brightness alpha:NULL]; - NSString *bodyString = [self string]; - NSRange scanRange = NSMakeRange(lastHighlightedIndex, loc - lastHighlightedIndex); - if (lastHighlightedIndex < loc && [futureWordsToHighlight length] && NSMaxRange(scanRange) <= [bodyString length]) { - //find the range with the lowest location - - //NSLog(@"highlighting from %d to %d", lastHighlightedIndex, loc); - CFArrayRef ranges = [bodyString copyRangesOfWordsInString:futureWordsToHighlight inRange:scanRange]; - if (ranges) { - - if (!futureRange.length) { - CFRange earliestRange = CFRangeMake(NSNotFound, 0); - CFIndex rangeIndex; - for (rangeIndex = 0; rangeIndex < CFArrayGetCount(ranges); rangeIndex++) { - CFRange *range = (CFRange *)CFArrayGetValueAtIndex(ranges, rangeIndex); - if (range && range->length > 0 && range->location + range->length <= loc) { - if (range->location < earliestRange.location) - earliestRange = *range; - } - } - - if (earliestRange.location != NSNotFound) { - futureRange.location = earliestRange.location; - futureRange.length = earliestRange.length; - //NSLog(@"set futureRange to found: %@", NSStringFromRange(futureRange)); - } - } - - [self highlightRangesTemporarily:ranges]; - CFRelease(ranges); - } - lastHighlightedIndex = loc; - } else { - //NSLog(@"not scanning range %@ (max=%d)", NSStringFromRange(scanRange), NSMaxRange(scanRange)); - } + //make the insertion point lighter than the foreground color if the background is dark and vise versa + NSColor *brighter = [fgColor blendedColorWithFraction:0.4 ofColor:[NSColor whiteColor]]; + NSColor *darker = [fgColor blendedColorWithFraction:0.4 ofColor:[NSColor blackColor]]; + + return _perceptualColorDifference(brighter, bgColor) > _perceptualColorDifference(darker, bgColor) ? brighter : darker; } -- (void)_setFutureSelectionRangeWithinIndex:(unsigned)loc { - [timer invalidate]; - timer = nil; - - //[[[self enclosingScrollView] verticalScroller] setHidden:NO]; - [self _updateHighlightedRangesToIndex:loc]; - - if (!didSetFutureRange) { - //highlight words from lastHighlightedIndex to end of body - - if (futureRange.location != NSNotFound && NSMaxRange(futureRange) <= [[self string] length]) { - didSetFutureRange = YES; - [self setAutomaticallySelectedRange:futureRange]; - [self scrollRangeToVisible:futureRange]; - } - - inhibitingUpdates = NO; - - [self setNeedsDisplayInRect:rectForSuppressedUpdate avoidAdditionalLayout:YES]; - [(BodyScroller*)[[self enclosingScrollView] verticalScroller] restoreSuppressedRects]; - } +- (NSDictionary*)preferredLinkAttributes { + if (![prefsController URLsAreClickable]) + return [NSDictionary dictionary]; - //[(BodyScroller*)[[self enclosingScrollView] verticalScroller] setDisableUpdating:NO]; + return [NSDictionary dictionaryWithObjectsAndKeys: + [NSCursor pointingHandCursor], NSCursorAttributeName, + [NSNumber numberWithInt:NSUnderlineStyleSingle], NSUnderlineStyleAttributeName, + [self _linkColorForForegroundColor:[[NSApp delegate] foregrndColor] backgroundColor:[[NSApp delegate] backgrndColor]], + NSForegroundColorAttributeName, nil]; + + /* + return [NSDictionary dictionaryWithObjectsAndKeys: + [NSCursor pointingHandCursor], NSCursorAttributeName, + [NSNumber numberWithInt:NSUnderlineStyleSingle], NSUnderlineStyleAttributeName, + [self _linkColorForForegroundColor:[prefsController foregroundTextColor] backgroundColor:[prefsController backgroundTextColor]], + NSForegroundColorAttributeName, nil]; + */ } -- (void)layoutManager:(NSLayoutManager *)aLayoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)aTextContainer atEnd:(BOOL)flag { - //NSLog(@"completed layout at end: %d", flag); +/* +- (BOOL)acceptsFirstResponder { - didRenderFully = YES; - if (!didInvalidateLayout) { - //ideally we want to be able to do this as soon as firstUnlaidCharacterIndex is >= NSMaxRange(futureRange), but how to check other than polling? - [self _setFutureSelectionRangeWithinIndex:[[self string] length]]; - //[self setNeedsDisplayInRect:[self visibleRect] avoidAdditionalLayout:YES]; - } + return ([[controlField stringValue] length] > 0); +}*/ + +- (void)toggleAutomaticTextReplacement:(id)sender { + [super toggleAutomaticTextReplacement:sender]; + + [prefsController setUseTextReplacement:[self isAutomaticTextReplacementEnabled] sender:self]; } -- (void)layoutManagerDidInvalidateLayout:(NSLayoutManager *)aLayoutManager { - //NSLog(@"invalidated layout"); - didInvalidateLayout = YES; - didRenderFully = NO; -} -- (BOOL)readyToDraw { - //return didRenderFully || didInvalidateLayout || didSetFutureRange; - return !inhibitingUpdates; +- (void)toggleContinuousSpellChecking:(id)sender { + + [super toggleContinuousSpellChecking:sender]; + + [prefsController setCheckSpellingAsYouType:[self isContinuousSpellCheckingEnabled] sender:self]; } -- (void)setNeedsDisplayInRect:(NSRect)aRect avoidAdditionalLayout:(BOOL)flag { - if (![self readyToDraw]) { - rectForSuppressedUpdate = NSUnionRect(rectForSuppressedUpdate, aRect); - } else { - [super setNeedsDisplayInRect:aRect avoidAdditionalLayout:flag]; - } +- (BOOL)isContinuousSpellCheckingEnabled { + //optimization so that we don't spell-check while scrolling through notes that don't have focus + NSView *responder = (NSView*)[[self window] firstResponder]; + + return (responder == self && [super isContinuousSpellCheckingEnabled]); } -#else - (BOOL)didRenderFully { return didRenderFully; @@ -401,61 +345,51 @@ - (void)layoutManager:(NSLayoutManager *)aLayoutManager didCompleteLayoutForText - (void)layoutManagerDidInvalidateLayout:(NSLayoutManager *)aLayoutManager { didRenderFully = NO; } -#endif - (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard type:(NSString *)type { //NSLog(@"readSelectionFromPasteboard: %@ (total %@)", type, [[pboard types] description]); if ([type isEqualToString:NSFilenamesPboardType]) { //paste as a file:// URL, so that it can be linked - NSArray *files = [pboard propertyListForType:NSFilenamesPboardType]; - if ([files isKindOfClass:[NSArray class]]) { - NSMutableString *allURLsString = [NSMutableString string]; - unsigned int i; - BOOL foundURL = NO; - for (i=0; i<[files count]; i++) { - NSURL *url = [NSURL fileURLWithPath:[files objectAtIndex:i]]; - if (url) { - [allURLsString appendFormat:@"<%@>", - [[url absoluteString] stringByReplacingOccurrencesOfString:@"file://localhost" withString:@"file://"]]; - foundURL = YES; - } - if (i < [files count] - 1) [allURLsString appendString:@"\n"]; - } - if (foundURL) { - NSRange selectedRange = [self rangeForUserTextChange]; - if ([self shouldChangeTextInRange:selectedRange replacementString:allURLsString]) { - [self replaceCharactersInRange:selectedRange withString:allURLsString]; - [self didChangeText]; - - return YES; - } + NSString *allURLsString = [[NSApp delegate] stringWithNoteURLsOnPasteboard:pboard]; + + if ([allURLsString length]) { + NSRange selectedRange = [self rangeForUserTextChange]; + if ([self shouldChangeTextInRange:selectedRange replacementString:allURLsString]) { + [self replaceCharactersInRange:selectedRange withString:allURLsString]; + [self didChangeText]; + + return YES; } } } - if ([type isEqualToString:NSRTFPboardType] || [type isEqualToString:NVPTFPboardType]) { + if ([type isEqualToString:NSRTFPboardType] || [type isEqualToString:NVPTFPboardType] || [type isEqualToString:NSHTMLPboardType]) { //strip formatting if RTF and stick it into a new pboard - NSMutableAttributedString *newString = [[[NSMutableAttributedString alloc] initWithRTF:[pboard dataForType:type] - documentAttributes:nil] autorelease]; - NSRange selectedRange = [self rangeForUserTextChange]; - if ([self shouldChangeTextInRange:selectedRange replacementString:[newString string]]) { + + NSMutableAttributedString *newString = [[[NSMutableAttributedString alloc] performSelector:[type isEqualToString:NSHTMLPboardType] ? + @selector(initWithHTML:documentAttributes:) : @selector(initWithRTF:documentAttributes:) + withObject:[pboard dataForType:type] withObject:nil] autorelease]; + if ([newString length]) { + NSRange selectedRange = [self rangeForUserTextChange]; + if ([self shouldChangeTextInRange:selectedRange replacementString:[newString string]]) { + + if (![type isEqualToString:NVPTFPboardType]) { + //remove the link attribute, because it will be re-added after we paste, and restyleText would preserve it otherwise + //and we only want real URLs to be linked + [newString removeAttribute:NSLinkAttributeName range:NSMakeRange(0, [newString length])]; + [newString restyleTextToFont:[prefsController noteBodyFont] usingBaseFont:nil]; + } + + [self replaceCharactersInRange:selectedRange withRTF:[newString RTFFromRange: + NSMakeRange(0, [newString length]) documentAttributes:nil]]; - if (![type isEqualToString:NVPTFPboardType]) { - //remove the link attribute, because it will be re-added after we paste, and restyleText would preserve it otherwise - //and we only want real URLs to be linked - [newString removeAttribute:NSLinkAttributeName range:NSMakeRange(0, [newString length])]; - [newString restyleTextToFont:[prefsController noteBodyFont] usingBaseFont:nil]; + //paragraph styles will ALWAYS be added _after_ replaceCharactersInRange, it seems + //[[self textStorage] removeAttribute:NSParagraphStyleAttributeName range:NSMakeRange(0, [[self string] length])]; + [self didChangeText]; + + return YES; } - - [self replaceCharactersInRange:selectedRange withRTF:[newString RTFFromRange: - NSMakeRange(0, [newString length]) documentAttributes:nil]]; - - //paragraph styles will ALWAYS be added _after_ replaceCharactersInRange, it seems - //[[self textStorage] removeAttribute:NSParagraphStyleAttributeName range:NSMakeRange(0, [[self string] length])]; - [self didChangeText]; - - return YES; } } @@ -472,17 +406,25 @@ - (NSArray *)readablePasteboardTypes { if ([prefsController pastePreservesStyle]) { [types insertObject:NSRTFPboardType atIndex:2]; + [types insertObject:NSHTMLPboardType atIndex:3]; } return types; } - - (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard type:(NSString *)type { - - if ([type isEqualToString:NVPTFPboardType]) { + + if ([type isEqualToString:NVPTFPboardType] || [type isEqualToString:NSRTFPboardType]) { //always preserve RTF to allow pasting into ourselves; prejudice against external sources - [pboard setData:[self RTFFromRange:[self selectedRange]] forType:NVPTFPboardType]; + + NSMutableAttributedString *newString = [[[self textStorage] attributedSubstringFromRange:[self selectedRange]] mutableCopy]; + + if (![type isEqualToString:NVPTFPboardType]) + [newString removeAttribute:NSForegroundColorAttributeName range:NSMakeRange(0, [newString length])]; + + NSData *rtfData = [newString RTFFromRange:NSMakeRange(0, [newString length]) documentAttributes:nil];; + if (rtfData) [pboard setData:rtfData forType:type]; + [newString release]; return YES; } @@ -515,7 +457,7 @@ - (NSArray *)writablePasteboardTypes { goto copyRTFType; if ([attributes attributesHaveFontTrait:NSItalicFontMask orAttribute:NSObliquenessAttributeName]) goto copyRTFType; - if ([attributes attributesHaveFontTrait:0 orAttribute:NSUnderlineStyleAttributeName]) + if ([attributes attributesHaveFontTrait:0 orAttribute:NSStrikethroughStyleAttributeName]) goto copyRTFType; } #if COPY_PASTE_DEBUG @@ -542,21 +484,19 @@ - (NSArray *)writablePasteboardTypes { return types; } -- (void)underlineNV:(id)sender { - - //we don't respond to the font panel, so underline it ourselves - [self applyStyleOfTrait:0 alternateAttributeName:NSUnderlineStyleAttributeName +//font panel is disabled for the note-body, so styles must be applied manually: + +- (void)strikethroughNV:(id)sender { + + [self applyStyleOfTrait:0 alternateAttributeName:NSStrikethroughStyleAttributeName alternateAttributeValue:[NSNumber numberWithInt:NSUnderlineStyleSingle]]; - [[self undoManager] setActionName:NSLocalizedString(@"Underline",nil)]; + [[self undoManager] setActionName:NSLocalizedString(@"Strikethrough",nil)]; } #define STROKE_WIDTH_FOR_BOLD (-3.50) #define OBLIQUENESS_FOR_ITALIC (0.20) -- (void)bold:(id)sender { - if ([self selectedRange].length) { - [self insertText:@"**"]; - } +- (void)bold:(id)sender { [self applyStyleOfTrait:NSBoldFontMask alternateAttributeName:NSStrokeWidthAttributeName alternateAttributeValue:[NSNumber numberWithFloat:STROKE_WIDTH_FOR_BOLD]]; @@ -637,7 +577,7 @@ - (void)highlightRangesTemporarily:(CFArrayRef)ranges { } } -- (NSRange)highlightTermsTemporarilyReturningFirstRange:(NSString*)typedString { +- (NSRange)highlightTermsTemporarilyReturningFirstRange:(NSString*)typedString avoidHighlight:(BOOL)noHighlight { //if lengths of respective UTF8-string equivalents for contentString are the same, we should revert to cstring-based algorithm @@ -662,7 +602,13 @@ - (NSRange)highlightTermsTemporarilyReturningFirstRange:(NSString*)typedString { CFRange *range = (CFRange *)CFArrayGetValueAtIndex(ranges, rangeIndex); if (range && range->length > 0 && range->location + range->length <= CFStringGetLength(bodyString)) { - if (firstRange.location > (NSUInteger)range->location) firstRange = *(NSRange*)range; + if (firstRange.location > (NSUInteger)range->location) { + firstRange = *(NSRange*)range; + if (noHighlight) { + CFRelease(ranges); + goto returnEarly; + } + } [[self layoutManager] addTemporaryAttributes:highlightDict forCharacterRange:*(NSRange*)range]; } else { NSLog(@"highlightTermsTemporarily: Invalid range (%@)", range ? NSStringFromRange(*(NSRange*)range) : @"?"); @@ -671,12 +617,15 @@ - (NSRange)highlightTermsTemporarilyReturningFirstRange:(NSString*)typedString { CFRelease(ranges); } } + returnEarly: CFRelease(terms); } return (firstRange); } - (NSRange)selectionRangeForProposedRange:(NSRange)proposedSelRange granularity:(NSSelectionGranularity)granularity { + + // [[NSApp delegate] updateWordCount:YES]; if (granularity != NSSelectByWord || [[self string] length] == proposedSelRange.location) { // If it's not a double-click return unchanged return [super selectionRangeForProposedRange:proposedSelRange granularity:granularity]; @@ -738,7 +687,8 @@ - (NSRange)selectionRangeForProposedRange:(NSRange)proposedSelRange granularity: } //NSBeep(); } - + + // If it has a found a "starting" brace but not found a match, a double-click should only select the "starting" brace and not what it usually would select at a double-click if (triedToMatchBrace) { return [super selectionRangeForProposedRange:NSMakeRange(proposedSelRange.location, 1) granularity:NSSelectByCharacter]; @@ -760,16 +710,25 @@ - (void)setAutomaticallySelectedRange:(NSRange)newRange { didChangeIntoAutomaticRange = NO; [self setSelectedRange:newRange]; } +/* +- (IBAction)performNVFindPanelAction:(id)sender { + //NSLog(@"finding sender is :%@",[sender description]); + [[self window] endEditingFor:nil]; + [self setUsesFindPanel:YES]; + [super performFindPanelAction:sender]; +}*/ - (IBAction)performFindPanelAction:(id)sender { id controller = [NSApp delegate]; NSString *typedString = [controller typedString]; NSString *currentFindString = nil; - + if (!typedString) typedString = [controlField stringValue]; typedString = [typedString stringByReplacingOccurrencesOfString:@"\"" withString:@""]; NSTextFinder *textFinder = [NSTextFinder sharedTextFinder]; + + [self switchFindPanelDelegate]; if ([typedString length] > 0 && ![lastImportedFindString isEqualToString:typedString]) { NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSFindPboard]; @@ -794,7 +753,6 @@ - (IBAction)performFindPanelAction:(id)sender { int rowNumber = -1; int totalNotes = [notesTableView numberOfRows]; int tag = [sender tag]; - if (![controller selectedNoteObject]) { rowNumber = (tag == NSFindPanelActionPrevious ? totalNotes - 1 : 0); @@ -819,8 +777,9 @@ - (IBAction)performFindPanelAction:(id)sender { if ([controller selectedNoteObject]) [[self window] makeFirstResponder:self]; - [super performFindPanelAction:sender]; - + //[textFinder setTextObjectToSearchIn:self]; + [super performFindPanelAction:sender]; + //NSLog(@"textfienders win resp: %@",[[[textFinder findPanel:YES] firstResponder]description]);NSFindPanelTextView [stringDuringFind release]; stringDuringFind = [currentFindString retain]; noteDuringFind = [controller selectedNoteObject]; @@ -829,12 +788,11 @@ - (IBAction)performFindPanelAction:(id)sender { } - (BOOL)performKeyEquivalent:(NSEvent *)anEvent { - - unichar keyChar = [anEvent firstCharacterIgnoringModifiers]; - - if (keyChar == NSCarriageReturnCharacter || keyChar == NSNewlineCharacter || keyChar == NSEnterCharacter) { + if ([anEvent modifierFlags] & NSCommandKeyMask) { - if ([anEvent modifierFlags] & NSCommandKeyMask) { + unichar keyChar = [anEvent firstCharacterIgnoringModifiers]; + if (keyChar == NSCarriageReturnCharacter || keyChar == NSNewlineCharacter || keyChar == NSEnterCharacter) { + // NSLog(@"insertion"); unsigned charIndex = [self selectedRange].location; id aLink = [self highlightLinkAtIndex:charIndex]; @@ -842,13 +800,24 @@ - (BOOL)performKeyEquivalent:(NSEvent *)anEvent { [self clickedOnLink:aLink atIndex:charIndex]; return YES; } + } else if ((keyChar == NSBackspaceCharacter || keyChar == NSDeleteCharacter) && [[self window] firstResponder] == self) { + if ([[self string] length]) { + [self doCommandBySelector:@selector(deleteToBeginningOfLine:)]; + return YES; + } } } return [super performKeyEquivalent:anEvent]; } -- (void)keyDown:(NSEvent*)anEvent { +- (void)flagsChanged:(NSEvent *)theEvent{ + [[NSApp delegate] flagsChanged:theEvent]; +} + + +- (void)keyDown:(NSEvent*)anEvent { + unichar keyChar = [anEvent firstCharacterIgnoringModifiers]; if (keyChar == NSBackTabCharacter) { @@ -886,43 +855,43 @@ - (void)moveToBeginningOfLine:(id)sender { - (void)insertTab:(id)sender { //check prefs for tab behavior - + BOOL wasAutomatic = NO; [self selectedRangeWasAutomatic:&wasAutomatic]; if ([prefsController tabKeyIndents] && (!wasAutomatic || ![[self string] length] || didChangeIntoAutomaticRange)) { - [self insertTabIgnoringFieldEditor:sender]; + [self insertTabIgnoringFieldEditor:sender]; } else { [[self window] selectNextKeyView:self]; } } - (void)insertBacktab:(id)sender { - [[self window] selectPreviousKeyView:self]; + //check temporary NVHiddenBulletIndentAttributeName here first + if ([prefsController autoFormatsListBullets] && [self _selectionAbutsBulletIndentRange]) { + + [self shiftLeftAction:nil]; + } else { + + [[self window] selectPreviousKeyView:self]; + } } - (void)insertTabIgnoringFieldEditor:(id)sender { - - BOOL shouldShiftText = NO; - - if ([self selectedRange].length > 0) { // Check to see if the selection is in the text or if it's at the beginning of a line or in whitespace; if one doesn't do this one shifts the line if there's only one suggestion in the auto-complete - NSRange rangeOfFirstLine = [[self string] lineRangeForRange:NSMakeRange([self selectedRange].location, 0)]; - unsigned int firstCharacterOfFirstLine = rangeOfFirstLine.location; - while ([[self string] characterAtIndex:firstCharacterOfFirstLine] == ' ' || [[self string] characterAtIndex:firstCharacterOfFirstLine] == '\t') { - firstCharacterOfFirstLine++; - } - if ([self selectedRange].location <= firstCharacterOfFirstLine) { - shouldShiftText = YES; - } - } - - if (shouldShiftText) { + NSRange range = [self selectedRange]; + if ((range.length > 0 && [[self string] rangeOfCharacterFromSet:[NSCharacterSet newlineCharacterSet] + options:NSLiteralSearch range:range].location != NSNotFound) || + ([prefsController autoFormatsListBullets] && [self _selectionAbutsBulletIndentRange])) { + //tab shifts text only if there is more than one line selected (i.e., the selection contains at least one line break), or an indented bullet is near + [self shiftRightAction:nil]; + } else if ([prefsController softTabs]) { + int numberOfSpacesPerTab = [prefsController numberOfSpacesInTab]; - int locationOnLine = [self selectedRange].location - [[self string] lineRangeForRange:[self selectedRange]].location; + int locationOnLine = range.location - [[self string] lineRangeForRange:range].location; if (numberOfSpacesPerTab != 0) { int numberOfSpacesLess = locationOnLine % numberOfSpacesPerTab; numberOfSpacesPerTab = numberOfSpacesPerTab - numberOfSpacesLess; @@ -1032,7 +1001,62 @@ - (void)deleteBackward:(id)sender { } [self insertText:insertString]; } -}*/ +} + +*/ + +- (void)mouseEntered:(NSEvent*)anEvent { + mouseInside = YES; + [self fixCursorForBackgroundUpdatingMouseInside:NO]; +} +- (void)mouseExited:(NSEvent*)anEvent { + mouseInside = NO; + [self fixCursorForBackgroundUpdatingMouseInside:NO]; +} + +- (void)_fixCursorForBackgroundUpdatingMouseInside:(NSNumber*)num { + [self fixCursorForBackgroundUpdatingMouseInside:[num boolValue]]; +} + +- (void)fixCursorForBackgroundUpdatingMouseInside:(BOOL)setMouseInside { + + if (IsLeopardOrLater && whiteIBeamCursorIMP && defaultIBeamCursorIMP) { + if (setMouseInside) + mouseInside = [self mouse:[self convertPoint:[[self window] mouseLocationOutsideOfEventStream] fromView:nil] inRect:[self bounds]]; + + BOOL shouldBeWhite = mouseInside && backgroundIsDark && ![self isHidden]; + Class class = [NSCursor class]; + + //set method implementation directly; whiteIBeamCursorIMP and defaultIBeamCursorIMP always point to the same respective blocks of code + Method defaultIBeamCursorMethod = class_getClassMethod(class, @selector(IBeamCursor)); + method_setImplementation(defaultIBeamCursorMethod, shouldBeWhite ? whiteIBeamCursorIMP : defaultIBeamCursorIMP); + + NSCursor *currentCursor = [NSCursor currentCursor]; + NSCursor *whiteCursor = whiteIBeamCursorIMP(class, @selector(whiteIBeamCursor)); + NSCursor *defaultCursor = defaultIBeamCursorIMP(class, @selector(IBeamCursor)); + + //if the current cursor is set incorrectly, and and it's not a non-IBeam cursor, then update it (IBeamCursor points to our recently-set implementation) + if ((currentCursor == whiteCursor) != shouldBeWhite && (currentCursor == whiteCursor || currentCursor == defaultCursor)) { + [[NSCursor IBeamCursor] set]; + } + } +} + +//hiding or showing the view does not always produce mouseEntered/Exited events +- (void)viewDidUnhide { + [self performSelector:@selector(_fixCursorForBackgroundUpdatingMouseInside:) withObject:[NSNumber numberWithBool:YES] afterDelay:0.0]; + + [super viewDidUnhide]; +} +- (void)viewDidHide { + [self fixCursorForBackgroundUpdatingMouseInside:YES]; + [super viewDidHide]; +} + +- (void)windowBecameOrResignedMain:(NSNotification *)aNotification { + //changing the window ordering seems to occasionally trigger mouseExited events w/o a corresponding mouseEntered + [self fixCursorForBackgroundUpdatingMouseInside:YES]; +} - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { //need to fix this for better style detection @@ -1041,7 +1065,7 @@ - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { if (action == @selector(defaultStyle:) || action == @selector(bold:) || action == @selector(italic:) || - action == @selector(underlineNV:)) { + action == @selector(strikethroughNV:)) { NSRange effectiveRange = NSMakeRange(0,0), range = [self selectedRange]; NSDictionary *attrs = nil; @@ -1066,8 +1090,8 @@ - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { menuItemState = [attrs attributesHaveFontTrait:NSBoldFontMask orAttribute:NSStrokeWidthAttributeName]; } else if (action == @selector(italic:)) { menuItemState = [attrs attributesHaveFontTrait:NSItalicFontMask orAttribute:NSObliquenessAttributeName]; - } else if (action == @selector(underlineNV:)) { - menuItemState = [attrs attributesHaveFontTrait:0 orAttribute:NSUnderlineStyleAttributeName]; + } else if (action == @selector(strikethroughNV:)) { + menuItemState = [attrs attributesHaveFontTrait:0 orAttribute:NSStrikethroughStyleAttributeName]; } if (menuItemState && multipleAttributes) @@ -1095,11 +1119,9 @@ - (void)defaultStyle:(id)sender { NSTextStorage *textStorage = [self textStorage]; [textStorage beginEditing]; - [textStorage setAttributes:[prefsController noteBodyAttributes] range:range]; - [textStorage addLinkAttributesForRange:range]; - [textStorage endEditing]; + [self didChangeText]; } @@ -1108,14 +1130,6 @@ - (void)defaultStyle:(id)sender { [[self undoManager] setActionName:NSLocalizedString(@"Plain Text Style",nil)]; } -/*- (void)suggestComplete:(id)sender { - NSRange selectedRange = [self selectedRange]; - NSRange lastWordRange = [self rangeOfWordLocation:selectedRange.location String:[self string] Backwards:YES]; - if ([self selectedRange].location == lastWordRange.location + lastWordRange.length) { - [self complete:sender]; - } -}*/ - - (id)highlightLinkAtIndex:(unsigned)givenIndex { unsigned totalLength = [[self string] length]; unsigned charIndex = givenIndex; @@ -1143,50 +1157,84 @@ - (void)clickedOnLink:(id)aLink atIndex:(NSUInteger)charIndex { return; } - [super clickedOnLink:aLink atIndex:charIndex]; + if ([aLink isKindOfClass:[NSURL class]] && [[aLink scheme] isEqualToString:@"nv"]) { + [[NSApp delegate] interpretNVURL:aLink]; + } else { + [super clickedOnLink:aLink atIndex:charIndex]; + } } -- (void)didChangeText { - /*NSString *string = [self string]; - WordEnumerator *enumerator = [WordEnumerator enumeratorForString:[string substringWithRange:changedRange]]; - NSRange firstWordRange = [enumerator next]; - if (firstWordRange.location != NSNotFound) { - firstWordRange.location += changedRange.location; - id link = [[self textStorage] attribute:NSLinkAttributeName atIndex:firstWordRange.location effectiveRange:NULL]; - if ([link isKindOfClass:[NSURL class]]) { - link = [link absoluteURL]; - } +- (NSRange)rangeForUserCompletion { + NSRange completionRange = [super rangeForUserCompletion]; + //NSLog(@"completionRange: %@", [[self string] substringWithRange:completionRange]); + + + //problem: changedRange.location was 201, but completionRange.location was 195 + NSRange beginLineRange = NSMakeRange(changedRange.location, completionRange.location - changedRange.location); + if (beginLineRange.length > changedRange.length) + goto cancelCompetion; + + NSRange backRange = [[self string] rangeOfString:@"[[" options:NSBackwardsSearch | NSLiteralSearch range:beginLineRange]; + if (backRange.location == NSNotFound) + goto cancelCompetion; + + backRange.location += 2; + backRange.length = completionRange.length + (completionRange.location - backRange.location); + + if ([[NSCharacterSet whitespaceAndNewlineCharacterSet] characterIsMember:[[self string] characterAtIndex:backRange.location]]) + goto cancelCompetion; + + if ([[self string] rangeOfString:@"]]" options:NSLiteralSearch range:backRange].location != NSNotFound) + goto cancelCompetion; + + return backRange; +cancelCompetion: + return NSMakeRange(NSNotFound, 0); +} + +- (void)insertCompletion:(NSString *)word forPartialWordRange:(NSRange)charRange movement:(NSInteger)movement isFinal:(BOOL)isFinal { + NSString *str = [self string]; + BOOL finalizedCompletion = NO; + + isFinal = isFinal && movement != NSRightTextMovement; + + if (isFinal && [word length] && (movement == NSReturnTextMovement || movement == NSTabTextMovement)) { - NSString *word = [string substringWithRange:firstWordRange]; - if (!link || ![link isEqual:word]) { - firstWordRange.location = NSNotFound; + //automatically add a trailing double-bracket if one does not already exist + NSRange endRange = NSMakeRange(charRange.location + [word length], 2); + if ([str length] < NSMaxRange(endRange) || ![[str substringWithRange:endRange] isEqualToString:@"]]"]) { + word = [word stringByAppendingString:@"]]"]; } - }*/ + finalizedCompletion = YES; + } - [[self textStorage] removeAttribute:NSLinkAttributeName range:changedRange]; + //preserve capitalization by transferring charRange substring into word + if (!finalizedCompletion && charRange.length <= [word length]) { + NSString *existingWord = [str substringWithRange:charRange]; + word = [existingWord stringByAppendingString:[word substringFromIndex:[existingWord length]]]; + } - /*if (firstWordRange.location != NSNotFound) { - [self createWikiLinkWithRange:firstWordRange]; - changedRange.length += changedRange.location - (firstWordRange.location+firstWordRange.length); - changedRange.location = firstWordRange.location + firstWordRange.length; - }*/ + [super insertCompletion:word forPartialWordRange:charRange movement:movement isFinal:isFinal]; +} + +- (void)didChangeText { + //if the text storage was somehow shortened since changedRange was set in -shouldChangeText, at least avoid an out of bounds exception + changedRange = NSMakeRange(changedRange.location, (MIN(NSMaxRange(changedRange), [[self string] length]) - changedRange.location)); + + + //-removeAttribute:range: seems slow for some reason; try checking with -attributesAtIndex:effectiveRange: first + if ([[self textStorage] attribute:NSLinkAttributeName existsInRange:changedRange]) + [[self textStorage] removeAttribute:NSLinkAttributeName range:changedRange]; [[self textStorage] addLinkAttributesForRange:changedRange]; - if ([prefsController linksAutoSuggested]) { - - /*WordEnumerator *words = [WordEnumerator enumeratorForString:[string substringWithRange:changedRange]]; - NSRange wordRange = [words next]; - while (wordRange.location != NSNotFound) { - wordRange.location += changedRange.location; - if ([self isWikiWord: [string substringWithRange:wordRange]]) { - [self createWikiLinkWithRange: wordRange]; - } - wordRange = [words next]; - }*/ - - //[self suggestComplete:nil]; - //[self complete:nil]; + [[self textStorage] addStrikethroughNearDoneTagsForRange:changedRange]; + + if (!isAutocompleting && !wasDeleting && [prefsController linksAutoSuggested] && + ![[self undoManager] isUndoing] && ![[self undoManager] isRedoing]) { + isAutocompleting = YES; + [self complete:self]; + isAutocompleting = NO; } //[[self window] invalidateCursorRectsForView:self]; @@ -1200,44 +1248,28 @@ - (void)didChangeText { } - (BOOL)shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString { - NSCharacterSet *separatorCharacterSet = [NSAttributedString antiURLCharacterSet]; + wasDeleting = ![replacementString length]; //it's not exactly proper to alter typing attributes when we don't yet know whether the text should actually be changed, but NV shouldn't cause that to happen, anyway [self fixTypingAttributesForSubstitutedFonts]; NSString *string = [self string]; - - //changedRange = NSMakeRange(affectedCharRange.location, affectedCharRange.length); - - NSUInteger begin = [string rangeOfCharacterFromSet:separatorCharacterSet options:NSBackwardsSearch - range:NSMakeRange(0, affectedCharRange.location)].location; + + NSCharacterSet *separatorCharacterSet = [NSCharacterSet newlineCharacterSet]; + //even when only seeking newlines, this manual line-finding method is less laggy than -[NSString lineRangeForRange:] + NSUInteger begin = [string rangeOfCharacterFromSet:separatorCharacterSet options:NSBackwardsSearch range:NSMakeRange(0, affectedCharRange.location)].location; if (begin == NSNotFound) { begin = 0; } - NSUInteger end = [string rangeOfCharacterFromSet:separatorCharacterSet options:0 - range:NSMakeRange(affectedCharRange.location + affectedCharRange.length, - [string length] - (affectedCharRange.location + affectedCharRange.length))].location; + NSUInteger end = [string rangeOfCharacterFromSet:separatorCharacterSet options:0 range:NSMakeRange(affectedCharRange.location + affectedCharRange.length, + [string length] - (affectedCharRange.location + affectedCharRange.length))].location; if (end == NSNotFound) { end = [string length]; } - - changedRange = NSMakeRange(begin, (end-begin)); - - //NSAttributedString *changedText = [[self textStorage] attributedSubstringFromRange:changedRange]; - changedRange.length += [replacementString length]; - - /*int startIndex = 0; - NSRange range; - while (startIndex < [changedText length]) { - id link = [changedText findNextLinkAtIndex:startIndex effectiveRange:&range]; - if ([link isKindOfClass:[NSURL class]]) { - link = [link absoluteString]; - } - startIndex = range.location+range.length; - }*/ - - if (affectedCharRange.length > 0) { // Deleting something + changedRange = NSMakeRange(begin, (end - begin) + [replacementString length]); + + if (affectedCharRange.length > 0 && replacementString != nil) { // Deleting something changedRange.length -= affectedCharRange.length; } @@ -1312,17 +1344,181 @@ - (void)fixTypingAttributesForSubstitutedFonts { } } +- (BOOL)_selectionAbutsBulletIndentRange { + + NSRange range = [self selectedRange]; + NSRange backBulletRange = NSMakeRange(range.location - 2, 2); + NSRange frontBulletRange = NSMakeRange(range.location, 2); + + return ((backBulletRange.location > 0 && NSMaxRange(backBulletRange) < [[self string] length] && [self _rangeIsAutoIdentedBullet:backBulletRange]) || + (NSMaxRange(frontBulletRange) < [[self string] length] && [self _rangeIsAutoIdentedBullet:frontBulletRange])); +} + +- (BOOL)_rangeIsAutoIdentedBullet:(NSRange)aRange { + NSRange effectiveRange = NSMakeRange(aRange.location, 0); + while (NSMaxRange(effectiveRange) < NSMaxRange(aRange)) { + + id bulletIndicator = nil; + + //sometimes the temporary attributes are split across juxtaposing characters for some reason, so longest-effective-range is necessary + //unfortunately there is no such method on Tiger, and I'm not about to emulate its coalescing behavior here + if (IsLeopardOrLater) { + bulletIndicator = [[self layoutManager] temporaryAttribute:NVHiddenBulletIndentAttributeName atCharacterIndex:NSMaxRange(effectiveRange) + longestEffectiveRange:&effectiveRange inRange:aRange]; + } else { + NSDictionary *dict = [[self layoutManager] temporaryAttributesAtCharacterIndex:NSMaxRange(effectiveRange) effectiveRange:&effectiveRange]; + bulletIndicator = [dict objectForKey:NVHiddenBulletIndentAttributeName]; + } + if (bulletIndicator && NSEqualRanges(effectiveRange, aRange)) { + return YES; + } + } + + return NO; +} + - (void)insertNewline:(id)sender { +// NSLog(@"insertion2"); + //reset custom styles after each line + [self setTypingAttributes:[prefsController noteBodyAttributes]]; + [super insertNewline:sender]; - // If we should indent automatically, check the previous line and scan all the whitespace at the beginning of the line into a string and insert that string into the new line - //NSString *lastLineString = [[self string] substringWithRange:[[self string] lineRangeForRange:NSMakeRange([self selectedRange].location - 1, 0)]]; - NSString *previousLineWhitespaceString; - NSScanner *previousLineScanner = [[NSScanner alloc] initWithString:[[self string] substringWithRange:[[self string] lineRangeForRange:NSMakeRange([self selectedRange].location - 1, 0)]]]; - [previousLineScanner setCharactersToBeSkipped:nil]; - if ([previousLineScanner scanCharactersFromSet:[NSCharacterSet whitespaceCharacterSet] intoString:&previousLineWhitespaceString]) { - [self insertText:previousLineWhitespaceString]; + + if ([prefsController autoIndentsNewLines]) { + // If we should indent automatically, check the previous line and scan all the whitespace at the beginning of the line into a string and insert that string into the new line + NSString *previousLineWhitespaceString = nil; + NSRange previousLineRange = [[self string] lineRangeForRange:NSMakeRange([self selectedRange].location - 1, 0)]; + NSScanner *previousLineScanner = [[NSScanner alloc] initWithString:[[self string] substringWithRange:previousLineRange]]; + [previousLineScanner setCharactersToBeSkipped:nil]; + + if ([previousLineScanner scanCharactersFromSet:[NSCharacterSet whitespaceCharacterSet] intoString:&previousLineWhitespaceString]) { + //for propagating list-element, look for bullet-type-character + 1charWS + at-least-one-nonWSChar + + NSUInteger loc = [previousLineScanner scanLocation]; + NSString *str = [previousLineScanner string]; + unichar bulletChar, wsChar; + NSRange realBulletRange = NSMakeRange(loc + previousLineRange.location, 2), carriedBulletRange = NSMakeRange(NSNotFound, 0); + BOOL shouldDeleteLastBullet = NO; + + if ([prefsController autoFormatsListBullets]) { + if (loc + 2 < [str length] && ![previousLineScanner isAtEnd] && + [[NSCharacterSet listBulletsCharacterSet] characterIsMember:(bulletChar = [str characterAtIndex:loc])] && + [[NSCharacterSet whitespaceCharacterSet] characterIsMember:(wsChar = [str characterAtIndex:loc + 1])] && + [[[NSCharacterSet whitespaceAndNewlineCharacterSet] invertedSet] characterIsMember:[str characterAtIndex:loc + 2]]) { + + carriedBulletRange = NSMakeRange(NSMaxRange(previousLineRange) + [previousLineWhitespaceString length], 2); + previousLineWhitespaceString = [previousLineWhitespaceString stringByAppendingFormat:@"%C%C", bulletChar, wsChar]; + + } else if (NSMaxRange(realBulletRange) < [[self string] length] && [self _rangeIsAutoIdentedBullet:realBulletRange]) { + //should not carry a bullet; also check if one is here that we should delete + shouldDeleteLastBullet = YES; + } + } + + if (shouldDeleteLastBullet) { + //we had carried a bullet, but now it is no carried no more + //so instead of inserting the extra space, delete both that previously-carried-bullet and the newline added by -super up there + [[self textStorage] deleteCharactersInRange:NSMakeRange(realBulletRange.location, realBulletRange.length + 1)]; + } else { + [self insertText:previousLineWhitespaceString]; + if (carriedBulletRange.length) { + [[self layoutManager] addTemporaryAttributes:[NSDictionary dictionaryWithObject:[NSNull null] forKey:NVHiddenBulletIndentAttributeName] + forCharacterRange:carriedBulletRange]; + //[[self layoutManager] addTemporaryAttributes:[prefsController searchTermHighlightAttributes] forCharacterRange:carriedBulletRange]; + } + } + } + [previousLineScanner release]; } - [previousLineScanner release]; +} + +- (void)setupFontMenu { + NSMenu *theMenu = [[[NSMenu alloc] initWithTitle:@"NVFontMenu"] autorelease]; + NSMenuItem *theMenuItem; + if(IsLeopardOrLater){ + theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Toggle Fullscreen Mode",@"toggle fs menu item title") action:@selector(toggleFullscreen:) keyEquivalent:@""] autorelease]; + [theMenuItem setTarget:[NSApp delegate]]; + [theMenu addItem:theMenuItem]; + [theMenu addItem:[NSMenuItem separatorItem]]; + } + theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Cut",@"cut menu item title") action:@selector(cut:) keyEquivalent:@""] autorelease]; + [theMenuItem setTarget:self]; + [theMenu addItem:theMenuItem]; + + theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Copy",@"copy menu item title") action:@selector(copy:) keyEquivalent:@""] autorelease]; + [theMenuItem setTarget:self]; + [theMenu addItem:theMenuItem]; + + theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Paste",@"paste menu item title") action:@selector(paste:) keyEquivalent:@""] autorelease]; + [theMenuItem setTarget:self]; + [theMenu addItem:theMenuItem]; + [theMenu addItem:[NSMenuItem separatorItem]]; + + NSMenu *formatMenu = [[[NSMenu alloc] initWithTitle:NSLocalizedString(@"Format", nil)] autorelease]; + + theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Plain Text Style",nil) + action:@selector(defaultStyle:) keyEquivalent:@""] autorelease]; + [theMenuItem setTarget:self]; + [formatMenu addItem:theMenuItem]; + + theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Bold",nil) action:@selector(bold:) keyEquivalent:@""] autorelease]; + [theMenuItem setTarget:self]; + [formatMenu addItem:theMenuItem]; + + theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Italic",nil) action:@selector(italic:) keyEquivalent:@""] autorelease]; + [theMenuItem setTarget:self]; + [formatMenu addItem:theMenuItem]; + + theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Strikethrough",nil) action:@selector(strikethroughNV:) keyEquivalent:@""] autorelease]; + [theMenuItem setTarget:self]; + [formatMenu addItem:theMenuItem]; + + theMenuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Format",@"format submenu title") action:NULL keyEquivalent:@""] autorelease]; + [theMenu addItem:theMenuItem]; + [theMenu setSubmenu:formatMenu forItem:theMenuItem]; + + + [self setMenu:theMenu]; + + + // Insert Password menus + static BOOL additionalEditItems = YES; + + if (additionalEditItems) { + additionalEditItems = NO; + + NSMenu *editMenu = [[NSApp mainMenu] numberOfItems] > 2 ? [[[NSApp mainMenu] itemAtIndex:2] submenu] : nil; + + if (IsSnowLeopardOrLater) { + theMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Use Automatic Text Replacement", "use-text-replacement command in the edit menu") + action:@selector(toggleAutomaticTextReplacement:) keyEquivalent:@""]; + [theMenuItem setTarget:self]; + [editMenu addItem:theMenuItem]; + [theMenuItem release]; + } + + [editMenu addItem:[NSMenuItem separatorItem]]; + +#if PASSWORD_SUGGESTIONS + theMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"New Password...", "new password command in the edit menu") + action:@selector(showGeneratedPasswords:) keyEquivalent:@"\\"]; + [theMenuItem setKeyEquivalentModifierMask:NSCommandKeyMask]; + [theMenuItem setTarget:nil]; // First Responder being the current Link Editor + [editMenu addItem:theMenuItem]; + [theMenuItem release]; +#endif + + theMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Insert New Password", "insert new password command in the edit menu") + action:@selector(insertGeneratedPassword:) keyEquivalent:@"\\"]; +#if PASSWORD_SUGGESTIONS + [theMenuItem setAlternate:YES]; +#endif + [theMenuItem setKeyEquivalentModifierMask:NSCommandKeyMask|NSAlternateKeyMask]; + [theMenuItem setTarget:nil]; // First Responder being the current Link Editor + [editMenu addItem:theMenuItem]; + [theMenuItem release]; + } + } - (void)insertPassword:(NSString*)password @@ -1332,7 +1528,7 @@ - (void)insertPassword:(NSString*)password NSPasteboard *pb = [NSPasteboard generalPasteboard]; #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 NSPasteboardItem *pbitem = [[[NSPasteboardItem alloc] init] autorelease]; - [pbitem setData:password forType:@"public.plain-text"]; + [pbitem setData:[password dataUsingEncoding:NSUTF8StringEncoding] forType:@"public.plain-text"]; [pb writeObjects:[NSArray arrayWithObject:pbitem]]; #else [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; @@ -1358,4 +1554,71 @@ - (void)showGeneratedPasswords:(id)sender { #endif } +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver: self]; + [super dealloc]; +} + + +//elasticwork +- (void)switchFindPanelDelegate{ + NSTextFinder *textFinder = [NSTextFinder sharedTextFinder]; + if ([[[self window] contentView] isInFullScreenMode]) { + [[textFinder findPanel:YES] setDelegate:self]; + NSArray *sViews = [[[textFinder findPanel:YES] contentView] subviews]; + for (id thing in sViews){ + if ([[thing className] isEqualToString:@"NSButton"]) { + NSButton *aBut = thing; + if (![aBut target]==nil) { + [aBut setTarget:self]; + [aBut setAction:@selector(findInFullscreen:)]; + } + } + } + }else { + [[textFinder findPanel:YES] setDelegate:textFinder]; + NSArray *sViews = [[[textFinder findPanel:YES] contentView] subviews]; + for (id thing in sViews){ + if ([[thing className] isEqualToString:@"NSButton"]) { + NSButton *aBut = thing; + if (![aBut target]==nil) { + [aBut setTarget:textFinder]; + [aBut setAction:@selector(performFindPanelAction:)]; + } + } + } + + } + [[textFinder findPanel:YES] update]; +} + +- (IBAction)findInFullscreen:(id)sender{ + int findTag = 1; + if ([[sender className] isEqualToString:@"NSButton"]) { + //NSLog(@"findinfull sender is :%@",[sender title]); + if ([[sender title] isEqualToString:@"Replace All"]) { + findTag = 4; + }else if ([[sender title] isEqualToString:@"Replace"]) { + findTag = 5; + }else if ([[sender title] isEqualToString:@"Replace & Find"]) { + findTag = 6; + }else if ([[sender title] isEqualToString:@"Replace"]) { + findTag = 5; + }else if ([[sender title] isEqualToString:@"Previous"]) { + findTag = 3; + }else if ([[sender title] isEqualToString:@"Next"]) { + findTag = 2; + } + } +// [[NSTextFinder sharedTextFinder] setFindString:[[NSTextFinder sharedTextFinder] findString] writeToPasteboard:NO updateUI:YES]; + [[NSTextFinder sharedTextFinder] performFindPanelAction:findTag forClient:self]; +} + +- (void)mouseDown:(NSEvent *)theEvent{ + [[NSApp delegate] setIsEditing:NO]; + + [super mouseDown:theEvent]; +} + + @end diff --git a/Markdownify.nvhelp b/Markdownify.nvhelp new file mode 100644 index 00000000..6bca4ca5 --- /dev/null +++ b/Markdownify.nvhelp @@ -0,0 +1,9 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs28 \cf0 To import a URL as Markdown, turn on the option under "Editing" in nvALT's Preferences. Now, when you drag a URL to the notes list, it will convert it to Markdown as much as possible. The success depends on the quality of the original markup in the page.\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural +\cf0 \ +You can also turn on Readability to strip out ads, comments, menus, etc. Again, it depends on the quality of the original markup. If you only want to use Readability on occasion, turn the option off and just hold down the option key while dragging to use it on just the url you're currently dropping.} \ No newline at end of file diff --git a/MultiMarkdown/Utilities/table_cleanup.pl b/MultiMarkdown/Utilities/table_cleanup.pl index f6445342..886aa223 100755 --- a/MultiMarkdown/Utilities/table_cleanup.pl +++ b/MultiMarkdown/Utilities/table_cleanup.pl @@ -168,7 +168,7 @@ $goal_length--; $result = ":"; } - if ($cell =~ /\:$/) { + if ($cell =~ /[\:\+]$/) { $goal_length--; } for (my $i=0;$i < $goal_length;$i++){ @@ -177,7 +177,9 @@ if ($cell =~ /\:$/) { $result .=":"; } - + if ($cell =~ /\+$/) { + $result .="+"; + } $count++; $opening . "$result" . $ending; }xsge; diff --git a/MultiMarkdown/XSLT/sffms.xslt b/MultiMarkdown/XSLT/sffms.xslt index af54350f..1557d6f1 100755 --- a/MultiMarkdown/XSLT/sffms.xslt +++ b/MultiMarkdown/XSLT/sffms.xslt @@ -278,7 +278,7 @@ - \underline{ + \emph{ } diff --git a/MultiMarkdown/XSLT/xhtml-google-docs.xslt b/MultiMarkdown/XSLT/xhtml-google-docs.xslt index efb6aef6..c6317e78 100755 --- a/MultiMarkdown/XSLT/xhtml-google-docs.xslt +++ b/MultiMarkdown/XSLT/xhtml-google-docs.xslt @@ -90,6 +90,7 @@ + diff --git a/MultiMarkdown/bin/MultiMarkdown.pl b/MultiMarkdown/bin/MultiMarkdown.pl index 9c9f5b15..8f36adf5 100755 --- a/MultiMarkdown/bin/MultiMarkdown.pl +++ b/MultiMarkdown/bin/MultiMarkdown.pl @@ -170,7 +170,7 @@ sub story { my $plugin = new MT::Plugin({ name => "MultiMarkdown", description => "Based on the original Markdown", - doc_link => 'http://fletcherpenney.net/MultiMarkdown/' + doc_link => 'http://fletcherpenney.net/multimarkdown/' }); MT->add_plugin( $plugin ); } @@ -423,7 +423,8 @@ sub _StripLinkDefinitions { (?:\n+|\Z) } {}mx) { - $g_urls{lc $1} = _EncodeAmpsAndAngles( $2 ); # Link IDs are case-insensitive +# $g_urls{lc $1} = _EncodeAmpsAndAngles( $2 ); # Link IDs are case-insensitive + $g_urls{lc $1} = $2; # Link IDs are case-insensitive if ($3) { $g_titles{lc $1} = $3; $g_titles{lc $1} =~ s/"/"/g; @@ -748,22 +749,6 @@ sub _DoAnchors { } $result .= _DoAttributes($label); $result .= ">$link_text"; - } elsif ($link_id =~ /^\§/) { - # - # ZETTELKASTEN Link Processing - # - $link_id=~ s/\§//g; - my $loc = $ENV{"ZETTELKASTEN"} || expand_tilde("~/Archiv/"); - my $filename = `ls -C $loc | grep -o --colour=never "^${link_id}_.*"`; - $filename =~ s/\n|\r//sg; - $filename =~ s/ /%20/g; - $filename =~ s/=/%3D/g; - $filename =~ s/\+/%2B/g; - # $filename =~ s/\.md/\.html/; - my $url = "txmt://open?url=file://". $loc . $filename; # Zettelkasten Link - $result = " + $result .= qq{ \n}; $result.= qq{\n\t\n}; @@ -1949,7 +1919,8 @@ sub xhtmlMetaData { } elsif (lc($export_key) eq "xhtmlheader") { $result .= "\t\t$g_metadata{$key}\n"; } else { - $result.= qq!\t\tHe said, "'Quoted' words in a larger quote."

- s/"'(?=\w)/»‚/g; - s/'"(?=\w)/‚»/g; + s/"'(?=\w)/„‚/g; + s/'"(?=\w)/‚„/g; # Special case for decade abbreviations (the '80s): s/'(?=\d{2}s)/’/g; @@ -520,7 +520,7 @@ sub EducateQuotes { ) " # the quote (?=\w) # followed by a word character - } {$1»}xg; + } {$1„}xg; # Double closing quotes: s { @@ -528,10 +528,10 @@ sub EducateQuotes { " (?(1)|(?=\s)) # If $1 captured, then do nothing; # if not, then make sure the next char is whitespace. - } {$1«}xg; + } {$1“}xg; # Any remaining quotes should be opening ones. - s/"/»/g; + s/"/„/g; return $_; } @@ -544,12 +544,12 @@ sub EducateBackticks { # translated into HTML curly quote entities. # # Example input: ``Isn't this fun?'' -# Example output: »Isn't this fun?« +# Example output: „Isn't this fun?“ # local $_ = shift; - s/``/»/g; - s/''/«/g; + s/``/„/g; + s/''/“/g; return $_; } @@ -648,7 +648,7 @@ sub StupefyEntities { # Returns: The string, with each SmartyPants HTML entity translated to # its ASCII counterpart. # -# Example input: »Hello — world.« +# Example input: „Hello — world.“ # Example output: "Hello -- world." # @@ -660,8 +660,8 @@ sub StupefyEntities { s/‚/'/g; # open single quote s/‘/'/g; # close single quote - s/»/"/g; # open double quote - s/«/"/g; # close double quote + s/„/"/g; # open double quote + s/“/"/g; # close double quote s/…/.../g; # ellipsis @@ -1017,7 +1017,7 @@ =head1 VERSION HISTORY smarty_pants="-1" SmartyPants will perform reverse transformations, turning HTML - entities into plain ASCII equivalents. E.g. "»" is turned + entities into plain ASCII equivalents. E.g. "„" is turned into a simple double-quote ("), "—" is turned into two dashes, etc. This is useful if you are using SmartyPants from Brad Choate's MT-Textile text filter, but wish to suppress smart diff --git a/NSBezierPath_NV.h b/NSBezierPath_NV.h new file mode 100644 index 00000000..f54cd336 --- /dev/null +++ b/NSBezierPath_NV.h @@ -0,0 +1,28 @@ +// +// NSBezierPath_NV.h +// Notation +// +// Created by Zachary Schneirov on 1/14/11. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + + +#import + + +@interface NSBezierPath (NV) + ++ (NSBezierPath *)bezierPathWithRoundRectInRect:(NSRect)aRect radius:(float)radius; + ++ (NSBezierPath *)bezierPathWithLayoutManager:(NSLayoutManager*)layoutManager characterRange:(NSRange)charRange atPoint:(NSPoint)point; + +@end diff --git a/NSBezierPath_NV.m b/NSBezierPath_NV.m new file mode 100644 index 00000000..95e89a1d --- /dev/null +++ b/NSBezierPath_NV.m @@ -0,0 +1,51 @@ +// +// NSBezierPath_NV.m +// Notation +// +// Created by Zachary Schneirov on 1/14/11. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + +#import "NSBezierPath_NV.h" + + +@implementation NSBezierPath (NV) + ++ (NSBezierPath *)bezierPathWithRoundRectInRect:(NSRect)aRect radius:(float)radius { + NSBezierPath* path = [NSBezierPath bezierPath]; + float smallestEdge = MIN(NSWidth(aRect), NSHeight(aRect)); + radius = MIN(radius, 0.5f * smallestEdge); + NSRect rect = NSInsetRect(aRect, radius, radius); + [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMinY(rect)) radius:radius startAngle:180.0 endAngle:270.0]; + [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMinY(rect)) radius:radius startAngle:270.0 endAngle:360.0]; + [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMaxY(rect)) radius:radius startAngle: 0.0 endAngle: 90.0]; + [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMaxY(rect)) radius:radius startAngle: 90.0 endAngle:180.0]; + [path closePath]; + return path; +} + ++ (NSBezierPath *)bezierPathWithLayoutManager:(NSLayoutManager*)layoutManager characterRange:(NSRange)charRange atPoint:(NSPoint)point { + NSRange range = [layoutManager glyphRangeForCharacterRange:charRange actualCharacterRange:NULL]; + NSGlyph *glyphs = (NSGlyph *)malloc(sizeof(NSGlyph) * range.length * 2); + [layoutManager getGlyphs:glyphs range:range]; + + NSBezierPath *path = [NSBezierPath bezierPath]; + [path moveToPoint:point]; + [path appendBezierPathWithGlyphs:glyphs count:range.length inFont:[[layoutManager textStorage] font]]; + + free(glyphs); + + return path; +} + + +@end diff --git a/NSCollection_utils.h b/NSCollection_utils.h index e02e4473..72b23910 100755 --- a/NSCollection_utils.h +++ b/NSCollection_utils.h @@ -29,8 +29,9 @@ alternateAttributeName:(NSString*)attrName alternateAttributeValue:(id)value; @end -@interface NSDictionary (URLEncoding) +@interface NSDictionary (HTTP) ++ (NSDictionary*)optionsDictionaryWithTimeout:(float)timeout; - (NSString*)URLEncodedString; @end @@ -51,10 +52,12 @@ - (void)addMenuItemsForURLsInNotes:(NSMenu*)urlsMenu; - (NSUInteger)indexOfNoteWithUUIDBytes:(CFUUIDBytes*)bytes; - (NSArray*)objectsFromDictionariesForKey:(id)aKey; + @end @interface NSMutableArray (Sorting) - (void)sortUnstableUsingFunction:(NSInteger (*)(id *, id *))compare; - (void)sortStableUsingFunction:(NSInteger (*)(id *, id *))compare usingBuffer:(id **)buffer ofSize:(unsigned int*)bufSize; -@end \ No newline at end of file +@end + diff --git a/NSCollection_utils.m b/NSCollection_utils.m index 3036cdba..cd7c9178 100755 --- a/NSCollection_utils.m +++ b/NSCollection_utils.m @@ -19,6 +19,7 @@ #import "NSCollection_utils.h" #import "AttributedPlainText.h" #import "NSString_NV.h" +#import "NSFileManager_NV.h" #import "NoteObject.h" #import "BufferUtils.h" @@ -42,19 +43,22 @@ - (BOOL)attributesHaveFontTrait:(NSFontTraitMask)desiredTrait orAttribute:(NSStr @implementation NSMutableDictionary (FontTraits) - (void)addDesiredAttributesFromDictionary:(NSDictionary*)dict { - id underlineStyle = [dict objectForKey:NSUnderlineStyleAttributeName]; + id strikethroughStyle = [dict objectForKey:NSStrikethroughStyleAttributeName]; + id hiddenDoneTagStyle = [dict objectForKey:NVHiddenDoneTagAttributeName]; id strokeWidthStyle = [dict objectForKey:NSStrokeWidthAttributeName]; id obliquenessStyle = [dict objectForKey:NSObliquenessAttributeName]; id linkStyle = [dict objectForKey:NSLinkAttributeName]; if (linkStyle) [self setObject:linkStyle forKey:NSLinkAttributeName]; - if (underlineStyle) - [self setObject:underlineStyle forKey:NSUnderlineStyleAttributeName]; + if (strikethroughStyle) + [self setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSStrikethroughStyleAttributeName]; if (strokeWidthStyle) [self setObject:strokeWidthStyle forKey:NSStrokeWidthAttributeName]; if (obliquenessStyle) [self setObject:obliquenessStyle forKey:NSObliquenessAttributeName]; + if (hiddenDoneTagStyle) + [self setObject:hiddenDoneTagStyle forKey:NVHiddenDoneTagAttributeName]; } - (void)applyStyleInverted:(BOOL)opposite trait:(NSFontTraitMask)trait forFont:(NSFont*)font @@ -80,7 +84,11 @@ - (void)applyStyleInverted:(BOOL)opposite trait:(NSFontTraitMask)trait forFont:( @end -@implementation NSDictionary (URLEncoding) +@implementation NSDictionary (HTTP) + ++ (NSDictionary*)optionsDictionaryWithTimeout:(float)timeout { + return [NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:timeout] forKey:NSTimeoutDocumentOption]; +} - (NSString*)URLEncodedString { @@ -136,6 +144,7 @@ - (NSUInteger)indexOfNoteWithUUIDBytes:(CFUUIDBytes*)bytes { return NSNotFound; } + #if 0 - (NSRange)nextRangeForString:(NSString*)string activeNote:(NoteObject*)startNote options:(unsigned)opts range:(NSRange)inRange { unsigned noteCount = [self count]; @@ -224,7 +233,7 @@ - (void)sortUnstableUsingFunction:(NSInteger (*)(id *, id *))compare { - (void)sortStableUsingFunction:(NSInteger (*)(id *, id *))compare usingBuffer:(id **)buffer ofSize:(unsigned int*)bufSize { CFIndex count = CFArrayGetCount((CFArrayRef)self); - ResizeBuffer((void***)buffer, count, bufSize); + ResizeArray(buffer, count, bufSize); CFArrayGetValues((CFArrayRef)self, CFRangeMake(0, [self count]), (const void **)*buffer); @@ -233,4 +242,4 @@ - (void)sortStableUsingFunction:(NSInteger (*)(id *, id *))compare usingBuffer:( CFArrayReplaceValues((CFMutableArrayRef)self, CFRangeMake(0, count), (const void **)*buffer, count); } -@end \ No newline at end of file +@end diff --git a/NSData_transformations.m b/NSData_transformations.m index 9def9b67..13fbdaca 100755 --- a/NSData_transformations.m +++ b/NSData_transformations.m @@ -170,10 +170,11 @@ - (NSMutableData*)derivedKeyOfLength:(int)len salt:(NSData*)salt iterations:(int //NSDate *date = [NSDate date]; //when compiled with -Os or greater, this is always faster than OpenSSL version +#if 1 if (!pbkdf2_sha1([self bytes], [self length], [salt bytes], [salt length], (unsigned int)count, [derivedKey mutableBytes], (size_t)len)) return nil; //NSLog(@"dk_time(%d): %g", count, (float)[[NSDate date] timeIntervalSinceDate:date]); -#if 0 +#else if (!PKCS5_PBKDF2_HMAC_SHA1([self bytes], [self length], (unsigned char*)[salt bytes], [salt length], count, len, [derivedKey mutableBytes])) return nil; #endif diff --git a/NSFileManager_NV.h b/NSFileManager_NV.h new file mode 100644 index 00000000..d6c2459e --- /dev/null +++ b/NSFileManager_NV.h @@ -0,0 +1,36 @@ +// +// NSFileManager_NV.h +// Notation +// +// Created by Zachary Schneirov on 12/31/10. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + + + + +#import + + +@interface NSFileManager (NV) + + +- (id)getOpenMetaTagsAtFSPath:(const char*)path; +- (BOOL)setOpenMetaTags:(id)plistObject atFSPath:(const char*)path; + +- (NSString*)pathCopiedFromAliasData:(NSData*)aliasData; +- (BOOL)setTextEncodingAttribute:(NSStringEncoding)encoding atFSPath:(const char*)path; +- (NSStringEncoding)textEncodingAttributeOfFSPath:(const char*)path; +- (NSString*)pathFromFSPath:(char*)path; +- (NSString*)pathWithFSRef:(FSRef*)fsRef; + +@end diff --git a/NSFileManager_NV.m b/NSFileManager_NV.m new file mode 100644 index 00000000..67acf59f --- /dev/null +++ b/NSFileManager_NV.m @@ -0,0 +1,189 @@ +// +// NSFileManager_NV.m +// Notation +// +// Created by Zachary Schneirov on 12/31/10. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + + +#import "NSFileManager_NV.h" + + +@implementation NSFileManager (NV) + +#define kMaxDataSize 4096 + +- (id)getOpenMetaTagsAtFSPath:(const char*)path { + //return convention: empty tags should be an empty array; + //for files that have never been tagged, or that have had their tags removed, return + //files might lose their metadata if edited externally or synced without being first encoded + + if (!path) return nil; + + const char* inKeyNameC = "com.apple.metadata:kMDItemOMUserTags"; + // retrieve data from store. + char* data[kMaxDataSize]; + ssize_t dataSize = kMaxDataSize; // ssize_t means SIGNED size_t as getXattr returns - 1 for no attribute found + NSData* nsData = nil; + if ((dataSize = getxattr(path, inKeyNameC, data, dataSize, 0, 0)) > 0) { + nsData = [NSData dataWithBytes:data length:dataSize]; + } else { + // I get EINVAL sometimes when setting/getting xattrs on afp servers running 10.5. When I get this error, I find that everything is working correctly... so it seems to make sense to ignore them + // EINVAL means invalid argument. I know that the args are fine. + //if ((errno != ENOATTR) && (errno != EINVAL) && error) // it is not an error to have no attribute set + // *error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:[NSDictionary dictionaryWithObject:[self errnoString:errno] forKey:@"info"]]; + return nil; + } + + // ok, we have some data + NSPropertyListFormat formatFound; + NSString* errorString = nil; + id outObject = [NSPropertyListSerialization propertyListFromData:nsData mutabilityOption:kCFPropertyListImmutable format:&formatFound errorDescription:&errorString]; + if (errorString) { + NSLog(@"%s: error deserializing labels: %@", _cmd, errorString); + [errorString autorelease]; + return nil; + } + + return outObject; + +} + + +- (BOOL)setOpenMetaTags:(id)plistObject atFSPath:(const char*)path { + if (!path) return NO; + + // If the object passed in has no data - is a string of length 0 or an array or dict with 0 objects, then we remove the data at the key. + + const char* inKeyNameC = "com.apple.metadata:kMDItemOMUserTags"; + + long returnVal = 0; + + // always set data as binary plist. + NSData* dataToSendNS = nil; + if (plistObject) { + NSString *errorString = nil; + dataToSendNS = [NSPropertyListSerialization dataFromPropertyList:plistObject format:kCFPropertyListBinaryFormat_v1_0 errorDescription:&errorString]; + if (errorString) { + NSLog(@"%s: error serializing labels: %@", _cmd, errorString); + [errorString autorelease]; + return NO; + } + } + + if (dataToSendNS) { + // also reject for tags over the maximum size: + if ([dataToSendNS length] > kMaxDataSize) + return NO; + returnVal = setxattr(path, inKeyNameC, [dataToSendNS bytes], [dataToSendNS length], 0, 0); + } else { + returnVal = removexattr(path, inKeyNameC, 0); + } + + if (returnVal < 0) { + if (errno != ENOATTR) NSLog(@"%s: couldn't set/remove attribute: %d (value '%@')", _cmd, errno, dataToSendNS); + return NO; + } + + return YES; +} + +//TODO: use volumeCapabilities in FSExchangeObjectsCompat.c to skip some work on volumes for which we know we would receive ENOTSUP +//for +setTextEncodingAttribute:atFSPath: and +textEncodingAttributeOfFSPath: (test against VOL_CAP_INT_EXTENDED_ATTR) + +- (BOOL)setTextEncodingAttribute:(NSStringEncoding)encoding atFSPath:(const char*)path { + if (!path) return NO; + + CFStringEncoding cfStringEncoding = CFStringConvertNSStringEncodingToEncoding(encoding); + if (cfStringEncoding == kCFStringEncodingInvalidId) { + NSLog(@"%s: encoding %lu is invalid!", _cmd, encoding); + return NO; + } + NSString *textEncStr = [(NSString *)CFStringConvertEncodingToIANACharSetName(cfStringEncoding) stringByAppendingFormat:@";%@", + [[NSNumber numberWithInt:cfStringEncoding] stringValue]]; + const char *textEncUTF8Str = [textEncStr UTF8String]; + + if (setxattr(path, "com.apple.TextEncoding", textEncUTF8Str, strlen(textEncUTF8Str), 0, 0) < 0) { + NSLog(@"couldn't set text encoding attribute of %s to '%s': %d", path, textEncUTF8Str, errno); + return NO; + } + return YES; +} + +- (NSStringEncoding)textEncodingAttributeOfFSPath:(const char*)path { + if (!path) goto errorReturn; + + //We could query the size of the attribute, but that would require a second system call + //and the value for this key shouldn't need to be anywhere near this large, anyway. + //It could be, but it probably won't. If it is, then we won't get the encoding. Too bad. + char xattrValueBytes[128] = { 0 }; + if (getxattr(path, "com.apple.TextEncoding", xattrValueBytes, sizeof(xattrValueBytes), 0, 0) < 0) { + if (ENOATTR != errno) NSLog(@"couldn't get text encoding attribute of %s: %d", path, errno); + goto errorReturn; + } + NSString *encodingStr = [NSString stringWithUTF8String:xattrValueBytes]; + if (!encodingStr) { + NSLog(@"couldn't make attribute data from %s into a string", path); + goto errorReturn; + } + NSArray *segs = [encodingStr componentsSeparatedByString:@";"]; + + if ([segs count] >= 2 && [(NSString*)[segs objectAtIndex:1] length] > 1) { + return CFStringConvertEncodingToNSStringEncoding([[segs objectAtIndex:1] intValue]); + } else if ([(NSString*)[segs objectAtIndex:0] length] > 1) { + CFStringEncoding theCFEncoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)[segs objectAtIndex:0]); + if (theCFEncoding == kCFStringEncodingInvalidId) { + NSLog(@"couldn't convert IANA charset"); + goto errorReturn; + } + return CFStringConvertEncodingToNSStringEncoding(theCFEncoding); + } + +errorReturn: + return 0; +} + +- (NSString*)pathCopiedFromAliasData:(NSData*)aliasData { + AliasHandle inAlias; + CFStringRef path = NULL; + FSAliasInfoBitmap whichInfo = kFSAliasInfoNone; + FSAliasInfo info; + if (aliasData && PtrToHand([aliasData bytes], (Handle*)&inAlias, [aliasData length]) == noErr && + FSCopyAliasInfo(inAlias, NULL, NULL, &path, &whichInfo, &info) == noErr) { + //this method doesn't always seem to work + return [(NSString*)path autorelease]; + } + + return nil; +} + +- (NSString*)pathFromFSPath:(char*)path { + DebugPath(path); + return [self stringWithFileSystemRepresentation:path length:strlen(path)]; +} + +- (NSString*)pathWithFSRef:(FSRef*)fsRef { + NSString *path = nil; + + const UInt32 maxPathSize = 4 * 1024; + UInt8 *convertedPath = (UInt8*)malloc(maxPathSize * sizeof(UInt8)); + if (FSRefMakePath(fsRef, convertedPath, maxPathSize) == noErr) { + path = [self stringWithFileSystemRepresentation:(char*)convertedPath length:strlen((char*)convertedPath)]; + } + free(convertedPath); + + return path; +} + + +@end diff --git a/NSString_CustomTruncation.h b/NSString_CustomTruncation.h new file mode 100644 index 00000000..d13abdf0 --- /dev/null +++ b/NSString_CustomTruncation.h @@ -0,0 +1,31 @@ +// +// NSString_CustomTruncation.h +// Notation +// +// Created by Zachary Schneirov on 1/12/11. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + + +#import + +@interface NSString (CustomTruncation) + +void ResetFontRelatedTableAttributes(); +NSDictionary *LineTruncAttributesForTitle(); + +- (NSString*)truncatedPreviewStringOfLength:(NSUInteger)bodyCharCount; +- (NSAttributedString*)attributedSingleLinePreviewFromBodyText:(NSAttributedString*)bodyText upToWidth:(float)width; +- (NSAttributedString*)attributedSingleLineTitle; +- (NSAttributedString*)attributedMultiLinePreviewFromBodyText:(NSAttributedString*)bodyText upToWidth:(float)upToWidth intrusionWidth:(float)intWidth; + +@end diff --git a/NSString_CustomTruncation.m b/NSString_CustomTruncation.m new file mode 100644 index 00000000..6bd82cdb --- /dev/null +++ b/NSString_CustomTruncation.m @@ -0,0 +1,212 @@ +// +// NSString_CustomTruncation.m +// Notation +// +// Created by Zachary Schneirov on 1/12/11. + +/*Copyright (c) 2010, Zachary Schneirov. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ + + +#import "NSString_CustomTruncation.h" +#import "GlobalPrefs.h" + +@implementation NSString (CustomTruncation) + +static NSMutableParagraphStyle *LineBreakingStyle(); +static NSDictionary *GrayTextAttributes(); +static NSDictionary *LineTruncAttributes(); +static size_t EstimatedCharCountForWidth(float upToWidth); + + + +- (NSString*)truncatedPreviewStringOfLength:(NSUInteger)bodyCharCount { + + //try to get the underlying C-string buffer and copy only part of it + //this won't be exact because chars != bytes, but that's alright because it is expected to be further truncated by an NSTextFieldCell + CFStringEncoding bodyPreviewEncoding = CFStringGetFastestEncoding((CFStringRef)self); + const char * cStrPtr = CFStringGetCStringPtr((CFStringRef)self, bodyPreviewEncoding); + char *bodyPreviewBuffer = calloc(bodyCharCount + 1, sizeof(char)); + CFIndex usedBufLen = bodyCharCount; + + if (bodyCharCount > 1) { + if (cStrPtr && kCFStringEncodingUTF8 != bodyPreviewEncoding && kCFStringEncodingUnicode != bodyPreviewEncoding) { + //only attempt to copy the buffer directly if the fastest encoding is not a unicode variant + memcpy(bodyPreviewBuffer, cStrPtr, bodyCharCount); + } else { + bodyPreviewEncoding = kCFStringEncodingUTF8; + if ([self length] == bodyCharCount) { + //if this is supposed to be the entire string, don't waffle around + const char *fullUTF8String = [self UTF8String]; + if (fullUTF8String) { + usedBufLen = bodyCharCount = strlen(fullUTF8String); + bodyPreviewBuffer = realloc(bodyPreviewBuffer, bodyCharCount + 1); + memcpy(bodyPreviewBuffer, fullUTF8String, bodyCharCount + 1); + goto replace; + } + } + if (!CFStringGetBytes((CFStringRef)self, CFRangeMake(0, bodyCharCount), bodyPreviewEncoding, ' ', FALSE, + (UInt8 *)bodyPreviewBuffer, bodyCharCount + 1, &usedBufLen)) { + NSLog(@"can't get utf8 string from '%@' (charcount: %u)", self, bodyCharCount); + free(bodyPreviewBuffer); + return nil; + } + } + } +replace: + //if bodyPreviewBuffer is a UTF-8 encoded string, then examine the string one UTF-8 sequence at a time to catch multi-byte breaks + if (bodyPreviewEncoding == kCFStringEncodingUTF8) { + replace_breaks_utf8(bodyPreviewBuffer, bodyCharCount); + } else { + replace_breaks(bodyPreviewBuffer, bodyCharCount); + } + + NSString* truncatedBodyString = [[NSString alloc] initWithBytesNoCopy:bodyPreviewBuffer length:usedBufLen + encoding:CFStringConvertEncodingToNSStringEncoding(bodyPreviewEncoding) freeWhenDone:YES]; + if (!truncatedBodyString) { + free(bodyPreviewBuffer); + NSLog(@"can't create cfstring from '%@' (cstr lens: %u/%d) with encoding %u (fastest = %u)", self, bodyCharCount, usedBufLen, bodyPreviewEncoding, CFStringGetFastestEncoding((CFStringRef)self)); + return nil; + } + return [truncatedBodyString autorelease]; +} + +static NSMutableDictionary *titleTruncAttrs = nil; + +void ResetFontRelatedTableAttributes() { + [titleTruncAttrs release]; + titleTruncAttrs = nil; +} + +static NSMutableParagraphStyle *LineBreakingStyle() { + static NSMutableParagraphStyle *lineBreaksStyle = nil; + if (!lineBreaksStyle) { + lineBreaksStyle = [[NSMutableParagraphStyle alloc] init]; + [lineBreaksStyle setLineBreakMode:NSLineBreakByTruncatingTail]; + [lineBreaksStyle setTighteningFactorForTruncation:0.0]; + } + return lineBreaksStyle; +} + +static NSDictionary *GrayTextAttributes() { + static NSDictionary *grayTextAttributes = nil; + if (!grayTextAttributes) grayTextAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:[NSColor grayColor], NSForegroundColorAttributeName, nil] retain]; + return grayTextAttributes; +} + +static NSDictionary *LineTruncAttributes() { + static NSDictionary *lineTruncAttributes = nil; + if (!lineTruncAttributes) lineTruncAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:LineBreakingStyle(), NSParagraphStyleAttributeName, nil] retain]; + return lineTruncAttributes; +} + +NSDictionary *LineTruncAttributesForTitle() { + if (!titleTruncAttrs) { + GlobalPrefs *prefs = [GlobalPrefs defaultPrefs]; + unsigned int bitmap = [prefs tableColumnsBitmap]; + float fontSize = [prefs tableFontSize]; + BOOL usesBold = ColumnIsSet(NoteLabelsColumn, bitmap) || ColumnIsSet(NoteDateCreatedColumn, bitmap) || + ColumnIsSet(NoteDateModifiedColumn, bitmap) || [prefs tableColumnsShowPreview]; + + titleTruncAttrs = [[NSDictionary dictionaryWithObjectsAndKeys:[[LineBreakingStyle() mutableCopy] autorelease], NSParagraphStyleAttributeName, + (usesBold ? [NSFont boldSystemFontOfSize:fontSize] : [NSFont systemFontOfSize:fontSize]), NSFontAttributeName, nil] retain]; + + if (ColumnIsSet(NoteDateCreatedColumn, bitmap) || ColumnIsSet(NoteDateModifiedColumn, bitmap)) { + //account for right-"aligned" date string, which will be relatively constant, so this can be cached + [[titleTruncAttrs objectForKey:NSParagraphStyleAttributeName] setTailIndent: fontSize * -4.6]; //avg of -55 for ~11-12 font size + } + } + return titleTruncAttrs; +} + +static size_t EstimatedCharCountForWidth(float upToWidth) { + return (size_t)(upToWidth / ([[GlobalPrefs defaultPrefs] tableFontSize] / 2.5f)); +} + +//LineTruncAttributesForTags would be variable, depending on the note; each preview string will have its own copy of the nsdictionary + +- (NSAttributedString*)attributedMultiLinePreviewFromBodyText:(NSAttributedString*)bodyText upToWidth:(float)upToWidth intrusionWidth:(float)intWidth { + //first line is title, truncated to a shorter width to account for date/time, using a negative -[NSMutableParagraphStyle setTailIndent:] value + //next "two" lines are wrapped body text, with a character-count estimation of essentially double that of a single-line preview + //also with an independent tailindent to account for a separately-drawn tags-string, if tags exist + //upToWidth will be used to manually truncate note-bodies only, and should be the full column width available + //intWidth will typically be the width of the tags string or other representation + + size_t bodyCharCount = (EstimatedCharCountForWidth(upToWidth) * 2) - EstimatedCharCountForWidth(intWidth); + bodyCharCount = MIN(bodyCharCount, [bodyText length]); + + NSMutableString *unattributedPreview = [[NSMutableString alloc] initWithCapacity:bodyCharCount + [self length] + 2]; + + NSString *truncatedBodyString = [[bodyText string] truncatedPreviewStringOfLength:bodyCharCount]; + if (!truncatedBodyString) return nil; + + [unattributedPreview appendString:self]; + [unattributedPreview appendString:@"\n"]; + [unattributedPreview appendString:truncatedBodyString]; + + NSMutableAttributedString *attributedStringPreview = [[NSMutableAttributedString alloc] initWithString:unattributedPreview]; + + //title is black (no added colors) and truncated with LineTruncAttributesForTitle() + //body is gray and truncated with a variable tail indent, depending on intruding tags + + NSDictionary *bodyTruncDict = [NSDictionary dictionaryWithObjectsAndKeys:[[LineBreakingStyle() mutableCopy] autorelease], + NSParagraphStyleAttributeName, [NSColor grayColor], NSForegroundColorAttributeName, nil]; + //set word-wrapping to let -[NSCell setTruncatesLastVisibleLine:] work + [[bodyTruncDict objectForKey:NSParagraphStyleAttributeName] setLineBreakMode:NSLineBreakByWordWrapping]; + + if (intWidth > 0.0) { + //there are tags; add an appropriately-sized tail indent to the body + [[bodyTruncDict objectForKey:NSParagraphStyleAttributeName] setTailIndent:-intWidth]; + } + + [attributedStringPreview addAttributes:LineTruncAttributesForTitle() range:NSMakeRange(0, [self length])]; + [attributedStringPreview addAttributes:bodyTruncDict range:NSMakeRange([self length] + 1, [unattributedPreview length] - ([self length] + 1))]; + + [unattributedPreview release]; + + return [attributedStringPreview autorelease]; +} + +- (NSAttributedString*)attributedSingleLineTitle { + //show only a single line, with a tail indent large enough for both the date and tags (if there are any) + //because this method displays the title only, manual truncation isn't really necessary + //the highlighted version of this string should be bolded + + NSMutableAttributedString *titleStr = [[NSMutableAttributedString alloc] initWithString:self attributes:LineTruncAttributesForTitle()]; + + return [titleStr autorelease]; +} + + +- (NSAttributedString*)attributedSingleLinePreviewFromBodyText:(NSAttributedString*)bodyText upToWidth:(float)upToWidth { + + //compute the char count for this note based on the width of the title column and the length of the receiver + size_t bodyCharCount = EstimatedCharCountForWidth(upToWidth) - [self length]; + bodyCharCount = MIN(bodyCharCount, [bodyText length]); + + NSString *truncatedBodyString = [[bodyText string] truncatedPreviewStringOfLength:bodyCharCount]; + if (!truncatedBodyString) return nil; + + NSMutableString *unattributedPreview = [self mutableCopy]; + NSString *delimiter = NSLocalizedString(@" option-shift-dash ", @"title/description delimiter"); + [unattributedPreview appendString:delimiter]; + [unattributedPreview appendString:truncatedBodyString]; + + NSMutableAttributedString *attributedStringPreview = [[NSMutableAttributedString alloc] initWithString:unattributedPreview attributes:LineTruncAttributes()]; + [attributedStringPreview addAttributes:GrayTextAttributes() range:NSMakeRange([self length], [unattributedPreview length] - [self length])]; + + [unattributedPreview release]; + + return [attributedStringPreview autorelease]; +} + + +@end diff --git a/NSString_Markdown.m b/NSString_Markdown.m index 5743a58c..fa42625a 100755 --- a/NSString_Markdown.m +++ b/NSString_Markdown.m @@ -4,6 +4,7 @@ // #import "NSString_Markdown.h" +#import "NoteObject.h" @implementation NSString (Markdown) @@ -40,4 +41,4 @@ + (NSString*)stringWithProcessedMarkdown:(NSString*)inputString return outputString; } -@end \ No newline at end of file +@end diff --git a/NSString_MultiMarkdown.m b/NSString_MultiMarkdown.m index bef6ff6d..77e563e1 100755 --- a/NSString_MultiMarkdown.m +++ b/NSString_MultiMarkdown.m @@ -8,6 +8,7 @@ #import "NSString_MultiMarkdown.h" #import "PreviewController.h" #import "AppController.h" +#import "NoteObject.h" @implementation NSString (MultiMarkdown) @@ -22,28 +23,15 @@ @implementation NSString (MultiMarkdown) */ +(NSString*)mmdDirectory { // fallback path in this program's directiory - NSString *bundlePath = [[[[[NSBundle mainBundle] resourcePath] + NSString *bundlePath = [[[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"MultiMarkdown"] - stringByAppendingPathComponent:@"bin"] - stringByAppendingPathComponent:@"mmd2ZettelXHTML.pl"]; - - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); - - if ([paths count] > 0) { - NSString *path = [[[paths objectAtIndex:0] - stringByAppendingPathComponent:@"MultiMarkdown"] - stringByAppendingPathComponent:@"bin"]; - NSFileManager *mgr = [NSFileManager defaultManager]; - NSString *mmdZettel = [path stringByAppendingPathComponent:@"mmd2ZettelXHTML.pl"]; - NSString *mmdDefault = [path stringByAppendingPathComponent:@"mmd2XHTML.pl"]; - - if ([mgr fileExistsAtPath:mmdZettel]) { - return mmdZettel; - } else if ([mgr fileExistsAtPath:mmdDefault]) { - return mmdDefault; - } - } - + stringByAppendingPathComponent:@"bin"] + stringByAppendingPathComponent:@"mmd2XHTML.pl"]; + NSString *mmd3 = [NSString stringWithString:@"/usr/local/bin/multimarkdown"]; + NSFileManager *mgr = [NSFileManager defaultManager]; + if ([mgr fileExistsAtPath:mmd3]) { + return mmd3; + } return bundlePath; } // mmdDirectory @@ -82,34 +70,37 @@ +(NSString*)processMultiMarkdown:(NSString*)inputString +(NSString*)documentWithProcessedMultiMarkdown:(NSString*)inputString { - AppController *app = [[NSApplication sharedApplication] delegate]; - NSString *rawString = [@"format: snippet\n\n" stringByAppendingString:inputString]; - NSString *processedString = [self processMultiMarkdown:rawString]; - NSString *htmlString = [[PreviewController class] html]; - NSString *cssString = [[PreviewController class] css]; - NSMutableString *outputString = [NSMutableString stringWithString:(NSString *)htmlString]; - NSString *noteTitle = ([app selectedNoteObject]) ? [NSString stringWithFormat:@"%@",titleOfNote([app selectedNoteObject])] : @""; - - NSString *nvSupportPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/Notational Velocity"]; - [outputString replaceOccurrencesOfString:@"{%support%}" withString:nvSupportPath options:0 range:NSMakeRange(0, [outputString length])]; - [outputString replaceOccurrencesOfString:@"{%title%}" withString:noteTitle options:0 range:NSMakeRange(0, [outputString length])]; - [outputString replaceOccurrencesOfString:@"{%content%}" withString:processedString options:0 range:NSMakeRange(0, [outputString length])]; - [outputString replaceOccurrencesOfString:@"{%style%}" withString:cssString options:0 range:NSMakeRange(0, [outputString length])]; - - return outputString; + AppController *app = [[NSApplication sharedApplication] delegate]; + if (![[[self class] mmdDirectory] hasPrefix:@"/usr/local/bin"]) + inputString = [@"Format: Snippet\n\n" stringByAppendingString:inputString]; + NSString *processedString = [self processMultiMarkdown:inputString]; + NSString *htmlString = [[PreviewController class] html]; + NSString *cssString = [[PreviewController class] css]; + NSMutableString *outputString = [NSMutableString stringWithString:(NSString *)htmlString]; + NSString *noteTitle = ([app selectedNoteObject]) ? [NSString stringWithFormat:@"%@",titleOfNote([app selectedNoteObject])] : @""; + NSString *nvSupportPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/Notational Velocity"]; + [outputString replaceOccurrencesOfString:@"{%support%}" withString:nvSupportPath options:0 range:NSMakeRange(0, [outputString length])]; + [outputString replaceOccurrencesOfString:@"{%title%}" withString:noteTitle options:0 range:NSMakeRange(0, [outputString length])]; + [outputString replaceOccurrencesOfString:@"{%content%}" withString:processedString options:0 range:NSMakeRange(0, [outputString length])]; + [outputString replaceOccurrencesOfString:@"{%style%}" withString:cssString options:0 range:NSMakeRange(0, [outputString length])]; + return outputString; } +(NSString*)xhtmlWithProcessedMultiMarkdown:(NSString*)inputString { AppController *app = [[NSApplication sharedApplication] delegate]; NSString *noteTitle = ([app selectedNoteObject]) ? [NSString stringWithFormat:@"%@",titleOfNote([app selectedNoteObject])] : @""; - inputString = [[NSString stringWithFormat:@"format: complete\ntitle: %@\n\n",noteTitle] stringByAppendingString:inputString]; + if (![[[self class] mmdDirectory] hasPrefix:@"/usr/local/bin"]) { + inputString = [@"Format: Snippet\n\n" stringByAppendingString:inputString]; +// inputString = [[NSString stringWithFormat:@"Title: %@\n\n",noteTitle] stringByAppendingString:inputString]; + } return [self processMultiMarkdown:inputString]; } +(NSString*)stringWithProcessedMultiMarkdown:(NSString*)inputString { - inputString = [@"format: snippet\n\n" stringByAppendingString:inputString]; + if (![[[self class] mmdDirectory] hasPrefix:@"/usr/local/bin"]) + inputString = [@"Format: Snippet\n\n" stringByAppendingString:inputString]; return [self processMultiMarkdown:inputString]; } // stringWithProcessedMultiMarkdown: diff --git a/NSString_NV.h b/NSString_NV.h index 29627d8e..7afbdf5b 100755 --- a/NSString_NV.h +++ b/NSString_NV.h @@ -22,7 +22,6 @@ unsigned int hoursFromAbsoluteTime(CFAbsoluteTime absTime); void resetCurrentDayTime(); -- (NSMutableSet*)labelSetFromWordsAndContainingNote:(NoteObject*)note; + (NSString*)relativeTimeStringWithDate:(CFDateRef)date relativeDay:(int)day; + (NSString*)relativeDateStringWithAbsoluteTime:(CFAbsoluteTime)absTime; CFDateFormatterRef simplenoteDateFormatter(int lowPrecision); @@ -35,13 +34,13 @@ CFDateFormatterRef simplenoteDateFormatter(int lowPrecision); #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 - (NSString*)stringByReplacingOccurrencesOfString:(NSString*)stringToReplace withString:(NSString*)replacementString; #endif -+ (NSString*)pathCopiedFromAliasData:(NSData*)aliasData; - (NSString*)fourCharTypeString; +- (BOOL)isAMachineDirective; - (void)copyItemToPasteboard:(id)sender; -- (NSURL*)linkForWord; -- (NSString*)syntheticTitleAndSeparatorWithContext:(NSString**)sepStr bodyLoc:(NSUInteger*)bodyLoc oldTitle:(NSString*)oldTitle; +- (NSString*)syntheticTitleAndSeparatorWithContext:(NSString**)sepStr bodyLoc:(NSUInteger*)bodyLoc maxTitleLen:(NSUInteger)maxTitleLen; +- (NSString*)syntheticTitleAndSeparatorWithContext:(NSString**)sepStr bodyLoc:(NSUInteger*)bodyLoc + oldTitle:(NSString*)oldTitle maxTitleLen:(NSUInteger)maxTitleLen; - (NSString*)syntheticTitleAndTrimmedBody:(NSString**)newBody; -- (NSAttributedString*)attributedPreviewFromBodyText:(NSAttributedString*)bodyText upToWidth:(float)width; + (NSString *)tabbifiedStringWithNumberOfSpaces:(unsigned)origNumSpaces tabWidth:(unsigned)tabWidth usesTabs:(BOOL)usesTabs; - (unsigned)numberOfLeadingSpacesFromRange:(NSRange*)range tabWidth:(unsigned)tabWidth; @@ -51,17 +50,19 @@ CFDateFormatterRef simplenoteDateFormatter(int lowPrecision); - (const char*)lowercaseUTF8String; - (NSString*)stringWithPercentEscapes; - (NSString *)stringByReplacingPercentEscapes; +- (BOOL)superficiallyResemblesAnHTTPURL; + (NSString*)reasonStringFromCarbonFSError:(OSStatus)err; -+ (NSString*)pathWithFSRef:(FSRef*)fsRef; -- (BOOL)UTIOfFileConformsToType:(NSString*)type; +- (NSArray*)labelCompatibleWords; -+ (BOOL)setTextEncodingAttribute:(NSStringEncoding)encoding atFSPath:(const char*)path; -+ (NSStringEncoding)textEncodingAttributeOfFSPath:(const char*)path; +- (BOOL)UTIOfFileConformsToType:(NSString*)type; - (CFUUIDBytes)uuidBytes; + (NSString*)uuidStringWithBytes:(CFUUIDBytes)bytes; +- (NSData *)decodeBase64; +- (NSData *)decodeBase64WithNewlines:(BOOL)encodedWithNewlines; + //- (NSTextView*)textViewWithFrame:(NSRect*)theFrame; @end @@ -77,6 +78,18 @@ CFDateFormatterRef simplenoteDateFormatter(int lowPrecision); - (void)scanContextualSeparator:(NSString**)sepStr withPrecedingString:(NSString*)firstLine; @end +@interface NSCharacterSet (NV) + ++ (NSCharacterSet*)labelSeparatorCharacterSet; ++ (NSCharacterSet*)listBulletsCharacterSet; + +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 ++ (id)newlineCharacterSet; +#endif + +@end + + @interface NSEvent (NV) - (unichar)firstCharacter; - (unichar)firstCharacterIgnoringModifiers; diff --git a/NSString_NV.m b/NSString_NV.m index 2a68a57d..85e4c200 100755 --- a/NSString_NV.m +++ b/NSString_NV.m @@ -17,6 +17,7 @@ #import "NSString_NV.h" #import "NSData_transformations.h" +#import "NSFileManager_NV.h" #import "NoteObject.h" #import "GlobalPrefs.h" #import "LabelObject.h" @@ -25,33 +26,13 @@ @implementation NSString (NV) static int dayFromAbsoluteTime(CFAbsoluteTime absTime); -- (NSMutableSet*)labelSetFromWordsAndContainingNote:(NoteObject*)note { - - NSArray *words = [self componentsSeparatedByString:@","]; - NSMutableSet *labelSet = [NSMutableSet setWithCapacity:[words count]]; - - unsigned int i; - for (i=0; i<[words count]; i++) { - NSString *aWord = [words objectAtIndex:i]; - - if ([aWord length] > 0) { - LabelObject *aLabel = [[LabelObject alloc] initWithTitle:aWord]; - [aLabel addNote:note]; - - [labelSet addObject:aLabel]; - [aLabel autorelease]; - } - } - - return labelSet; -} - enum {NoSpecialDay = -1, ThisDay = 0, NextDay = 1, PriorDay = 2}; static const double dayInSeconds = 86400.0; static CFTimeInterval secondsAfterGMT = 0.0; static int currentDay = 0; static CFMutableDictionaryRef dateStringsCache = NULL; +static CFDateFormatterRef dateAndTimeFormatter = NULL; unsigned int hoursFromAbsoluteTime(CFAbsoluteTime absTime) { return (unsigned int)floor(absTime / 3600.0); @@ -68,6 +49,11 @@ void resetCurrentDayTime() { if (dateStringsCache) CFDictionaryRemoveAllValues(dateStringsCache); + + if (dateAndTimeFormatter) { + CFRelease(dateAndTimeFormatter); + dateAndTimeFormatter = NULL; + } CFRelease(timeZone); } @@ -94,7 +80,7 @@ + (NSString*)relativeTimeStringWithDate:(CFDateRef)date relativeDay:(int)day { static NSString *days[3] = { NULL }; if (!timeOnlyFormatter) { - timeOnlyFormatter = CFDateFormatterCreate(kCFAllocatorDefault, CFLocaleCopyCurrent(), kCFDateFormatterNoStyle, kCFDateFormatterShortStyle); + timeOnlyFormatter = CFDateFormatterCreate(kCFAllocatorDefault, CFLocaleCopyCurrent(), kCFDateFormatterNoStyle, kCFDateFormatterShortStyle); } if (!days[ThisDay]) { @@ -104,6 +90,13 @@ + (NSString*)relativeTimeStringWithDate:(CFDateRef)date relativeDay:(int)day { } CFStringRef dateString = CFDateFormatterCreateStringWithDate(kCFAllocatorDefault, timeOnlyFormatter, date); + + if ([[GlobalPrefs defaultPrefs] horizontalLayout]) { + //if today, return the time only; otherwise say "Yesterday", etc.; and this method shouldn't be called unless day != NoSpecialDay + if (day == PriorDay || day == NextDay) + return days[day]; + return [(id)dateString autorelease]; + } NSString *relativeTimeString = [days[day] stringByAppendingFormat:@" %@", dateString]; CFRelease(dateString); @@ -111,8 +104,6 @@ + (NSString*)relativeTimeStringWithDate:(CFDateRef)date relativeDay:(int)day { return relativeTimeString; } -int uncachedDateCount = 0; - //take into account yesterday/today thing //this method _will_ affect application launch time + (NSString*)relativeDateStringWithAbsoluteTime:(CFAbsoluteTime)absTime { @@ -126,24 +117,24 @@ + (NSString*)relativeDateStringWithAbsoluteTime:(CFAbsoluteTime)absTime { NSString *dateString = (NSString*)CFDictionaryGetValue(dateStringsCache, (const void *)minutesCount); if (!dateString) { - static CFDateFormatterRef formatter = nil; - if (!formatter) { - formatter = CFDateFormatterCreate(kCFAllocatorDefault, CFLocaleCopyCurrent(), kCFDateFormatterMediumStyle, kCFDateFormatterShortStyle); + int day = dayFromAbsoluteTime(absTime); + + if (!dateAndTimeFormatter) { + BOOL horiz = [[GlobalPrefs defaultPrefs] horizontalLayout]; + dateAndTimeFormatter = CFDateFormatterCreate(kCFAllocatorDefault, CFLocaleCopyCurrent(), + horiz ? kCFDateFormatterShortStyle : kCFDateFormatterMediumStyle, + horiz ? kCFDateFormatterNoStyle : kCFDateFormatterShortStyle); } CFDateRef date = CFDateCreate(kCFAllocatorDefault, absTime); - - int day = dayFromAbsoluteTime(absTime); if (day == NoSpecialDay) { - dateString = [(NSString*)CFDateFormatterCreateStringWithDate(kCFAllocatorDefault, formatter, date) autorelease]; + dateString = [(NSString*)CFDateFormatterCreateStringWithDate(kCFAllocatorDefault, dateAndTimeFormatter, date) autorelease]; } else { dateString = [NSString relativeTimeStringWithDate:date relativeDay:day]; } CFRelease(date); - - uncachedDateCount++; //ints as pointers ints as pointers ints as pointers CFDictionarySetValue(dateStringsCache, (const void *)minutesCount, (const void *)dateString); @@ -188,18 +179,24 @@ - (CFAbsoluteTime)absoluteTimeFromSimplenoteDate { return absTime; } -+ (NSString*)pathCopiedFromAliasData:(NSData*)aliasData { - AliasHandle inAlias; - CFStringRef path = NULL; - FSAliasInfoBitmap whichInfo = kFSAliasInfoNone; - FSAliasInfo info; - if (aliasData && PtrToHand([aliasData bytes], (Handle*)&inAlias, [aliasData length]) == noErr && - FSCopyAliasInfo(inAlias, NULL, NULL, &path, &whichInfo, &info) == noErr) { - //this method doesn't always seem to work - return [(NSString*)path autorelease]; - } - - return nil; +- (NSArray*)labelCompatibleWords { + NSArray *array = nil; + if (IsLeopardOrLater) { + array = [self componentsSeparatedByCharactersInSet:[NSCharacterSet labelSeparatorCharacterSet]]; + } else { + BOOL lacksSpace = [self rangeOfString:@" " options:NSLiteralSearch].location == NSNotFound; + array = [self componentsSeparatedByString: lacksSpace ? @"," : @" "]; + } + NSMutableArray *titles = [NSMutableArray arrayWithCapacity:[array count]]; + + NSUInteger i; + for (i=0; i<[array count]; i++) { + NSString *aWord = [array objectAtIndex:i]; + if ([aWord length] > 0) { + [titles addObject:aWord]; + } + } + return titles; } - (CFArrayRef)copyRangesOfWordsInString:(NSString*)findString inRange:(NSRange)limitRange { @@ -253,6 +250,13 @@ - (NSString*)filenameExpectingAdditionalCharCount:(int)charCount { return newfilename; } +- (BOOL)isAMachineDirective { + return [self hasPrefix:@"#!"] || [self hasPrefix:@"#import "] || [self hasPrefix:@"#include "] || + [self hasPrefix:@"= 5 && protocolSpecLoc != NSNotFound && protocolSpecLoc > 0) { - NSURL *anurl = [NSURL URLWithString:self]; - //File Reference URLs cannot be safely archived! - if ([anurl isFileURL] && [self rangeOfString:@"/.file/" options:NSLiteralSearch].location != NSNotFound) return nil; - return anurl; - } - - if (length >= 12 && [self rangeOfString:@"mailto:" options:NSAnchoredSearch | NSLiteralSearch].location != NSNotFound) - return [NSURL URLWithString:self]; - - if (length >= 5 && [self rangeOfString:@"www." options:NSAnchoredSearch | NSCaseInsensitiveSearch range:NSMakeRange(0, length)].location != NSNotFound) { - //if string starts with www., and is long enough to contain one other character, prefix URL with http:// - return [NSURL URLWithString:[@"http://" stringByAppendingString:self]]; - } - - if (length >= 5) { - NSUInteger atSignLoc = [self rangeOfString:@"@" options:NSLiteralSearch].location; - if (atSignLoc != NSNotFound && atSignLoc > 0) { - //if we contain an @, but do not start with one, and have a period somewhere after the @ but not at the end, then make it an email address - - NSUInteger periodLoc = [self rangeOfString:@"." options:NSLiteralSearch range:NSMakeRange(atSignLoc, length - atSignLoc)].location; - if (periodLoc != NSNotFound && periodLoc > atSignLoc + 1 && periodLoc != length - 1) { - - //make sure it's not some kind of SCP or CVS path - if ([self rangeOfString:@":/" options:NSLiteralSearch].location == NSNotFound) - return [NSURL URLWithString:[@"mailto:" stringByAppendingString:self]]; - } - } - } +- (void)copyItemToPasteboard:(id)sender { - return nil; + NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; + [pasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; + [pasteboard setString:[sender isKindOfClass:[NSMenuItem class]] ? [sender representedObject] : self + forType:NSStringPboardType]; } -#define MAX_TITLE_LEN 60 -- (NSString*)syntheticTitleAndSeparatorWithContext:(NSString**)sepStr bodyLoc:(NSUInteger*)bodyLoc oldTitle:(NSString*)oldTitle { +- (NSString*)syntheticTitleAndSeparatorWithContext:(NSString**)sepStr bodyLoc:(NSUInteger*)bodyLoc maxTitleLen:(NSUInteger)maxTitleLen { + return [self syntheticTitleAndSeparatorWithContext:sepStr bodyLoc:bodyLoc oldTitle:nil maxTitleLen:maxTitleLen]; +} + +- (NSString*)syntheticTitleAndSeparatorWithContext:(NSString**)sepStr bodyLoc:(NSUInteger*)bodyLoc + oldTitle:(NSString*)oldTitle maxTitleLen:(NSUInteger)maxTitleLen { //break string into pieces for turning into a note //find the first line, whitespace or no whitespace - NSCharacterSet *titleDelimiters = [NSCharacterSet characterSetWithCharactersInString:@"\n\r\t"]; + NSCharacterSet *titleDelimiters = [NSCharacterSet characterSetWithCharactersInString: + [NSString stringWithFormat:@"\n\r\t%C%C", NSLineSeparatorCharacter, NSParagraphSeparatorCharacter]]; + NSScanner *scanner = [NSScanner scannerWithString:self]; [scanner setCharactersToBeSkipped:[[[NSMutableCharacterSet alloc] init] autorelease]]; //skip any blank space before the title; this will not be preserved for round-tripped syncing BOOL didSkipInitialWS = [scanner scanCharactersFromSet:[NSCharacterSet whitespaceAndNewlineCharacterSet] intoString:NULL]; - if ([oldTitle length] > MAX_TITLE_LEN) { + if ([oldTitle length] > maxTitleLen) { //break apart the string based on an existing title (if it still matches) that would have been longer than our default truncation limit NSString *contentStartStr = didSkipInitialWS && [scanner scanLocation] < [self length] ? [self substringFromIndex:[scanner scanLocation]] : self; @@ -352,12 +329,12 @@ - (NSString*)syntheticTitleAndSeparatorWithContext:(NSString**)sepStr bodyLoc:(N NSString *firstLine = nil; [scanner scanUpToCharactersFromSet:titleDelimiters intoString:&firstLine]; - if ([firstLine length] > MAX_TITLE_LEN) { + if ([firstLine length] > maxTitleLen) { //what if this title is too long? then we need to break it up and start the body after that NSRange lastSpaceInFirstLine = [firstLine rangeOfString:@" " options: NSBackwardsSearch | NSLiteralSearch - range:NSMakeRange(MAX_TITLE_LEN - 10, 10)]; + range:NSMakeRange(maxTitleLen - 10, 10)]; if (lastSpaceInFirstLine.location == NSNotFound) { - lastSpaceInFirstLine.location = MAX_TITLE_LEN; + lastSpaceInFirstLine.location = maxTitleLen; } [scanner setScanLocation:[scanner scanLocation] - ([firstLine length] - lastSpaceInFirstLine.location)]; firstLine = [firstLine substringToIndex:lastSpaceInFirstLine.location]; @@ -376,108 +353,11 @@ - (NSString*)syntheticTitleAndSeparatorWithContext:(NSString**)sepStr bodyLoc:(N - (NSString*)syntheticTitleAndTrimmedBody:(NSString**)newBody { NSUInteger bodyLoc = 0; - NSString *title = [self syntheticTitleAndSeparatorWithContext:NULL bodyLoc:&bodyLoc oldTitle:nil]; + NSString *title = [self syntheticTitleAndSeparatorWithContext:NULL bodyLoc:&bodyLoc maxTitleLen:60]; if (newBody) *newBody = [self substringFromIndex:bodyLoc]; return title; } -- (NSAttributedString*)attributedPreviewFromBodyText:(NSAttributedString*)bodyText upToWidth:(float)upToWidth { - //NSLog(@"gen prev for %@", [[bodyText string] substringToIndex:MIN([bodyText length], 10U)]); - - NSColor *backgroundColor = [[GlobalPrefs defaultPrefs] notesListBackgroundColor]; - NSColor *fontColor = [backgroundColor blendedColorWithFraction:0.5f ofColor:[NSColor colorWithCalibratedWhite:0.75 alpha:1.00f]]; - - CGFloat fWhite; - CGFloat fAlpha; - CGFloat endWhite; - NSColor *gBack = [backgroundColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace]; - [gBack getWhite:&fWhite alpha:&fAlpha]; - if (fWhite < 0.5) { - endWhite = fWhite + 0.5f; - fontColor = [backgroundColor blendedColorWithFraction:0.5f ofColor:[NSColor colorWithCalibratedWhite:endWhite alpha:0.70f]]; - } else { - endWhite = fWhite - 0.75f; - fontColor = [backgroundColor blendedColorWithFraction:0.5f ofColor:[NSColor colorWithCalibratedWhite:endWhite alpha:0.75f]]; - } - - static NSMutableParagraphStyle *lineBreaksStyle = nil; - static NSDictionary *grayTextAttributes = nil; - static NSDictionary *lineTruncAttributes = nil; - if (!grayTextAttributes) { - lineBreaksStyle = [[NSMutableParagraphStyle alloc] init]; - [lineBreaksStyle setLineBreakMode:NSLineBreakByTruncatingTail]; - - grayTextAttributes = [[NSDictionary dictionaryWithObjectsAndKeys: - fontColor, NSForegroundColorAttributeName, nil] retain]; - lineTruncAttributes = [[NSDictionary dictionaryWithObjectsAndKeys: - lineBreaksStyle, NSParagraphStyleAttributeName, nil] retain]; - } - - NSString *bodyString = [bodyText string]; - - //compute the char count for this note based on the width of the title column and the length of the receiver - size_t expectedCharCountToFitInWidth = (size_t)(upToWidth / ([[GlobalPrefs defaultPrefs] tableFontSize] / 2.5f)); - size_t bodyCharCount = expectedCharCountToFitInWidth - [self length]; - - bodyCharCount = MIN(bodyCharCount, [bodyString length]); - - - //try to get the underlying C-string buffer by copying only part of it - //this won't be exact because chars != bytes, but that's alright because it is expected to be further truncated by an NSTextFieldCell - CFStringEncoding bodyPreviewEncoding = CFStringGetFastestEncoding((CFStringRef)bodyString); - const char * cStrPtr = CFStringGetCStringPtr((CFStringRef)bodyString, bodyPreviewEncoding); - char *bodyPreviewBuffer = calloc(bodyCharCount + 1, sizeof(char)); - CFIndex usedBufLen = bodyCharCount; - - if (bodyCharCount > 1) { - if (cStrPtr && kCFStringEncodingUTF8 != bodyPreviewEncoding && kCFStringEncodingUnicode != bodyPreviewEncoding) { - //only attempt to copy the buffer directly if the fastest encoding is not a unicode variant - memcpy(bodyPreviewBuffer, cStrPtr, bodyCharCount); - } else { - bodyPreviewEncoding = kCFStringEncodingUTF8; - if ([bodyString length] == bodyCharCount) { - //if this is supposed to be the entire string, don't waffle around - const char *fullUTF8String = [bodyString UTF8String]; - if (fullUTF8String) { - usedBufLen = bodyCharCount = strlen(fullUTF8String); - bodyPreviewBuffer = realloc(bodyPreviewBuffer, bodyCharCount + 1); - memcpy(bodyPreviewBuffer, fullUTF8String, bodyCharCount + 1); - goto replace; - } - } - if (!CFStringGetBytes((CFStringRef)bodyString, CFRangeMake(0, bodyCharCount), bodyPreviewEncoding, ' ', FALSE, - (UInt8 *)bodyPreviewBuffer, bodyCharCount + 1, &usedBufLen)) { - NSLog(@"can't get utf8 string from note %@ (charcount: %u)", self, bodyCharCount); - free(bodyPreviewBuffer); - return nil; - } - } - } -replace: - replace_breaks(bodyPreviewBuffer, bodyCharCount); - NSString* truncatedBodyString = [[NSString alloc] initWithBytesNoCopy:bodyPreviewBuffer length:usedBufLen - encoding:CFStringConvertEncodingToNSStringEncoding(bodyPreviewEncoding) freeWhenDone:YES]; - if (!truncatedBodyString) { - free(bodyPreviewBuffer); - NSLog(@"can't create cfstring from %@ (cstr: %s/%u/%d) with encoding %u (fastest = %u)", self, bodyPreviewBuffer, bodyCharCount, usedBufLen, bodyPreviewEncoding, CFStringGetFastestEncoding((CFStringRef)bodyString)); - return nil; - } - - NSMutableString *unattributedPreview = [self mutableCopy]; - NSString *delimiter = NSLocalizedString(@" option-shift-dash ", @"title/description delimiter"); - [unattributedPreview appendString:delimiter]; - [unattributedPreview appendString:truncatedBodyString]; - - [truncatedBodyString release]; - - NSMutableAttributedString *attributedStringPreview = [[NSMutableAttributedString alloc] initWithString:unattributedPreview attributes:lineTruncAttributes]; - [attributedStringPreview addAttributes:grayTextAttributes range:NSMakeRange([self length], [unattributedPreview length] - [self length])]; - - [unattributedPreview release]; - - return [attributedStringPreview autorelease]; -} - //the following three methods + function come courtesy of Mike Ferris' TextExtras + (NSString *)tabbifiedStringWithNumberOfSpaces:(unsigned)origNumSpaces tabWidth:(unsigned)tabWidth usesTabs:(BOOL)usesTabs { static NSMutableString *sharedString = nil; @@ -630,20 +510,6 @@ + (NSString*)reasonStringFromCarbonFSError:(OSStatus)err { return reason; } -+ (NSString*)pathWithFSRef:(FSRef*)fsRef { - NSString *path = nil; - - const UInt32 maxPathSize = 8 * 1024; - UInt8 *convertedPath = (UInt8*)malloc(maxPathSize * sizeof(UInt8)); - if (FSRefMakePath(fsRef, convertedPath, maxPathSize) == noErr) { - path = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:(char*)convertedPath length:strlen((char*)convertedPath)]; - } - free(convertedPath); - - return path; -} - - - (BOOL)UTIOfFileConformsToType:(NSString*)type { CFStringRef fileUTI = NULL; @@ -660,62 +526,6 @@ - (BOOL)UTIOfFileConformsToType:(NSString*)type { return NO; } -//TODO: use volumeCapabilities in FSExchangeObjectsCompat.c to skip some work on volumes for which we know we would receive ENOTSUP -//for +setTextEncodingAttribute:atFSPath: and +textEncodingAttributeOfFSPath: (test against VOL_CAP_INT_EXTENDED_ATTR) - -+ (BOOL)setTextEncodingAttribute:(NSStringEncoding)encoding atFSPath:(const char*)path { - if (!path) return NO; - - CFStringEncoding cfStringEncoding = CFStringConvertNSStringEncodingToEncoding(encoding); - if (cfStringEncoding == kCFStringEncodingInvalidId) { - NSLog(@"%s: encoding %lu is invalid!", _cmd, encoding); - return NO; - } - NSString *textEncStr = [(NSString *)CFStringConvertEncodingToIANACharSetName(cfStringEncoding) stringByAppendingFormat:@";%@", - [[NSNumber numberWithInt:cfStringEncoding] stringValue]]; - const char *textEncUTF8Str = [textEncStr UTF8String]; - - if (setxattr(path, "com.apple.TextEncoding", textEncUTF8Str, strlen(textEncUTF8Str), 0, 0) < 0) { - NSLog(@"couldn't set text encoding attribute of %s to '%s': %d", path, textEncUTF8Str, errno); - return NO; - } - return YES; -} - -+ (NSStringEncoding)textEncodingAttributeOfFSPath:(const char*)path { - if (!path) goto errorReturn; - - //We could query the size of the attribute, but that would require a second system call - //and the value for this key shouldn't need to be anywhere near this large, anyway. - //It could be, but it probably won't. If it is, then we won't get the encoding. Too bad. - char xattrValueBytes[128] = { 0 }; - if (getxattr(path, "com.apple.TextEncoding", xattrValueBytes, sizeof(xattrValueBytes), 0, 0) < 0) { - if (ENOATTR != errno) NSLog(@"couldn't get text encoding attribute of %s: %d", path, errno); - goto errorReturn; - } - NSString *encodingStr = [NSString stringWithUTF8String:xattrValueBytes]; - if (!encodingStr) { - NSLog(@"couldn't make attribute data from %s into a string", path); - goto errorReturn; - } - NSArray *segs = [encodingStr componentsSeparatedByString:@";"]; - - if ([segs count] >= 2 && [(NSString*)[segs objectAtIndex:1] length] > 1) { - return CFStringConvertEncodingToNSStringEncoding([[segs objectAtIndex:1] intValue]); - } else if ([(NSString*)[segs objectAtIndex:0] length] > 1) { - CFStringEncoding theCFEncoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)[segs objectAtIndex:0]); - if (theCFEncoding == kCFStringEncodingInvalidId) { - NSLog(@"couldn't convert IANA charset"); - goto errorReturn; - } - return CFStringConvertEncodingToNSStringEncoding(theCFEncoding); - } - -errorReturn: - return 0; -} - - - (CFUUIDBytes)uuidBytes { CFUUIDBytes bytes = {0}; CFUUIDRef uuidRef = CFUUIDCreateFromString(NULL, (CFStringRef)self); @@ -739,6 +549,33 @@ + (NSString*)uuidStringWithBytes:(CFUUIDBytes)bytes { return [(NSString*)uuidString autorelease]; } + +- (NSData *)decodeBase64 { + return [self decodeBase64WithNewlines:YES]; +} + +- (NSData *)decodeBase64WithNewlines:(BOOL)encodedWithNewlines { + // Create a memory buffer containing Base64 encoded string data + BIO * mem = BIO_new_mem_buf((void *) [self UTF8String], strlen([self UTF8String])); + + // Push a Base64 filter so that reading from the buffer decodes it + BIO * b64 = BIO_new(BIO_f_base64()); + if (!encodedWithNewlines) + BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); + mem = BIO_push(b64, mem); + + // Decode into an NSMutableData + NSMutableData * data = [NSMutableData data]; + char inbuf[512]; + int inlen; + while ((inlen = BIO_read(mem, inbuf, sizeof(inbuf))) > 0) + [data appendBytes: inbuf length: inlen]; + + // Clean up and go home + BIO_free_all(mem); + return data; +} + @end @@ -809,9 +646,9 @@ + (NSMutableString*)newShortLivedStringFromData:(NSMutableData*)data ofGuessedEn if (!aPath && fsRef && !IsZeros(fsRef, sizeof(FSRef))) { NSMutableData *pathData = [NSMutableData dataWithLength:4 * 1024]; if (FSRefMakePath(fsRef, [pathData mutableBytes], [pathData length]) == noErr) - extendedAttrsEncoding = [NSString textEncodingAttributeOfFSPath:[pathData bytes]]; + extendedAttrsEncoding = [[NSFileManager defaultManager] textEncodingAttributeOfFSPath:[pathData bytes]]; } else if (aPath) { - extendedAttrsEncoding = [NSString textEncodingAttributeOfFSPath:aPath]; + extendedAttrsEncoding = [[NSFileManager defaultManager] textEncodingAttributeOfFSPath:aPath]; } if (extendedAttrsEncoding) AddIfUnique(extendedAttrsEncoding); } @@ -874,6 +711,36 @@ - (void)scanContextualSeparator:(NSString**)sepStr withPrecedingString:(NSString @end +@implementation NSCharacterSet (NV) + ++ (NSCharacterSet*)labelSeparatorCharacterSet { + static NSMutableCharacterSet *charSet = nil; + if (!charSet) { + charSet = [[NSMutableCharacterSet whitespaceCharacterSet] retain]; + [charSet formUnionWithCharacterSet:[NSCharacterSet characterSetWithCharactersInString:@",;"]]; + } + + return charSet; +} + ++ (NSCharacterSet*)listBulletsCharacterSet { + static NSCharacterSet *charSet = nil; + if (!charSet) { + charSet = [[NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"-+*!%C%C%C", 0x2022, 0x2014, 0x2013]] retain]; + } + + return charSet; + +} + +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 ++ (id)newlineCharacterSet { + return [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"%C%C%C",0x000A,0x000D,0x0085]]; +} +#endif + +@end + @implementation NSEvent (NV) diff --git a/NSString_Textile.m b/NSString_Textile.m index 9322ddf4..3a33fd03 100755 --- a/NSString_Textile.m +++ b/NSString_Textile.m @@ -6,6 +6,7 @@ #import "NSString_Textile.h" #import "PreviewController.h" #import "AppController.h" +#import "NoteObject.h" @implementation NSString (Textile) @@ -73,4 +74,4 @@ +(NSString*)stringWithProcessedTextile:(NSString*)inputString return [self processTextile:inputString]; } -@end \ No newline at end of file +@end diff --git a/NSTextFinder.h b/NSTextFinder.h index b26b9995..6d76f6b2 100755 --- a/NSTextFinder.h +++ b/NSTextFinder.h @@ -161,4 +161,4 @@ enum {LAST_FIND_UNKNOWN, LAST_FIND_NO, LAST_FIND_YES}; - (void)windowDidUpdate:(id)arg1; @end -#endif \ No newline at end of file +#endif diff --git a/NVPasswordGenerator.h b/NVPasswordGenerator.h old mode 100755 new mode 100644 diff --git a/NVPasswordGenerator.m b/NVPasswordGenerator.m old mode 100755 new mode 100644 diff --git a/Notality.icns b/Notality.icns new file mode 100644 index 00000000..1bd300a0 Binary files /dev/null and b/Notality.icns differ diff --git a/Notation.freqorder b/Notation.freqorder index ae693165..06cee75a 100755 --- a/Notation.freqorder +++ b/Notation.freqorder @@ -231,7 +231,7 @@ _BlockSizeForNotation -[WALController logFileStillExists] -[RBSplitView restoreState] -[WALController setDelegate] -_getOptimalBlockSize +_GetVolumeInfo -[AppController windowWillReturnUndoManager] -[AppController runDelayedUIActionsAfterLaunch] -[PTHotKeyCenter unregisterHotKeyForName] diff --git a/Notation.launchorder b/Notation.launchorder index 532ee74c..862ac6f4 100755 --- a/Notation.launchorder +++ b/Notation.launchorder @@ -21,7 +21,7 @@ _NSInvalidArgumentException _NSLinkAttributeName _NSBackgroundColorAttributeName _NSForegroundColorAttributeName -_NSUnderlineStyleAttributeName +_NSStrikethroughStyleAttributeName _NSObliquenessAttributeName _NSCursorAttributeName _NSFindPboard @@ -206,7 +206,7 @@ _FSCreateFileIfNotPresentInDirectory _FSRefMakeInDirectoryWithString _statfs _BlockSizeForNotation -_getOptimalBlockSize +_GetVolumeInfo _FSGetDataForkName _FSOpenFork _FSGetForkSize diff --git a/Notation.sdef b/Notation.sdef old mode 100755 new mode 100644 diff --git a/Notation.xcodeproj/project.pbxproj b/Notation.xcodeproj/project.pbxproj index a1a2bd17..aa140217 100755 --- a/Notation.xcodeproj/project.pbxproj +++ b/Notation.xcodeproj/project.pbxproj @@ -17,44 +17,32 @@ 2114C13F0957732800614E74 /* NotationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2114C13E0957732800614E74 /* NotationController.m */; }; 2114C1460957733200614E74 /* NoteObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 2114C1450957733200614E74 /* NoteObject.m */; }; 2114C23E095883A600614E74 /* NSData_transformations.m in Sources */ = {isa = PBXBuildFile; fileRef = 2114C23C095883A600614E74 /* NSData_transformations.m */; }; - 2114C25B095885C800614E74 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2114C259095885C800614E74 /* Localizable.strings */; }; 2114C2880958CC9100614E74 /* pbkdf2.c in Sources */ = {isa = PBXBuildFile; fileRef = 2114C2870958CC9100614E74 /* pbkdf2.c */; }; 2114C2A80958D24800614E74 /* hmacsha1.c in Sources */ = {isa = PBXBuildFile; fileRef = 2114C2A70958D24800614E74 /* hmacsha1.c */; }; 212089B10B0C24F500A15A69 /* AlienNoteImporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 212089B00B0C24F500A15A69 /* AlienNoteImporter.m */; }; 212089D80B0C2CA500A15A69 /* StickiesDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 212089D70B0C2CA500A15A69 /* StickiesDocument.m */; }; - 212850880B56E549005F6E34 /* CarbonErrorStrings.plist in Resources */ = {isa = PBXBuildFile; fileRef = 212850860B56E549005F6E34 /* CarbonErrorStrings.plist */; }; + 2128651E1278AF220013820A /* ServicesMenu.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2128651C1278AF220013820A /* ServicesMenu.strings */; }; 212B84620978422300F3597F /* NSString_NV.m in Sources */ = {isa = PBXBuildFile; fileRef = 212B84610978422300F3597F /* NSString_NV.m */; }; 212C6952110E1940004DD82C /* TitlebarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 212C6951110E1940004DD82C /* TitlebarButton.m */; }; - 212C6A29110E371B004DD82C /* TBAlertWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6A22110E371B004DD82C /* TBAlertWhite.png */; }; 212C6A2A110E371B004DD82C /* TBSynchronizingWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6A23110E371B004DD82C /* TBSynchronizingWhite.png */; }; - 212C6A2B110E371B004DD82C /* TBSynchronizing.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6A24110E371B004DD82C /* TBSynchronizing.png */; }; 212C6A2C110E371B004DD82C /* TBDownArrowWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6A25110E371B004DD82C /* TBDownArrowWhite.png */; }; - 212C6A2D110E371B004DD82C /* TBRolloverBG.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6A26110E371B004DD82C /* TBRolloverBG.png */; }; 212C6A2E110E371B004DD82C /* TBMousedownBG.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6A27110E371B004DD82C /* TBMousedownBG.png */; }; - 212C6E9A110E46F0004DD82C /* TBDownArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6E99110E46F0004DD82C /* TBDownArrow.png */; }; 212C6EA3110E493C004DD82C /* Clear.tif in Resources */ = {isa = PBXBuildFile; fileRef = 212C6EA1110E493C004DD82C /* Clear.tif */; }; - 212C6EA4110E493C004DD82C /* ClearPressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 212C6EA2110E493C004DD82C /* ClearPressed.tif */; }; 212DCA470A6AD28700F74E46 /* EncodingsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 212DCA460A6AD28700F74E46 /* EncodingsManager.m */; }; - 212DCB310A6AE38500F74E46 /* EncodingsManager.nib in Resources */ = {isa = PBXBuildFile; fileRef = 212DCB2F0A6AE38500F74E46 /* EncodingsManager.nib */; }; 212DCF610A6DEECB00F74E46 /* DeletionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 212DCF600A6DEECB00F74E46 /* DeletionManager.m */; }; - 212DCFF70A6E005000F74E46 /* DeletionManager.nib in Resources */ = {isa = PBXBuildFile; fileRef = 212DCFF50A6E005000F74E46 /* DeletionManager.nib */; }; + 212EEAC112F085DB00F89538 /* AutoHyperlinks.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 212EEAB812F085D100F89538 /* AutoHyperlinks.framework */; }; 21317FAF1113840E00472211 /* Excruciatingly Useful Shortcuts.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 21317FAD1113840E00472211 /* Excruciatingly Useful Shortcuts.nvhelp */; }; 213621ED0B92413F008C0830 /* FindPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = 213621E70B92413F008C0830 /* FindPanel.nib */; }; 213621F20B92414F008C0830 /* MultiTextFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = 213621F00B92414F008C0830 /* MultiTextFinder.m */; }; 213623FC0B92AA6E008C0830 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 213623E50B92AA4E008C0830 /* Sparkle.framework */; }; 213FAD530B3C6B52004C74BD /* FSExchangeObjectsCompat.c in Sources */ = {isa = PBXBuildFile; fileRef = 213FAD520B3C6B52004C74BD /* FSExchangeObjectsCompat.c */; }; - 213FB0240B3CB1C4004C74BD /* PTKeyboardIcon.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 213FB0230B3CB1C4004C74BD /* PTKeyboardIcon.tiff */; }; 2143D2F410E953F500127EA6 /* SnapBackPressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2143D2F210E953F400127EA6 /* SnapBackPressed.tif */; }; - 2143D2F510E953F500127EA6 /* SnapBack.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2143D2F310E953F500127EA6 /* SnapBack.tif */; }; 2143D3D910E987B100127EA6 /* Pencil.png in Resources */ = {isa = PBXBuildFile; fileRef = 2143D3D810E987B100127EA6 /* Pencil.png */; }; 214493F60ADB892C00E2A2B6 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 214493E70ADB892C00E2A2B6 /* CoreServices.framework */; }; 214495030ADC7C8D00E2A2B6 /* SecurityInterface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 214494F80ADC7C8D00E2A2B6 /* SecurityInterface.framework */; }; - 2144950F0ADC883100E2A2B6 /* PasswordAssistantButton.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2144950D0ADC883000E2A2B6 /* PasswordAssistantButton.tif */; }; - 214495100ADC883100E2A2B6 /* PasswordAssistantButtonPressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2144950E0ADC883000E2A2B6 /* PasswordAssistantButtonPressed.tif */; }; 214495130ADC8A6600E2A2B6 /* PassphrasePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 214495120ADC8A6600E2A2B6 /* PassphrasePicker.m */; }; - 2144957A0ADCC06300E2A2B6 /* PassphrasePicker.nib in Resources */ = {isa = PBXBuildFile; fileRef = 214495740ADCC06300E2A2B6 /* PassphrasePicker.nib */; }; - 214495870ADCC07E00E2A2B6 /* PassphraseChanger.nib in Resources */ = {isa = PBXBuildFile; fileRef = 214495810ADCC07E00E2A2B6 /* PassphraseChanger.nib */; }; 21469C8C0BEBA6A10094835F /* TemporaryFileCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 21469C8A0BEBA6A10094835F /* TemporaryFileCache.m */; }; + 215309F412E4E92300AF2739 /* DiskUUIDEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = 215309F312E4E92300AF2739 /* DiskUUIDEntry.m */; }; 21544FBE0B06331800C0D1D5 /* KeyDerivationManager.nib in Resources */ = {isa = PBXBuildFile; fileRef = 21544FB80B06331800C0D1D5 /* KeyDerivationManager.nib */; }; 21544FC10B06332600C0D1D5 /* KeyDerivationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 21544FC00B06332600C0D1D5 /* KeyDerivationManager.m */; }; 215452080B06541800C0D1D5 /* PassphraseChanger.m in Sources */ = {isa = PBXBuildFile; fileRef = 215450F80B06509600C0D1D5 /* PassphraseChanger.m */; }; @@ -63,77 +51,62 @@ 2155DF44097C992800163A10 /* AttributedPlainText.m in Sources */ = {isa = PBXBuildFile; fileRef = 2155DF43097C992800163A10 /* AttributedPlainText.m */; }; 21582DC50B73F59B00711663 /* BookmarksController.m in Sources */ = {isa = PBXBuildFile; fileRef = 21582DC40B73F59A00711663 /* BookmarksController.m */; }; 215DE83809ECC4FE009A710B /* HeaderViewWIthMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 215DE83709ECC4FE009A710B /* HeaderViewWIthMenu.m */; }; - 215DEA3F09EF5323009A710B /* General.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 215DEA3D09EF5323009A710B /* General.tiff */; }; - 215DEA4709EF6446009A710B /* Notes.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 215DEA4609EF6446009A710B /* Notes.tiff */; }; - 215DEE1309F1AA4C009A710B /* Editing.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 215DEE1209F1AA4C009A710B /* Editing.tiff */; }; - 21665A9E10E6032F00188D3D /* Search.png in Resources */ = {isa = PBXBuildFile; fileRef = 21665A9C10E6032F00188D3D /* Search.png */; }; 2168EC5309E33B0300778D02 /* FrozenNotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 2168EC5209E33B0300778D02 /* FrozenNotation.m */; }; 216BA24310746E3900F62D93 /* ImporterAccessory.nib in Resources */ = {isa = PBXBuildFile; fileRef = 216BA24110746E3900F62D93 /* ImporterAccessory.nib */; }; + 216D987F12CE68AD0004B9CE /* NSFileManager_NV.m in Sources */ = {isa = PBXBuildFile; fileRef = 216D987E12CE68AD0004B9CE /* NSFileManager_NV.m */; }; + 216D9C2E12CFEF2A0004B9CE /* LinkBackPressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 216D9C2C12CFEF2A0004B9CE /* LinkBackPressed.tif */; }; + 216DA22612D17DB70004B9CE /* AugmentedScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 216DA22512D17DB70004B9CE /* AugmentedScrollView.m */; }; 217CEBA309E9885500DF0E09 /* NotationFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 217CEBA209E9885500DF0E09 /* NotationFileManager.m */; }; - 217D02D60B77061E0004E02D /* BodyScroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 217D02D40B77061E0004E02D /* BodyScroller.m */; }; 217D4282096545A000E84749 /* LabelObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 217D4281096545A000E84749 /* LabelObject.m */; }; - 217EAF0F0B0D56860041A8A9 /* FocusRingScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 217EAF0E0B0D56860041A8A9 /* FocusRingScrollView.m */; }; - 217EB3CE0B0F62FB0041A8A9 /* NSTextFinder_LastFind.m in Sources */ = {isa = PBXBuildFile; fileRef = 217EB3CD0B0F62FB0041A8A9 /* NSTextFinder_LastFind.m */; }; 2181171309F311110020A252 /* DeletedNoteObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 2181171209F311110020A252 /* DeletedNoteObject.m */; }; - 21813562105AF27400A0AE18 /* Acknowledgments.txt in Resources */ = {isa = PBXBuildFile; fileRef = 21813561105AF27400A0AE18 /* Acknowledgments.txt */; }; 2182B39A106B2296008641E4 /* RBSplitSubview.m in Sources */ = {isa = PBXBuildFile; fileRef = 2182B396106B2296008641E4 /* RBSplitSubview.m */; }; 2182B39B106B2296008641E4 /* RBSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2182B398106B2296008641E4 /* RBSplitView.m */; }; - 2182B3C3106B2509008641E4 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2182B3C1106B2509008641E4 /* MainMenu.nib */; }; 218D43330AA2ABC600F36CCA /* NotesTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2191930209CFBEBD00586B15 /* NotesTableView.m */; }; 21918FD009C49B2500586B15 /* EmptyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 21918FCE09C49B2400586B15 /* EmptyView.m */; }; 219190F109C4A60700586B15 /* DualField.m in Sources */ = {isa = PBXBuildFile; fileRef = 219190F009C4A60700586B15 /* DualField.m */; }; 2191926409C52A9200586B15 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2191926309C52A9100586B15 /* libcrypto.dylib */; }; 2191926709C52AA600586B15 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2191926609C52AA600586B15 /* libz.dylib */; }; 219192D409CFBC8800586B15 /* NoteAttributeColumn.m in Sources */ = {isa = PBXBuildFile; fileRef = 219192D309CFBC8700586B15 /* NoteAttributeColumn.m */; }; - 219195E609D3A20F00586B15 /* Preferences.nib in Resources */ = {isa = PBXBuildFile; fileRef = 219195E409D3A20F00586B15 /* Preferences.nib */; }; - 219196BF09D4F20100586B15 /* Add_Pressed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 219196BB09D4F20000586B15 /* Add_Pressed.tiff */; }; - 219196C009D4F20100586B15 /* Add.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 219196BC09D4F20000586B15 /* Add.tiff */; }; - 219196C109D4F20100586B15 /* Remove_Pressed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 219196BD09D4F20000586B15 /* Remove_Pressed.tiff */; }; - 219196C209D4F20100586B15 /* Remove.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 219196BE09D4F20000586B15 /* Remove.tiff */; }; 2191982209D607C600586B15 /* PrefsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2191982109D607C600586B15 /* PrefsWindowController.m */; }; 219588D20961D7F200972B8C /* LinkingEditor.m in Sources */ = {isa = PBXBuildFile; fileRef = 219588D10961D7F200972B8C /* LinkingEditor.m */; }; 219739FB0AFE42A10046683E /* PassphraseRetriever.m in Sources */ = {isa = PBXBuildFile; fileRef = 219739FA0AFE42A10046683E /* PassphraseRetriever.m */; }; 21973A290AFE447A0046683E /* PassphraseRetriever.nib in Resources */ = {isa = PBXBuildFile; fileRef = 21973A230AFE447A0046683E /* PassphraseRetriever.nib */; }; 21973FF10B0060C80046683E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21973FBC0B0060C80046683E /* Security.framework */; }; 219D1BB3110EA66A005E7DF5 /* TBAlert.png in Resources */ = {isa = PBXBuildFile; fileRef = 219D1BB2110EA66A005E7DF5 /* TBAlert.png */; }; - 219D222F1111564F005E7DF5 /* Contact Information.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 219D22281111564F005E7DF5 /* Contact Information.nvhelp */; }; 219D22301111564F005E7DF5 /* This is the title of a note.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 219D222A1111564F005E7DF5 /* This is the title of a note.nvhelp */; }; - 219D22311111564F005E7DF5 /* How does this thing work?.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 219D222C1111564F005E7DF5 /* How does this thing work?.nvhelp */; }; 219D254A1113FE34005E7DF5 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 219D25491113FE34005E7DF5 /* SystemConfiguration.framework */; }; 219FD3160B2CC655004E132B /* LinkingEditor_Indentation.m in Sources */ = {isa = PBXBuildFile; fileRef = 219FD3150B2CC655004E132B /* LinkingEditor_Indentation.m */; }; 219FD63E0B309B69004E132B /* BlorPasswordRetriever.m in Sources */ = {isa = PBXBuildFile; fileRef = 219FD63D0B309B69004E132B /* BlorPasswordRetriever.m */; }; 21A2F95E09DF3FDC001AF0B5 /* NotationPrefs.m in Sources */ = {isa = PBXBuildFile; fileRef = 21A2F95D09DF3FDC001AF0B5 /* NotationPrefs.m */; }; 21A2FA1709DF6174001AF0B5 /* NotationPrefsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 21A2FA1609DF6174001AF0B5 /* NotationPrefsViewController.m */; }; - 21A2FA7C09DF64E9001AF0B5 /* NotationPrefsView.nib in Resources */ = {isa = PBXBuildFile; fileRef = 21A2FA7A09DF64E9001AF0B5 /* NotationPrefsView.nib */; }; 21A30EA70971D11D0071E9AF /* FastListDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 21A30EA60971D11D0071E9AF /* FastListDataSource.m */; }; + 21A38EE412EA864400CEB5F0 /* MakeDefault_Pressed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 21A38EE212EA864400CEB5F0 /* MakeDefault_Pressed.tiff */; }; + 21A3913A12EB4C2F00CEB5F0 /* Spaces.c in Sources */ = {isa = PBXBuildFile; fileRef = 21A3913912EB4C2F00CEB5F0 /* Spaces.c */; }; 21A6E6FD0974204F008436A9 /* LabelsListController.m in Sources */ = {isa = PBXBuildFile; fileRef = 21A6E6FC0974204F008436A9 /* LabelsListController.m */; }; 21A73DC8099712A8009F8A6C /* WALController.m in Sources */ = {isa = PBXBuildFile; fileRef = 21A73DC7099712A8009F8A6C /* WALController.m */; }; 21AD2550110A8BA600B7A985 /* SimplenoteEntryCollector.m in Sources */ = {isa = PBXBuildFile; fileRef = 21AD254F110A8BA600B7A985 /* SimplenoteEntryCollector.m */; }; 21AD2850110BE99B00B7A985 /* SyncSessionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 21AD284F110BE99B00B7A985 /* SyncSessionController.m */; }; 21AD292D110C188800B7A985 /* TinyAlert.tif in Resources */ = {isa = PBXBuildFile; fileRef = 21AD292C110C188800B7A985 /* TinyAlert.tif */; }; - 21AD292F110C18AA00B7A985 /* Notality.icns in Resources */ = {isa = PBXBuildFile; fileRef = 21AD292E110C18AA00B7A985 /* Notality.icns */; }; 21B1BC361104D20E0004A7D0 /* InvocationRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 21B1BC351104D20E0004A7D0 /* InvocationRecorder.m */; }; - 21B1C171110764570004A7D0 /* statusValidated.png in Resources */ = {isa = PBXBuildFile; fileRef = 21B1C16E110764570004A7D0 /* statusValidated.png */; }; 21B1C172110764570004A7D0 /* statusError.png in Resources */ = {isa = PBXBuildFile; fileRef = 21B1C16F110764570004A7D0 /* statusError.png */; }; - 21B1C173110764570004A7D0 /* statusInProgress.png in Resources */ = {isa = PBXBuildFile; fileRef = 21B1C170110764570004A7D0 /* statusInProgress.png */; }; 21B548FA112F307E00E163A1 /* NotationDirectoryManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 21B548F8112F307E00E163A1 /* NotationDirectoryManager.m */; }; 21B54C021134F2E800E163A1 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21B54C011134F2E800E163A1 /* IOKit.framework */; }; + 21B64A2612E61FA700D87EFC /* LabelColumnCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 21B64A2512E61FA700D87EFC /* LabelColumnCell.m */; }; + 21B64C4E12E62A5700D87EFC /* UnifiedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 21B64C4D12E62A5700D87EFC /* UnifiedCell.m */; }; 21BD2ED110DAF31500BA3DF6 /* LinearDividerShader.m in Sources */ = {isa = PBXBuildFile; fileRef = 21BD2ECF10DAF31500BA3DF6 /* LinearDividerShader.m */; }; 21BD2F3610DAF61700BA3DF6 /* SplitViewDimple.tif in Resources */ = {isa = PBXBuildFile; fileRef = 21BD2F3510DAF61700BA3DF6 /* SplitViewDimple.tif */; }; + 21C0F8A212C7E7160068693F /* Fonts & Colors.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 21C0F8A112C7E7160068693F /* Fonts & Colors.tiff */; }; 21C737950B50C73E0048C08A /* MultiplePageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 21C737940B50C73E0048C08A /* MultiplePageView.m */; }; 21D583620B78F0CC00245E29 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21D5834D0B78F0CC00245E29 /* ApplicationServices.framework */; }; 21D60128098FDB46007440DF /* GlobalPrefs.m in Sources */ = {isa = PBXBuildFile; fileRef = 21D60127098FDB46007440DF /* GlobalPrefs.m */; }; + 21D6F7EF12E0C751005C2DA5 /* AppController_Importing.m in Sources */ = {isa = PBXBuildFile; fileRef = 21D6F7EE12E0C751005C2DA5 /* AppController_Importing.m */; }; + 21D6FB4912E104D6005C2DA5 /* NSBezierPath_NV.m in Sources */ = {isa = PBXBuildFile; fileRef = 21D6FB4812E104D6005C2DA5 /* NSBezierPath_NV.m */; }; + 21DB3D0F12D4FBDD0057F52B /* SecureTextEntryManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 21DB3D0E12D4FBDD0057F52B /* SecureTextEntryManager.m */; }; + 21DB4BE612DE4E3D0057F52B /* NSString_CustomTruncation.m in Sources */ = {isa = PBXBuildFile; fileRef = 21DB4BE512DE4E3D0057F52B /* NSString_CustomTruncation.m */; }; 21DC788F097894B600E59B09 /* NSCollection_utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 21DC788E097894B600E59B09 /* NSCollection_utils.m */; }; - 21DF19B210D172F600543C35 /* DFCapRightInactive.png in Resources */ = {isa = PBXBuildFile; fileRef = 21DF19AE10D172F600543C35 /* DFCapRightInactive.png */; }; - 21DF19B310D172F600543C35 /* DFCapRight.png in Resources */ = {isa = PBXBuildFile; fileRef = 21DF19AF10D172F600543C35 /* DFCapRight.png */; }; 21DF19B410D172F600543C35 /* DFCapLeftRoundedInactive.png in Resources */ = {isa = PBXBuildFile; fileRef = 21DF19B010D172F600543C35 /* DFCapLeftRoundedInactive.png */; }; - 21DF19B510D172F600543C35 /* DFCapLeftRounded.png in Resources */ = {isa = PBXBuildFile; fileRef = 21DF19B110D172F600543C35 /* DFCapLeftRounded.png */; }; 21E6B09B0B6E6D0C001ABEDC /* URLGetter.nib in Resources */ = {isa = PBXBuildFile; fileRef = 21E6B0950B6E6D0B001ABEDC /* URLGetter.nib */; }; 21E6B09F0B6E6D18001ABEDC /* URLGetter.m in Sources */ = {isa = PBXBuildFile; fileRef = 21E6B09D0B6E6D18001ABEDC /* URLGetter.m */; }; - 21E6EC21111DD52B0038ECC7 /* Comment ça marche.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 21E6EC1F111DD52B0038ECC7 /* Comment ça marche.nvhelp */; }; - 21EA3699111C9AD900E2B517 /* Raccourcis incroyablement utiles.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 21EA3691111C9AD900E2B517 /* Raccourcis incroyablement utiles.nvhelp */; }; - 21EA369B111C9AD900E2B517 /* Ceci est le titre d'une note.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 21EA3695111C9AD900E2B517 /* Ceci est le titre d'une note.nvhelp */; }; - 21EA369C111C9AD900E2B517 /* Contact.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 21EA3697111C9AD900E2B517 /* Contact.nvhelp */; }; 21F078FC10EC280E004FE56F /* NotationSyncServiceManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 21F078FB10EC280E004FE56F /* NotationSyncServiceManager.m */; }; 21F0794310EC5EA2004FE56F /* SimplenoteSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 21F0794210EC5EA2004FE56F /* SimplenoteSession.m */; }; 21F0797E10EC93B0004FE56F /* SyncResponseFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 21F0797D10EC93B0004FE56F /* SyncResponseFetcher.m */; }; @@ -149,81 +122,150 @@ 21F1CD980B3A3F77001FB5F6 /* PTHotKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 21F1CD970B3A3F77001FB5F6 /* PTHotKey.m */; }; 21F1CD9F0B3A3F88001FB5F6 /* PTKeyComboPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = 21F1CD990B3A3F88001FB5F6 /* PTKeyComboPanel.nib */; }; 21F1CDAD0B3A401F001FB5F6 /* PTKeyCombo.m in Sources */ = {isa = PBXBuildFile; fileRef = 21F1CDAC0B3A401F001FB5F6 /* PTKeyCombo.m */; }; - 21F447F011B896C4004D008B /* Atalhos Incrivelmente Úteis.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 21F447E811B896C4004D008B /* Atalhos Incrivelmente Úteis.nvhelp */; }; - 21F447F111B896C4004D008B /* Como funciona isso?.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 21F447EA11B896C4004D008B /* Como funciona isso?.nvhelp */; }; - 21F447F211B896C4004D008B /* Este é o título de uma nota.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 21F447EC11B896C4004D008B /* Este é o título de uma nota.nvhelp */; }; - 21F447F311B896C4004D008B /* Informações de Contato.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 21F447EE11B896C4004D008B /* Informações de Contato.nvhelp */; }; 21F459AD0A92E01D00FB6FFE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21F4599B0A92E01C00FB6FFE /* Carbon.framework */; }; 21FF94F30B5AD22800DB6A2F /* ExporterManager.nib in Resources */ = {isa = PBXBuildFile; fileRef = 21FF94ED0B5AD22800DB6A2F /* ExporterManager.nib */; }; 21FF94F70B5AD23B00DB6A2F /* ExporterManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 21FF94F50B5AD23B00DB6A2F /* ExporterManager.m */; }; - 3FB0FAEA12DC455B003DC14E /* BWToolkitFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FB0FAE912DC455B003DC14E /* BWToolkitFramework.framework */; }; - 3FB0FB2312DC45CA003DC14E /* BWToolkitFramework.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3FB0FAE912DC455B003DC14E /* BWToolkitFramework.framework */; }; 57F27F7B11973A7F00C63ACF /* Notation.sdef in Resources */ = {isa = PBXBuildFile; fileRef = 57F27F7A11973A7F00C63ACF /* Notation.sdef */; }; 57F27FB91197407400C63ACF /* SearchCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 57F27FB81197407400C63ACF /* SearchCommand.m */; }; - 608A24D21268DB9F00EEF326 /* NSString_Textile.m in Sources */ = {isa = PBXBuildFile; fileRef = 608A24D11268DB9F00EEF326 /* NSString_Textile.m */; }; - 608A24F11268DCF900EEF326 /* Textile_2.12 in Resources */ = {isa = PBXBuildFile; fileRef = 608A24ED1268DCF900EEF326 /* Textile_2.12 */; }; - 608A24F81268DDC800EEF326 /* Markdown_1.0.1 in Resources */ = {isa = PBXBuildFile; fileRef = 608A24F31268DDC800EEF326 /* Markdown_1.0.1 */; }; - 608A24FB1268DDF200EEF326 /* NSString_Markdown.m in Sources */ = {isa = PBXBuildFile; fileRef = 608A24FA1268DDF200EEF326 /* NSString_Markdown.m */; }; - 608A25651268DEAB00EEF326 /* MultiMarkdown in Resources */ = {isa = PBXBuildFile; fileRef = 608A25061268DEAB00EEF326 /* MultiMarkdown */; }; - 608A25661268DEAB00EEF326 /* NSString_MultiMarkdown.m in Sources */ = {isa = PBXBuildFile; fileRef = 608A25641268DEAB00EEF326 /* NSString_MultiMarkdown.m */; }; - 608A25791268DF9700EEF326 /* MarkupPreview.xib in Resources */ = {isa = PBXBuildFile; fileRef = 608A25781268DF9700EEF326 /* MarkupPreview.xib */; }; - 608A25AF1268ECFA00EEF326 /* PreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 608A25AE1268ECFA00EEF326 /* PreviewController.m */; }; - 608A25B61268EE5E00EEF326 /* AppController_Preview.m in Sources */ = {isa = PBXBuildFile; fileRef = 608A25B51268EE5E00EEF326 /* AppController_Preview.m */; }; + 5C1830CA132EA675005E2210 /* MarkupPreview.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5C1830CC132EA675005E2210 /* MarkupPreview.xib */; }; + 5C1830CD132EA687005E2210 /* SaveHTMLPreview.nib in Resources */ = {isa = PBXBuildFile; fileRef = 5C1830CF132EA687005E2210 /* SaveHTMLPreview.nib */; }; + 5C2CC185134989A8006FFE56 /* nvMenu.png in Resources */ = {isa = PBXBuildFile; fileRef = 5C2CC182134989A8006FFE56 /* nvMenu.png */; }; + 5C2CC186134989A8006FFE56 /* nvMenuC.png in Resources */ = {isa = PBXBuildFile; fileRef = 5C2CC183134989A8006FFE56 /* nvMenuC.png */; }; + 5C2CC18A134989D7006FFE56 /* nvMenuDark.png in Resources */ = {isa = PBXBuildFile; fileRef = 5C2CC189134989D7006FFE56 /* nvMenuDark.png */; }; + 5C2FAD2B1333970200FBFD34 /* ETScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C2CD036132ED47900CA0D7C /* ETScrollView.m */; }; + 5C49E365131C5CC500696B68 /* Credits.html in Resources */ = {isa = PBXBuildFile; fileRef = 5C49E364131C5CC500696B68 /* Credits.html */; }; + 5C4B353E1307220E00014119 /* TransparentScrollerKnobTop.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C4B35361307220E00014119 /* TransparentScrollerKnobTop.tif */; }; + 5C4B35401307220E00014119 /* TransparentScrollerSlotBottom.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C4B35381307220E00014119 /* TransparentScrollerSlotBottom.tif */; }; + 5C4B35421307220E00014119 /* TransparentScrollerSlotVerticalFill.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C4B353A1307220E00014119 /* TransparentScrollerSlotVerticalFill.tif */; }; + 5C4B356A1307225000014119 /* ETTransparentScroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B35691307225000014119 /* ETTransparentScroller.m */; }; + 5C671531133294F30020CCBC /* Atalhos Incrivelmente Úteis.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D56132EA29D0079B3FD /* Atalhos Incrivelmente Úteis.nvhelp */; }; + 5C671532133294F30020CCBC /* Como funciona isso?.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D5C132EA29D0079B3FD /* Como funciona isso?.nvhelp */; }; + 5C671533133294F30020CCBC /* Este é o título de uma nota.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D64132EA29D0079B3FD /* Este é o título de uma nota.nvhelp */; }; + 5C671534133294F30020CCBC /* Informações de Contato.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D6F132EA29D0079B3FD /* Informações de Contato.nvhelp */; }; + 5C671539133295280020CCBC /* Atalhos Incrivelmente Úteis.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D56132EA29D0079B3FD /* Atalhos Incrivelmente Úteis.nvhelp */; }; + 5C67153A133295280020CCBC /* Como funciona isso?.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D5C132EA29D0079B3FD /* Como funciona isso?.nvhelp */; }; + 5C67153B133295280020CCBC /* Este é o título de uma nota.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D64132EA29D0079B3FD /* Este é o título de uma nota.nvhelp */; }; + 5C67153C133295280020CCBC /* Informações de Contato.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D6F132EA29D0079B3FD /* Informações de Contato.nvhelp */; }; + 5C94376F132A0C9E00B08B80 /* greyscrollervertbottom3.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C94376C132A0C9D00B08B80 /* greyscrollervertbottom3.tif */; }; + 5C943771132A0C9E00B08B80 /* greyscrollerverttop3.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C94376E132A0C9D00B08B80 /* greyscrollerverttop3.tif */; }; + 5C96F4FF131C2F9500A2E4AC /* TabClose_Front_Pressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F4FC131C2F9500A2E4AC /* TabClose_Front_Pressed.tif */; }; + 5C96F501131C2F9500A2E4AC /* TabClose_Front.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F4FE131C2F9500A2E4AC /* TabClose_Front.tif */; }; + 5C96F504131C2FA800A2E4AC /* BTTransparentScroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C96F502131C2FA800A2E4AC /* BTTransparentScroller.m */; }; + 5C96F566131C35AB00A2E4AC /* __init__.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5CA10FFB131C2A7600DE1F91 /* __init__.py */; }; + 5C96F567131C35AB00A2E4AC /* BeautifulSoup.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5CA10FFC131C2A7600DE1F91 /* BeautifulSoup.py */; }; + 5C96F568131C35AB00A2E4AC /* BeautifulSoup.pyc in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5CA10FFD131C2A7600DE1F91 /* BeautifulSoup.pyc */; }; + 5C96F569131C35AB00A2E4AC /* html2text.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5CA10FFE131C2A7600DE1F91 /* html2text.py */; }; + 5C96F56A131C35AB00A2E4AC /* page_parser.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5CA10FFF131C2A7600DE1F91 /* page_parser.py */; }; + 5C96F56B131C35AB00A2E4AC /* page_parser.pyc in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5CA11000131C2A7600DE1F91 /* page_parser.pyc */; }; + 5C96F56C131C35AB00A2E4AC /* readability.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5CA11001131C2A7600DE1F91 /* readability.py */; }; + 5C96F56D131C35AB00A2E4AC /* url_helpers.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5CA11002131C2A7600DE1F91 /* url_helpers.py */; }; + 5C96F56E131C35AB00A2E4AC /* url_helpers.pyc in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5CA11003131C2A7600DE1F91 /* url_helpers.pyc */; }; + 5C96F5AF131C37DF00A2E4AC /* NSString_MultiMarkdown.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C96F5AA131C37DF00A2E4AC /* NSString_MultiMarkdown.m */; }; + 5C96F5B0131C37DF00A2E4AC /* NSString_Markdown.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C96F5AC131C37DF00A2E4AC /* NSString_Markdown.m */; }; + 5C96F5B1131C37DF00A2E4AC /* NSString_Textile.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C96F5AE131C37DF00A2E4AC /* NSString_Textile.m */; }; + 5C96F60F131C37F500A2E4AC /* MultiMarkdown in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F5B2131C37F500A2E4AC /* MultiMarkdown */; }; + 5C96F616131C380100A2E4AC /* Textile_2.12 in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F610131C380100A2E4AC /* Textile_2.12 */; }; + 5C96F61C131C380C00A2E4AC /* Markdown_1.0.1 in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F617131C380C00A2E4AC /* Markdown_1.0.1 */; }; + 5C96F6DE131C488B00A2E4AC /* ETTransparentButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C96F6DD131C488B00A2E4AC /* ETTransparentButtonCell.m */; }; + 5C96F6E9131C48FE00A2E4AC /* ETTransparentButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C96F6E8131C48FE00A2E4AC /* ETTransparentButton.m */; }; + 5C96F709131C49D400A2E4AC /* TransparentButtonFillN.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F703131C49D400A2E4AC /* TransparentButtonFillN.tiff */; }; + 5C96F70B131C49D400A2E4AC /* TransparentButtonLeftN.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F705131C49D400A2E4AC /* TransparentButtonLeftN.tiff */; }; + 5C96F70D131C49D400A2E4AC /* TransparentButtonRightN.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F707131C49D400A2E4AC /* TransparentButtonRightN.tiff */; }; + 5C9C7734131DA04300FB2652 /* WordCountToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C9C7733131DA04300FB2652 /* WordCountToken.m */; }; + 5CA08C2013301D5E004E3250 /* ETContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CA08C1F13301D5E004E3250 /* ETContentView.m */; }; + 5CA10F1A131C297000DE1F91 /* PreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CA10F19131C297000DE1F91 /* PreviewController.m */; }; + 5CA10F32131C29E900DE1F91 /* AppController_Preview.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CA10F31131C29E900DE1F91 /* AppController_Preview.m */; }; + 5CA10F3B131C2A3F00DE1F91 /* MAAttachedWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CA10F3A131C2A3F00DE1F91 /* MAAttachedWindow.m */; }; + 5CA11004131C2A7600DE1F91 /* __init__.py in Resources */ = {isa = PBXBuildFile; fileRef = 5CA10FFB131C2A7600DE1F91 /* __init__.py */; }; + 5CA11005131C2A7600DE1F91 /* BeautifulSoup.py in Resources */ = {isa = PBXBuildFile; fileRef = 5CA10FFC131C2A7600DE1F91 /* BeautifulSoup.py */; }; + 5CA11006131C2A7600DE1F91 /* BeautifulSoup.pyc in Resources */ = {isa = PBXBuildFile; fileRef = 5CA10FFD131C2A7600DE1F91 /* BeautifulSoup.pyc */; }; + 5CA11007131C2A7600DE1F91 /* html2text.py in Resources */ = {isa = PBXBuildFile; fileRef = 5CA10FFE131C2A7600DE1F91 /* html2text.py */; }; + 5CA11008131C2A7600DE1F91 /* page_parser.py in Resources */ = {isa = PBXBuildFile; fileRef = 5CA10FFF131C2A7600DE1F91 /* page_parser.py */; }; + 5CA11009131C2A7600DE1F91 /* page_parser.pyc in Resources */ = {isa = PBXBuildFile; fileRef = 5CA11000131C2A7600DE1F91 /* page_parser.pyc */; }; + 5CA1100A131C2A7600DE1F91 /* readability.py in Resources */ = {isa = PBXBuildFile; fileRef = 5CA11001131C2A7600DE1F91 /* readability.py */; }; + 5CA1100B131C2A7600DE1F91 /* url_helpers.py in Resources */ = {isa = PBXBuildFile; fileRef = 5CA11002131C2A7600DE1F91 /* url_helpers.py */; }; + 5CA1100C131C2A7600DE1F91 /* url_helpers.pyc in Resources */ = {isa = PBXBuildFile; fileRef = 5CA11003131C2A7600DE1F91 /* url_helpers.pyc */; }; + 5CBA7A911305E2DF004ADEBB /* TagEditingManager.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5CBA7A8F1305E2DF004ADEBB /* TagEditingManager.xib */; }; + 5CBA7A981305E38C004ADEBB /* TagEditingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CBA7A971305E38C004ADEBB /* TagEditingManager.m */; }; + 5CC2DF0B13083BCF006772D9 /* StatusItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CC2DF0A13083BCF006772D9 /* StatusItemView.m */; }; + 5CCEEF1D130B599B00E15B77 /* DFView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CCEEF1C130B599B00E15B77 /* DFView.m */; }; + 5CE6624B13185202002039D0 /* NSTextFinder_LastFind.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CE6624A13185202002039D0 /* NSTextFinder_LastFind.m */; }; + 5CF01B08132975910083D66E /* greyscrollervertbottom.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 5CF01B02132975910083D66E /* greyscrollervertbottom.tiff */; }; + 5CF01B0C132975910083D66E /* greyscrollerverttop.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 5CF01B06132975910083D66E /* greyscrollerverttop.tiff */; }; + 5CF01B22132975DB0083D66E /* BTransparentScrollerSlotBottom.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5CF01B16132975DA0083D66E /* BTransparentScrollerSlotBottom.tif */; }; + 5CF33C721308B478002B5499 /* NotesTableHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CF33C711308B478002B5499 /* NotesTableHeaderCell.m */; }; + 5CF96C43132EA1890079B3FD /* Ceci est le titre d'une note.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96C0B132EA1880079B3FD /* Ceci est le titre d'une note.nvhelp */; }; + 5CF96C45132EA1890079B3FD /* Contact.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96C0F132EA1880079B3FD /* Contact.nvhelp */; }; + 5CF96CB0132EA1890079B3FD /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8D1107310486CEB800E47090 /* Info.plist */; }; + 5CF96CBD132EA1890079B3FD /* PassphrasePicker.nib in Resources */ = {isa = PBXBuildFile; fileRef = 214495740ADCC06300E2A2B6 /* PassphrasePicker.nib */; }; + 5CF96CDD132EA1980079B3FD /* Kontaktdaten.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96CCA132EA1970079B3FD /* Kontaktdaten.nvhelp */; }; + 5CF96D93132EA29D0079B3FD /* Atalhos Incrivelmente Úteis.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D56132EA29D0079B3FD /* Atalhos Incrivelmente Úteis.nvhelp */; }; + 5CF96D95132EA29D0079B3FD /* Como funciona isso?.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D5C132EA29D0079B3FD /* Como funciona isso?.nvhelp */; }; + 5CF96D98132EA29D0079B3FD /* Este é o título de uma nota.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D64132EA29D0079B3FD /* Este é o título de uma nota.nvhelp */; }; + 5CF96D9B132EA29D0079B3FD /* Informações de Contato.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96D6F132EA29D0079B3FD /* Informações de Contato.nvhelp */; }; + 5CF96DA8132EA29D0079B3FD /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96BFD132EA0300079B3FD /* MainMenu.xib */; }; + 5CF96DA9132EA29D0079B3FD /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 5C49E553131C72FD00696B68 /* dsa_pub.pem */; }; + 5CF96DAA132EA29D0079B3FD /* Acknowledgments.txt in Resources */ = {isa = PBXBuildFile; fileRef = 21813561105AF27400A0AE18 /* Acknowledgments.txt */; }; + 5CF96DAB132EA29D0079B3FD /* Dies ist der Titel einer Notiz.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96CC1132EA1970079B3FD /* Dies ist der Titel einer Notiz.nvhelp */; }; + 5CF96DAD132EA29D0079B3FD /* Moglicherweise nutzliche Tastenkurzel.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96CCE132EA1970079B3FD /* Moglicherweise nutzliche Tastenkurzel.nvhelp */; }; + 5CF96DAE132EA29D0079B3FD /* Wie funktioniert dieses Programm?.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96CDA132EA1970079B3FD /* Wie funktioniert dieses Programm?.nvhelp */; }; + 5CF96DB0132EA29D0079B3FD /* Comment ça marche.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96C0D132EA1880079B3FD /* Comment ça marche.nvhelp */; }; + 5CF96DB2132EA29D0079B3FD /* Raccourcis incroyablement utiles.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 5CF96C25132EA1880079B3FD /* Raccourcis incroyablement utiles.nvhelp */; }; + 5CF96DB8132EA29D0079B3FD /* Contact Information.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 219D22281111564F005E7DF5 /* Contact Information.nvhelp */; }; + 5CF96DBA132EA29D0079B3FD /* How does this thing work?.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 219D222C1111564F005E7DF5 /* How does this thing work?.nvhelp */; }; + 5CF96DBC132EA29D0079B3FD /* greyscrollervertfill3.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C94376D132A0C9D00B08B80 /* greyscrollervertfill3.tif */; }; + 5CF96DBF132EA29D0079B3FD /* BTransparentScrollerSlotTop.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5CF01B1A132975DA0083D66E /* BTransparentScrollerSlotTop.tif */; }; + 5CF96DC0132EA29D0079B3FD /* scrollbarblue.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5CF01B0E132975A40083D66E /* scrollbarblue.tif */; }; + 5CF96DC2132EA29D0079B3FD /* greyscrollervertfill.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 5CF01B04132975910083D66E /* greyscrollervertfill.tiff */; }; + 5CF96DC5132EA29D0079B3FD /* TransparentButtonFillP.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F704131C49D400A2E4AC /* TransparentButtonFillP.tiff */; }; + 5CF96DC7132EA29D0079B3FD /* TransparentButtonLeftP.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F706131C49D400A2E4AC /* TransparentButtonLeftP.tiff */; }; + 5CF96DC9132EA29D0079B3FD /* TransparentButtonRightP.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F708131C49D400A2E4AC /* TransparentButtonRightP.tiff */; }; + 5CF96DCB132EA29D0079B3FD /* TabClose_Front_Rollover.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C96F4FD131C2F9500A2E4AC /* TabClose_Front_Rollover.tif */; }; + 5CF96DCD132EA29D0079B3FD /* TransparentScrollerKnobBottom.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C4B35351307220E00014119 /* TransparentScrollerKnobBottom.tif */; }; + 5CF96DCF132EA29D0079B3FD /* TransparentScrollerKnobVerticalFill.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C4B35371307220E00014119 /* TransparentScrollerKnobVerticalFill.tif */; }; + 5CF96DD1132EA29D0079B3FD /* TransparentScrollerSlotTop.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C4B35391307220E00014119 /* TransparentScrollerSlotTop.tif */; }; + 5CF96DD6132EA29D0079B3FD /* IBeamInverted.png in Resources */ = {isa = PBXBuildFile; fileRef = 21DB407D12D5383F0057F52B /* IBeamInverted.png */; }; + 5CF96DD7132EA29D0079B3FD /* ListDividerDrag.png in Resources */ = {isa = PBXBuildFile; fileRef = 216DA1AC12D15F310004B9CE /* ListDividerDrag.png */; }; + 5CF96DD9132EA29D0079B3FD /* TBDownArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6E99110E46F0004DD82C /* TBDownArrow.png */; }; + 5CF96DDA132EA29D0079B3FD /* TBAlertWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6A22110E371B004DD82C /* TBAlertWhite.png */; }; + 5CF96DDC132EA29D0079B3FD /* TBSynchronizing.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6A24110E371B004DD82C /* TBSynchronizing.png */; }; + 5CF96DDE132EA29D0079B3FD /* TBRolloverBG.png in Resources */ = {isa = PBXBuildFile; fileRef = 212C6A26110E371B004DD82C /* TBRolloverBG.png */; }; + 5CF96DE1132EA29D0079B3FD /* PTKeyboardIcon.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 213FB0230B3CB1C4004C74BD /* PTKeyboardIcon.tiff */; }; + 5CF96DE2132EA29D0079B3FD /* PasswordAssistantButton.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2144950D0ADC883000E2A2B6 /* PasswordAssistantButton.tif */; }; + 5CF96DE3132EA29D0079B3FD /* PasswordAssistantButtonPressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2144950E0ADC883000E2A2B6 /* PasswordAssistantButtonPressed.tif */; }; + 5CF96DE5132EA29D0079B3FD /* SplitViewDimple2.tif in Resources */ = {isa = PBXBuildFile; fileRef = 5C5713F01309A42600961090 /* SplitViewDimple2.tif */; }; + 5CF96DE6132EA29D0079B3FD /* Editing.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 215DEE1209F1AA4C009A710B /* Editing.tiff */; }; + 5CF96DE7132EA29D0079B3FD /* Notes.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 215DEA4609EF6446009A710B /* Notes.tiff */; }; + 5CF96DE8132EA29D0079B3FD /* General.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 215DEA3D09EF5323009A710B /* General.tiff */; }; + 5CF96DEA132EA29D0079B3FD /* Add_Pressed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 219196BB09D4F20000586B15 /* Add_Pressed.tiff */; }; + 5CF96DEB132EA29D0079B3FD /* Add.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 219196BC09D4F20000586B15 /* Add.tiff */; }; + 5CF96DEC132EA29D0079B3FD /* Remove_Pressed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 219196BD09D4F20000586B15 /* Remove_Pressed.tiff */; }; + 5CF96DED132EA29D0079B3FD /* Remove.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 219196BE09D4F20000586B15 /* Remove.tiff */; }; + 5CF96DEF132EA29D0079B3FD /* MakeDefault.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 21A38EE312EA864400CEB5F0 /* MakeDefault.tiff */; }; + 5CF96DF0132EA29D0079B3FD /* DFCapRightInactive.png in Resources */ = {isa = PBXBuildFile; fileRef = 21DF19AE10D172F600543C35 /* DFCapRightInactive.png */; }; + 5CF96DF1132EA29D0079B3FD /* DFCapRight.png in Resources */ = {isa = PBXBuildFile; fileRef = 21DF19AF10D172F600543C35 /* DFCapRight.png */; }; + 5CF96DF3132EA29D0079B3FD /* DFCapLeftRounded.png in Resources */ = {isa = PBXBuildFile; fileRef = 21DF19B110D172F600543C35 /* DFCapLeftRounded.png */; }; + 5CF96DF4132EA29D0079B3FD /* Search.png in Resources */ = {isa = PBXBuildFile; fileRef = 21665A9C10E6032F00188D3D /* Search.png */; }; + 5CF96DF7132EA29D0079B3FD /* ClearPressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 212C6EA2110E493C004DD82C /* ClearPressed.tif */; }; + 5CF96DF8132EA29D0079B3FD /* LinkBack.tif in Resources */ = {isa = PBXBuildFile; fileRef = 216D9C2B12CFEF2A0004B9CE /* LinkBack.tif */; }; + 5CF96DFA132EA29D0079B3FD /* SnapBack.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2143D2F310E953F500127EA6 /* SnapBack.tif */; }; + 5CF96DFC132EA29D0079B3FD /* statusValidated.png in Resources */ = {isa = PBXBuildFile; fileRef = 21B1C16E110764570004A7D0 /* statusValidated.png */; }; + 5CF96DFE132EA29D0079B3FD /* statusInProgress.png in Resources */ = {isa = PBXBuildFile; fileRef = 21B1C170110764570004A7D0 /* statusInProgress.png */; }; + 5CF96DFF132EA29D0079B3FD /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2114C259095885C800614E74 /* Localizable.strings */; }; + 5CF96E04132EA29D0079B3FD /* CarbonErrorStrings.plist in Resources */ = {isa = PBXBuildFile; fileRef = 212850860B56E549005F6E34 /* CarbonErrorStrings.plist */; }; + 5CF96E09132EA29D0079B3FD /* DeletionManager.nib in Resources */ = {isa = PBXBuildFile; fileRef = 212DCFF50A6E005000F74E46 /* DeletionManager.nib */; }; + 5CF96E0A132EA29D0079B3FD /* EncodingsManager.nib in Resources */ = {isa = PBXBuildFile; fileRef = 212DCB2F0A6AE38500F74E46 /* EncodingsManager.nib */; }; + 5CF96E0B132EA29D0079B3FD /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 219195E409D3A20F00586B15 /* Preferences.xib */; }; + 5CF96E0C132EA29D0079B3FD /* NotationPrefsView.nib in Resources */ = {isa = PBXBuildFile; fileRef = 21A2FA7A09DF64E9001AF0B5 /* NotationPrefsView.nib */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - 930EC2F012C113080004E569 /* NotesTableCornerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 930EC2ED12C113080004E569 /* NotesTableCornerView.m */; }; - 930EC2F112C113080004E569 /* NotesTableHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 930EC2EF12C113080004E569 /* NotesTableHeaderCell.m */; }; - 9326D4B712C537F6001A0761 /* MAAttachedWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 9326D4B612C537F6001A0761 /* MAAttachedWindow.m */; }; - 93439D9912B120CA002946D7 /* scrollbarblue.tif in Resources */ = {isa = PBXBuildFile; fileRef = 93439D9812B120CA002946D7 /* scrollbarblue.tif */; }; - 93439DD912B12B31002946D7 /* CustomTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93439DD812B12B31002946D7 /* CustomTextFieldCell.m */; }; - 9349C10212C6743D00E8E5C2 /* TabClose_Front_Pressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9349C0FF12C6743D00E8E5C2 /* TabClose_Front_Pressed.tif */; }; - 9349C10312C6743D00E8E5C2 /* TabClose_Front_Rollover.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9349C10012C6743D00E8E5C2 /* TabClose_Front_Rollover.tif */; }; - 9349C10412C6743D00E8E5C2 /* TabClose_Front.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9349C10112C6743D00E8E5C2 /* TabClose_Front.tif */; }; - 936763CF12BAA34300107A04 /* greyscrollervertbottom.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 936763CC12BAA34300107A04 /* greyscrollervertbottom.tiff */; }; - 936763D012BAA34300107A04 /* greyscrollervertfill.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 936763CD12BAA34300107A04 /* greyscrollervertfill.tiff */; }; - 936763D112BAA34300107A04 /* greyscrollerverttop.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 936763CE12BAA34300107A04 /* greyscrollerverttop.tiff */; }; - 9367644F12BBB7B700107A04 /* greyscrollervertbottom2.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 9367644C12BBB7B700107A04 /* greyscrollervertbottom2.tiff */; }; - 9367645012BBB7B700107A04 /* greyscrollervertfill2.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 9367644D12BBB7B700107A04 /* greyscrollervertfill2.tiff */; }; - 9367645112BBB7B700107A04 /* greyscrollerverttop2.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 9367644E12BBB7B700107A04 /* greyscrollerverttop2.tiff */; }; - 9397BAF812B044FB004D25E9 /* BTTransparentScroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 9397BAF712B044FB004D25E9 /* BTTransparentScroller.m */; }; - 9397BB0512B04686004D25E9 /* BTransparentScrollerKnobBottom.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BAF912B04686004D25E9 /* BTransparentScrollerKnobBottom.tif */; }; - 9397BB0612B04686004D25E9 /* BTransparentScrollerKnobHorizontalFill.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BAFA12B04686004D25E9 /* BTransparentScrollerKnobHorizontalFill.tif */; }; - 9397BB0712B04686004D25E9 /* BTransparentScrollerKnobLeft.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BAFB12B04686004D25E9 /* BTransparentScrollerKnobLeft.tif */; }; - 9397BB0812B04686004D25E9 /* BTransparentScrollerKnobRight.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BAFC12B04686004D25E9 /* BTransparentScrollerKnobRight.tif */; }; - 9397BB0912B04686004D25E9 /* BTransparentScrollerKnobTop.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BAFD12B04686004D25E9 /* BTransparentScrollerKnobTop.tif */; }; - 9397BB0A12B04686004D25E9 /* BTransparentScrollerKnobVerticalFill.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BAFE12B04686004D25E9 /* BTransparentScrollerKnobVerticalFill.tif */; }; - 9397BB0C12B04686004D25E9 /* BTransparentScrollerSlotHorizontalFill.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BB0012B04686004D25E9 /* BTransparentScrollerSlotHorizontalFill.tif */; }; - 9397BB0D12B04686004D25E9 /* BTransparentScrollerSlotLeft.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BB0112B04686004D25E9 /* BTransparentScrollerSlotLeft.tif */; }; - 9397BB0E12B04686004D25E9 /* BTransparentScrollerSlotRight.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BB0212B04686004D25E9 /* BTransparentScrollerSlotRight.tif */; }; - 9397BB0F12B04686004D25E9 /* BTransparentScrollerSlotTop.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BB0312B04686004D25E9 /* BTransparentScrollerSlotTop.tif */; }; - 9397BB1012B04686004D25E9 /* BTransparentScrollerSlotVerticalFill.tif in Resources */ = {isa = PBXBuildFile; fileRef = 9397BB0412B04686004D25E9 /* BTransparentScrollerSlotVerticalFill.tif */; }; - 9397BBE012B05991004D25E9 /* BlueTransparentScroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 9397BBDE12B05991004D25E9 /* BlueTransparentScroller.m */; }; - 9397BBE312B059AD004D25E9 /* WhiteTransparentScroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 9397BBE212B059AD004D25E9 /* WhiteTransparentScroller.m */; }; - 939D7EB212E5932700E7C2F3 /* FullscreenWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 939D7EB112E5932700E7C2F3 /* FullscreenWindow.m */; }; - 93A081E112ACF30200DAB227 /* BWToolkitFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93A081E012ACF30200DAB227 /* BWToolkitFramework.framework */; }; - 93A413BD12E18741002340FD /* SaveHTMLPreview.nib in Resources */ = {isa = PBXBuildFile; fileRef = 93A413BC12E18741002340FD /* SaveHTMLPreview.nib */; }; - 93B9E6DA12E5440000DEDECF /* __init__.py in Resources */ = {isa = PBXBuildFile; fileRef = 93B9E6D112E5440000DEDECF /* __init__.py */; }; - 93B9E6DB12E5440000DEDECF /* BeautifulSoup.py in Resources */ = {isa = PBXBuildFile; fileRef = 93B9E6D212E5440000DEDECF /* BeautifulSoup.py */; }; - 93B9E6DC12E5440000DEDECF /* BeautifulSoup.pyc in Resources */ = {isa = PBXBuildFile; fileRef = 93B9E6D312E5440000DEDECF /* BeautifulSoup.pyc */; }; - 93B9E6DD12E5440000DEDECF /* html2text.py in Resources */ = {isa = PBXBuildFile; fileRef = 93B9E6D412E5440000DEDECF /* html2text.py */; }; - 93B9E6DE12E5440000DEDECF /* page_parser.py in Resources */ = {isa = PBXBuildFile; fileRef = 93B9E6D512E5440000DEDECF /* page_parser.py */; }; - 93B9E6DF12E5440000DEDECF /* page_parser.pyc in Resources */ = {isa = PBXBuildFile; fileRef = 93B9E6D612E5440000DEDECF /* page_parser.pyc */; }; - 93B9E6E012E5440000DEDECF /* readability.py in Resources */ = {isa = PBXBuildFile; fileRef = 93B9E6D712E5440000DEDECF /* readability.py */; }; - 93B9E6E112E5440000DEDECF /* url_helpers.py in Resources */ = {isa = PBXBuildFile; fileRef = 93B9E6D812E5440000DEDECF /* url_helpers.py */; }; - 93B9E6E212E5440000DEDECF /* url_helpers.pyc in Resources */ = {isa = PBXBuildFile; fileRef = 93B9E6D912E5440000DEDECF /* url_helpers.pyc */; }; - 93B9E6E512E5445100DEDECF /* __init__.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 93B9E6D112E5440000DEDECF /* __init__.py */; }; - 93B9E6E612E5445100DEDECF /* BeautifulSoup.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 93B9E6D212E5440000DEDECF /* BeautifulSoup.py */; }; - 93B9E6E712E5445100DEDECF /* BeautifulSoup.pyc in CopyFiles */ = {isa = PBXBuildFile; fileRef = 93B9E6D312E5440000DEDECF /* BeautifulSoup.pyc */; }; - 93B9E6E812E5445100DEDECF /* html2text.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 93B9E6D412E5440000DEDECF /* html2text.py */; }; - 93B9E6E912E5445100DEDECF /* page_parser.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 93B9E6D512E5440000DEDECF /* page_parser.py */; }; - 93B9E6EA12E5445100DEDECF /* page_parser.pyc in CopyFiles */ = {isa = PBXBuildFile; fileRef = 93B9E6D612E5440000DEDECF /* page_parser.pyc */; }; - 93B9E6EB12E5445100DEDECF /* readability.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 93B9E6D712E5440000DEDECF /* readability.py */; }; - 93B9E6EC12E5445100DEDECF /* url_helpers.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = 93B9E6D812E5440000DEDECF /* url_helpers.py */; }; - 93B9E6ED12E5445100DEDECF /* url_helpers.pyc in CopyFiles */ = {isa = PBXBuildFile; fileRef = 93B9E6D912E5440000DEDECF /* url_helpers.pyc */; }; - 93CF647912B66B030088ADC4 /* BTTableHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CF647812B66B030088ADC4 /* BTTableHeaderCell.m */; }; - 93CF647F12B66F4A0088ADC4 /* tan_column_header.png in Resources */ = {isa = PBXBuildFile; fileRef = 93CF647E12B66F4A0088ADC4 /* tan_column_header.png */; }; - 93EE398612B1D803007E6B27 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 93EE398512B1D803007E6B27 /* dsa_pub.pem */; }; + 93A158BC133C304D00E1E7DA /* Markdownify.nvhelp in Resources */ = {isa = PBXBuildFile; fileRef = 93A158BB133C304D00E1E7DA /* Markdownify.nvhelp */; }; + 93A158BE133C497400E1E7DA /* Notality.icns in Resources */ = {isa = PBXBuildFile; fileRef = 93A158BD133C497400E1E7DA /* Notality.icns */; }; + 93B348281371547800658F98 /* HUDIconLock.png in Resources */ = {isa = PBXBuildFile; fileRef = 93B348241371547800658F98 /* HUDIconLock.png */; }; + 93B348291371547800658F98 /* HUDIconPrint.png in Resources */ = {isa = PBXBuildFile; fileRef = 93B348251371547800658F98 /* HUDIconPrint.png */; }; + 93B3482A1371547800658F98 /* HUDIconSave.png in Resources */ = {isa = PBXBuildFile; fileRef = 93B348261371547800658F98 /* HUDIconSave.png */; }; + 93B3482B1371547800658F98 /* HUDIconShare.png in Resources */ = {isa = PBXBuildFile; fileRef = 93B348271371547800658F98 /* HUDIconShare.png */; }; D3EECA00106F66C70023D7F8 /* NVPasswordGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = D3EEC9FE106F66C70023D7F8 /* NVPasswordGenerator.m */; }; /* End PBXBuildFile section */ @@ -234,35 +276,26 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 212EEAC112F085DB00F89538 /* AutoHyperlinks.framework in CopyFiles */, 213623FC0B92AA6E008C0830 /* Sparkle.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; - 93A0813012ACF18600DAB227 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3FB0FB2312DC45CA003DC14E /* BWToolkitFramework.framework in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 93B9E6E412E5444600DEDECF /* CopyFiles */ = { + 5C96F565131C35A300A2E4AC /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 6; files = ( - 93B9E6E512E5445100DEDECF /* __init__.py in CopyFiles */, - 93B9E6E612E5445100DEDECF /* BeautifulSoup.py in CopyFiles */, - 93B9E6E712E5445100DEDECF /* BeautifulSoup.pyc in CopyFiles */, - 93B9E6E812E5445100DEDECF /* html2text.py in CopyFiles */, - 93B9E6E912E5445100DEDECF /* page_parser.py in CopyFiles */, - 93B9E6EA12E5445100DEDECF /* page_parser.pyc in CopyFiles */, - 93B9E6EB12E5445100DEDECF /* readability.py in CopyFiles */, - 93B9E6EC12E5445100DEDECF /* url_helpers.py in CopyFiles */, - 93B9E6ED12E5445100DEDECF /* url_helpers.pyc in CopyFiles */, + 5C96F566131C35AB00A2E4AC /* __init__.py in CopyFiles */, + 5C96F567131C35AB00A2E4AC /* BeautifulSoup.py in CopyFiles */, + 5C96F568131C35AB00A2E4AC /* BeautifulSoup.pyc in CopyFiles */, + 5C96F569131C35AB00A2E4AC /* html2text.py in CopyFiles */, + 5C96F56A131C35AB00A2E4AC /* page_parser.py in CopyFiles */, + 5C96F56B131C35AB00A2E4AC /* page_parser.pyc in CopyFiles */, + 5C96F56C131C35AB00A2E4AC /* readability.py in CopyFiles */, + 5C96F56D131C35AB00A2E4AC /* url_helpers.py in CopyFiles */, + 5C96F56E131C35AB00A2E4AC /* url_helpers.pyc in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -282,7 +315,7 @@ 211345A90B35D8540081B064 /* broken_md5.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = broken_md5.c; sourceTree = ""; }; 211345AA0B35D8540081B064 /* broken_md5.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = broken_md5.h; sourceTree = ""; }; 2114C11409575BD400614E74 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; - 2114C11509575BD400614E74 /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = ""; }; + 2114C11509575BD400614E74 /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = ""; wrapsLines = 1; }; 2114C13D0957732800614E74 /* NotationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotationController.h; sourceTree = ""; }; 2114C13E0957732800614E74 /* NotationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotationController.m; sourceTree = ""; }; 2114C1440957733200614E74 /* NoteObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoteObject.h; sourceTree = ""; }; @@ -318,6 +351,7 @@ 212DCF5F0A6DEECB00F74E46 /* DeletionManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DeletionManager.h; sourceTree = ""; }; 212DCF600A6DEECB00F74E46 /* DeletionManager.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = DeletionManager.m; sourceTree = ""; }; 212DCFF60A6E005000F74E46 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/DeletionManager.nib; sourceTree = ""; }; + 212EEAB812F085D100F89538 /* AutoHyperlinks.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AutoHyperlinks.framework; sourceTree = ""; }; 21317FAE1113840E00472211 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = English; path = "English.lproj/Excruciatingly Useful Shortcuts.nvhelp"; sourceTree = ""; }; 213621E80B92413F008C0830 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/FindPanel.nib; sourceTree = ""; }; 213621EF0B92414F008C0830 /* MultiTextFinder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultiTextFinder.h; sourceTree = ""; }; @@ -343,6 +377,8 @@ 2144987D0AE192F900E2A2B6 /* PassphraseChanger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PassphraseChanger.h; sourceTree = ""; }; 21469C890BEBA6A10094835F /* TemporaryFileCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemporaryFileCache.h; sourceTree = ""; }; 21469C8A0BEBA6A10094835F /* TemporaryFileCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TemporaryFileCache.m; sourceTree = ""; }; + 215309F212E4E92300AF2739 /* DiskUUIDEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskUUIDEntry.h; sourceTree = ""; }; + 215309F312E4E92300AF2739 /* DiskUUIDEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DiskUUIDEntry.m; sourceTree = ""; }; 21544FB90B06331800C0D1D5 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/KeyDerivationManager.nib; sourceTree = ""; }; 21544FBF0B06332600C0D1D5 /* KeyDerivationManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KeyDerivationManager.h; sourceTree = ""; }; 21544FC00B06332600C0D1D5 /* KeyDerivationManager.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = KeyDerivationManager.m; sourceTree = ""; }; @@ -353,7 +389,7 @@ 2155DEA5097B5F0300163A10 /* BufferUtils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = BufferUtils.c; sourceTree = ""; }; 2155DF42097C992800163A10 /* AttributedPlainText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AttributedPlainText.h; sourceTree = ""; }; 2155DF43097C992800163A10 /* AttributedPlainText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AttributedPlainText.m; sourceTree = ""; }; - 21582DC40B73F59A00711663 /* BookmarksController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BookmarksController.m; sourceTree = ""; }; + 21582DC40B73F59A00711663 /* BookmarksController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BookmarksController.m; sourceTree = ""; wrapsLines = 1; }; 215DE83609ECC4FE009A710B /* HeaderViewWIthMenu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HeaderViewWIthMenu.h; sourceTree = ""; }; 215DE83709ECC4FE009A710B /* HeaderViewWIthMenu.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = HeaderViewWIthMenu.m; sourceTree = ""; }; 215DEA3D09EF5323009A710B /* General.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = General.tiff; path = Images/General.tiff; sourceTree = ""; }; @@ -363,16 +399,17 @@ 2168EC5109E33B0300778D02 /* FrozenNotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrozenNotation.h; sourceTree = ""; }; 2168EC5209E33B0300778D02 /* FrozenNotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FrozenNotation.m; sourceTree = ""; }; 216BA24210746E3900F62D93 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ImporterAccessory.nib; sourceTree = ""; }; + 216D987D12CE68AD0004B9CE /* NSFileManager_NV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSFileManager_NV.h; sourceTree = ""; }; + 216D987E12CE68AD0004B9CE /* NSFileManager_NV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSFileManager_NV.m; sourceTree = ""; }; + 216D9C2B12CFEF2A0004B9CE /* LinkBack.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = LinkBack.tif; path = Images/LinkBack.tif; sourceTree = ""; }; + 216D9C2C12CFEF2A0004B9CE /* LinkBackPressed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = LinkBackPressed.tif; path = Images/LinkBackPressed.tif; sourceTree = ""; }; + 216DA1AC12D15F310004B9CE /* ListDividerDrag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ListDividerDrag.png; path = Images/ListDividerDrag.png; sourceTree = ""; }; + 216DA22412D17DB70004B9CE /* AugmentedScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AugmentedScrollView.h; sourceTree = ""; }; + 216DA22512D17DB70004B9CE /* AugmentedScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AugmentedScrollView.m; sourceTree = ""; }; 217CEBA109E9885500DF0E09 /* NotationFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotationFileManager.h; sourceTree = ""; }; 217CEBA209E9885500DF0E09 /* NotationFileManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotationFileManager.m; sourceTree = ""; }; - 217D02D30B77061E0004E02D /* BodyScroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BodyScroller.h; sourceTree = ""; }; - 217D02D40B77061E0004E02D /* BodyScroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BodyScroller.m; sourceTree = ""; }; 217D4280096545A000E84749 /* LabelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelObject.h; sourceTree = ""; }; 217D4281096545A000E84749 /* LabelObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LabelObject.m; sourceTree = ""; }; - 217D4B570A61F42700887100 /* NSTextFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTextFinder.h; sourceTree = ""; }; - 217EAF0D0B0D56860041A8A9 /* FocusRingScrollView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FocusRingScrollView.h; sourceTree = ""; }; - 217EAF0E0B0D56860041A8A9 /* FocusRingScrollView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FocusRingScrollView.m; sourceTree = ""; }; - 217EB3CD0B0F62FB0041A8A9 /* NSTextFinder_LastFind.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NSTextFinder_LastFind.m; sourceTree = ""; }; 2181171109F311110020A252 /* DeletedNoteObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeletedNoteObject.h; sourceTree = ""; }; 2181171209F311110020A252 /* DeletedNoteObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DeletedNoteObject.m; sourceTree = ""; }; 2181193909FA9CF90020A252 /* SynchronizedNoteProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SynchronizedNoteProtocol.h; sourceTree = ""; }; @@ -382,8 +419,8 @@ 2182B397106B2296008641E4 /* RBSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RBSplitView.h; path = RBSplitView/RBSplitView.h; sourceTree = ""; }; 2182B398106B2296008641E4 /* RBSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RBSplitView.m; path = RBSplitView/RBSplitView.m; sourceTree = ""; }; 2182B399106B2296008641E4 /* RBSplitViewPrivateDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RBSplitViewPrivateDefines.h; path = RBSplitView/RBSplitViewPrivateDefines.h; sourceTree = ""; }; - 21918FCE09C49B2400586B15 /* EmptyView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = EmptyView.m; sourceTree = ""; }; - 21918FCF09C49B2500586B15 /* EmptyView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EmptyView.h; sourceTree = ""; }; + 21918FCE09C49B2400586B15 /* EmptyView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = EmptyView.m; sourceTree = SOURCE_ROOT; }; + 21918FCF09C49B2500586B15 /* EmptyView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EmptyView.h; sourceTree = SOURCE_ROOT; }; 219190EF09C4A60600586B15 /* DualField.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DualField.h; sourceTree = ""; }; 219190F009C4A60700586B15 /* DualField.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = DualField.m; sourceTree = ""; }; 2191926309C52A9100586B15 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = /usr/lib/libcrypto.dylib; sourceTree = ""; }; @@ -392,7 +429,6 @@ 219192D309CFBC8700586B15 /* NoteAttributeColumn.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NoteAttributeColumn.m; sourceTree = ""; }; 2191930109CFBEBD00586B15 /* NotesTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NotesTableView.h; sourceTree = ""; }; 2191930209CFBEBD00586B15 /* NotesTableView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NotesTableView.m; sourceTree = ""; }; - 219195E509D3A20F00586B15 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Preferences.nib; sourceTree = ""; }; 219196BB09D4F20000586B15 /* Add_Pressed.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = Add_Pressed.tiff; path = Images/Add_Pressed.tiff; sourceTree = ""; }; 219196BC09D4F20000586B15 /* Add.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = Add.tiff; path = Images/Add.tiff; sourceTree = ""; }; 219196BD09D4F20000586B15 /* Remove_Pressed.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = Remove_Pressed.tiff; path = Images/Remove_Pressed.tiff; sourceTree = ""; }; @@ -400,7 +436,7 @@ 2191982009D607C600586B15 /* PrefsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PrefsWindowController.h; sourceTree = ""; }; 2191982109D607C600586B15 /* PrefsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = PrefsWindowController.m; sourceTree = ""; }; 219588D00961D7F200972B8C /* LinkingEditor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LinkingEditor.h; sourceTree = ""; }; - 219588D10961D7F200972B8C /* LinkingEditor.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = LinkingEditor.m; sourceTree = ""; }; + 219588D10961D7F200972B8C /* LinkingEditor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LinkingEditor.m; sourceTree = ""; }; 219739F90AFE42A10046683E /* PassphraseRetriever.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PassphraseRetriever.h; sourceTree = ""; }; 219739FA0AFE42A10046683E /* PassphraseRetriever.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = PassphraseRetriever.m; sourceTree = ""; }; 21973A240AFE447A0046683E /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/PassphraseRetriever.nib; sourceTree = ""; }; @@ -421,6 +457,10 @@ 21A2FA7B09DF64E9001AF0B5 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/NotationPrefsView.nib; sourceTree = ""; }; 21A30EA50971D11D0071E9AF /* FastListDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FastListDataSource.h; sourceTree = ""; }; 21A30EA60971D11D0071E9AF /* FastListDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FastListDataSource.m; sourceTree = ""; }; + 21A38EE212EA864400CEB5F0 /* MakeDefault_Pressed.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = MakeDefault_Pressed.tiff; path = Images/MakeDefault_Pressed.tiff; sourceTree = ""; }; + 21A38EE312EA864400CEB5F0 /* MakeDefault.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = MakeDefault.tiff; path = Images/MakeDefault.tiff; sourceTree = ""; }; + 21A3913812EB4C2F00CEB5F0 /* Spaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Spaces.h; sourceTree = ""; }; + 21A3913912EB4C2F00CEB5F0 /* Spaces.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Spaces.c; sourceTree = ""; }; 21A6E6FB0974204F008436A9 /* LabelsListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelsListController.h; sourceTree = ""; }; 21A6E6FC0974204F008436A9 /* LabelsListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LabelsListController.m; sourceTree = ""; }; 21A73DC6099712A8009F8A6C /* WALController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WALController.h; sourceTree = ""; }; @@ -430,7 +470,6 @@ 21AD284E110BE99B00B7A985 /* SyncSessionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SyncSessionController.h; sourceTree = ""; }; 21AD284F110BE99B00B7A985 /* SyncSessionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SyncSessionController.m; sourceTree = ""; }; 21AD292C110C188800B7A985 /* TinyAlert.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = TinyAlert.tif; path = Images/TinyAlert.tif; sourceTree = ""; }; - 21AD292E110C18AA00B7A985 /* Notality.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Notality.icns; path = Images/Notality.icns; sourceTree = ""; }; 21B1BC341104D20E0004A7D0 /* InvocationRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InvocationRecorder.h; sourceTree = ""; }; 21B1BC351104D20E0004A7D0 /* InvocationRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InvocationRecorder.m; sourceTree = ""; }; 21B1C16E110764570004A7D0 /* statusValidated.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = statusValidated.png; path = Images/statusValidated.png; sourceTree = ""; }; @@ -439,9 +478,13 @@ 21B548F8112F307E00E163A1 /* NotationDirectoryManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotationDirectoryManager.m; sourceTree = ""; }; 21B548F9112F307E00E163A1 /* NotationDirectoryManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotationDirectoryManager.h; sourceTree = ""; }; 21B54C011134F2E800E163A1 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; + 21B64A2412E61FA700D87EFC /* LabelColumnCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelColumnCell.h; sourceTree = ""; }; + 21B64A2512E61FA700D87EFC /* LabelColumnCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LabelColumnCell.m; sourceTree = ""; }; + 21B64C4D12E62A5700D87EFC /* UnifiedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UnifiedCell.m; sourceTree = ""; }; 21BD2ECF10DAF31500BA3DF6 /* LinearDividerShader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LinearDividerShader.m; sourceTree = ""; }; 21BD2ED010DAF31500BA3DF6 /* LinearDividerShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinearDividerShader.h; sourceTree = ""; }; 21BD2F3510DAF61700BA3DF6 /* SplitViewDimple.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = SplitViewDimple.tif; sourceTree = ""; }; + 21C0F8A112C7E7160068693F /* Fonts & Colors.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = "Fonts & Colors.tiff"; path = "Images/Fonts & Colors.tiff"; sourceTree = ""; }; 21C737930B50C73E0048C08A /* MultiplePageView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultiplePageView.h; sourceTree = ""; }; 21C737940B50C73E0048C08A /* MultiplePageView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MultiplePageView.m; sourceTree = ""; }; 21CB29AD10EEE39400360118 /* SyncServiceSessionProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SyncServiceSessionProtocol.h; sourceTree = ""; }; @@ -449,6 +492,16 @@ 21D5834D0B78F0CC00245E29 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 21D60126098FDB46007440DF /* GlobalPrefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlobalPrefs.h; sourceTree = ""; }; 21D60127098FDB46007440DF /* GlobalPrefs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GlobalPrefs.m; sourceTree = ""; }; + 21D6F7ED12E0C751005C2DA5 /* AppController_Importing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController_Importing.h; sourceTree = ""; }; + 21D6F7EE12E0C751005C2DA5 /* AppController_Importing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController_Importing.m; sourceTree = ""; }; + 21D6FB4712E104D6005C2DA5 /* NSBezierPath_NV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSBezierPath_NV.h; sourceTree = ""; }; + 21D6FB4812E104D6005C2DA5 /* NSBezierPath_NV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSBezierPath_NV.m; sourceTree = ""; }; + 21DB3D0D12D4FBDD0057F52B /* SecureTextEntryManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecureTextEntryManager.h; sourceTree = ""; }; + 21DB3D0E12D4FBDD0057F52B /* SecureTextEntryManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecureTextEntryManager.m; sourceTree = ""; }; + 21DB407D12D5383F0057F52B /* IBeamInverted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = IBeamInverted.png; path = Images/IBeamInverted.png; sourceTree = ""; }; + 21DB49BA12DE19480057F52B /* UnifiedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnifiedCell.h; sourceTree = ""; }; + 21DB4BE412DE4E3D0057F52B /* NSString_CustomTruncation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_CustomTruncation.h; sourceTree = ""; }; + 21DB4BE512DE4E3D0057F52B /* NSString_CustomTruncation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSString_CustomTruncation.m; sourceTree = ""; }; 21DC788D097894B600E59B09 /* NSCollection_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSCollection_utils.h; sourceTree = ""; }; 21DC788E097894B600E59B09 /* NSCollection_utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSCollection_utils.m; sourceTree = ""; }; 21DF19AE10D172F600543C35 /* DFCapRightInactive.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DFCapRightInactive.png; path = Images/DFCapRightInactive.png; sourceTree = ""; }; @@ -458,25 +511,6 @@ 21E6B0960B6E6D0B001ABEDC /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/URLGetter.nib; sourceTree = ""; }; 21E6B09D0B6E6D18001ABEDC /* URLGetter.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = URLGetter.m; sourceTree = ""; }; 21E6B09E0B6E6D18001ABEDC /* URLGetter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = URLGetter.h; sourceTree = ""; }; - 21E6EC20111DD52B0038ECC7 /* French */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = French; path = "French.lproj/Comment ça marche.nvhelp"; sourceTree = ""; }; - 21EA3679111C9A2600E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/BlorPasswordRetriever.nib; sourceTree = ""; }; - 21EA367D111C9A5C00E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/URLGetter.nib; sourceTree = ""; }; - 21EA367F111C9A6D00E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/PTKeyComboPanel.nib; sourceTree = ""; }; - 21EA3681111C9A6D00E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/NotationPrefsView.nib; sourceTree = ""; }; - 21EA3682111C9A6D00E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/PassphraseChanger.nib; sourceTree = ""; }; - 21EA3683111C9A6D00E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/PassphrasePicker.nib; sourceTree = ""; }; - 21EA3684111C9A6D00E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/PassphraseRetriever.nib; sourceTree = ""; }; - 21EA3686111C9A7500E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/KeyDerivationManager.nib; sourceTree = ""; }; - 21EA3687111C9A8200E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/ImporterAccessory.nib; sourceTree = ""; }; - 21EA3689111C9AA000E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/DeletionManager.nib; sourceTree = ""; }; - 21EA368A111C9AA000E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/EncodingsManager.nib; sourceTree = ""; }; - 21EA368B111C9AA000E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/ExporterManager.nib; sourceTree = ""; }; - 21EA368D111C9ABB00E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/InfoPlist.strings; sourceTree = ""; }; - 21EA3692111C9AD900E2B517 /* French */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = French; path = "French.lproj/Raccourcis incroyablement utiles.nvhelp"; sourceTree = ""; }; - 21EA3696111C9AD900E2B517 /* French */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = French; path = "French.lproj/Ceci est le titre d'une note.nvhelp"; sourceTree = ""; }; - 21EA3698111C9AD900E2B517 /* French */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = French; path = French.lproj/Contact.nvhelp; sourceTree = ""; }; - 21EA36A6111C9B8900E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = French; path = French.lproj/CarbonErrorStrings.plist; sourceTree = ""; }; - 21EA3727111CBCB500E2B517 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/Localizable.strings; sourceTree = ""; }; 21F078FA10EC280E004FE56F /* NotationSyncServiceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotationSyncServiceManager.h; sourceTree = ""; }; 21F078FB10EC280E004FE56F /* NotationSyncServiceManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotationSyncServiceManager.m; sourceTree = ""; }; 21F0794110EC5EA2004FE56F /* SimplenoteSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimplenoteSession.h; sourceTree = ""; }; @@ -505,109 +539,187 @@ 21F1CD9A0B3A3F88001FB5F6 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/PTKeyComboPanel.nib; sourceTree = ""; }; 21F1CDAB0B3A401F001FB5F6 /* PTKeyCombo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PTKeyCombo.h; path = PTHotKeys/PTKeyCombo.h; sourceTree = ""; }; 21F1CDAC0B3A401F001FB5F6 /* PTKeyCombo.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PTKeyCombo.m; path = PTHotKeys/PTKeyCombo.m; sourceTree = ""; }; - 21F447E911B896C4004D008B /* Portuguese */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Portuguese; path = "Portuguese.lproj/Atalhos Incrivelmente Úteis.nvhelp"; sourceTree = ""; }; - 21F447EB11B896C4004D008B /* Portuguese */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Portuguese; path = "Portuguese.lproj/Como funciona isso?.nvhelp"; sourceTree = ""; }; - 21F447ED11B896C4004D008B /* Portuguese */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Portuguese; path = "Portuguese.lproj/Este é o título de uma nota.nvhelp"; sourceTree = ""; }; - 21F447EF11B896C4004D008B /* Portuguese */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Portuguese; path = "Portuguese.lproj/Informações de Contato.nvhelp"; sourceTree = ""; }; - 21F4481111B896FC004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/DeletionManager.nib; sourceTree = ""; }; - 21F4481211B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/BlorPasswordRetriever.nib; sourceTree = ""; }; - 21F4481311B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/EncodingsManager.nib; sourceTree = ""; }; - 21F4481411B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/ExporterManager.nib; sourceTree = ""; }; - 21F4481611B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/ImporterAccessory.nib; sourceTree = ""; }; - 21F4481711B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/KeyDerivationManager.nib; sourceTree = ""; }; - 21F4481811B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/NotationPrefsView.nib; sourceTree = ""; }; - 21F4481911B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/PassphraseChanger.nib; sourceTree = ""; }; - 21F4481A11B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/PassphrasePicker.nib; sourceTree = ""; }; - 21F4481B11B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/PassphraseRetriever.nib; sourceTree = ""; }; - 21F4481D11B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/PTKeyComboPanel.nib; sourceTree = ""; }; - 21F4482111B8971D004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Portuguese; path = Portuguese.lproj/URLGetter.nib; sourceTree = ""; }; - 21F4482311B89818004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Portuguese; path = Portuguese.lproj/CarbonErrorStrings.plist; sourceTree = ""; }; - 21F4482411B89818004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Portuguese; path = Portuguese.lproj/InfoPlist.strings; sourceTree = ""; }; - 21F4482511B89818004D008B /* Portuguese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Portuguese; path = Portuguese.lproj/Localizable.strings; sourceTree = ""; }; 21F4599B0A92E01C00FB6FFE /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 21FF94EE0B5AD22800DB6A2F /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ExporterManager.nib; sourceTree = ""; }; 21FF94F50B5AD23B00DB6A2F /* ExporterManager.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ExporterManager.m; sourceTree = ""; }; 21FF94F60B5AD23B00DB6A2F /* ExporterManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ExporterManager.h; sourceTree = ""; }; - 21FFBA96111EC0A9004CB80B /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* Notation_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Notation_Prefix.pch; sourceTree = ""; }; - 3FB0FAE912DC455B003DC14E /* BWToolkitFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BWToolkitFramework.framework; path = "../Interface Builder Plug-Ins/BWToolkit/BWToolkitFramework.framework"; sourceTree = SOURCE_ROOT; }; - 57F27F7A11973A7F00C63ACF /* Notation.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.sdef; path = Notation.sdef; sourceTree = ""; }; + 57F27F7A11973A7F00C63ACF /* Notation.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Notation.sdef; sourceTree = ""; }; 57F27FB71197407400C63ACF /* SearchCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchCommand.h; sourceTree = ""; }; 57F27FB81197407400C63ACF /* SearchCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchCommand.m; sourceTree = ""; }; - 608A24D01268DB9F00EEF326 /* NSString_Textile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_Textile.h; sourceTree = ""; }; - 608A24D11268DB9F00EEF326 /* NSString_Textile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSString_Textile.m; sourceTree = ""; }; - 608A24ED1268DCF900EEF326 /* Textile_2.12 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Textile_2.12; sourceTree = ""; }; - 608A24F31268DDC800EEF326 /* Markdown_1.0.1 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Markdown_1.0.1; sourceTree = ""; }; - 608A24F91268DDF200EEF326 /* NSString_Markdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_Markdown.h; sourceTree = ""; }; - 608A24FA1268DDF200EEF326 /* NSString_Markdown.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSString_Markdown.m; sourceTree = ""; }; - 608A25061268DEAB00EEF326 /* MultiMarkdown */ = {isa = PBXFileReference; lastKnownFileType = folder; path = MultiMarkdown; sourceTree = ""; }; - 608A25631268DEAB00EEF326 /* NSString_MultiMarkdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_MultiMarkdown.h; sourceTree = ""; }; - 608A25641268DEAB00EEF326 /* NSString_MultiMarkdown.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSString_MultiMarkdown.m; sourceTree = ""; }; - 608A25781268DF9700EEF326 /* MarkupPreview.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MarkupPreview.xib; sourceTree = ""; }; - 608A25AD1268ECFA00EEF326 /* PreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreviewController.h; sourceTree = ""; }; - 608A25AE1268ECFA00EEF326 /* PreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreviewController.m; sourceTree = ""; }; - 608A25B41268EE5E00EEF326 /* AppController_Preview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController_Preview.h; sourceTree = ""; }; - 608A25B51268EE5E00EEF326 /* AppController_Preview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController_Preview.m; sourceTree = ""; }; + 5C1830CB132EA675005E2210 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MarkupPreview.xib; sourceTree = ""; }; + 5C1830CE132EA687005E2210 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/SaveHTMLPreview.nib; sourceTree = ""; }; + 5C1830D3132EA6A4005E2210 /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/SaveHTMLPreview.nib; sourceTree = ""; }; + 5C1830D4132EA6A4005E2210 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/SaveHTMLPreview.nib; sourceTree = ""; }; + 5C1830D5132EA6A4005E2210 /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/SaveHTMLPreview.nib; sourceTree = ""; }; + 5C2CC182134989A8006FFE56 /* nvMenu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = nvMenu.png; path = Images/nvMenu.png; sourceTree = ""; }; + 5C2CC183134989A8006FFE56 /* nvMenuC.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = nvMenuC.png; path = Images/nvMenuC.png; sourceTree = ""; }; + 5C2CC189134989D7006FFE56 /* nvMenuDark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = nvMenuDark.png; path = Images/nvMenuDark.png; sourceTree = ""; }; + 5C2CD035132ED47900CA0D7C /* ETScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ETScrollView.h; sourceTree = ""; }; + 5C2CD036132ED47900CA0D7C /* ETScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ETScrollView.m; sourceTree = ""; }; + 5C49E364131C5CC500696B68 /* Credits.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Credits.html; sourceTree = ""; }; + 5C49E553131C72FD00696B68 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = ""; }; + 5C4B35351307220E00014119 /* TransparentScrollerKnobBottom.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentScrollerKnobBottom.tif; sourceTree = ""; }; + 5C4B35361307220E00014119 /* TransparentScrollerKnobTop.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentScrollerKnobTop.tif; sourceTree = ""; }; + 5C4B35371307220E00014119 /* TransparentScrollerKnobVerticalFill.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentScrollerKnobVerticalFill.tif; sourceTree = ""; }; + 5C4B35381307220E00014119 /* TransparentScrollerSlotBottom.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentScrollerSlotBottom.tif; sourceTree = ""; }; + 5C4B35391307220E00014119 /* TransparentScrollerSlotTop.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentScrollerSlotTop.tif; sourceTree = ""; }; + 5C4B353A1307220E00014119 /* TransparentScrollerSlotVerticalFill.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentScrollerSlotVerticalFill.tif; sourceTree = ""; }; + 5C4B35681307225000014119 /* ETTransparentScroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ETTransparentScroller.h; sourceTree = ""; }; + 5C4B35691307225000014119 /* ETTransparentScroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ETTransparentScroller.m; sourceTree = ""; }; + 5C5713F01309A42600961090 /* SplitViewDimple2.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = SplitViewDimple2.tif; sourceTree = ""; }; + 5C94376C132A0C9D00B08B80 /* greyscrollervertbottom3.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollervertbottom3.tif; sourceTree = ""; }; + 5C94376D132A0C9D00B08B80 /* greyscrollervertfill3.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollervertfill3.tif; sourceTree = ""; }; + 5C94376E132A0C9D00B08B80 /* greyscrollerverttop3.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollerverttop3.tif; sourceTree = ""; }; + 5C96F4FC131C2F9500A2E4AC /* TabClose_Front_Pressed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Front_Pressed.tif; sourceTree = ""; }; + 5C96F4FD131C2F9500A2E4AC /* TabClose_Front_Rollover.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Front_Rollover.tif; sourceTree = ""; }; + 5C96F4FE131C2F9500A2E4AC /* TabClose_Front.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Front.tif; sourceTree = ""; }; + 5C96F502131C2FA800A2E4AC /* BTTransparentScroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTTransparentScroller.m; sourceTree = ""; }; + 5C96F503131C2FA800A2E4AC /* BTTransparentScroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTTransparentScroller.h; sourceTree = ""; }; + 5C96F5A9131C37DF00A2E4AC /* NSString_MultiMarkdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_MultiMarkdown.h; sourceTree = ""; }; + 5C96F5AA131C37DF00A2E4AC /* NSString_MultiMarkdown.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSString_MultiMarkdown.m; sourceTree = ""; }; + 5C96F5AB131C37DF00A2E4AC /* NSString_Markdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_Markdown.h; sourceTree = ""; }; + 5C96F5AC131C37DF00A2E4AC /* NSString_Markdown.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSString_Markdown.m; sourceTree = ""; }; + 5C96F5AD131C37DF00A2E4AC /* NSString_Textile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_Textile.h; sourceTree = ""; }; + 5C96F5AE131C37DF00A2E4AC /* NSString_Textile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSString_Textile.m; sourceTree = ""; }; + 5C96F5B2131C37F500A2E4AC /* MultiMarkdown */ = {isa = PBXFileReference; lastKnownFileType = folder; path = MultiMarkdown; sourceTree = ""; }; + 5C96F610131C380100A2E4AC /* Textile_2.12 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Textile_2.12; sourceTree = ""; }; + 5C96F617131C380C00A2E4AC /* Markdown_1.0.1 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Markdown_1.0.1; sourceTree = ""; }; + 5C96F6DD131C488B00A2E4AC /* ETTransparentButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ETTransparentButtonCell.m; sourceTree = ""; }; + 5C96F6E7131C48FE00A2E4AC /* ETTransparentButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ETTransparentButton.h; sourceTree = ""; }; + 5C96F6E8131C48FE00A2E4AC /* ETTransparentButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ETTransparentButton.m; sourceTree = ""; }; + 5C96F703131C49D400A2E4AC /* TransparentButtonFillN.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentButtonFillN.tiff; sourceTree = ""; }; + 5C96F704131C49D400A2E4AC /* TransparentButtonFillP.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentButtonFillP.tiff; sourceTree = ""; }; + 5C96F705131C49D400A2E4AC /* TransparentButtonLeftN.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentButtonLeftN.tiff; sourceTree = ""; }; + 5C96F706131C49D400A2E4AC /* TransparentButtonLeftP.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentButtonLeftP.tiff; sourceTree = ""; }; + 5C96F707131C49D400A2E4AC /* TransparentButtonRightN.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentButtonRightN.tiff; sourceTree = ""; }; + 5C96F708131C49D400A2E4AC /* TransparentButtonRightP.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TransparentButtonRightP.tiff; sourceTree = ""; }; + 5C9C7732131DA04200FB2652 /* WordCountToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordCountToken.h; sourceTree = ""; }; + 5C9C7733131DA04300FB2652 /* WordCountToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WordCountToken.m; sourceTree = ""; }; + 5CA08C1E13301D5E004E3250 /* ETContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ETContentView.h; sourceTree = ""; }; + 5CA08C1F13301D5E004E3250 /* ETContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ETContentView.m; sourceTree = ""; }; + 5CA10F18131C297000DE1F91 /* PreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreviewController.h; sourceTree = ""; }; + 5CA10F19131C297000DE1F91 /* PreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreviewController.m; sourceTree = ""; }; + 5CA10F30131C29E900DE1F91 /* AppController_Preview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController_Preview.h; sourceTree = SOURCE_ROOT; }; + 5CA10F31131C29E900DE1F91 /* AppController_Preview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController_Preview.m; sourceTree = SOURCE_ROOT; }; + 5CA10F39131C2A3F00DE1F91 /* MAAttachedWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MAAttachedWindow.h; sourceTree = ""; }; + 5CA10F3A131C2A3F00DE1F91 /* MAAttachedWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MAAttachedWindow.m; sourceTree = ""; }; + 5CA10FFB131C2A7600DE1F91 /* __init__.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = __init__.py; sourceTree = ""; }; + 5CA10FFC131C2A7600DE1F91 /* BeautifulSoup.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = BeautifulSoup.py; sourceTree = ""; }; + 5CA10FFD131C2A7600DE1F91 /* BeautifulSoup.pyc */ = {isa = PBXFileReference; lastKnownFileType = file; path = BeautifulSoup.pyc; sourceTree = ""; }; + 5CA10FFE131C2A7600DE1F91 /* html2text.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = html2text.py; sourceTree = ""; }; + 5CA10FFF131C2A7600DE1F91 /* page_parser.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = page_parser.py; sourceTree = ""; }; + 5CA11000131C2A7600DE1F91 /* page_parser.pyc */ = {isa = PBXFileReference; lastKnownFileType = file; path = page_parser.pyc; sourceTree = ""; }; + 5CA11001131C2A7600DE1F91 /* readability.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = readability.py; sourceTree = ""; }; + 5CA11002131C2A7600DE1F91 /* url_helpers.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = url_helpers.py; sourceTree = ""; }; + 5CA11003131C2A7600DE1F91 /* url_helpers.pyc */ = {isa = PBXFileReference; lastKnownFileType = file; path = url_helpers.pyc; sourceTree = ""; }; + 5CBA7A901305E2DF004ADEBB /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/TagEditingManager.xib; sourceTree = ""; }; + 5CBA7A961305E38C004ADEBB /* TagEditingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagEditingManager.h; sourceTree = ""; }; + 5CBA7A971305E38C004ADEBB /* TagEditingManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TagEditingManager.m; sourceTree = ""; }; + 5CBD88F0132A84E000FC5A79 /* ETTransparentButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ETTransparentButtonCell.h; sourceTree = ""; }; + 5CC2DF0913083BCF006772D9 /* StatusItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusItemView.h; sourceTree = ""; }; + 5CC2DF0A13083BCF006772D9 /* StatusItemView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusItemView.m; sourceTree = ""; }; + 5CCEEF1B130B599B00E15B77 /* DFView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFView.h; sourceTree = ""; }; + 5CCEEF1C130B599B00E15B77 /* DFView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DFView.m; sourceTree = ""; }; + 5CE6624913185202002039D0 /* NSTextFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTextFinder.h; sourceTree = ""; }; + 5CE6624A13185202002039D0 /* NSTextFinder_LastFind.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSTextFinder_LastFind.m; sourceTree = ""; }; + 5CF01B02132975910083D66E /* greyscrollervertbottom.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollervertbottom.tiff; sourceTree = ""; }; + 5CF01B04132975910083D66E /* greyscrollervertfill.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollervertfill.tiff; sourceTree = ""; }; + 5CF01B06132975910083D66E /* greyscrollerverttop.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollerverttop.tiff; sourceTree = ""; }; + 5CF01B0E132975A40083D66E /* scrollbarblue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = scrollbarblue.tif; sourceTree = ""; }; + 5CF01B16132975DA0083D66E /* BTransparentScrollerSlotBottom.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerSlotBottom.tif; sourceTree = ""; }; + 5CF01B1A132975DA0083D66E /* BTransparentScrollerSlotTop.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerSlotTop.tif; sourceTree = ""; }; + 5CF33C701308B478002B5499 /* NotesTableHeaderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotesTableHeaderCell.h; sourceTree = ""; }; + 5CF33C711308B478002B5499 /* NotesTableHeaderCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotesTableHeaderCell.m; sourceTree = ""; }; + 5CF96BFC132EA0300079B3FD /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; + 5CF96BFE132EA03E0079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/MainMenu.xib; sourceTree = ""; }; + 5CF96BFF132EA03E0079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/MainMenu.xib; sourceTree = ""; }; + 5CF96C00132EA03E0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt; path = pt.lproj/MainMenu.xib; sourceTree = ""; }; + 5CF96C09132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/BlorPasswordRetriever.nib; sourceTree = ""; }; + 5CF96C0A132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = fr; path = fr.lproj/CarbonErrorStrings.plist; sourceTree = ""; }; + 5CF96C0C132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = text; name = fr; path = "fr.lproj/Ceci est le titre d'une note.nvhelp"; sourceTree = ""; }; + 5CF96C0E132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = text; name = fr; path = "fr.lproj/Comment ça marche.nvhelp"; sourceTree = ""; }; + 5CF96C10132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = text; name = fr; path = fr.lproj/Contact.nvhelp; sourceTree = ""; }; + 5CF96C11132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/DeletionManager.nib; sourceTree = ""; }; + 5CF96C12132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/EncodingsManager.nib; sourceTree = ""; }; + 5CF96C13132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/ExporterManager.nib; sourceTree = ""; }; + 5CF96C14132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/FindPanel.nib; sourceTree = ""; }; + 5CF96C17132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/ImporterAccessory.nib; sourceTree = ""; }; + 5CF96C18132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/InfoPlist.strings; sourceTree = ""; }; + 5CF96C19132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/KeyDerivationManager.nib; sourceTree = ""; }; + 5CF96C1A132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; + 5CF96C1D132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/NotationPrefsView.nib; sourceTree = ""; }; + 5CF96C1E132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/PassphraseChanger.nib; sourceTree = ""; }; + 5CF96C1F132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/PassphrasePicker.nib; sourceTree = ""; }; + 5CF96C20132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/PassphraseRetriever.nib; sourceTree = ""; }; + 5CF96C23132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/Preferences.xib; sourceTree = ""; }; + 5CF96C24132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/PTKeyComboPanel.nib; sourceTree = ""; }; + 5CF96C26132EA1880079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = text; name = fr; path = "fr.lproj/Raccourcis incroyablement utiles.nvhelp"; sourceTree = ""; }; + 5CF96C3F132EA1890079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/SavedSearches.nib; sourceTree = ""; }; + 5CF96C40132EA1890079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/ServicesMenu.strings; sourceTree = ""; }; + 5CF96C42132EA1890079B3FD /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/URLGetter.nib; sourceTree = ""; }; + 5CF96CBE132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/BlorPasswordRetriever.nib; sourceTree = ""; }; + 5CF96CBF132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = de; path = de.lproj/CarbonErrorStrings.plist; sourceTree = ""; }; + 5CF96CC0132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/DeletionManager.nib; sourceTree = ""; }; + 5CF96CC2132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = text; name = de; path = "de.lproj/Dies ist der Titel einer Notiz.nvhelp"; sourceTree = ""; }; + 5CF96CC3132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/EncodingsManager.nib; sourceTree = ""; }; + 5CF96CC4132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/ExporterManager.nib; sourceTree = ""; }; + 5CF96CC5132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/FindPanel.nib; sourceTree = ""; }; + 5CF96CC7132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/ImporterAccessory.nib; sourceTree = ""; }; + 5CF96CC8132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = ""; }; + 5CF96CC9132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/KeyDerivationManager.nib; sourceTree = ""; }; + 5CF96CCB132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = text; name = de; path = de.lproj/Kontaktdaten.nvhelp; sourceTree = ""; }; + 5CF96CCC132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; + 5CF96CCF132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = text; name = de; path = "de.lproj/Moglicherweise nutzliche Tastenkurzel.nvhelp"; sourceTree = ""; }; + 5CF96CD0132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/NotationPrefsView.nib; sourceTree = ""; }; + 5CF96CD1132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/PassphraseChanger.nib; sourceTree = ""; }; + 5CF96CD2132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/PassphrasePicker.nib; sourceTree = ""; }; + 5CF96CD3132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/PassphraseRetriever.nib; sourceTree = ""; }; + 5CF96CD4132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/Preferences.xib; sourceTree = ""; }; + 5CF96CD5132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/PTKeyComboPanel.nib; sourceTree = ""; }; + 5CF96CD6132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/SavedSearches.nib; sourceTree = ""; }; + 5CF96CD7132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/ServicesMenu.strings; sourceTree = ""; }; + 5CF96CD9132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/URLGetter.nib; sourceTree = ""; }; + 5CF96CDB132EA1970079B3FD /* de */ = {isa = PBXFileReference; lastKnownFileType = text; name = de; path = "de.lproj/Wie funktioniert dieses Programm?.nvhelp"; sourceTree = ""; }; + 5CF96D57132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = text; name = pt; path = "pt.lproj/Atalhos Incrivelmente Úteis.nvhelp"; sourceTree = ""; }; + 5CF96D58132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/BlorPasswordRetriever.nib; sourceTree = ""; }; + 5CF96D5B132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = pt; path = pt.lproj/CarbonErrorStrings.plist; sourceTree = ""; }; + 5CF96D5D132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = text; name = pt; path = "pt.lproj/Como funciona isso?.nvhelp"; sourceTree = ""; }; + 5CF96D5E132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/DeletionManager.nib; sourceTree = ""; }; + 5CF96D61132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/EncodingsManager.nib; sourceTree = ""; }; + 5CF96D65132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = text; name = pt; path = "pt.lproj/Este é o título de uma nota.nvhelp"; sourceTree = ""; }; + 5CF96D66132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/ExporterManager.nib; sourceTree = ""; }; + 5CF96D69132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/FindPanel.nib; sourceTree = ""; }; + 5CF96D6B132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/ImporterAccessory.nib; sourceTree = ""; }; + 5CF96D6E132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 5CF96D70132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = text; name = pt; path = "pt.lproj/Informações de Contato.nvhelp"; sourceTree = ""; }; + 5CF96D71132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/KeyDerivationManager.nib; sourceTree = ""; }; + 5CF96D74132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/Localizable.strings; sourceTree = ""; }; + 5CF96D78132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/NotationPrefsView.nib; sourceTree = ""; }; + 5CF96D7B132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/PassphraseChanger.nib; sourceTree = ""; }; + 5CF96D7E132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/PassphrasePicker.nib; sourceTree = ""; }; + 5CF96D81132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/PassphraseRetriever.nib; sourceTree = ""; }; + 5CF96D84132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt; path = pt.lproj/Preferences.xib; sourceTree = ""; }; + 5CF96D87132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/PTKeyComboPanel.nib; sourceTree = ""; }; + 5CF96D8A132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/SavedSearches.nib; sourceTree = ""; }; + 5CF96D90132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/URLGetter.nib; sourceTree = ""; }; + 5CFC3A4E13327EF9000B4792 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/TagEditingManager.xib; sourceTree = ""; }; + 5CFC3A4F13327EF9000B4792 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/TagEditingManager.xib; sourceTree = ""; }; + 5CFC3A5013327EF9000B4792 /* pt */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt; path = pt.lproj/TagEditingManager.xib; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* Notational Velocity.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Notational Velocity.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 930EC2EC12C113080004E569 /* NotesTableCornerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotesTableCornerView.h; sourceTree = ""; }; - 930EC2ED12C113080004E569 /* NotesTableCornerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotesTableCornerView.m; sourceTree = ""; }; - 930EC2EE12C113080004E569 /* NotesTableHeaderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotesTableHeaderCell.h; sourceTree = ""; }; - 930EC2EF12C113080004E569 /* NotesTableHeaderCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotesTableHeaderCell.m; sourceTree = ""; }; - 9326D4B512C537F6001A0761 /* MAAttachedWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MAAttachedWindow.h; sourceTree = ""; }; - 9326D4B612C537F6001A0761 /* MAAttachedWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MAAttachedWindow.m; sourceTree = ""; }; - 93439D9812B120CA002946D7 /* scrollbarblue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = scrollbarblue.tif; sourceTree = ""; }; - 93439DD712B12B31002946D7 /* CustomTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomTextFieldCell.h; sourceTree = ""; }; - 93439DD812B12B31002946D7 /* CustomTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomTextFieldCell.m; sourceTree = ""; }; - 9349C0FF12C6743D00E8E5C2 /* TabClose_Front_Pressed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Front_Pressed.tif; sourceTree = ""; }; - 9349C10012C6743D00E8E5C2 /* TabClose_Front_Rollover.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Front_Rollover.tif; sourceTree = ""; }; - 9349C10112C6743D00E8E5C2 /* TabClose_Front.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Front.tif; sourceTree = ""; }; - 936763CC12BAA34300107A04 /* greyscrollervertbottom.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollervertbottom.tiff; sourceTree = ""; }; - 936763CD12BAA34300107A04 /* greyscrollervertfill.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollervertfill.tiff; sourceTree = ""; }; - 936763CE12BAA34300107A04 /* greyscrollerverttop.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollerverttop.tiff; sourceTree = ""; }; - 9367644C12BBB7B700107A04 /* greyscrollervertbottom2.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollervertbottom2.tiff; sourceTree = ""; }; - 9367644D12BBB7B700107A04 /* greyscrollervertfill2.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollervertfill2.tiff; sourceTree = ""; }; - 9367644E12BBB7B700107A04 /* greyscrollerverttop2.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = greyscrollerverttop2.tiff; sourceTree = ""; }; - 9397BAF612B044FB004D25E9 /* BTTransparentScroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTTransparentScroller.h; sourceTree = ""; }; - 9397BAF712B044FB004D25E9 /* BTTransparentScroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTTransparentScroller.m; sourceTree = ""; }; - 9397BAF912B04686004D25E9 /* BTransparentScrollerKnobBottom.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerKnobBottom.tif; sourceTree = ""; }; - 9397BAFA12B04686004D25E9 /* BTransparentScrollerKnobHorizontalFill.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerKnobHorizontalFill.tif; sourceTree = ""; }; - 9397BAFB12B04686004D25E9 /* BTransparentScrollerKnobLeft.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerKnobLeft.tif; sourceTree = ""; }; - 9397BAFC12B04686004D25E9 /* BTransparentScrollerKnobRight.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerKnobRight.tif; sourceTree = ""; }; - 9397BAFD12B04686004D25E9 /* BTransparentScrollerKnobTop.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerKnobTop.tif; sourceTree = ""; }; - 9397BAFE12B04686004D25E9 /* BTransparentScrollerKnobVerticalFill.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerKnobVerticalFill.tif; sourceTree = ""; }; - 9397BAFF12B04686004D25E9 /* BTransparentScrollerSlotBottom.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerSlotBottom.tif; sourceTree = ""; }; - 9397BB0012B04686004D25E9 /* BTransparentScrollerSlotHorizontalFill.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerSlotHorizontalFill.tif; sourceTree = ""; }; - 9397BB0112B04686004D25E9 /* BTransparentScrollerSlotLeft.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerSlotLeft.tif; sourceTree = ""; }; - 9397BB0212B04686004D25E9 /* BTransparentScrollerSlotRight.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerSlotRight.tif; sourceTree = ""; }; - 9397BB0312B04686004D25E9 /* BTransparentScrollerSlotTop.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerSlotTop.tif; sourceTree = ""; }; - 9397BB0412B04686004D25E9 /* BTransparentScrollerSlotVerticalFill.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = BTransparentScrollerSlotVerticalFill.tif; sourceTree = ""; }; - 9397BBDE12B05991004D25E9 /* BlueTransparentScroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlueTransparentScroller.m; sourceTree = ""; }; - 9397BBDF12B05991004D25E9 /* BlueTransparentScroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlueTransparentScroller.h; sourceTree = ""; }; - 9397BBE112B059AD004D25E9 /* WhiteTransparentScroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WhiteTransparentScroller.h; sourceTree = ""; }; - 9397BBE212B059AD004D25E9 /* WhiteTransparentScroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WhiteTransparentScroller.m; sourceTree = ""; }; - 939D7EB012E5932700E7C2F3 /* FullscreenWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullscreenWindow.h; sourceTree = ""; }; - 939D7EB112E5932700E7C2F3 /* FullscreenWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FullscreenWindow.m; sourceTree = ""; }; - 93A081E012ACF30200DAB227 /* BWToolkitFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BWToolkitFramework.framework; path = "/Users/ttscoff/Dropbox/Code/OddsAndEnds/Interface Builder Plug-Ins/BWToolkit/BWToolkitFramework.framework"; sourceTree = ""; }; - 93A413BC12E18741002340FD /* SaveHTMLPreview.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = SaveHTMLPreview.nib; sourceTree = ""; }; - 93B9E6D112E5440000DEDECF /* __init__.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = __init__.py; sourceTree = ""; }; - 93B9E6D212E5440000DEDECF /* BeautifulSoup.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = BeautifulSoup.py; sourceTree = ""; }; - 93B9E6D312E5440000DEDECF /* BeautifulSoup.pyc */ = {isa = PBXFileReference; lastKnownFileType = file; path = BeautifulSoup.pyc; sourceTree = ""; }; - 93B9E6D412E5440000DEDECF /* html2text.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = html2text.py; sourceTree = ""; }; - 93B9E6D512E5440000DEDECF /* page_parser.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = page_parser.py; sourceTree = ""; }; - 93B9E6D612E5440000DEDECF /* page_parser.pyc */ = {isa = PBXFileReference; lastKnownFileType = file; path = page_parser.pyc; sourceTree = ""; }; - 93B9E6D712E5440000DEDECF /* readability.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = readability.py; sourceTree = ""; }; - 93B9E6D812E5440000DEDECF /* url_helpers.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = url_helpers.py; sourceTree = ""; }; - 93B9E6D912E5440000DEDECF /* url_helpers.pyc */ = {isa = PBXFileReference; lastKnownFileType = file; path = url_helpers.pyc; sourceTree = ""; }; - 93CF647712B66B030088ADC4 /* BTTableHeaderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTTableHeaderCell.h; sourceTree = ""; }; - 93CF647812B66B030088ADC4 /* BTTableHeaderCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTTableHeaderCell.m; sourceTree = ""; }; - 93CF647E12B66F4A0088ADC4 /* tan_column_header.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tan_column_header.png; sourceTree = ""; }; - 93EE398512B1D803007E6B27 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = ""; }; + 8D1107320486CEB800E47090 /* nvALT.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = nvALT.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 93A158BB133C304D00E1E7DA /* Markdownify.nvhelp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Markdownify.nvhelp; sourceTree = ""; }; + 93A158BD133C497400E1E7DA /* Notality.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Notality.icns; sourceTree = ""; }; + 93B348241371547800658F98 /* HUDIconLock.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HUDIconLock.png; path = Images/HUDIconLock.png; sourceTree = ""; }; + 93B348251371547800658F98 /* HUDIconPrint.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HUDIconPrint.png; path = Images/HUDIconPrint.png; sourceTree = ""; }; + 93B348261371547800658F98 /* HUDIconSave.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HUDIconSave.png; path = Images/HUDIconSave.png; sourceTree = ""; }; + 93B348271371547800658F98 /* HUDIconShare.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HUDIconShare.png; path = Images/HUDIconShare.png; sourceTree = ""; }; D3EEC9FE106F66C70023D7F8 /* NVPasswordGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NVPasswordGenerator.m; sourceTree = ""; }; D3EEC9FF106F66C70023D7F8 /* NVPasswordGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NVPasswordGenerator.h; sourceTree = ""; }; + F0E01EE812DB95F40000B192 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Preferences.xib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -626,8 +738,6 @@ 21D583620B78F0CC00245E29 /* ApplicationServices.framework in Frameworks */, 219D254A1113FE34005E7DF5 /* SystemConfiguration.framework in Frameworks */, 21B54C021134F2E800E163A1 /* IOKit.framework in Frameworks */, - 93A081E112ACF30200DAB227 /* BWToolkitFramework.framework in Frameworks */, - 3FB0FAEA12DC455B003DC14E /* BWToolkitFramework.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -637,32 +747,19 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( - 939D7EB012E5932700E7C2F3 /* FullscreenWindow.h */, - 939D7EB112E5932700E7C2F3 /* FullscreenWindow.m */, - 930EC2EC12C113080004E569 /* NotesTableCornerView.h */, - 930EC2ED12C113080004E569 /* NotesTableCornerView.m */, - 930EC2EE12C113080004E569 /* NotesTableHeaderCell.h */, - 930EC2EF12C113080004E569 /* NotesTableHeaderCell.m */, - 9397BBDE12B05991004D25E9 /* BlueTransparentScroller.m */, - 9397BBDF12B05991004D25E9 /* BlueTransparentScroller.h */, - 9397BBE112B059AD004D25E9 /* WhiteTransparentScroller.h */, - 9397BBE212B059AD004D25E9 /* WhiteTransparentScroller.m */, - 9397BAF612B044FB004D25E9 /* BTTransparentScroller.h */, - 9397BAF712B044FB004D25E9 /* BTTransparentScroller.m */, - 93CF647712B66B030088ADC4 /* BTTableHeaderCell.h */, - 93CF647812B66B030088ADC4 /* BTTableHeaderCell.m */, - 608A25B41268EE5E00EEF326 /* AppController_Preview.h */, - 608A25B51268EE5E00EEF326 /* AppController_Preview.m */, + 5C96F713131C4A1B00A2E4AC /* UIElement Subclasses */, + 5CA10F30131C29E900DE1F91 /* AppController_Preview.h */, + 5CA10F31131C29E900DE1F91 /* AppController_Preview.m */, + 5CA10F18131C297000DE1F91 /* PreviewController.h */, + 5CA10F19131C297000DE1F91 /* PreviewController.m */, + 5CBA7A961305E38C004ADEBB /* TagEditingManager.h */, + 5CBA7A971305E38C004ADEBB /* TagEditingManager.m */, 214498800AE1931700E2A2B6 /* UI Decision Classes */, 2191930609CFBED200586B15 /* View Classes */, - 21F0793710EC5E21004FE56F /* Sync Services */, - 212089CF0B0C2BCF00A15A69 /* Note Importing */, - 2114C11409575BD400614E74 /* AppController.h */, - 2114C11509575BD400614E74 /* AppController.m */, - 608A25AD1268ECFA00EEF326 /* PreviewController.h */, - 608A25AE1268ECFA00EEF326 /* PreviewController.m */, 21D60126098FDB46007440DF /* GlobalPrefs.h */, 21D60127098FDB46007440DF /* GlobalPrefs.m */, + 2114C11409575BD400614E74 /* AppController.h */, + 2114C11509575BD400614E74 /* AppController.m */, 2191982009D607C600586B15 /* PrefsWindowController.h */, 2191982109D607C600586B15 /* PrefsWindowController.m */, 21A2F95C09DF3FDC001AF0B5 /* NotationPrefs.h */, @@ -691,11 +788,17 @@ 21DC788E097894B600E59B09 /* NSCollection_utils.m */, 212B84600978422300F3597F /* NSString_NV.h */, 212B84610978422300F3597F /* NSString_NV.m */, + 21DB4BE412DE4E3D0057F52B /* NSString_CustomTruncation.h */, + 21DB4BE512DE4E3D0057F52B /* NSString_CustomTruncation.m */, + 216D987D12CE68AD0004B9CE /* NSFileManager_NV.h */, + 216D987E12CE68AD0004B9CE /* NSFileManager_NV.m */, 21B548F9112F307E00E163A1 /* NotationDirectoryManager.h */, 21B548F8112F307E00E163A1 /* NotationDirectoryManager.m */, 2181171109F311110020A252 /* DeletedNoteObject.h */, 2181171209F311110020A252 /* DeletedNoteObject.m */, 2181193909FA9CF90020A252 /* SynchronizedNoteProtocol.h */, + 21DB3D0D12D4FBDD0057F52B /* SecureTextEntryManager.h */, + 21DB3D0E12D4FBDD0057F52B /* SecureTextEntryManager.m */, 21CF80F210FD33B90094AA90 /* SynchronizedNoteMixIns.h */, 217CEBA109E9885500DF0E09 /* NotationFileManager.h */, 217CEBA209E9885500DF0E09 /* NotationFileManager.m */, @@ -709,8 +812,16 @@ D3EEC9FE106F66C70023D7F8 /* NVPasswordGenerator.m */, 21B1BC341104D20E0004A7D0 /* InvocationRecorder.h */, 21B1BC351104D20E0004A7D0 /* InvocationRecorder.m */, + 21D6FB4712E104D6005C2DA5 /* NSBezierPath_NV.h */, + 21D6FB4812E104D6005C2DA5 /* NSBezierPath_NV.m */, + 215309F212E4E92300AF2739 /* DiskUUIDEntry.h */, + 215309F312E4E92300AF2739 /* DiskUUIDEntry.m */, + 21F0793710EC5E21004FE56F /* Sync Services */, + 212089CF0B0C2BCF00A15A69 /* Note Importing */, 57F27FB71197407400C63ACF /* SearchCommand.h */, 57F27FB81197407400C63ACF /* SearchCommand.m */, + 21A3913812EB4C2F00CEB5F0 /* Spaces.h */, + 21A3913912EB4C2F00CEB5F0 /* Spaces.c */, ); name = Classes; sourceTree = ""; @@ -726,7 +837,7 @@ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( - 93A081E012ACF30200DAB227 /* BWToolkitFramework.framework */, + 212EEAB812F085D100F89538 /* AutoHyperlinks.framework */, 21B54C011134F2E800E163A1 /* IOKit.framework */, 213623E50B92AA4E008C0830 /* Sparkle.framework */, 210C07230B6BF0A1005D23A8 /* WebKit.framework */, @@ -747,7 +858,7 @@ 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( - 8D1107320486CEB800E47090 /* Notational Velocity.app */, + 8D1107320486CEB800E47090 /* nvALT.app */, ); name = Products; sourceTree = ""; @@ -770,6 +881,8 @@ 212089CF0B0C2BCF00A15A69 /* Note Importing */ = { isa = PBXGroup; children = ( + 21D6F7ED12E0C751005C2DA5 /* AppController_Importing.h */, + 21D6F7EE12E0C751005C2DA5 /* AppController_Importing.m */, 212089D60B0C2CA500A15A69 /* StickiesDocument.h */, 212089D70B0C2CA500A15A69 /* StickiesDocument.m */, 212089AF0B0C24F500A15A69 /* AlienNoteImporter.h */, @@ -815,14 +928,19 @@ 217DB1810B7CE5B9008CD564 /* Help Notes */ = { isa = PBXGroup; children = ( - 21F447E811B896C4004D008B /* Atalhos Incrivelmente Úteis.nvhelp */, - 21F447EA11B896C4004D008B /* Como funciona isso?.nvhelp */, - 21F447EC11B896C4004D008B /* Este é o título de uma nota.nvhelp */, - 21F447EE11B896C4004D008B /* Informações de Contato.nvhelp */, - 21EA3691111C9AD900E2B517 /* Raccourcis incroyablement utiles.nvhelp */, - 21E6EC1F111DD52B0038ECC7 /* Comment ça marche.nvhelp */, - 21EA3695111C9AD900E2B517 /* Ceci est le titre d'une note.nvhelp */, - 21EA3697111C9AD900E2B517 /* Contact.nvhelp */, + 93A158BB133C304D00E1E7DA /* Markdownify.nvhelp */, + 5CF96D56132EA29D0079B3FD /* Atalhos Incrivelmente Úteis.nvhelp */, + 5CF96D5C132EA29D0079B3FD /* Como funciona isso?.nvhelp */, + 5CF96D64132EA29D0079B3FD /* Este é o título de uma nota.nvhelp */, + 5CF96D6F132EA29D0079B3FD /* Informações de Contato.nvhelp */, + 5CF96CC1132EA1970079B3FD /* Dies ist der Titel einer Notiz.nvhelp */, + 5CF96CCA132EA1970079B3FD /* Kontaktdaten.nvhelp */, + 5CF96CCE132EA1970079B3FD /* Moglicherweise nutzliche Tastenkurzel.nvhelp */, + 5CF96CDA132EA1970079B3FD /* Wie funktioniert dieses Programm?.nvhelp */, + 5CF96C0B132EA1880079B3FD /* Ceci est le titre d'une note.nvhelp */, + 5CF96C0D132EA1880079B3FD /* Comment ça marche.nvhelp */, + 5CF96C0F132EA1880079B3FD /* Contact.nvhelp */, + 5CF96C25132EA1880079B3FD /* Raccourcis incroyablement utiles.nvhelp */, 21317FAD1113840E00472211 /* Excruciatingly Useful Shortcuts.nvhelp */, 219D22281111564F005E7DF5 /* Contact Information.nvhelp */, 219D222A1111564F005E7DF5 /* This is the title of a note.nvhelp */, @@ -846,34 +964,30 @@ 2191930609CFBED200586B15 /* View Classes */ = { isa = PBXGroup; children = ( - 9326D4B512C537F6001A0761 /* MAAttachedWindow.h */, - 9326D4B612C537F6001A0761 /* MAAttachedWindow.m */, - 93439DD712B12B31002946D7 /* CustomTextFieldCell.h */, - 93439DD812B12B31002946D7 /* CustomTextFieldCell.m */, 219588D00961D7F200972B8C /* LinkingEditor.h */, 219588D10961D7F200972B8C /* LinkingEditor.m */, 219FD3140B2CC655004E132B /* LinkingEditor_Indentation.h */, 219FD3150B2CC655004E132B /* LinkingEditor_Indentation.m */, - 21918FCF09C49B2500586B15 /* EmptyView.h */, - 21918FCE09C49B2400586B15 /* EmptyView.m */, 219190EF09C4A60600586B15 /* DualField.h */, 219190F009C4A60700586B15 /* DualField.m */, 219192D209CFBC8700586B15 /* NoteAttributeColumn.h */, 219192D309CFBC8700586B15 /* NoteAttributeColumn.m */, 2191930109CFBEBD00586B15 /* NotesTableView.h */, 2191930209CFBEBD00586B15 /* NotesTableView.m */, + 21DB49BA12DE19480057F52B /* UnifiedCell.h */, + 21B64C4D12E62A5700D87EFC /* UnifiedCell.m */, + 21B64A2412E61FA700D87EFC /* LabelColumnCell.h */, + 21B64A2512E61FA700D87EFC /* LabelColumnCell.m */, 215DE83609ECC4FE009A710B /* HeaderViewWIthMenu.h */, 215DE83709ECC4FE009A710B /* HeaderViewWIthMenu.m */, 210A10660B66720F005BE981 /* BookmarksTable.h */, 210A10670B66720F005BE981 /* BookmarksTable.m */, 215453EE0B067A5100C0D1D5 /* KeyDerivationDelaySlider.h */, 215453EF0B067A5100C0D1D5 /* KeyDerivationDelaySlider.m */, - 217EAF0D0B0D56860041A8A9 /* FocusRingScrollView.h */, - 217EAF0E0B0D56860041A8A9 /* FocusRingScrollView.m */, + 216DA22412D17DB70004B9CE /* AugmentedScrollView.h */, + 216DA22512D17DB70004B9CE /* AugmentedScrollView.m */, 21C737930B50C73E0048C08A /* MultiplePageView.h */, 21C737940B50C73E0048C08A /* MultiplePageView.m */, - 217D02D30B77061E0004E02D /* BodyScroller.h */, - 217D02D40B77061E0004E02D /* BodyScroller.m */, 212C6950110E1940004DD82C /* TitlebarButton.h */, 212C6951110E1940004DD82C /* TitlebarButton.m */, ); @@ -883,29 +997,40 @@ 219196B109D4F1DB00586B15 /* Images */ = { isa = PBXGroup; children = ( - 9349C0FF12C6743D00E8E5C2 /* TabClose_Front_Pressed.tif */, - 9349C10012C6743D00E8E5C2 /* TabClose_Front_Rollover.tif */, - 9349C10112C6743D00E8E5C2 /* TabClose_Front.tif */, - 9367644C12BBB7B700107A04 /* greyscrollervertbottom2.tiff */, - 9367644D12BBB7B700107A04 /* greyscrollervertfill2.tiff */, - 9367644E12BBB7B700107A04 /* greyscrollerverttop2.tiff */, - 936763CC12BAA34300107A04 /* greyscrollervertbottom.tiff */, - 936763CD12BAA34300107A04 /* greyscrollervertfill.tiff */, - 936763CE12BAA34300107A04 /* greyscrollerverttop.tiff */, - 93CF647E12B66F4A0088ADC4 /* tan_column_header.png */, - 93439D9812B120CA002946D7 /* scrollbarblue.tif */, - 9397BAF912B04686004D25E9 /* BTransparentScrollerKnobBottom.tif */, - 9397BAFA12B04686004D25E9 /* BTransparentScrollerKnobHorizontalFill.tif */, - 9397BAFB12B04686004D25E9 /* BTransparentScrollerKnobLeft.tif */, - 9397BAFC12B04686004D25E9 /* BTransparentScrollerKnobRight.tif */, - 9397BAFD12B04686004D25E9 /* BTransparentScrollerKnobTop.tif */, - 9397BAFE12B04686004D25E9 /* BTransparentScrollerKnobVerticalFill.tif */, - 9397BAFF12B04686004D25E9 /* BTransparentScrollerSlotBottom.tif */, - 9397BB0012B04686004D25E9 /* BTransparentScrollerSlotHorizontalFill.tif */, - 9397BB0112B04686004D25E9 /* BTransparentScrollerSlotLeft.tif */, - 9397BB0212B04686004D25E9 /* BTransparentScrollerSlotRight.tif */, - 9397BB0312B04686004D25E9 /* BTransparentScrollerSlotTop.tif */, - 9397BB0412B04686004D25E9 /* BTransparentScrollerSlotVerticalFill.tif */, + 93B348241371547800658F98 /* HUDIconLock.png */, + 93B348251371547800658F98 /* HUDIconPrint.png */, + 93B348261371547800658F98 /* HUDIconSave.png */, + 93B348271371547800658F98 /* HUDIconShare.png */, + 5C2CC189134989D7006FFE56 /* nvMenuDark.png */, + 5C2CC182134989A8006FFE56 /* nvMenu.png */, + 5C2CC183134989A8006FFE56 /* nvMenuC.png */, + 93A158BD133C497400E1E7DA /* Notality.icns */, + 5C94376C132A0C9D00B08B80 /* greyscrollervertbottom3.tif */, + 5C94376D132A0C9D00B08B80 /* greyscrollervertfill3.tif */, + 5C94376E132A0C9D00B08B80 /* greyscrollerverttop3.tif */, + 5CF01B16132975DA0083D66E /* BTransparentScrollerSlotBottom.tif */, + 5CF01B1A132975DA0083D66E /* BTransparentScrollerSlotTop.tif */, + 5CF01B0E132975A40083D66E /* scrollbarblue.tif */, + 5CF01B02132975910083D66E /* greyscrollervertbottom.tiff */, + 5CF01B04132975910083D66E /* greyscrollervertfill.tiff */, + 5CF01B06132975910083D66E /* greyscrollerverttop.tiff */, + 5C96F703131C49D400A2E4AC /* TransparentButtonFillN.tiff */, + 5C96F704131C49D400A2E4AC /* TransparentButtonFillP.tiff */, + 5C96F705131C49D400A2E4AC /* TransparentButtonLeftN.tiff */, + 5C96F706131C49D400A2E4AC /* TransparentButtonLeftP.tiff */, + 5C96F707131C49D400A2E4AC /* TransparentButtonRightN.tiff */, + 5C96F708131C49D400A2E4AC /* TransparentButtonRightP.tiff */, + 5C96F4FC131C2F9500A2E4AC /* TabClose_Front_Pressed.tif */, + 5C96F4FD131C2F9500A2E4AC /* TabClose_Front_Rollover.tif */, + 5C96F4FE131C2F9500A2E4AC /* TabClose_Front.tif */, + 5C4B35351307220E00014119 /* TransparentScrollerKnobBottom.tif */, + 5C4B35361307220E00014119 /* TransparentScrollerKnobTop.tif */, + 5C4B35371307220E00014119 /* TransparentScrollerKnobVerticalFill.tif */, + 5C4B35381307220E00014119 /* TransparentScrollerSlotBottom.tif */, + 5C4B35391307220E00014119 /* TransparentScrollerSlotTop.tif */, + 5C4B353A1307220E00014119 /* TransparentScrollerSlotVerticalFill.tif */, + 21DB407D12D5383F0057F52B /* IBeamInverted.png */, + 216DA1AC12D15F310004B9CE /* ListDividerDrag.png */, 219D1BB2110EA66A005E7DF5 /* TBAlert.png */, 212C6E99110E46F0004DD82C /* TBDownArrow.png */, 212C6A22110E371B004DD82C /* TBAlertWhite.png */, @@ -914,19 +1039,22 @@ 212C6A25110E371B004DD82C /* TBDownArrowWhite.png */, 212C6A26110E371B004DD82C /* TBRolloverBG.png */, 212C6A27110E371B004DD82C /* TBMousedownBG.png */, - 21AD292E110C18AA00B7A985 /* Notality.icns */, 21AD292C110C188800B7A985 /* TinyAlert.tif */, 213FB0230B3CB1C4004C74BD /* PTKeyboardIcon.tiff */, 2144950D0ADC883000E2A2B6 /* PasswordAssistantButton.tif */, 2144950E0ADC883000E2A2B6 /* PasswordAssistantButtonPressed.tif */, 21BD2F3510DAF61700BA3DF6 /* SplitViewDimple.tif */, + 5C5713F01309A42600961090 /* SplitViewDimple2.tif */, 215DEE1209F1AA4C009A710B /* Editing.tiff */, 215DEA4609EF6446009A710B /* Notes.tiff */, 215DEA3D09EF5323009A710B /* General.tiff */, + 21C0F8A112C7E7160068693F /* Fonts & Colors.tiff */, 219196BB09D4F20000586B15 /* Add_Pressed.tiff */, 219196BC09D4F20000586B15 /* Add.tiff */, 219196BD09D4F20000586B15 /* Remove_Pressed.tiff */, 219196BE09D4F20000586B15 /* Remove.tiff */, + 21A38EE212EA864400CEB5F0 /* MakeDefault_Pressed.tiff */, + 21A38EE312EA864400CEB5F0 /* MakeDefault.tiff */, 21DF19AE10D172F600543C35 /* DFCapRightInactive.png */, 21DF19AF10D172F600543C35 /* DFCapRight.png */, 21DF19B010D172F600543C35 /* DFCapLeftRoundedInactive.png */, @@ -935,6 +1063,8 @@ 2143D3D810E987B100127EA6 /* Pencil.png */, 212C6EA1110E493C004DD82C /* Clear.tif */, 212C6EA2110E493C004DD82C /* ClearPressed.tif */, + 216D9C2B12CFEF2A0004B9CE /* LinkBack.tif */, + 216D9C2C12CFEF2A0004B9CE /* LinkBackPressed.tif */, 2143D2F310E953F500127EA6 /* SnapBack.tif */, 2143D2F210E953F400127EA6 /* SnapBackPressed.tif */, 21B1C16E110764570004A7D0 /* statusValidated.png */, @@ -1000,7 +1130,6 @@ 29B97314FDCFA39411CA2CEA /* Notation */ = { isa = PBXGroup; children = ( - 3FB0FAE912DC455B003DC14E /* BWToolkitFramework.framework */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, @@ -1015,8 +1144,8 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( - 93B9E6D012E5440000DEDECF /* readability */, - 608A24F21268DD2200EEF326 /* Markup */, + 5C96F5A8131C379200A2E4AC /* Markup */, + 5CA10FFA131C2A7600DE1F91 /* readability */, 21F07C7010EDED87004FE56F /* BSJSON */, 2182B38E106B2286008641E4 /* RBSplitView */, 21F1CD490B3A38CB001FB5F6 /* HotKeys */, @@ -1027,8 +1156,8 @@ 21BD2ECF10DAF31500BA3DF6 /* LinearDividerShader.m */, 2114C23B095883A600614E74 /* NSData_transformations.h */, 2114C23C095883A600614E74 /* NSData_transformations.m */, - 217D4B570A61F42700887100 /* NSTextFinder.h */, - 217EB3CD0B0F62FB0041A8A9 /* NSTextFinder_LastFind.m */, + 5CE6624913185202002039D0 /* NSTextFinder.h */, + 5CE6624A13185202002039D0 /* NSTextFinder_LastFind.m */, 214495040ADC7F4F00E2A2B6 /* SFPasswordAssistantInspectorController.h */, 213FAD510B3C6B52004C74BD /* FSExchangeObjectsCompat.h */, 213FAD520B3C6B52004C74BD /* FSExchangeObjectsCompat.c */, @@ -1039,18 +1168,23 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( - 93EE398512B1D803007E6B27 /* dsa_pub.pem */, + 5C49E553131C72FD00696B68 /* dsa_pub.pem */, 21813561105AF27400A0AE18 /* Acknowledgments.txt */, 217DB1810B7CE5B9008CD564 /* Help Notes */, 219196B109D4F1DB00586B15 /* Images */, 2114C259095885C800614E74 /* Localizable.strings */, 8D1107310486CEB800E47090 /* Info.plist */, + 5C49E364131C5CC500696B68 /* Credits.html */, + 2128651C1278AF220013820A /* ServicesMenu.strings */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 212850860B56E549005F6E34 /* CarbonErrorStrings.plist */, - 2182B3C1106B2509008641E4 /* MainMenu.nib */, + 5CF96BFD132EA0300079B3FD /* MainMenu.xib */, + 5C1830CC132EA675005E2210 /* MarkupPreview.xib */, + 5C1830CF132EA687005E2210 /* SaveHTMLPreview.nib */, + 5CBA7A8F1305E2DF004ADEBB /* TagEditingManager.xib */, 212DCFF50A6E005000F74E46 /* DeletionManager.nib */, 212DCB2F0A6AE38500F74E46 /* EncodingsManager.nib */, - 219195E409D3A20F00586B15 /* Preferences.nib */, + 219195E409D3A20F00586B15 /* Preferences.xib */, 21A2FA7A09DF64E9001AF0B5 /* NotationPrefsView.nib */, 214495740ADCC06300E2A2B6 /* PassphrasePicker.nib */, 214495810ADCC07E00E2A2B6 /* PassphraseChanger.nib */, @@ -1063,8 +1197,6 @@ 2110C0CF0B65F09E00F5C52E /* SavedSearches.nib */, 21E6B0950B6E6D0B001ABEDC /* URLGetter.nib */, 213621E70B92413F008C0830 /* FindPanel.nib */, - 608A25781268DF9700EEF326 /* MarkupPreview.xib */, - 93A413BC12E18741002340FD /* SaveHTMLPreview.nib */, ); name = Resources; sourceTree = ""; @@ -1078,34 +1210,65 @@ name = Frameworks; sourceTree = ""; }; - 608A24F21268DD2200EEF326 /* Markup */ = { + 5C96F5A8131C379200A2E4AC /* Markup */ = { isa = PBXGroup; children = ( - 608A25061268DEAB00EEF326 /* MultiMarkdown */, - 608A25631268DEAB00EEF326 /* NSString_MultiMarkdown.h */, - 608A25641268DEAB00EEF326 /* NSString_MultiMarkdown.m */, - 608A24F31268DDC800EEF326 /* Markdown_1.0.1 */, - 608A24F91268DDF200EEF326 /* NSString_Markdown.h */, - 608A24FA1268DDF200EEF326 /* NSString_Markdown.m */, - 608A24ED1268DCF900EEF326 /* Textile_2.12 */, - 608A24D01268DB9F00EEF326 /* NSString_Textile.h */, - 608A24D11268DB9F00EEF326 /* NSString_Textile.m */, + 5C96F617131C380C00A2E4AC /* Markdown_1.0.1 */, + 5C96F610131C380100A2E4AC /* Textile_2.12 */, + 5C96F5B2131C37F500A2E4AC /* MultiMarkdown */, + 5C96F5A9131C37DF00A2E4AC /* NSString_MultiMarkdown.h */, + 5C96F5AA131C37DF00A2E4AC /* NSString_MultiMarkdown.m */, + 5C96F5AB131C37DF00A2E4AC /* NSString_Markdown.h */, + 5C96F5AC131C37DF00A2E4AC /* NSString_Markdown.m */, + 5C96F5AD131C37DF00A2E4AC /* NSString_Textile.h */, + 5C96F5AE131C37DF00A2E4AC /* NSString_Textile.m */, ); name = Markup; sourceTree = ""; }; - 93B9E6D012E5440000DEDECF /* readability */ = { + 5C96F713131C4A1B00A2E4AC /* UIElement Subclasses */ = { + isa = PBXGroup; + children = ( + 5C96F502131C2FA800A2E4AC /* BTTransparentScroller.m */, + 5C96F503131C2FA800A2E4AC /* BTTransparentScroller.h */, + 5C96F6E7131C48FE00A2E4AC /* ETTransparentButton.h */, + 5C96F6E8131C48FE00A2E4AC /* ETTransparentButton.m */, + 5CBD88F0132A84E000FC5A79 /* ETTransparentButtonCell.h */, + 5C96F6DD131C488B00A2E4AC /* ETTransparentButtonCell.m */, + 5C4B35681307225000014119 /* ETTransparentScroller.h */, + 5C4B35691307225000014119 /* ETTransparentScroller.m */, + 5CA10F39131C2A3F00DE1F91 /* MAAttachedWindow.h */, + 5CA10F3A131C2A3F00DE1F91 /* MAAttachedWindow.m */, + 5CC2DF0913083BCF006772D9 /* StatusItemView.h */, + 5CC2DF0A13083BCF006772D9 /* StatusItemView.m */, + 21918FCF09C49B2500586B15 /* EmptyView.h */, + 21918FCE09C49B2400586B15 /* EmptyView.m */, + 5CCEEF1B130B599B00E15B77 /* DFView.h */, + 5CCEEF1C130B599B00E15B77 /* DFView.m */, + 5C9C7732131DA04200FB2652 /* WordCountToken.h */, + 5C9C7733131DA04300FB2652 /* WordCountToken.m */, + 5CF33C701308B478002B5499 /* NotesTableHeaderCell.h */, + 5CF33C711308B478002B5499 /* NotesTableHeaderCell.m */, + 5C2CD035132ED47900CA0D7C /* ETScrollView.h */, + 5C2CD036132ED47900CA0D7C /* ETScrollView.m */, + 5CA08C1E13301D5E004E3250 /* ETContentView.h */, + 5CA08C1F13301D5E004E3250 /* ETContentView.m */, + ); + name = "UIElement Subclasses"; + sourceTree = SOURCE_ROOT; + }; + 5CA10FFA131C2A7600DE1F91 /* readability */ = { isa = PBXGroup; children = ( - 93B9E6D112E5440000DEDECF /* __init__.py */, - 93B9E6D212E5440000DEDECF /* BeautifulSoup.py */, - 93B9E6D312E5440000DEDECF /* BeautifulSoup.pyc */, - 93B9E6D412E5440000DEDECF /* html2text.py */, - 93B9E6D512E5440000DEDECF /* page_parser.py */, - 93B9E6D612E5440000DEDECF /* page_parser.pyc */, - 93B9E6D712E5440000DEDECF /* readability.py */, - 93B9E6D812E5440000DEDECF /* url_helpers.py */, - 93B9E6D912E5440000DEDECF /* url_helpers.pyc */, + 5CA10FFB131C2A7600DE1F91 /* __init__.py */, + 5CA10FFC131C2A7600DE1F91 /* BeautifulSoup.py */, + 5CA10FFD131C2A7600DE1F91 /* BeautifulSoup.pyc */, + 5CA10FFE131C2A7600DE1F91 /* html2text.py */, + 5CA10FFF131C2A7600DE1F91 /* page_parser.py */, + 5CA11000131C2A7600DE1F91 /* page_parser.pyc */, + 5CA11001131C2A7600DE1F91 /* readability.py */, + 5CA11002131C2A7600DE1F91 /* url_helpers.py */, + 5CA11003131C2A7600DE1F91 /* url_helpers.pyc */, ); path = readability; sourceTree = ""; @@ -1118,11 +1281,10 @@ buildConfigurationList = 212B842309780B5000F3597F /* Build configuration list for PBXNativeTarget "Notation" */; buildPhases = ( 8D1107290486CEB800E47090 /* Resources */, - 93A0813012ACF18600DAB227 /* CopyFiles */, 8D11072C0486CEB800E47090 /* Sources */, 8D11072E0486CEB800E47090 /* Frameworks */, 213FB6AD0B52E1B2004C74BD /* CopyFiles */, - 93B9E6E412E5444600DEDECF /* CopyFiles */, + 5C96F565131C35A300A2E4AC /* CopyFiles */, ); buildRules = ( ); @@ -1131,7 +1293,7 @@ name = Notation; productInstallPath = "$(HOME)/Applications"; productName = Notation; - productReference = 8D1107320486CEB800E47090 /* Notational Velocity.app */; + productReference = 8D1107320486CEB800E47090 /* nvALT.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -1149,6 +1311,9 @@ French, German, Portuguese, + fr, + pt, + de, ); mainGroup = 29B97314FDCFA39411CA2CEA /* Notation */; projectDirPath = ""; @@ -1165,110 +1330,143 @@ buildActionMask = 2147483647; files = ( 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - 2114C25B095885C800614E74 /* Localizable.strings in Resources */, - 219195E609D3A20F00586B15 /* Preferences.nib in Resources */, - 219196BF09D4F20100586B15 /* Add_Pressed.tiff in Resources */, - 219196C009D4F20100586B15 /* Add.tiff in Resources */, - 219196C109D4F20100586B15 /* Remove_Pressed.tiff in Resources */, - 219196C209D4F20100586B15 /* Remove.tiff in Resources */, - 21A2FA7C09DF64E9001AF0B5 /* NotationPrefsView.nib in Resources */, - 215DEA3F09EF5323009A710B /* General.tiff in Resources */, - 215DEA4709EF6446009A710B /* Notes.tiff in Resources */, - 215DEE1309F1AA4C009A710B /* Editing.tiff in Resources */, - 212DCB310A6AE38500F74E46 /* EncodingsManager.nib in Resources */, - 212DCFF70A6E005000F74E46 /* DeletionManager.nib in Resources */, - 2144950F0ADC883100E2A2B6 /* PasswordAssistantButton.tif in Resources */, - 214495100ADC883100E2A2B6 /* PasswordAssistantButtonPressed.tif in Resources */, - 2144957A0ADCC06300E2A2B6 /* PassphrasePicker.nib in Resources */, - 214495870ADCC07E00E2A2B6 /* PassphraseChanger.nib in Resources */, 21973A290AFE447A0046683E /* PassphraseRetriever.nib in Resources */, 21544FBE0B06331800C0D1D5 /* KeyDerivationManager.nib in Resources */, 211344C00B3551BD0081B064 /* BlorPasswordRetriever.nib in Resources */, 21F1CD700B3A38DB001FB5F6 /* PTKeyCodes.plist in Resources */, 21F1CD9F0B3A3F88001FB5F6 /* PTKeyComboPanel.nib in Resources */, - 213FB0240B3CB1C4004C74BD /* PTKeyboardIcon.tiff in Resources */, - 212850880B56E549005F6E34 /* CarbonErrorStrings.plist in Resources */, 21FF94F30B5AD22800DB6A2F /* ExporterManager.nib in Resources */, 2110C0D90B65F09F00F5C52E /* SavedSearches.nib in Resources */, 21E6B09B0B6E6D0C001ABEDC /* URLGetter.nib in Resources */, 213621ED0B92413F008C0830 /* FindPanel.nib in Resources */, - 21813562105AF27400A0AE18 /* Acknowledgments.txt in Resources */, - 2182B3C3106B2509008641E4 /* MainMenu.nib in Resources */, 216BA24310746E3900F62D93 /* ImporterAccessory.nib in Resources */, - 21DF19B210D172F600543C35 /* DFCapRightInactive.png in Resources */, - 21DF19B310D172F600543C35 /* DFCapRight.png in Resources */, 21DF19B410D172F600543C35 /* DFCapLeftRoundedInactive.png in Resources */, - 21DF19B510D172F600543C35 /* DFCapLeftRounded.png in Resources */, 21BD2F3610DAF61700BA3DF6 /* SplitViewDimple.tif in Resources */, - 21665A9E10E6032F00188D3D /* Search.png in Resources */, 2143D2F410E953F500127EA6 /* SnapBackPressed.tif in Resources */, - 2143D2F510E953F500127EA6 /* SnapBack.tif in Resources */, 2143D3D910E987B100127EA6 /* Pencil.png in Resources */, - 21B1C171110764570004A7D0 /* statusValidated.png in Resources */, 21B1C172110764570004A7D0 /* statusError.png in Resources */, - 21B1C173110764570004A7D0 /* statusInProgress.png in Resources */, 21AD292D110C188800B7A985 /* TinyAlert.tif in Resources */, - 21AD292F110C18AA00B7A985 /* Notality.icns in Resources */, - 212C6A29110E371B004DD82C /* TBAlertWhite.png in Resources */, 212C6A2A110E371B004DD82C /* TBSynchronizingWhite.png in Resources */, - 212C6A2B110E371B004DD82C /* TBSynchronizing.png in Resources */, 212C6A2C110E371B004DD82C /* TBDownArrowWhite.png in Resources */, - 212C6A2D110E371B004DD82C /* TBRolloverBG.png in Resources */, 212C6A2E110E371B004DD82C /* TBMousedownBG.png in Resources */, - 212C6E9A110E46F0004DD82C /* TBDownArrow.png in Resources */, 212C6EA3110E493C004DD82C /* Clear.tif in Resources */, - 212C6EA4110E493C004DD82C /* ClearPressed.tif in Resources */, 219D1BB3110EA66A005E7DF5 /* TBAlert.png in Resources */, - 219D222F1111564F005E7DF5 /* Contact Information.nvhelp in Resources */, 219D22301111564F005E7DF5 /* This is the title of a note.nvhelp in Resources */, - 219D22311111564F005E7DF5 /* How does this thing work?.nvhelp in Resources */, 21317FAF1113840E00472211 /* Excruciatingly Useful Shortcuts.nvhelp in Resources */, - 21EA3699111C9AD900E2B517 /* Raccourcis incroyablement utiles.nvhelp in Resources */, - 21EA369B111C9AD900E2B517 /* Ceci est le titre d'une note.nvhelp in Resources */, - 21EA369C111C9AD900E2B517 /* Contact.nvhelp in Resources */, - 21E6EC21111DD52B0038ECC7 /* Comment ça marche.nvhelp in Resources */, 57F27F7B11973A7F00C63ACF /* Notation.sdef in Resources */, - 21F447F011B896C4004D008B /* Atalhos Incrivelmente Úteis.nvhelp in Resources */, - 21F447F111B896C4004D008B /* Como funciona isso?.nvhelp in Resources */, - 21F447F211B896C4004D008B /* Este é o título de uma nota.nvhelp in Resources */, - 21F447F311B896C4004D008B /* Informações de Contato.nvhelp in Resources */, - 608A24F11268DCF900EEF326 /* Textile_2.12 in Resources */, - 608A24F81268DDC800EEF326 /* Markdown_1.0.1 in Resources */, - 608A25651268DEAB00EEF326 /* MultiMarkdown in Resources */, - 608A25791268DF9700EEF326 /* MarkupPreview.xib in Resources */, - 9397BB0512B04686004D25E9 /* BTransparentScrollerKnobBottom.tif in Resources */, - 9397BB0612B04686004D25E9 /* BTransparentScrollerKnobHorizontalFill.tif in Resources */, - 9397BB0712B04686004D25E9 /* BTransparentScrollerKnobLeft.tif in Resources */, - 9397BB0812B04686004D25E9 /* BTransparentScrollerKnobRight.tif in Resources */, - 9397BB0912B04686004D25E9 /* BTransparentScrollerKnobTop.tif in Resources */, - 9397BB0A12B04686004D25E9 /* BTransparentScrollerKnobVerticalFill.tif in Resources */, - 9397BB0C12B04686004D25E9 /* BTransparentScrollerSlotHorizontalFill.tif in Resources */, - 9397BB0D12B04686004D25E9 /* BTransparentScrollerSlotLeft.tif in Resources */, - 9397BB0E12B04686004D25E9 /* BTransparentScrollerSlotRight.tif in Resources */, - 9397BB0F12B04686004D25E9 /* BTransparentScrollerSlotTop.tif in Resources */, - 9397BB1012B04686004D25E9 /* BTransparentScrollerSlotVerticalFill.tif in Resources */, - 93439D9912B120CA002946D7 /* scrollbarblue.tif in Resources */, - 93EE398612B1D803007E6B27 /* dsa_pub.pem in Resources */, - 93CF647F12B66F4A0088ADC4 /* tan_column_header.png in Resources */, - 936763CF12BAA34300107A04 /* greyscrollervertbottom.tiff in Resources */, - 936763D012BAA34300107A04 /* greyscrollervertfill.tiff in Resources */, - 936763D112BAA34300107A04 /* greyscrollerverttop.tiff in Resources */, - 9367644F12BBB7B700107A04 /* greyscrollervertbottom2.tiff in Resources */, - 9367645012BBB7B700107A04 /* greyscrollervertfill2.tiff in Resources */, - 9367645112BBB7B700107A04 /* greyscrollerverttop2.tiff in Resources */, - 9349C10212C6743D00E8E5C2 /* TabClose_Front_Pressed.tif in Resources */, - 9349C10312C6743D00E8E5C2 /* TabClose_Front_Rollover.tif in Resources */, - 9349C10412C6743D00E8E5C2 /* TabClose_Front.tif in Resources */, - 93A413BD12E18741002340FD /* SaveHTMLPreview.nib in Resources */, - 93B9E6DA12E5440000DEDECF /* __init__.py in Resources */, - 93B9E6DB12E5440000DEDECF /* BeautifulSoup.py in Resources */, - 93B9E6DC12E5440000DEDECF /* BeautifulSoup.pyc in Resources */, - 93B9E6DD12E5440000DEDECF /* html2text.py in Resources */, - 93B9E6DE12E5440000DEDECF /* page_parser.py in Resources */, - 93B9E6DF12E5440000DEDECF /* page_parser.pyc in Resources */, - 93B9E6E012E5440000DEDECF /* readability.py in Resources */, - 93B9E6E112E5440000DEDECF /* url_helpers.py in Resources */, - 93B9E6E212E5440000DEDECF /* url_helpers.pyc in Resources */, + 2128651E1278AF220013820A /* ServicesMenu.strings in Resources */, + 21C0F8A212C7E7160068693F /* Fonts & Colors.tiff in Resources */, + 216D9C2E12CFEF2A0004B9CE /* LinkBackPressed.tif in Resources */, + 21A38EE412EA864400CEB5F0 /* MakeDefault_Pressed.tiff in Resources */, + 5CBA7A911305E2DF004ADEBB /* TagEditingManager.xib in Resources */, + 5C4B353E1307220E00014119 /* TransparentScrollerKnobTop.tif in Resources */, + 5C4B35401307220E00014119 /* TransparentScrollerSlotBottom.tif in Resources */, + 5C4B35421307220E00014119 /* TransparentScrollerSlotVerticalFill.tif in Resources */, + 5CA11004131C2A7600DE1F91 /* __init__.py in Resources */, + 5CA11005131C2A7600DE1F91 /* BeautifulSoup.py in Resources */, + 5CA11006131C2A7600DE1F91 /* BeautifulSoup.pyc in Resources */, + 5CA11007131C2A7600DE1F91 /* html2text.py in Resources */, + 5CA11008131C2A7600DE1F91 /* page_parser.py in Resources */, + 5CA11009131C2A7600DE1F91 /* page_parser.pyc in Resources */, + 5CA1100A131C2A7600DE1F91 /* readability.py in Resources */, + 5CA1100B131C2A7600DE1F91 /* url_helpers.py in Resources */, + 5CA1100C131C2A7600DE1F91 /* url_helpers.pyc in Resources */, + 5C96F4FF131C2F9500A2E4AC /* TabClose_Front_Pressed.tif in Resources */, + 5C96F501131C2F9500A2E4AC /* TabClose_Front.tif in Resources */, + 5C96F60F131C37F500A2E4AC /* MultiMarkdown in Resources */, + 5C96F616131C380100A2E4AC /* Textile_2.12 in Resources */, + 5C96F61C131C380C00A2E4AC /* Markdown_1.0.1 in Resources */, + 5C96F709131C49D400A2E4AC /* TransparentButtonFillN.tiff in Resources */, + 5C96F70B131C49D400A2E4AC /* TransparentButtonLeftN.tiff in Resources */, + 5C96F70D131C49D400A2E4AC /* TransparentButtonRightN.tiff in Resources */, + 5C49E365131C5CC500696B68 /* Credits.html in Resources */, + 5CF01B08132975910083D66E /* greyscrollervertbottom.tiff in Resources */, + 5CF01B0C132975910083D66E /* greyscrollerverttop.tiff in Resources */, + 5CF01B22132975DB0083D66E /* BTransparentScrollerSlotBottom.tif in Resources */, + 5C94376F132A0C9E00B08B80 /* greyscrollervertbottom3.tif in Resources */, + 5C943771132A0C9E00B08B80 /* greyscrollerverttop3.tif in Resources */, + 5CF96C43132EA1890079B3FD /* Ceci est le titre d'une note.nvhelp in Resources */, + 5CF96C45132EA1890079B3FD /* Contact.nvhelp in Resources */, + 5CF96CB0132EA1890079B3FD /* Info.plist in Resources */, + 5CF96CBD132EA1890079B3FD /* PassphrasePicker.nib in Resources */, + 5CF96CDD132EA1980079B3FD /* Kontaktdaten.nvhelp in Resources */, + 5CF96D93132EA29D0079B3FD /* Atalhos Incrivelmente Úteis.nvhelp in Resources */, + 5CF96D95132EA29D0079B3FD /* Como funciona isso?.nvhelp in Resources */, + 5CF96D98132EA29D0079B3FD /* Este é o título de uma nota.nvhelp in Resources */, + 5CF96D9B132EA29D0079B3FD /* Informações de Contato.nvhelp in Resources */, + 5CF96DA8132EA29D0079B3FD /* MainMenu.xib in Resources */, + 5CF96DA9132EA29D0079B3FD /* dsa_pub.pem in Resources */, + 5CF96DAA132EA29D0079B3FD /* Acknowledgments.txt in Resources */, + 5CF96DAB132EA29D0079B3FD /* Dies ist der Titel einer Notiz.nvhelp in Resources */, + 5CF96DAD132EA29D0079B3FD /* Moglicherweise nutzliche Tastenkurzel.nvhelp in Resources */, + 5CF96DAE132EA29D0079B3FD /* Wie funktioniert dieses Programm?.nvhelp in Resources */, + 5CF96DB0132EA29D0079B3FD /* Comment ça marche.nvhelp in Resources */, + 5CF96DB2132EA29D0079B3FD /* Raccourcis incroyablement utiles.nvhelp in Resources */, + 5CF96DB8132EA29D0079B3FD /* Contact Information.nvhelp in Resources */, + 5CF96DBA132EA29D0079B3FD /* How does this thing work?.nvhelp in Resources */, + 5CF96DBC132EA29D0079B3FD /* greyscrollervertfill3.tif in Resources */, + 5CF96DBF132EA29D0079B3FD /* BTransparentScrollerSlotTop.tif in Resources */, + 5CF96DC0132EA29D0079B3FD /* scrollbarblue.tif in Resources */, + 5CF96DC2132EA29D0079B3FD /* greyscrollervertfill.tiff in Resources */, + 5CF96DC5132EA29D0079B3FD /* TransparentButtonFillP.tiff in Resources */, + 5CF96DC7132EA29D0079B3FD /* TransparentButtonLeftP.tiff in Resources */, + 5CF96DC9132EA29D0079B3FD /* TransparentButtonRightP.tiff in Resources */, + 5CF96DCB132EA29D0079B3FD /* TabClose_Front_Rollover.tif in Resources */, + 5CF96DCD132EA29D0079B3FD /* TransparentScrollerKnobBottom.tif in Resources */, + 5CF96DCF132EA29D0079B3FD /* TransparentScrollerKnobVerticalFill.tif in Resources */, + 5CF96DD1132EA29D0079B3FD /* TransparentScrollerSlotTop.tif in Resources */, + 5CF96DD6132EA29D0079B3FD /* IBeamInverted.png in Resources */, + 5CF96DD7132EA29D0079B3FD /* ListDividerDrag.png in Resources */, + 5CF96DD9132EA29D0079B3FD /* TBDownArrow.png in Resources */, + 5CF96DDA132EA29D0079B3FD /* TBAlertWhite.png in Resources */, + 5CF96DDC132EA29D0079B3FD /* TBSynchronizing.png in Resources */, + 5CF96DDE132EA29D0079B3FD /* TBRolloverBG.png in Resources */, + 5CF96DE1132EA29D0079B3FD /* PTKeyboardIcon.tiff in Resources */, + 5CF96DE2132EA29D0079B3FD /* PasswordAssistantButton.tif in Resources */, + 5CF96DE3132EA29D0079B3FD /* PasswordAssistantButtonPressed.tif in Resources */, + 5CF96DE5132EA29D0079B3FD /* SplitViewDimple2.tif in Resources */, + 5CF96DE6132EA29D0079B3FD /* Editing.tiff in Resources */, + 5CF96DE7132EA29D0079B3FD /* Notes.tiff in Resources */, + 5CF96DE8132EA29D0079B3FD /* General.tiff in Resources */, + 5CF96DEA132EA29D0079B3FD /* Add_Pressed.tiff in Resources */, + 5CF96DEB132EA29D0079B3FD /* Add.tiff in Resources */, + 5CF96DEC132EA29D0079B3FD /* Remove_Pressed.tiff in Resources */, + 5CF96DED132EA29D0079B3FD /* Remove.tiff in Resources */, + 5CF96DEF132EA29D0079B3FD /* MakeDefault.tiff in Resources */, + 5CF96DF0132EA29D0079B3FD /* DFCapRightInactive.png in Resources */, + 5CF96DF1132EA29D0079B3FD /* DFCapRight.png in Resources */, + 5CF96DF3132EA29D0079B3FD /* DFCapLeftRounded.png in Resources */, + 5CF96DF4132EA29D0079B3FD /* Search.png in Resources */, + 5CF96DF7132EA29D0079B3FD /* ClearPressed.tif in Resources */, + 5CF96DF8132EA29D0079B3FD /* LinkBack.tif in Resources */, + 5CF96DFA132EA29D0079B3FD /* SnapBack.tif in Resources */, + 5CF96DFC132EA29D0079B3FD /* statusValidated.png in Resources */, + 5CF96DFE132EA29D0079B3FD /* statusInProgress.png in Resources */, + 5CF96DFF132EA29D0079B3FD /* Localizable.strings in Resources */, + 5CF96E04132EA29D0079B3FD /* CarbonErrorStrings.plist in Resources */, + 5C1830CA132EA675005E2210 /* MarkupPreview.xib in Resources */, + 5C1830CD132EA687005E2210 /* SaveHTMLPreview.nib in Resources */, + 5CF96E09132EA29D0079B3FD /* DeletionManager.nib in Resources */, + 5CF96E0A132EA29D0079B3FD /* EncodingsManager.nib in Resources */, + 5CF96E0B132EA29D0079B3FD /* Preferences.xib in Resources */, + 5CF96E0C132EA29D0079B3FD /* NotationPrefsView.nib in Resources */, + 5C671531133294F30020CCBC /* Atalhos Incrivelmente Úteis.nvhelp in Resources */, + 5C671532133294F30020CCBC /* Como funciona isso?.nvhelp in Resources */, + 5C671533133294F30020CCBC /* Este é o título de uma nota.nvhelp in Resources */, + 5C671534133294F30020CCBC /* Informações de Contato.nvhelp in Resources */, + 5C671539133295280020CCBC /* Atalhos Incrivelmente Úteis.nvhelp in Resources */, + 5C67153A133295280020CCBC /* Como funciona isso?.nvhelp in Resources */, + 5C67153B133295280020CCBC /* Este é o título de uma nota.nvhelp in Resources */, + 5C67153C133295280020CCBC /* Informações de Contato.nvhelp in Resources */, + 93A158BC133C304D00E1E7DA /* Markdownify.nvhelp in Resources */, + 93A158BE133C497400E1E7DA /* Notality.icns in Resources */, + 5C2CC185134989A8006FFE56 /* nvMenu.png in Resources */, + 5C2CC186134989A8006FFE56 /* nvMenuC.png in Resources */, + 5C2CC18A134989D7006FFE56 /* nvMenuDark.png in Resources */, + 93B348281371547800658F98 /* HUDIconLock.png in Resources */, + 93B348291371547800658F98 /* HUDIconPrint.png in Resources */, + 93B3482A1371547800658F98 /* HUDIconSave.png in Resources */, + 93B3482B1371547800658F98 /* HUDIconShare.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1316,8 +1514,6 @@ 215453F00B067A5100C0D1D5 /* KeyDerivationDelaySlider.m in Sources */, 212089B10B0C24F500A15A69 /* AlienNoteImporter.m in Sources */, 212089D80B0C2CA500A15A69 /* StickiesDocument.m in Sources */, - 217EAF0F0B0D56860041A8A9 /* FocusRingScrollView.m in Sources */, - 217EB3CE0B0F62FB0041A8A9 /* NSTextFinder_LastFind.m in Sources */, 219FD3160B2CC655004E132B /* LinkingEditor_Indentation.m in Sources */, 219FD63E0B309B69004E132B /* BlorPasswordRetriever.m in Sources */, 211344450B354E000081B064 /* idea_ossl.c in Sources */, @@ -1333,7 +1529,6 @@ 210A10690B66720F005BE981 /* BookmarksTable.m in Sources */, 21E6B09F0B6E6D18001ABEDC /* URLGetter.m in Sources */, 21582DC50B73F59B00711663 /* BookmarksController.m in Sources */, - 217D02D60B77061E0004E02D /* BodyScroller.m in Sources */, 213621F20B92414F008C0830 /* MultiTextFinder.m in Sources */, 21469C8C0BEBA6A10094835F /* TemporaryFileCache.m in Sources */, 2182B39A106B2296008641E4 /* RBSplitSubview.m in Sources */, @@ -1354,20 +1549,34 @@ 212C6952110E1940004DD82C /* TitlebarButton.m in Sources */, 21B548FA112F307E00E163A1 /* NotationDirectoryManager.m in Sources */, 57F27FB91197407400C63ACF /* SearchCommand.m in Sources */, - 608A24D21268DB9F00EEF326 /* NSString_Textile.m in Sources */, - 608A24FB1268DDF200EEF326 /* NSString_Markdown.m in Sources */, - 608A25661268DEAB00EEF326 /* NSString_MultiMarkdown.m in Sources */, - 608A25AF1268ECFA00EEF326 /* PreviewController.m in Sources */, - 608A25B61268EE5E00EEF326 /* AppController_Preview.m in Sources */, - 9397BAF812B044FB004D25E9 /* BTTransparentScroller.m in Sources */, - 9397BBE012B05991004D25E9 /* BlueTransparentScroller.m in Sources */, - 9397BBE312B059AD004D25E9 /* WhiteTransparentScroller.m in Sources */, - 93439DD912B12B31002946D7 /* CustomTextFieldCell.m in Sources */, - 93CF647912B66B030088ADC4 /* BTTableHeaderCell.m in Sources */, - 930EC2F012C113080004E569 /* NotesTableCornerView.m in Sources */, - 930EC2F112C113080004E569 /* NotesTableHeaderCell.m in Sources */, - 9326D4B712C537F6001A0761 /* MAAttachedWindow.m in Sources */, - 939D7EB212E5932700E7C2F3 /* FullscreenWindow.m in Sources */, + 216D987F12CE68AD0004B9CE /* NSFileManager_NV.m in Sources */, + 216DA22612D17DB70004B9CE /* AugmentedScrollView.m in Sources */, + 21DB3D0F12D4FBDD0057F52B /* SecureTextEntryManager.m in Sources */, + 21DB4BE612DE4E3D0057F52B /* NSString_CustomTruncation.m in Sources */, + 21D6F7EF12E0C751005C2DA5 /* AppController_Importing.m in Sources */, + 21D6FB4912E104D6005C2DA5 /* NSBezierPath_NV.m in Sources */, + 215309F412E4E92300AF2739 /* DiskUUIDEntry.m in Sources */, + 21B64A2612E61FA700D87EFC /* LabelColumnCell.m in Sources */, + 21B64C4E12E62A5700D87EFC /* UnifiedCell.m in Sources */, + 21A3913A12EB4C2F00CEB5F0 /* Spaces.c in Sources */, + 5CBA7A981305E38C004ADEBB /* TagEditingManager.m in Sources */, + 5C4B356A1307225000014119 /* ETTransparentScroller.m in Sources */, + 5CC2DF0B13083BCF006772D9 /* StatusItemView.m in Sources */, + 5CF33C721308B478002B5499 /* NotesTableHeaderCell.m in Sources */, + 5CCEEF1D130B599B00E15B77 /* DFView.m in Sources */, + 5CE6624B13185202002039D0 /* NSTextFinder_LastFind.m in Sources */, + 5CA10F1A131C297000DE1F91 /* PreviewController.m in Sources */, + 5CA10F32131C29E900DE1F91 /* AppController_Preview.m in Sources */, + 5CA10F3B131C2A3F00DE1F91 /* MAAttachedWindow.m in Sources */, + 5C96F504131C2FA800A2E4AC /* BTTransparentScroller.m in Sources */, + 5C96F5AF131C37DF00A2E4AC /* NSString_MultiMarkdown.m in Sources */, + 5C96F5B0131C37DF00A2E4AC /* NSString_Markdown.m in Sources */, + 5C96F5B1131C37DF00A2E4AC /* NSString_Textile.m in Sources */, + 5C96F6DE131C488B00A2E4AC /* ETTransparentButtonCell.m in Sources */, + 5C96F6E9131C48FE00A2E4AC /* ETTransparentButton.m in Sources */, + 5C9C7734131DA04300FB2652 /* WordCountToken.m in Sources */, + 5CA08C2013301D5E004E3250 /* ETContentView.m in Sources */, + 5C2FAD2B1333970200FBFD34 /* ETScrollView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1378,8 +1587,9 @@ isa = PBXVariantGroup; children = ( 089C165DFE840E0CC02AAC07 /* English */, - 21EA368D111C9ABB00E2B517 /* French */, - 21F4482411B89818004D008B /* Portuguese */, + 5CF96C18132EA1880079B3FD /* fr */, + 5CF96CC8132EA1970079B3FD /* de */, + 5CF96D6E132EA29D0079B3FD /* pt */, ); name = InfoPlist.strings; sourceTree = ""; @@ -1388,6 +1598,9 @@ isa = PBXVariantGroup; children = ( 2110C0D00B65F09E00F5C52E /* English */, + 5CF96C3F132EA1890079B3FD /* fr */, + 5CF96CD6132EA1970079B3FD /* de */, + 5CF96D8A132EA29D0079B3FD /* pt */, ); name = SavedSearches.nib; sourceTree = ""; @@ -1396,8 +1609,9 @@ isa = PBXVariantGroup; children = ( 211344BB0B3551BD0081B064 /* English */, - 21EA3679111C9A2600E2B517 /* French */, - 21F4481211B8971D004D008B /* Portuguese */, + 5CF96C09132EA1880079B3FD /* fr */, + 5CF96CBE132EA1970079B3FD /* de */, + 5CF96D58132EA29D0079B3FD /* pt */, ); name = BlorPasswordRetriever.nib; sourceTree = ""; @@ -1406,8 +1620,9 @@ isa = PBXVariantGroup; children = ( 2114C25A095885C800614E74 /* English */, - 21EA3727111CBCB500E2B517 /* French */, - 21F4482511B89818004D008B /* Portuguese */, + 5CF96C1A132EA1880079B3FD /* fr */, + 5CF96CCC132EA1970079B3FD /* de */, + 5CF96D74132EA29D0079B3FD /* pt */, ); name = Localizable.strings; sourceTree = ""; @@ -1416,18 +1631,29 @@ isa = PBXVariantGroup; children = ( 212850870B56E549005F6E34 /* English */, - 21EA36A6111C9B8900E2B517 /* French */, - 21F4482311B89818004D008B /* Portuguese */, + 5CF96C0A132EA1880079B3FD /* fr */, + 5CF96CBF132EA1970079B3FD /* de */, + 5CF96D5B132EA29D0079B3FD /* pt */, ); name = CarbonErrorStrings.plist; sourceTree = ""; }; + 2128651C1278AF220013820A /* ServicesMenu.strings */ = { + isa = PBXVariantGroup; + children = ( + 5CF96C40132EA1890079B3FD /* fr */, + 5CF96CD7132EA1970079B3FD /* de */, + ); + name = ServicesMenu.strings; + sourceTree = ""; + }; 212DCB2F0A6AE38500F74E46 /* EncodingsManager.nib */ = { isa = PBXVariantGroup; children = ( 212DCB300A6AE38500F74E46 /* English */, - 21EA368A111C9AA000E2B517 /* French */, - 21F4481311B8971D004D008B /* Portuguese */, + 5CF96C12132EA1880079B3FD /* fr */, + 5CF96CC3132EA1970079B3FD /* de */, + 5CF96D61132EA29D0079B3FD /* pt */, ); name = EncodingsManager.nib; sourceTree = ""; @@ -1436,8 +1662,9 @@ isa = PBXVariantGroup; children = ( 212DCFF60A6E005000F74E46 /* English */, - 21EA3689111C9AA000E2B517 /* French */, - 21F4481111B896FC004D008B /* Portuguese */, + 5CF96C11132EA1880079B3FD /* fr */, + 5CF96CC0132EA1970079B3FD /* de */, + 5CF96D5E132EA29D0079B3FD /* pt */, ); name = DeletionManager.nib; sourceTree = ""; @@ -1454,6 +1681,9 @@ isa = PBXVariantGroup; children = ( 213621E80B92413F008C0830 /* English */, + 5CF96C14132EA1880079B3FD /* fr */, + 5CF96CC5132EA1970079B3FD /* de */, + 5CF96D69132EA29D0079B3FD /* pt */, ); name = FindPanel.nib; sourceTree = ""; @@ -1462,8 +1692,9 @@ isa = PBXVariantGroup; children = ( 214495750ADCC06300E2A2B6 /* English */, - 21EA3683111C9A6D00E2B517 /* French */, - 21F4481A11B8971D004D008B /* Portuguese */, + 5CF96C1F132EA1880079B3FD /* fr */, + 5CF96CD2132EA1970079B3FD /* de */, + 5CF96D7E132EA29D0079B3FD /* pt */, ); name = PassphrasePicker.nib; sourceTree = ""; @@ -1472,8 +1703,9 @@ isa = PBXVariantGroup; children = ( 214495820ADCC07E00E2A2B6 /* English */, - 21EA3682111C9A6D00E2B517 /* French */, - 21F4481911B8971D004D008B /* Portuguese */, + 5CF96C1E132EA1880079B3FD /* fr */, + 5CF96CD1132EA1970079B3FD /* de */, + 5CF96D7B132EA29D0079B3FD /* pt */, ); name = PassphraseChanger.nib; sourceTree = ""; @@ -1482,8 +1714,9 @@ isa = PBXVariantGroup; children = ( 21544FB90B06331800C0D1D5 /* English */, - 21EA3686111C9A7500E2B517 /* French */, - 21F4481711B8971D004D008B /* Portuguese */, + 5CF96C19132EA1880079B3FD /* fr */, + 5CF96CC9132EA1970079B3FD /* de */, + 5CF96D71132EA29D0079B3FD /* pt */, ); name = KeyDerivationManager.nib; sourceTree = ""; @@ -1492,34 +1725,31 @@ isa = PBXVariantGroup; children = ( 216BA24210746E3900F62D93 /* English */, - 21EA3687111C9A8200E2B517 /* French */, - 21F4481611B8971D004D008B /* Portuguese */, + 5CF96C17132EA1880079B3FD /* fr */, + 5CF96CC7132EA1970079B3FD /* de */, + 5CF96D6B132EA29D0079B3FD /* pt */, ); name = ImporterAccessory.nib; sourceTree = ""; }; - 2182B3C1106B2509008641E4 /* MainMenu.nib */ = { - isa = PBXVariantGroup; - children = ( - 21FFBA96111EC0A9004CB80B /* English */, - ); - name = MainMenu.nib; - sourceTree = ""; - }; - 219195E409D3A20F00586B15 /* Preferences.nib */ = { + 219195E409D3A20F00586B15 /* Preferences.xib */ = { isa = PBXVariantGroup; children = ( - 219195E509D3A20F00586B15 /* English */, + F0E01EE812DB95F40000B192 /* English */, + 5CF96C23132EA1880079B3FD /* fr */, + 5CF96CD4132EA1970079B3FD /* de */, + 5CF96D84132EA29D0079B3FD /* pt */, ); - name = Preferences.nib; + name = Preferences.xib; sourceTree = ""; }; 21973A230AFE447A0046683E /* PassphraseRetriever.nib */ = { isa = PBXVariantGroup; children = ( 21973A240AFE447A0046683E /* English */, - 21EA3684111C9A6D00E2B517 /* French */, - 21F4481B11B8971D004D008B /* Portuguese */, + 5CF96C20132EA1880079B3FD /* fr */, + 5CF96CD3132EA1970079B3FD /* de */, + 5CF96D81132EA29D0079B3FD /* pt */, ); name = PassphraseRetriever.nib; sourceTree = ""; @@ -1552,8 +1782,9 @@ isa = PBXVariantGroup; children = ( 21A2FA7B09DF64E9001AF0B5 /* English */, - 21EA3681111C9A6D00E2B517 /* French */, - 21F4481811B8971D004D008B /* Portuguese */, + 5CF96C1D132EA1880079B3FD /* fr */, + 5CF96CD0132EA1970079B3FD /* de */, + 5CF96D78132EA29D0079B3FD /* pt */, ); name = NotationPrefsView.nib; sourceTree = ""; @@ -1562,94 +1793,170 @@ isa = PBXVariantGroup; children = ( 21E6B0960B6E6D0B001ABEDC /* English */, - 21EA367D111C9A5C00E2B517 /* French */, - 21F4482111B8971D004D008B /* Portuguese */, + 5CF96C42132EA1890079B3FD /* fr */, + 5CF96CD9132EA1970079B3FD /* de */, + 5CF96D90132EA29D0079B3FD /* pt */, ); name = URLGetter.nib; sourceTree = ""; }; - 21E6EC1F111DD52B0038ECC7 /* Comment ça marche.nvhelp */ = { + 21F1CD990B3A3F88001FB5F6 /* PTKeyComboPanel.nib */ = { isa = PBXVariantGroup; children = ( - 21E6EC20111DD52B0038ECC7 /* French */, + 21F1CD9A0B3A3F88001FB5F6 /* English */, + 5CF96C24132EA1880079B3FD /* fr */, + 5CF96CD5132EA1970079B3FD /* de */, + 5CF96D87132EA29D0079B3FD /* pt */, ); - name = "Comment ça marche.nvhelp"; + name = PTKeyComboPanel.nib; + sourceTree = ""; + }; + 21FF94ED0B5AD22800DB6A2F /* ExporterManager.nib */ = { + isa = PBXVariantGroup; + children = ( + 21FF94EE0B5AD22800DB6A2F /* English */, + 5CF96C13132EA1880079B3FD /* fr */, + 5CF96CC4132EA1970079B3FD /* de */, + 5CF96D66132EA29D0079B3FD /* pt */, + ); + name = ExporterManager.nib; sourceTree = ""; }; - 21EA3691111C9AD900E2B517 /* Raccourcis incroyablement utiles.nvhelp */ = { + 5C1830CC132EA675005E2210 /* MarkupPreview.xib */ = { isa = PBXVariantGroup; children = ( - 21EA3692111C9AD900E2B517 /* French */, + 5C1830CB132EA675005E2210 /* English */, ); - name = "Raccourcis incroyablement utiles.nvhelp"; + name = MarkupPreview.xib; + sourceTree = ""; + }; + 5C1830CF132EA687005E2210 /* SaveHTMLPreview.nib */ = { + isa = PBXVariantGroup; + children = ( + 5C1830CE132EA687005E2210 /* English */, + 5C1830D3132EA6A4005E2210 /* fr */, + 5C1830D4132EA6A4005E2210 /* de */, + 5C1830D5132EA6A4005E2210 /* pt */, + ); + name = SaveHTMLPreview.nib; + sourceTree = ""; + }; + 5CBA7A8F1305E2DF004ADEBB /* TagEditingManager.xib */ = { + isa = PBXVariantGroup; + children = ( + 5CBA7A901305E2DF004ADEBB /* English */, + 5CFC3A4E13327EF9000B4792 /* de */, + 5CFC3A4F13327EF9000B4792 /* fr */, + 5CFC3A5013327EF9000B4792 /* pt */, + ); + name = TagEditingManager.xib; sourceTree = ""; }; - 21EA3695111C9AD900E2B517 /* Ceci est le titre d'une note.nvhelp */ = { + 5CF96BFD132EA0300079B3FD /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( - 21EA3696111C9AD900E2B517 /* French */, + 5CF96BFC132EA0300079B3FD /* English */, + 5CF96BFE132EA03E0079B3FD /* fr */, + 5CF96BFF132EA03E0079B3FD /* de */, + 5CF96C00132EA03E0079B3FD /* pt */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; + 5CF96C0B132EA1880079B3FD /* Ceci est le titre d'une note.nvhelp */ = { + isa = PBXVariantGroup; + children = ( + 5CF96C0C132EA1880079B3FD /* fr */, ); name = "Ceci est le titre d'une note.nvhelp"; sourceTree = ""; }; - 21EA3697111C9AD900E2B517 /* Contact.nvhelp */ = { + 5CF96C0D132EA1880079B3FD /* Comment ça marche.nvhelp */ = { + isa = PBXVariantGroup; + children = ( + 5CF96C0E132EA1880079B3FD /* fr */, + ); + name = "Comment ça marche.nvhelp"; + sourceTree = ""; + }; + 5CF96C0F132EA1880079B3FD /* Contact.nvhelp */ = { isa = PBXVariantGroup; children = ( - 21EA3698111C9AD900E2B517 /* French */, + 5CF96C10132EA1880079B3FD /* fr */, ); name = Contact.nvhelp; sourceTree = ""; }; - 21F1CD990B3A3F88001FB5F6 /* PTKeyComboPanel.nib */ = { + 5CF96C25132EA1880079B3FD /* Raccourcis incroyablement utiles.nvhelp */ = { isa = PBXVariantGroup; children = ( - 21F1CD9A0B3A3F88001FB5F6 /* English */, - 21EA367F111C9A6D00E2B517 /* French */, - 21F4481D11B8971D004D008B /* Portuguese */, + 5CF96C26132EA1880079B3FD /* fr */, ); - name = PTKeyComboPanel.nib; + name = "Raccourcis incroyablement utiles.nvhelp"; sourceTree = ""; }; - 21F447E811B896C4004D008B /* Atalhos Incrivelmente Úteis.nvhelp */ = { + 5CF96CC1132EA1970079B3FD /* Dies ist der Titel einer Notiz.nvhelp */ = { isa = PBXVariantGroup; children = ( - 21F447E911B896C4004D008B /* Portuguese */, + 5CF96CC2132EA1970079B3FD /* de */, ); - name = "Atalhos Incrivelmente Úteis.nvhelp"; + name = "Dies ist der Titel einer Notiz.nvhelp"; sourceTree = ""; }; - 21F447EA11B896C4004D008B /* Como funciona isso?.nvhelp */ = { + 5CF96CCA132EA1970079B3FD /* Kontaktdaten.nvhelp */ = { isa = PBXVariantGroup; children = ( - 21F447EB11B896C4004D008B /* Portuguese */, + 5CF96CCB132EA1970079B3FD /* de */, ); - name = "Como funciona isso?.nvhelp"; + name = Kontaktdaten.nvhelp; sourceTree = ""; }; - 21F447EC11B896C4004D008B /* Este é o título de uma nota.nvhelp */ = { + 5CF96CCE132EA1970079B3FD /* Moglicherweise nutzliche Tastenkurzel.nvhelp */ = { isa = PBXVariantGroup; children = ( - 21F447ED11B896C4004D008B /* Portuguese */, + 5CF96CCF132EA1970079B3FD /* de */, ); - name = "Este é o título de uma nota.nvhelp"; + name = "Moglicherweise nutzliche Tastenkurzel.nvhelp"; sourceTree = ""; }; - 21F447EE11B896C4004D008B /* Informações de Contato.nvhelp */ = { + 5CF96CDA132EA1970079B3FD /* Wie funktioniert dieses Programm?.nvhelp */ = { isa = PBXVariantGroup; children = ( - 21F447EF11B896C4004D008B /* Portuguese */, + 5CF96CDB132EA1970079B3FD /* de */, ); - name = "Informações de Contato.nvhelp"; + name = "Wie funktioniert dieses Programm?.nvhelp"; sourceTree = ""; }; - 21FF94ED0B5AD22800DB6A2F /* ExporterManager.nib */ = { + 5CF96D56132EA29D0079B3FD /* Atalhos Incrivelmente Úteis.nvhelp */ = { isa = PBXVariantGroup; children = ( - 21FF94EE0B5AD22800DB6A2F /* English */, - 21EA368B111C9AA000E2B517 /* French */, - 21F4481411B8971D004D008B /* Portuguese */, + 5CF96D57132EA29D0079B3FD /* pt */, ); - name = ExporterManager.nib; + name = "Atalhos Incrivelmente Úteis.nvhelp"; + sourceTree = ""; + }; + 5CF96D5C132EA29D0079B3FD /* Como funciona isso?.nvhelp */ = { + isa = PBXVariantGroup; + children = ( + 5CF96D5D132EA29D0079B3FD /* pt */, + ); + name = "Como funciona isso?.nvhelp"; + sourceTree = ""; + }; + 5CF96D64132EA29D0079B3FD /* Este é o título de uma nota.nvhelp */ = { + isa = PBXVariantGroup; + children = ( + 5CF96D65132EA29D0079B3FD /* pt */, + ); + name = "Este é o título de uma nota.nvhelp"; + sourceTree = ""; + }; + 5CF96D6F132EA29D0079B3FD /* Informações de Contato.nvhelp */ = { + isa = PBXVariantGroup; + children = ( + 5CF96D70132EA29D0079B3FD /* pt */, + ); + name = "Informações de Contato.nvhelp"; sourceTree = ""; }; /* End PBXVariantGroup section */ @@ -1667,9 +1974,9 @@ "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", "\"$(SRCROOT)/French.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", - "\"$(SRCROOT)/../Interface Builder Plug-Ins/BWToolkit\"", - "\"$(DEVELOPER_FRAMEWORKS_DIR)\"", - "\"$(SRCROOT)/../binarygod-BGHUDAppKit-8a706f1/build/Debug\"", + "\"$(SRCROOT)\"", + "\"$(DEVELOPER_DIR)/Library/IBPlugins/BWToolkit\"", + "\"$(SRCROOT)/fr.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", ); FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\""; @@ -1682,11 +1989,12 @@ GCC_FEEDBACK_DIRECTED_OPTIMIZATION = Off; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO; - GCC_OPTIMIZATION_LEVEL = 0; + GCC_OPTIMIZATION_LEVEL = 3; GCC_PFE_FILE_C_DIALECTS = "c objective-c"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Notation_Prefix.pch; GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = com.apple.compilers.llvmgcc42; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; @@ -1701,10 +2009,13 @@ GCC_WARN_UNUSED_PARAMETER = NO; GCC_WARN_UNUSED_VARIABLE = YES; GENERATE_PROFILING_CODE = YES; + HEADER_SEARCH_PATHS = ICU/icu; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; LD_GENERATE_MAP_FILE = YES; LIBRARY_SEARCH_PATHS = "$(LIBRARY_SEARCH_PATHS)"; + MACOSX_DEPLOYMENT_TARGET = 10.5; + "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6][arch=x86_64]" = 10.5; OTHER_CFLAGS = ( "-pg", "-whatsloaded", @@ -1716,7 +2027,9 @@ PDFKit, ); PREBINDING = NO; - PRODUCT_NAME = "Notational Velocity"; + PRODUCT_NAME = nvALT; + SDKROOT = macosx10.5; + "SDKROOT[arch=x86_64]" = macosx10.5; STRIP_STYLE = "non-global"; WARNING_CFLAGS = "-pg"; WARNING_LDFLAGS = "-pg"; @@ -1728,6 +2041,7 @@ 212B842509780B5000F3597F /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { + COPY_PHASE_STRIP = YES; DEAD_CODE_STRIPPING = YES; DEPLOYMENT_POSTPROCESSING = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -1737,9 +2051,9 @@ "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", "\"$(SRCROOT)/French.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", - "\"$(SRCROOT)/../Interface Builder Plug-Ins/BWToolkit\"", - "\"$(DEVELOPER_FRAMEWORKS_DIR)\"", - "\"$(SRCROOT)/../binarygod-BGHUDAppKit-8a706f1/build/Debug\"", + "\"$(SRCROOT)\"", + "\"$(DEVELOPER_DIR)/Library/IBPlugins/BWToolkit\"", + "\"$(SRCROOT)/fr.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", ); FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\""; @@ -1748,10 +2062,12 @@ GCC_ENABLE_CPP_RTTI = NO; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_OPTIMIZATION_LEVEL = s; GCC_PFE_FILE_C_DIALECTS = "c objective-c"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Notation_Prefix.pch; GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = com.apple.compilers.llvmgcc42; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; @@ -1765,14 +2081,18 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_PARAMETER = NO; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ICU/icu; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = "$(LIBRARY_SEARCH_PATHS)"; + MACOSX_DEPLOYMENT_TARGET = 10.5; "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5; + "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6][arch=x86_64]" = 10.5; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ""; PREBINDING = NO; - PRODUCT_NAME = "Notational Velocity"; + PRODUCT_NAME = nvALT; + SDKROOT = macosx10.5; "SDKROOT[arch=x86_64]" = macosx10.5; SECTORDER_FLAGS = ( "-sectorder", @@ -1783,6 +2103,7 @@ start, ); STRIP_INSTALLED_PRODUCT = YES; + STRIP_STYLE = all; WRAPPER_EXTENSION = app; ZERO_LINK = NO; }; @@ -1798,9 +2119,9 @@ "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", "\"$(SRCROOT)/French.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", - "\"$(SRCROOT)/../Interface Builder Plug-Ins/BWToolkit\"", - "\"$(DEVELOPER_FRAMEWORKS_DIR)\"", - "\"$(SRCROOT)/../binarygod-BGHUDAppKit-8a706f1/build/Debug\"", + "\"$(SRCROOT)\"", + "\"$(DEVELOPER_DIR)/Library/IBPlugins/BWToolkit\"", + "\"$(SRCROOT)/fr.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", ); FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\""; @@ -1813,6 +2134,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Notation_Prefix.pch; GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = com.apple.compilers.llvmgcc42; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; @@ -1829,11 +2151,14 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = "$(LIBRARY_SEARCH_PATHS)"; + MACOSX_DEPLOYMENT_TARGET = 10.5; OTHER_LDFLAGS = ( "-weak_framework", PDFKit, ); - PRODUCT_NAME = "Notational Velocity"; + PRODUCT_NAME = nvALT; + SDKROOT = macosx10.5; + "SDKROOT[arch=x86_64]" = macosx10.5; WRAPPER_EXTENSION = app; }; name = Default; @@ -1841,23 +2166,35 @@ 212B842809780B5000F3597F /* Development */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - x86_64, - ppc, - i386, - ); + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; DEAD_CODE_STRIPPING = YES; GCC_DEBUGGING_SYMBOLS = full; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; + GCC_MODEL_TUNING = ""; + GCC_OPTIMIZATION_LEVEL = 3; GCC_THREADSAFE_STATICS = NO; - "GCC_VERSION[sdk=macosx10.5][arch=*]" = 4.0; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_SHADOW = YES; GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.5; - "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5; + "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6][arch=x86_64]" = 10.5; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx10.5; "SDKROOT[arch=x86_64]" = macosx10.5; @@ -1867,19 +2204,41 @@ 212B842909780B5000F3597F /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + DEAD_CODE_STRIPPING = YES; GCC_DEBUGGING_SYMBOLS = full; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_THREADSAFE_STATICS = NO; - GCC_VERSION = 4.2; - "GCC_VERSION[sdk=macosx10.5][arch=*]" = 4.0; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; + GCC_WARN_ABOUT_GLOBAL_CONSTRUCTORS = NO; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_SHADOW = YES; GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.5; - "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.5][arch=*]" = 10.5; + "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6][arch=x86_64]" = 10.5; + PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = YES; + RUN_CLANG_STATIC_ANALYZER = YES; + SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = NO; SDKROOT = macosx10.5; "SDKROOT[arch=x86_64]" = macosx10.5; }; @@ -1888,28 +2247,365 @@ 212B842A09780B5000F3597F /* Default */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - x86_64, - ppc, - i386, - ); + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; DEAD_CODE_STRIPPING = YES; GCC_DEBUGGING_SYMBOLS = full; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_THREADSAFE_STATICS = NO; - "GCC_VERSION[sdk=macosx10.5][arch=*]" = 4.0; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_SHADOW = YES; GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.5; - "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5; + "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6][arch=x86_64]" = 10.5; SDKROOT = macosx10.5; "SDKROOT[arch=x86_64]" = macosx10.5; }; name = Default; }; + 5C8DD68E130F2BC2000AF682 /* Deployment temp */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + GCC_DEBUGGING_SYMBOLS = full; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_THREADSAFE_STATICS = NO; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.5; + "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6][arch=x86_64]" = 10.5; + SDKROOT = macosx10.5; + "SDKROOT[arch=x86_64]" = macosx10.5; + }; + name = "Deployment temp"; + }; + 5C8DD68F130F2BC2000AF682 /* Deployment temp */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; + DEPLOYMENT_POSTPROCESSING = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", + "\"$(SRCROOT)/French.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", + "\"$(SRCROOT)\"", + "\"$(DEVELOPER_DIR)/Library/IBPlugins/BWToolkit\"", + "\"$(SRCROOT)/fr.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; + FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\""; + GCC_DEBUGGING_SYMBOLS = full; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PFE_FILE_C_DIALECTS = "c objective-c"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Notation_Prefix.pch; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = NO; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ICU/icu; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = "$(LIBRARY_SEARCH_PATHS)"; + MACOSX_DEPLOYMENT_TARGET = 10.5; + "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6][arch=x86_64]" = 10.5; + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = ""; + PREBINDING = NO; + PRODUCT_NAME = nvALT; + SDKROOT = macosx10.5; + "SDKROOT[arch=x86_64]" = macosx10.5; + SECTORDER_FLAGS = ( + "-sectorder", + __TEXT, + __text, + Notation.launchorder, + "-e", + start, + ); + STRIP_INSTALLED_PRODUCT = YES; + STRIP_STYLE = all; + WRAPPER_EXTENSION = app; + ZERO_LINK = NO; + }; + name = "Deployment temp"; + }; + 5C9CB58B134A7F0400073277 /* ForBuildingIn3 */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + GCC_DEBUGGING_SYMBOLS = full; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_THREADSAFE_STATICS = NO; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.5; + "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6][arch=x86_64]" = 10.5; + SDKROOT = macosx10.5; + "SDKROOT[arch=x86_64]" = macosx10.5; + }; + name = ForBuildingIn3; + }; + 5C9CB58C134A7F0400073277 /* ForBuildingIn3 */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; + DEPLOYMENT_POSTPROCESSING = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", + "\"$(SRCROOT)/French.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", + "\"$(SRCROOT)\"", + "\"$(DEVELOPER_DIR)/Library/IBPlugins/BWToolkit\"", + "\"$(SRCROOT)/fr.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; + FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\""; + GCC_DEBUGGING_SYMBOLS = full; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PFE_FILE_C_DIALECTS = "c objective-c"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Notation_Prefix.pch; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = NO; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ICU/icu; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = "$(LIBRARY_SEARCH_PATHS)"; + MACOSX_DEPLOYMENT_TARGET = 10.5; + "MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6][arch=x86_64]" = 10.5; + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = ""; + PREBINDING = NO; + PRODUCT_NAME = nvALT; + SDKROOT = macosx10.5; + "SDKROOT[arch=x86_64]" = macosx10.5; + SECTORDER_FLAGS = ( + "-sectorder", + __TEXT, + __text, + Notation.launchorder, + "-e", + start, + ); + STRIP_INSTALLED_PRODUCT = YES; + STRIP_STYLE = all; + WRAPPER_EXTENSION = app; + ZERO_LINK = NO; + }; + name = ForBuildingIn3; + }; + 5CA10DB1131C1AE900DE1F91 /* Development3 */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + DEAD_CODE_STRIPPING = YES; + GCC_DEBUGGING_SYMBOLS = full; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_MODEL_TUNING = ""; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_THREADSAFE_STATICS = NO; + GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = NO; + GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_GLOBAL_CONSTRUCTORS = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_PEDANTIC = NO; + GCC_WARN_PROTOTYPE_CONVERSION = NO; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.5; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx10.5; + }; + name = Development3; + }; + 5CA10DB2131C1AE900DE1F91 /* Development3 */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", + "\"$(SRCROOT)/French.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", + "\"$(SRCROOT)\"", + "\"$(DEVELOPER_DIR)/Library/IBPlugins/BWToolkit\"", + "\"$(SRCROOT)/fr.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; + FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\""; + FRAMEWORK_SEARCH_PATHS_QUOTED_3 = "\"$(SRCROOT)\""; + FRAMEWORK_SEARCH_PATHS_QUOTED_4 = "\"$(SRCROOT)\""; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_FEEDBACK_DIRECTED_OPTIMIZATION = Off; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PFE_FILE_C_DIALECTS = "c objective-c"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Notation_Prefix.pch; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; + GCC_WARN_UNINITIALIZED_AUTOS = NO; + GCC_WARN_UNUSED_FUNCTION = NO; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VARIABLE = YES; + GENERATE_PROFILING_CODE = YES; + HEADER_SEARCH_PATHS = ICU/icu; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LD_GENERATE_MAP_FILE = YES; + LIBRARY_SEARCH_PATHS = "$(LIBRARY_SEARCH_PATHS)"; + MACOSX_DEPLOYMENT_TARGET = 10.5; + OTHER_CFLAGS = ( + "-pg", + "-whatsloaded", + ); + OTHER_LDFLAGS = ( + "-pg", + "-whatsloaded", + "-weak_framework", + PDFKit, + ); + PREBINDING = NO; + PRODUCT_NAME = nvALT; + SDKROOT = macosx10.5; + STRIP_STYLE = "non-global"; + WARNING_CFLAGS = "-pg"; + WARNING_LDFLAGS = "-pg"; + WRAPPER_EXTENSION = app; + ZERO_LINK = NO; + }; + name = Development3; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1917,7 +2613,10 @@ isa = XCConfigurationList; buildConfigurations = ( 212B842509780B5000F3597F /* Deployment */, + 5C8DD68F130F2BC2000AF682 /* Deployment temp */, + 5C9CB58C134A7F0400073277 /* ForBuildingIn3 */, 212B842409780B5000F3597F /* Development */, + 5CA10DB2131C1AE900DE1F91 /* Development3 */, 212B842609780B5000F3597F /* Default */, ); defaultConfigurationIsVisible = 0; @@ -1927,7 +2626,10 @@ isa = XCConfigurationList; buildConfigurations = ( 212B842909780B5000F3597F /* Deployment */, + 5C8DD68E130F2BC2000AF682 /* Deployment temp */, + 5C9CB58B134A7F0400073277 /* ForBuildingIn3 */, 212B842809780B5000F3597F /* Development */, + 5CA10DB1131C1AE900DE1F91 /* Development3 */, 212B842A09780B5000F3597F /* Default */, ); defaultConfigurationIsVisible = 0; diff --git a/Notation.xcodeproj/stevenf.perspectivev3 b/Notation.xcodeproj/stevenf.perspectivev3 deleted file mode 100755 index a222ddeb..00000000 --- a/Notation.xcodeproj/stevenf.perspectivev3 +++ /dev/null @@ -1,1498 +0,0 @@ - - - - - ActivePerspectiveName - Project - AllowedModules - - - BundleLoadPath - - MaxInstances - n - Module - PBXSmartGroupTreeModule - Name - Groups and Files Outline View - - - BundleLoadPath - - MaxInstances - n - Module - PBXNavigatorGroup - Name - Editor - - - BundleLoadPath - - MaxInstances - n - Module - XCTaskListModule - Name - Task List - - - BundleLoadPath - - MaxInstances - n - Module - XCDetailModule - Name - File and Smart Group Detail Viewer - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXBuildResultsModule - Name - Detailed Build Results Viewer - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXProjectFindModule - Name - Project Batch Find Tool - - - BundleLoadPath - - MaxInstances - n - Module - XCProjectFormatConflictsModule - Name - Project Format Conflicts List - - - BundleLoadPath - - MaxInstances - n - Module - PBXBookmarksModule - Name - Bookmarks Tool - - - BundleLoadPath - - MaxInstances - n - Module - PBXClassBrowserModule - Name - Class Browser - - - BundleLoadPath - - MaxInstances - n - Module - PBXCVSModule - Name - Source Code Control Tool - - - BundleLoadPath - - MaxInstances - n - Module - PBXDebugBreakpointsModule - Name - Debug Breakpoints Tool - - - BundleLoadPath - - MaxInstances - n - Module - XCDockableInspector - Name - Inspector - - - BundleLoadPath - - MaxInstances - n - Module - PBXOpenQuicklyModule - Name - Open Quickly Tool - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXDebugSessionModule - Name - Debugger - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXDebugCLIModule - Name - Debug Console - - - BundleLoadPath - - MaxInstances - n - Module - XCSnapshotModule - Name - Snapshots Tool - - - BundlePath - /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources - Description - AIODescriptionKey - DockingSystemVisible - - Extension - perspectivev3 - FavBarConfig - - PBXProjectModuleGUID - F1C037D011238DC7000AC534 - XCBarModuleItemNames - - XCBarModuleItems - - - FirstTimeWindowDisplayed - - Identifier - com.apple.perspectives.project.defaultV3 - MajorVersion - 34 - MinorVersion - 0 - Name - All-In-One - Notifications - - - XCObserverAutoDisconnectKey - - XCObserverDefintionKey - - XCObserverFactoryKey - XCPerspectivesSpecificationIdentifier - XCObserverGUIDKey - XCObserverProjectIdentifier - XCObserverNotificationKey - PBXStatusBuildStateMessageNotification - XCObserverTargetKey - XCMainBuildResultsModuleGUID - XCObserverTriggerKey - awakenModuleWithObserver: - XCObserverValidationKey - - - - OpenEditors - - PerspectiveWidths - - 999 - 999 - - Perspectives - - - ChosenToolbarItems - - XCToolbarPerspectiveControl - NSToolbarSeparatorItem - active-combo-popup - action - NSToolbarFlexibleSpaceItem - debugger-enable-breakpoints - build-and-go - com.apple.ide.PBXToolbarStopButton - get-info - NSToolbarFlexibleSpaceItem - com.apple.pbx.toolbar.searchfield - - ControllerClassBaseName - - IconName - WindowOfProject - Identifier - perspective.project - IsVertical - - Layout - - - ContentConfiguration - - PBXBottomSmartGroupGIDs - - 1C37FBAC04509CD000000102 - 1C37FAAC04509CD000000102 - 1C37FABC05509CD000000102 - 1C37FABC05539CD112110102 - E2644B35053B69B200211256 - 1C37FABC04509CD000100104 - 1CC0EA4004350EF90044410B - 1CC0EA4004350EF90041110B - 1C77FABC04509CD000000102 - - PBXProjectModuleGUID - 1CA23ED40692098700951B8B - PBXProjectModuleLabel - Files - PBXProjectStructureProvided - yes - PBXSmartGroupTreeModuleColumnData - - PBXSmartGroupTreeModuleColumnWidthsKey - - 254 - - PBXSmartGroupTreeModuleColumnsKey_v4 - - MainColumn - - - PBXSmartGroupTreeModuleOutlineStateKey_v7 - - PBXSmartGroupTreeModuleOutlineStateExpansionKey - - 29B97314FDCFA39411CA2CEA - 080E96DDFE201D6D7F000001 - 29B97315FDCFA39411CA2CEA - 29B97317FDCFA39411CA2CEA - 21395BA90B7FDB5E007BCFAA - - PBXSmartGroupTreeModuleOutlineStateSelectionKey - - - 81 - 73 - 0 - - - PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {254, 1080}} - - PBXTopSmartGroupGIDs - - XCIncludePerspectivesSwitch - - - GeometryConfiguration - - Frame - {{0, 0}, {271, 1098}} - GroupTreeTableConfiguration - - MainColumn - 254 - - RubberWindowFrame - 10 39 999 1139 0 0 1920 1178 - - Module - PBXSmartGroupTreeModule - Proportion - 271pt - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - F1C037C511238DC7000AC534 - PBXProjectModuleLabel - NotationPrefs.m - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - F1C037C611238DC7000AC534 - PBXProjectModuleLabel - NotationPrefs.m - _historyCapacity - 10 - bookmark - F13EEF901125D723007DBC98 - history - - F1B71CEE1124B66800669F88 - F13EEF8E1125D723007DBC98 - F13EEF8F1125D723007DBC98 - - - SplitCount - 1 - - StatusBarVisibility - - XCSharingToken - com.apple.Xcode.CommonNavigatorGroupSharingToken - - GeometryConfiguration - - Frame - {{0, 0}, {723, 773}} - RubberWindowFrame - 10 39 999 1139 0 0 1920 1178 - - Module - PBXNavigatorGroup - Proportion - 773pt - - - Proportion - 320pt - Tabs - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA23EDF0692099D00951B8B - PBXProjectModuleLabel - Detail - - GeometryConfiguration - - Frame - {{10, 27}, {723, 293}} - - Module - XCDetailModule - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA23EE00692099D00951B8B - PBXProjectModuleLabel - Project Find - - GeometryConfiguration - - Frame - {{10, 31}, {603, 297}} - - Module - PBXProjectFindModule - - - ContentConfiguration - - PBXCVSModuleFilterTypeKey - 1032 - PBXProjectModuleGUID - 1CA23EE10692099D00951B8B - PBXProjectModuleLabel - SCM Results - - GeometryConfiguration - - Frame - {{10, 31}, {603, 297}} - - Module - PBXCVSModule - - - ContentConfiguration - - PBXProjectModuleGUID - XCMainBuildResultsModuleGUID - PBXProjectModuleLabel - Build Results - XCBuildResultsTrigger_Collapse - 1021 - XCBuildResultsTrigger_Open - 1010 - - GeometryConfiguration - - Frame - {{10, 27}, {723, 293}} - RubberWindowFrame - 10 39 999 1139 0 0 1920 1178 - - Module - PBXBuildResultsModule - - - - - Proportion - 723pt - - - Name - Project - ServiceClasses - - XCModuleDock - PBXSmartGroupTreeModule - XCModuleDock - PBXNavigatorGroup - XCDockableTabModule - XCDetailModule - PBXProjectFindModule - PBXCVSModule - PBXBuildResultsModule - - TableOfContents - - F13EEF7E1125D699007DBC98 - 1CA23ED40692098700951B8B - F13EEF7F1125D699007DBC98 - F1C037C511238DC7000AC534 - F13EEF801125D699007DBC98 - 1CA23EDF0692099D00951B8B - 1CA23EE00692099D00951B8B - 1CA23EE10692099D00951B8B - XCMainBuildResultsModuleGUID - - ToolbarConfigUserDefaultsMinorVersion - 2 - ToolbarConfiguration - xcode.toolbar.config.defaultV3 - - - ChosenToolbarItems - - XCToolbarPerspectiveControl - NSToolbarSeparatorItem - active-combo-popup - NSToolbarFlexibleSpaceItem - debugger-enable-breakpoints - build-and-go - com.apple.ide.PBXToolbarStopButton - debugger-restart-executable - debugger-pause - debugger-step-over - debugger-step-into - debugger-step-out - NSToolbarFlexibleSpaceItem - servicesModulebreakpoints - debugger-show-console-window - - ControllerClassBaseName - PBXDebugSessionModule - IconName - DebugTabIcon - Identifier - perspective.debug - IsVertical - - Layout - - - ContentConfiguration - - PBXProjectModuleGUID - 1CCC7628064C1048000F2A68 - PBXProjectModuleLabel - Debugger Console - - GeometryConfiguration - - Frame - {{0, 0}, {999, 393}} - - Module - PBXDebugCLIModule - Proportion - 393pt - - - ContentConfiguration - - Debugger - - HorizontalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {496, 240}} - {{496, 0}, {503, 240}} - - - VerticalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {999, 240}} - {{0, 240}, {999, 460}} - - - - LauncherConfigVersion - 8 - PBXProjectModuleGUID - 1CCC7629064C1048000F2A68 - PBXProjectModuleLabel - Debug - - GeometryConfiguration - - DebugConsoleVisible - None - DebugConsoleWindowFrame - {{200, 200}, {500, 300}} - DebugSTDIOWindowFrame - {{200, 200}, {500, 300}} - Frame - {{0, 398}, {999, 700}} - PBXDebugSessionStackFrameViewKey - - DebugVariablesTableConfiguration - - Name - 120 - Value - 85 - Summary - 273 - - Frame - {{496, 0}, {503, 240}} - - - Module - PBXDebugSessionModule - Proportion - 700pt - - - Name - Debug - ServiceClasses - - XCModuleDock - PBXDebugCLIModule - PBXDebugSessionModule - PBXDebugProcessAndThreadModule - PBXDebugProcessViewModule - PBXDebugThreadViewModule - PBXDebugStackFrameViewModule - PBXNavigatorGroup - - TableOfContents - - F13EEF811125D699007DBC98 - 1CCC7628064C1048000F2A68 - 1CCC7629064C1048000F2A68 - F13EEF821125D699007DBC98 - F13EEF831125D699007DBC98 - F13EEF841125D699007DBC98 - F13EEF851125D699007DBC98 - F1C037C511238DC7000AC534 - - ToolbarConfigUserDefaultsMinorVersion - 2 - ToolbarConfiguration - xcode.toolbar.config.debugV3 - - - PerspectivesBarVisible - - ShelfIsVisible - - SourceDescription - file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecification.xcperspec' - StatusbarIsVisible - - TimeStamp - 287692579.73175699 - ToolbarConfigUserDefaultsMinorVersion - 2 - ToolbarDisplayMode - 2 - ToolbarIsVisible - - ToolbarSizeMode - 1 - Type - Perspectives - UpdateMessage - - WindowJustification - 5 - WindowOrderList - - /Users/stevenf/Documents/Source/nv/Notation.xcodeproj - - WindowString - 10 39 999 1139 0 0 1920 1178 - WindowToolsV3 - - - Identifier - windowTool.debugger - Layout - - - Dock - - - ContentConfiguration - - Debugger - - HorizontalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {317, 164}} - {{317, 0}, {377, 164}} - - - VerticalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {694, 164}} - {{0, 164}, {694, 216}} - - - - LauncherConfigVersion - 8 - PBXProjectModuleGUID - 1C162984064C10D400B95A72 - PBXProjectModuleLabel - Debug - GLUTExamples (Underwater) - - GeometryConfiguration - - DebugConsoleDrawerSize - {100, 120} - DebugConsoleVisible - None - DebugConsoleWindowFrame - {{200, 200}, {500, 300}} - DebugSTDIOWindowFrame - {{200, 200}, {500, 300}} - Frame - {{0, 0}, {694, 380}} - RubberWindowFrame - 321 238 694 422 0 0 1440 878 - - Module - PBXDebugSessionModule - Proportion - 100% - - - Proportion - 100% - - - Name - Debugger - ServiceClasses - - PBXDebugSessionModule - - StatusbarIsVisible - 1 - TableOfContents - - 1CD10A99069EF8BA00B06720 - 1C0AD2AB069F1E9B00FABCE6 - 1C162984064C10D400B95A72 - 1C0AD2AC069F1E9B00FABCE6 - - ToolbarConfiguration - xcode.toolbar.config.debugV3 - WindowString - 321 238 694 422 0 0 1440 878 - WindowToolGUID - 1CD10A99069EF8BA00B06720 - WindowToolIsVisible - 0 - - - Identifier - windowTool.build - Layout - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1CD0528F0623707200166675 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1CD052900623707200166675 - - SplitCount - 1 - - StatusBarVisibility - 1 - - GeometryConfiguration - - Frame - {{0, 0}, {500, 215}} - RubberWindowFrame - 192 257 500 500 0 0 1280 1002 - - Module - PBXNavigatorGroup - Proportion - 218pt - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - XCMainBuildResultsModuleGUID - PBXProjectModuleLabel - Build Results - - GeometryConfiguration - - Frame - {{0, 222}, {500, 236}} - RubberWindowFrame - 192 257 500 500 0 0 1280 1002 - - Module - PBXBuildResultsModule - Proportion - 236pt - - - Proportion - 458pt - - - Name - Build Results - ServiceClasses - - PBXBuildResultsModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C78EAA5065D492600B07095 - 1C78EAA6065D492600B07095 - 1CD0528F0623707200166675 - XCMainBuildResultsModuleGUID - - ToolbarConfiguration - xcode.toolbar.config.buildV3 - WindowString - 192 257 500 500 0 0 1280 1002 - - - Identifier - windowTool.find - Layout - - - Dock - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1CDD528C0622207200134675 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1CD0528D0623707200166675 - - SplitCount - 1 - - StatusBarVisibility - 1 - - GeometryConfiguration - - Frame - {{0, 0}, {781, 167}} - RubberWindowFrame - 62 385 781 470 0 0 1440 878 - - Module - PBXNavigatorGroup - Proportion - 781pt - - - Proportion - 50% - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - 1CD0528E0623707200166675 - PBXProjectModuleLabel - Project Find - - GeometryConfiguration - - Frame - {{8, 0}, {773, 254}} - RubberWindowFrame - 62 385 781 470 0 0 1440 878 - - Module - PBXProjectFindModule - Proportion - 50% - - - Proportion - 428pt - - - Name - Project Find - ServiceClasses - - PBXProjectFindModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C530D57069F1CE1000CFCEE - 1C530D58069F1CE1000CFCEE - 1C530D59069F1CE1000CFCEE - 1CDD528C0622207200134675 - 1C530D5A069F1CE1000CFCEE - 1CE0B1FE06471DED0097A5F4 - 1CD0528E0623707200166675 - - WindowString - 62 385 781 470 0 0 1440 878 - WindowToolGUID - 1C530D57069F1CE1000CFCEE - WindowToolIsVisible - 0 - - - Identifier - windowTool.snapshots - Layout - - - Dock - - - Module - XCSnapshotModule - Proportion - 100% - - - Proportion - 100% - - - Name - Snapshots - ServiceClasses - - XCSnapshotModule - - StatusbarIsVisible - Yes - ToolbarConfiguration - xcode.toolbar.config.snapshots - WindowString - 315 824 300 550 0 0 1440 878 - WindowToolIsVisible - Yes - - - Identifier - windowTool.debuggerConsole - Layout - - - Dock - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - 1C78EAAC065D492600B07095 - PBXProjectModuleLabel - Debugger Console - - GeometryConfiguration - - Frame - {{0, 0}, {700, 358}} - RubberWindowFrame - 149 87 700 400 0 0 1440 878 - - Module - PBXDebugCLIModule - Proportion - 358pt - - - Proportion - 358pt - - - Name - Debugger Console - ServiceClasses - - PBXDebugCLIModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C530D5B069F1CE1000CFCEE - 1C530D5C069F1CE1000CFCEE - 1C78EAAC065D492600B07095 - - ToolbarConfiguration - xcode.toolbar.config.consoleV3 - WindowString - 149 87 440 400 0 0 1440 878 - WindowToolGUID - 1C530D5B069F1CE1000CFCEE - WindowToolIsVisible - 0 - - - Identifier - windowTool.scm - Layout - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1C78EAB2065D492600B07095 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1C78EAB3065D492600B07095 - - SplitCount - 1 - - StatusBarVisibility - 1 - - GeometryConfiguration - - Frame - {{0, 0}, {452, 0}} - RubberWindowFrame - 743 379 452 308 0 0 1280 1002 - - Module - PBXNavigatorGroup - Proportion - 0pt - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - 1CD052920623707200166675 - PBXProjectModuleLabel - SCM - - GeometryConfiguration - - ConsoleFrame - {{0, 259}, {452, 0}} - Frame - {{0, 7}, {452, 259}} - RubberWindowFrame - 743 379 452 308 0 0 1280 1002 - TableConfiguration - - Status - 30 - FileName - 199 - Path - 197.09500122070312 - - TableFrame - {{0, 0}, {452, 250}} - - Module - PBXCVSModule - Proportion - 262pt - - - Proportion - 266pt - - - Name - SCM - ServiceClasses - - PBXCVSModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C78EAB4065D492600B07095 - 1C78EAB5065D492600B07095 - 1C78EAB2065D492600B07095 - 1CD052920623707200166675 - - ToolbarConfiguration - xcode.toolbar.config.scmV3 - WindowString - 743 379 452 308 0 0 1280 1002 - - - Identifier - windowTool.breakpoints - IsVertical - 0 - Layout - - - Dock - - - BecomeActive - 1 - ContentConfiguration - - PBXBottomSmartGroupGIDs - - 1C77FABC04509CD000000102 - - PBXProjectModuleGUID - 1CE0B1FE06471DED0097A5F4 - PBXProjectModuleLabel - Files - PBXProjectStructureProvided - no - PBXSmartGroupTreeModuleColumnData - - PBXSmartGroupTreeModuleColumnWidthsKey - - 168 - - PBXSmartGroupTreeModuleColumnsKey_v4 - - MainColumn - - - PBXSmartGroupTreeModuleOutlineStateKey_v7 - - PBXSmartGroupTreeModuleOutlineStateExpansionKey - - 1C77FABC04509CD000000102 - - PBXSmartGroupTreeModuleOutlineStateSelectionKey - - - 0 - - - PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {168, 350}} - - PBXTopSmartGroupGIDs - - XCIncludePerspectivesSwitch - 0 - - GeometryConfiguration - - Frame - {{0, 0}, {185, 368}} - GroupTreeTableConfiguration - - MainColumn - 168 - - RubberWindowFrame - 315 424 744 409 0 0 1440 878 - - Module - PBXSmartGroupTreeModule - Proportion - 185pt - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA1AED706398EBD00589147 - PBXProjectModuleLabel - Detail - - GeometryConfiguration - - Frame - {{190, 0}, {554, 368}} - RubberWindowFrame - 315 424 744 409 0 0 1440 878 - - Module - XCDetailModule - Proportion - 554pt - - - Proportion - 368pt - - - MajorVersion - 3 - MinorVersion - 0 - Name - Breakpoints - ServiceClasses - - PBXSmartGroupTreeModule - XCDetailModule - - StatusbarIsVisible - 1 - TableOfContents - - 1CDDB66807F98D9800BB5817 - 1CDDB66907F98D9800BB5817 - 1CE0B1FE06471DED0097A5F4 - 1CA1AED706398EBD00589147 - - ToolbarConfiguration - xcode.toolbar.config.breakpointsV3 - WindowString - 315 424 744 409 0 0 1440 878 - WindowToolGUID - 1CDDB66807F98D9800BB5817 - WindowToolIsVisible - 1 - - - Identifier - windowTool.debugAnimator - Layout - - - Dock - - - Module - PBXNavigatorGroup - Proportion - 100% - - - Proportion - 100% - - - Name - Debug Visualizer - ServiceClasses - - PBXNavigatorGroup - - StatusbarIsVisible - 1 - ToolbarConfiguration - xcode.toolbar.config.debugAnimatorV3 - WindowString - 100 100 700 500 0 0 1280 1002 - - - Identifier - windowTool.bookmarks - Layout - - - Dock - - - Module - PBXBookmarksModule - Proportion - 166pt - - - Proportion - 166pt - - - Name - Bookmarks - ServiceClasses - - PBXBookmarksModule - - StatusbarIsVisible - 0 - WindowString - 538 42 401 187 0 0 1280 1002 - - - Identifier - windowTool.projectFormatConflicts - Layout - - - Dock - - - Module - XCProjectFormatConflictsModule - Proportion - 100% - - - Proportion - 100% - - - Name - Project Format Conflicts - ServiceClasses - - XCProjectFormatConflictsModule - - StatusbarIsVisible - 0 - WindowContentMinSize - 450 300 - WindowString - 50 850 472 307 0 0 1440 877 - - - Identifier - windowTool.classBrowser - Layout - - - Dock - - - BecomeActive - 1 - ContentConfiguration - - OptionsSetName - Hierarchy, all classes - PBXProjectModuleGUID - 1CA6456E063B45B4001379D8 - PBXProjectModuleLabel - Class Browser - NSObject - - GeometryConfiguration - - ClassesFrame - {{0, 0}, {369, 96}} - ClassesTreeTableConfiguration - - PBXClassNameColumnIdentifier - 208 - PBXClassBookColumnIdentifier - 22 - - Frame - {{0, 0}, {616, 353}} - MembersFrame - {{0, 105}, {369, 395}} - MembersTreeTableConfiguration - - PBXMemberTypeIconColumnIdentifier - 22 - PBXMemberNameColumnIdentifier - 216 - PBXMemberTypeColumnIdentifier - 94 - PBXMemberBookColumnIdentifier - 22 - - PBXModuleWindowStatusBarHidden2 - 1 - RubberWindowFrame - 597 125 616 374 0 0 1280 1002 - - Module - PBXClassBrowserModule - Proportion - 354pt - - - Proportion - 354pt - - - Name - Class Browser - ServiceClasses - - PBXClassBrowserModule - - StatusbarIsVisible - 0 - TableOfContents - - 1C78EABA065D492600B07095 - 1C78EABB065D492600B07095 - 1CA6456E063B45B4001379D8 - - ToolbarConfiguration - xcode.toolbar.config.classbrowser - WindowString - 597 125 616 374 0 0 1280 1002 - - - Identifier - windowTool.refactoring - IncludeInToolsMenu - 0 - Layout - - - Dock - - - BecomeActive - 1 - GeometryConfiguration - - Frame - {0, 0}, {500, 335} - RubberWindowFrame - {0, 0}, {500, 335} - - Module - XCRefactoringModule - Proportion - 100% - - - Proportion - 100% - - - Name - Refactoring - ServiceClasses - - XCRefactoringModule - - WindowString - 200 200 500 356 0 0 1920 1200 - - - - diff --git a/NotationController.h b/NotationController.h index 686b4431..2bf62ef1 100755 --- a/NotationController.h +++ b/NotationController.h @@ -21,10 +21,13 @@ #import "LabelsListController.h" #import "WALController.h" +#import + //enum { kUISearch, kUINewNote, kUIDeleteNote, kUIRenameNote, kUILabelOperation }; typedef struct _NoteCatalogEntry { UTCDateTime lastModified; + UTCDateTime lastAttrModified; UInt32 logicalSize; OSType fileType; UInt32 nodeID; @@ -68,16 +71,25 @@ typedef struct _NoteCatalogEntry { NSMutableSet *deletedNotes; int volumeSupportsExchangeObjects; - FNSubscriptionUPP subscriptionCallback; - FNSubscriptionRef noteDirSubscription; FSCatalogInfo *fsCatInfoArray; HFSUniStr255 *HFSUniNameArray; + +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 + FNSubscriptionUPP subscriptionCallback; + FNSubscriptionRef noteDirSubscription; +#endif + FSEventStreamRef noteDirEventStreamRef; + BOOL eventStreamStarted; size_t catEntriesCount, totalCatEntriesCount; NoteCatalogEntry *catalogEntries, **sortedCatalogEntries; unsigned int lastCheckedDateInHours; + int lastLayoutStyleGenerated; long blockSize; + struct statfs *statfsInfo; + unsigned int diskUUIDIndex; + CFUUIDRef diskUUID; FSRef noteDirectoryRef, noteDatabaseRef; AliasHandle aliasHandle; BOOL aliasNeedsUpdating; @@ -118,6 +130,8 @@ typedef struct _NoteCatalogEntry { - (void)synchronizeNoteChanges:(NSTimer*)timer; - (void)updateDateStringsIfNecessary; +- (void)makeForegroundTextColorMatchGlobalPrefs; +- (void)setForegroundTextColor:(NSColor*)aColor; - (void)restyleAllNotes; - (void)setUndoManager:(NSUndoManager*)anUndoManager; - (NSUndoManager*)undoManager; @@ -127,6 +141,7 @@ typedef struct _NoteCatalogEntry { - (void)trashRemainingNoteFilesInDirectory; - (void)checkIfNotationIsTrashed; - (void)updateLinksToNote:(NoteObject*)aNoteObject fromOldName:(NSString*)oldname; +- (void)updateTitlePrefixConnections; - (void)addNotes:(NSArray*)noteArray; - (void)addNotesFromSync:(NSArray*)noteArray; - (void)addNewNote:(NoteObject*)aNoteObject; @@ -137,7 +152,6 @@ typedef struct _NoteCatalogEntry { - (void)removeSyncMDFromDeletedNotesInSet:(NSSet*)notesToOrphan forService:(NSString*)serviceName; - (DeletedNoteObject*)_addDeletedNote:(id)aNote; - (void)_registerDeletionUndoForNote:(NoteObject*)aNote; -- (NoteObject*)addNote:(NSAttributedString*)attributedContents withTitle:(NSString*)title; - (NoteObject*)addNoteFromCatalogEntry:(NoteCatalogEntry*)catEntry; - (BOOL)openFiles:(NSArray*)filenames; @@ -147,12 +161,13 @@ typedef struct _NoteCatalogEntry { - (void)filterNotesFromLabelAtIndex:(int)labelIndex; - (void)filterNotesFromLabelIndexSet:(NSIndexSet*)indexSet; +- (void)updateLabelConnectionsAfterDecoding; - (void)refilterNotes; - (BOOL)filterNotesFromString:(NSString*)string; - (BOOL)filterNotesFromUTF8String:(const char*)searchString forceUncached:(BOOL)forceUncached; - (NSUInteger)preferredSelectedNoteIndex; -- (BOOL)preferredSelectedNoteMatchesSearchString; +- (NSArray*)noteTitlesPrefixedByString:(NSString*)prefixString indexOfSelectedItem:(NSInteger *)anIndex; - (NoteObject*)noteObjectAtFilteredIndex:(int)noteIndex; - (NSArray*)notesAtIndexes:(NSIndexSet*)indexSet; - (NSIndexSet*)indexesOfNotes:(NSArray*)noteSet; @@ -168,11 +183,13 @@ typedef struct _NoteCatalogEntry { - (float)titleColumnWidth; - (void)regeneratePreviewsForColumn:(NSTableColumn*)col visibleFilteredRows:(NSRange)rows forceUpdate:(BOOL)force; - (void)regenerateAllPreviews; +- (void)invalidateAllLabelPreviewImages; //for setting up the nstableviews - (id)labelsListDataSource; - (id)notesListDataSource; +- (NotationPrefs*)notationPrefs; - (SyncSessionController*)syncSessionController; - (void)dealloc; diff --git a/NotationController.m b/NotationController.m index 64f89cef..ac4bfc25 100755 --- a/NotationController.m +++ b/NotationController.m @@ -15,12 +15,13 @@ - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. */ - +#import "AppController.h" #import "NotationController.h" #import "NSCollection_utils.h" #import "NoteObject.h" #import "DeletedNoteObject.h" #import "NSString_NV.h" +#import "NSFileManager_NV.h" #import "BufferUtils.h" #import "GlobalPrefs.h" #import "NotationPrefs.h" @@ -53,19 +54,21 @@ - (id)init { lastWordInFilterStr = 0; selectedNoteIndex = NSNotFound; - subscriptionCallback = NewFNSubscriptionUPP(NotesDirFNSubscriptionProc); - fsCatInfoArray = NULL; HFSUniNameArray = NULL; catalogEntries = NULL; sortedCatalogEntries = NULL; catEntriesCount = totalCatEntriesCount = 0; - + +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 + subscriptionCallback = NewFNSubscriptionUPP(NotesDirFNSubscriptionProc); bzero(¬eDirSubscription, sizeof(FNSubscriptionRef)); +#endif bzero(¬eDatabaseRef, sizeof(FSRef)); bzero(¬eDirectoryRef, sizeof(FSRef)); volumeSupportsExchangeObjects = -1; + lastLayoutStyleGenerated = -1; lastCheckedDateInHours = hoursFromAbsoluteTime(CFAbsoluteTimeGetCurrent()); blockSize = 0; @@ -143,6 +146,8 @@ - (id)initWithDirectoryRef:(FSRef*)directoryRef error:(OSStatus*)err { } [self upgradeDatabaseIfNecessary]; + + [self updateTitlePrefixConnections]; } return self; @@ -169,7 +174,7 @@ - (void)upgradeDatabaseIfNecessary { NSLog(@"trying to upgrade note encodings"); [allNotes makeObjectsPerformSelector:@selector(upgradeToUTF8IfUsingSystemEncoding)]; //move aside the old database as the new format breaks compatibility - (void)[self renameAndForgetNoteDatabaseFile:@"nvALT Notes & Settings (old version from 2.0b)"]; + (void)[self renameAndForgetNoteDatabaseFile:@"Notes & Settings (old version from 2.0b)"]; } if (epochIteration < 3) { [allNotes makeObjectsPerformSelector:@selector(writeFileDatesAndUpdateTrackingInfo)]; @@ -179,6 +184,14 @@ - (void)upgradeDatabaseIfNecessary { NSLog(@"found and removed spurious DB notes"); [self refilterNotes]; } + + //TableColumnsVisible was renamed NoteAttributesVisible to coincide with shifted emphasis; remove old key to declutter prefs + [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"TableColumnsVisible"]; + + //remove and re-add link attributes for all notes + //remove underline attribute for all notes + //add automatic strike-through attribute for all notes + [allNotes makeObjectsPerformSelector:@selector(_resanitizeContent)]; } if (epochIteration < EPOC_ITERATION) { @@ -188,7 +201,7 @@ - (void)upgradeDatabaseIfNecessary { } else if ([notationPrefs epochIteration] > EPOC_ITERATION) { if (NSRunCriticalAlertPanel(NSLocalizedString(@"Warning: this database was created by a newer version of Notational Velocity. Continue anyway?", nil), NSLocalizedString(@"If you make changes, some settings and metadata will be lost.", nil), - NSLocalizedString(@"Quit", nil), NSLocalizedString(@"Continue", nil), nil) == NSAlertDefaultReturn); + NSLocalizedString(@"Quit", nil), NSLocalizedString(@"Continue", nil), nil) == NSAlertDefaultReturn) exit(0); } } @@ -286,6 +299,10 @@ - (OSStatus)_readAndInitializeSerializedNotes { if (!(notationPrefs = [[frozenNotation notationPrefs] retain])) notationPrefs = [[NotationPrefs alloc] init]; [notationPrefs setDelegate:self]; + + //notationPrefs will have the index of the current disk UUID (or we will add it otherwise) + //which will be used to determine which attr-mod-time to use for each note after decoding + [self initializeDiskUUIDIfNecessary]; [allNotes release]; @@ -301,16 +318,16 @@ - (OSStatus)_readAndInitializeSerializedNotes { allNotes = [[NSMutableArray alloc] init]; } else { [allNotes makeObjectsPerformSelector:@selector(setDelegate:) withObject:self]; - //[allNotes makeObjectsPerformSelector:@selector(updateLabelConnectionsAfterDecoding)]; //not until we get an actual tag browser } [deletedNotes release]; - if (!(deletedNotes = [[frozenNotation deletedNotes] retain])) deletedNotes = [[NSMutableSet alloc] init]; - + [prefsController setNotationPrefs:notationPrefs sender:self]; + [self makeForegroundTextColorMatchGlobalPrefs]; + if(notesData) free(notesData); @@ -507,6 +524,10 @@ - (BOOL)flushAllNoteChanges { [NSObject cancelPreviousPerformRequestsWithTarget:walWriter selector:@selector(synchronize) object:nil]; } + //purge attr-mod-times for old disk uuids here + [self purgeOldPerDiskInfoFromNotes]; + + NSData *serializedData = [FrozenNotation frozenDataWithExistingNotes:allNotes deletedNotes:deletedNotes prefs:notationPrefs]; if (!serializedData) { @@ -555,7 +576,6 @@ - (void)databaseEncryptionSettingsChanged { //notation prefs delegate method - (void)databaseSettingsChangedFromOldFormat:(int)oldFormat { - OSStatus err = noErr; int currentStorageFormat = [notationPrefs notesStorageFormat]; if (!walWriter && ![self initializeJournaling]) { @@ -584,15 +604,8 @@ - (void)databaseSettingsChangedFromOldFormat:(int)oldFormat { [self closeJournal]; }*/ //notationPrefs should call flushAllNoteChanges after this method, anyway - - if (IsZeros(¬eDirSubscription, sizeof(FNSubscriptionRef))) { - - err = FNSubscribe(¬eDirectoryRef, subscriptionCallback, self, kFNNoImplicitAllSubscription | kFNNotifyInBackground, ¬eDirSubscription); - if (err != noErr) { - NSLog(@"Could not subscribe to changes in notes directory!"); - //just check modification time of directory? - } - } + + [self startFileNotifications]; [self synchronizeNotesFromDirectory]; } @@ -619,7 +632,9 @@ - (void)synchronizeNoteChanges:(NSTimer*)timer { if ([unwrittenNotes count] > 0) { lastWriteError = noErr; if ([notationPrefs notesStorageFormat] != SingleDatabaseFormat) { - [unwrittenNotes makeObjectsPerformSelector:@selector(writeUsingCurrentFileFormatIfNecessary)]; + //to avoid mutation enumeration if writing this file triggers a filename change which then triggers another makeNoteDirty which then triggers another scheduleWriteForNote: + //loose-coupling? what? + [[[unwrittenNotes copy] autorelease] makeObjectsPerformSelector:@selector(writeUsingCurrentFileFormatIfNecessary)]; //this always seems to call ourselves FNNotify(¬eDirectoryRef, kFNDirectoryModifiedMessage, kFNNoImplicitAllSubscription); @@ -689,7 +704,7 @@ - (void)endDeletionManagerIfNecessary { - (void)checkIfNotationIsTrashed { if ([self notesDirectoryIsTrashed]) { - NSString *trashLocation = [[NSString pathWithFSRef:¬eDirectoryRef] stringByAbbreviatingWithTildeInPath]; + NSString *trashLocation = [[[NSFileManager defaultManager] pathWithFSRef:¬eDirectoryRef] stringByAbbreviatingWithTildeInPath]; if (!trashLocation) trashLocation = @"unknown"; int result = NSRunCriticalAlertPanel([NSString stringWithFormat:NSLocalizedString(@"Your notes directory (%@) appears to be in the Trash.",nil), trashLocation], NSLocalizedString(@"If you empty the Trash now, you could lose your notes. Relocate the notes to a less volatile folder?",nil), @@ -710,24 +725,39 @@ - (void)updateLinksToNote:(NoteObject*)aNoteObject fromOldName:(NSString*)oldnam //O(n) } -//for making notes that we don't already own -- (NoteObject*)addNote:(NSAttributedString*)attributedContents withTitle:(NSString*)title { - if (!title || ![title length]) - title = NSLocalizedString(@"Untitled Note", @"Title of a nameless note"); - - if (!attributedContents) - attributedContents = [[[NSAttributedString alloc] initWithString:@"" attributes:[prefsController noteBodyAttributes]] autorelease]; - - NoteObject *note = [[NoteObject alloc] initWithNoteBody:attributedContents title:title - uniqueFilename:[self uniqueFilenameForTitle:title fromNote:nil] - format:[self currentNoteStorageFormat]]; - - [self addNewNote:note]; - - //we are the the owner of this note - [note release]; - - return note; +- (void)updateTitlePrefixConnections { + //used to auto-complete titles to the first, shortest title of the same prefix-- + //to prevent auto-completing "Chicago Brauhaus" before "Chicago" when search string is "Chi", for example. + //builds a tree-overlay in the list of notes, to find, for any given note, + //all other notes whose complete titles are a prefix of it + + //*** + //*** this method must run after any note is added, deleted, or retitled ** + //*** + + if (![prefsController autoCompleteSearches] || ![allNotes count]) + return; + + //sort alphabetically to find shorter prefixes first + NSMutableArray *allNotesAlpha = [allNotes mutableCopy]; + [allNotesAlpha sortStableUsingFunction:compareTitleString usingBuffer:&allNotesBuffer ofSize:&allNotesBufferSize]; + [allNotes makeObjectsPerformSelector:@selector(removeAllPrefixParentNotes)]; + + NSUInteger j, i = 0, count = [allNotesAlpha count]; + for (i=0; i= vs. ==) - assert(filteredNoteCount >= [allNotes count]); + NSAssert(filteredNoteCount >= [allNotes count], @"filtered notes were claimed to be filtered but were not"); //reset found-ptr values; the search string was effectively blank and so no notes were examined for (i=0; ilogicalSize = (UInt32)(fsCatInfoArray[i].dataLogicalSize & 0xFFFFFFFF); entry->nodeID = (UInt32)fsCatInfoArray[i].nodeID; entry->lastModified = fsCatInfoArray[i].contentModDate; + entry->lastAttrModified = fsCatInfoArray[i].attributeModDate; + if (filename->length > entry->filenameCharCount) { entry->filenameCharCount = filename->length; @@ -246,19 +347,20 @@ - (BOOL)_readFilesInDirectory { - (BOOL)modifyNoteIfNecessary:(NoteObject*)aNoteObject usingCatalogEntry:(NoteCatalogEntry*)catEntry { //check dates UTCDateTime lastReadDate = fileModifiedDateOfNote(aNoteObject); - UTCDateTime fileModDate = catEntry->lastModified; + UTCDateTime *lastAttrModDate = attrsModifiedDateOfNote(aNoteObject); //should we always update the note's stored inode here regardless? +// NSLog(@"content mod: %d,%d,%d, attr mod: %d,%d,%d", catEntry->lastModified.highSeconds,catEntry->lastModified.lowSeconds,catEntry->lastModified.fraction, +// catEntry->lastAttrModified.highSeconds,catEntry->lastAttrModified.lowSeconds,catEntry->lastAttrModified.fraction); + + updateForVerifiedExistingNote(deletionManager, aNoteObject); if (fileSizeOfNote(aNoteObject) != catEntry->logicalSize || - lastReadDate.lowSeconds != fileModDate.lowSeconds || - lastReadDate.highSeconds != fileModDate.highSeconds || - lastReadDate.fraction != fileModDate.fraction) { + *(int64_t*)&lastReadDate != *(int64_t*)&(catEntry->lastModified) || + *(int64_t*)lastAttrModDate != *(int64_t*)&(catEntry->lastAttrModified)) { + //assume the file on disk was modified by someone other than us - - //figure out whether there is a conflict; is this file on disk older than the one that we have in memory? do we merge? - //if ((UInt64*)&fileModDate > (UInt64*)&lastReadDate) - + //check if this note has changes in memory that still need to be committed -- that we _know_ the other writer never had a chance to see if (![unwrittenNotes containsObject:aNoteObject]) { @@ -297,9 +399,9 @@ - (void)makeNotesMatchCatalogEntries:(NoteCatalogEntry**)catEntriesPtrs ofSize:( unsigned int aSize = [allNotes count]; unsigned int bSize = catCount; - ResizeBuffer((void***)&allNotesBuffer, aSize, &allNotesBufferSize); + ResizeArray(&allNotesBuffer, aSize, &allNotesBufferSize); - assert(allNotesBuffer != NULL); + NSAssert(allNotesBuffer != NULL, @"sorting buffer not initialized"); NoteObject **currentNotes = allNotesBuffer; [allNotes getObjects:(id*)currentNotes]; @@ -377,7 +479,7 @@ - (void)makeNotesMatchCatalogEntries:(NoteCatalogEntry**)catEntriesPtrs ofSize:( } } - if (![addedEntries count]) { + if (![addedEntries count]) { [deletionManager addDeletedNotes:removedEntries]; } } @@ -526,7 +628,7 @@ - (void)processNotesAddedByContent:(NSMutableArray*)addedEntries removed:(NSMuta NSValue *val = [sameSizeObj isKindOfClass:[NSArray class]] ? [sameSizeObj objectAtIndex:addedObjCount] : sameSizeObj; NoteObject *addedObjToCompare = [[NoteObject alloc] initWithCatalogEntry:[val pointerValue] delegate:self]; - if ([[addedObjToCompare contentString] isEqual:[removedObj contentString]]) { + if ([[[addedObjToCompare contentString] string] isEqualToString:[[removedObj contentString] string]]) { //process this pair as a modification NSLog(@"File %@ renamed as per content to %@", filenameOfNote(removedObj), filenameOfNote(addedObjToCompare)); @@ -550,7 +652,7 @@ - (void)processNotesAddedByContent:(NSMutableArray*)addedEntries removed:(NSMuta } if (!foundMatchingContent) { - NSLog(@"File %@ _actually_ removed", filenameOfNote(removedObj)); + NSLog(@"File %@ _actually_ removed (size: %u)", filenameOfNote(removedObj), fileSizeOfNote(removedObj)); [deletionManager addDeletedNote:removedObj]; } } diff --git a/NotationFileManager.h b/NotationFileManager.h index 0d6b7ccd..1742ca5c 100755 --- a/NotationFileManager.h +++ b/NotationFileManager.h @@ -23,11 +23,25 @@ extern NSString *NotesDatabaseFileName; +typedef union VolumeUUID { + u_int32_t value[2]; + struct { + u_int32_t high; + u_int32_t low; + } v; +} VolumeUUID; + + @interface NotationController (NotationFileManager) OSStatus CreateTemporaryFile(FSRef *parentRef, FSRef *childTempRef); OSStatus CreateDirectoryIfNotPresent(FSRef *parentRef, CFStringRef subDirectoryName, FSRef *childRef); +CFUUIDRef CopyHFSVolumeUUIDForMount(const char *mntonname); long BlockSizeForNotation(NotationController *controller); +UInt32 diskUUIDIndexForNotation(NotationController *controller); + +- (void)purgeOldPerDiskInfoFromNotes; +- (void)initializeDiskUUIDIfNecessary; - (BOOL)notesDirectoryIsTrashed; diff --git a/NotationFileManager.m b/NotationFileManager.m index 3f37c37d..bb0be2ae 100755 --- a/NotationFileManager.m +++ b/NotationFileManager.m @@ -19,17 +19,19 @@ #import "NotationFileManager.h" #import "NotationPrefs.h" #import "NSString_NV.h" +#import "NSFileManager_NV.h" #import "NoteObject.h" #import "GlobalPrefs.h" #import "NSData_transformations.h" #include #include -NSString *NotesDatabaseFileName = @"nvALT Notes & Settings"; +NSString *NotesDatabaseFileName = @"Notes & Settings"; @implementation NotationController (NotationFileManager) -static long getOptimalBlockSize(NotationController *controller); +static BOOL VolumeSupportsExchangeObjects(NotationController *controller); +static struct statfs *StatFSVolumeInfo(NotationController *controller); OSStatus CreateDirectoryIfNotPresent(FSRef *parentRef, CFStringRef subDirectoryName, FSRef *childRef) { UniChar chars[256]; @@ -52,44 +54,202 @@ OSStatus CreateTemporaryFile(FSRef *parentRef, FSRef *childTempRef) { OSStatus result = noErr; do { - CFStringRef filename = CreateRandomizedFileName(); - nameLength = CFStringGetLength(filename); - result = FSRefMakeInDirectoryWithString(parentRef, childTempRef, filename, chars); - CFRelease(filename); - + CFStringRef filename = CreateRandomizedFileName(); + nameLength = CFStringGetLength(filename); + result = FSRefMakeInDirectoryWithString(parentRef, childTempRef, filename, chars); + CFRelease(filename); + } while (result == noErr); if (result == fnfErr) { - result = FSCreateFileUnicode(parentRef, nameLength, chars, kFSCatInfoNone, NULL, childTempRef, NULL); + result = FSCreateFileUnicode(parentRef, nameLength, chars, kFSCatInfoNone, NULL, childTempRef, NULL); } - return result; } -static long getOptimalBlockSize(NotationController *controller) { - struct statfs sfsb; - OSStatus err = noErr; - const UInt32 maxPathSize = 8 * 1024; //you can never have a large enough path buffer - UInt8 *convertedPath = (UInt8*)malloc(maxPathSize * sizeof(UInt8)); - - if ((err = FSRefMakePath(&(controller->noteDirectoryRef), convertedPath, maxPathSize)) == noErr) { - - if (!statfs((char*)convertedPath, &sfsb)) - return sfsb.f_iosize; - else - NSLog(@"statfs: error %d\n", errno); - } else - NSLog(@"FSRefMakePath: error %d\n", err); - - free(convertedPath); - - return 0; + +/* + Read the UUID from a mounted volume, by calling getattrlist(). + Assumes the path is the mount point of an HFS volume. + */ +static BOOL GetVolumeUUIDAttr(const char *path, VolumeUUID *volumeUUIDPtr) { + struct attrlist alist; + struct FinderAttrBuf { + u_int32_t info_length; + u_int32_t finderinfo[8]; + } volFinderInfo; + + int result = -1; + + /* Set up the attrlist structure to get the volume's Finder Info */ + alist.bitmapcount = 5; + alist.reserved = 0; + alist.commonattr = ATTR_CMN_FNDRINFO; + alist.volattr = ATTR_VOL_INFO; + alist.dirattr = 0; + alist.fileattr = 0; + alist.forkattr = 0; + + /* Get the Finder Info */ + if ((result = getattrlist(path, &alist, &volFinderInfo, sizeof(volFinderInfo), 0))) { + NSLog(@"GetVolumeUUIDAttr error: %d", result); + return NO; + } + + /* Copy the UUID from the Finder Into to caller's buffer */ + VolumeUUID *finderInfoUUIDPtr = (VolumeUUID *)(&volFinderInfo.finderinfo[6]); + volumeUUIDPtr->v.high = CFSwapInt32BigToHost(finderInfoUUIDPtr->v.high); + volumeUUIDPtr->v.low = CFSwapInt32BigToHost(finderInfoUUIDPtr->v.low); + + return YES; +} + + +// Create a version 3 UUID; derived using "name" via MD5 checksum. +static void uuid_create_md5_from_name(unsigned char result_uuid[16], const void *name, int namelen) { + + static unsigned char FSUUIDNamespaceSHA1[16] = { + 0xB3, 0xE2, 0x0F, 0x39, 0xF2, 0x92, 0x11, 0xD6, + 0x97, 0xA4, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC + }; + + MD5_CTX c; + + MD5_Init(&c); + MD5_Update(&c, FSUUIDNamespaceSHA1, sizeof(FSUUIDNamespaceSHA1)); + MD5_Update(&c, name, namelen); + MD5_Final(result_uuid, &c); + + result_uuid[6] = (result_uuid[6] & 0x0F) | 0x30; + result_uuid[8] = (result_uuid[8] & 0x3F) | 0x80; +} + + +CFUUIDRef CopyHFSVolumeUUIDForMount(const char *mntonname) { + VolumeUUID targetVolumeUUID; + + unsigned char rawUUID[8]; + + if (!GetVolumeUUIDAttr(mntonname, &targetVolumeUUID)) + return NULL; + + ((uint32_t *)rawUUID)[0] = CFSwapInt32HostToBig(targetVolumeUUID.v.high); + ((uint32_t *)rawUUID)[1] = CFSwapInt32HostToBig(targetVolumeUUID.v.low); + + CFUUIDBytes uuidBytes; + uuid_create_md5_from_name((void*)&uuidBytes, rawUUID, sizeof(rawUUID)); + + return CFUUIDCreateFromUUIDBytes(NULL, uuidBytes); +} + +CFUUIDRef CopySyntheticUUIDForVolumeCreationDate(FSRef *fsRef) { + + FSCatalogInfo fileInfo; + if (FSGetCatalogInfo(fsRef, kFSCatInfoVolume, &fileInfo, NULL, NULL, NULL) == noErr) { + + FSVolumeInfo volInfo; + OSStatus err = FSGetVolumeInfo(fileInfo.volume, 0, NULL, kFSVolInfoCreateDate, &volInfo, NULL, NULL); + if (err == noErr) { + volInfo.createDate.highSeconds = CFSwapInt16HostToBig(volInfo.createDate.highSeconds); + volInfo.createDate.lowSeconds = CFSwapInt32HostToBig(volInfo.createDate.lowSeconds); + volInfo.createDate.fraction = CFSwapInt16HostToBig(volInfo.createDate.fraction); + + CFUUIDBytes uuidBytes; + uuid_create_md5_from_name((void*)&uuidBytes, (void*)&volInfo.createDate, sizeof(UTCDateTime)); + + return CFUUIDCreateFromUUIDBytes(NULL, uuidBytes); + } else { + NSLog(@"can't even get the volume creation date -- what are you trying to do to me?"); + } + } + return NULL; +} + +static BOOL VolumeSupportsExchangeObjects(NotationController *controller) { + + if (controller->volumeSupportsExchangeObjects == -1) { + /* get source volume's path */ + struct statfs * sfsb = StatFSVolumeInfo(controller); + if (sfsb) { + /* query getattrlist to see if that volume supports FSExchangeObjects */ + controller->volumeSupportsExchangeObjects = ( 0 != (volumeCapabilities(sfsb->f_mntonname) & VOL_CAP_INT_EXCHANGEDATA)); + } + } + return controller->volumeSupportsExchangeObjects; +} + +- (void)purgeOldPerDiskInfoFromNotes { + //here's where notes' PerDiskInfo arrays would have older times removed, depending on -[DiskUUIDEntry lastAccessed] + //each note will use RemovePerDiskInfoWithTableIndex +} + +- (void)initializeDiskUUIDIfNecessary { + //create a CFUUIDRef that identifies the volume this database sits on + + //don't bother unless we will be reading notes as separate files; otherwise there's no need to track the source of the attr mod dates + //maybe disk UUIDs will be used in the future for something else; at that point this check should be altered + + if (!diskUUID && [self currentNoteStorageFormat] != SingleDatabaseFormat) { + + struct statfs * sfsb = StatFSVolumeInfo(self); + //if this is not an hfs+ disk, then get the FSEvents UUID + //if this is not Leopard or the FSEvents UUID is null, + //then take MD5 sum of creation date + some other info? + + if (!strcmp(sfsb->f_fstypename, "hfs")) { + //if this is an HFS volume, then use getattrlist to get finderinfo from the volume + diskUUID = CopyHFSVolumeUUIDForMount(sfsb->f_mntonname); + } + + //ah but what happens when a non-hfs disk is first mounted on leopard+, and then moves to a tiger machine? + //or vise-versa; that calls for tracking how the UUIDs were generated, and grouping them together when others are found; + //this is probably unnecessary for now + if (!diskUUID && IsLeopardOrLater) { + //this is not an hfs disk, and this computer is new enough to have FSEvents + diskUUID = FSEventsCopyUUIDForDevice(sfsb->f_fsid.val[0]); + } + + if (!diskUUID) { + //all other checks failed; just use the volume's creation date + diskUUID = CopySyntheticUUIDForVolumeCreationDate(¬eDirectoryRef); + } + diskUUIDIndex = [notationPrefs tableIndexOfDiskUUID:diskUUID]; + } +} + +static struct statfs *StatFSVolumeInfo(NotationController *controller) { + if (!controller->statfsInfo) { + OSStatus err = noErr; + const UInt32 maxPathSize = 4 * 1024; + UInt8 *convertedPath = (UInt8*)malloc(maxPathSize * sizeof(UInt8)); + + if ((err = FSRefMakePath(&(controller->noteDirectoryRef), convertedPath, maxPathSize)) == noErr) { + + controller->statfsInfo = calloc(1, sizeof(struct statfs)); + + if (statfs((char*)convertedPath, controller->statfsInfo)) + NSLog(@"statfs: error %d\n", errno); + } else + NSLog(@"FSRefMakePath: error %d\n", err); + + free(convertedPath); + } + return controller->statfsInfo; +} + +UInt32 diskUUIDIndexForNotation(NotationController *controller) { + return controller->diskUUIDIndex; } long BlockSizeForNotation(NotationController *controller) { if (!controller->blockSize) { - controller->blockSize = MAX(getOptimalBlockSize(controller), 16 * 1024); + long iosize = 0; + + struct statfs * sfsb = StatFSVolumeInfo(controller); + if (sfsb) iosize = sfsb->f_iosize; + + controller->blockSize = MAX(iosize, 16 * 1024); } return controller->blockSize; @@ -209,7 +369,7 @@ - (void)relocateNotesDirectory { } //directory move successful! //show the user where new notes are - NSString *newNotesPath = [NSString pathWithFSRef:&newNotesDirectory]; + NSString *newNotesPath = [[NSFileManager defaultManager] pathWithFSRef:&newNotesDirectory]; if (newNotesPath) [[NSWorkspace sharedWorkspace] selectFile:newNotesPath inFileViewerRootedAtPath:nil]; break; @@ -244,7 +404,6 @@ + (OSStatus)getDefaultNotesDirectoryRef:(FSRef*)notesDir { //whenever a note uses this method to change its filename, we will have to re-establish all the links to it - (NSString*)uniqueFilenameForTitle:(NSString*)title fromNote:(NoteObject*)note { //generate a unique filename based on title, varying numbers - BOOL isUnique = YES; NSString *uniqueFilename = title; @@ -253,9 +412,13 @@ - (NSString*)uniqueFilenameForTitle:(NSString*)title fromNote:(NoteObject*)note if ([sanitizedName characterAtIndex:0] == (unichar)'.') [sanitizedName replaceCharactersInRange:NSMakeRange(0, 1) withString:@"_"]; uniqueFilename = [[sanitizedName copy] autorelease]; - //use the note's current format if the current default format is for a database - int defaultFormat = [notationPrefs notesStorageFormat]; - NSString *extension = [NotationPrefs pathExtensionForFormat:(defaultFormat || !note ? defaultFormat : storageFormatOfNote(note))]; + //use the note's current format if the current default format is for a database; get the "ideal" extension for that format + int noteFormat = [notationPrefs notesStorageFormat] || !note ? [notationPrefs notesStorageFormat] : storageFormatOfNote(note); + NSString *extension = [notationPrefs chosenPathExtensionForFormat:noteFormat]; + + //if the note's current extension is compatible with the storage format above, then use the existing extension instead + if (note && filenameOfNote(note) && [notationPrefs pathExtensionAllowed:[filenameOfNote(note) pathExtension] forFormat:noteFormat]) + extension = [filenameOfNote(note) pathExtension]; //assume that we won't have more than 999 notes with the exact same name and of more than 247 chars uniqueFilename = [uniqueFilename filenameExpectingAdditionalCharCount:3 + [extension length] + 2]; @@ -312,8 +475,7 @@ - (OSStatus)fileInNotesDirectory:(FSRef*)childRef isOwnedByUs:(BOOL*)owned hasCa if (owned) *owned = NO; if (info) { - whichInfo = kFSCatInfoContentMod | kFSCatInfoCreateDate | kFSCatInfoNodeID | kFSCatInfoDataSizes; - //may have to be adjusted to include logical size if we start tracking that + whichInfo = kFSCatInfoContentMod | kFSCatInfoCreateDate | kFSCatInfoAttrMod | kFSCatInfoNodeID | kFSCatInfoDataSizes; bzero(info, sizeof(FSCatalogInfo)); } @@ -417,9 +579,7 @@ - (OSStatus)storeDataAtomicallyInNotesDirectory:(NSData*)data withName:(NSString //if destRef is not zeros, just assume that it exists and retry if it doesn't FSRef newSourceRef, newDestRef; - if (volumeSupportsExchangeObjects == -1) - volumeSupportsExchangeObjects = VolumeOfFSRefSupportsExchangeObjects(&tempFileRef); - if (!volumeSupportsExchangeObjects) { + if (VolumeSupportsExchangeObjects(self) != 1) { //NSLog(@"emulating fsexchange objects"); if ((err = FSExchangeObjectsEmulate(&tempFileRef, destRef, &newSourceRef, &newDestRef)) == noErr) { memcpy(&tempFileRef, &newSourceRef, sizeof(FSRef)); diff --git a/NotationPrefs.h b/NotationPrefs.h index ae342237..1c6d1581 100755 --- a/NotationPrefs.h +++ b/NotationPrefs.h @@ -22,11 +22,11 @@ /* this class is responsible for managing all preferences specific to a notational database, including encryption, file formats, synchronization, passwords management, and others */ -#define EPOC_ITERATION 3 +#define EPOC_ITERATION 4 -enum { SingleDatabaseFormat = 0, PlainTextFormat, RTFTextFormat, HTMLFormat, WordDocFormat, WordXMLFormat, MarkupTextFormat }; +enum { SingleDatabaseFormat = 0, PlainTextFormat, RTFTextFormat, HTMLFormat, WordDocFormat, WordXMLFormat }; -extern NSString *SyncPrefsDidChangeNotification; +extern NSString *NotationPrefsDidChangeNotification; @interface NotationPrefs : NSObject { BOOL doesEncryption, storesPasswordInKeychain, secureTextEntry; @@ -37,15 +37,19 @@ extern NSString *SyncPrefsDidChangeNotification; unsigned int hashIterationCount, keyLengthInBits; + NSColor *foregroundColor; NSFont *baseBodyFont; int notesStorageFormat; BOOL confirmFileDeletion; - NSMutableArray *typeStrings[7], *pathExtensions[7]; + unsigned int chosenExtIndices[4]; + NSMutableArray *typeStrings[4], *pathExtensions[4]; OSType *allowedTypes; NSData *masterSalt, *dataSessionSalt, *verifierKey; + NSMutableArray *seenDiskUUIDEntries; + UInt32 epochIteration; BOOL firstTimeUsed; BOOL preferencesChanged; @@ -62,6 +66,8 @@ NSMutableDictionary *ServiceAccountDictInit(NotationPrefs *prefs, NSString* serv + (NSMutableArray*)defaultTypeStringsForFormat:(int)formatID; + (NSMutableArray*)defaultPathExtensionsForFormat:(int)formatID; - (BOOL)preferencesChanged; +- (void)setForegroundTextColor:(NSColor*)aColor; +- (NSColor*)foregroundColor; - (void)setBaseBodyFont:(NSFont*)aFont; - (NSFont*)baseBodyFont; @@ -114,6 +120,7 @@ NSMutableDictionary *ServiceAccountDictInit(NotationPrefs *prefs, NSString* serv - (void)removeSyncPasswordForService:(NSString*)serviceName; - (void)setKeyLengthInBits:(unsigned int)newLength; +- (NSUInteger)tableIndexOfDiskUUID:(CFUUIDRef)UUIDRef; - (void)checkForKnownRedundantSyncConduitsAtPath:(NSString*)dbPath; + (NSString*)pathExtensionForFormat:(int)format; @@ -121,17 +128,22 @@ NSMutableDictionary *ServiceAccountDictInit(NotationPrefs *prefs, NSString* serv //used to view tableviews - (NSString*)typeStringAtIndex:(int)typeIndex; - (NSString*)pathExtensionAtIndex:(int)pathIndex; +- (unsigned int)indexOfChosenPathExtension; +- (NSString*)chosenPathExtensionForFormat:(int)format; - (int)typeStringsCount; - (int)pathExtensionsCount; //used to edit tableviews - (void)addAllowedPathExtension:(NSString*)extension; -- (void)removeAllowedPathExtensionAtIndex:(unsigned int)extensionIndex; -- (void)addAllowedType:(NSString*)type; +- (BOOL)removeAllowedPathExtensionAtIndex:(unsigned int)extensionIndex; +- (BOOL)setChosenPathExtensionAtIndex:(unsigned int)extensionIndex; +- (BOOL)addAllowedType:(NSString*)type; - (void)removeAllowedTypeAtIndex:(unsigned int)index; - (BOOL)setExtension:(NSString*)newExtension atIndex:(unsigned int)oldIndex; - (BOOL)setType:(NSString*)newType atIndex:(unsigned int)oldIndex; +- (BOOL)pathExtensionAllowed:(NSString*)anExtension forFormat:(int)formatID; + //actually used while searching for files - (void)updateOSTypesArray; - (BOOL)catalogEntryAllowed:(NoteCatalogEntry*)catEntry; diff --git a/NotationPrefs.m b/NotationPrefs.m index 6ca09f80..3b017361 100755 --- a/NotationPrefs.m +++ b/NotationPrefs.m @@ -15,7 +15,7 @@ - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. */ - +#import "AppController.h" #import "NotationPrefs.h" #import "GlobalPrefs.h" #import "NSString_NV.h" @@ -24,7 +24,8 @@ #import "NotationPrefsViewController.h" #import "NSData_transformations.h" #import "NotationFileManager.h" -#include +#import "SecureTextEntryManager.h" +#import "DiskUUIDEntry.h" #include #include #include @@ -36,7 +37,7 @@ #define INIT_DICT_ACCT() NSMutableDictionary *accountDict = ServiceAccountDictInit(self, serviceName) -NSString *SyncPrefsDidChangeNotification = @"SyncPrefsDidChangeNotification"; +NSString *NotationPrefsDidChangeNotification = @"NotationPrefsDidChangeNotification"; @implementation NotationPrefs @@ -55,18 +56,22 @@ - (id)init { allowedTypes = NULL; unsigned int i; - for (i=0; i<=6; i++) { + for (i=0; i<4; i++) { typeStrings[i] = [[NotationPrefs defaultTypeStringsForFormat:i] retain]; pathExtensions[i] = [[NotationPrefs defaultPathExtensionsForFormat:i] retain]; + chosenExtIndices[i] = 0; } confirmFileDeletion = YES; storesPasswordInKeychain = secureTextEntry = doesEncryption = NO; syncServiceAccounts = [[NSMutableDictionary alloc] init]; + seenDiskUUIDEntries = [[NSMutableArray alloc] init]; notesStorageFormat = SingleDatabaseFormat; hashIterationCount = DEFAULT_HASH_ITERATIONS; keyLengthInBits = DEFAULT_KEY_LENGTH; baseBodyFont = [[[GlobalPrefs defaultPrefs] noteBodyFont] retain]; + //foregroundColor = [[[GlobalPrefs defaultPrefs] foregroundTextColor] retain]; + foregroundColor = [[[NSApp delegate] foregrndColor]retain]; epochIteration = 0; [self updateOSTypesArray]; @@ -84,6 +89,8 @@ - (id)initWithCoder:(NSCoder*)decoder { //if we're initializing from an archive, we've obviously been run at least once before firstTimeUsed = NO; + preferencesChanged = NO; + epochIteration = [decoder decodeInt32ForKey:VAR_STR(epochIteration)]; notesStorageFormat = [decoder decodeIntForKey:VAR_STR(notesStorageFormat)]; doesEncryption = [decoder decodeBoolForKey:VAR_STR(doesEncryption)]; @@ -105,7 +112,20 @@ - (id)initWithCoder:(NSCoder*)decoder { NSLog(@"setting base body to current default: %@", baseBodyFont); preferencesChanged = YES; } - + //foregroundColor does not receive the same treatment as basebodyfont; in the event of a discrepancy between global and per-db settings, + //the former is applied to the notes in the database, while the latter is restored from the database itself + @try { + foregroundColor = [[decoder decodeObjectForKey:VAR_STR(foregroundColor)] retain]; + } @catch (NSException *e) { + NSLog(@"Error trying to unarchive foreground text color (%@, %@)", [e name], [e reason]); + } + if (!foregroundColor || ![foregroundColor isKindOfClass:[NSColor class]]) { + //foregroundColor = [[[GlobalPrefs defaultPrefs] foregroundTextColor] retain]; + + foregroundColor = [[[NSApp delegate] foregrndColor]retain]; + preferencesChanged = YES; + } + confirmFileDeletion = [decoder decodeBoolForKey:VAR_STR(confirmFileDeletion)]; unsigned int i; @@ -114,12 +134,16 @@ - (id)initWithCoder:(NSCoder*)decoder { typeStrings[i] = [[NotationPrefs defaultTypeStringsForFormat:i] retain]; if (!(pathExtensions[i] = [[decoder decodeObjectForKey:[VAR_STR(pathExtensions) stringByAppendingFormat:@".%d",i]] retain])) pathExtensions[i] = [[NotationPrefs defaultPathExtensionsForFormat:i] retain]; + chosenExtIndices[i] = [decoder decodeIntForKey:[VAR_STR(chosenExtIndices) stringByAppendingFormat:@".%d",i]]; } if (!(syncServiceAccounts = [[decoder decodeObjectForKey:VAR_STR(syncServiceAccounts)] retain])) syncServiceAccounts = [[NSMutableDictionary alloc] init]; keychainDatabaseIdentifier = [[decoder decodeObjectForKey:VAR_STR(keychainDatabaseIdentifier)] retain]; + if (!(seenDiskUUIDEntries = [[decoder decodeObjectForKey:VAR_STR(seenDiskUUIDEntries)] retain])) + seenDiskUUIDEntries = [[NSMutableArray alloc] init]; + masterSalt = [[decoder decodeObjectForKey:VAR_STR(masterSalt)] retain]; dataSessionSalt = [[decoder decodeObjectForKey:VAR_STR(dataSessionSalt)] retain]; verifierKey = [[decoder decodeObjectForKey:VAR_STR(verifierKey)] retain]; @@ -129,8 +153,6 @@ - (id)initWithCoder:(NSCoder*)decoder { [self updateOSTypesArray]; } - preferencesChanged = NO; - return self; } @@ -142,6 +164,7 @@ - (void)encodeWithCoder:(NSCoder *)coder { 1: First NSArchiver (was unused--maps to 0) 2: First NSKeyedArchiver 3: First syncServicesMD and date created/modified syncing to files + 4: tracking of file size and attribute mod dates, font foreground colors, openmeta labels */ [coder encodeInt32:EPOC_ITERATION forKey:VAR_STR(epochIteration)]; @@ -154,17 +177,21 @@ - (void)encodeWithCoder:(NSCoder *)coder { [coder encodeBool:confirmFileDeletion forKey:VAR_STR(confirmFileDeletion)]; [coder encodeObject:baseBodyFont forKey:VAR_STR(baseBodyFont)]; - + [coder encodeObject:foregroundColor forKey:VAR_STR(foregroundColor)]; + unsigned int i; for (i=0; i<4; i++) { [coder encodeObject:typeStrings[i] forKey:[VAR_STR(typeStrings) stringByAppendingFormat:@".%d",i]]; [coder encodeObject:pathExtensions[i] forKey:[VAR_STR(pathExtensions) stringByAppendingFormat:@".%d",i]]; + [coder encodeInt:chosenExtIndices[i] forKey:[VAR_STR(chosenExtIndices) stringByAppendingFormat:@".%d",i]]; } [coder encodeObject:[self syncServiceAccountsForArchiving] forKey:VAR_STR(syncServiceAccounts)]; [coder encodeObject:keychainDatabaseIdentifier forKey:VAR_STR(keychainDatabaseIdentifier)]; + [coder encodeObject:seenDiskUUIDEntries forKey:VAR_STR(seenDiskUUIDEntries)]; + [coder encodeObject:masterSalt forKey:VAR_STR(masterSalt)]; [coder encodeObject:dataSessionSalt forKey:VAR_STR(dataSessionSalt)]; [coder encodeObject:verifierKey forKey:VAR_STR(verifierKey)]; @@ -182,8 +209,10 @@ - (void)dealloc { free(allowedTypes); [syncServiceAccounts release]; + [seenDiskUUIDEntries release]; [keychainDatabaseIdentifier release]; [baseBodyFont release]; + [foregroundColor release]; [super dealloc]; } @@ -192,8 +221,6 @@ + (NSMutableArray*)defaultTypeStringsForFormat:(int)formatID { switch (formatID) { case SingleDatabaseFormat: return [NSMutableArray arrayWithCapacity:0]; - case MarkupTextFormat: - // (fall-through intended) case PlainTextFormat: return [NSMutableArray arrayWithObjects:[(id)UTCreateStringForOSType(TEXT_TYPE_ID) autorelease], [(id)UTCreateStringForOSType(UTXT_TYPE_ID) autorelease], nil]; @@ -211,18 +238,15 @@ + (NSMutableArray*)defaultTypeStringsForFormat:(int)formatID { } + (NSMutableArray*)defaultPathExtensionsForFormat:(int)formatID { - NSLog(@"%d",formatID); switch (formatID) { case SingleDatabaseFormat: return [NSMutableArray arrayWithCapacity:0]; case PlainTextFormat: - return [NSMutableArray arrayWithObjects:@"txt", @"text", @"utf8", nil]; - case MarkupTextFormat: - return [NSMutableArray arrayWithObjects:@"md", @"mmd", @"mdown", @"markdown", @"textile", @"text", @"txt", nil]; + return [NSMutableArray arrayWithObjects:@"txt", @"text", @"utf8", @"taskpaper", nil]; case RTFTextFormat: return [NSMutableArray arrayWithObjects:@"rtf", nil]; case HTMLFormat: - return [NSMutableArray arrayWithObjects:@"htm", @"html", nil]; + return [NSMutableArray arrayWithObjects:@"html", @"htm", nil]; case WordDocFormat: return [NSMutableArray arrayWithObjects:@"doc", nil]; case WordXMLFormat: @@ -348,6 +372,17 @@ - (BOOL)firstTimeUsed { return firstTimeUsed; } +- (void)setForegroundTextColor:(NSColor*)aColor { + [foregroundColor autorelease]; + foregroundColor = [aColor retain]; + + preferencesChanged = YES; +} + +- (NSColor*)foregroundColor { + return foregroundColor; +} + - (void)setBaseBodyFont:(NSFont*)aFont { [baseBodyFont autorelease]; baseBodyFont = [aFont retain]; @@ -640,18 +675,20 @@ - (void)setDoesEncryption:(BOOL)value { } - (void)setSecureTextEntry:(BOOL)value { - //make application active to simplify balancing - //(what, someone will be setting this by command-clicking in a window?) - [NSApp activateIgnoringOtherApps:YES]; secureTextEntry = value; preferencesChanged = YES; + SecureTextEntryManager *tem = [SecureTextEntryManager sharedInstance]; + if (secureTextEntry) { - EnableSecureEventInput(); + [tem enableSecureTextEntry]; + [tem checkForIncompatibleApps]; } else { - DisableSecureEventInput(); + //"forget" that the user had disabled the warning dialog when disabling this feature permanently + [[NSUserDefaults standardUserDefaults] removeObjectForKey:ShouldHideSecureTextEntryWarningKey]; + [tem disableSecureTextEntry]; } } @@ -784,6 +821,25 @@ - (void)removeSyncPasswordForService:(NSString*)serviceName { } } +- (NSUInteger)tableIndexOfDiskUUID:(CFUUIDRef)UUIDRef { + //if this UUID doesn't yet exist, then add it and return the last index + + DiskUUIDEntry *diskEntry = [[[DiskUUIDEntry alloc] initWithUUIDRef:UUIDRef] autorelease]; + + NSUInteger idx = [seenDiskUUIDEntries indexOfObject: diskEntry]; + if (NSNotFound != idx) { + [[seenDiskUUIDEntries objectAtIndex:idx] see]; + return idx; + } + + NSLog(@"saw new disk UUID: %@ (other disks are: %@)", diskEntry, seenDiskUUIDEntries); + [seenDiskUUIDEntries addObject:diskEntry]; + + preferencesChanged = YES; + + return [seenDiskUUIDEntries count] - 1; +} + - (void)checkForKnownRedundantSyncConduitsAtPath:(NSString*)dbPath { //is inside dropbox folder and notes are separate files //is set to sync with any service @@ -826,11 +882,8 @@ + (NSString*)pathExtensionForFormat:(int)format { switch (format) { case SingleDatabaseFormat: case PlainTextFormat: - + return @"txt"; - case MarkupTextFormat: - - return @"md"; case RTFTextFormat: return @"rtf"; @@ -871,6 +924,15 @@ - (NSString*)typeStringAtIndex:(int)typeIndex { - (NSString*)pathExtensionAtIndex:(int)pathIndex { return [pathExtensions[notesStorageFormat] objectAtIndex:pathIndex]; } +- (unsigned int)indexOfChosenPathExtension { + return chosenExtIndices[notesStorageFormat]; +} +- (NSString*)chosenPathExtensionForFormat:(int)format { + if (chosenExtIndices[format] >= [pathExtensions[format] count]) + return [NotationPrefs pathExtensionForFormat:format]; + + return [pathExtensions[format] objectAtIndex:chosenExtIndices[format]]; +} - (void)updateOSTypesArray { if (!typeStrings[notesStorageFormat]) @@ -887,25 +949,44 @@ - (void)addAllowedPathExtension:(NSString*)extension { NSString *actualExt = [extension stringAsSafePathExtension]; [pathExtensions[notesStorageFormat] addObject:actualExt]; - - preferencesChanged = YES; + + preferencesChanged = YES; } -- (void)removeAllowedPathExtensionAtIndex:(unsigned int)extensionIndex { +- (BOOL)removeAllowedPathExtensionAtIndex:(unsigned int)extensionIndex { - [pathExtensions[notesStorageFormat] removeObjectAtIndex:extensionIndex]; - - preferencesChanged = YES; + if ([pathExtensions[notesStorageFormat] count] > 1 && extensionIndex < [pathExtensions[notesStorageFormat] count]) { + [pathExtensions[notesStorageFormat] removeObjectAtIndex:extensionIndex]; + + if (chosenExtIndices[notesStorageFormat] >= [pathExtensions[notesStorageFormat] count]) + chosenExtIndices[notesStorageFormat] = 0; + + preferencesChanged = YES; + return YES; + } + return NO; +} +- (BOOL)setChosenPathExtensionAtIndex:(unsigned int)extensionIndex { + if ([pathExtensions[notesStorageFormat] count] > extensionIndex && + [[pathExtensions[notesStorageFormat] objectAtIndex:extensionIndex] length]) { + chosenExtIndices[notesStorageFormat] = extensionIndex; + + preferencesChanged = YES; + return YES; + } + return NO; } -- (void)addAllowedType:(NSString*)type { +- (BOOL)addAllowedType:(NSString*)type { if (type) { [typeStrings[notesStorageFormat] addObject:[type fourCharTypeString]]; [self updateOSTypesArray]; preferencesChanged = YES; + return YES; } + return NO; } - (void)removeAllowedTypeAtIndex:(unsigned int)typeIndex { @@ -951,10 +1032,19 @@ - (BOOL)setType:(NSString*)newType atIndex:(unsigned int)oldIndex { return YES; } +- (BOOL)pathExtensionAllowed:(NSString*)anExtension forFormat:(int)formatID { + NSUInteger i; + for (i=0; i<[pathExtensions[formatID] count]; i++) { + if ([anExtension compare:[pathExtensions[formatID] objectAtIndex:i] + options:NSCaseInsensitiveSearch] == NSOrderedSame) { + return YES; + } + } + return NO; +} + - (BOOL)catalogEntryAllowed:(NoteCatalogEntry*)catEntry { - unsigned int i; - - NSString *filename = (NSString*)catEntry->filename; + NSString *filename = (NSString*)catEntry->filename; if (![filename length]) return NO; @@ -970,13 +1060,10 @@ - (BOOL)catalogEntryAllowed:(NoteCatalogEntry*)catEntry { return NO; } - for (i=0; i<[pathExtensions[notesStorageFormat] count]; i++) { - if ([[filename pathExtension] compare:[pathExtensions[notesStorageFormat] objectAtIndex:i] - options:NSCaseInsensitiveSearch] == NSOrderedSame) { - return YES; - } - } + if ([self pathExtensionAllowed:[filename pathExtension] forFormat:notesStorageFormat]) + return YES; + NSUInteger i; for (i=0; i<[typeStrings[notesStorageFormat] count]; i++) { if (catEntry->fileType == allowedTypes[i]) { return YES; diff --git a/NotationPrefsViewController.h b/NotationPrefsViewController.h index cfa8a11c..6723e7b6 100755 --- a/NotationPrefsViewController.h +++ b/NotationPrefsViewController.h @@ -28,7 +28,11 @@ } @end -@interface NotationPrefsViewController : NSObject { +@interface NotationPrefsViewController : NSObject +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +#endif +{ IBOutlet NSTableView *allowedExtensionsTable; IBOutlet NSTableView *allowedTypesTable; IBOutlet NSButton *enableEncryptionButton; @@ -39,6 +43,7 @@ IBOutlet NSButton *newTypeButton; IBOutlet NSTextField *syncAccountField; IBOutlet NSTextField *syncPasswordField; + IBOutlet NSButton *makeDefaultExtensionButton; IBOutlet NSButton *removeExtensionButton; IBOutlet NSButton *removeTypeButton; IBOutlet NSButton *confirmFileDeletionButton; @@ -91,6 +96,7 @@ - (int)notesStorageFormatInProgress; - (void)runQueuedStorageFormatChangeInvocation; - (IBAction)visitSimplenoteSite:(id)sender; +- (IBAction)makeDefaultExtension:(id)sender; - (IBAction)removedExtension:(id)sender; - (IBAction)removedType:(id)sender; diff --git a/NotationPrefsViewController.m b/NotationPrefsViewController.m index e00f99ec..a5d1f164 100755 --- a/NotationPrefsViewController.m +++ b/NotationPrefsViewController.m @@ -91,7 +91,7 @@ - (void)awakeFromNib { [center addObserver:self selector:@selector(syncCredentialsDidChange:) name:NSControlTextDidChangeNotification object:syncPasswordField]; [center addObserver:self selector:@selector(syncEditingDidEnd:) name:NSControlTextDidEndEditingNotification object:syncPasswordField]; } - [center addObserver:self selector:@selector(initializeControls) name:SyncPrefsDidChangeNotification object:nil]; + [center addObserver:self selector:@selector(initializeControls) name:NotationPrefsDidChangeNotification object:nil]; [self initializeControls]; } @@ -102,6 +102,17 @@ - (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn - (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(NSInteger)rowIndex { return (notationPrefs && [notationPrefs notesStorageFormat]); } +- (void)tableViewSelectionDidChange:(NSNotification *)aNotification { + NSTableView *tv = [aNotification object]; + BOOL isRowSelected = [tv selectedRow] > -1; + + if (tv == allowedExtensionsTable) { + [removeExtensionButton setEnabled:isRowSelected]; + [makeDefaultExtensionButton setEnabled:isRowSelected]; + } else if (tv == allowedTypesTable) { + [removeTypeButton setEnabled:isRowSelected]; + } +} - (void)settingChangedForSelectorString:(NSString*)selectorString { @@ -181,18 +192,17 @@ - (void)setEncryptionControlsState:(BOOL)encryptionState { - (void)setSeparateFileControlsState:(BOOL)separateFileControlsState { [newExtensionButton setEnabled:separateFileControlsState]; - [removeExtensionButton setEnabled:separateFileControlsState]; + [removeExtensionButton setEnabled:separateFileControlsState && [allowedExtensionsTable selectedRow] > -1]; + [makeDefaultExtensionButton setEnabled:separateFileControlsState && [allowedExtensionsTable selectedRow] > -1]; [newTypeButton setEnabled:separateFileControlsState]; - [removeTypeButton setEnabled:separateFileControlsState]; + [removeTypeButton setEnabled:separateFileControlsState && [allowedTypesTable selectedRow] > -1]; [allowedTypesTable setEnabled:separateFileControlsState]; [allowedExtensionsTable setEnabled:separateFileControlsState]; [confirmFileDeletionButton setEnabled:separateFileControlsState]; - int targetItem = [storageFormatPopupButton indexOfItemWithTag:[notationPrefs notesStorageFormat]]; - if (targetItem > -1) - [storageFormatPopupButton selectItemAtIndex:targetItem]; + [storageFormatPopupButton selectItemWithTag:[notationPrefs notesStorageFormat]]; [fileAttributesHelpText setTextColor: separateFileControlsState ? [NSColor controlTextColor] : [NSColor grayColor]]; } @@ -224,11 +234,20 @@ - (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { - if (aTableView == allowedExtensionsTable) - return [notationPrefs pathExtensionAtIndex:rowIndex]; - else if (aTableView == allowedTypesTable) + if (aTableView == allowedExtensionsTable) { + NSString *extension = [notationPrefs pathExtensionAtIndex:rowIndex]; + + if ([notationPrefs indexOfChosenPathExtension] == (unsigned int)rowIndex) { + return [[[NSAttributedString alloc] initWithString:extension attributes: + [NSDictionary dictionaryWithObjectsAndKeys: + [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]], NSFontAttributeName, nil]] autorelease]; + } + return extension; + + } else if (aTableView == allowedTypesTable) { + return [notationPrefs typeStringAtIndex:rowIndex]; - + } return 0; } @@ -245,7 +264,7 @@ - (IBAction)addedExtension:(id)sender { [notationPrefs addAllowedPathExtension:@""]; [allowedExtensionsTable reloadData]; - [allowedExtensionsTable selectRow:[notationPrefs pathExtensionsCount]-1 byExtendingSelection:NO]; + [allowedExtensionsTable selectRowIndexes:[NSIndexSet indexSetWithIndex:[notationPrefs pathExtensionsCount]-1] byExtendingSelection:NO]; [allowedExtensionsTable editColumn:0 row:[notationPrefs pathExtensionsCount]-1 withEvent:nil select:YES]; } @@ -253,7 +272,7 @@ - (IBAction)addedType:(id)sender { [notationPrefs addAllowedType:@""]; [allowedTypesTable reloadData]; - [allowedTypesTable selectRow:[notationPrefs typeStringsCount]-1 byExtendingSelection:NO]; + [allowedTypesTable selectRowIndexes:[NSIndexSet indexSetWithIndex:[notationPrefs typeStringsCount]-1] byExtendingSelection:NO]; [allowedTypesTable editColumn:0 row:[notationPrefs typeStringsCount]-1 withEvent:nil select:YES]; } @@ -304,7 +323,6 @@ - (void)notesStorageFormatDidChange { - (IBAction)changedFileStorageFormat:(id)sender { int storageTag = [storageFormatPopupButton selectedTag]; - if (storageTag != SingleDatabaseFormat && [notationPrefs doesEncryption]) { if (NSRunAlertPanel(NSLocalizedString(@"Encryption is currently on, but storing notes individually requires it to be off. Disable encryption?",nil), NSLocalizedString(@"Warning: Your notes will be written to disk in clear text.",nil), NSLocalizedString(@"Disable Encryption",nil), @@ -340,6 +358,20 @@ - (IBAction)changedFileStorageFormat:(id)sender { //sheet ending will not do this for us--there is no sheet [self runQueuedStorageFormatChangeInvocation]; } + + + if ([[storageFormatPopupButton objectValue] intValue]==0) { + [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"TextEditor"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + }else { + [[NSUserDefaults standardUserDefaults] setObject:@"Default" forKey:@"TextEditor"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + if ( [[NSApp delegate] respondsToSelector: @selector(updateTextApp:)] ) { + [[NSApp delegate] updateTextApp:self]; + } + } + + } - (IBAction)toggledSyncing:(id)sender { @@ -453,15 +485,29 @@ - (IBAction)visitSimplenoteSite:(id)sender { [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://simplenoteapp.com/"]]; } +- (IBAction)makeDefaultExtension:(id)sender { + [[allowedExtensionsTable window] makeFirstResponder:allowedExtensionsTable]; + + int selectedRow = [allowedExtensionsTable selectedRow]; + if (selectedRow > -1) + [notationPrefs setChosenPathExtensionAtIndex:selectedRow]; + + [allowedExtensionsTable reloadData]; +} + - (IBAction)removedExtension:(id)sender { + [allowedExtensionsTable abortEditing]; + int selectedRow = [allowedExtensionsTable selectedRow]; if (selectedRow > -1) - [notationPrefs removeAllowedPathExtensionAtIndex:selectedRow]; + if (![notationPrefs removeAllowedPathExtensionAtIndex:selectedRow]) NSBeep(); [allowedExtensionsTable reloadData]; } - (IBAction)removedType:(id)sender { + [allowedTypesTable abortEditing]; + int selectedRow = [allowedTypesTable selectedRow]; if (selectedRow > -1) [notationPrefs removeAllowedTypeAtIndex:selectedRow]; @@ -479,9 +525,7 @@ - (void)passphrasePicker:(PassphrasePicker*)picker choseAPassphrase:(BOOL)succes - (void)encryptionFormatMismatchSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { if (returnCode == NSAlertDefaultReturn) { //switching to single DB - int targetItem = [storageFormatPopupButton indexOfItemWithTag:SingleDatabaseFormat]; - if (targetItem > -1) - [storageFormatPopupButton selectItemAtIndex:targetItem]; + [storageFormatPopupButton selectItemWithTag:SingleDatabaseFormat]; [self performSelector:@selector(changedFileStorageFormat:) withObject:storageFormatPopupButton afterDelay:0.0]; diff --git a/NotationSyncServiceManager.h b/NotationSyncServiceManager.h old mode 100755 new mode 100644 index 5a47d915..a5e9a037 --- a/NotationSyncServiceManager.h +++ b/NotationSyncServiceManager.h @@ -26,6 +26,8 @@ - (NSDictionary*)invertedDictionaryOfEntries:(NSArray*)entries keyedBy:(NSString*)keyName; - (NSDictionary*)invertedDictionaryOfNotes:(NSArray*)someNotes forSession:(id)aSession; +- (NoteObject*)noteForKey:(NSString*)key ofServiceClass:(Class)serviceClass; + - (void)makeNotesMatchList:(NSArray*)MDEntries fromSyncSession:(id )syncSession; - (void)schedulePushToAllSyncServicesForNote:(id )aNote; diff --git a/NotationSyncServiceManager.m b/NotationSyncServiceManager.m old mode 100755 new mode 100644 index b1815837..d31b5eb1 --- a/NotationSyncServiceManager.m +++ b/NotationSyncServiceManager.m @@ -58,6 +58,17 @@ - (NSDictionary*)invertedDictionaryOfNotes:(NSArray*)someNotes forSession:(id)serviceClass { + NSUInteger i = 0; + for (i=0; i<[allNotes count]; i++) { + NoteObject *note = [allNotes objectAtIndex:i]; + if ([[[[note syncServicesMD] objectForKey:[serviceClass serviceName]] + objectForKey:[serviceClass nameOfKeyElement]] isEqualToString:key]) + return note; + } + return nil; +} + - (void)startSyncServices { [syncSessionController setSyncDelegate:self]; [syncSessionController initializeAllServices]; diff --git a/Notation_Prefix.pch b/Notation_Prefix.pch index eecf04c0..fc01c5af 100755 --- a/Notation_Prefix.pch +++ b/Notation_Prefix.pch @@ -9,7 +9,6 @@ #if __OBJC__ #import -#import #endif #ifndef NSFoundationVersionNumber10_6 @@ -37,6 +36,11 @@ typedef unsigned int NSUInteger; #define NSINTEGER_DEFINED 1 #endif +#define DebugPath(__p) (__p = ((!(__p)) ? __FILE__ : (__p))) +#define _COMPILE_ASSERT_SYMBOL_INNER(line, msg) __COMPILE_ASSERT_ ## line ## __ ## msg +#define _COMPILE_ASSERT_SYMBOL(line, msg) _COMPILE_ASSERT_SYMBOL_INNER(line, msg) +#define COMPILE_ASSERT(test, msg) \ +typedef char _COMPILE_ASSERT_SYMBOL(__LINE__, msg) [ ((test) ? 1 : -1) ] #define GCC_VERSION (__GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ @@ -71,5 +75,8 @@ typedef unsigned int NSUInteger; #define IsLeopardOrLater (floor(NSFoundationVersionNumber) >= NSFoundationVersionNumber10_5) #define IsSnowLeopardOrLater (floor(NSFoundationVersionNumber) >= NSFoundationVersionNumber10_6) +#define IsLionOrLater (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber10_6) #define NOTES_MENU_ID 89 +#define VIEW_MENU_ID 99 + diff --git a/NoteAttributeColumn.h b/NoteAttributeColumn.h index ceee3e80..bfca5a4b 100755 --- a/NoteAttributeColumn.h +++ b/NoteAttributeColumn.h @@ -15,33 +15,31 @@ #import @class NotesTableView; - +/* @interface NoteTableHeaderCell : NSTableHeaderCell { - NSImage *metalBg; - NSMutableDictionary *attrs; + } @end - +*/ @interface NoteAttributeColumn : NSTableColumn { NSInteger (*sortFunction) (id*, id*); NSInteger (*reverseSortFunction) (id*, id*); - id (*objectAttribute) (id, id); - SEL mutateObjectSelector; - + id (*objectAttribute) (id, id, NSInteger); + SEL mutateObjectSelector; float absoluteMinimumWidth; } + (NSDictionary*)standardDictionary; SEL columnAttributeMutator(NoteAttributeColumn *col); - (void)setMutatingSelector:(SEL)selector; -id columnAttributeForObject(NotesTableView *tv, NoteAttributeColumn *col, id object); +id columnAttributeForObject(NotesTableView *tv, NoteAttributeColumn *col, id object, NSInteger row); - (void)updateWidthForHighlight; -id (*dereferencingFunction(NoteAttributeColumn *col))(id, id); -- (void)setDereferencingFunction:(id (*)(id, id))attributeFunction; +id (*dereferencingFunction(NoteAttributeColumn *col))(id, id, NSInteger); +- (void)setDereferencingFunction:(id (*)(id, id, NSInteger))attributeFunction; - (void)setSortingFunction:(NSInteger (*)(id*, id*))sortFunction; - (NSInteger (*)(id*, id*))sortFunction; - (void)setReverseSortingFunction:(NSInteger (*)(id*, id*))aFunction; diff --git a/NoteAttributeColumn.m b/NoteAttributeColumn.m index 38269cdf..454aa249 100755 --- a/NoteAttributeColumn.m +++ b/NoteAttributeColumn.m @@ -13,7 +13,7 @@ #import "NoteAttributeColumn.h" #import "NotesTableView.h" - +/* @implementation NoteTableHeaderCell - (NSRect)drawingRectForBounds:(NSRect)theRect { @@ -21,7 +21,7 @@ - (NSRect)drawingRectForBounds:(NSRect)theRect { } @end - +*/ @implementation NoteAttributeColumn - (id)initWithIdentifier:(id)anObject { @@ -46,6 +46,7 @@ + (NSDictionary*)standardDictionary { - (void)updateWidthForHighlight { [self setMinWidth:absoluteMinimumWidth + ([[self tableView] highlightedTableColumn] == self ? 10 : 0)]; + } SEL columnAttributeMutator(NoteAttributeColumn *col) { @@ -56,11 +57,11 @@ - (void)setMutatingSelector:(SEL)selector { mutateObjectSelector = selector; } -id columnAttributeForObject(NotesTableView *tv, NoteAttributeColumn *col, id object) { - return col->objectAttribute(tv, object); +id columnAttributeForObject(NotesTableView *tv, NoteAttributeColumn *col, id object, NSInteger row) { + return col->objectAttribute(tv, object, row); } -- (void)setDereferencingFunction:(id (*)(id, id))attributeFunction { +- (void)setDereferencingFunction:(id (*)(id, id, NSInteger))attributeFunction { objectAttribute = attributeFunction; } @@ -79,7 +80,7 @@ - (void)setReverseSortingFunction:(NSInteger (*)(id*, id*))aFunction { - (NSInteger (*)(id*, id*))reverseSortFunction { return reverseSortFunction; } -id (*dereferencingFunction(NoteAttributeColumn *col))(id, id) { +id (*dereferencingFunction(NoteAttributeColumn *col))(id, id, NSInteger) { return col->objectAttribute; } diff --git a/NoteObject.h b/NoteObject.h index fe8ecf02..aa2b9337 100755 --- a/NoteObject.h +++ b/NoteObject.h @@ -18,12 +18,12 @@ #import #import "NotationController.h" +#import "BufferUtils.h" #import "SynchronizedNoteProtocol.h" @class LabelObject; @class WALStorageController; @class NotesTableView; -@class AppController; typedef struct _NoteFilterContext { char* needle; @@ -34,13 +34,17 @@ typedef struct _NoteFilterContext { NSAttributedString *tableTitleString; NSString *titleString, *labelString; NSMutableAttributedString *contentString; + + NSImage *labelsPreviewImage, *highlightedLabelsPreviewImage; //caching/searching purposes only -- created at runtime char *cTitle, *cContents, *cLabels, *cTitleFoundPtr, *cContentsFoundPtr, *cLabelsFoundPtr; NSMutableSet *labelSet; BOOL contentsWere7Bit, contentCacheNeedsUpdate; + //if this note's title is "Chicken Shack menu listing", its prefix parent might have the title "Chicken Shack" + NSMutableArray *prefixParentNotes; - NSString *wordCountString; +// NSString *wordCountString; NSString *dateModifiedString, *dateCreatedString; id delegate; //the notes controller @@ -49,10 +53,12 @@ typedef struct _NoteFilterContext { NSString *filename; UInt32 nodeID; UInt32 logicalSize; - UTCDateTime fileModifiedDate; + UTCDateTime fileModifiedDate, *attrsModifiedDate; + PerDiskInfo *perDiskInfoGroups; + unsigned int perDiskInfoGroupCount; int currentFormatID; NSStringEncoding fileEncoding; - BOOL shouldWriteToFile; + BOOL shouldWriteToFile, didUnarchive; //for storing in write-ahead-log unsigned int logSequenceNumber; @@ -104,34 +110,40 @@ NSInteger compareFileSize(id *a, id *b); UInt32 fileNodeIDOfNote(NoteObject *note); UInt32 fileSizeOfNote(NoteObject *note); UTCDateTime fileModifiedDateOfNote(NoteObject *note); + UTCDateTime *attrsModifiedDateOfNote(NoteObject *note); CFAbsoluteTime modifiedDateOfNote(NoteObject *note); CFAbsoluteTime createdDateOfNote(NoteObject *note); NSStringEncoding fileEncodingOfNote(NoteObject *note); - + NSString* titleOfNote(NoteObject *note); NSString* labelsOfNote(NoteObject *note); -#define DefColAttrAccessor(__FName, __IVar) force_inline id __FName(NotesTableView *tv, NoteObject *note) { return note->__IVar; } + NSMutableArray* prefixParentsOfNote(NoteObject *note); + +#define DefColAttrAccessor(__FName, __IVar) force_inline id __FName(NotesTableView *tv, NoteObject *note, NSInteger row) { return note->__IVar; } #define DefModelAttrAccessor(__FName, __IVar) force_inline typeof (((NoteObject *)0)->__IVar) __FName(NoteObject *note) { return note->__IVar; } //return types are NSString or NSAttributedString, satisifying NSTableDataSource protocol otherwise - id titleOfNote2(NotesTableView *tv, NoteObject *note); - id tableTitleOfNote(NotesTableView *tv, NoteObject *note); - id properlyHighlightingTableTitleOfNote(NotesTableView *tv, NoteObject *note); - id labelsOfNote2(NotesTableView *tv, NoteObject *note); - id dateCreatedStringOfNote(NotesTableView *tv, NoteObject *note); - id dateModifiedStringOfNote(NotesTableView *tv, NoteObject *note); - id wordCountOfNote(NotesTableView *tv, NoteObject *note); + id titleOfNote2(NotesTableView *tv, NoteObject *note, NSInteger row); + id tableTitleOfNote(NotesTableView *tv, NoteObject *note, NSInteger row); + id properlyHighlightingTableTitleOfNote(NotesTableView *tv, NoteObject *note, NSInteger row); + id unifiedCellSingleLineForNote(NotesTableView *tv, NoteObject *note, NSInteger row); + id unifiedCellForNote(NotesTableView *tv, NoteObject *note, NSInteger row); + id labelColumnCellForNote(NotesTableView *tv, NoteObject *note, NSInteger row); + id dateCreatedStringOfNote(NotesTableView *tv, NoteObject *note, NSInteger row); + id dateModifiedStringOfNote(NotesTableView *tv, NoteObject *note, NSInteger row); + id wordCountOfNote(NotesTableView *tv, NoteObject *note, NSInteger row); void resetFoundPtrsForNote(NoteObject *note); BOOL noteContainsUTF8String(NoteObject *note, NoteFilterContext *context); BOOL noteTitleHasPrefixOfUTF8String(NoteObject *note, const char* fullString, size_t stringLen); - BOOL noteTitleMatchesUTF8String(NoteObject *note, const char* fullString); + BOOL noteTitleIsAPrefixOfOtherNoteTitle(NoteObject *longerNote, NoteObject *shorterNote); - (id)delegate; - (void)setDelegate:(id)theDelegate; -- (id)initWithNoteBody:(NSAttributedString*)bodyText title:(NSString*)aNoteTitle uniqueFilename:(NSString*)aFilename format:(int)formatID; +- (id)initWithNoteBody:(NSAttributedString*)bodyText title:(NSString*)aNoteTitle + delegate:(id)aDelegate format:(int)formatID labels:(NSString*)aLabelString; - (id)initWithCatalogEntry:(NoteCatalogEntry*)entry delegate:(id)aDelegate; - (NSSet*)labelSet; @@ -139,7 +151,15 @@ NSInteger compareFileSize(id *a, id *b); - (void)replaceMatchingLabel:(LabelObject*)label; - (void)updateLabelConnectionsAfterDecoding; - (void)updateLabelConnections; +- (void)disconnectLabels; +- (BOOL)_setLabelString:(NSString*)newLabelString; - (void)setLabelString:(NSString*)newLabels; +- (NSMutableSet*)labelSetFromCurrentString; +- (NSArray*)orderedLabelTitles; +- (void)invalidateLabelsPreviewImage; +- (NSImage*)highlightedLabelsPreviewImage; +- (NSImage*)labelsPreviewImage; +- (NSImage*)_labelsPreviewImageOfColor:(NSColor*)aColor; - (void)setSyncObjectAndKeyMD:(NSDictionary*)aDict forService:(NSString*)serviceName; - (void)removeAllSyncMDForService:(NSString*)serviceName; @@ -158,6 +178,7 @@ NSInteger compareFileSize(id *a, id *b); - (OSStatus)writeFileDatesAndUpdateTrackingInfo; +- (NSURL*)uniqueNoteLink; - (NSString*)noteFilePath; - (void)invalidateFSRef; @@ -186,6 +207,8 @@ NSInteger compareFileSize(id *a, id *b); - (NSAttributedString*)contentString; - (NSAttributedString*)printableStringRelativeToBodyFont:(NSFont*)bodyFont; - (NSString*)combinedContentWithContextSeparator:(NSString*)sepWContext; +- (void)setForegroundTextColorOnly:(NSColor*)aColor; +- (void)_resanitizeContent; - (void)updateUnstyledTextWithBaseFont:(NSFont*)baseFont; - (void)updateDateStrings; - (void)setDateModified:(CFAbsoluteTime)newTime; @@ -193,6 +216,8 @@ NSInteger compareFileSize(id *a, id *b); - (void)setSelectedRange:(NSRange)newRange; - (NSRange)lastSelectedRange; - (BOOL)contentsWere7Bit; +- (void)addPrefixParentNote:(NoteObject*)aNote; +- (void)removeAllPrefixParentNotes; - (NSUndoManager*)undoManager; - (void)_undoManagerDidChange:(NSNotification *)notification; diff --git a/NoteObject.m b/NoteObject.m index 77dbb078..0b25527a 100755 --- a/NoteObject.m +++ b/NoteObject.m @@ -23,13 +23,19 @@ #import "NotationController.h" #import "NotationPrefs.h" #import "AttributedPlainText.h" -#import "NSString_NV.h" +#import "NSString_CustomTruncation.h" +#import "NSFileManager_NV.h" #include "BufferUtils.h" #import "NotationFileManager.h" #import "NotationSyncServiceManager.h" #import "SyncServiceSessionProtocol.h" #import "SyncSessionController.h" +#import "NSData_transformations.h" +#import "NSCollection_utils.h" #import "NotesTableView.h" +#import "UnifiedCell.h" +#import "LabelColumnCell.h" +#import "NSBezierPath_NV.h" #if __LP64__ // Needed for compatability with data created by 32bit app @@ -44,26 +50,21 @@ @implementation NoteObject static FSRef *noteFileRefInit(NoteObject* obj); +static void setAttrModifiedDate(NoteObject *note, UTCDateTime *dateTime); +static void setCatalogNodeID(NoteObject *note, UInt32 cnid); - (id)init { if ([super init]) { - cTitle = cContents = cLabels = cTitleFoundPtr = cContentsFoundPtr = cLabelsFoundPtr = NULL; - - bzero(&fileModifiedDate, sizeof(UTCDateTime)); - modifiedDate = createdDate = 0.0; - currentFormatID = SingleDatabaseFormat; - logSequenceNumber = logicalSize = nodeID = 0; - fileEncoding = NSUTF8StringEncoding; - contentsWere7Bit = NO; - - selectedRange = NSMakeRange(NSNotFound, 0); - - //these are created either when the object is initialized from disk or when it writes its files to disk - //bzero(¬eFileRef, sizeof(FSRef)); - - //labelSet = [[NSMutableSet alloc] init]; - + perDiskInfoGroups = calloc(1, sizeof(PerDiskInfo)); + perDiskInfoGroups[0].diskIDIndex = -1; + perDiskInfoGroupCount = 1; + + currentFormatID = SingleDatabaseFormat; + fileEncoding = NSUTF8StringEncoding; + selectedRange = NSMakeRange(NSNotFound, 0); + + //other instance variables initialized on demand } return self; @@ -82,6 +83,10 @@ - (void)dealloc { [filename release]; [dateModifiedString release]; [dateCreatedString release]; + [prefixParentNotes release]; + + if (perDiskInfoGroups) + free(perDiskInfoGroups); if (cTitle) free(cTitle); @@ -102,10 +107,10 @@ - (void)setDelegate:(id)theDelegate { if (theDelegate) { delegate = theDelegate; - //clean up anything else that couldn't be set due to the note being created without knowledge of its delegate - if (!filename) { - filename = [[delegate uniqueFilenameForTitle:titleString fromNote:self] retain]; - } + //do things that ought to have been done during init, but were not possible due to lack of delegate information + if (!filename) filename = [[delegate uniqueFilenameForTitle:titleString fromNote:self] retain]; + if (!tableTitleString && !didUnarchive) [self updateTablePreviewString]; + if (!labelSet && !didUnarchive) [self updateLabelConnectionsAfterDecoding]; } } @@ -116,6 +121,55 @@ - (void)setDelegate:(id)theDelegate { return obj->noteFileRef; } +static void setAttrModifiedDate(NoteObject *note, UTCDateTime *dateTime) { + unsigned int idx = SetPerDiskInfoWithTableIndex(dateTime, NULL, diskUUIDIndexForNotation(note->delegate), + &(note->perDiskInfoGroups), &(note->perDiskInfoGroupCount)); + note->attrsModifiedDate = &(note->perDiskInfoGroups[idx].attrTime); +} +static void setCatalogNodeID(NoteObject *note, UInt32 cnid) { + SetPerDiskInfoWithTableIndex(NULL, &cnid, diskUUIDIndexForNotation(note->delegate), + &(note->perDiskInfoGroups), &(note->perDiskInfoGroupCount)); + note->nodeID = cnid; +} + +UTCDateTime *attrsModifiedDateOfNote(NoteObject *note) { + //once unarchived, the disk UUID index won't change, so this pointer will always reflect the current attr mod time + if (!note->attrsModifiedDate) { + //init from delegate based on disk table index + unsigned int i, tableIndex = diskUUIDIndexForNotation(note->delegate); + + for (i=0; iperDiskInfoGroupCount; i++) { + //check if this date has actually been initialized; this entry could be here only because setCatalogNodeID was called + if (note->perDiskInfoGroups[i].diskIDIndex == tableIndex && !UTCDateTimeIsEmpty(note->perDiskInfoGroups[i].attrTime)) { + note->attrsModifiedDate = &(note->perDiskInfoGroups[i].attrTime); + goto giveDate; + } + } + //this note doesn't have a file-modified date, so initialize a fairly reasonable one here + setAttrModifiedDate(note, &(note->fileModifiedDate)); + } +giveDate: + return note->attrsModifiedDate; +} + +UInt32 fileNodeIDOfNote(NoteObject *note) { + if (!note->nodeID) { + unsigned int i, tableIndex = diskUUIDIndexForNotation(note->delegate); + + for (i=0; iperDiskInfoGroupCount; i++) { + //check if this nodeID has actually been initialized; this entry could be here only because setAttrModifiedDate was called + if (note->perDiskInfoGroups[i].diskIDIndex == tableIndex && note->perDiskInfoGroups[i].nodeID != 0U) { + note->nodeID = note->perDiskInfoGroups[i].nodeID; + goto giveID; + } + } + //this note doesn't have a file-modified date, so initialize something that at least won't repeat this lookup + setCatalogNodeID(note, 1); + } +giveID: + return note->nodeID; +} + NSInteger compareFilename(id *one, id *two) { return (NSInteger)CFStringCompare((CFStringRef)((*(NoteObject**)one)->filename), @@ -178,7 +232,7 @@ NSInteger compareTitleStringReverse(id *a, id *b) { } NSInteger compareNodeID(id *a, id *b) { - return (*(NoteObject**)a)->nodeID - (*(NoteObject**)b)->nodeID; + return fileNodeIDOfNote(*(NoteObject**)a) - fileNodeIDOfNote(*(NoteObject**)b); } NSInteger compareFileSize(id *a, id *b) { return (*(NoteObject**)a)->logicalSize - (*(NoteObject**)b)->logicalSize; @@ -190,7 +244,6 @@ NSInteger compareFileSize(id *a, id *b) { //syncing w/ server and from journal; DefModelAttrAccessor(filenameOfNote, filename) -DefModelAttrAccessor(fileNodeIDOfNote, nodeID) DefModelAttrAccessor(fileSizeOfNote, logicalSize) DefModelAttrAccessor(titleOfNote, titleString) DefModelAttrAccessor(labelsOfNote, labelString) @@ -199,20 +252,20 @@ NSInteger compareFileSize(id *a, id *b) { DefModelAttrAccessor(createdDateOfNote, createdDate) DefModelAttrAccessor(storageFormatOfNote, currentFormatID) DefModelAttrAccessor(fileEncodingOfNote, fileEncoding) +DefModelAttrAccessor(prefixParentsOfNote, prefixParentNotes) -DefColAttrAccessor(wordCountOfNote, wordCountString) +//DefColAttrAccessor(wordCountOfNote, wordCountString) DefColAttrAccessor(titleOfNote2, titleString) -DefColAttrAccessor(labelsOfNote2, labelString) DefColAttrAccessor(dateCreatedStringOfNote, dateCreatedString) DefColAttrAccessor(dateModifiedStringOfNote, dateModifiedString) -force_inline id tableTitleOfNote(NotesTableView *tv, NoteObject *note) { +force_inline id tableTitleOfNote(NotesTableView *tv, NoteObject *note, NSInteger row) { if (note->tableTitleString) return note->tableTitleString; return titleOfNote(note); } -force_inline id properlyHighlightingTableTitleOfNote(NotesTableView *tv, NoteObject *note) { +force_inline id properlyHighlightingTableTitleOfNote(NotesTableView *tv, NoteObject *note, NSInteger row) { if (note->tableTitleString) { - if ([tv objectIsSelected:note]) { + if ([tv isRowSelected:row]) { return [note->tableTitleString string]; } return note->tableTitleString; @@ -220,6 +273,43 @@ NSInteger compareFileSize(id *a, id *b) { return titleOfNote(note); } +force_inline id labelColumnCellForNote(NotesTableView *tv, NoteObject *note, NSInteger row) { + + LabelColumnCell *cell = [[tv tableColumnWithIdentifier:NoteLabelsColumnString] dataCellForRow:row]; + [cell setNoteObject:note]; + + return labelsOfNote(note); +} + +force_inline id unifiedCellSingleLineForNote(NotesTableView *tv, NoteObject *note, NSInteger row) { + + id obj = note->tableTitleString ? (id)note->tableTitleString : (id)titleOfNote(note); + + UnifiedCell *cell = [[[tv tableColumns] objectAtIndex:0] dataCellForRow:row]; + [cell setNoteObject:note]; + [cell setPreviewIsHidden:YES]; + + return obj; +} + +force_inline id unifiedCellForNote(NotesTableView *tv, NoteObject *note, NSInteger row) { + //snow leopard is stricter about applying the default highlight-attributes (e.g., no shadow unless no paragraph formatting) + //so add the shadow here for snow leopard on selected rows + + UnifiedCell *cell = [[[tv tableColumns] objectAtIndex:0] dataCellForRow:row]; + [cell setNoteObject:note]; + [cell setPreviewIsHidden:NO]; + + BOOL rowSelected = [tv isRowSelected:row]; + BOOL drawShadow = IsSnowLeopardOrLater || (IsLeopardOrLater && rowSelected && [tv currentEditor]); + + id obj = note->tableTitleString ? (rowSelected ? (id)AttributedStringForSelection(note->tableTitleString, drawShadow) : + (id)note->tableTitleString) : (id)titleOfNote(note); + + + return obj; +} + //make notationcontroller should send setDelegate: and setLabelString: (if necessary) to each note when unarchiving this way //there is no measurable difference in speed when using decodeValuesOfObjCTypes, oddly enough @@ -232,6 +322,9 @@ - (id)initWithCoder:(NSCoder*)decoder { if ([decoder allowsKeyedCoding]) { //(hopefully?) no versioning necessary here + //for knowing when to delay certain initializations during launch (e.g., preview generation) + didUnarchive = YES; + modifiedDate = [decoder decodeDoubleForKey:VAR_STR(modifiedDate)]; createdDate = [decoder decodeDoubleForKey:VAR_STR(createdDate)]; selectedRange.location = [decoder decodeInt32ForKey:@"selectionRangeLocation"]; @@ -241,11 +334,17 @@ - (id)initWithCoder:(NSCoder*)decoder { logSequenceNumber = [decoder decodeInt32ForKey:VAR_STR(logSequenceNumber)]; currentFormatID = [decoder decodeInt32ForKey:VAR_STR(currentFormatID)]; - nodeID = [decoder decodeInt32ForKey:VAR_STR(nodeID)]; logicalSize = [decoder decodeInt32ForKey:VAR_STR(logicalSize)]; - fileModifiedDate.highSeconds = [decoder decodeInt32ForKey:@"fileModDateHigh"]; - fileModifiedDate.lowSeconds = [decoder decodeInt32ForKey:@"fileModDateLow"]; - fileModifiedDate.fraction = [decoder decodeInt32ForKey:@"fileModDateFrac"]; + + int64_t fileModifiedDate64 = [decoder decodeInt64ForKey:VAR_STR(fileModifiedDate)]; + memcpy(&fileModifiedDate, &fileModifiedDate64, sizeof(int64_t)); + + NSUInteger decodedPerDiskByteCount = 0; + const uint8_t *decodedPerDiskBytes = [decoder decodeBytesForKey:VAR_STR(perDiskInfoGroups) returnedLength:&decodedPerDiskByteCount]; + if (decodedPerDiskBytes && decodedPerDiskByteCount) { + CopyPerDiskInfoGroupsToOrder(&perDiskInfoGroups, &perDiskInfoGroupCount, (PerDiskInfo *)decodedPerDiskBytes, decodedPerDiskByteCount, 1); + } + fileEncoding = [decoder decodeInt32ForKey:VAR_STR(fileEncoding)]; NSUInteger decodedUUIDByteCount = 0; @@ -343,12 +442,15 @@ - (void)encodeWithCoder:(NSCoder *)coder { [coder encodeInt32:logSequenceNumber forKey:VAR_STR(logSequenceNumber)]; [coder encodeInt32:currentFormatID forKey:VAR_STR(currentFormatID)]; - [coder encodeInt32:nodeID forKey:VAR_STR(nodeID)]; [coder encodeInt32:logicalSize forKey:VAR_STR(logicalSize)]; - [coder encodeInt32:fileModifiedDate.highSeconds forKey:@"fileModDateHigh"]; - [coder encodeInt32:fileModifiedDate.lowSeconds forKey:@"fileModDateLow"]; - [coder encodeInt32:fileModifiedDate.fraction forKey:@"fileModDateFrac"]; + uint8_t *flippedPerDiskInfoGroups = calloc(perDiskInfoGroupCount, sizeof(PerDiskInfo)); + CopyPerDiskInfoGroupsToOrder((PerDiskInfo**)&flippedPerDiskInfoGroups, &perDiskInfoGroupCount, perDiskInfoGroups, perDiskInfoGroupCount * sizeof(PerDiskInfo), 0); + + [coder encodeBytes:flippedPerDiskInfoGroups length:perDiskInfoGroupCount * sizeof(PerDiskInfo) forKey:VAR_STR(perDiskInfoGroups)]; + free(flippedPerDiskInfoGroups); + + [coder encodeInt64:*(int64_t*)&fileModifiedDate forKey:VAR_STR(fileModifiedDate)]; [coder encodeInt32:fileEncoding forKey:VAR_STR(fileEncoding)]; [coder encodeBytes:(const uint8_t *)&uniqueNoteIDBytes length:sizeof(CFUUIDBytes) forKey:VAR_STR(uniqueNoteIDBytes)]; @@ -397,12 +499,14 @@ - (void)encodeWithCoder:(NSCoder *)coder { } } -- (id)initWithNoteBody:(NSAttributedString*)bodyText title:(NSString*)aNoteTitle uniqueFilename:(NSString*)aFilename format:(int)formatID { +- (id)initWithNoteBody:(NSAttributedString*)bodyText title:(NSString*)aNoteTitle delegate:(id)aDelegate format:(int)formatID labels:(NSString*)aLabelString { + //delegate optional here if ([self init]) { if (!bodyText || !aNoteTitle) { return nil; } + delegate = aDelegate; contentString = [[NSMutableAttributedString alloc] initWithAttributedString:bodyText]; [self initContentCacheCString]; @@ -414,13 +518,13 @@ - (id)initWithNoteBody:(NSAttributedString*)bodyText title:(NSString*)aNoteTitle if (![self _setTitleString:aNoteTitle]) titleString = NSLocalizedString(@"Untitled Note", @"Title of a nameless note"); - [self updateTablePreviewString]; - - labelString = @""; - cLabelsFoundPtr = cLabels = strdup(""); + if (![self _setLabelString:aLabelString]) { + labelString = @""; + cLabelsFoundPtr = cLabels = strdup(""); + } - filename = [aFilename retain]; currentFormatID = formatID; + filename = [[delegate uniqueFilenameForTitle:titleString fromNote:nil] retain]; CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault); uniqueNoteIDBytes = CFUUIDGetUUIDBytes(uuidRef); @@ -428,11 +532,10 @@ - (id)initWithNoteBody:(NSAttributedString*)bodyText title:(NSString*)aNoteTitle createdDate = modifiedDate = CFAbsoluteTimeGetCurrent(); dateCreatedString = [dateModifiedString = [[NSString relativeDateStringWithAbsoluteTime:modifiedDate] retain] retain]; - if (UCConvertCFAbsoluteTimeToUTCDateTime(modifiedDate, &fileModifiedDate) != noErr) - NSLog(@"Error initializing file modification date"); + UCConvertCFAbsoluteTimeToUTCDateTime(modifiedDate, &fileModifiedDate); - //delegate is not set yet, so we cannot dirty ourselves here - //[self makeNoteDirty]; + if (delegate) + [self updateTablePreviewString]; } return self; @@ -441,12 +544,14 @@ - (id)initWithNoteBody:(NSAttributedString*)bodyText title:(NSString*)aNoteTitle //only get the fsrefs until we absolutely need them - (id)initWithCatalogEntry:(NoteCatalogEntry*)entry delegate:(id)aDelegate { + NSAssert(aDelegate != nil, @"must supply a delegate"); if ([self init]) { delegate = aDelegate; filename = [(NSString*)entry->filename copy]; currentFormatID = [delegate currentNoteStorageFormat]; fileModifiedDate = entry->lastModified; - nodeID = entry->nodeID; + setAttrModifiedDate(self, &(entry->lastAttrModified)); + setCatalogNodeID(self, entry->nodeID); logicalSize = entry->logicalSize; CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault); @@ -456,7 +561,7 @@ - (id)initWithCatalogEntry:(NoteCatalogEntry*)entry delegate:(id)aDelegate { if (![self _setTitleString:[filename stringByDeletingPathExtension]]) titleString = NSLocalizedString(@"Untitled Note", @"Title of a nameless note"); - labelString = @""; //I'd like to get labels from getxattr + labelString = @""; //set by updateFromCatalogEntry if there are openmeta extended attributes cLabelsFoundPtr = cLabels = strdup(""); contentString = [[NSMutableAttributedString alloc] initWithString:@""]; @@ -541,7 +646,7 @@ - (BOOL)contentsWere7Bit { } - (NSString*)description { - return [NSString stringWithFormat:@"%@ / %@", titleString, syncServicesMD]; + return syncServicesMD ? [NSString stringWithFormat:@"%@ / %@", titleString, syncServicesMD] : titleString; } - (NSString*)combinedContentWithContextSeparator:(NSString*)sepWContext { @@ -587,18 +692,38 @@ - (NSAttributedString*)printableStringRelativeToBodyFont:(NSFont*)bodyFont { [noAttrBreak release]; //other header things here, too? like date created/mod/printed? tags? - [largeAttributedTitleString appendAttributedString:[self contentString]]; + NSMutableAttributedString *contentMinusColor = [[self contentString] mutableCopy]; + [contentMinusColor removeAttribute:NSForegroundColorAttributeName range:NSMakeRange(0, [contentMinusColor length])]; + + [largeAttributedTitleString appendAttributedString:contentMinusColor]; + + [contentMinusColor release]; return largeAttributedTitleString; } - (void)updateTablePreviewString { + //delegate required for this method [tableTitleString release]; - - if ([[GlobalPrefs defaultPrefs] tableColumnsShowPreview]) { - tableTitleString = [[titleString attributedPreviewFromBodyText:contentString upToWidth:[delegate titleColumnWidth]] retain]; + GlobalPrefs *prefs = [GlobalPrefs defaultPrefs]; + + if ([prefs tableColumnsShowPreview]) { + if ([prefs horizontalLayout]) { + //labelsPreviewImage does work only when the image is explicitly invalidated, and because updateTablePreviewString + //is called for visible notes at launch and resize only, generation of images for invisible notes is delayed until after launch + + NSImage *img = ColumnIsSet(NoteLabelsColumn, [prefs tableColumnsBitmap]) ? [self labelsPreviewImage] : nil; + tableTitleString = [[titleString attributedMultiLinePreviewFromBodyText:contentString upToWidth:[delegate titleColumnWidth] + intrusionWidth:img ? [img size].width : 0.0] retain]; + } else { + tableTitleString = [[titleString attributedSingleLinePreviewFromBodyText:contentString upToWidth:[delegate titleColumnWidth]] retain]; + } } else { - tableTitleString = nil; + if ([prefs horizontalLayout]) { + tableTitleString = [[titleString attributedSingleLineTitle] retain]; + } else { + tableTitleString = nil; + } } } @@ -647,7 +772,7 @@ - (void)setTitleString:(NSString*)aNewTitle { - (BOOL)_setTitleString:(NSString*)aNewTitle { if (!aNewTitle || ![aNewTitle length] || (titleString && [aNewTitle isEqualToString:titleString])) return NO; - + [titleString release]; titleString = [aNewTitle copy]; @@ -691,6 +816,28 @@ - (void)setFilename:(NSString*)aString withExternalTrigger:(BOOL)externalTrigger } } +- (void)setForegroundTextColorOnly:(NSColor*)aColor { + //called when notationPrefs font doesn't match globalprefs font, or user changes the font + [contentString removeAttribute:NSForegroundColorAttributeName range:NSMakeRange(0, [contentString length])]; + if (aColor) { + [contentString addAttribute:NSForegroundColorAttributeName value:aColor range:NSMakeRange(0, [contentString length])]; + } +} + +- (void)_resanitizeContent { + [contentString santizeForeignStylesForImporting]; + + //renormalize the title, in case it is still somehow derived from decomposed HFS+ filenames + CFMutableStringRef normalizedString = CFStringCreateMutableCopy(NULL, 0, (CFStringRef)titleString); + CFStringNormalize(normalizedString, kCFStringNormalizationFormC); + + [self _setTitleString:(NSString*)normalizedString]; + CFRelease(normalizedString); + + if ([delegate currentNoteStorageFormat] == RTFTextFormat) + [self makeNoteDirtyUpdateTime:NO updateFile:YES]; +} + //how do we write a thousand RTF files at once, repeatedly? - (void)updateUnstyledTextWithBaseFont:(NSFont*)baseFont { @@ -767,30 +914,46 @@ - (void)updateLabelConnectionsAfterDecoding { } - (void)updateLabelConnections { - return; - //find differences between previous labels and new ones - NSMutableSet *oldLabelSet = labelSet; - NSMutableSet *newLabelSet = [labelString labelSetFromWordsAndContainingNote:self]; - - //what's left-over - NSMutableSet *oldLabels = [oldLabelSet mutableCopy]; - [oldLabels minusSet:newLabelSet]; - - //what wasn't there last time - NSMutableSet *newLabels = newLabelSet; - [newLabels minusSet:oldLabelSet]; - - //update the currently known labels - [labelSet minusSet:oldLabels]; - [labelSet unionSet:newLabels]; - - //update our status within the list of all labels, adding or removing from the list and updating the labels where appropriate - //these end up calling replaceMatchingLabel* - [delegate note:self didRemoveLabelSet:oldLabels]; - [delegate note:self didAddLabelSet:newLabels]; + //find differences between previous labels and new ones + if (delegate) { + NSMutableSet *oldLabelSet = labelSet; + NSMutableSet *newLabelSet = [self labelSetFromCurrentString]; + + if (!oldLabelSet) { + oldLabelSet = labelSet = [[NSMutableSet alloc] initWithCapacity:[newLabelSet count]]; + } + + //what's left-over + NSMutableSet *oldLabels = [oldLabelSet mutableCopy]; + [oldLabels minusSet:newLabelSet]; + + //what wasn't there last time + NSMutableSet *newLabels = newLabelSet; + [newLabels minusSet:oldLabelSet]; + + //update the currently known labels + [labelSet minusSet:oldLabels]; + [labelSet unionSet:newLabels]; + + //update our status within the list of all labels, adding or removing from the list and updating the labels where appropriate + //these end up calling replaceMatchingLabel* + [delegate note:self didRemoveLabelSet:oldLabels]; + [delegate note:self didAddLabelSet:newLabels]; + } } -- (void)setLabelString:(NSString*)newLabelString { +- (void)disconnectLabels { + //when removing this note from NotationController, other LabelObjects as well as LabelsListController should know not to list it + if (delegate) { + [delegate note:self didRemoveLabelSet:labelSet]; + [labelSet autorelease]; + labelSet = nil; + } else { + NSLog(@"not disconnecting labels because no delegate exists"); + } +} + +- (BOOL)_setLabelString:(NSString*)newLabelString { if (newLabelString && ![newLabelString isEqualToString:labelString]) { [labelString release]; @@ -799,18 +962,171 @@ - (void)setLabelString:(NSString*)newLabelString { cLabelsFoundPtr = cLabels = replaceString(cLabels, [labelString lowercaseUTF8String]); [self updateLabelConnections]; + [self invalidateLabelsPreviewImage]; + return YES; + } + return NO; +} + +- (void)setLabelString:(NSString*)newLabelString { + + if ([self _setLabelString:newLabelString]) { + + if ([[GlobalPrefs defaultPrefs] horizontalLayout]) { + [self updateTablePreviewString]; + } - [self makeNoteDirtyUpdateTime:YES updateFile:NO]; - //[self registerModificationWithOwnedServices]; //not until we have a service that knows about labels + [self makeNoteDirtyUpdateTime:YES updateFile:YES]; + //[self registerModificationWithOwnedServices]; [delegate note:self attributeChanged:NoteLabelsColumnString]; } } +- (NSMutableSet*)labelSetFromCurrentString { + + NSArray *words = [self orderedLabelTitles]; + NSMutableSet *newLabelSet = [NSMutableSet setWithCapacity:[words count]]; + + unsigned int i; + for (i=0; i<[words count]; i++) { + NSString *aWord = [words objectAtIndex:i]; + + if ([aWord length] > 0) { + LabelObject *aLabel = [[LabelObject alloc] initWithTitle:aWord]; + [aLabel addNote:self]; + + [newLabelSet addObject:aLabel]; + [aLabel autorelease]; + } + } + + return newLabelSet; +} + + +- (NSArray*)orderedLabelTitles { + return [labelString labelCompatibleWords]; +} + +- (void)invalidateLabelsPreviewImage { + [highlightedLabelsPreviewImage release]; + highlightedLabelsPreviewImage = nil; + [labelsPreviewImage release]; + labelsPreviewImage = nil; +} + +- (NSImage*)highlightedLabelsPreviewImage { + if (!highlightedLabelsPreviewImage && [labelString length]) { + highlightedLabelsPreviewImage = [[self _labelsPreviewImageOfColor:[NSColor whiteColor]] retain]; + } + return highlightedLabelsPreviewImage; +} + +- (NSImage*)labelsPreviewImage { + if (!labelsPreviewImage && [labelString length]) { + labelsPreviewImage = [[self _labelsPreviewImageOfColor:[NSColor colorWithCalibratedWhite:0.55 alpha:1.0]] retain]; + } + return labelsPreviewImage; +} + +- (NSImage*)_labelsPreviewImageOfColor:(NSColor*)aColor { + if ([labelString length]) { + float tableFontSize = [[GlobalPrefs defaultPrefs] tableFontSize] - 1.0; + NSFont *font = [NSFont systemFontOfSize:tableFontSize]; + NSDictionary *attrs = [NSDictionary dictionaryWithObject:font forKey:NSFontNameAttribute]; + + //compute dimensions of each word first using nslayoutmanager; -sizeWithAttributes: likes to ignore the font and size here for some reason + + static NSTextStorage *textStorage = nil; + static NSTextContainer *textContainer = nil; + static NSLayoutManager *layoutManager = nil; + + if (!layoutManager) { + textStorage = [[NSTextStorage alloc] initWithString:@"" attributes:attrs]; + textContainer = [[NSTextContainer alloc] initWithContainerSize:NSMakeSize(1e7, 1e7)]; + layoutManager = [[NSLayoutManager alloc] init]; + + [textContainer setLineFragmentPadding:0.0]; + [layoutManager addTextContainer:textContainer]; + [textStorage addLayoutManager:layoutManager]; + } + + NSArray *words = [self orderedLabelTitles]; + if (![words count]) + return nil; + + NSBezierPath *blocksPath = [NSBezierPath bezierPath]; + NSPoint nextBoxPoint = NSZeroPoint; + NSUInteger i; + float imageWidth = 0.0; + + for (i=0; i<[words count]; i++) { + NSString *word = [words objectAtIndex:i]; + if ([word length]) { + + //Force the layout manager to layout its text + [[textStorage mutableString] setString:word]; + [textStorage setFont:font]; //will infuriatingly revert to measuring Lucida Grande 11 otherwise, despite what it actually says + + (void)[layoutManager glyphRangeForTextContainer:textContainer]; + NSSize wordSize = [layoutManager usedRectForTextContainer:textContainer].size; + + NSRect wordRect = NSMakeRect(nextBoxPoint.x, nextBoxPoint.y, roundf(wordSize.width + 4.0), roundf(tableFontSize * 1.3)); + imageWidth += wordRect.size.width + 4.0; + + NSBezierPath *stringPath = [NSBezierPath bezierPathWithLayoutManager:layoutManager characterRange:NSMakeRange(0,[word length]) + atPoint:NSMakePoint(nextBoxPoint.x + 2.0, 3.0)]; + wordRect.origin = nextBoxPoint; + + NSBezierPath *backgroundPath = [NSBezierPath bezierPathWithRoundRectInRect:wordRect radius:2.0f]; + + [backgroundPath setWindingRule:NSEvenOddWindingRule]; + [backgroundPath appendBezierPath:stringPath]; + + [blocksPath appendBezierPath:backgroundPath]; + + nextBoxPoint = NSMakePoint(roundf(nextBoxPoint.x + wordRect.size.width + 4.0), 0.0); + } + } + + + NSImage *img = [[NSImage alloc] initWithSize:NSMakeSize(imageWidth - 4.0, tableFontSize * 1.3 + 1.5)]; + [img lockFocus]; + + [aColor setFill]; + [blocksPath fill]; + + [img unlockFocus]; + + return [img autorelease]; + } + return nil; +} + + +- (NSURL*)uniqueNoteLink { + + NSArray *svcs = [[SyncSessionController class] allServiceNames]; + NSMutableDictionary *idsDict = [NSMutableDictionary dictionaryWithCapacity:[svcs count] + 1]; + + //include all identifying keys in case the title changes later + NSUInteger i = 0; + for (i=0; i<[svcs count]; i++) { + NSString *syncID = [[syncServicesMD objectForKey:[svcs objectAtIndex:i]] + objectForKey:[[[SyncSessionController allServiceClasses] objectAtIndex:i] nameOfKeyElement]]; + if (syncID) [idsDict setObject:syncID forKey:[svcs objectAtIndex:i]]; + } + [idsDict setObject:[[NSData dataWithBytes:&uniqueNoteIDBytes length:16] encodeBase64WithNewlines:NO] forKey:@"NV"]; + + return [NSURL URLWithString:[@"nv://find/" stringByAppendingFormat:@"%@/?%@", [titleString stringWithPercentEscapes], + [idsDict URLEncodedString]]]; +} + - (NSString*)noteFilePath { UniChar chars[256]; if ([delegate refreshFileRefIfNecessary:noteFileRefInit(self) withName:filename charsBuffer:chars] == noErr) - return [NSString pathWithFSRef:noteFileRefInit(self)]; + return [[NSFileManager defaultManager] pathWithFSRef:noteFileRefInit(self)]; return nil; } @@ -880,6 +1196,7 @@ - (BOOL)writeUsingCurrentFileFormat { NSData *formattedData = nil; NSError *error = nil; + NSMutableAttributedString *contentMinusColor = nil; int formatID = [delegate currentNoteStorageFormat]; switch (formatID) { @@ -888,7 +1205,6 @@ - (BOOL)writeUsingCurrentFileFormat { NSAssert(NO, @"Warning! Tried to write data for an individual note in single-db format!"); return NO; - case MarkupTextFormat: case PlainTextFormat: if (!(formattedData = [[contentString string] dataUsingEncoding:fileEncoding allowLossyConversion:NO])) { @@ -903,7 +1219,10 @@ - (BOOL)writeUsingCurrentFileFormat { } break; case RTFTextFormat: - formattedData = [contentString RTFFromRange:NSMakeRange(0, [contentString length]) documentAttributes:nil]; + contentMinusColor = [contentString mutableCopy]; + [contentMinusColor removeAttribute:NSForegroundColorAttributeName range:NSMakeRange(0, [contentMinusColor length])]; + formattedData = [contentMinusColor RTFFromRange:NSMakeRange(0, [contentMinusColor length]) documentAttributes:nil]; + [contentMinusColor release]; break; case HTMLFormat: @@ -941,9 +1260,12 @@ - (BOOL)writeUsingCurrentFileFormat { return NO; } //if writing plaintext set the file encoding with setxattr - if (PlainTextFormat == formatID || MarkupTextFormat == formatID) { + if (PlainTextFormat == formatID) { (void)[self writeCurrentFileEncodingToFSRef:noteFileRefInit(self)]; } + NSFileManager *fileMan = [NSFileManager defaultManager]; + [fileMan setOpenMetaTags:[self orderedLabelTitles] atFSPath:[[fileMan pathWithFSRef:noteFileRefInit(self)] fileSystemRepresentation]]; + //always hide the file extension for all types LSSetExtensionHiddenForRef(noteFileRefInit(self), TRUE); @@ -1000,7 +1322,8 @@ - (OSStatus)writeFileDatesAndUpdateTrackingInfo { return err; } fileModifiedDate = catInfo.contentModDate; - nodeID = catInfo.nodeID; + setAttrModifiedDate(self, &catInfo.attributeModDate); + setCatalogNodeID(self, catInfo.nodeID); logicalSize = (UInt32)(catInfo.dataLogicalSize & 0xFFFFFFFF); return noErr; @@ -1013,7 +1336,7 @@ - (OSStatus)writeCurrentFileEncodingToFSRef:(FSRef*)fsRef { NSMutableData *pathData = [NSMutableData dataWithLength:4 * 1024]; OSStatus err = noErr; if ((err = FSRefMakePath(fsRef, [pathData mutableBytes], [pathData length])) == noErr) { - [NSString setTextEncodingAttribute:fileEncoding atFSPath:[pathData bytes]]; + [[NSFileManager defaultManager] setTextEncodingAttribute:fileEncoding atFSPath:[pathData bytes]]; } else { NSLog(@"%s: error getting path from FSRef: %d (IsZeros: %d)", _cmd, err, IsZeros(fsRef, sizeof(fsRef))); } @@ -1033,7 +1356,7 @@ - (BOOL)upgradeEncodingToUTF8 { if (NSUTF8StringEncoding != fileEncoding) { [self _setFileEncoding:NSUTF8StringEncoding]; - if (!contentsWere7Bit && (PlainTextFormat == currentFormatID || MarkupTextFormat == currentFormatID)) { + if (!contentsWere7Bit && PlainTextFormat == currentFormatID) { //this note exists on disk as a plaintext file, and its encoding is incompatible with UTF-8 if ([delegate currentNoteStorageFormat] == PlainTextFormat) { @@ -1101,7 +1424,8 @@ - (BOOL)updateFromFile { FSCatalogInfo info; if ([delegate fileInNotesDirectory:noteFileRefInit(self) isOwnedByUs:NULL hasCatalogInfo:&info] == noErr) { fileModifiedDate = info.contentModDate; - nodeID = info.nodeID; + setAttrModifiedDate(self, &info.attributeModDate); + setCatalogNodeID(self, info.nodeID); logicalSize = (UInt32)(info.dataLogicalSize & 0xFFFFFFFF); return YES; @@ -1111,6 +1435,8 @@ - (BOOL)updateFromFile { } - (BOOL)updateFromCatalogEntry:(NoteCatalogEntry*)catEntry { + BOOL didRestoreLabels = NO; + NSMutableData *data = [delegate dataFromFileInNotesDirectory:noteFileRefInit(self) forCatalogEntry:catEntry]; if (!data) { NSLog(@"Couldn't update note from file on disk given catalog entry"); @@ -1123,21 +1449,47 @@ - (BOOL)updateFromCatalogEntry:(NoteCatalogEntry*)catEntry { [self setFilename:(NSString*)catEntry->filename withExternalTrigger:YES]; fileModifiedDate = catEntry->lastModified; - nodeID = catEntry->nodeID; + setAttrModifiedDate(self, &(catEntry->lastAttrModified)); + setCatalogNodeID(self, catEntry->nodeID); logicalSize = catEntry->logicalSize; - + + NSMutableData *pathData = [NSMutableData dataWithLength:4 * 1024]; + if (FSRefMakePath(noteFileRefInit(self), [pathData mutableBytes], [pathData length]) == noErr) { + + NSArray *openMetaTags = [[NSFileManager defaultManager] getOpenMetaTagsAtFSPath:[pathData bytes]]; + if (openMetaTags) { + //overwrite this note's labels with those from the file; merging may be the wrong thing to do here + if ([self _setLabelString:[openMetaTags componentsJoinedByString:@" "]]) + [self updateTablePreviewString]; + } else if ([labelString length]) { + //this file has either never had tags or has had them cleared by accident (e.g., non-user intervention) + //so if this note still has tags, then restore them now. + + NSLog(@"restoring lost tags for %@", titleString); + [[NSFileManager defaultManager] setOpenMetaTags:[self orderedLabelTitles] atFSPath:[pathData bytes]]; + didRestoreLabels = YES; + } + } + OSStatus err = noErr; CFAbsoluteTime aModDate, aCreateDate; if (noErr == (err = UCConvertUTCDateTimeToCFAbsoluteTime(&fileModifiedDate, &aModDate))) { [self setDateModified:aModDate]; } - if (createdDate == 0.0) { + + if (createdDate == 0.0 || didRestoreLabels) { //when reading files from disk for the first time, grab their creation date + //or if this file has just been altered, grab its newly-changed modification dates + FSCatalogInfo info; if ([delegate fileInNotesDirectory:noteFileRefInit(self) isOwnedByUs:NULL hasCatalogInfo:&info] == noErr) { - if (UCConvertUTCDateTimeToCFAbsoluteTime(&info.createDate, &aCreateDate) == noErr) { + if (createdDate == 0.0 && UCConvertUTCDateTimeToCFAbsoluteTime(&info.createDate, &aCreateDate) == noErr) { [self setDateAdded:aCreateDate]; } + if (didRestoreLabels) { + fileModifiedDate = info.contentModDate; + setAttrModifiedDate(self, &info.attributeModDate); + } } } @@ -1160,7 +1512,6 @@ - (BOOL)updateFromData:(NSMutableData*)data { NSAssert(NO, @"Warning! Tried to update data from a note in single-db format!"); break; - case MarkupTextFormat: case PlainTextFormat: //try to merge/re-match attributes? if ((stringFromData = [NSMutableString newShortLivedStringFromData:data ofGuessedEncoding:&fileEncoding withPath:NULL orWithFSRef:noteFileRefInit(self)])) { @@ -1214,6 +1565,7 @@ - (void)updateWithSyncBody:(NSString*)newBody andTitle:(NSString*)newTitle { NSMutableAttributedString *attributedBodyString = [[NSMutableAttributedString alloc] initWithString:newBody attributes:[[GlobalPrefs defaultPrefs] noteBodyAttributes]]; [attributedBodyString addLinkAttributesForRange:NSMakeRange(0, [attributedBodyString length])]; + [attributedBodyString addStrikethroughNearDoneTagsForRange:NSMakeRange(0, [attributedBodyString length])]; //should eventually sync changes back to disk: [self setContentString:[attributedBodyString autorelease]]; @@ -1236,7 +1588,7 @@ - (void)moveFileToTrash { } - (void)removeFileFromDirectory { - +#if PERMADELETE OSStatus err = noErr; if ((err = [delegate deleteFileInNotesDirectory:noteFileRefInit(self) forFilename:filename]) != noErr) { @@ -1247,6 +1599,9 @@ - (void)removeFileFromDirectory { [self moveFileToTrash]; } } +#else + [self moveFileToTrash]; +#endif } - (BOOL)removeUsingJournal:(WALStorageController*)wal { @@ -1303,30 +1658,33 @@ - (OSStatus)exportToDirectoryRef:(FSRef*)directoryRef withFilename:(NSString*)us NSData *formattedData = nil; NSError *error = nil; + NSMutableAttributedString *contentMinusColor = [[contentString mutableCopy] autorelease]; + [contentMinusColor removeAttribute:NSForegroundColorAttributeName range:NSMakeRange(0, [contentMinusColor length])]; + + switch (storageFormat) { case SingleDatabaseFormat: NSAssert(NO, @"Warning! Tried to export data in single-db format!?"); - case MarkupTextFormat: case PlainTextFormat: - if (!(formattedData = [[contentString string] dataUsingEncoding:fileEncoding allowLossyConversion:NO])) { + if (!(formattedData = [[contentMinusColor string] dataUsingEncoding:fileEncoding allowLossyConversion:NO])) { [self _setFileEncoding:NSUTF8StringEncoding]; NSLog(@"promoting to unicode (UTF-8) on export--probably because internal format is singledb"); - formattedData = [[contentString string] dataUsingEncoding:fileEncoding allowLossyConversion:YES]; + formattedData = [[contentMinusColor string] dataUsingEncoding:fileEncoding allowLossyConversion:YES]; } break; case RTFTextFormat: - formattedData = [contentString RTFFromRange:NSMakeRange(0, [contentString length]) documentAttributes:nil]; + formattedData = [contentMinusColor RTFFromRange:NSMakeRange(0, [contentMinusColor length]) documentAttributes:nil]; break; case HTMLFormat: - formattedData = [contentString dataFromRange:NSMakeRange(0, [contentString length]) + formattedData = [contentMinusColor dataFromRange:NSMakeRange(0, [contentMinusColor length]) documentAttributes:[NSDictionary dictionaryWithObject:NSHTMLTextDocumentType forKey:NSDocumentTypeDocumentAttribute] error:&error]; break; case WordDocFormat: - formattedData = [contentString docFormatFromRange:NSMakeRange(0, [contentString length]) documentAttributes:nil]; + formattedData = [contentMinusColor docFormatFromRange:NSMakeRange(0, [contentMinusColor length]) documentAttributes:nil]; break; case WordXMLFormat: - formattedData = [contentString dataFromRange:NSMakeRange(0, [contentString length]) + formattedData = [contentMinusColor dataFromRange:NSMakeRange(0, [contentMinusColor length]) documentAttributes:[NSDictionary dictionaryWithObject:NSWordMLTextDocumentType forKey:NSDocumentTypeDocumentAttribute] error:&error]; break; @@ -1335,7 +1693,7 @@ - (OSStatus)exportToDirectoryRef:(FSRef*)directoryRef withFilename:(NSString*)us } if (!formattedData) return kDataFormattingErr; - + //can use our already-determined filename to write here //but what about file names that were the same except for their extension? e.g., .txt vs. .text //this will give them the same extension and cause an overwrite @@ -1361,9 +1719,11 @@ - (OSStatus)exportToDirectoryRef:(FSRef*)directoryRef withFilename:(NSString*)us NSLog(@"error writing to temporary file: %d", err); return err; } - if (PlainTextFormat == storageFormat || MarkupTextFormat == storageFormat) { + if (PlainTextFormat == storageFormat) { (void)[self writeCurrentFileEncodingToFSRef:&fileRef]; } + NSFileManager *fileMan = [NSFileManager defaultManager]; + [fileMan setOpenMetaTags:[self orderedLabelTitles] atFSPath:[[fileMan pathWithFSRef:&fileRef] fileSystemRepresentation]]; //also export the note's modification and creation dates FSCatalogInfo catInfo; @@ -1426,14 +1786,24 @@ BOOL noteContainsUTF8String(NoteObject *note, NoteFilterContext *context) { BOOL noteTitleHasPrefixOfUTF8String(NoteObject *note, const char* fullString, size_t stringLen) { return !strncmp(note->cTitle, fullString, stringLen); } +BOOL noteTitleIsAPrefixOfOtherNoteTitle(NoteObject *longerNote, NoteObject *shorterNote) { + return !strncmp(longerNote->cTitle, shorterNote->cTitle, strlen(shorterNote->cTitle)); +} -BOOL noteTitleMatchesUTF8String(NoteObject *note, const char* fullString) { - return !strcmp(note->cTitle, fullString); +- (void)addPrefixParentNote:(NoteObject*)aNote { + if (!prefixParentNotes) { + prefixParentNotes = [[NSMutableArray alloc] init]; + } + [prefixParentNotes addObject:aNote]; +} +- (void)removeAllPrefixParentNotes { + [prefixParentNotes removeAllObjects]; } - (NSSet*)labelSet { return labelSet; } + /* - (CFArrayRef)rangesForWords:(NSString*)string inRange:(NSRange)rangeLimit { //use cstring caches if note is all 7-bit, as we [REALLY OUGHT TO] be able to assume a 1-to-1 character mapping diff --git a/NotesTableHeaderCell.m b/NotesTableHeaderCell.m index 0678dfef..a603f6ed 100644 --- a/NotesTableHeaderCell.m +++ b/NotesTableHeaderCell.m @@ -21,7 +21,9 @@ - (id)initTextCell:(NSString *)text //NSLog(@"headerCELL initing"); if (!bColor) { bColor = [[NSColor whiteColor] retain]; - hColor = [[NSColor whiteColor] retain]; + } + if (!hColor) { + hColor = [[NSColor grayColor] retain]; } if (!tColor) { tColor = [[NSColor blackColor] retain]; @@ -49,6 +51,9 @@ - (id)initTextCell:(NSString *)text } + (void)setBackgroundColor:(NSColor *)inColor{ + if (bColor) { + [bColor release]; + } bColor = [inColor retain]; CGFloat fWhite; CGFloat endWhite; @@ -60,34 +65,45 @@ + (void)setBackgroundColor:(NSColor *)inColor{ }else { endWhite = fWhite - .27f; } - + [hColor release]; hColor = [[inColor blendedColorWithFraction:0.60f ofColor:[NSColor colorWithCalibratedWhite:endWhite alpha:0.98f]] retain]; } + (void)setForegroundColor:(NSColor *)inColor{ + if (tColor) { + [tColor release]; + } tColor = [inColor retain]; } +- (NSRect)drawingRectForBounds:(NSRect)theRect { + return NSInsetRect(theRect, 6.0f, 0.0); +} + - (void)drawWithFrame:(NSRect)inFrame inView:(NSView*)inView { @try { - //NSLog(@"draw frame"); [[bColor copy]setFill]; NSRectFill(inFrame); [gradient drawInRect:inFrame angle:90]; @try { [tColor set]; NSBezierPath* thePath = [NSBezierPath bezierPath]; - [thePath removeAllPoints]; - [thePath moveToPoint:inFrame.origin]; - [thePath lineToPoint:NSMakePoint(inFrame.origin.x,(inFrame.origin.y + inFrame.size.height))]; - [thePath lineToPoint:NSMakePoint((inFrame.origin.x + inFrame.size.width),(inFrame.origin.y + inFrame.size.height))]; - // [thePath setLineWidth:2.0]; - [thePath setLineWidth:1.4]; + [thePath removeAllPoints]; + [thePath moveToPoint:NSMakePoint((inFrame.origin.x + inFrame.size.width),(inFrame.origin.y + inFrame.size.height))]; + [thePath lineToPoint:NSMakePoint(inFrame.origin.x,(inFrame.origin.y + inFrame.size.height))]; + if (inFrame.origin.x>5) { + [thePath lineToPoint:inFrame.origin]; + } + + [thePath moveToPoint:NSMakePoint((inFrame.origin.x + inFrame.size.width),inFrame.origin.y)]; + [thePath lineToPoint:NSMakePoint(inFrame.origin.x,inFrame.origin.y)]; + + [thePath setLineWidth:1.0]; [thePath stroke]; } @catch (NSException * e) { - NSLog(@"draw sides EXCEPT name: %@ description : %@",[e name],[e description]); + NSLog(@"draw sides EXCEPT name: %@ description : %@",[e name],[e description]); } float offset = 5; NSRect centeredRect = inFrame; @@ -113,21 +129,22 @@ - (void)drawSortIndicatorWithFrame:(NSRect)cellFrame inView:(NSView *)controlVie - (void)highlight:(BOOL)hBool withFrame:(NSRect)inFrame inView:(NSView *)controlView{ @try { if (hBool) { - //NSLog(@"draw highlight"); [hColor setFill]; - // [NSBezierPath fillRect:inFrame]; NSRectFill(inFrame); [gradient drawInRect:inFrame angle:90]; @try { [tColor setStroke]; - // NSLog(@"inFrame origin x is :%f and y is : %f",inFrame.origin.x,inFrame.origin.y); NSBezierPath* thePath = [NSBezierPath bezierPath]; [thePath removeAllPoints]; - [thePath moveToPoint:inFrame.origin]; + [thePath moveToPoint:NSMakePoint((inFrame.origin.x + inFrame.size.width),(inFrame.origin.y + inFrame.size.height))]; [thePath lineToPoint:NSMakePoint(inFrame.origin.x,(inFrame.origin.y + inFrame.size.height))]; - [thePath lineToPoint:NSMakePoint((inFrame.origin.x + inFrame.size.width),(inFrame.origin.y + inFrame.size.height))]; + if (inFrame.origin.x>5) { + [thePath lineToPoint:inFrame.origin]; + } + [thePath moveToPoint:NSMakePoint((inFrame.origin.x + inFrame.size.width),inFrame.origin.y)]; + [thePath lineToPoint:NSMakePoint(inFrame.origin.x,inFrame.origin.y)]; //[thePath setLineWidth:2.0]; // Has no effect. [thePath setLineWidth:1.4]; [thePath stroke]; @@ -141,7 +158,6 @@ - (void)highlight:(BOOL)hBool withFrame:(NSRect)inFrame inView:(NSView *)control NSRect centeredRect = inFrame; centeredRect.size = [[self stringValue] sizeWithAttributes:attrs]; centeredRect.origin.x += offset; - //centeredRect.origin.x += ((inFrame.size.width - centeredRect.size.width) / 2.0); centeredRect.origin.y = ((inFrame.size.height - centeredRect.size.height) / 2.0); [attrs setValue:tColor forKey:@"NSColor"]; [[self stringValue] drawInRect:centeredRect withAttributes:attrs]; @@ -151,10 +167,7 @@ - (void)highlight:(BOOL)hBool withFrame:(NSRect)inFrame inView:(NSView *)control NSLog(@"draw highlight EXCEPT: %@",[e description]); } } -/* -- (void)drawInteriorWithFrame:(NSRect)inFrame inView:(NSView *)controlView{ -}*/ - (id)copyWithZone:(NSZone *)zone { diff --git a/NotesTableView.h b/NotesTableView.h index 561cb13f..531963fc 100755 --- a/NotesTableView.h +++ b/NotesTableView.h @@ -12,12 +12,12 @@ #import -#import "NotesTableCornerView.h" @class HeaderViewWithMenu; @class NoteAttributeColumn; @class GlobalPrefs; -@class NotesTableCornerView; +//@class NotesTableCornerView; +//@class NVTransparentScroller; typedef struct _ViewLocationContext { BOOL pivotRowWasEdge; @@ -27,23 +27,33 @@ typedef struct _ViewLocationContext { @interface NotesTableView : NSTableView { + NSTimer *modifierTimer; IBOutlet NSTextField *controlField; NSMutableArray *allColumns; + NSMutableDictionary *allColsDict; NSInteger firstRowIndexBeforeSplitResize; BOOL viewMenusValid; BOOL hadHighlightInForeground, hadHighlightInBackground; - BOOL shouldUseSecondaryHighlightColor; - + BOOL shouldUseSecondaryHighlightColor, isActiveStyle; + BOOL lastEventActivatedTagEdit, wasDeleting, isAutocompleting; + + id labelsListSource; + GlobalPrefs *globalPrefs; NSMenuItem *dummyItem; HeaderViewWithMenu *headerView; - NotesTableCornerView *cornerView; + //NotesTableCornerView *cornerView; + NSView *cornerView; + NSTextFieldCell *cachedCell; + //NVTransparentScroller *nvNotesScroller; NSDictionary *loadStatusAttributes; float loadStatusStringWidth; NSString *loadStatusString; + + float tableFontHeight; int affinity; } @@ -56,19 +66,23 @@ typedef struct _ViewLocationContext { - (double)distanceFromRow:(int)aRow forVisibleArea:(NSRect)visibleRect; - (void)scrollRowToVisible:(NSInteger)rowIndex withVerticalOffset:(float)offset; - (void)selectRowAndScroll:(NSInteger)row; -- (BOOL)objectIsSelected:(id)obj; +- (float)tableFontHeight; + +- (BOOL)isActiveStyle; - (void)setShouldUseSecondaryHighlightColor:(BOOL)value; -- (void)_setTitleDereferencorState:(BOOL)activeStyle; +- (void)_setActiveStyleState:(BOOL)activeStyle; - (void)updateTitleDereferencorState; - (void)reloadDataIfNotEditing; - (void)restoreColumns; - +- (void)_configureAttributesForCurrentLayout; - (void)updateHeaderViewForColumns; +- (BOOL)eventIsTagEdit:(NSEvent*)event forColumn:(NSInteger)columnIndex row:(NSInteger)rowIndex; +- (BOOL)lastEventActivatedTagEdit; - (void)editRowAtColumnWithIdentifier:(id)identifier; -- (void)addPermanentTableColumn:(NSTableColumn*)column; +- (BOOL)addPermanentTableColumn:(NSTableColumn*)column; - (IBAction)actionHideShowColumn:(id)sender; - (IBAction)toggleNoteBodyPreviews:(id)sender; - (void)setStatusForSortedColumn:(id)item; @@ -80,6 +94,10 @@ typedef struct _ViewLocationContext { - (void)incrementNoteSelection:(id)sender; +- (id)labelsListSource; +- (void)setLabelsListSource:(id)labelsSource; +- (NSArray *)labelCompletionsForString:(NSString *)fieldString index:(int)index; + @end @interface NSTableView (Private) @@ -89,3 +107,4 @@ typedef struct _ViewLocationContext { //10.3 only - (void)_sizeToFitIfNecessary; @end + diff --git a/NotesTableView.m b/NotesTableView.m index 659896a2..c81d52c8 100755 --- a/NotesTableView.m +++ b/NotesTableView.m @@ -1,107 +1,111 @@ /*Copyright (c) 2010, Zachary Schneirov. All rights reserved. - Redistribution and use in source and binary forms, with or without modification, are permitted - provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of - conditions and the following disclaimer in the documentation and/or other materials provided with - the distribution. - - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior written permission. */ + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided with + the distribution. + - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. */ #import "NotesTableView.h" -#import "AppController.h" +#import "AppController_Importing.h" #import "FastListDataSource.h" #import "NoteAttributeColumn.h" #import "GlobalPrefs.h" #import "NotationPrefs.h" #import "NoteObject.h" #import "NSCollection_utils.h" +#import "LabelColumnCell.h" +#import "UnifiedCell.h" #import "HeaderViewWithMenu.h" #import "NSString_NV.h" +#import "NotesTableHeaderCell.h" +//#import "NotesTableCornerView.h" #define STATUS_STRING_FONT_SIZE 16.0f #define SET_DUAL_HIGHLIGHTS 0 +#define SYNTHETIC_TAGS_COLUMN_INDEX 200 + +static void _CopyItemWithSelectorFromMenu(NSMenu *destMenu, NSMenu *sourceMenu, SEL aSel, id target); + @implementation NotesTableView //there's something wrong with this initialization under panther, I think - (id)initWithCoder:(NSCoder *)decoder { if ((self = [super initWithCoder:decoder])) { - - globalPrefs = [GlobalPrefs defaultPrefs]; - loadStatusString = NSLocalizedString(@"Loading Notes...",nil); - loadStatusAttributes = [[NSDictionary dictionaryWithObjectsAndKeys: - [NSFont fontWithName:@"Helvetica" size:STATUS_STRING_FONT_SIZE], NSFontAttributeName, - [NSColor colorWithCalibratedRed:0.0f green:0.0f blue:0.0f alpha:0.5f], NSForegroundColorAttributeName, nil] retain]; - loadStatusStringWidth = [loadStatusString sizeWithAttributes:loadStatusAttributes].width; - - affinity = 0; - shouldUseSecondaryHighlightColor = viewMenusValid = NO; - firstRowIndexBeforeSplitResize = NSNotFound; - - headerView = [[HeaderViewWithMenu alloc] init]; - [headerView setTableView:self]; - [headerView setFrame:[[self headerView] frame]]; - cornerView = [[self cornerView] retain]; - - NSFont *font = [NSFont systemFontOfSize:[globalPrefs tableFontSize]]; - NSArray *columnsToDisplay = [globalPrefs visibleTableColumns]; - allColumns = [[NSMutableArray alloc] init]; + globalPrefs = [GlobalPrefs defaultPrefs]; - id (*titleReferencor)(id, id) = [globalPrefs tableColumnsShowPreview] ? tableTitleOfNote : titleOfNote2; - - NSString *colStrings[] = { NoteTitleColumnString, NoteLabelsColumnString, NoteDateModifiedColumnString, NoteDateCreatedColumnString }; - SEL colMutators[] = { @selector(setTitleString:), @selector(setLabelString:), NULL, NULL }; - id (*colReferencors[])(id, id) = {titleReferencor, labelsOfNote2, dateModifiedStringOfNote, dateCreatedStringOfNote }; - NSInteger (*sortFunctions[])(id*, id*) = { compareTitleString, compareLabelString, compareDateModified, compareDateCreated }; - NSInteger (*reverseSortFunctions[])(id*, id*) = { compareTitleStringReverse, compareLabelStringReverse, compareDateModifiedReverse, - compareDateCreatedReverse }; + loadStatusString = NSLocalizedString(@"Loading Notes...",nil); + loadStatusAttributes = [[NSDictionary dictionaryWithObjectsAndKeys: + [NSFont fontWithName:@"Helvetica" size:STATUS_STRING_FONT_SIZE], NSFontAttributeName, + [NSColor colorWithCalibratedRed:0.0f green:0.0f blue:0.0f alpha:0.5f], NSForegroundColorAttributeName, nil] retain]; + loadStatusStringWidth = [loadStatusString sizeWithAttributes:loadStatusAttributes].width; + affinity = 0; + shouldUseSecondaryHighlightColor = viewMenusValid = NO; + firstRowIndexBeforeSplitResize = NSNotFound; - unsigned int i; - for (i=0; i)sender { - + if ([sender draggingSource] == self) return NO; - + return YES; } @@ -222,7 +190,7 @@ - (BOOL)performDragOperation:(id )sender { if ([sender draggingSource] == self) return NO; - + return [[NSApp delegate] addNotesFromPasteboard:[sender draggingPasteboard]]; } @@ -230,18 +198,27 @@ - (void)paste:(id)sender { [[NSApp delegate] addNotesFromPasteboard:[NSPasteboard generalPasteboard]]; } -- (void)_setTitleDereferencorState:(BOOL)activeStyle { +- (float)tableFontHeight { + return tableFontHeight; +} + +- (BOOL)isActiveStyle { + return isActiveStyle; +} + +- (void)_setActiveStyleState:(BOOL)activeStyle { NoteAttributeColumn *col = [self noteAttributeColumnForIdentifier:NoteTitleColumnString]; #if SET_DUAL_HIGHLIGHTS activeStyle = YES; #endif - [col setDereferencingFunction: [globalPrefs tableColumnsShowPreview] ? - (activeStyle ? properlyHighlightingTableTitleOfNote : tableTitleOfNote) : titleOfNote2]; + isActiveStyle = activeStyle; + [col setDereferencingFunction: [globalPrefs horizontalLayout] ? ([globalPrefs tableColumnsShowPreview] ? unifiedCellForNote : unifiedCellSingleLineForNote) : + ([globalPrefs tableColumnsShowPreview] ? (activeStyle ? properlyHighlightingTableTitleOfNote : tableTitleOfNote) : titleOfNote2)]; } - (void)updateTitleDereferencorState { NSWindow *win = [self window]; - [self _setTitleDereferencorState: [win isMainWindow] && ([win firstResponder] == self || [self currentEditor]) ]; + [self _setActiveStyleState: [win isMainWindow] && ([win firstResponder] == self || [self currentEditor]) ]; } - (BOOL)becomeFirstResponder { @@ -251,7 +228,7 @@ - (BOOL)becomeFirstResponder { } - (BOOL)resignFirstResponder { - [self _setTitleDereferencorState:NO]; + [self _setActiveStyleState:NO]; return [super resignFirstResponder]; } @@ -268,27 +245,104 @@ - (void)reloadData { } - (void)menuNeedsUpdate:(NSMenu *)menu { - - if (!viewMenusValid && [menu delegate] == self) { + + if (!viewMenusValid && [menu delegate] == (id)self) { [menu setSubmenu:[self menuForColumnConfiguration:nil] forItem:[menu itemWithTag:97]]; [menu setSubmenu:[self menuForColumnSorting] forItem:[menu itemWithTag:98]]; - viewMenusValid = YES; + + viewMenusValid = YES; } } -- (void)settingChangedForSelectorString:(NSString*)selectorString { +- (void)drawGridInClipRect:(NSRect)clipRect { + //draw lines manually to avoid interfering with title-focusrings and selection highlighting on leopard+ + if (![self dataSource]) { + return; + } + [NSGraphicsContext saveGraphicsState]; + [[NSGraphicsContext currentContext] setShouldAntialias:NO]; + + NSBezierPath *line = [NSBezierPath bezierPath]; + NSUInteger i; + + [[self gridColor] setStroke]; + + NSIndexSet *set = [self selectedRowIndexes]; + NSInteger editedRow = [self editedRow]; + + NSRange rangeOfRows = [self rowsInRect:clipRect]; + float yToDraw = -0.5; + float ySpacing = [self rowHeight] + [self intercellSpacing].height; + float rowRectOrigin = ySpacing * rangeOfRows.location; + + for (i = rangeOfRows.location; i < rangeOfRows.location + rangeOfRows.length; i++) { + //don't draw this line if it's next to a selected row, or the row after it is being edited + if (![set containsIndex:i] && editedRow != (NSInteger)(i+1)) { + yToDraw = rowRectOrigin + ySpacing - 0.5; + [line moveToPoint:NSMakePoint(clipRect.origin.x, yToDraw)]; + [line lineToPoint:NSMakePoint(clipRect.origin.x + clipRect.size.width, yToDraw)]; + } + rowRectOrigin += ySpacing; + } + //draw everything after the visible range of rows + while (rowRectOrigin < clipRect.size.height) { + rowRectOrigin += ySpacing; + [line moveToPoint:NSMakePoint(clipRect.origin.x, rowRectOrigin)]; + [line lineToPoint:NSMakePoint(clipRect.origin.x + clipRect.size.width, rowRectOrigin)]; + } + [line stroke]; + [NSGraphicsContext restoreGraphicsState]; +} + +- (void)_configureAttributesForCurrentLayout { + BOOL horiz = [globalPrefs horizontalLayout]; + + NoteAttributeColumn *col = [self noteAttributeColumnForIdentifier:NoteTitleColumnString]; + if (!cachedCell) cachedCell = [[col dataCell] retain]; + [col setDataCell: horiz ? [[[UnifiedCell alloc] init] autorelease] : cachedCell]; + + NSFont *font = [NSFont systemFontOfSize:[globalPrefs tableFontSize]]; + NSUInteger i; + for (i=0; i<[allColumns count]; i++) { + [[[allColumns objectAtIndex:i] dataCell] setFont:font]; + } + + if (IsLeopardOrLater) + [self setSelectionHighlightStyle:horiz ? NSTableViewSelectionHighlightStyleSourceList : NSTableViewSelectionHighlightStyleRegular]; + + NSLayoutManager *lm = [[NSLayoutManager alloc] init]; + tableFontHeight = [lm defaultLineHeightForFont:font]; + float h[4] = {(tableFontHeight * 3.0 + 5.0f), (tableFontHeight * 2.0 + 6.0f), (tableFontHeight + 4.0f), tableFontHeight + 2.0f}; + [self setRowHeight: horiz ? ([globalPrefs tableColumnsShowPreview] ? h[0] : + (ColumnIsSet(NoteLabelsColumn,[globalPrefs tableColumnsBitmap]) ? h[1] : h[2])) : h[3]]; + [lm release]; + + [self setIntercellSpacing:NSMakeSize(12, 2)]; + + [self setGridStyleMask:horiz ? NSTableViewSolidHorizontalGridLineMask : NSTableViewGridNone]; + //[self setGridColor:[NSColor colorWithCalibratedWhite:0.882 alpha:1.0]]; +} +- (void)settingChangedForSelectorString:(NSString*)selectorString { + if ([selectorString isEqualToString:SEL_STR(setTableFontSize:sender:)]) { - NSFont *font = [NSFont systemFontOfSize:[globalPrefs tableFontSize]]; + [self _configureAttributesForCurrentLayout]; + + } else if ([selectorString isEqualToString:SEL_STR(setHorizontalLayout:sender:)]) { - NSUInteger i; - for (i=0; i<[allColumns count]; i++) - [[[allColumns objectAtIndex:i] dataCell] setFont:font]; + [self abortEditing]; + + //restore columns according to the current preferences + + [self restoreColumns]; + [self updateHeaderViewForColumns]; - NSLayoutManager *lm = [[NSLayoutManager alloc] init]; - [self setRowHeight:[lm defaultLineHeightForFont:font] + 3.0f]; - [lm release]; + [self _configureAttributesForCurrentLayout]; + + [self updateTitleDereferencorState]; + + viewMenusValid = NO; } } @@ -353,64 +407,73 @@ - (void)scrollRowToVisible:(NSInteger)rowIndex withVerticalOffset:(float)offset rowRect.origin.y -= offset; NSClipView *clipView = [[self enclosingScrollView] contentView]; - + [clipView scrollToPoint:[clipView constrainScrollPoint:rowRect.origin]]; [[self enclosingScrollView] reflectScrolledClipView:clipView]; } - (void)editRowAtColumnWithIdentifier:(id)identifier { + NSInteger colIndex = -1; + NSInteger selected = [self selectedRow]; - int colIndex = [self columnWithIdentifier:identifier]; - if (colIndex < 0) { + if (selected < 0) { + NSBeep(); + return; + } + + if ([globalPrefs horizontalLayout]) { - BOOL isTitleCol = [identifier isEqualToString:NoteTitleColumnString]; - int newColIndex = (int)(!isTitleCol); + //default to editing title if this is attempted in horizontal mode for any column other than tags + //(which currently are the only two editable columns, anyway) + colIndex = [identifier isEqualToString:NoteLabelsColumnString] ? SYNTHETIC_TAGS_COLUMN_INDEX : 0; + } else if ((colIndex = [self columnWithIdentifier:identifier]) < 0) { + //always move title column to 0 index + NSInteger newColIndex = (NSInteger)(![identifier isEqualToString:NoteTitleColumnString]); - NSEnumerator *theEnumerator = [allColumns objectEnumerator]; - NSTableColumn *column = nil; - while ((column = [theEnumerator nextObject]) != nil) { + NSTableColumn *column = [self noteAttributeColumnForIdentifier:identifier]; + if (column && [self addPermanentTableColumn:column]) { - if ([[column identifier] isEqualToString:identifier]) { - [self addPermanentTableColumn:column]; - [self moveColumn:[[self tableColumns] indexOfObjectIdenticalTo:column] toColumn:newColIndex]; + NSUInteger addedColIndex = [[self tableColumns] indexOfObjectIdenticalTo:column]; + if (addedColIndex < [[self tableColumns] count]) { + [self moveColumn:addedColIndex toColumn:newColIndex]; colIndex = newColIndex; [self sizeToFit]; - break; } } } - int selected = [self selectedRow]; - if (selected > -1 && colIndex > -1) { + if (colIndex > -1) { + [self editColumn:colIndex row:selected withEvent:[[self window] currentEvent] select:YES]; - } else NSBeep(); + } else { + + NSBeep(); + } } - (NoteAttributeColumn*)noteAttributeColumnForIdentifier:(NSString*)identifier { - NSEnumerator *theEnumerator = [allColumns objectEnumerator]; - NoteAttributeColumn *theColumn = nil; - while ((theColumn = [theEnumerator nextObject]) != nil) { - if ([[theColumn identifier] isEqualToString:identifier]) - return theColumn; - } - - return nil; + return [allColsDict objectForKey:identifier]; } -- (void)addPermanentTableColumn:(NSTableColumn*)column { - [self addTableColumn:column]; +- (BOOL)addPermanentTableColumn:(NSTableColumn*)column { + if (![globalPrefs horizontalLayout]) { + [self addTableColumn:column]; + } [globalPrefs addTableColumn:[column identifier] sender:self]; + if ([globalPrefs horizontalLayout]) //for now, for extending rowheight when tags are shown/hidden + [self _configureAttributesForCurrentLayout]; + if ([[column identifier] isEqualToString:[globalPrefs sortedTableColumnKey]]) { [(NoteAttributeColumn*)[self highlightedTableColumn] updateWidthForHighlight]; [self setHighlightedTableColumn:column]; - [(NoteAttributeColumn*)column updateWidthForHighlight]; } [self updateHeaderViewForColumns]; viewMenusValid = NO; + return YES; } - (void)updateHeaderViewForColumns { @@ -425,11 +488,9 @@ - (void)updateHeaderViewForColumns { if (oldHeader != newHeader) { //[headerView setTableView:newHeader ? self : nil]; - - [self setHeaderView:newHeader]; [self setCornerView:newHeader ? cornerView : nil]; - + if ([self respondsToSelector:@selector(_sizeRowHeaderToFitIfNecessary)]) { //hopefully 10.5 has this [self _sizeRowHeaderToFitIfNecessary]; @@ -450,20 +511,27 @@ - (void)updateHeaderViewForColumns { frame.size.width += 2.6; [win setFrame:frame display:YES]; } - //[self tile]; } } - (IBAction)actionHideShowColumn:(id)sender { NSTableColumn *column = [sender representedObject]; - if ([[self tableColumns] containsObject:column]) { + + if ([globalPrefs horizontalLayout] && [[column identifier] isEqualToString:NoteTitleColumnString]) { + NSBeep(); + return; + } + + if ([[globalPrefs visibleTableColumns] containsObject:[column identifier]]) { - if ([self numberOfColumns] > 1) { + if ([[globalPrefs visibleTableColumns] count] > 1) { [self abortEditing]; [self removeTableColumn:column]; [globalPrefs removeTableColumn:[column identifier] sender:self]; viewMenusValid = NO; + if ([globalPrefs horizontalLayout]) //for now, in case we are hiding tags when previews are not visible + [self _configureAttributesForCurrentLayout]; } else { NSBeep(); } @@ -475,11 +543,11 @@ - (IBAction)actionHideShowColumn:(id)sender { NSArray *cols = [self tableColumns]; - unsigned addedColIndex = [cols indexOfObjectIdenticalTo:column]; - unsigned clickedColIndex = [sender tag]; + NSUInteger addedColIndex = [cols indexOfObjectIdenticalTo:column]; + NSInteger clickedColIndex = [sender tag]; - if (clickedColIndex < [cols count] && addedColIndex < [cols count]) - [self moveColumn:addedColIndex toColumn:clickedColIndex+1]; + if ((NSUInteger)clickedColIndex < [cols count] && addedColIndex < [cols count]) + [self moveColumn:addedColIndex toColumn:clickedColIndex + 1]; } [self sizeToFit]; @@ -487,6 +555,7 @@ - (IBAction)actionHideShowColumn:(id)sender { - (IBAction)toggleNoteBodyPreviews:(id)sender { [globalPrefs setTableColumnsShowPreview: ![globalPrefs tableColumnsShowPreview] sender:self]; + [self _configureAttributesForCurrentLayout]; } - (NSMenu *)menuForColumnSorting { @@ -512,7 +581,8 @@ - (NSMenu *)menuForColumnSorting { - (NSMenu *)menuForColumnConfiguration:(NSTableColumn *)inSelectedColumn { NSMenu *theMenu = [[[NSMenu alloc] initWithTitle:@""] autorelease]; - NSArray *cols = [self tableColumns]; + NSArray *prefsCols = [globalPrefs visibleTableColumns]; + NSEnumerator *theEnumerator = [allColumns objectEnumerator]; NSTableColumn *theColumn = nil; while ((theColumn = [theEnumerator nextObject]) != nil) { @@ -521,11 +591,12 @@ - (NSMenu *)menuForColumnConfiguration:(NSTableColumn *)inSelectedColumn { keyEquivalent:@""] autorelease]; [theMenuItem setTarget:self]; [theMenuItem setRepresentedObject:theColumn]; - [theMenuItem setState:[cols containsObject:theColumn]]; - [theMenuItem setTag:(inSelectedColumn ? [cols indexOfObjectIdenticalTo:inSelectedColumn] : 0)]; + [theMenuItem setState:[prefsCols containsObject:[theColumn identifier]]]; + [theMenuItem setTag:(inSelectedColumn ? [[self tableColumns] indexOfObjectIdenticalTo:inSelectedColumn] : 0)]; [theMenu addItem:theMenuItem]; } + return theMenu; } @@ -560,8 +631,7 @@ - (void)setStatusForSortedColumn:(id)sender { - (void)setSortDirection:(BOOL)direction inTableColumn:(NSTableColumn*)tableColumn { [self setHighlightedTableColumn:tableColumn]; - - + // Set the graphic for the new column header [self setIndicatorImage: (direction ? [NSImage imageNamed:@"NSDescendingSortIndicator"] : [NSImage imageNamed:@"NSAscendingSortIndicator"]) inTableColumn:tableColumn]; @@ -588,71 +658,41 @@ - (NSMenu *)menuForEvent:(NSEvent *)theEvent { return [self defaultNoteCommandsMenuWithTarget:[NSApp delegate]]; } +static void _CopyItemWithSelectorFromMenu(NSMenu *destMenu, NSMenu *sourceMenu, SEL aSel, id target) { + int menuIndex = [sourceMenu indexOfItemWithTarget:target andAction:aSel]; + if (menuIndex > -1) [destMenu addItem:[[(NSMenuItem*)[sourceMenu itemAtIndex:menuIndex] copy] autorelease]]; +} + - (NSMenu *)defaultNoteCommandsMenuWithTarget:(id)target { NSMenu *theMenu = [[[NSMenu alloc] initWithTitle:@"Contextual Note Commands Menu"] autorelease]; - NSMenu *notesMenu = [[[NSApp mainMenu] itemWithTag:NOTES_MENU_ID] submenu]; - int menuIndex = [notesMenu indexOfItemWithTarget:target andAction:@selector(renameNote:)]; - if (menuIndex > -1) [theMenu addItem:[[(NSMenuItem*)[notesMenu itemAtIndex:menuIndex] copy] autorelease]]; - - menuIndex = [notesMenu indexOfItemWithTarget:target andAction:@selector(tagNote:)]; - if (menuIndex > -1) [theMenu addItem:[[(NSMenuItem*)[notesMenu itemAtIndex:menuIndex] copy] autorelease]]; - - menuIndex = [notesMenu indexOfItemWithTarget:target andAction:@selector(deleteNote:)]; - if (menuIndex > -1) [theMenu addItem:[[(NSMenuItem*)[notesMenu itemAtIndex:menuIndex] copy] autorelease]]; + _CopyItemWithSelectorFromMenu(theMenu, notesMenu, @selector(renameNote:), target); + _CopyItemWithSelectorFromMenu(theMenu, notesMenu, @selector(tagNote:), target); + _CopyItemWithSelectorFromMenu(theMenu, notesMenu, @selector(deleteNote:), target); [theMenu addItem:[NSMenuItem separatorItem]]; - menuIndex = [notesMenu indexOfItemWithTarget:target andAction:@selector(exportNote:)]; - if (menuIndex > -1) [theMenu addItem:[[(NSMenuItem*)[notesMenu itemAtIndex:menuIndex] copy] autorelease]]; + NSMenuItem *noteLinkItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Copy URL",@"contextual menu item title to copy urls") + action:@selector(copyNoteLink:) keyEquivalent:@"c"]; + [noteLinkItem setKeyEquivalentModifierMask:NSCommandKeyMask|NSAlternateKeyMask]; + [noteLinkItem setTarget:target]; + [theMenu addItem:[noteLinkItem autorelease]]; + + _CopyItemWithSelectorFromMenu(theMenu, notesMenu, @selector(exportNote:), target); + _CopyItemWithSelectorFromMenu(theMenu, notesMenu, @selector(revealNote:), target); + _CopyItemWithSelectorFromMenu(theMenu, notesMenu, @selector(openFileInEditor:), target); [theMenu addItem:[NSMenuItem separatorItem]]; - menuIndex = [notesMenu indexOfItemWithTarget:target andAction:@selector(printNote:)]; - if (menuIndex > -1) [theMenu addItem:[[(NSMenuItem*)[notesMenu itemAtIndex:menuIndex] copy] autorelease]]; + _CopyItemWithSelectorFromMenu(theMenu, notesMenu, @selector(printNote:), target); NSArray *notes = [(FastListDataSource*)[self dataSource] objectsAtFilteredIndexes:[self selectedRowIndexes]]; - //NSMenuItem *copyURLsItem = [theMenu addItemWithTitle:@"Copy Link to Clipboard" action:NULL keyEquivalent:@""]; [notes addMenuItemsForURLsInNotes:theMenu]; return theMenu; } - -- (BOOL)objectIsSelected:(id)obj { - NSIndexSet *indexSet = nil; - - const id *objects = [(FastListDataSource*)[self dataSource] immutableObjects]; - if (!objects) return NO; - - //check for single-selections first to avoid selectedRowIndexes, which will always create a new object - if ([self numberOfSelectedRows] == 1) { - NSInteger selRowIndex = [self selectedRow]; - if (selRowIndex >= 0) { - return obj == objects[selRowIndex]; - } - } - - indexSet = [self selectedRowIndexes]; - NSUInteger count = (NSUInteger)[self numberOfRows]; - NSUInteger indexBuffer[20]; - NSUInteger bufferIndex, firstIndex = [indexSet firstIndex]; - NSUInteger indexCount = 1; - NSRange range = NSMakeRange(firstIndex, [indexSet lastIndex]-firstIndex+1); - - while ((indexCount = [indexSet getIndexes:indexBuffer maxCount:20 inIndexRange:&range])) { - - for (bufferIndex=0; bufferIndex < indexCount; bufferIndex++) { - NSUInteger objIndex = indexBuffer[bufferIndex]; - if (objIndex < count && obj == objects[objIndex]) return YES; - } - } - - return NO; -} - - - (void)windowDidBecomeMain:(NSNotification *)aNotification { [self setShouldUseSecondaryHighlightColor:hadHighlightInForeground]; [self updateTitleDereferencorState]; @@ -679,7 +719,7 @@ - (void)setShouldUseSecondaryHighlightColor:(BOOL)value { #if SET_DUAL_HIGHLIGHTS - (BOOL)_shouldUseSecondaryHighlightColor { - + return shouldUseSecondaryHighlightColor; } #endif @@ -690,7 +730,8 @@ - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { } - (void)mouseDown:(NSEvent*)event { - + [[NSApp delegate] setIsEditing:NO]; + //this seems like it should happen automatically, but it does not. if (![NSApp isActive]) { [NSApp activateIgnoringOtherApps:YES]; @@ -747,9 +788,7 @@ - (void)mouseDown:(NSEvent*)event { #define UPCHAR(x) ((x) == NSUpArrowFunctionKey || (x) == NSUpTextMovement) - (void)keyDown:(NSEvent*)theEvent { - unichar keyChar = [theEvent firstCharacter]; - if (keyChar == NSNewlineCharacter || keyChar == NSCarriageReturnCharacter || keyChar == NSEnterCharacter) { unsigned int sel = [self selectedRow]; if (sel < (unsigned)[self numberOfRows] && [self numberOfSelectedRows] == 1) { @@ -817,7 +856,7 @@ - (void)keyDown:(NSEvent*)theEvent { return; } - + NSWindow *win = [self window]; if ([win firstResponder] == self) { //forward keystroke to first responder, which should be controlField's field editor @@ -836,9 +875,17 @@ - (void)keyDown:(NSEvent*)theEvent { - (BOOL)performKeyEquivalent:(NSEvent *)theEvent { unsigned mods = [theEvent modifierFlags]; - if (mods & NSCommandKeyMask) { + + // Also catch Ctrl-J/-K to match the shortcuts of other apps + if (((mods & NSCommandKeyMask) || (mods & NSControlKeyMask)) && ((mods & NSShiftKeyMask) == 0)) { - unichar keyChar = [theEvent firstCharacter]; /*cannot use ignoringModifiers here as it subverts the Dvorak-Qwerty-CMD keyboard layout */ + unichar keyChar = ' '; + if (mods & NSCommandKeyMask) { + keyChar = [theEvent firstCharacter]; /*cannot use ignoringModifiers here as it subverts the Dvorak-Qwerty-CMD keyboard layout */ + } + if (mods & NSControlKeyMask) { + keyChar = [theEvent firstCharacterIgnoringModifiers]; /* first gets '\n' when control key is set, so fall back to ignoringModifiers */ + } if (keyChar == kNext_Tag || keyChar == kPrev_Tag) { @@ -853,10 +900,11 @@ - (BOOL)performKeyEquivalent:(NSEvent *)theEvent { return YES; } } - + return [super performKeyEquivalent:theEvent]; } + - (void)incrementNoteSelection:(id)sender { int tag = [sender tag]; @@ -882,7 +930,7 @@ - (void)deselectAll:(id)sender { } - (void)selectRowAndScroll:(NSInteger)row { - + if (row > -1 && row < [self numberOfRows]) { [self selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; [self scrollRowToVisible:row]; @@ -890,9 +938,13 @@ - (void)selectRowAndScroll:(NSInteger)row { } - (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)command { - + if ((command == @selector(insertTab:))||(command == @selector(insertNewline:))||(command == @selector(insertBacktab:))||(command == @selector(cancelOperation:))) { + [[NSApp delegate] setIsEditing:NO]; + }//else { + // NSLog(@"ntv got %@",NSStringFromSelector(command)); + //} if (command == @selector(moveToEndOfLine:) || command == @selector(moveToRightEndOfLine:)) { - + NSEvent *event = [[self window] currentEvent]; if ([event type] == NSKeyDown && ![event isARepeat] && NSEqualRanges([aTextView selectedRange], NSMakeRange([[aTextView string] length], 0))) { @@ -905,26 +957,158 @@ - (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)command { } return YES; } + } else if (command == @selector(insertTab:)) { + + if ([globalPrefs horizontalLayout] && !lastEventActivatedTagEdit) { + //if we're currently renaming a note in horizontal mode, then tab should move focus to tags area + + [self editRowAtColumnWithIdentifier:NoteLabelsColumnString]; + return YES; + } + } else if (command == @selector(insertBacktab:)) { + + if ([globalPrefs horizontalLayout] && lastEventActivatedTagEdit) { + //if we're currently tagging a note in horizontal mode, then tab should move focus to renaming + + [self editRowAtColumnWithIdentifier:NoteTitleColumnString]; + return YES; + } } + return NO; } -- (void)editColumn:(NSInteger)columnIndex row:(NSInteger)rowIndex withEvent:(NSEvent *)theEvent select:(BOOL)flag { +- (BOOL)textView:(NSTextView *)aTextView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString { + wasDeleting = ![replacementString length]; + return YES; +} - [super editColumn:columnIndex row:rowIndex withEvent:theEvent select:flag]; +- (id)labelsListSource { + return labelsListSource; +} + +- (void)setLabelsListSource:(id)labelsSource { + labelsListSource = labelsSource; +} + +- (NSArray *)textView:(NSTextView *)aTextView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)anIndex { + if (charRange.location != NSNotFound) { + if (!IsLeopardOrLater) + goto getCompletions; + + NSCharacterSet *set = [NSCharacterSet labelSeparatorCharacterSet]; + NSString *str = [aTextView string]; +#define CharIndexIsMember(__index) ([set characterIsMember:[str characterAtIndex:(__index)]]) + + BOOL hasLChar = charRange.location > 0; + BOOL hasRChar = NSMaxRange(charRange) < [str length]; + + //suggest tags only if the suggestion-range borders a tag-separating character; if at the end/beginning of a string, check the other side + if (NSEqualRanges(charRange, NSMakeRange(0, [str length])) || + (hasLChar && hasRChar && CharIndexIsMember(charRange.location - 1) && CharIndexIsMember(NSMaxRange(charRange))) || + (hasLChar && NSMaxRange(charRange) == [str length] && CharIndexIsMember(charRange.location - 1)) || + (hasRChar && charRange.location == 0 && CharIndexIsMember(NSMaxRange(charRange)))) { + + getCompletions: + { + NSSet *existingWordSet = [NSSet setWithArray:[[aTextView string] labelCompatibleWords]]; + NSArray *tags = [labelsListSource labelTitlesPrefixedByString:[[aTextView string] substringWithRange:charRange] + indexOfSelectedItem:anIndex minusWordSet:existingWordSet]; + return tags; + } + } + } + return [NSArray array]; +} + + +- (BOOL)eventIsTagEdit:(NSEvent*)event forColumn:(NSInteger)columnIndex row:(NSInteger)rowIndex { + //is it a mouse event? is it within the tags area? + //is it a keyboard event? is it command-shift-t? + + if (![globalPrefs horizontalLayout]) + return NO; + + NSEventType type = [event type]; + if (type == NSLeftMouseDown || type == NSLeftMouseUp) { + + NSPoint p = [self convertPoint:[event locationInWindow] fromView:nil]; + + //mouse is inside this column's row's cell's tags frame + UnifiedCell *cell = [[[self tableColumns] objectAtIndex:columnIndex] dataCellForRow:rowIndex]; + NSRect tagCellRect = [cell nv_tagsRectForFrame:[self frameOfCellAtColumn:columnIndex row:rowIndex] andImage:nil]; + + return [self mouse:p inRect:tagCellRect]; + + } else if (type == NSKeyDown) { + + //activated either using the shortcut or using tab, when there was already an editor, and the last event invoked rename + //checking for the keyboard equivalent here is redundant in theory + + return ([event firstCharacter] == 't' && ([event modifierFlags] & (NSShiftKeyMask | NSCommandKeyMask)) != 0) || + ([event firstCharacter] == NSTabCharacter && !lastEventActivatedTagEdit && [self currentEditor]); + } + + return NO; +} + +- (SEL)attributeSetterForColumn:(NoteAttributeColumn*)col { + if ([globalPrefs horizontalLayout] && [self columnWithIdentifier:[col identifier]] == 0) { + return lastEventActivatedTagEdit ? @selector(setLabelString:) : @selector(setTitleString:); + } + return columnAttributeMutator(col); +} + +- (BOOL)lastEventActivatedTagEdit { + return lastEventActivatedTagEdit; +} + +- (void)editColumn:(NSInteger)columnIndex row:(NSInteger)rowIndex withEvent:(NSEvent *)event select:(BOOL)flag { + [[NSApp delegate] setIsEditing:YES]; + BOOL isTitleCol = [self columnWithIdentifier:NoteTitleColumnString] == columnIndex; + + //if event's mouselocation is inside rowIndex cell's tag rect and this edit is in horizontal mode in the title column + BOOL tagsInTitleColumn = [globalPrefs horizontalLayout] && ((isTitleCol && [self eventIsTagEdit:event forColumn:columnIndex row:rowIndex]) || + SYNTHETIC_TAGS_COLUMN_INDEX == columnIndex); + + if ([self editedRow] == rowIndex && [self currentEditor]) { + //this row is currently being edited; finish editing before start it again anywhere else + [[self window] makeFirstResponder:self]; + } + lastEventActivatedTagEdit = tagsInTitleColumn; + + if (tagsInTitleColumn && !ColumnIsSet(NoteLabelsColumn, [globalPrefs tableColumnsBitmap])) { + [self addPermanentTableColumn:[self noteAttributeColumnForIdentifier:NoteLabelsColumnString]]; + } + + [super editColumn:tagsInTitleColumn ? 0 : columnIndex row:rowIndex withEvent:event select:flag]; //become/resignFirstResponder can't handle the field-editor case for row-highlighting style, so do it here: [self updateTitleDereferencorState]; //this is way easier and faster than a custom formatter! just change the title while we're editing! - if ([self columnWithIdentifier:NoteTitleColumnString] == columnIndex) { - //we're editing a title + if (isTitleCol || tagsInTitleColumn) { NoteObject *note = [(FastListDataSource*)[self dataSource] immutableObjects][rowIndex]; NSTextView *editor = (NSTextView*)[self currentEditor]; - [editor setString:titleOfNote(note)]; - if (flag) [editor setSelectedRange:NSMakeRange(0, [titleOfNote(note) length])]; - } + [editor setString: tagsInTitleColumn ? labelsOfNote(note) : titleOfNote(note)]; + + NSRange range = NSMakeRange(0, [[editor string] length]); +#if 0 + NoteAttributeColumn *col = [self noteAttributeColumnForIdentifier:NoteTitleColumnString]; + if (tagsInTitleColumn && dereferencingFunction(col) != unifiedCellSingleLineForNote) { + //the textview will comply! when editing tags, use a smaller font, right-aligned + [editor setAlignment:NSRightTextAlignment range:range]; + NSFont *smallerFont = [NSFont systemFontOfSize:[globalPrefs tableFontSize] - 1.0]; + [editor setFont:smallerFont range:range]; + NSMutableParagraphStyle *pstyle = [[[NSMutableParagraphStyle alloc] init] autorelease]; + [pstyle setAlignment:NSRightTextAlignment]; + [editor setTypingAttributes:[NSDictionary dictionaryWithObjectsAndKeys:pstyle, NSParagraphStyleAttributeName, smallerFont, NSFontAttributeName, nil]]; + } +#endif + + if (flag) [editor setSelectedRange:range]; + } } - (void)textDidEndEditing:(NSNotification *)aNotification { @@ -943,6 +1127,55 @@ - (void)cancelOperation:(id)sender { [[NSApp delegate] cancelOperation:sender]; } +- (void)textDidChange:(NSNotification *)aNotification { + + NSInteger col = [self editedColumn]; + if (col > -1 && [self attributeSetterForColumn:[[self tableColumns] objectAtIndex:col]] == @selector(setLabelString:)) { + //text changed while editing tags; autocomplete! + + NSTextView *editor = [aNotification object]; + //NSLog(@"isAutocompleting: %d, wasDeleting: %d", isAutocompleting, wasDeleting); + if (!isAutocompleting && !wasDeleting) { + isAutocompleting = YES; + [editor complete:self]; + isAutocompleting = NO; + } + } +} + +- (NSArray *)labelCompletionsForString:(NSString *)fieldString index:(int)index{ + NSRange charRange = [fieldString rangeOfString:fieldString]; + NSArray *tags = [NSArray arrayWithObject:@""]; + if (charRange.location != NSNotFound) { + if (!IsLeopardOrLater) + goto getCompletions; + + NSCharacterSet *set = [NSCharacterSet labelSeparatorCharacterSet]; + NSString *str = fieldString; +#define CharIndexIsMember(__index) ([set characterIsMember:[str characterAtIndex:(__index)]]) + + BOOL hasLChar = charRange.location > 0; + BOOL hasRChar = NSMaxRange(charRange) < [str length]; + + //suggest tags only if the suggestion-range borders a tag-separating character; if at the end/beginning of a string, check the other side + if (NSEqualRanges(charRange, NSMakeRange(0, [str length])) || + (hasLChar && hasRChar && CharIndexIsMember(charRange.location - 1) && CharIndexIsMember(NSMaxRange(charRange))) || + (hasLChar && NSMaxRange(charRange) == [str length] && CharIndexIsMember(charRange.location - 1)) || + (hasRChar && charRange.location == 0 && CharIndexIsMember(NSMaxRange(charRange)))) { + + getCompletions: + { + NSSet *existingWordSet = [NSSet setWithArray:[fieldString labelCompatibleWords]]; + tags = [labelsListSource labelTitlesPrefixedByString:[fieldString substringWithRange:charRange] + indexOfSelectedItem:index minusWordSet:existingWordSet]; + + //NSLog(@"tags is :%@",[tags description]); + } + } + } + return tags; +} + - (void)viewWillStartLiveResize { [self noteFirstVisibleRow]; } @@ -975,17 +1208,103 @@ - (void)noteFirstVisibleRow { } - (void)drawRect:(NSRect)rect { + //force fully live resizing of columns while resizing window [super drawRect:rect]; if (![self dataSource]) { NSSize size = [self bounds].size; + + BOOL didRotate = NO; NSPoint center = NSMakePoint(size.width / 2.0, size.height / 2.0); + if ((didRotate = loadStatusStringWidth + 10.0 > size.width)) { + + NSAffineTransform *translateTransform = [NSAffineTransform transform]; + [translateTransform translateXBy:center.x yBy:center.y]; + [translateTransform rotateByDegrees:90.0]; + [translateTransform translateXBy:-center.x yBy:-center.y]; + [NSGraphicsContext saveGraphicsState]; + [translateTransform concat]; + } - [loadStatusString drawAtPoint:NSMakePoint(center.x - loadStatusStringWidth/2.0, - center.y - STATUS_STRING_FONT_SIZE/2.0) + [loadStatusString drawAtPoint:NSMakePoint(center.x - loadStatusStringWidth/2.0, center.y - STATUS_STRING_FONT_SIZE/2.0) withAttributes:loadStatusAttributes]; + + if (didRotate) [NSGraphicsContext restoreGraphicsState]; + } +} + +# pragma mark elasticthreads work +- (void)flagsChanged:(NSEvent *)theEvent{ + [[NSApp delegate] flagsChanged:theEvent]; +} + +- (void)setBackgroundColor:(NSColor *)color{ + [super setBackgroundColor:color]; + [NotesTableHeaderCell setBackgroundColor:color]; + CGFloat fWhite; + fWhite = [[color colorUsingColorSpaceName:NSCalibratedWhiteColorSpace] whiteComponent]; + if (fWhite < 0.75f) { + if (fWhite<0.25f) { + fWhite += 0.22f; + }else { + fWhite += 0.16f; + } + }else { + fWhite -= 0.20f; + } + if ([globalPrefs showGrid]) { + [self setGridColor:[NSColor colorWithCalibratedWhite:fWhite alpha:1.0f]]; + } else { + [self setGridColor:[NSColor colorWithCalibratedWhite:fWhite alpha:0.0f]]; + } +} + +# pragma mark alternating rows (Brett) +- (void)highlightSelectionInClipRect:(NSRect)clipRect +{ + CGFloat fWhite; + CGFloat endWhite; + CGFloat fAlpha; + NSColor *backgroundColor = [[self delegate] backgrndColor]; + + NSColor *gBack = [backgroundColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace]; + NSColor *evenColor = backgroundColor; + NSColor *oddColor = backgroundColor; + [gBack getWhite:&fWhite alpha:&fAlpha]; + if ([globalPrefs alternatingRows]) { + if (fWhite < 0.5f) { + endWhite = fWhite + 0.25f; + oddColor = [backgroundColor blendedColorWithFraction:0.05f ofColor:[NSColor whiteColor]]; + } else { + endWhite = fWhite-0.28f; + oddColor = [backgroundColor blendedColorWithFraction:0.05f ofColor:[NSColor blackColor]]; + } } + float rowHeight = [self rowHeight] + [self intercellSpacing].height; + NSRect visibleRect = [self visibleRect]; + NSRect highlightRect; + + highlightRect.origin = NSMakePoint( + NSMinX(visibleRect), + (int)(NSMinY(clipRect)/rowHeight)*rowHeight); + highlightRect.size = NSMakeSize( + NSWidth(visibleRect), + rowHeight - [self intercellSpacing].height); + + while (NSMinY(highlightRect) < NSMaxY(clipRect)) + { + NSRect clippedHighlightRect + = NSIntersectionRect(highlightRect, clipRect); + int row = (int) + ((NSMinY(highlightRect)+rowHeight/2.0)/rowHeight); + NSColor *rowColor = (0 == row % 2) ? evenColor : oddColor; + [rowColor set]; + NSRectFill(clippedHighlightRect); + highlightRect.origin.y += rowHeight; + } + + [super highlightSelectionInClipRect: clipRect]; } @end diff --git a/PTHotKeys/PTHotKeyCenter.m b/PTHotKeys/PTHotKeyCenter.m index b56fce0f..51ee39d3 100755 --- a/PTHotKeys/PTHotKeyCenter.m +++ b/PTHotKeys/PTHotKeyCenter.m @@ -104,7 +104,6 @@ - (BOOL)registerHotKey: (PTHotKey*)hotKey - (void)unregisterHotKey: (PTHotKey*)hotKey { //NSLog(@"unregisterHotKey: %@", hotKey); - OSStatus err; EventHotKeyRef carbonHotKey; if(![mHotKeys objectForKey:[hotKey name]]) @@ -113,7 +112,7 @@ - (void)unregisterHotKey: (PTHotKey*)hotKey carbonHotKey = [hotKey carbonHotKey]; NSAssert( carbonHotKey != nil, @"" ); - err = UnregisterEventHotKey( carbonHotKey ); + (void)UnregisterEventHotKey( carbonHotKey ); //Watch as we ignore 'err': [mHotKeys removeObjectForKey: [hotKey name]]; diff --git a/PTHotKeys/PTKeyBroadcaster.h b/PTHotKeys/PTKeyBroadcaster.h index 0894a23a..74f6d2c7 100755 --- a/PTHotKeys/PTKeyBroadcaster.h +++ b/PTHotKeys/PTKeyBroadcaster.h @@ -17,4 +17,4 @@ @end -__private_extern__ NSString* PTKeyBroadcasterKeyEvent; //keys: keyCombo as PTKeyCombo \ No newline at end of file +__private_extern__ NSString* PTKeyBroadcasterKeyEvent; //keys: keyCombo as PTKeyCombo diff --git a/PTHotKeys/PTKeyCombo.h b/PTHotKeys/PTKeyCombo.h index 6f380e37..21b24158 100755 --- a/PTHotKeys/PTKeyCombo.h +++ b/PTHotKeys/PTKeyCombo.h @@ -36,4 +36,4 @@ - (NSString*)description; -@end \ No newline at end of file +@end diff --git a/PTHotKeys/PTKeyCombo.m b/PTHotKeys/PTKeyCombo.m index a8d7687d..0a3ad3cb 100755 --- a/PTHotKeys/PTKeyCombo.m +++ b/PTHotKeys/PTKeyCombo.m @@ -175,4 +175,4 @@ - (NSString*)description return desc; } -@end \ No newline at end of file +@end diff --git a/PTHotKeys/PTKeyComboPanel.h b/PTHotKeys/PTKeyComboPanel.h index a9a4107b..9923d60b 100755 --- a/PTHotKeys/PTKeyComboPanel.h +++ b/PTHotKeys/PTKeyComboPanel.h @@ -45,4 +45,4 @@ @interface PTKeyComboPanel (ModalDelegate) - (void)keyComboPanelEnded:(PTKeyComboPanel*)panel; -@end \ No newline at end of file +@end diff --git a/PassphraseChanger.m b/PassphraseChanger.m index a2f80d03..7853f507 100755 --- a/PassphraseChanger.m +++ b/PassphraseChanger.m @@ -13,7 +13,6 @@ #import "PassphraseChanger.h" #import "NotationPrefs.h" #import "KeyDerivationManager.h" -#import @implementation PassphraseChanger @@ -124,9 +123,7 @@ - (void)showAroundWindow:(NSWindow*)window { [currentPasswordField selectText:nil]; [okChangeButton setEnabled:NO]; - - EnableSecureEventInput(); - + [NSApp beginSheet:changePassphraseWindow modalForWindow:window modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:NULL]; } @@ -135,8 +132,6 @@ - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(vo [newPasswordField setStringValue:@""]; [verifyChangedPasswordField setStringValue:@""]; [currentPasswordField setStringValue:@""]; - - DisableSecureEventInput(); } - (void)textDidChange:(NSNotification *)aNotification { diff --git a/PassphrasePicker.h b/PassphrasePicker.h index e936f6c4..7ba5b6c2 100755 --- a/PassphrasePicker.h +++ b/PassphrasePicker.h @@ -45,4 +45,4 @@ @interface NSObject (PassphrasePickerDelegate) - (void)passphrasePicker:(PassphrasePicker*)picker choseAPassphrase:(BOOL)success; -@end \ No newline at end of file +@end diff --git a/PassphrasePicker.m b/PassphrasePicker.m index 7815155f..5d06c6d2 100755 --- a/PassphrasePicker.m +++ b/PassphrasePicker.m @@ -13,7 +13,6 @@ #import "PassphrasePicker.h" #import "NotationPrefs.h" #import "KeyDerivationManager.h" -#import @implementation PassphrasePicker @@ -89,8 +88,6 @@ - (void)showAroundWindow:(NSWindow*)mainWindow resultDelegate:(id)aDelegate { [newPasswordField selectText:nil]; [okNewButton setEnabled:NO]; - - EnableSecureEventInput(); [NSApp beginSheet:newPassphraseWindow modalForWindow:mainWindow modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:NULL]; @@ -99,9 +96,7 @@ - (void)showAroundWindow:(NSWindow*)mainWindow resultDelegate:(id)aDelegate { - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { [newPasswordField setStringValue:@""]; [verifyNewPasswordField setStringValue:@""]; - - DisableSecureEventInput(); - + if ([resultDelegate respondsToSelector:@selector(passphrasePicker:choseAPassphrase:)]) [resultDelegate passphrasePicker:self choseAPassphrase:returnCode]; } diff --git a/PassphraseRetriever.m b/PassphraseRetriever.m index ecb0250f..c64296c4 100755 --- a/PassphraseRetriever.m +++ b/PassphraseRetriever.m @@ -15,7 +15,7 @@ #import "NotationPrefs.h" #import "NSData_transformations.h" #import "NSString_NV.h" -#import +#import "NSFileManager_NV.h" @implementation PassphraseRetriever @@ -56,7 +56,7 @@ - (int)loadedUserPassphraseData { FSRef notesDirectoryRef; if ([[[notationPrefs delegate] aliasDataForNoteDirectory] fsRefAsAlias:¬esDirectoryRef]) { - NSString *resolvedPath = [NSString pathWithFSRef:¬esDirectoryRef]; + NSString *resolvedPath = [[NSFileManager defaultManager] pathWithFSRef:¬esDirectoryRef]; if (resolvedPath) startingDirectory = resolvedPath; } [helpStringField setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Please enter the passphrase to access notes in %@.",nil), @@ -74,9 +74,7 @@ - (int)loadedUserPassphraseData { [rememberKeychainButton setState:[notationPrefs storesPasswordInKeychain]]; - EnableSecureEventInput(); int result = [NSApp runModalForWindow:window]; - DisableSecureEventInput(); [passphraseField setStringValue:@""]; [self textDidChange:nil]; diff --git a/PrefsWindowController.h b/PrefsWindowController.h index e23e98d3..00a7b3c0 100755 --- a/PrefsWindowController.h +++ b/PrefsWindowController.h @@ -17,7 +17,11 @@ @class NotationPrefsViewController; @class GlobalPrefs; -@interface PrefsWindowController : NSObject { +@interface PrefsWindowController : NSObject +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +#endif +{ IBOutlet NSPopUpButton *folderLocationsMenuButton; IBOutlet NSTextField *bodyTextFontField; IBOutlet NSMatrix *tabKeyRadioMatrix; @@ -32,37 +36,40 @@ IBOutlet NSButton *autoSuggestLinksButton; IBOutlet NSButton *softTabsButton; IBOutlet NSButton *makeURLsClickable; - IBOutlet NSButton *rtlButton; - IBOutlet NSButton *useMarkdownImportButton; - IBOutlet NSButton *useReadabilityButton; - IBOutlet NSColorWell *searchHighlightColorWell; - IBOutlet NSColorWell *notesListBackgroundColorWell; - IBOutlet NSButton *alternatingRowsButton; - + IBOutlet NSButton *highlightSearchTermsButton; + IBOutlet NSColorWell *searchHighlightColorWell, *foregroundColorWell, *backgroundColorWell; + IBOutlet NSButton *togDockButton; + IBOutlet NSTextField *togDockLabel; + IBOutlet NSSlider *maxWidthSlider; IBOutlet NotationPrefsViewController *notationPrefsViewController; - + IBOutlet NSComboBox *appList; + IBOutlet NSButton *useMarkdownImportButton; + IBOutlet NSButton *useReadabilityButton; + IBOutlet NSButton *showGridButton; + IBOutlet NSButton *altRowsButton; NSMutableParagraphStyle *centerStyle; NSMutableDictionary *items; NSToolbar *toolbar; BOOL fontPanelWasOpen; IBOutlet NSWindow *window; - IBOutlet NSView *editingView, *generalView, *databaseView, *notationPrefsView; - + IBOutlet NSView *editingView, *generalView, *fontsColorsView, *databaseView, *notationPrefsView; + IBOutlet NSButton *rtlButton; + GlobalPrefs *prefsController; } - (void)showWindow:(id)sender; +- (IBAction)changedBackgroundTextColorWell:(id)sender; +- (IBAction)changedForegroundTextColorWell:(id)sender; +- (IBAction)changedHighlightSearchTerms:(id)sender; - (IBAction)changedSearchHighlightColorWell:(id)sender; -- (IBAction)changedNotesListBackgroundColorWell:(id)sender; - (IBAction)changedMakeURLsClickable:(id)sender; -- (IBAction)changedRTL:(id)sender; -- (IBAction)changedUseMarkdownImport:(id)sender; -- (IBAction)changedUseReadability:(id)sender; - (IBAction)changedStyledTextBehavior:(id)sender; - (IBAction)changedAutoSuggestLinks:(id)sender; - (IBAction)setAppShortcut:(id)sender; - (IBAction)changeBodyFont:(id)sender; +- (IBAction)changedRTL:(id)sender; - (void)previewNoteBodyFont; - (IBAction)changedNoteDeletion:(id)sender; - (IBAction)changedNotesFolderLocation:(id)sender; @@ -72,7 +79,10 @@ - (IBAction)changedTableText:(id)sender; - (IBAction)changedTitleCompletion:(id)sender; - (IBAction)changedSoftTabs:(id)sender; -- (IBAction)changedAlternatingRows:(id)sender; +- (IBAction)changedUseMarkdownImport:(id)sender; +- (IBAction)changedUseReadability:(id)sender; +- (IBAction)changedShowGrid:(id)sender; +- (IBAction)changedAltRows:(id)sender; - (NSMenu*)directorySelectionMenu; - (void)changeDefaultDirectory; @@ -83,4 +93,11 @@ - (void)addToolbarItemWithName:(NSString*)name; - (void)switchViews:(NSToolbarItem *)item; NSRect ScaleRectWithFactor(NSRect rect, float factor); +- (IBAction)toggleHideDockIcon:(id)sender; +- (IBAction)toggleKeepsTextWidthInWindow:(id)sender; +- (IBAction)setMaxWidth:(id)sender; +- (void)relaunchNV:(id)sender; +- (void)reActivate:(id)sender; +- (void)updateAppList:(id)sender; + @end diff --git a/PrefsWindowController.m b/PrefsWindowController.m index 8e77b809..60a41b9a 100755 --- a/PrefsWindowController.m +++ b/PrefsWindowController.m @@ -9,16 +9,16 @@ - Neither the name of Notational Velocity nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. */ - +#import "AppController.h" #import "PrefsWindowController.h" #import "PTKeyComboPanel.h" #import "PTKeyCombo.h" #import "NotationPrefsViewController.h" #import "NSData_transformations.h" #import "NSString_NV.h" +#import "NSFileManager_NV.h" #import "NotationPrefs.h" #import "GlobalPrefs.h" -#import "AppController.h" #define SYSTEM_LIST_FONT_SIZE 12.0f @@ -29,13 +29,16 @@ - (id)init { prefsController = [GlobalPrefs defaultPrefs]; fontPanelWasOpen = NO; - [prefsController registerForSettingChange:@selector(resolveNoteBodyFontFromNotationPrefsFromSender:) withTarget:self]; - [prefsController registerForSettingChange:@selector(setCheckSpellingAsYouType:sender:) withTarget:self]; + [prefsController registerWithTarget:self forChangesInSettings: + @selector(resolveNoteBodyFontFromNotationPrefsFromSender:), + @selector(setCheckSpellingAsYouType:sender:), + @selector(setConfirmNoteDeletion:sender:), nil]; } return self; } - (void)showWindow:(id)sender { + //NSLog(@"showwin"); if (!window) { if (![NSBundle loadNibNamed:@"Preferences" owner:self]) { NSLog(@"Failed to load Preferences.nib"); @@ -46,6 +49,26 @@ - (void)showWindow:(id)sender { if (![window isVisible]) [window center]; + NSArray *appArray = [[NSApp delegate] getTxtAppList]; + // NSArray *appArray = nil; + if (appArray) { + if ((![appList numberOfItems]>0)||(![[appList objectValues] isEqualToArray:appArray])) { + [appList removeAllItems]; + [appList addItemsWithObjectValues:appArray]; + NSString *defApp = [prefsController textEditor]; + if ((![appArray containsObject:defApp])&&(![defApp isEqualToString:@"Default"])) { + defApp = @"Default"; + [prefsController setTextEditor:@"Default"]; + } + if ([defApp isEqualToString:@"Default"]) { + [appList selectItemAtIndex:0]; + }else{ + [appList selectItemWithObjectValue:defApp]; + } + } + } + + [window makeKeyAndOrderFront:self]; } @@ -137,16 +160,17 @@ - (void)previewNoteBodyFont { } +- (IBAction)changedBackgroundTextColorWell:(id)sender { + [prefsController setBackgroundTextColor:[backgroundColorWell color] sender:self]; +} +- (IBAction)changedForegroundTextColorWell:(id)sender { + [prefsController setForegroundTextColor:[foregroundColorWell color] sender:self]; +} - (IBAction)changedSearchHighlightColorWell:(id)sender { [prefsController setSearchTermHighlightColor:[searchHighlightColorWell color] sender:self]; } -- (IBAction)changedNotesListBackgroundColorWell:(id)sender { - [prefsController setNotesListBackgroundColor:[notesListBackgroundColorWell color] sender:self]; - [[NSApp delegate] updateScheme]; -} -- (IBAction)changedAlternatingRows:(id)sender { - [prefsController setAlternatingRows:[alternatingRowsButton state] sender:self]; - [[NSApp delegate] updateScheme]; +- (IBAction)changedHighlightSearchTerms:(id)sender { + [prefsController setShouldHighlightSearchTerms:[highlightSearchTermsButton state] sender:self]; } - (IBAction)changedStyledTextBehavior:(id)sender { [prefsController setPastePreservesStyle:[styledTextButton state] sender:self]; @@ -159,20 +183,6 @@ - (IBAction)changedMakeURLsClickable:(id)sender { [prefsController setMakeURLsClickable:[makeURLsClickable state] sender:self]; } -- (IBAction)changedRTL:(id)sender { - [prefsController setRTL:[rtlButton state] sender:self]; - [[NSApp delegate] updateRTL]; -} - -- (IBAction)changedUseMarkdownImport:(id)sender { - [prefsController setUseMarkdownImport:[useMarkdownImportButton state] sender:self]; - [useReadabilityButton setEnabled:[useMarkdownImportButton state]]; -} - -- (IBAction)changedUseReadability:(id)sender { - [prefsController setUseReadability:[useReadabilityButton state] sender:self]; -} - - (IBAction)changedNoteDeletion:(id)sender { [prefsController setConfirmNoteDeletion:[confirmDeletionButton state] sender:self]; } @@ -235,6 +245,8 @@ - (void)settingChangedForSelectorString:(NSString*)selectorString { [self previewNoteBodyFont]; } else if ([selectorString isEqualToString:SEL_STR(setCheckSpellingAsYouType:sender:)]) { [checkSpellingButton setState:[prefsController checkSpellingAsYouType]]; + } else if ([selectorString isEqualToString:SEL_STR(setConfirmNoteDeletion:sender:)]) { + [confirmDeletionButton setState:[prefsController confirmNoteDeletion]]; } } @@ -296,6 +308,11 @@ - (void)changeDefaultDirectory { [folderLocationsMenuButton selectItemAtIndex:0]; } +- (IBAction)changedRTL:(id)sender { + [prefsController setRTL:[rtlButton state] sender:self]; + [[NSApp delegate] updateRTL]; +} + - (BOOL)getNewNotesRefFromOpenPanel:(FSRef*)notesDirectoryRef returnedPath:(NSString**)path { NSString *startingDirectory = nil; @@ -307,7 +324,7 @@ - (BOOL)getNewNotesRefFromOpenPanel:(FSRef*)notesDirectoryRef returnedPath:(NSSt FSRef currentNotesDirectoryRef; //resolve alias to fsref; get path from fsref if ([[prefsController aliasDataForDefaultDirectory] fsRefAsAlias:¤tNotesDirectoryRef]) { - NSString *resolvedPath = [NSString pathWithFSRef:¤tNotesDirectoryRef]; + NSString *resolvedPath = [[NSFileManager defaultManager] pathWithFSRef:¤tNotesDirectoryRef]; if (resolvedPath) startingDirectory = resolvedPath; } @@ -392,25 +409,46 @@ - (void)awakeFromNib { [checkSpellingButton setState:[prefsController checkSpellingAsYouType]]; [confirmDeletionButton setState:[prefsController confirmNoteDeletion]]; [quitWhenClosingButton setState:[prefsController quitWhenClosingWindow]]; - [alternatingRowsButton setState:[prefsController alternatingRows]]; [styledTextButton setState:[prefsController pastePreservesStyle]]; [autoSuggestLinksButton setState:[prefsController linksAutoSuggested]]; [softTabsButton setState:[prefsController softTabs]]; [makeURLsClickable setState:[prefsController URLsAreClickable]]; - [rtlButton setState:[prefsController rtl]]; + [rtlButton setState:[prefsController rtl]]; + [self previewNoteBodyFont]; + [appShortcutField setStringValue:[[prefsController appActivationKeyCombo] description]]; + [searchHighlightColorWell setColor:[prefsController searchTermHighlightColorRaw:YES]]; + [highlightSearchTermsButton setState:[prefsController highlightSearchTerms]]; + [foregroundColorWell setColor:[prefsController foregroundTextColor]]; + [backgroundColorWell setColor:[prefsController backgroundTextColor]]; + [maxWidthSlider setDoubleValue:[[NSUserDefaults standardUserDefaults] doubleForKey:@"NoteBodyMaxWidth"]]; + //for elasticthreads' hide dock icon option, check if OS compatible + if (IsSnowLeopardOrLater) { + [togDockButton setEnabled:YES]; + + if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"HideDockIcon"] isEqualToString:@"Hide Dock Icon"]) { + [togDockLabel setStringValue:@"This will immediately restart NV"]; + }else { + [togDockLabel setStringValue:@""]; + } + + }else { + [togDockButton setEnabled:NO]; + [togDockLabel setStringValue:@"Sorry, requires Snow Leopard"]; + } + //for Brett's Markdownify/Readability import [useMarkdownImportButton setState:[prefsController useMarkdownImport]]; [useReadabilityButton setState:[prefsController useReadability]]; [useReadabilityButton setEnabled:[useMarkdownImportButton state]]; - [searchHighlightColorWell setColor:[prefsController searchTermHighlightColor]]; - [notesListBackgroundColorWell setColor:[prefsController notesListBackgroundColor]]; - [self previewNoteBodyFont]; - [appShortcutField setStringValue:[[prefsController appActivationKeyCombo] description]]; + + [altRowsButton setState:[prefsController alternatingRows]]; + [showGridButton setState:[prefsController showGrid]]; items = [[NSMutableDictionary alloc] init]; [self addToolbarItemWithName:@"General"]; [self addToolbarItemWithName:@"Notes"]; [self addToolbarItemWithName:@"Editing"]; + [self addToolbarItemWithName:@"Fonts & Colors"]; toolbar = [[NSToolbar alloc] initWithIdentifier:@"preferencePanes"]; [toolbar setDelegate:self]; @@ -435,7 +473,7 @@ - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)theToolbar { } - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)theToolbar { - return [NSArray arrayWithObjects:@"General", @"Notes", @"Editing", nil]; + return [NSArray arrayWithObjects:@"General", @"Notes", @"Editing", @"Fonts & Colors", nil]; } - (NSArray *)toolbarSelectableItemIdentifiers: (NSToolbar *)toolbar { @@ -464,7 +502,9 @@ - (void)switchViews:(NSToolbarItem *)item { prefsView = [self databaseView]; } else if([sender isEqualToString:@"Editing"]) { prefsView = editingView; - } else { + } else if([sender isEqualToString:@"Fonts & Colors"]) { + prefsView = fontsColorsView; + } else { NSLog(@"unknown sender: %@", sender); } @@ -510,4 +550,108 @@ NSRect ScaleRectWithFactor(NSRect rect, float factor) { return newRect; } +//elasticwork + +- (IBAction)toggleHideDockIcon:(id)sender{ + @try { + if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"HideDockIcon"] isEqualToString:@"Show Dock Icon"]) { + // Write new plist to file using dictionary + [NSApp hide:self]; + if((IsSnowLeopardOrLater)&&([[NSApplication sharedApplication] respondsToSelector: @selector(setActivationPolicy:)] )) { + enum {NSApplicationActivationPolicyRegular}; + [[NSApplication sharedApplication] setActivationPolicy:NSApplicationActivationPolicyRegular]; + }else { + ProcessSerialNumber psn = { 0, kCurrentProcess }; + OSStatus returnCode = TransformProcessType(&psn, kProcessTransformToForegroundApplication); + if( returnCode != 0) { + NSLog(@"Could not bring the application to front. Error %d", returnCode); + } + } + + [[NSUserDefaults standardUserDefaults] setValue:@"Hide Dock Icon" forKey:@"HideDockIcon"]; + [togDockLabel setStringValue:@"This will immediately restart NV"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + [self performSelector:@selector(reActivate:) withObject:self afterDelay:.16]; + }else { + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"StatusBarItem"]; + [[NSUserDefaults standardUserDefaults] setValue:@"Show Dock Icon" forKey:@"HideDockIcon"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + [self performSelector:@selector(relaunchNV:) withObject:self afterDelay:.22]; + + } + } + @catch (NSException * e) { + NSLog(@"oops1 >%@<",[e name]); + } +} + +- (void)reActivate:(id)sender{ + [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; + +} + +- (void)relaunchNV:(id)sender{ + id fullPath = [[NSBundle mainBundle] executablePath]; + NSArray *arg = [NSArray arrayWithObjects:nil]; + [NSTask launchedTaskWithLaunchPath:fullPath arguments:arg]; + [NSApp terminate:self]; +} + +- (IBAction)toggleKeepsTextWidthInWindow:(id)sender{ + [[NSApp delegate] setMaxNoteBodyWidth]; +} + +- (void)updateAppList:(id)sender{ + NSArray *appArr = [[NSApp delegate] getTxtAppList]; + NSString *defApp = [appList objectValueOfSelectedItem]; + if ((![[appList objectValues] isEqualToArray:appArr])||(![appArr containsObject:defApp])) { + [appList removeAllItems]; + [appList addItemsWithObjectValues:appArr]; + [prefsController setTextEditor:@"Default"]; + [appList selectItemAtIndex:0]; + } +} + +- (IBAction)setMaxWidth:(id)sender{ + double dbWidth = [maxWidthSlider doubleValue]; + dbWidth = dbWidth - fmod(dbWidth,2.0); + int theWidth = (int) dbWidth; + [prefsController setMaxNoteBodyWidth:theWidth]; + [[NSApp delegate] setMaxNoteBodyWidth]; +} + +- (IBAction)changedUseMarkdownImport:(id)sender { + [prefsController setUseMarkdownImport:[useMarkdownImportButton state] sender:self]; + [useReadabilityButton setEnabled:[useMarkdownImportButton state]]; +} + +- (IBAction)changedUseReadability:(id)sender { + [prefsController setUseReadability:[useReadabilityButton state] sender:self]; +} + +- (IBAction)changedAltRows:(id)sender { + [prefsController setAlternatingRows:[altRowsButton state] sender:self]; + [[NSApp delegate] refreshNotesList]; +} + +- (IBAction)changedShowGrid:(id)sender { + [prefsController setShowGrid:[showGridButton state] sender:self]; + [[NSApp delegate] refreshNotesList]; +} + +//delegate methods for text editor application combobox +- (void)comboBoxSelectionDidChange:(NSNotification *)notification{ + NSString *defApp = [appList objectValueOfSelectedItem]; + if (defApp) { + if ([defApp hasPrefix:@"Default"]) { + defApp = @"Default"; + } + [prefsController setTextEditor:defApp]; + } +} + +- (void)comboBoxWillPopUp:(NSNotification *)notification{ + [self updateAppList:self]; +} + @end diff --git a/PreviewController.h b/PreviewController.h index 82c2936a..cb73b856 100755 --- a/PreviewController.h +++ b/PreviewController.h @@ -11,30 +11,36 @@ @class AppController; @class NoteObject; +@class ETTransparentButton; @interface PreviewController : NSWindowController { - IBOutlet WebView *preview; + IBOutlet WebView *preview; IBOutlet NSTextView *sourceView; IBOutlet NSTabView *tabView; IBOutlet NSButton *tabSwitcher; IBOutlet NSButton *shareButton; - IBOutlet NSButton *viewOnWebButton; - BOOL isPreviewOutdated; + IBOutlet NSButton *saveButton; + IBOutlet NSButton *stickyPreviewButton; + IBOutlet NSButton *printPreviewButton; + ETTransparentButton *viewOnWebButton; + BOOL isPreviewOutdated; + BOOL isPreviewSticky; NSMutableData *receivedData; - //IBOutlet NSPanel *wnd; +// IBOutlet NSWindow *wnd; MAAttachedWindow *attachedWindow; MAAttachedWindow *confirmWindow; IBOutlet NSTextField *urlTextField; IBOutlet NSView *shareNotification; IBOutlet NSView *shareConfirmation; - IBOutlet NSButton *shareCancel; - IBOutlet NSButton *shareConfirm; + ETTransparentButton *shareCancel; + ETTransparentButton *shareConfirm; NSString *shareURL; NSString *cssString; NSString *htmlString; IBOutlet NSButton *includeTemplate; + IBOutlet NSTextField *templateNote; IBOutlet NSView *accessoryView; NoteObject *lastNote; @@ -42,6 +48,7 @@ @property (assign) BOOL isPreviewOutdated; @property (retain) WebView *preview; +@property (assign) BOOL isPreviewSticky; -(IBAction)saveHTML:(id)sender; -(IBAction)switchTabs:(id)sender; @@ -49,6 +56,10 @@ -(IBAction)shareAsk:(id)sender; -(IBAction)cancelShare:(id)sender; +-(IBAction)makePreviewSticky:(id)sender; +-(IBAction)makePreviewNotSticky:(id)sender; +-(IBAction)printPreview:(id)sender; +-(BOOL)previewIsVisible; -(void)togglePreview:(id)sender; -(void)requestPreviewUpdate:(NSNotification *)notification; +(void)createCustomFiles; diff --git a/PreviewController.m b/PreviewController.m index 8b67e8c0..85e1cf91 100755 --- a/PreviewController.m +++ b/PreviewController.m @@ -11,6 +11,10 @@ #import "NSString_MultiMarkdown.h" #import "NSString_Markdown.h" #import "NSString_Textile.h" +#import "NoteObject.h" +#import "ETTransparentButtonCell.h" +#import "ETTransparentButton.h" +#import "BTTransparentScroller.h" #define kDefaultMarkupPreviewVisible @"markupPreviewVisible" @@ -45,6 +49,7 @@ @implementation PreviewController @synthesize preview; @synthesize isPreviewOutdated; +@synthesize isPreviewSticky; +(void)initialize { @@ -58,14 +63,87 @@ -(id)init { if ((self = [super initWithWindowNibName:@"MarkupPreview" owner:self])) { self.isPreviewOutdated = YES; + self.isPreviewSticky = NO; [[self class] createCustomFiles]; BOOL showPreviewWindow = [[NSUserDefaults standardUserDefaults] boolForKey:kDefaultMarkupPreviewVisible]; if (showPreviewWindow) { [[self window] orderFront:self]; } - [sourceView setTextContainerInset:NSMakeSize(20,20)]; - [tabView selectTabViewItem:[tabView tabViewItemAtIndex:0]]; - [tabSwitcher setTitle:@"View Source"]; + + NSRect shCon = [[[self window] contentView]visibleRect]; + shCon.origin.x +=20; + shCon.origin.y -= 2; + shCon.size.width = 99; + shCon.size.height = 28; +// tabSwitcher = [[[ETTransparentButton alloc]initWithFrame:shCon] retain]; +// shCon.origin.x = [[[self window] contentView]visibleRect].origin.x + [[[self window] contentView]visibleRect].size.width - 80; +// shCon.size.width = 56; +// saveButton = [[[ETTransparentButton alloc]initWithFrame:shCon] retain]; +// shCon.origin.x -= 65; +// shareButton = [[[ETTransparentButton alloc]initWithFrame:shCon] retain]; +// shCon.origin.x -= 65; +// stickyPreviewButton = [[[ETTransparentButton alloc]initWithFrame:shCon] retain]; +// shCon.origin.x -= 65; +// printPreviewButton = [[[ETTransparentButton alloc]initWithFrame:shCon] retain]; +// [tabSwitcher setTitle:@"View Source"]; +// [tabSwitcher setTarget:self]; +// [tabSwitcher setAction:@selector(switchTabs:)]; +// [tabSwitcher setAutoresizingMask:NSViewMaxXMargin]; +// [shareButton setTitle:@"Share"]; +// [shareButton setToolTip:@"Make this note available to the public on Peg.gd"]; +// [shareButton setTarget:self]; +// [shareButton setAction:@selector(shareAsk:)]; +// [shareButton setAutoresizingMask:NSViewMinXMargin]; +// [saveButton setTitle:@"Save"]; +// [saveButton setToolTip:@"Save the current preview as an HTML file"]; +// [saveButton setTarget:self]; +// [saveButton setAction:@selector(saveHTML:)]; +// [saveButton setAutoresizingMask:NSViewMinXMargin]; +// [stickyPreviewButton setTitle:@"Stick"]; +// [stickyPreviewButton setToolTip:@"Maintain current note in Preview, even if you switch to other notes."]; +// [stickyPreviewButton setTarget:self]; +// [stickyPreviewButton setAction:@selector(makePreviewSticky:)]; +// [stickyPreviewButton setAutoresizingMask:NSViewMinXMargin]; +// [printPreviewButton setTitle:@"Print"]; +// [printPreviewButton setToolTip:@"Print to Printer or PDF."]; +// [printPreviewButton setTarget:self]; +// [printPreviewButton setAction:@selector(printPreview:)]; +// [printPreviewButton setAutoresizingMask:NSViewMinXMargin]; +// [[[self window] contentView] addSubview:tabSwitcher]; +// [[[self window] contentView] addSubview:shareButton]; +// [[[self window] contentView] addSubview:saveButton]; +// [[[self window] contentView] addSubview:stickyPreviewButton]; +// [[[self window] contentView] addSubview:printPreviewButton]; + [tabView selectTabViewItem:[tabView tabViewItemAtIndex:0]]; + + shCon = [shareConfirmation visibleRect]; + shCon.origin.x = shCon.size.width - 106; + shCon.origin.y = 1; + shCon.size.width = 81; + shCon.size.height = 28; + shareConfirm = [[[ETTransparentButton alloc]initWithFrame:shCon] retain]; + shCon.origin.x = [shareConfirmation visibleRect].origin.x + 25; + shareCancel = [[[ETTransparentButton alloc]initWithFrame:shCon] retain]; + [shareConfirm setTitle:@"Yes"]; + [shareConfirm setTarget:self]; + [shareConfirm setAction:@selector(shareNote:)]; + [shareCancel setTitle:@"No, thanks"]; + [shareCancel setTarget:self]; + [shareCancel setAction:@selector(cancelShare:)]; + [shareConfirmation addSubview:shareCancel]; + [shareConfirmation addSubview:shareConfirm]; + + shCon = [shareNotification visibleRect]; + shCon.size.width = 116; + shCon.size.height = 28; + shCon.origin.x = 70; + viewOnWebButton = [[[ETTransparentButton alloc]initWithFrame:shCon] retain]; + [viewOnWebButton setTitle:@"View in Browser"]; + [viewOnWebButton setTarget:self]; + [viewOnWebButton setAction:@selector(openShareURL:)]; + [shareNotification addSubview:viewOnWebButton]; + // [[[self window] contentView] setNeedsDisplay:YES]; + // [preview setPolicyDelegate:self]; // [preview setUIDelegate:self]; } @@ -73,11 +151,16 @@ -(id)init } -(void)awakeFromNib -{ - AppController *app = [[NSApplication sharedApplication] delegate];; +{ cssString = [[[self class] css] retain]; htmlString = [[[self class] html] retain]; - lastNote = [app selectedNoteObject]; + lastNote = [[NSApp delegate] selectedNoteObject]; + [sourceView setTextContainerInset:NSMakeSize(10.0,12.0)]; + if (!IsLionOrLater) { + // ETTransparentScroller *tScroll = [[[ETTransparentScroller alloc]init] retain]; + [[sourceView enclosingScrollView] setVerticalScroller:[[BTTransparentScroller alloc]init]]; + // [tScroll release]; + } } //this returns a nice name for the method in the JavaScript environment @@ -135,36 +218,46 @@ -(void)requestPreviewUpdate:(NSNotification *)notification self.isPreviewOutdated = YES; return; } + + if (self.isPreviewSticky) { + return; + } AppController *app = [notification object]; [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(preview:) object:app]; - [self performSelector:@selector(preview:) withObject:app afterDelay:0.5]; + [self performSelector:@selector(preview:) withObject:app afterDelay:0.3]; +} + +- (BOOL)previewIsVisible{ + return [[self window] isVisible]; } -(void)togglePreview:(id)sender { + NSWindow *wnd = [self window]; - if ([wnd isVisible]) { - if (attachedWindow) { - [[shareButton window] removeChildWindow:attachedWindow]; - [attachedWindow orderOut:self]; - [attachedWindow release]; - attachedWindow = nil; - [shareURL release]; - } - [wnd orderOut:self]; + if (attachedWindow) { + [[shareButton window] removeChildWindow:attachedWindow]; + [attachedWindow orderOut:self]; + [attachedWindow release]; + attachedWindow = nil; + [shareURL release]; + } +// // TODO: should the "stuck" note remain stuck when preview is closed? +// if (self.isPreviewSticky) +// [self makePreviewNotSticky:self]; + [wnd orderOut:self]; } else { - if (self.isPreviewOutdated) { - // TODO high coupling; too many assumptions on architecture: - [self performSelector:@selector(preview:) withObject:[[NSApplication sharedApplication] delegate] afterDelay:0.0]; - } - [tabView selectTabViewItem:[tabView tabViewItemAtIndex:0]]; - [tabSwitcher setTitle:@"View Source"]; - - [wnd orderFront:self]; - [wnd setLevel:NSScreenSaverWindowLevel]; + if (self.isPreviewOutdated) { + // TODO high coupling; too many assumptions on architecture: + [self performSelector:@selector(preview:) withObject:[[NSApplication sharedApplication] delegate] afterDelay:0.0]; + } + [tabView selectTabViewItem:[tabView tabViewItemAtIndex:0]]; + [tabSwitcher setTitle:@"View Source"]; + + [wnd orderFront:self]; } // save visibility to defaults @@ -176,6 +269,8 @@ -(void)windowWillClose:(NSNotification *)notification { [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:NO] forKey:kDefaultMarkupPreviewVisible]; + NSMenu *previewMenu = [[[NSApp mainMenu] itemWithTitle:@"Preview"] submenu]; + [[previewMenu itemWithTitle:@"Toggle Preview Window"]setState:0]; } +(NSString*)css { @@ -213,12 +308,15 @@ +(NSString*)html { -(void)preview:(id)object { + if (self.isPreviewSticky) { + return; + } NSString *lastScrollPosition = [[preview windowScriptObject] evaluateWebScript:@"document.getElementById('contentdiv').scrollTop"]; AppController *app = object; NSString *rawString = [app noteContent]; SEL mode = [self markupProcessorSelector:[app currentPreviewMode]]; NSString *processedString = [NSString performSelector:mode withObject:rawString]; - NSString *previewString = processedString; + NSString *previewString = processedString; NSMutableString *outputString = [NSMutableString stringWithString:(NSString *)htmlString]; NSString *noteTitle = ([app selectedNoteObject]) ? [NSString stringWithFormat:@"%@",titleOfNote([app selectedNoteObject])] : @""; @@ -273,7 +371,7 @@ + (void) createCustomFiles } if ([fileManager fileExistsAtPath:cssFile] == NO) { - NSString *cssString = @"body,p,td,div { font-family:Helvetica,Arial,sans-serif;line-height:1.4em;font-size:14px;color:#111; }\np { margin:0 0 1.7em 0; }\na { color:rgb(13,110,161);text-decoration:none;-webkit-transition:color .2s ease-in-out; }\na:hover { color:#3593d9; }\nh1.doctitle { background:#eee;font-size:14px;font-weight:bold;color:#333;line-height:25px;margin:0;padding:0 10px;border-bottom:solid 1px #aaa; }\nh1 { font-size:24px;color:#000;margin:12px 0 15px 0; }\nh2 { font-size:20px;color:#111;width:auto;margin:15px 0 10px 2px; }\nh2 em { line-height:1.6em;font-size:12px;color:#111;text-shadow:0 1px 0 #FFF;padding-left:10px; }\nh3 { font-size:20px;color:#111; }\nh4 { font-size:14px;color:#111;margin-bottom:1.3em; }\n.footnote { font-size:.8em;vertical-align:super;color:rgb(13,110,161); }\n#wrapper { background:#fff;position:fixed;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:inset 0px 0px 4px #8F8D87; }\n#contentdiv { position:fixed;top:27px;left:5px;right:5px;bottom:5px;background:transparent;color:#303030;overflow:auto;text-indent:0px;padding:10px; }\n#contentdiv::-webkit-scrollbar { width:6px; }\n#contentdiv::-webkit-scrollbar:horizontal { height:6px;display:none; }\n#contentdiv::-webkit-scrollbar-track { background:transparent;-webkit-border-radius:0;right:10px; }\n#contentdiv::-webkit-scrollbar-track:disabled { display:none; }\n#contentdiv::-webkit-scrollbar-thumb { border-width:0;min-height:20px;background:#777;opacity:0.4;-webkit-border-radius:5px; }"; + NSString *cssString = @"body,p,td,div { font-family:Helvetica,Arial,sans-serif;line-height:1.4em;font-size:14px;color:#111; }\np { margin:0 0 1.7em 0; }\na { color:rgb(13,110,161);text-decoration:none;-webkit-transition:color .2s ease-in-out; }\na:hover { color:#3593d9; }\nh1.doctitle { background:#eee;font-size:14px;font-weight:bold;color:#333;line-height:28px;margin:0;padding:0 10px;border-bottom:solid 1px #aaa;white-space:nowrap; }\nh1,h2,h3,h4,h5 {line-height:1.1em;}\nh1 { font-size:24px;color:#000;margin:12px 0 15px 0; }\nh2 { font-size:20px;color:#111;width:auto;margin:15px 0 10px 2px; }\nh2 em { line-height:1.6em;font-size:12px;color:#111;text-shadow:0 1px 0 #FFF;padding-left:10px; }\nh3 { font-size:20px;color:#111; }\nh4 { font-size:14px;color:#111;margin-bottom:1.3em; }\n.footnote { font-size:.8em;vertical-align:super;color:rgb(13,110,161); }\n#contentdiv img {max-width:100%;}\n@media print {\nbody {overflow: auto;}\n#wrapper { background:#fff;position:relative; }\n#contentdiv { position:relative;background:transparent;color:#303030;text-indent:0px;padding:10px; }\n}\n@media screen {\nbody {overflow: hidden;} \n#wrapper { background:#fff;position:fixed;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:inset 0px 0px 4px #8F8D87; }\n#contentdiv { position:fixed;top:27px;left:5px;right:5px;bottom:5px;background:transparent;color:#303030;overflow:auto;text-indent:0px;padding:10px; }\n#contentdiv::-webkit-scrollbar { width:6px; }\n#contentdiv::-webkit-scrollbar:horizontal { height:6px;display:none; }\n#contentdiv::-webkit-scrollbar-track { background:transparent;-webkit-border-radius:0;right:10px; }\n#contentdiv::-webkit-scrollbar-track:disabled { display:none; }\n#contentdiv::-webkit-scrollbar-thumb { border-width:0;min-height:20px;background:#777;opacity:0.4;-webkit-border-radius:5px; }\n}\nli>p {margin:0 0 1em;}\nul ul,ul ol {margin-bottom:1em;}\npre {white-space:pre-wrap;white-space:pre-line;}"; NSData *cssData = [NSData dataWithBytes:[cssString UTF8String] length:[cssString length]]; [fileManager createFileAtPath:cssFile contents:cssData attributes:nil]; @@ -298,28 +396,60 @@ - (NSString *)urlEncodeValue:(NSString *)str return [result autorelease]; } +-(IBAction)makePreviewSticky:(id)sender +{ + self.isPreviewSticky = YES; + [[preview window] setTitle:@"Locked"]; + [stickyPreviewButton setToolTip:@"Return the preview to normal functionality."]; + [stickyPreviewButton setAction:@selector(makePreviewNotSticky:)]; + [shareButton setEnabled:NO]; + [saveButton setEnabled:NO]; + [[self window] setHidesOnDeactivate:NO]; +} + +-(IBAction)makePreviewNotSticky:(id)sender +{ + self.isPreviewSticky = NO; + [[preview window] setTitle:@"Preview"]; + [stickyPreviewButton setToolTip:@"Maintain current note in Preview, even if you switch to other notes."]; + [stickyPreviewButton setAction:@selector(makePreviewSticky:)]; + [shareButton setEnabled:YES]; + [saveButton setEnabled:YES]; + self.isPreviewOutdated = YES; + [self performSelector:@selector(preview:) withObject:[[NSApplication sharedApplication] delegate] afterDelay:0.0]; + [[self window] setHidesOnDeactivate:YES]; +} + +-(IBAction)printPreview:(id)sender +{ + NSPrintInfo* printInfo = [NSPrintInfo sharedPrintInfo]; + + [printInfo setHorizontallyCentered:YES]; + [printInfo setVerticallyCentered:NO]; + [[[[preview mainFrame] frameView] documentView] print:nil]; +} -(IBAction)shareNote:(id)sender { - AppController *app = [[NSApplication sharedApplication] delegate]; + AppController *app = [NSApp delegate]; NSString *noteTitle = [NSString stringWithFormat:@"%@",titleOfNote([app selectedNoteObject])]; - NSString *rawString = [app noteContent]; - SEL mode = [self markupProcessorSelector:[app currentPreviewMode]]; - NSString *processedString = [NSString performSelector:mode withObject:rawString]; + NSString *rawString = [app noteContent]; + SEL mode = [self markupProcessorSelector:[app currentPreviewMode]]; + NSString *processedString = [NSString performSelector:mode withObject:rawString]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] - initWithURL: - [NSURL URLWithString:@"http://peg.gd/nvapi.php"]]; - [request setHTTPMethod:@"POST"]; - [request addValue:@"8bit" forHTTPHeaderField:@"Content-Transfer-Encoding"]; - [request addValue: [NSString stringWithFormat:@"multipart/form-data; boundary=%@",[NSString MIMEBoundary]] forHTTPHeaderField: @"Content-Type"]; - NSDictionary* postData = [NSDictionary dictionaryWithObjectsAndKeys: - @"8c4205ec33d8f6caeaaaa0c10a14138c", @"key", - noteTitle, @"title", - processedString, @"body", - nil]; - [request setHTTPBody: [[NSString multipartMIMEStringWithDictionary: postData] dataUsingEncoding: NSUTF8StringEncoding]]; + initWithURL: + [NSURL URLWithString:@"http://peg.gd/nvapi.php"]]; + [request setHTTPMethod:@"POST"]; + [request addValue:@"8bit" forHTTPHeaderField:@"Content-Transfer-Encoding"]; + [request addValue: [NSString stringWithFormat:@"multipart/form-data; boundary=%@",[NSString MIMEBoundary]] forHTTPHeaderField: @"Content-Type"]; + NSDictionary* postData = [NSDictionary dictionaryWithObjectsAndKeys: + @"8c4205ec33d8f6caeaaaa0c10a14138c", @"key", + noteTitle, @"title", + processedString, @"body", + nil]; + [request setHTTPBody: [[NSString multipartMIMEStringWithDictionary: postData] dataUsingEncoding: NSUTF8StringEncoding]]; NSHTTPURLResponse * response = nil; NSError * error = nil; NSData * responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; @@ -332,7 +462,7 @@ -(IBAction)shareNote:(id)sender } else { [self showShareURL:@"Error connecting" isError:YES]; } - + [request release]; } @@ -363,7 +493,7 @@ - (void)savePanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextI AppController *app = [[NSApplication sharedApplication] delegate]; NSString *rawString = [app noteContent]; NSString *processedString = [[NSString alloc] init]; - + if ([app currentPreviewMode] == MarkdownPreview) { processedString = [NSString stringWithProcessedMarkdown:rawString]; } else if ([app currentPreviewMode] == MultiMarkdownPreview) { @@ -371,11 +501,10 @@ - (void)savePanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextI } else if ([app currentPreviewMode] == TextilePreview) { processedString = ( [includeTemplate state] == NSOnState ) ? [NSString documentWithProcessedTextile:rawString] : [NSString xhtmlWithProcessedTextile:rawString]; } - - NSURL *file = [sheet URL]; - NSError *error; - [processedString writeToURL:file atomically:YES encoding:NSUTF8StringEncoding error:&error]; - } + NSURL *file = [sheet URL]; + NSError *error; + [processedString writeToURL:file atomically:YES encoding:NSUTF8StringEncoding error:&error]; + } } -(IBAction)saveHTML:(id)sender @@ -386,23 +515,38 @@ -(IBAction)saveHTML:(id)sender NSBeep(); return; } + } - // TODO high coupling; too many assumptions on architecture: - AppController *app = [[NSApplication sharedApplication] delegate]; + // TODO high coupling; too many assumptions on architecture: + AppController *app = [NSApp delegate]; - NSSavePanel *savePanel = [NSSavePanel savePanel]; + NSSavePanel *savePanel = [NSSavePanel savePanel]; [savePanel setAccessoryView:accessoryView]; [savePanel setCanCreateDirectories:YES]; [savePanel setCanSelectHiddenExtension:YES]; - NSArray *fileTypes = [[NSArray alloc] initWithObjects:@"html",@"xhtml",@"htm",nil]; - [savePanel setAllowedFileTypes:fileTypes]; - + NSArray *fileTypes = [[NSArray alloc] initWithObjects:@"html",@"xhtml",@"htm",nil]; + [savePanel setAllowedFileTypes:fileTypes]; + + + NSString *rawString = [app noteContent]; + NSString *xhtmlOutput = [NSString xhtmlWithProcessedMultiMarkdown:rawString]; + if ([xhtmlOutput hasPrefix:@"maxDimension)) { [[self splitView] setMustAdjust]; @@ -337,17 +322,22 @@ - (CGFloat)dimension { // Sets the current dimension of the subview, subject to the current maximum and minimum. // If the subview is collapsed, this will have an effect only after reexpanding. - (void)setDimension:(CGFloat)value { + if (valuemaxDimension) { + value = maxDimension; + } RBSplitView* sv = [self splitView]; NSSize size = [self frame].size; BOOL ishor = [sv isHorizontal]; if (DIM(size)>0.0) { -// We're not collapsed, set the size and adjust other subviews. + // We're not collapsed, set the size and adjust other subviews. DIM(size) = value; [self setFrameSize:size]; [sv adjustSubviewsExcepting:self]; } else { -// We're collapsed, adjust the fraction so that we'll have the (approximately) correct -// dimension after expanding. + // We're collapsed, adjust the fraction so that we'll have the (approximately) correct + // dimension after expanding. fraction = value/[sv RB___dimensionWithoutDividers]; } } @@ -385,6 +375,10 @@ - (BOOL)autoresizesSubviews { return YES; } +// ...and we don't want that to change under any circumstances. +- (void)setAutoresizesSubviews:(BOOL)flag { +} + // This is method is called automatically when the subview is resized; don't call it yourself. - (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize { RBSplitView* sv = [self splitView]; @@ -393,14 +387,14 @@ - (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize { NSRect frame = [self frame]; CGFloat dim = DIM(frame.size); CGFloat other = OTHER(frame.size); -// We resize subviews only when we're inside the subview's limits and the containing splitview's limits. + // We resize subviews only when we're inside the subview's limits and the containing splitview's limits. animationData* anim = [self RB___animationData:NO resize:NO]; if ((dim>=(anim&&!anim->resizing?anim->dimension:minDimension))&&(dim<=maxDimension)&&(other>=[sv minDimension])&&(other<=[sv maxDimension])) { if (notInLimits) { -// The subviews can be resized, so we restore the saved size. + // The subviews can be resized, so we restore the saved size. oldBoundsSize = savedSize; } -// We save the size every time the subview's subviews are resized within the limits. + // We save the size every time the subview's subviews are resized within the limits. notInLimits = NO; savedSize = frame.size; [super resizeSubviewsWithOldSize:oldBoundsSize]; @@ -415,7 +409,7 @@ - (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize { // to call this directly. - (CGFloat)changeDimensionBy:(CGFloat)increment mayCollapse:(BOOL)mayCollapse move:(BOOL)move { RBSplitView* sv = [self splitView]; - if (!sv||(fabsf(increment)<1.0)) { + if (!sv||(fabs(increment)<1.0)) { return 0.0; } BOOL ishor = [sv isHorizontal]; @@ -424,7 +418,7 @@ - (CGFloat)changeDimensionBy:(CGFloat)increment mayCollapse:(BOOL)mayCollapse mo CGFloat newdim = MAX(0.0,olddim+increment); if (newdimolddim) { if (olddim<1.0) { -// Expand if needed. + // Expand if needed. if (newdim>(minDimension*(0.5+HYSTERESIS))) { newdim = MAX(newdim,[self RB___expandAndSetToMinimum:YES]); } else { @@ -443,15 +437,15 @@ - (CGFloat)changeDimensionBy:(CGFloat)increment mayCollapse:(BOOL)mayCollapse mo newdim = maxDimension; } } - if ((NSInteger)newdim!=(NSInteger)olddim) { -// The dimension has changed. + if ((int)newdim!=(int)olddim) { + // The dimension has changed. increment = newdim-olddim; DIM(frame.size) = newdim; if (move) { DIM(frame.origin) -= increment; } -// We call super instead of self here to postpone adjusting subviews for nested splitviews. -// [super setFrameSize:frame.size]; + // We call super instead of self here to postpone adjusting subviews for nested splitviews. + // [super setFrameSize:frame.size]; [super setFrame:frame]; [sv RB___setMustClearFractions]; [sv setMustAdjust]; @@ -467,18 +461,18 @@ - (NSUInteger)numberOfSubviews { // We return the deepest subview that's hit by aPoint. We also check with the delegate if aPoint is // within an alternate drag view. - (NSView*)hitTest:(NSPoint)aPoint { - RBSplitView* sv = [self splitView]; if ([self mouse:aPoint inRect:[self frame]]) { + RBSplitView* sv = [self splitView]; id delegate = [sv delegate]; if ([delegate respondsToSelector:@selector(splitView:dividerForPoint:inSubview:)]) { actDivider = [delegate splitView:sv dividerForPoint:aPoint inSubview:self]; - if ((NSInteger)actDivider<(NSInteger)([sv RB___numberOfSubviews]-1)) { + if ((actDivider+1)<[sv RB___numberOfSubviews]) { return self; } } actDivider = NSNotFound; NSView* result = [super hitTest:aPoint]; - canDragWindow = ![result isOpaque]; + canDragWindow = ![[result opaqueAncestor] isDescendantOf:[[result window] contentView]]; return result; } return nil; @@ -490,33 +484,35 @@ - (void)mouseDown:(NSEvent*)theEvent { NSWindow* window = [self window]; NSPoint where = [theEvent locationInWindow]; if (actDivider=WAYOUT) { -// The subview was collapsed when encoded, so we correct the origin and collapse it. + // The subview was collapsed when encoded, so we correct the origin and collapse it. BOOL ishor = [self splitViewIsHorizontal]; previous.origin.x -= WAYOUT; DIM(previous.size) = 0.0; @@ -602,7 +598,7 @@ - (id)initWithCoder:(NSCoder*)coder { previous = NSZeroRect; if ([coder allowsKeyedCoding]) { [self setIdentifier:[coder decodeObjectForKey:@"identifier"]]; - tag = [coder decodeInt32ForKey:@"tag"]; + tag = [coder decodeIntegerForKey:@"tag"]; minDimension = [coder decodeDoubleForKey:@"minDimension"]; maxDimension = [coder decodeDoubleForKey:@"maxDimension"]; fraction = [coder decodeDoubleForKey:@"fraction"]; @@ -623,7 +619,7 @@ - (id)initWithCoder:(NSCoder*)coder { @implementation RBSplitSubview (RB___SubviewAdditions) -// This hides/shows the subview without calling adjustSubview. +// This hides/shows the subview without calling adjustSubviews. - (void)RB___setHidden:(BOOL)flag { [super setHidden:flag]; } @@ -634,21 +630,21 @@ - (void)RB___setHidden:(BOOL)flag { // one will be restarted). - (animationData*)RB___animationData:(BOOL)start resize:(BOOL)resize { if (currentAnimation&&(currentAnimation->owner!=self)) { -// There already is an animation in progress on some other subview. + // There already is an animation in progress on some other subview. return nil; } if (start) { -// We want to start (or restart) an animation. + // We want to start (or restart) an animation. RBSplitView* sv = [self splitView]; if (sv) { CGFloat dim = [self dimension]; -// First assume the default time, then ask the delegate. + // First assume the default time, then ask the delegate. NSTimeInterval total = dim*(0.2/150.0); id delegate = [sv delegate]; if ([delegate respondsToSelector:@selector(splitView:willAnimateSubview:withDimension:)]) { total = [delegate splitView:sv willAnimateSubview:self withDimension:dim]; } -// No use animating anything shorter than the frametime. + // No use animating anything shorter than the frametime. if (total>FRAMETIME) { if (!currentAnimation) { currentAnimation = (animationData*)malloc(sizeof(animationData)); @@ -682,17 +678,17 @@ - (void)RB___stepAnimation { NSTimeInterval remain = anim->finishTime-now; NSRect frame = [self frame]; BOOL ishor = [sv isHorizontal]; -// Continuing animation only makes sense if we still have at least FRAMETIME available. + // Continuing animation only makes sense if we still have at least FRAMETIME available. if (remain>=FRAMETIME) { CGFloat avg = anim->elapsedTime; -// We try to keep a record of how long it takes, on the average, to resize and adjust -// one animation frame. + // We try to keep a record of how long it takes, on the average, to resize and adjust + // one animation frame. if (anim->stepsDone) { avg /= anim->stepsDone; } NSTimeInterval delay = MIN(0.0,FRAMETIME-avg); -// We adjust the new dimension proportionally to how much of the designated time has passed. - CGFloat dim = floorf(anim->dimension*(remain-avg)/anim->totalTime); + // We adjust the new dimension proportionally to how much of the designated time has passed. + CGFloat dim = floor(anim->dimension*(remain-avg)/anim->totalTime); if (dim>4.0) { if (!anim->collapsing) { dim = anim->dimension-dim; @@ -703,13 +699,13 @@ - (void)RB___stepAnimation { [self display]; anim->elapsedTime += [NSDate timeIntervalSinceReferenceDate]-now; ++anim->stepsDone; -// Schedule a timer to do the next animation step. + // Schedule a timer to do the next animation step. [self performSelector:@selector(RB___stepAnimation) withObject:nil afterDelay:delay inModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode,NSModalPanelRunLoopMode, - NSEventTrackingRunLoopMode,nil]]; + NSEventTrackingRunLoopMode,nil]]; return; } } -// We're finished, either collapse or expand entirely now. + // We're finished, either collapse or expand entirely now. if (anim->collapsing) { DIM(frame.size) = 0.0; [self RB___finishCollapse:frame withFraction:anim->dimension/[sv RB___dimensionWithoutDividers]]; @@ -758,22 +754,22 @@ - (void)RB___copyIntoCache:(subviewCache*)cache { - (void)RB___updateFromCache:(subviewCache*)cache withTotalDimension:(CGFloat)value { CGFloat dim = [self RB___visibleDimension]; if (cache->size>=1.0) { -// New state is not collapsed. + // New state is not collapsed. if (dim>=1.0) { -// Old state was not collapsed, so we just change the frame. + // Old state was not collapsed, so we just change the frame. [self RB___setFrame:cache->rect withFraction:cache->fraction notify:YES]; } else { -// Old state was collapsed, so we expand it. + // Old state was collapsed, so we expand it. [self RB___finishExpand:cache->rect withFraction:cache->fraction]; } } else { -// New state is collapsed. + // New state is collapsed. if (dim>=1.0) { -// Old state was not collapsed, so we clear first responder and change the frame. + // Old state was not collapsed, so we clear first responder and change the frame. [self RB___clearResponder]; [self RB___finishCollapse:cache->rect withFraction:dim/value]; } else { -// It was collapsed already, but the frame may have changed, so we set it. + // It was collapsed already, but the frame may have changed, so we set it. [self RB___setFrame:cache->rect withFraction:cache->fraction notify:YES]; } } @@ -824,7 +820,7 @@ - (CGFloat)RB___collapse { NSRect frame = [self frame]; BOOL ishor = [sv isHorizontal]; result = DIM(frame.size); -// For collapsed views, fraction will contain the fraction of the dimension previously occupied + // For collapsed views, fraction will contain the fraction of the dimension previously occupied DIM(frame.size) = 0.0; [self RB___finishCollapse:frame withFraction:result/[sv RB___dimensionWithoutDividers]]; } @@ -861,10 +857,10 @@ - (CGFloat)RB___expandAndSetToMinimum:(BOOL)setToMinimum { result = DIM(frame.size) = minDimension; } else { result = [sv RB___dimensionWithoutDividers]*frac; -// We need to apply a compensation factor for proportional resizing in adjustSubviews. - CGFloat newdim = floorf((frac>=1.0)?result:result/(1.0-frac)); + // We need to apply a compensation factor for proportional resizing in adjustSubviews. + CGFloat newdim = floor((frac>=1.0)?result:result/(1.0-frac)); DIM(frame.size) = newdim; - result = floorf(result); + result = floor(result); } [self RB___finishExpand:frame withFraction:0.0]; } @@ -894,9 +890,9 @@ - (void)RB___setFrame:(NSRect)rect withFraction:(double)value notify:(BOOL)notif id delegate = nil; if (notify) { delegate = [sv delegate]; -// If the delegate method isn't implemented, we ignore the delegate altogether. + // If the delegate method isn't implemented, we ignore the delegate altogether. if ([delegate respondsToSelector:@selector(splitView:changedFrameOfSubview:from:to:)]) { -// If the rects are equal, the delegate isn't called. + // If the rects are equal, the delegate isn't called. if (NSEqualRects(previous,rect)) { delegate = nil; } diff --git a/RBSplitView/RBSplitView.h b/RBSplitView/RBSplitView.h old mode 100755 new mode 100644 index 72cf9fc8..b2871613 --- a/RBSplitView/RBSplitView.h +++ b/RBSplitView/RBSplitView.h @@ -1,9 +1,9 @@ // -// RBSplitView.h version 1.1.4 +// RBSplitView.h version 1.2 // RBSplitView // // Created by Rainer Brockerhoff on 24/09/2004. -// Copyright 2004-2006 Rainer Brockerhoff. +// Copyright 2004-2009 Rainer Brockerhoff. // Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License. // @@ -19,15 +19,15 @@ typedef enum { } RBSVCursorType; @interface RBSplitView : RBSplitSubview { -// Subclasses normally should use setter methods instead of changing instance variables by assignment. -// Most getter methods simply return the corresponding instance variable, so with some care, subclasses -// could reference them directly. + // Subclasses normally should use setter methods instead of changing instance variables by assignment. + // Most getter methods simply return the corresponding instance variable, so with some care, subclasses + // could reference them directly. IBOutlet id delegate; // The delegate (may be nil). NSString* autosaveName; // This name is used for storing subview proportions in user defaults. NSColor* background; // The color used to paint the view's background (may be nil). NSImage* divider; // The image used for the divider "dimple". NSRect* dividers; // A C array of NSRects, one for each divider. - CGFloat dividerThickness; // Actual divider width; should be an integer and at least 1.0. + CGFloat dividerThickness; // Actual divider width; should be an integer and at least 1.0. BOOL mustAdjust; // Set internally if the subviews need to be adjusted. BOOL mustClearFractions; // Set internally if fractions should be cleared before adjusting. BOOL isHorizontal; // The divider's orientation; default is vertical. @@ -123,6 +123,7 @@ typedef enum { // dividers are vertical, but the subviews are in a horizontal row. Sort of counter-intuitive, yes. - (void)setVertical:(BOOL)flag; - (BOOL)isVertical; +- (void)setHorizontal:(BOOL)flag; - (BOOL)isHorizontal; // Call this to force adjusting the subviews before display. Called automatically if anything @@ -131,6 +132,7 @@ typedef enum { // Returns YES if there's a pending adjustment. - (BOOL)mustAdjust; +- (BOOL)isAdjusting; // Returns YES if we're in a dragging loop. - (BOOL)isDragging; @@ -154,7 +156,8 @@ typedef enum { // The following methods are optionally implemented by the delegate. -@interface NSObject(RBSplitViewDelegate) +@protocol RBSplitViewDelegate +@optional // The delegate can override a subview's ability to collapse by implementing this method. // Return YES to allow collapsing. If this is implemented, the subviews' built-in diff --git a/RBSplitView/RBSplitView.m b/RBSplitView/RBSplitView.m old mode 100755 new mode 100644 index 5f223857..7a83b94a --- a/RBSplitView/RBSplitView.m +++ b/RBSplitView/RBSplitView.m @@ -1,21 +1,20 @@ // -// RBSplitView.m version 1.1.4 +// RBSplitView.m version 1.2 // RBSplitView // // Created by Rainer Brockerhoff on 24/09/2004. -// Copyright 2004-2006 Rainer Brockerhoff. +// Copyright 2004-2009 Rainer Brockerhoff. // Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License. // #import "RBSplitView.h" #import "RBSplitViewPrivateDefines.h" -#import "AppController.h" - +//#import "AppController.h" // Please don't remove this copyright notice! static const unsigned char RBSplitView_Copyright[] __attribute__ ((used)) = - "RBSplitView 1.1.4 Copyright(c)2004-2006 by Rainer Brockerhoff ."; +"RBSplitView 1.2 Copyright(c)2004-2009 by Rainer Brockerhoff ."; // This vector keeps currently used cursors. nil means the default cursor. static NSCursor* cursors[RBSVCursorTypeCount] = {nil}; @@ -76,7 +75,7 @@ + (NSString*)defaultsKeyForName:(NSString*)name isHorizontal:(BOOL)orientation { return [NSString stringWithFormat:@"RBSplitView %@ %@",orientation?@"H":@"V",name]; } -// This pair of methods gets and sets the autosave name, which allows restoring the subview's +// These methods get and set the autosave name, which allows restoring the subview's // state from the user defaults. // We take care not to allow nil autosaveNames. - (NSString*)autosaveName { @@ -97,8 +96,8 @@ - (void)setAutosaveName:(NSString*)aString recursively:(BOOL)flag { autosaveName = [aString retain]; if (flag) { NSArray* subviews = [self subviews]; - NSInteger subcount = [subviews count]; - NSInteger i; + NSUInteger subcount = [subviews count]; + NSUInteger i; for (i=0;i1)&&((NSInteger)[[parts objectAtIndex:0] intValue]==subcount)&&(k==subcount)) { + if ((k-->1)&&([[parts objectAtIndex:0] intValue]==subcount)&&(k==subcount)) { NSInteger i; NSRect frame = [self frame]; BOOL ishor = [self isHorizontal]; for (i=0;i

` tags. + ++ You can now write empty links: + + [like this]() + + and they'll be turned into anchor tags with empty href attributes. + This should have worked before, but didn't. + ++ `***this***` and `___this___` are now turned into + + this + + Instead of + + this + + which isn't valid. (Thanks to Michel Fortin for the fix.) + ++ Added a new substitution in `_EncodeCode()`: s/\$/$/g; This + is only for the benefit of Blosxom users, because Blosxom + (sometimes?) interpolates Perl scalars in your article bodies. + ++ Fixed problem for links defined with urls that include parens, e.g.: + + [1]: http://sources.wikipedia.org/wiki/Middle_East_Policy_(Chomsky) + + "Chomsky" was being erroneously treated as the URL's title. + ++ At some point during 1.0's beta cycle, I changed every sub's + argument fetching from this idiom: + + my $text = shift; + + to: + + my $text = shift || return ''; + + The idea was to keep Markdown from doing any work in a sub + if the input was empty. This introduced a bug, though: + if the input to any function was the single-character string + "0", it would also evaluate as false and return immediately. + How silly. Now fixed. + + + +Donations +--------- + +Donations to support Markdown's development are happily accepted. See: + for details. + + + +Copyright and License +--------------------- + +Copyright (c) 2003-2004 John Gruber + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. diff --git a/build/Deployment/nvALT.app/Contents/Resources/Markdown_1.0.1/Markdown.pl b/build/Deployment/nvALT.app/Contents/Resources/Markdown_1.0.1/Markdown.pl new file mode 100755 index 00000000..e4c8469d --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/Markdown_1.0.1/Markdown.pl @@ -0,0 +1,1450 @@ +#!/usr/bin/perl + +# +# Markdown -- A text-to-HTML conversion tool for web writers +# +# Copyright (c) 2004 John Gruber +# +# + + +package Markdown; +require 5.006_000; +use strict; +use warnings; + +use Digest::MD5 qw(md5_hex); +use vars qw($VERSION); +$VERSION = '1.0.1'; +# Tue 14 Dec 2004 + +## Disabled; causes problems under Perl 5.6.1: +# use utf8; +# binmode( STDOUT, ":utf8" ); # c.f.: http://acis.openlib.org/dev/perl-unicode-struggle.html + + +# +# Global default settings: +# +my $g_empty_element_suffix = " />"; # Change to ">" for HTML output +my $g_tab_width = 4; + + +# +# Globals: +# + +# Regex to match balanced [brackets]. See Friedl's +# "Mastering Regular Expressions", 2nd Ed., pp. 328-331. +my $g_nested_brackets; +$g_nested_brackets = qr{ + (?> # Atomic matching + [^\[\]]+ # Anything other than brackets + | + \[ + (??{ $g_nested_brackets }) # Recursive set of nested brackets + \] + )* +}x; + + +# Table of hash values for escaped characters: +my %g_escape_table; +foreach my $char (split //, '\\`*_{}[]()>#+-.!') { + $g_escape_table{$char} = md5_hex($char); +} + + +# Global hashes, used by various utility routines +my %g_urls; +my %g_titles; +my %g_html_blocks; + +# Used to track when we're inside an ordered or unordered list +# (see _ProcessListItems() for details): +my $g_list_level = 0; + + +#### Blosxom plug-in interface ########################################## + +# Set $g_blosxom_use_meta to 1 to use Blosxom's meta plug-in to determine +# which posts Markdown should process, using a "meta-markup: markdown" +# header. If it's set to 0 (the default), Markdown will process all +# entries. +my $g_blosxom_use_meta = 0; + +sub start { 1; } +sub story { + my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; + + if ( (! $g_blosxom_use_meta) or + (defined($meta::markup) and ($meta::markup =~ /^\s*markdown\s*$/i)) + ){ + $$body_ref = Markdown($$body_ref); + } + 1; +} + + +#### Movable Type plug-in interface ##################################### +eval {require MT}; # Test to see if we're running in MT. +unless ($@) { + require MT; + import MT; + require MT::Template::Context; + import MT::Template::Context; + + eval {require MT::Plugin}; # Test to see if we're running >= MT 3.0. + unless ($@) { + require MT::Plugin; + import MT::Plugin; + my $plugin = new MT::Plugin({ + name => "Markdown", + description => "A plain-text-to-HTML formatting plugin. (Version: $VERSION)", + doc_link => 'http://daringfireball.net/projects/markdown/' + }); + MT->add_plugin( $plugin ); + } + + MT::Template::Context->add_container_tag(MarkdownOptions => sub { + my $ctx = shift; + my $args = shift; + my $builder = $ctx->stash('builder'); + my $tokens = $ctx->stash('tokens'); + + if (defined ($args->{'output'}) ) { + $ctx->stash('markdown_output', lc $args->{'output'}); + } + + defined (my $str = $builder->build($ctx, $tokens) ) + or return $ctx->error($builder->errstr); + $str; # return value + }); + + MT->add_text_filter('markdown' => { + label => 'Markdown', + docs => 'http://daringfireball.net/projects/markdown/', + on_format => sub { + my $text = shift; + my $ctx = shift; + my $raw = 0; + if (defined $ctx) { + my $output = $ctx->stash('markdown_output'); + if (defined $output && $output =~ m/^html/i) { + $g_empty_element_suffix = ">"; + $ctx->stash('markdown_output', ''); + } + elsif (defined $output && $output eq 'raw') { + $raw = 1; + $ctx->stash('markdown_output', ''); + } + else { + $raw = 0; + $g_empty_element_suffix = " />"; + } + } + $text = $raw ? $text : Markdown($text); + $text; + }, + }); + + # If SmartyPants is loaded, add a combo Markdown/SmartyPants text filter: + my $smartypants; + + { + no warnings "once"; + $smartypants = $MT::Template::Context::Global_filters{'smarty_pants'}; + } + + if ($smartypants) { + MT->add_text_filter('markdown_with_smartypants' => { + label => 'Markdown With SmartyPants', + docs => 'http://daringfireball.net/projects/markdown/', + on_format => sub { + my $text = shift; + my $ctx = shift; + if (defined $ctx) { + my $output = $ctx->stash('markdown_output'); + if (defined $output && $output eq 'html') { + $g_empty_element_suffix = ">"; + } + else { + $g_empty_element_suffix = " />"; + } + } + $text = Markdown($text); + $text = $smartypants->($text, '1'); + }, + }); + } +} +else { +#### BBEdit/command-line text filter interface ########################## +# Needs to be hidden from MT (and Blosxom when running in static mode). + + # We're only using $blosxom::version once; tell Perl not to warn us: + no warnings 'once'; + unless ( defined($blosxom::version) ) { + use warnings; + + #### Check for command-line switches: ################# + my %cli_opts; + use Getopt::Long; + Getopt::Long::Configure('pass_through'); + GetOptions(\%cli_opts, + 'version', + 'shortversion', + 'html4tags', + ); + if ($cli_opts{'version'}) { # Version info + print "\nThis is Markdown, version $VERSION.\n"; + print "Copyright 2004 John Gruber\n"; + print "http://daringfireball.net/projects/markdown/\n\n"; + exit 0; + } + if ($cli_opts{'shortversion'}) { # Just the version number string. + print $VERSION; + exit 0; + } + if ($cli_opts{'html4tags'}) { # Use HTML tag style instead of XHTML + $g_empty_element_suffix = ">"; + } + + + #### Process incoming text: ########################### + my $text; + { + local $/; # Slurp the whole file + $text = <>; + } + print Markdown($text); + } +} + + + +sub Markdown { +# +# Main function. The order in which other subs are called here is +# essential. Link and image substitutions need to happen before +# _EscapeSpecialChars(), so that any *'s or _'s in the +# and tags get encoded. +# + my $text = shift; + + # Clear the global hashes. If we don't clear these, you get conflicts + # from other articles when generating a page which contains more than + # one article (e.g. an index page that shows the N most recent + # articles): + %g_urls = (); + %g_titles = (); + %g_html_blocks = (); + + + # Standardize line endings: + $text =~ s{\r\n}{\n}g; # DOS to Unix + $text =~ s{\r}{\n}g; # Mac to Unix + + # Make sure $text ends with a couple of newlines: + $text .= "\n\n"; + + # Convert all tabs to spaces. + $text = _Detab($text); + + # Strip any lines consisting only of spaces and tabs. + # This makes subsequent regexen easier to write, because we can + # match consecutive blank lines with /\n+/ instead of something + # contorted like /[ \t]*\n+/ . + $text =~ s/^[ \t]+$//mg; + + # Turn block-level HTML blocks into hash entries + $text = _HashHTMLBlocks($text); + + # Strip link definitions, store in hashes. + $text = _StripLinkDefinitions($text); + + $text = _RunBlockGamut($text); + + $text = _UnescapeSpecialChars($text); + + return $text . "\n"; +} + + +sub _StripLinkDefinitions { +# +# Strips link definitions from text, stores the URLs and titles in +# hash references. +# + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + # Link defs are in the form: ^[id]: url "optional title" + while ($text =~ s{ + ^[ ]{0,$less_than_tab}\[(.+)\]: # id = $1 + [ \t]* + \n? # maybe *one* newline + [ \t]* + ? # url = $2 + [ \t]* + \n? # maybe one newline + [ \t]* + (?: + (?<=\s) # lookbehind for whitespace + ["(] + (.+?) # title = $3 + [")] + [ \t]* + )? # title is optional + (?:\n+|\Z) + } + {}mx) { + $g_urls{lc $1} = _EncodeAmpsAndAngles( $2 ); # Link IDs are case-insensitive + if ($3) { + $g_titles{lc $1} = $3; + $g_titles{lc $1} =~ s/"/"/g; + } + } + + return $text; +} + + +sub _HashHTMLBlocks { + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + # Hashify HTML blocks: + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded: + my $block_tags_a = qr/p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del/; + my $block_tags_b = qr/p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math/; + + # First, look for nested blocks, e.g.: + #

+ # + # The outermost tags must start at the left margin for this to match, and + # the inner nested divs must be indented. + # We need to do this before the next, more liberal match, because the next + # match will start at the first `
` and stop at the first `
`. + $text =~ s{ + ( # save in $1 + ^ # start of line (with /m) + <($block_tags_a) # start tag = $2 + \b # word break + (.*\n)*? # any number of lines, minimally matching + # the matching end tag + [ \t]* # trailing spaces/tabs + (?=\n+|\Z) # followed by a newline or end of document + ) + }{ + my $key = md5_hex($1); + $g_html_blocks{$key} = $1; + "\n\n" . $key . "\n\n"; + }egmx; + + + # + # Now match more liberally, simply from `\n` to `\n` + # + $text =~ s{ + ( # save in $1 + ^ # start of line (with /m) + <($block_tags_b) # start tag = $2 + \b # word break + (.*\n)*? # any number of lines, minimally matching + .* # the matching end tag + [ \t]* # trailing spaces/tabs + (?=\n+|\Z) # followed by a newline or end of document + ) + }{ + my $key = md5_hex($1); + $g_html_blocks{$key} = $1; + "\n\n" . $key . "\n\n"; + }egmx; + # Special case just for
. It was easier to make a special case than + # to make the other regex more complicated. + $text =~ s{ + (?: + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + [ ]{0,$less_than_tab} + <(hr) # start tag = $2 + \b # word break + ([^<>])*? # + /?> # the matching end tag + [ \t]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + ) + }{ + my $key = md5_hex($1); + $g_html_blocks{$key} = $1; + "\n\n" . $key . "\n\n"; + }egx; + + # Special case for standalone HTML comments: + $text =~ s{ + (?: + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + [ ]{0,$less_than_tab} + (?s: + + ) + [ \t]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + ) + }{ + my $key = md5_hex($1); + $g_html_blocks{$key} = $1; + "\n\n" . $key . "\n\n"; + }egx; + + + return $text; +} + + +sub _RunBlockGamut { +# +# These are all the transformations that form block-level +# tags like paragraphs, headers, and list items. +# + my $text = shift; + + $text = _DoHeaders($text); + + # Do Horizontal Rules: + $text =~ s{^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$}{\n tags around block-level tags. + $text = _HashHTMLBlocks($text); + + $text = _FormParagraphs($text); + + return $text; +} + + +sub _RunSpanGamut { +# +# These are all the transformations that occur *within* block-level +# tags like paragraphs, headers, and list items. +# + my $text = shift; + + $text = _DoCodeSpans($text); + + $text = _EscapeSpecialChars($text); + + # Process anchor and image tags. Images must come first, + # because ![foo][f] looks like an anchor. + $text = _DoImages($text); + $text = _DoAnchors($text); + + # Make links out of things like `` + # Must come after _DoAnchors(), because you can use < and > + # delimiters in inline links like [this](). + $text = _DoAutoLinks($text); + + $text = _EncodeAmpsAndAngles($text); + + $text = _DoItalicsAndBold($text); + + # Do hard breaks: + $text =~ s/ {2,}\n/ or tags. +# my $tags_to_skip = qr!<(/?)(?:pre|code|kbd|script|math)[\s>]!; + + foreach my $cur_token (@$tokens) { + if ($cur_token->[0] eq "tag") { + # Within tags, encode * and _ so they don't conflict + # with their use in Markdown for italics and strong. + # We're replacing each such character with its + # corresponding MD5 checksum value; this is likely + # overkill, but it should prevent us from colliding + # with the escape values by accident. + $cur_token->[1] =~ s! \* !$g_escape_table{'*'}!gx; + $cur_token->[1] =~ s! _ !$g_escape_table{'_'}!gx; + $text .= $cur_token->[1]; + } else { + my $t = $cur_token->[1]; + $t = _EncodeBackslashEscapes($t); + $text .= $t; + } + } + return $text; +} + + +sub _DoAnchors { +# +# Turn Markdown link shortcuts into XHTML
tags. +# + my $text = shift; + + # + # First, handle reference-style links: [link text] [id] + # + $text =~ s{ + ( # wrap whole match in $1 + \[ + ($g_nested_brackets) # link text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + ) + }{ + my $result; + my $whole_match = $1; + my $link_text = $2; + my $link_id = lc $3; + + if ($link_id eq "") { + $link_id = lc $link_text; # for shortcut links like [this][]. + } + + if (defined $g_urls{$link_id}) { + my $url = $g_urls{$link_id}; + $url =~ s! \* !$g_escape_table{'*'}!gx; # We've got to encode these to avoid + $url =~ s! _ !$g_escape_table{'_'}!gx; # conflicting with italics/bold. + $result = "? # href = $3 + [ \t]* + ( # $4 + (['"]) # quote char = $5 + (.*?) # Title = $6 + \5 # matching quote + )? # title is optional + \) + ) + }{ + my $result; + my $whole_match = $1; + my $link_text = $2; + my $url = $3; + my $title = $6; + + $url =~ s! \* !$g_escape_table{'*'}!gx; # We've got to encode these to avoid + $url =~ s! _ !$g_escape_table{'_'}!gx; # conflicting with italics/bold. + $result = " tags. +# + my $text = shift; + + # + # First, handle reference-style labeled images: ![alt text][id] + # + $text =~ s{ + ( # wrap whole match in $1 + !\[ + (.*?) # alt text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + + ) + }{ + my $result; + my $whole_match = $1; + my $alt_text = $2; + my $link_id = lc $3; + + if ($link_id eq "") { + $link_id = lc $alt_text; # for shortcut links like ![this][]. + } + + $alt_text =~ s/"/"/g; + if (defined $g_urls{$link_id}) { + my $url = $g_urls{$link_id}; + $url =~ s! \* !$g_escape_table{'*'}!gx; # We've got to encode these to avoid + $url =~ s! _ !$g_escape_table{'_'}!gx; # conflicting with italics/bold. + $result = "\"$alt_text\"";? # src url = $3 + [ \t]* + ( # $4 + (['"]) # quote char = $5 + (.*?) # title = $6 + \5 # matching quote + [ \t]* + )? # title is optional + \) + ) + }{ + my $result; + my $whole_match = $1; + my $alt_text = $2; + my $url = $3; + my $title = ''; + if (defined($6)) { + $title = $6; + } + + $alt_text =~ s/"/"/g; + $title =~ s/"/"/g; + $url =~ s! \* !$g_escape_table{'*'}!gx; # We've got to encode these to avoid + $url =~ s! _ !$g_escape_table{'_'}!gx; # conflicting with italics/bold. + $result = "\"$alt_text\"";" . _RunSpanGamut($1) . "\n\n"; + }egmx; + + $text =~ s{ ^(.+)[ \t]*\n-+[ \t]*\n+ }{ + "

" . _RunSpanGamut($1) . "

\n\n"; + }egmx; + + + # atx-style headers: + # # Header 1 + # ## Header 2 + # ## Header 2 with closing hashes ## + # ... + # ###### Header 6 + # + $text =~ s{ + ^(\#{1,6}) # $1 = string of #'s + [ \t]* + (.+?) # $2 = Header text + [ \t]* + \#* # optional closing #'s (not counted) + \n+ + }{ + my $h_level = length($1); + "" . _RunSpanGamut($2) . "\n\n"; + }egmx; + + return $text; +} + + +sub _DoLists { +# +# Form HTML ordered (numbered) and unordered (bulleted) lists. +# + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + # Re-usable patterns to match list item bullets and number markers: + my $marker_ul = qr/[*+-]/; + my $marker_ol = qr/\d+[.]/; + my $marker_any = qr/(?:$marker_ul|$marker_ol)/; + + # Re-usable pattern to match any entirel ul or ol list: + my $whole_list = qr{ + ( # $1 = whole list + ( # $2 + [ ]{0,$less_than_tab} + (${marker_any}) # $3 = first list item marker + [ \t]+ + ) + (?s:.+?) + ( # $4 + \z + | + \n{2,} + (?=\S) + (?! # Negative lookahead for another list item marker + [ \t]* + ${marker_any}[ \t]+ + ) + ) + ) + }mx; + + # We use a different prefix before nested lists than top-level lists. + # See extended comment in _ProcessListItems(). + # + # Note: There's a bit of duplication here. My original implementation + # created a scalar regex pattern as the conditional result of the test on + # $g_list_level, and then only ran the $text =~ s{...}{...}egmx + # substitution once, using the scalar as the pattern. This worked, + # everywhere except when running under MT on my hosting account at Pair + # Networks. There, this caused all rebuilds to be killed by the reaper (or + # perhaps they crashed, but that seems incredibly unlikely given that the + # same script on the same server ran fine *except* under MT. I've spent + # more time trying to figure out why this is happening than I'd like to + # admit. My only guess, backed up by the fact that this workaround works, + # is that Perl optimizes the substition when it can figure out that the + # pattern will never change, and when this optimization isn't on, we run + # afoul of the reaper. Thus, the slightly redundant code to that uses two + # static s/// patterns rather than one conditional pattern. + + if ($g_list_level) { + $text =~ s{ + ^ + $whole_list + }{ + my $list = $1; + my $list_type = ($3 =~ m/$marker_ul/) ? "ul" : "ol"; + # Turn double returns into triple returns, so that we can make a + # paragraph for the last item in a list, if necessary: + $list =~ s/\n{2,}/\n\n\n/g; + my $result = _ProcessListItems($list, $marker_any); + $result = "<$list_type>\n" . $result . "\n"; + $result; + }egmx; + } + else { + $text =~ s{ + (?:(?<=\n\n)|\A\n?) + $whole_list + }{ + my $list = $1; + my $list_type = ($3 =~ m/$marker_ul/) ? "ul" : "ol"; + # Turn double returns into triple returns, so that we can make a + # paragraph for the last item in a list, if necessary: + $list =~ s/\n{2,}/\n\n\n/g; + my $result = _ProcessListItems($list, $marker_any); + $result = "<$list_type>\n" . $result . "\n"; + $result; + }egmx; + } + + + return $text; +} + + +sub _ProcessListItems { +# +# Process the contents of a single ordered or unordered list, splitting it +# into individual list items. +# + + my $list_str = shift; + my $marker_any = shift; + + + # The $g_list_level global keeps track of when we're inside a list. + # Each time we enter a list, we increment it; when we leave a list, + # we decrement. If it's zero, we're not in a list anymore. + # + # We do this because when we're not inside a list, we want to treat + # something like this: + # + # I recommend upgrading to version + # 8. Oops, now this line is treated + # as a sub-list. + # + # As a single paragraph, despite the fact that the second line starts + # with a digit-period-space sequence. + # + # Whereas when we're inside a list (or sub-list), that line will be + # treated as the start of a sub-list. What a kludge, huh? This is + # an aspect of Markdown's syntax that's hard to parse perfectly + # without resorting to mind-reading. Perhaps the solution is to + # change the syntax rules such that sub-lists must start with a + # starting cardinal number; e.g. "1." or "a.". + + $g_list_level++; + + # trim trailing blank lines: + $list_str =~ s/\n{2,}\z/\n/; + + + $list_str =~ s{ + (\n)? # leading line = $1 + (^[ \t]*) # leading whitespace = $2 + ($marker_any) [ \t]+ # list marker = $3 + ((?s:.+?) # list item text = $4 + (\n{1,2})) + (?= \n* (\z | \2 ($marker_any) [ \t]+)) + }{ + my $item = $4; + my $leading_line = $1; + my $leading_space = $2; + + if ($leading_line or ($item =~ m/\n{2,}/)) { + $item = _RunBlockGamut(_Outdent($item)); + } + else { + # Recursion for sub-lists: + $item = _DoLists(_Outdent($item)); + chomp $item; + $item = _RunSpanGamut($item); + } + + "
  • " . $item . "
  • \n"; + }egmx; + + $g_list_level--; + return $list_str; +} + + + +sub _DoCodeBlocks { +# +# Process Markdown `
    ` blocks.
    +#	
    +
    +	my $text = shift;
    +
    +	$text =~ s{
    +			(?:\n\n|\A)
    +			(	            # $1 = the code block -- one or more lines, starting with a space/tab
    +			  (?:
    +			    (?:[ ]{$g_tab_width} | \t)  # Lines must start with a tab or a tab-width of spaces
    +			    .*\n+
    +			  )+
    +			)
    +			((?=^[ ]{0,$g_tab_width}\S)|\Z)	# Lookahead for non-space at line-start, or end of doc
    +		}{
    +			my $codeblock = $1;
    +			my $result; # return value
    +
    +			$codeblock = _EncodeCode(_Outdent($codeblock));
    +			$codeblock = _Detab($codeblock);
    +			$codeblock =~ s/\A\n+//; # trim leading newlines
    +			$codeblock =~ s/\s+\z//; # trim trailing whitespace
    +
    +			$result = "\n\n
    " . $codeblock . "\n
    \n\n"; + + $result; + }egmx; + + return $text; +} + + +sub _DoCodeSpans { +# +# * Backtick quotes are used for spans. +# +# * You can use multiple backticks as the delimiters if you want to +# include literal backticks in the code span. So, this input: +# +# Just type ``foo `bar` baz`` at the prompt. +# +# Will translate to: +# +#

    Just type foo `bar` baz at the prompt.

    +# +# There's no arbitrary limit to the number of backticks you +# can use as delimters. If you need three consecutive backticks +# in your code, use four for delimiters, etc. +# +# * You can use spaces to get literal backticks at the edges: +# +# ... type `` `bar` `` ... +# +# Turns to: +# +# ... type `bar` ... +# + + my $text = shift; + + $text =~ s@ + (`+) # $1 = Opening run of ` + (.+?) # $2 = The code block + (?$c
    "; + @egsx; + + return $text; +} + + +sub _EncodeCode { +# +# Encode/escape certain characters inside Markdown code runs. +# The point is that in code, these characters are literals, +# and lose their special Markdown meanings. +# + local $_ = shift; + + # Encode all ampersands; HTML entities are not + # entities within a Markdown code span. + s/&/&/g; + + # Encode $'s, but only if we're running under Blosxom. + # (Blosxom interpolates Perl variables in article bodies.) + { + no warnings 'once'; + if (defined($blosxom::version)) { + s/\$/$/g; + } + } + + + # Do the angle bracket song and dance: + s! < !<!gx; + s! > !>!gx; + + # Now, escape characters that are magic in Markdown: + s! \* !$g_escape_table{'*'}!gx; + s! _ !$g_escape_table{'_'}!gx; + s! { !$g_escape_table{'{'}!gx; + s! } !$g_escape_table{'}'}!gx; + s! \[ !$g_escape_table{'['}!gx; + s! \] !$g_escape_table{']'}!gx; + s! \\ !$g_escape_table{'\\'}!gx; + + return $_; +} + + +sub _DoItalicsAndBold { + my $text = shift; + + # must go first: + $text =~ s{ (\*\*|__) (?=\S) (.+?[*_]*) (?<=\S) \1 } + {$2}gsx; + + $text =~ s{ (\*|_) (?=\S) (.+?) (?<=\S) \1 } + {$2}gsx; + + return $text; +} + + +sub _DoBlockQuotes { + my $text = shift; + + $text =~ s{ + ( # Wrap whole match in $1 + ( + ^[ \t]*>[ \t]? # '>' at the start of a line + .+\n # rest of the first line + (.+\n)* # subsequent consecutive lines + \n* # blanks + )+ + ) + }{ + my $bq = $1; + $bq =~ s/^[ \t]*>[ \t]?//gm; # trim one level of quoting + $bq =~ s/^[ \t]+$//mg; # trim whitespace-only lines + $bq = _RunBlockGamut($bq); # recurse + + $bq =~ s/^/ /g; + # These leading spaces screw with
     content, so we need to fix that:
    +			$bq =~ s{
    +					(\s*
    .+?
    ) + }{ + my $pre = $1; + $pre =~ s/^ //mg; + $pre; + }egsx; + + "
    \n$bq\n
    \n\n"; + }egmx; + + + return $text; +} + + +sub _FormParagraphs { +# +# Params: +# $text - string to process with html

    tags +# + my $text = shift; + + # Strip leading and trailing lines: + $text =~ s/\A\n+//; + $text =~ s/\n+\z//; + + my @grafs = split(/\n{2,}/, $text); + + # + # Wrap

    tags. + # + foreach (@grafs) { + unless (defined( $g_html_blocks{$_} )) { + $_ = _RunSpanGamut($_); + s/^([ \t]*)/

    /; + $_ .= "

    "; + } + } + + # + # Unhashify HTML blocks + # + foreach (@grafs) { + if (defined( $g_html_blocks{$_} )) { + $_ = $g_html_blocks{$_}; + } + } + + return join "\n\n", @grafs; +} + + +sub _EncodeAmpsAndAngles { +# Smart processing for ampersands and angle brackets that need to be encoded. + + my $text = shift; + + # Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin: + # http://bumppo.net/projects/amputator/ + $text =~ s/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/&/g; + + # Encode naked <'s + $text =~ s{<(?![a-z/?\$!])}{<}gi; + + return $text; +} + + +sub _EncodeBackslashEscapes { +# +# Parameter: String. +# Returns: The string, with after processing the following backslash +# escape sequences. +# + local $_ = shift; + + s! \\\\ !$g_escape_table{'\\'}!gx; # Must process escaped backslashes first. + s! \\` !$g_escape_table{'`'}!gx; + s! \\\* !$g_escape_table{'*'}!gx; + s! \\_ !$g_escape_table{'_'}!gx; + s! \\\{ !$g_escape_table{'{'}!gx; + s! \\\} !$g_escape_table{'}'}!gx; + s! \\\[ !$g_escape_table{'['}!gx; + s! \\\] !$g_escape_table{']'}!gx; + s! \\\( !$g_escape_table{'('}!gx; + s! \\\) !$g_escape_table{')'}!gx; + s! \\> !$g_escape_table{'>'}!gx; + s! \\\# !$g_escape_table{'#'}!gx; + s! \\\+ !$g_escape_table{'+'}!gx; + s! \\\- !$g_escape_table{'-'}!gx; + s! \\\. !$g_escape_table{'.'}!gx; + s{ \\! }{$g_escape_table{'!'}}gx; + + return $_; +} + + +sub _DoAutoLinks { + my $text = shift; + + $text =~ s{<((https?|ftp):[^'">\s]+)>}{
    $1}gi; + + # Email addresses: + $text =~ s{ + < + (?:mailto:)? + ( + [-.\w]+ + \@ + [-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+ + ) + > + }{ + _EncodeEmailAddress( _UnescapeSpecialChars($1) ); + }egix; + + return $text; +} + + +sub _EncodeEmailAddress { +# +# Input: an email address, e.g. "foo@example.com" +# +# Output: the email address as a mailto link, with each character +# of the address encoded as either a decimal or hex entity, in +# the hopes of foiling most address harvesting spam bots. E.g.: +# +# foo +# @example.com +# +# Based on a filter by Matthew Wickline, posted to the BBEdit-Talk +# mailing list: +# + + my $addr = shift; + + srand; + my @encode = ( + sub { '&#' . ord(shift) . ';' }, + sub { '&#x' . sprintf( "%X", ord(shift) ) . ';' }, + sub { shift }, + ); + + $addr = "mailto:" . $addr; + + $addr =~ s{(.)}{ + my $char = $1; + if ( $char eq '@' ) { + # this *must* be encoded. I insist. + $char = $encode[int rand 1]->($char); + } elsif ( $char ne ':' ) { + # leave ':' alone (to spot mailto: later) + my $r = rand; + # roughly 10% raw, 45% hex, 45% dec + $char = ( + $r > .9 ? $encode[2]->($char) : + $r < .45 ? $encode[1]->($char) : + $encode[0]->($char) + ); + } + $char; + }gex; + + $addr = qq{$addr}; + $addr =~ s{">.+?:}{">}; # strip the mailto: from the visible part + + return $addr; +} + + +sub _UnescapeSpecialChars { +# +# Swap back in all the special characters we've hidden. +# + my $text = shift; + + while( my($char, $hash) = each(%g_escape_table) ) { + $text =~ s/$hash/$char/g; + } + return $text; +} + + +sub _TokenizeHTML { +# +# Parameter: String containing HTML markup. +# Returns: Reference to an array of the tokens comprising the input +# string. Each token is either a tag (possibly with nested, +# tags contained therein, such as , or a +# run of text between tags. Each element of the array is a +# two-element array; the first is either 'tag' or 'text'; +# the second is the actual value. +# +# +# Derived from the _tokenize() subroutine from Brad Choate's MTRegex plugin. +# +# + + my $str = shift; + my $pos = 0; + my $len = length $str; + my @tokens; + + my $depth = 6; + my $nested_tags = join('|', ('(?:<[a-z/!$](?:[^<>]') x $depth) . (')*>)' x $depth); + my $match = qr/(?s: ) | # comment + (?s: <\? .*? \?> ) | # processing instruction + $nested_tags/ix; # nested tags + + while ($str =~ m/($match)/g) { + my $whole_tag = $1; + my $sec_start = pos $str; + my $tag_start = $sec_start - length $whole_tag; + if ($pos < $tag_start) { + push @tokens, ['text', substr($str, $pos, $tag_start - $pos)]; + } + push @tokens, ['tag', $whole_tag]; + $pos = pos $str; + } + push @tokens, ['text', substr($str, $pos, $len - $pos)] if $pos < $len; + \@tokens; +} + + +sub _Outdent { +# +# Remove one level of line-leading tabs or spaces +# + my $text = shift; + + $text =~ s/^(\t|[ ]{1,$g_tab_width})//gm; + return $text; +} + + +sub _Detab { +# +# Cribbed from a post by Bart Lateur: +# +# + my $text = shift; + + $text =~ s{(.*?)\t}{$1.(' ' x ($g_tab_width - length($1) % $g_tab_width))}ge; + return $text; +} + + +1; + +__END__ + + +=pod + +=head1 NAME + +B + + +=head1 SYNOPSIS + +B [ B<--html4tags> ] [ B<--version> ] [ B<-shortversion> ] + [ I ... ] + + +=head1 DESCRIPTION + +Markdown is a text-to-HTML filter; it translates an easy-to-read / +easy-to-write structured text format into HTML. Markdown's text format +is most similar to that of plain text email, and supports features such +as headers, *emphasis*, code blocks, blockquotes, and links. + +Markdown's syntax is designed not as a generic markup language, but +specifically to serve as a front-end to (X)HTML. You can use span-level +HTML tags anywhere in a Markdown document, and you can use block level +HTML tags (like
    and as well). + +For more information about Markdown's syntax, see: + + http://daringfireball.net/projects/markdown/ + + +=head1 OPTIONS + +Use "--" to end switch parsing. For example, to open a file named "-z", use: + + Markdown.pl -- -z + +=over 4 + + +=item B<--html4tags> + +Use HTML 4 style for empty element tags, e.g.: + +
    + +instead of Markdown's default XHTML style tags, e.g.: + +
    + + +=item B<-v>, B<--version> + +Display Markdown's version number and copyright information. + + +=item B<-s>, B<--shortversion> + +Display the short-form version number. + + +=back + + + +=head1 BUGS + +To file bug reports or feature requests (other than topics listed in the +Caveats section above) please send email to: + + support@daringfireball.net + +Please include with your report: (1) the example input; (2) the output +you expected; (3) the output Markdown actually produced. + + +=head1 VERSION HISTORY + +See the readme file for detailed release notes for this version. + +1.0.1 - 14 Dec 2004 + +1.0 - 28 Aug 2004 + + +=head1 AUTHOR + + John Gruber + http://daringfireball.net + + PHP port and other contributions by Michel Fortin + http://michelf.com + + +=head1 COPYRIGHT AND LICENSE + +Copyright (c) 2003-2004 John Gruber + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. + +=cut diff --git a/build/Deployment/nvALT.app/Contents/Resources/MarkupPreview.nib b/build/Deployment/nvALT.app/Contents/Resources/MarkupPreview.nib new file mode 100644 index 00000000..36f6cc6b Binary files /dev/null and b/build/Deployment/nvALT.app/Contents/Resources/MarkupPreview.nib differ diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/GPL.txt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/GPL.txt new file mode 100755 index 00000000..b1ac8a61 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/GPL.txt @@ -0,0 +1,338 @@ +Title: GNU GENERAL PUBLIC LICENSE +Subtitle: Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +# Preamble # + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +# GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION # + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + + You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + + If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + + It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + + This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +# How to Apply These Terms to Your New Programs # + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/Markdown Readme.text b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/Markdown Readme.text new file mode 100755 index 00000000..3123e934 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/Markdown Readme.text @@ -0,0 +1,352 @@ +Markdown +======== + +Version 1.0.2b7 - Tue 29 Aug 2006 + +by John Gruber + + + +Introduction +------------ + +Markdown is a text-to-HTML conversion tool for web writers. Markdown +allows you to write using an easy-to-read, easy-to-write plain text +format, then convert it to structurally valid XHTML (or HTML). + +Thus, "Markdown" is two things: a plain text markup syntax, and a +software tool, written in Perl, that converts the plain text markup +to HTML. + +Markdown works both as a Movable Type plug-in and as a standalone Perl +script -- which means it can also be used as a text filter in BBEdit +(or any other application that supporst filters written in Perl). + +Full documentation of Markdown's syntax and configuration options is +available on the web: . +(Note: this readme file is formatted in Markdown.) + + + +Installation and Requirements +----------------------------- + +Markdown requires Perl 5.6.0 or later. Welcome to the 21st Century. +Markdown also requires the standard Perl library modules `Digest::MD5` +and `Text::Balanced`, both of which are included in the core library +with Perl 5.8 or later, and are on CPAN for older versions of Perl. + + +### Movable Type ### + +Markdown works with Movable Type version 2.6 or later (including +MT 3.0 or later). + +1. Copy the "Markdown.pl" file into your Movable Type "plugins" + directory. The "plugins" directory should be in the same directory + as "mt.cgi"; if the "plugins" directory doesn't already exist, use + your FTP program to create it. Your installation should look like + this: + + (mt home)/plugins/Markdown.pl + +2. Once installed, Markdown will appear as an option in Movable Type's + Text Formatting pop-up menu. This is selectable on a per-post basis. + Markdown translates your posts to HTML when you publish; the posts + themselves are stored in your MT database in Markdown format. + +3. If you also install SmartyPants 1.5 (or later), Markdown will offer + a second text formatting option: "Markdown with SmartyPants". This + option is the same as the regular "Markdown" formatter, except that + automatically uses SmartyPants to create typographically correct + curly quotes, em-dashes, and ellipses. See the SmartyPants web page + for more information: + +4. To make Markdown (or "Markdown with SmartyPants") your default + text formatting option for new posts, go to Weblog Config -> + Preferences. + +Note that by default, Markdown produces XHTML output. To configure +Markdown to produce HTML 4 output, see "Configuration", below. + + +### Blosxom ### + +Markdown works with Blosxom version 2.x. + +1. Rename the "Markdown.pl" plug-in to "Markdown" (case is + important). Movable Type requires plug-ins to have a ".pl" + extension; Blosxom forbids it. + +2. Copy the "Markdown" plug-in file to your Blosxom plug-ins folder. + If you're not sure where your Blosxom plug-ins folder is, see the + Blosxom documentation for information. + +3. That's it. The entries in your weblog will now automatically be + processed by Markdown. + +4. If you'd like to apply Markdown formatting only to certain posts, + rather than all of them, see Jason Clark's instructions for using + Markdown in conjunction with Blosxom's Meta plugin: + + + + +### BBEdit ### + +Markdown works with BBEdit 6.1 or later on Mac OS X. (It also works +with BBEdit 5.1 or later and MacPerl 5.6.1 on Mac OS 8.6 or later.) + +1. Copy the "Markdown.pl" file to appropriate filters folder in your + "BBEdit Support" folder. On Mac OS X, this should be: + + BBEdit Support/Unix Support/Unix Filters/ + + See the BBEdit documentation for more details on the location of + these folders. + + You can rename "Markdown.pl" to whatever you wish. + +2. That's it. To use Markdown, select some text in a BBEdit document, + then choose Markdown from the Filters sub-menu in the "#!" menu, or + the Filters floating palette + + + +Configuration +------------- + +By default, Markdown produces XHTML output for tags with empty elements. +E.g.: + +
    + +Markdown can be configured to produce HTML-style tags; e.g.: + +
    + + +### Movable Type ### + +You need to use a special `MTMarkdownOptions` container tag in each +Movable Type template where you want HTML 4-style output: + + + ... put your entry content here ... + + +The easiest way to use MTMarkdownOptions is probably to put the +opening tag right after your `` tag, and the closing tag right +before ``. + +To suppress Markdown processing in a particular template, i.e. to +publish the raw Markdown-formatted text without translation into +(X)HTML, set the `output` attribute to 'raw': + + + ... put your entry content here ... + + + +### Command-Line ### + +Use the `--html4tags` command-line switch to produce HTML output from a +Unix-style command line. E.g.: + + % perl Markdown.pl --html4tags foo.text + +Type `perldoc Markdown.pl`, or read the POD documentation within the +Markdown.pl source code for more information. + + + +Bugs +---- + +To file bug reports or feature requests please send email to: +. + + + +Version History +--------------- + +1.0.2b1 (Mon 28 Feb 2005) + ++ Fix for backticks within HTML tag: like this + ++ Fix for escaped backticks still triggering code spans: + + There are two raw backticks here: \` and here: \`, not a code span + + +1.0.1 (14 Dec 2004): + ++ Changed the syntax rules for code blocks and spans. Previously, + backslash escapes for special Markdown characters were processed + everywhere other than within inline HTML tags. Now, the contents + of code blocks and spans are no longer processed for backslash + escapes. This means that code blocks and spans are now treated + literally, with no special rules to worry about regarding + backslashes. + + **NOTE**: This changes the syntax from all previous versions of + Markdown. Code blocks and spans involving backslash characters + will now generate different output than before. + ++ Tweaked the rules for link definitions so that they must occur + within three spaces of the left margin. Thus if you indent a link + definition by four spaces or a tab, it will now be a code block. + + [a]: /url/ "Indented 3 spaces, this is a link def" + + [b]: /url/ "Indented 4 spaces, this is a code block" + + **IMPORTANT**: This may affect existing Markdown content if it + contains link definitions indented by 4 or more spaces. + ++ Added `>`, `+`, and `-` to the list of backslash-escapable + characters. These should have been done when these characters + were added as unordered list item markers. + ++ Trailing spaces and tabs following HTML comments and `
    ` tags + are now ignored. + ++ Inline links using `<` and `>` URL delimiters weren't working: + + like [this]() + ++ Added a bit of tolerance for trailing spaces and tabs after + Markdown hr's. + ++ Fixed bug where auto-links were being processed within code spans: + + like this: `` + ++ Sort-of fixed a bug where lines in the middle of hard-wrapped + paragraphs, which lines look like the start of a list item, + would accidentally trigger the creation of a list. E.g. a + paragraph that looked like this: + + I recommend upgrading to version + 8. Oops, now this line is treated + as a sub-list. + + This is fixed for top-level lists, but it can still happen for + sub-lists. E.g., the following list item will not be parsed + properly: + + + I recommend upgrading to version + 8. Oops, now this line is treated + as a sub-list. + + Given Markdown's list-creation rules, I'm not sure this can + be fixed. + ++ Standalone HTML comments are now handled; previously, they'd get + wrapped in a spurious `

    ` tag. + ++ Fix for horizontal rules preceded by 2 or 3 spaces. + ++ `


    ` HTML tags in must occur within three spaces of left + margin. (With 4 spaces or a tab, they should be code blocks, but + weren't before this fix.) + ++ Capitalized "With" in "Markdown With SmartyPants" for + consistency with the same string label in SmartyPants.pl. + (This fix is specific to the MT plug-in interface.) + ++ Auto-linked email address can now optionally contain + a 'mailto:' protocol. I.e. these are equivalent: + + + + ++ Fixed annoying bug where nested lists would wind up with + spurious (and invalid) `

    ` tags. + ++ You can now write empty links: + + [like this]() + + and they'll be turned into anchor tags with empty href attributes. + This should have worked before, but didn't. + ++ `***this***` and `___this___` are now turned into + + this + + Instead of + + this + + which isn't valid. (Thanks to Michel Fortin for the fix.) + ++ Added a new substitution in `_EncodeCode()`: s/\$/$/g; This + is only for the benefit of Blosxom users, because Blosxom + (sometimes?) interpolates Perl scalars in your article bodies. + ++ Fixed problem for links defined with urls that include parens, e.g.: + + [1]: http://sources.wikipedia.org/wiki/Middle_East_Policy_(Chomsky) + + "Chomsky" was being erroneously treated as the URL's title. + ++ At some point during 1.0's beta cycle, I changed every sub's + argument fetching from this idiom: + + my $text = shift; + + to: + + my $text = shift || return ''; + + The idea was to keep Markdown from doing any work in a sub + if the input was empty. This introduced a bug, though: + if the input to any function was the single-character string + "0", it would also evaluate as false and return immediately. + How silly. Now fixed. + + + +Donations +--------- + +Donations to support Markdown's development are happily accepted. See: + for details. + + + +Copyright and License +--------------------- + +Copyright (c) 2003-2006 John Gruber + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/Markdown Syntax.md b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/Markdown Syntax.md new file mode 100755 index 00000000..dbdd9e8a --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/Markdown Syntax.md @@ -0,0 +1,128 @@ +## Phrase Emphasis ## + + *italic* **bold** + _italic_ __bold__ + + +## Links ## + +Inline: + + An [example](http://url.com/ "Title") + +Reference-style labels (titles are optional): + + An [example][id]. Then, anywhere + else in the doc, define the link: + + [id]: http://example.com/ "Title" + + +## Images ## + +Inline (titles are optional): + + ![alt text](/path/img.jpg "Title") + +Reference-style: + + ![alt text][id] + + [id]: /url/to/img.jpg "Title" + + +## Headers ## + +Setext-style: + + Header 1 + ======== + + Header 2 + -------- + +atx-style (closing #'s are optional): + + # Header 1 # + + ## Header 2 ## + + ###### Header 6 + + +## Lists ## + +Ordered, without paragraphs: + + 1. Foo + 2. Bar + +Unordered, with paragraphs: + + * A list item. + + With multiple paragraphs. + + * Bar + +You can nest them: + + * Abacus + * answer + * Bubbles + 1. bunk + 2. bupkis + * BELITTLER + 3. burper + * Cunning + + +## Blockquotes ## + + > Email-style angle brackets + > are used for blockquotes. + + > > And, they can be nested. + + > #### Headers in blockquotes + > + > * You can quote a list. + > * Etc. + + +## Code Spans ## + + `` spans are delimited + by backticks. + + You can include literal backticks + like `` `this` ``. + + +## Preformatted Code Blocks ## + +Indent every line of a code block by at least 4 spaces or 1 tab. + + This is a normal paragraph. + + This is a preformatted + code block. + + +## Horizontal Rules ## + +Three or more dashes or asterisks: + + --- + + * * * + + - - - - + + +## Manual Line Breaks ## + +End a line with two or more spaces: + + Roses are red, + Violets are blue. \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/MultiMarkdown User's Guide.md b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/MultiMarkdown User's Guide.md new file mode 100755 index 00000000..bc9d3684 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/MultiMarkdown User's Guide.md @@ -0,0 +1,1861 @@ +Title: MultiMarkdown User's Guide +Subtitle: Version 2.0.b6 +Author: Fletcher T. Penney +Web: http://fletcherpenney.net/ +Copyright: 2005-2009 Fletcher T. Penney. + This work is licensed under a Creative Commons License. + http://creativecommons.org/licenses/by-nc-sa/3.0/ +XMP: CCAttributionShareAlike +Keywords: Markdown + LaTeX + TeX + PDF + XHTML + XSLT + Oddmuse + OmniOutliner + MultiMarkdown + RTF + TextMate +Version: 2.0.b6 +Base Header Level: 2 +CSS: http://fletcherpenney.net/document.css +XHTML XSLT: xhtml-toc-h2.xslt + + + +# Introduction to MultiMarkdown # + +This document is an introduction to [MultiMarkdown][] --- what it is, how to +use it, how you can help make it better. This document exists in multiple +formats: a plain text document, a pdf, a [Scrivener][] document, +etc. Find the format that best suits your needs, or create your own. That is +what MultiMarkdown was designed to be used for! + + +[MultiMarkdown]: http://fletcherpenney.net/MultiMarkdown +[Scrivener]: http://www.literatureandlatte.com/scrivener.html + +## What is Markdown? # + +To understand what MultiMarkdown is, you first should be familiar with +[Markdown](http://daringfireball.net/projects/markdown/ "Daring Fireball: +Markdown"). The best description of what Markdown is comes from John Gruber's +Markdown web site: + +> Markdown is a text-to-HTML conversion tool for web writers. Markdown +> allows you to write using an easy-to-read, easy-to-write plain text +> format, then convert it to structurally valid XHTML (or HTML). + +> Thus, “Markdown” is two things: (1) a plain text formatting +> syntax; and (2) a software tool, written in Perl, that converts +> the plain text formatting to HTML. See the Syntax page for details +> pertaining to Markdown’s formatting syntax. You can try it out, +> right now, using the online Dingus. + +> The overriding design goal for Markdown’s formatting syntax is to +> make it as readable as possible. The idea is that a Markdown-formatted +> document should be publishable as-is, as plain text, without looking +> like it’s been marked up with tags or formatting instructions. While +> Markdown’s syntax has been influenced by several existing +> text-to-HTML filters, the single biggest source of inspiration for +> Markdown’s syntax is the format of plain text email. [#Gruber][] + + + +[#Gruber]: Daring Fireball: Markdown. + + +## What is MultiMarkdown? # + + + +Markdown is great, but it lacked a few features that would allow it to work +with documents, rather than just pieces of a web page. + +I wrote MultiMarkdown in order to leverage Markdown's syntax, but to extend it +to work with complete documents that could ultimately be converted from text +into other formats, including complete XHTML documents, LaTeX, PDF, RTF, or +even (shudder) Microsoft Word documents. + +In addition to the ability to work with complete documents and conversion to +other formats, the Markdown syntax was lacking a few things. Michel Fortin +added a few additional syntax tools when writing [PHP Markdown Extra][]. Some +of his ideas were implemented and expanded on in MultiMarkdown. + +John Gruber may disagree with me, but I really did try to stick with his +proclaimed vision whenever I added a new syntax format to MultiMarkdown. The +quality that attracted me to Markdown the most was its clean format. Reading a +plain text document written in Markdown is *easy*. It makes sense, and it +looks like it was designed for people, not computers. To the extent possible, +I tried to keep this same concept in mind when working on MultiMarkdown. + +I may or may not have succeeded in this... + +In the vein of Markdown's multiple definitions, you can think of MultiMarkdown +as: + +1. A perl script to convert plain text to XHTML + +2. The syntax used in the plain text to describe how to convert it to XHTML + +3. The system of programs (perl scripts, shell commands, XSLT transforms, php scripts, etc) used to convert plain text to XHTML, and then to convert XHTML into LaTeX, PDF, RTF, etc) + +[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/ + +## How do I use MultiMarkdown? # + + +You can use MultiMarkdown in a variety of ways: + +* As a command-line perl program (the "default" approach) + +* As a drag and drop application for Mac OS X + +* As a [TextMate][] +[bundle](http://files.fletcherpenney.net/MultiMarkdown.tmbundle.zip) + +* Within the [Scrivener][] application + +* In a [blosxom][] or [Oddmuse][] web site + +[TextMate]: http://macromates.com/ +[Scrivener]: http://www.literatureandlatte.com/scrivener.html +[blosxom]: http://blosxom.sourceforge.net "blosxom" +[Oddmuse]: http://www.oddmuse.org/ "Oddmuse Homepage" + +## Where can I find MultiMarkdown? # + + +The MultiMarkdown package can be downloaded: + +* + +Information about MultiMarkdown is available on my web site: + +* + +John Gruber's original Markdown is available at his site: + +* + +Michel Fortin's PHP version of Markdown is at his site: + +* + + +## Where can I get more information about MultiMarkdown? # + + +As above, check my web site. + +Also, you can check out the MultiMarkdown discussion list: + +* +* + +If you questions are specific to Scrivener, you can also browse the Literate and Latte forum: + +* + +# Quickstart Guide to MultiMarkdown # + +Quick start instructions, for those in a hurry... + + +## General Instructions ## + +1. Download the MultiMarkdown package: + + + +2. Unzip/untar it + +3. MultiMarkdown can be run from anywhere, but is easiest when installed in a "common" location: + + * Windows: + + * C:\Documents and Settings\All Users\MultiMarkdown + * C:\Documents and Settings\<user>\MultiMarkdown + + * Mac OS X or *nix + + * ~/Library/Application Support/MultiMarkdown (preferred on Mac OS X) + * ~/.multimarkdown + * /Library/Application Support/MultiMarkdown (preferred on Mac OS X) + * /usr/share/multimarkdown + +4. In the "bin" directory, there are a couple of perl scripts designed to take a MultiMarkdown text file and convert to XHTML, or LaTeX, or pdf. These scripts are designed to be able to be run from anywhere. You can leave them where they are, or install them somewhere in your path directory: + + * mmd2XHTML.pl + + * mmd2LaTeX.pl + + * mmd2PDF.pl + + * mmd2PDFXeLaTeX.pl + + * mmd2letter.pl + + +5. To use these files, do something like the following: + + cd MultiMarkdown + bin/mmd2XHTML.pl file.txt + + where "file.txt" is the MultiMarkdown file you wish to process. "file.html" will be created automatically + +6. You can now open `file.html` in your web browser, or do what you like with it. + + +[TextMate]: http://macromates.com/ +[Scrivener]: http://www.literatureandlatte.com/scrivener.html + + + +# MultiMarkdown Syntax Guide # + +This is a guide to the markup syntax used in the MultiMarkdown system. + +## Metadata ## + +MultiMarkdown has support for metadata, meaning that you can include +information about a document that is not necessarily part of the document +contents. + +To use metadata, simply add information to the top of a Markdown file: + + Title: A New MultiMarkdown Document + Author: Fletcher T. Penney + John Doe + Date: July 25, 2005 + +The key is the text before the colon, and the data is the text after the +colon. In the above example, notice that there are two lines of information +for the Author key. If you end a line with "space-space-newline", the newline +will be included when converted to other formats. + +There must not be any whitespace above the metadata, and the metadata block +ends with the first whitespace only line. The metadata is stripped from the +document before it is passed on to the syntax parser. + +While not required, I recommend including two spaces at the end of each line +of metadata. In this way, if you pass your document through a regular version +of Markdown, the metadata will be properly formatted as plain text with line +breaks, rather than joined into a single run-on paragraph. + +I have included information about some of the "standard" metadata keys --- I +welcome feedback and suggestions for additional standard keys that would be +useful. If you add keys that are not listed, they are included in the XHTML +and LaTeX as custom variables that can still be used if you desire. + +Remember, XHTML snippets have no means to use metadata. To make use of these +features, one must be using `Format: complete` to create full XHTML documents, +which can then be processed using XSLT to create other document types. As an +example, I use metadata for information that is used to add title, author, +keyword, and copyright metadata to PDF's created by MultiMarkdown. + +**Note**: I make multiple mentions to the use of these keys for LaTeX +documents. This is simply because the LaTeX output format currently makes the +most use of the metadata information. Any export format could be modified to +make use of additional metadata keys. + +### Address ### + +Use this to include the author's mailing address. You can have more than one +line in this field --- use two extra spaces at the end of a line, and a +newline character will be used in LaTeX. Also used as return address for +letterhead and envelope templates. + +### Author ### + +Self-explanatory. I strip this out to provide an author string to LaTeX +documents. Also used as the sender for letterhead and envelope templates. + + +### Affiliation ### + +Use this to include an organization that the author is affiliated with, e.g. a +university, company, or organization. You can include address information here +as well, or use the `Address`, `email`, `web`, and `phone` metadata fields. +You can have more than one line in this field --- use two extra spaces at the +end of the line, and a newline character will be used in LaTeX. + + +### Base Header Level ### + +Used by my XSLT script tool to change the default header level. For example, +if using the memoir class, you might want a first level header to be +interpreted as a chapter, rather than as a part. To do this, simply set `Base +Header Level` to `2`. + +### Base URL (Deprecated)### + +Deprecated - WikiWords and WikiLinks no longer supported. + + +### Bibliography Title ### + +Change the title used for the references section (e.g. "References" or +"Bibliography"). The default value is "Bibliography". + + +### Bibliography Style ### + +The name of the BibTeX style you wish to use. + + +### BibTeX ### + +This should be the name of a `.bib` file (a BibTeX file used to store +references). If you use my xhtml2latex.xslt file, this will convert external +citations into markup for BibTeX (see [Bibliography Support][] for more +information). + +You must have `bibtex` installed and working, and the `.bib` file must be in +your working directory. + +### Chapterstyle ### + +This is used to designate the `chapterstyle` in LaTeX memoir documents. + +### Copyright ### + +This can be used to provide a copyright string. + + +### CSS ### + +Used to specify a CSS stylesheet when creating the complete XHTML output. + + +### Date ### + +Provide a date for the document. + + +### Email ### + +Use this to include the author's email address. + +### Format ### + +Set to `complete` to indicate that a fully-formed XHTML document should be +produced. Such a document is ready for processing by an XSLT tool, such as the +XSLT files to convert XHTML into LaTeX. + +Set to `snippet` to indicate that no `` or other information should be +included. This might be useful for generating (X)HTML output ready for pasting +into a weblog, for example. + +**Note**: Some MultiMarkdown tools add this for you (e.g. TextMate using my +bundle, and Scrivener.) Duplicating the `Format` key in these programs should +not cause a problem --- let me know if you have trouble. + +### Keywords ### + +Provide a list of keywords for the document. I use these to add keywords to +PDF's that are produced as well. Keywords can be separated by commas, or +placed on separate lines. + + +### Language ### + +Currently, the language field is used to specify which version of +[SmartyPants] to use. In the future, it may be used for other purposes as +well. + +The languages are written using the English word (e.g. "german" not +"deutsch"). + +[SmartyPants]: http://daringfireball.net/projects/smartypants/ "SmartyPants Homepage" + + +### LaTeX XSLT ### + +Used to designate an XSLT file to convert an XHTML document to a LaTeX +document. The LaTeX document can then be converted to PDF by `pdflatex`. This +key used to be called `XSLT File`. + +### Pagestyle ### + +This is used to designate the `pagestyle` in LaTeX memoir documents. + +### Phone ### + +Use this to include the author's phone number(s). You can have more than one +line in this field --- use two extra spaces at the end of the line, and a +newline character will be used in LaTeX. + + +### Recipient ### + +Used by letterhead and envelope templates. + + +### Recipient Address ### + +Used by letterhead and envelope templates. + + +### Revision ### + +You can use a string to declare the current version of the document. Displayed +on the copyright page when using my memoir XSLT transform. + + +### RTF XSLT ### + +This key is used to provide an XSLT file that can alter the XHTML output prior +to conversion to RTF. Useful for further customizing the output of +MultiMarkdown specifically for the RTF format. I have no plans to create any +such files myself, but others may find it useful. + +*I strongly encourage you to use another route to convert XHTML to RTF. +I've had the best results with [Google Docs](htts://docs.google.com/). For +non-Mac users, that's definitely the way to go.* + +### Subtitle ### + +Used to provide a subtitle. It ends up in the meta tags, but can be extracted +by XSLT for other uses. + + +### Title ### + +Used to provide the official title of a document. This is set as the `` +string within the `<head>` section of an HTML document, and is also used by +other export formats. + + +### Use WikiLinks (Deprecated)### + +Set to `true` or `1` to enable the use of `WikiWords` and `[[Free Links]]`. +Requires that you also set `Base URL`. See [WikiLinks][] for more information. + + +### Web ### + +Use this to include the author's web URL. + + +### XHTML Header ### + +This is used to include raw XHTML information in the header of a document. You +can use this field to add information that will be included in the header of +the generated XHTML file. This can be CSS formatting data, or javascript code, +or just about anything. I am not responsible for getting that code to work. +MultiMarkdown just includes it as is. + +Anything included in this field is inserted, unaltered, in the `<head>` +section of the XHTML output. If you do add anything here, the XSLT stylesheet +may have to updated to ignore what you added if you want to convert to LaTeX. +Let me know what you add, and I can consider updating the XSLT stylesheet to +ignore it. Currently it ignores `<style>` sections. + + +### XHTML XSLT ### + +This is the name of the XSLT file to use to post-process the XHTML file. This +can be used to further customize the XHTML output generated by MultiMarkdown. +For example, the `xhtml-toc.xslt` file can add a Table of Contents to the +start of XHTML page. + + + +### XMP ### + +This is used to provide a file to be included using +[xmpincl](http://www.ctan.org/tex-archive/macros/latex/contrib/xmpincl/). +Basically, this adds the ability to provide Creative Commons Licensing +information in a PDF's [metadata](http://creativecommons.org/technology/xmp). +It can also be used for other purposes (beyond the scope of this document.) + + +### XSLT File (deprecated)### + +This metadata key has been deprecated in favor of `XHTML XSLT`, `RTF XSLT`, +and `LaTeX XSLT`. + +## Automatic Cross-References ## + +An oft-requested feature was the ability to have Markdown automatically handle +within-document links as easily as it handled external links. To this aim, I +added the ability to interpret `[Some Text][]` as a cross-link, if a header +named "Some Text" exists. + +As an example, `[Metadata][]` will take you to the +[section describing metadata][Metadata]. + +Alternatively, you can include an optional label of your choosing to help +disambiguate cases where multiple headers have the same title: + + ### Overview [MultiMarkdownOverview] ## + +This allows you to use `[MultiMarkdownOverview]` to refer to this section +specifically, and not another section named `Overview`. This works with atx- +or settext-style headers. + +If you have already defined an anchor using the same id that is used by a +header, then the defined anchor takes precedence. + +In addition to headers within the document, you can provide labels for images +and tables which can then be used for cross-references as well. + +## Image Support ## + +Obviously, images are handled just fine by Markdown (with the exception of +attributes as noted above.) However, without some more information, images are +not easily translated into other document formats (e.g. PDF). + +To handle this, my XSLT files will make use of `<img>` dimensions (e.g. +`height` and `width`). If present, the image will be scaled. If only one +dimension is specified, the image will be scaled proportionately. If neither +`height` nor `width` is specified, then the image will be scaled such that +it's width is the same as a column of text. This is to prevent high resolution +images from overflowing the page. Unfortunately, it has the side effect of +"zooming" in on smaller images. So, if you have images that are being scaled +in a way that you do not desire, simply specify at least one dimension. + +*Note: XHTML only allows for units of `px` and `%` on `<img>` tags. LaTeX +allows for several others. So, my XSLT file allows for other units to be used, +even if they screw up the XHTML version. You have to choose appropriate units +for your purpose. Unfortunately, the only way around this is to make sure that +all of your images contain actual dimension information, and then remove the +`\resizebox` part from the XSLT.* + +## Anchor and Image Attributes ## + +Adding attributes to links and images has been requested for a long time on +the Markdown discussion list. I was fairly opposed to this, as most of the +proposals really disrupted the readability of the syntax. I consider myself a +"Markdown purist", meaning that I took John's introduction to heart: + +> The overriding design goal for Markdown's formatting syntax is to make +> it as readable as possible. The idea is that a Markdown-formatted +> document should be publishable as-is, as plain text, without looking +> like it's been marked up with tags or formatting instructions. While +> Markdown's syntax has been influenced by several existing text-to-HTML +> filters, the single biggest source of inspiration for Markdown's +> syntax is the format of plain text email. + +Because there was not a syntax proposal that I felt fit this goal, I was generally opposed to the idea. + +Then, Choan C. Gálvez [proposed][galvez] a brilliantly simple syntax that +stayed out of the way. By simply appending the attributes to the link +reference information, which is already removed from the text itself, it +doesn't disturb the readability. + +[galvez]: http://six.pairlist.net/pipermail/markdown-discuss/2005-October/001578.html + +For example: + + This is a formatted ![image][] and a [link][] with attributes. + + [image]: http://path.to/image "Image title" width=40px height=400px + [link]: http://path.to/link.html "Some Link" class=external + style="border: solid black 1px;" + +This will generate width and height attributes for the image, and a border +around the link. And while it can be argued that it does look "like it's been +marked up with tags [and] formatting instructions", even I can't argue too +strongly against it. The link and the title in quotes already look like some +form of markup, and the the additional tags are hardly that intrusive, and +they offer a great deal of functionality. They might even be useful in further +functions (citations?). + +The attributes must continue after the other link/image data, and may contain +newlines, but must start at the beginning of the line. The format is +`attribute=value` or `attribute="multi word value"`. Currently, MultiMarkdown +does not attempt to interpret or make any use of any of these attributes. +Also, you can't have a multiword attribute span a newline. + + +## WikiLinks (Deprecated)## + + + +**Note:** The WikiLinks feature was more trouble than it was +worth, and has been removed. One can still use the wiki software +to manage these links. For example, my [MultiMarkdown Extension] for [Oddmuse] +supports Oddmuse styled WikiLinks. + +[MultiMarkdown Extension]: http://www.oddmuse.org/cgi-bin/wiki/Markdown_Extension + +## Footnotes ## + + +I have added support for footnotes to MultiMarkdown, using the syntax proposed +by John Gruber. Note that there is no official support for footnotes yet, so +the output format may change, but the input format sounds fairly stable. + +To create a footnote, enter something like the following: + + Here is some text containing a footnote.[^somesamplefootnote] + + [^somesamplefootnote]: Here is the text of the footnote itself. + + [somelink]:http://somelink.com + + +The footnote itself must be at the start of a line, just like links by +reference. If you want a footnote to have multiple paragraphs, lists, etc., +then the subsequent paragraphs need an extra tab preceding them. You may have +to experiment to get this just right, and please let me know of any issues you +find. + +This is what the final result looks like: + +> Here is some text containing a footnote.[^somesamplefootnote] + +[^somesamplefootnote]: Here is the text of the footnote itself. + +## Tables ## + + +I have implemented a syntax for tables similar to that used by Michael +Fortin's [PHP Markdown Extra][]. + +[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra + +Basically, it allows you to turn: + + | | Grouping || + First Header | Second Header | Third Header | + ------------ | :-----------: | -----------: | + Content | *Long Cell* || + Content | **Cell** | Cell | + + New section | More | Data | + And more | And more | + [Prototype table] + +into a [table][Prototype Table]. + +| | Grouping || +First Header | Second Header | Third Header | +| ---------- | :-----------: | -----------: | +Content | *Long Cell* || +Content | **Cell** | Cell | + +New section | More | Data | +And more | And more || +[Prototype table] + + +The requirements are: + +* There must be at least one `|` per line +* The second line must contain only `|`,`-`,`:`,`.`, or spaces +* Cell content must be on one line only +* Columns are separated by `|` +* The first line of the table, and the alignment/divider line, must start at + the beginning of the line + +Other notes: + +* It is optional whether you have `|`'s at the beginning and end of lines. + +* To set alignment, you can use a colon to designate left or right alignment, + or a colon at each end to designate center alignment, as above. If no colon + is present, the default alignment of your system is selected (left in most + cases). If you use a period character (`.`), then `char` alignment is used - + in the future this will allow columns of decimal formatted numbers to be + aligned on the decimal character. Browsers do not currently support this + feature, so it is somewhat useless at the moment. It could be used in an + XSLT stylesheet for other output formats (e.g. LaTeX). + +* To indicate that a cell should span multiple columns, there simply add + additional pipes (`|`) at the end of the cell, as shown in the example. If + the cell in question is at the end of the row, then of course that means + that pipes are not optional at the end of that row.... + +* You can use normal Markdown markup within the table cells. + +* Captions are optional, but if present must be at the beginning of the line + immediately preceding or following the table, start with `[`, and end with + `]`. If you have a caption before and after the table, only the first match + will be used. + +* If you have a caption, you can also have a label, allowing you to create + anchors pointing to the table. If there is no label, then the caption acts + as the label + +* Cells can be empty. + +* You can create multiple `<tbody>` tags within a table by having a **single** + empty line between rows of the table. This allows your CSS to place + horizontal borders to emphasize different sections of the table. + +* If there is no header for the first column, then cells in that column will + be treated as headers, and formatted as such. + + +## Bibliography Support ## + +I have included support for *basic* bibliography features in this version of +MultiMarkdown. Please give me feedback on ways to improve this but keep the +following in mind: + +1. Bibliography support in MultiMarkdown is rudimentary. The goal is to offer +a basic standalone feature, that can be changed using the tool of your choice +to a more robust format (e.g. BibTeX, CiteProc). My XSLT files demonstrate how +to make this format compatible with BibTeX, but I am not planning on +personally providing compatibility with other tools. Feel free to post your +ideas and tools to the wiki. + +2. Those needing more detailed function sets for their bibliographies may need +customized tools to provide those services. This is a basic tool that should +work for most people. Reference librarians will probably not be satisfied +however. + + +To use citations in MultiMarkdown, you use a syntax much like that for +anchors: + + This is a statement that should be attributed to + its source[p. 23][#Doe:2006]. + + And following is the description of the reference to be + used in the bibliography. + + [#Doe:2006]: John Doe. *Some Big Fancy Book*. Vanity Press, 2006. + +The XHTML that is generated is as follows: + + <p>This is a statement that should be attributed to its source + <span class="markdowncitation"> (<a href="#Doe:2006">1</a>, <span + class="locator">p. 23</span>)</span>.</p> + + <p>And following is the description of the reference to be used + in the bibliography.</p> + + <div class="bibliography"> + <hr /> + <p>Bibliography</p> + + <div id="Doe:2006"><p>[1] John Doe. <em>Some Big Fancy Book</em>. + Vanity Press, 2006.</p></div> + + </div> + +You are not required to use a locator (e.g. `p. 23`), and there are no special +rules on what can be used as a locator if you choose to use one. + +There are no rules on the citation key format that you use (e.g. `Doe:2006`), +but it must be preceded by a `#`, just like footnotes use `^`. + +As for the reference description, you can use Markup code within this section, +and I recommend leaving a blank line afterwards to prevent concatenation of +several references. Note that there is no way to reformat these references in +different bibliography styles; for this you need a program designed for that +purpose (e.g. BibTeX). + +If you want to include a source in your bibliography that was not cited, you +may use the following: + + [Not cited][#citekey] + +The `Not cited` bit is not case sensitive. + + +### MultiMarkdown References ### + +If you define your references (as in the example above), MultiMarkdown will +automatically append a basic bibliography to the end of your document. The +citations will of the form: + + <span class="markdowncitation"> (<a href="#citekey"># + </a>, <span class="locator">p. 23</span>)</span> + +If you don't define a locator, you will get: + + <span class="markdowncitation"> (<a href="#citekey"># + </a>)</span> + +When you click on the `#` (which is replaced with the specific reference +number), it takes you to the appropriate point in the Bibliography. Unlike +footnotes, there is no reverse link. + + +### External References ### + +If you do not define references, then MultiMarkdown will substitute different +markup that can be used by XSLT to transform it into markup for an external +tool, e.g. BibTeX. + + <span class="externalcitation"> (<a id="citekey">citekey</a>, <span + class="locator">p. 23</span>)</span> + +If you don't define a locator, you will get: + + <span class="externalcitation"> (<a id="citekey">citekey</a>)</span> + + +Obviously, the citekey that you use in MultiMarkdown must match that used by +your external tool. + +[MultiMarkdownDragAndDrop]: http://fletcherpenney.net/Applications_That_Support_MultiMarkdown#multimarkdowndraganddrop "MultiMarkdown Drag and Drop" + +### Multiple Citations ### + +When you need to combine multiple citations together, simply add them +serially: + + [p. 3][#Doe:1996][p. 10][#Smith:2005] + +giving the output: + + (1, p. 3) (2, p. 10) + +I recognize that this is not really a standardized format, but again I remind +you that the bibliography support in MultiMarkdown is minimal. If you want +more control, or adherence to proper style rules, you need a more powerful +bibliography tool. + +I have written a perl script that will join these serial citations into one, +`cleancites.pl`. It is run by default by the default MultiMarkdown usage +scripts. + +### BibTeX Support ### + +If you are a user of BibTeX, you may use it to control your references. Simply +set the `Bibtex` and `Bibliographystyle` metadata as described in the section +on [Metadata][], and use my xhtml2latex XSLT files as examples. + +If you use this, you are not required to define your references within your +MultiMarkdown document. + +### Advanced Citations with natbib ### + +Advanced LaTeX users are probably familiar with the +[natbib](http://www.ctan.org/tex-archive/help/Catalogue/entries/natbib.html) +package, which adds additional features for bibliographic citations. It offers +two new citation commands, `\citet` and `\citep`. + +To use the advanced natbib features: + +1. You must have the natbib package installed for LaTeX +2. You must use an appropriate XSLT file that enables the natbib package (`memoir-natbib.xslt` is an example - you can make your own) + + +By default, citations occur using the `\citep` command. + +To use a `\citet` citation, follow the example below: + + In their seminal paper, [Smith and Jones; p 42][#Smith1990] argue + convincingly that.... + + [#Smith1990]: Smith, R, and Jones, K. *Some Fancy Article* etc... + +The text before the semi-colon indicates that we want a textual citation. In +the XHTML version, the text you enter becomes the text in the sentence. When +converted to LaTeX, your text is actually removed and the natbib package +handles it for you. The text after the semi-colon is the usual locator text +(if you don't want a locator, just leave it blank after the semi-colon). + +If you don't include a semi-colon, then the `\citep` command is used in the +usual fashion. + +## Math Syntax ## + +### Introduction to Math support ### + + +**Note**: *Math support within MultiMarkdown is created using MathML. MathML +is not fully supported in many browsers, so your mileage may vary (I honestly +don't care whether Internet Explorer works --- get a real browser. Support +within Firefox is pretty good, but not perfect.) This feature is quite useful, +however, when generating a PDF via LaTeX.* + +*To view a file with MathML properly in Firefox, it must have the file ending +".xhtml". I don't know why, and it seems dumb that file extensions are so +important in 2007. But for now, that's the way it is.* + +MultiMarkdown supports [ASCIIMathML](http://en.wikipedia.org/wiki/ASCIIMathML) +a syntax for converting mathematical equations from plain text into +[MathML](http://en.wikipedia.org/wiki/MathML). MathML can be used within +properly formatted XHTML documents to display well typeset mathematical +formula. + +The conversion used to managed by +[ASCIIMathPHP](http://www.jcphysics.com/ASCIIMath/), which was a PHP script +that had to be run separately from MultiMarkdown itself. As of version +2.0b.b4, however, I am using the +[Text::ASCIIMathML](http://search.cpan.org/~nodine/Text-ASCIIMathML-0.5/) Perl +module for support built into the MultiMarkdown script. + +### MultiMarkdown Math Syntax ### + +Basically, use use `<<` and `>>` as delimiters to indicate that you are +including math in your document. You can use this to create an inline formula, +or you can create independent equations, each in it's own paragraph. These can +also then be converted properly into LaTeX math environments. + +Additionally, you can include a `[label]` tag at the end of the equation to +allow you to reference it elsewhere in your text with the label. For example: + + << e^(i pi) + 1 = 0 [Euler's identity]>> + + << x_(1,2) = (-b+-sqrt(b^2-4ac))/(2a) [quadratic equation solution]>> + + You can also include formulas within a sentence, such as + <<x^2 + y^2 = 1>>. You can then make a reference to + [Euler's identity]. + +is converted into: + +> << e^(i pi) + 1 = 0 [Euler's identity]>> + +> << x_(1,2) = (-b+-sqrt(b^2-4ac))/(2a) [quadratic equation solution]>> + +> You can also include formulas within a sentence, such as +> << x^2 + y^2 = 1>>. You can then make a reference to [Euler's identity]. + +### Superscripts ### + +By using the math mode above, you can include superscripts and the like in +MultiMarkdown documents that don't necessarily have to be separate formulas. +For example: + + <<2^pi>> + +becomes + +> <<2^pi>>. + +This is, of course, subject to the same limitations as MathML in general. + +### MathML Difficulties ### + +There are some glitches in this process. First, many browsers don't fully +support MathML, and sometimes you have to go through great lengths to get the +browser to recognize it properly. Firefox, for instance, requires an `.xhtml` +extension to properly recognize the file as `XHTML` instead of `HTML`. This +may not be an ideal solution for everybody, but it **does** allow you to use a +plain english syntax to represent mathematical formulas and symbols within +Markdown documents, which was my goal. Others may prefer to use custom +solutions using raw LaTeX source, but I didn't want to have to learn the LaTeX +math syntax. + +On the up side, however, this does give wonderful output when combined with my +XSLT scripts to generate LaTeX documents and PDF's. I am open to input on this +feature, and suspect it will become increasingly useful as browser support for +MathML improves. + +For more information on supporting MathML in web browsers, I have written a +brief introduction to +[Supporting MathML](http://fletcherpenney.net/Supporting_MathML) on my web +site. + + +## Definition Lists ## + +MultiMarkdown has support for definition lists using the same syntax used in +[PHP Markdown Extra][]. Specifically: + + Apple + : Pomaceous fruit of plants of the genus Malus in + the family Rosaceae. + : An american computer company. + + Orange + : The fruit of an evergreen tree of the genus Citrus. + + +becomes: + +> Apple +> : Pomaceous fruit of plants of the genus Malus in +> the family Rosaceae. +> : An american computer company. +> +> Orange +> : The fruit of an evergreen tree of the genus Citrus. + +You can have more than one term per definition by placing each term on a +separate line. Each definition starts with a colon, and you can have more than +one definition per term. You may optionally have a blank line between the last +term and the first definition. + +Definitions may contain other block level elements, such as lists, +blockquotes, or other definition lists. + +Unlike PHP Markdown Extra, all definitions are wrapped in `<p>` tags. First, I +was unable to get Markdown *not* to create paragraphs. Second, I didn't see +where it mattered - the only difference seems to be aesthetic, and I actually +prefer the `<p>` tags in place. Let me know if this is a problem. + +See the [PHP Markdown Extra][] page for more information. + +## Appendices ## + +If you want to designate the final subgroup of chapters as appendices, you can include an `h1` or `h2` level header (as appropriate based on your document) with the title `Appendices`. The chapters that follow would be considered appendices when the document is converted to LaTeX using the memoir class. Since XHTML doesn't have a concept of appendices, it has no real meaning, but would at least designate this to the reader. + +## Glossaries ## + +MultiMarkdown has a feature that allows footnotes to be specified as glossary +terms. It doesn't do much for XHTML documents, but the XSLT file that converts +the document into LaTeX is designed to convert these special footnotes into +glossary entries. + +The glossary format for the footnotes is: + + [^glossaryfootnote]: glossary: term (optional sort key) + The actual definition belongs on a new line, and can continue on + just as other footnotes. + +The `term` is the item that belongs in the glossary. The `sort key` is +optional, and is used to specify that the term should appear somewhere else in +the glossary (which is sorted in alphabetical order). + +Unfortunately, it takes an extra step to generate the glossary when creating a +pdf from a latex file: + +1. You need to have the `basic.gst` file installed, which comes with the +memoir class. + +2. You need to run a special makeindex command to generate the `.glo` file: + ``makeindex -s `kpsewhich basic.gst` -o "filename.gls" "filename.glo"`` + +3. Then you run the usual pdflatex command again a few times. + +Alternatively, you can use the code below to create an engine file for TeXShop +(it belongs in `~/Library/TeXShop/Engines`). You can name it something like +`MemoirGlossary.engine`. Then, when processing a file that needs a glossary, +you typeset your document once with this engine, and then continue to process +it normally with the usual LaTeX engine. Your glossary should be compiled +appropriately. If you use [TeXShop][], this is the way to go. + +**Note**: *Getting glossaries to work is a slightly more advanced LaTeX +feature, and might take some trial and error the first few times.* + + + #!/bin/ + + set path = ($path /usr/local/teTeX/bin/powerpc-apple-darwin-current + /usr/local/bin) # This is actually a continuation of the line above + + set basefile = `basename "$1" .tex` + + makeindex -s `kpsewhich basic.gst` -o "${basefile}.gls" "${basefile}.glo" + + +[TeXShop]: http://www.uoregon.edu/~koch/texshop/ "TeXShop Homepage" + +## Poetry Mode ## + +By default, when you have a section of text indented with a tab, MultiMarkdown +interprets this as a code block. This allows you to more exactly control the +spacing and line endings, but it also applies a monospace font in both the +XHTML and LaTeX outputs. This is the usual way of demonstrating source code in +documents. + +Some authors, however, don't write about source code, but would like a way to +control line endings (when writing poetry, for example). + +To accomplish this, there are several alternate XSLT files included within the +MultiMarkdown distribution that are labelled with a `poetry` filename. These +XSLT files handle the code blocks in a slightly different way to make them +more suitable for text, rather than code. I encourage you to give this a try. + +At the current time, there is no way to use both formats within the same +document, except to format them manually. This may change in the future, +depending on some decisions John Gruber needs to make about the standard +Markdown syntax. + +## Miscellanea ## + +In addition to what is mentioned elsewhere in this document, MultiMarkdown +does a few things slightly differently: + +* `©` entities are converted to `©` so that they can pass through an + XSLT parser + +* `*` and `_` are not interpreted as `<strong>` or `<em>` when they occur in + the middle of words. This caused too many problems with URL's. + +MultiMarkdown supports the conversion of colored spans of text from XHTML to +LaTeX using the xcolor package. For example: + + <span style="color:#888888">net</span> + +becomes: + + {\color[HTML]{888888} net} + +There is not currently a syntax shortcut for this, you have to manually add +the `<span>` information. This technique is used to support annotations from +Scrivener, for example. + +[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/ + +# MultiMarkdown and LaTeX # + +[LaTeX](http://www.latex-project.org/) is a professional quality typesetting +system that can be used to take plain text markup and produce a high quality +pdf, complete with table of contents, index, glosssary, etc. It's a fairly +complicated program, but capable of doing most of the work for you. One of my +goals with MultiMarkdown was to make it even easier to create a LaTeX +document, with minimal knowledge of the LaTeX syntax. In fact, you can create +fairly complex documents without any understanding of how LaTeX works, as long +as you have it installed correctly. + + +That said, MultiMarkdown is not simply a preprocessor for LaTeX files, so +there will always be LaTeX commands that are just not available from within +MultiMarkdown. If you're a LaTeX expert, you might find that after +MultiMarkdown runs, you want to go and hand tweak a few parts to get things +just right. But for the average user and average document, I suspect the +default output will be just fine. + +The settings to pay particular attention to: + +* You must choose an XSLT file to convert the MultiMarkdown-generated XHTML + into LaTeX; you do this by setting the `LaTeX XSLT` metadata. If you do not + choose one, the default is `memoir.xslt`. Most of my XSLT files are based + around the `memoir` package --- it's the one I'm familiar with, it's very + flexible, and has high quality output, and lots of features. That said, you + are welcome to create your own XSLT files to use whatever packages you + prefer. The beauty of the XSLT transformation process is that it can be + completely reconfigured however you like. + +* Depending on what sort of document you are creating, you may need to set the + `Base Header Level` metadata. For example, if you are creating a `memoir` + based document, and wish for your top-level section to be a chapter, rather + than a "part", you could set `Base Header Level` to 2. It's easier to do + than explain, but basically it moves all levels of your structure by the + specified number of steps. + +* You likely will want to set as much of the basic metadata as possible (e.g. + `Title`, `Author`, `Date`, `Keywords`, etc) as most of this is converted to + a format that is used in the resulting PDF. + +Also, MultiMarkdown has support for +[BibTeX](http://en.wikipedia.org/wiki/BibTeX), glossaries, html links, +internal links between sections of the document, math formatting, etc. Most of +the "major" features of LaTeX are available using the standard MultiMarkdown +syntaxes. If there is something you don't see, just ask --- it may exist, or I +might be able to add it if appropriate. + +The general process of creating a PDF via LaTeX is the same as the normal use +of MultiMarkdown, with one additional step: + +1. Create your text source file + +2. Using your method of choice, convert the text file to XHTML, and then +convert the XHTML to LaTeX (most of my tools will do this as a single step as +far as the user is concerned). + +3. Convert the LaTeX source file to PDF using the tool of your choice (my Drag +and Drop [application](http://fletcherpenney.net/MultiMarkdown_Drag_and_Drop), +[TeXShop], [latexmk](http://www.phys.psu.edu/~collins/software/latexmk-jcc/), +manually, etc.) + +Due to the complexity of the LaTeX source, it can be hard to troubleshoot when +using an automatic tool. If something doesn't work, I recommend first trying +to get your MultiMarkdown text file converted to XHTML and verify that it is +correct. Then convert the XHTML to LaTeX and be sure that you can watch the +status messages that occur during processing of the LaTeX file - they will +usually give you a hint as to where the problem lies. Remember, just because +the XHTML version of a MultiMarkdown document is valid XHTML does not mean the +resulting LaTeX will be totally valid. + +[TeXShop]: http://www.uoregon.edu/~koch/texshop/ "TeXShop Homepage" + + +# Advanced Features and Customization # + +I believe that MultiMarkdown works pretty well "out of the box" for the vast +majority of users (of course, I'm not biased or anything...) But more advanced +users will eventually start thinking about features that they wish existed. +Some of these features are very specific to their own documents and style, but +others are more general and would be of use to everyone. + +## How do I find out about feature x? ## + +My recommended approach is: + +1. Make sure you check through the documentation on the web site (there is a +search feature). An increasing number of feature requests are for things that +already exist. + +2. Check the MultiMarkdown discussion list to see if someone has already +suggested your feature, or better yet, has already solved it. + +3. Decide whether it's something you could try and do yourself, or whether you +need to ask for help to accomplish it. Either way, the results can be shared +on my web site to help others. + +## How do I customize MultiMarkdown? ## + +The first step in trying to customize MultiMarkdown is to figure out where in +the workflow the customization needs to occur: + +1. Does the MultiMarkdown perl script need to be modified to add a new syntax, +or change the way the output is generated? There should be fewer and fewer +necessary changes in this step as the MultiMarkdown syntax matures. Also, note +that I am hesitant to add new features at this level that increase the +complexity of markup. It's not impossible, but I will definitely need to be +convinced it's the only way to go. + +2. Can the desired feature be implemented through a modification of one of the +XSLT files? XSLT is a powerful tool, and can be used to really customize the +XHTML or LaTeX output from a MMD document. (*Many users would likely benefit +from a generic XHTML to RTF XSLT stylesheet - I have been unable to locate one +that would work, and I have no need of RTF documents. This would be too much +work for too little gain for me, but I am sure someone out there needs exactly +this sort of tool.*) Browse through the `XSLT` directory and look to see if +there is a stylesheet that could be modified to do what you want. The XSLT +syntax is not that complicated, but does take some getting used to. As +examples, the `xhtml-toc.xslt` script parses the header tags in the XHTML +output, and creates an automatic table of contents at the top of the XHTML +file. The `xhtml-poetry-support.xslt` file looks for code blocks that start +with `[poetry]` and changes them to a poetry mode, rather than code (basically +removing the monospace font). + +3. Does the desired feature need to be implemented in a separate +post-processing script? For example, for LaTeX documents I use a script called +`cleancites.pl` that looks for strings of multiple citations to shorten the +syntax. You could easily create a script to do whatever you like and +incorporate it into your work flow. + + +In summary, a great many features and customizations can be added to +MultiMarkdown by users. I also recommend that you consider sharing any of your +customizations back to the MultiMarkdown community - I am happy to put any +files or links on my site, if you are interested. + +## Where do I dig in the MultiMarkdown package to find out more? ## + + +Again, places to look for inspiration: + +* MultiMarkdown/bin - this is where the "glue" scripts live that manage + different MultiMarkdown workflow patterns. You can create your own shell + scripts that can add additional steps to your workflow here. + +* MultiMarkdown/Utilities - a couple of utility scripts and the + `cleancites.pl` post-processing script live here; you can add files here and + incorporate them into your work flow. + +* MultiMarkdown/XSLT - XSLT files for modifying XHTML files or creating LaTeX + files go here. Lots of examples for different styles of output or + customizing the way various features work. + +* <http://fletcherpenney.net/XSLT_Files> - this is where I will place various + user submitted files that may be of interest, or offer a starting point for + further customization. Please consider submitting your own improvements here + as well. + +# Component Software # + +The MultiMarkdown system is actually a patchwork of multiple programs, which +are run in a specific order by shell scripts. I have written the glue +utilities, and the MultiMarkdown modifications to John Gruber's original +Markdown program, but I can't take credit for the rest. + + +## MultiMarkdown [MMD] ## + +* by Fletcher T. Penney +* <http://fletcherpenney.net/MultiMarkdown> + +MultiMarkdown is my update to John Gruber's +[Markdown](http://daringfireball.net/projects/markdown/) software. It is what +this bundle is based on. To learn more about why you would want to use this +bundle, check out the web page for MultiMarkdown. + +## SmartyPants ## + +* by John Gruber +* <http://daringfireball.net/projects/smartypants/> + +SmartyPants is another program by John Gruber, and is designed to add "smart" +typography to HTML documents, including proper quotes, dashes, and ellipses. +Additionally, there are several variations of the SmartyPants files to handle +different localizations (specifically, Dutch, French, German, and Swedish). +These localizations were provided by Joakim Hertze. + +## Text::ASCIIMathML ## + +* by Mark Nodine +* <http://search.cpan.org/~nodine/> + +This perl module adds support for converting the ASCIIMathML syntax into +MathML markup suitable for inclusion in XHTML documents. + +## ASCIIMathPHP (Deprecated)## + +* by Kee-Lin Steven Chan +* <http://www.jcphysics.com/ASCIIMath/> + +This bundle includes the MultiMarkdown specific variant of the original +ASCIIMathPHP. It allows you to use the ASCIIMath syntax to describe +mathematical formulas in plain text language. + +This software has been replaced by Text::ASCIIMathML. + +## XSLTMathML ## + +* by Vasil Yaroshevich +* <http://www.raleigh.ru/MathML/mmltex/index.php?lang=en> + +This bundle includes the MultiMarkdown specific variant of the original +XSLTMathML. It converts XHTML with MathML markup into LaTeX math environment +code. Very handy for making well typeset documents that are math-heavy. + +# Applications That Support MultiMarkdown # + +There are several applications and utilities out there that include support +for MultiMarkdown, that can make it even easier to create your output +documents. + +If you know of something not included here, please let me know. + + +## Movable Type ## + +MultiMarkdown can be used with Movable Type. To install: + +1. Place `MultiMarkdown.pl` in the `mt/plugins/Markdown` directory +2. Copy `ASCIIMathML.pm` into the same directory +3. Make sure `SmartyPants.pl` is also there + +Now MultiMarkdown should be working with Movable Type. For some reason, +however, it seems somewhat temperamental at times. I haven't been able to +figure out why, but it works for me on my local machine and on my host's +server. It has also worked for other users. + + +## MultiMarkdown Drag and Drop ## + +Early on, as MultiMarkdown became increasingly powerful (and complex) I +realized that most people would want something a little easier to use than +what had become a rather complicated command line string. + +The first solution was a set of Drag and Drop applications created using +[Platypus]. These were designed to allow you to drop a MultiMarkdown text file +on the application icon, and they spit out a .xhtml, .pdf, .rtf, or .tex file, +depending on which application you used. + +These utilities are still available, and have been updated to work with the +"Common" MultiMarkdown Installation: + +* <http://files.fletcherpenney.net/MultiMarkdownDragAndDrop.zip> + + +[Platypus]: http://sveinbjorn.sytes.net/platypus "Platypus Homepage" + +## Scrivener ## + +[Scrivener] is a: + +> ... project management tool for writers that acts like your own +> little writing shed at the bottom of the garden, where you have +> cork notice-boards, ring-binders, photos, clippings paperclipped +> to jottings, notebooks and reams of typewritten pages piling up +> - along with a secretary who keeps it all in neat piles and uses +> his speed-reading skills to find what you need as soon as you need +> it. [#Blount][] + +As of beta 3, Scrivener has the ability to export to a MultiMarkdown text +file, or to run the conversion utilities to create XHTML, RTF, or LaTeX files. +It also has support for MultiMarkdown metadata. + +Scrivener's strengths, as they relate to MultiMarkdown, included the ability +to arrange and re-arrange your document as desired using its outliner view, +cork-board, and other features. It also has some limited ability to convert +RTF bold and italic formatting into MultiMarkdown syntax, which can be useful +when converting documents from other formats. + +Scrivener is primarily focused towards creative writing, but when combined +with MultiMarkdown it is very useful for academic and technical writing where +a LaTeX file is highly desirable. + +Keith Blount has done a great job with Scrivener, and I was happy to be able +to help implement support for MultiMarkdown. I look forward to helping to +continue to use and refine this program myself. + +At this time, Scrivener is in public beta, and should be available for +purchase towards the end of 2006 or beginning of 2007. But the beta is very +usable as is, and gives you until Jan 2007 or so to try it out. + +For more information, I have created a User's Guide to MultiMarkdown and +Scrivener: + +* <http://fletcherpenney.net/Using_MultiMarkdown_with_Scrivener> + +[#Blount]: Literate and Latte - Scrivener. +<http://www.literatureandlatte.com/scrivener.html> + +## OmniOutliner ## + +I have written an export plugin for OmniOutliner that allows you to craft your +MultiMarkdown documents within OmniOutliner, and then export to a text file +(or folder with text file and images), that can then be processed with +Markdown or MultiMarkdown. + +<http://fletcherpenney.net/multimarkdown/multimarkdown_and_omnioutliner/> + +## TextMate ## + +[TextMate][] is a powerful text editor that: + +> brings Apple's approach to operating systems into the world of text +> editors. By bridging UNIX underpinnings and GUI, TextMate cherry-picks +> the best of both worlds to the benefit of expert scripters and novice +> users alike.... + +> Created by a closet UNIX geek who was lured to the Mac platform by +> its ease of use and elegance, TextMate has been referred to as the +> culmination of Emacs and OS X and has resulted in countless requests +> for both a Windows and Linux port, but TextMate remains exclusive for +> the Mac, and that is how we like it![#macromates][] + +TextMate is somewhere between a text editor for programmers, and a writing +tool. If you like being able to customize your writing environment, and like +fancy tools to handle the formatting for you, then TextMate might be the app +for you. + +Allan Odgaard created an initial Bundle that added Markdown support to +TextMate. It included some basic MultiMarkdown support as well. But to be +honest, *I* had trouble getting it to work. And if I had difficulty, I can +only imagine how much trouble others had. + +So I created my own Bundle. It includes a lot of features that automatically +format metadata, lists, tables, headers, etc. It can clean up the text to make +it look as presentable as possible in plain text, and it can then +automatically convert your text into XHTML, RTF, Word, or LaTeX/PDF. + +I have subsequently rewritten this bundle as a fork of the original on github. +This should make it easier to incorporate changes, and possibly to merge the +two projects into a single bundle. + +* <http://fletcher.github.com/markdown.tmbundle/> + + +[#macromates]: TextMate --- The Missing Editor for Mac OS X. +<http://macromates.com/> + + +## Using Scrivener and TextMate Together ## + +It is possible, using the "Edit in TextMate" feature from TextMate. Basically, +it adds the ability to edit any Cocoa based text editor view in TextMate. This +allows you to edit the text from a Scrivener document in TextMate, in order to +take advantage of the automatic formatting, while still retaining the +organizational features of Scrivener. + +This feature has its limitations (it breaks the undo stack in Scrivener) and +is only for advanced users. I take no responsibility for it, as I didn't write +Scrivener or TextMate. But it can be useful... + +To learn more, check out the information on Cocoa Text Fields: + +* <http://macromates.com/textmate/manual/using_textmate_from_terminal> + +## The "Common" MultiMarkdown approach ## + +During beta testing of the MultiMarkdown support with Scrivener, it was +proposed that having a standard location for MultiMarkdown could make it easy +to integrate with various applications, and to allow the user a single place +to update their MultiMarkdown files, independent of the application it was +being used with. + +For Mac OS X users, this boils down to allowing a MultiMarkdown installation +to be placed in one of two locations, where it is available to any application +that knows to look for it there: + +* ~/Library/Application Support/MultiMarkdown + +* /Library/Application Support/MultiMarkdown + +The first is available only to the user, and the second is available to anyone +on that computer. + +When Scrivener, or another application that supports this feature is run, it +checks to see if a MultiMarkdown installation is available in either of those +places. If not (the first time you run the program, for instance), then some +programs might install a version of MultiMarkdown here; others might simply +use an a copy of MultiMarkdown embedded within the application bundle. + +The benefit of this approach is that if I update MultiMarkdown, you can simply +replace the updated files in the Application Support folder, without having to +update the other applications. + +Please let me know if you have suggestions on improving this feature, or if +you are interested in including support for MultiMarkdown in your own +application. + +Naturally, this approach only works with Mac OS X. If anyone is interested in +working on a similar feature for other operating systems, please let me know. + +## Create Your Own ## + +Between shell scripts, applescripting, Automator, and other tools, you can +usually find an easy way to incorporate MultiMarkdown into your own workflow. +If you find something that you think should be added here, let me know! + + + +# Technical Issues # + +The MultiMarkdown system is actually a fairly complex group of programs, which +includes multiple perl utilities, a PHP program, and multiple XSLT files. With +some hand waving, I try to make it look like a single coherent program, but it +actually uses multiple utilities written by multiple people. + +This section is designed to address some of these issues, and implications +they may have for users, programmers, etc. + + +## XML Namespace Issues ## + +As of version 2.0.a3, there has been a complete overhaul of the way XML +namespaces are handled. This required changing all of the XSLT files to use an +"html" alias for the "http://www.w3.org/1999/xhtml" namespace. + +It appears to be working, including support for MathML. + +If you have any custom XSLT files, you will need to make the same changes, +specifically: + +Make your stylesheet declaration look like: + + <xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + +And relabel any references to XHTML elements, so that they are preceeded by "html:", e.g. + + <xsl:template match="/"> + <xsl:apply-templates select="html/head"/> + <xsl:apply-templates select="html/body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + +should look like this: + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + +I have left the `-novalid` and `-nonet` options in place to prevent +unnecessary errors when you are not connected to the internet, but these could +be removed if desired. + +## XeLaTeX Tips ## + +If you are using XeLaTeX to process your document (useful for utilizing Mac OS X fonts in your document), you want to use font declarations like this: + + \font\addressbold="Garamond Bold:mapping=tex-text" at 8pt + +By including the ":mapping=tex-text" portion, you regain use of smart quotes, en- and em- dashes, etc. I'm sure most XeLaTeX users know this, but it took me a bit of trial and error to discover it.... + + +# Acknowledgments # + +Thanks to the individuals and groups below for their contributions to +improving Markdown and MultiMarkdown: + +* John Gruber +* Michel Fortin +* Jonathan Weber +* Mark Eli Kalderon +* Choan C. Gálvez +* Dr. Drang +* Robert McGonegal +* David Green +* Trey Pickard +* Saleem +* Melinda Norris +* Sean Wallace +* Allan Odgaard +* Stefan Brantschen +* Keith Blount +* Amber Vaesca +* Gerd Knops +* John Purnell +* Jonathan Coulombe +* Jason Bandlow +* Joakim Hertze +* Kee-Lin Steven Chan +* Vasil Yaroshevich +* Matt Neuburg +* James Howison +* Edward Nixon +* etherean +* Özgür Gökmen +* Chad Schmidt +* Greg (gr) +* Ben Jennings +* Silvan Kaiser +* Tomas Doran +* Rob Walton +* Dan Rolander +* Duoyi wu +* Dan Dascalescu +* Ingolf Schäfer +* Chris Bunch +* Oblomov +* Alex Melhuish +* Stephan Mueller +* Josh Brown +* Rob Person +* Matthew D. Rankin + +and others I have surely forgotten.... + + + +# Known Issues # + +* The `<<...>>` syntax can cause only the first `<` to be encoded as `<` if + there is no trailing space (e.g. `<<something>>` vs. `<< something >>`). I + suspect that I will have to manually look for any `<<` and convert them. I + guess this is technically an issue with Markdown and not MultiMarkdown, but + it has apparently not come up before. + +* I tried to remove dependence on the `varwidth` package. This screws up the + formatting of footnotes in tables, and also RTF exporting of tables. I'm not + sure what to do - varwidth is incompatible with xcolor and is not a standard + package. Suggestions welcome. + +* Creating a link to an image by label doesn't work properly anymore + +* I'm having difficulty with getting the glossary feature to work in the + non-memoir classes. At some point I will look into this, but if someone else + out there can point out what I'm doing wrong, let me know. + +* RTF support currently only exists for Mac OS X. Conversion from XHTML to RTF + happens via Apples `textutil` tool. It is possible to write an XSLT file + that converts from XHTML to RTF, but I have little to no interest in + writing this myself, as I don't really use the RTF format very often. If + someone were interested in developing this, I would help out. An added + benefit would be that the XSLT could actually do a better job than Apple's + tool in terms of footnote support and internal links. Contact me if + you're interested. In the meantime, I suggest using [Google Docs][] to + import the XHTML file, and then export as an RTF. It does a much better + job. + +* The sample MMD file creates two copies of the footnote in the `MultiMarkdown + vs. Crayons` table, even though I only call for one. Not sure where the `a` + footnote comes from.... Any help in tracking this down would be appreciated, + as it didn't used to do this. + + +[Google Docs]: http://docs.google.com/ + + +# Things to Do # + +* Add a syntax to allow comments that can be stripped before passing the + output to the parser + +* write a routine (that would be separate from MultiMarkdown) to download + linked images, save them to a tmp directory, and then convert them for use + within a pdf. + +* Decide on appropriate management of alignment when a cell spans multiple + columns. Currently, the alignment of the first cell is used. (If Markdown + goes to a whitespace-based alignment option, that could be used in this + instance.) + +* Consider whether there is a reasonable syntax for table cells that span + multiple rows. + +* Consider a syntax for superscripts (this has been discussed before) - could + convert it to MathML syntax? Or just use math markup instead as described in + [Superscripts]. + +* Certain markup gets processed within headers and shouldn't, e.g. `<img>` + +* Consider whether to incorporate the definition list syntax into a footnote + to specify a glossary entry (or perhaps even without the footnote), or + whether to leave well enough alone. + + +# Version History # + +> Release early, release often! +> > Linus Torvalds + +* 2.0.b6 - Fix support for base header level with Setext-style headers (thanks + to Rob Walton); improve Windows support; + +* 2.0.b5 - spaces at end of xslt filenames won't cause failure; use `\url{}` + for "non-referenced" url's in LaTeX to allow linebreaks (though they still + don't always break correctly --- this is a problem with `hyperref` not MMD); + don't convert `^` to exponents in the `clean-text-allow-latex.xslt` file so + that math code works properly; the S5 XSLT file at least partially works + again now; update the TextMate bundle to work with Leopard; updated the + envelope and letterhead files; include `6x9book-real-poetry` XSLT that uses + memoir's poetry features fairly well; rework the `clean-text` files to make + them easier to update in the future and more modular; XHTML comments are now + passed through as raw LaTeX; unescape encoding within comments; + +* 2.0.b4 - empty labels for headers now produce valid XHTML (e.g. no `id=""`); + fix bug in `clean-text.xslt` that caused a problem with closing double + quotes; the `.xslt` extension is no longer required in metadata; added + customizable letterhead XSLT; fix bug in table support that choked on extra + spaces at end of lines; *Major Change*: switched to Text::ASCIIMathML for + math support, meaning that everything is once again perl based (this enables + math features on web sites using MultiMarkdown, for example); fix bug that + occurred when 'Abstract' was not the first chapter; + +* 2.0.b3 - move the `clean-text` routine from `xhtml2latex.xslt` into it's own + file (to allow easier modification by users); create alternate version that + does not protect certain characters in order to allow raw LaTeX code to be + passed through; added `latex-snippet.xslt` stylesheet for inclusion in + outside LaTeX template systems; added `xhtml-poetry-support.xslt` and + `xhtml-toc.xslt` to demonstrate how to extend MMD functionality for XHTML + output with new system; fix bug in SmartyPants that processed typography + within `<style>` sections (thanks AmberV); fix handling of links by + reference in headers and handling of attributes when links are referenced + multiple times (thanks to Edward Nixon); fix bug in epigraphs (thanks + etherean); improve id generation for footnotes - e.g. match behavior of PHP + Markdown Extra (thanks to Özgür Gökmen); fix bug in id generation for ToC + for XHTML documents; fix problem with `\ldots` command (thanks to etherean + and James Howison); fix issue with ` ` and tilde character; fix bug + where footnote special characters were not unescaped (thanks to Chad + Schmidt); clean up documentation a bit; + +* 2.0.b2 - fix processing of footnotes so that ending in a blockquote doesn't + break validity; fix bug in `letter.xslt`; overhaul XSLT system to allow for + different XSLT files for different output formats (e.g. HTML, RTF, LaTeX); + +* 2.0.b1 - fix bug in `_StripLinkDefinitions` that prevented detection of + single character labels; change `\textwidth` to `\linewidth` in LaTeX export + XSLT files (let me know if this causes problems); add Windoze compatibility + to the perl scripts (thanks to Jason Bandlow for pointing out this problem, + as well as for suggesting a fix);fix issues with glossary support and + document the process; complete overhaul of the way namespaces are handled + (`stripnamespace.pl` is no longer needed, XSLT files are rewritten, `-nonet` + and `-novalid` should be optional for xsltproc); update the Drag and Drop + applications to use the "Common" MMD Installation; update to Markdown + 1.0.2b8 codebase; add support for natbib and `\citep` and `\citet`; + +* 2.0.a2 - fix some minor problems with XSLTMathML; allow math to be enclosed + in parentheses; change matching for bottomrule in tables; improve handling + of tables with no header row (only a header column); + +* 2.0.a1 - strip spaces from metadata keys for XHTML validity; make XHTML + footnote output more compatible with Gruber's website and PHP Markdown + Extra; update XSLT to address these changes (*Note*: this breaks + compatibility with prior versions); add support for definition lists; fix + bug when escaping WikiWords in code; add `XHTML Header` metadata, and update + XSLT to ignore `<style>` tags; add support for the `XSLT File` metadata tag, + which allows a single command to parse any MultiMarkdown file; add + additional XSLT files; add the multimarkdown2XHTML.pl and related commands; + article XSLT now uses the article option in memoir, rather than the article + class; delete the report class (use memoir instead); fix a **lot** of + "minor" bugs; add the "6x9book.xslt" option; allow custom cross-reference + labels to headers; give preference to defined links over automatic + cross-references; add "poetry" versions of several XSLT files (treat code + blocks as formatted text, rather than code --- useful for formatting poetry) + +* 2.0.a - New version numbering scheme; update to Markdown.pl 1.0.2b7 code; + add support for `[link reference]` shortcut syntax (i.e. no trailing `[]`) + for MultiMarkdown crossrefs; add an extra newline in verbatims to add space + before the next paragraph; synchronize numbering schemes of all related + MultiMarkdown tools to make it easier to ensure compatibility; add revision + numbers to source documents to help track incompatibilities; add LaTeX + support for `i.e.` and `e.g.`; TextMate MultiMarkdown bundle available; + update MultiMarkdownDragAndDrop tools to new codebase; now distributed as a + zipfile. + +* 1.0.1Multi19.4 - major update; fix issue where cross-references to images + defined by alt text had to follow the image in the document; add support for + MathML via ASCIIMathPHP; change `name` to `id` for footnotes; move + _DoHeaders in front of _DoTables to allow cross-references inside tables; + fix handling of citations without locator; a table with no header titles and + no column alignment row is interpreted as a pull-quote - this is + experimental and may be changed; the `Bibliography Title` metadata field is + available for LaTeX to rename the bibliography section; multiple changes to + XSLT files to improve compatibility; support for `<< math >>` syntax using + ASCIIMathPHP; change `HeaderLevel` to `Base Header Level` and process it in + XSLT rather than in the OmniOutliner tool; support for `Affiliation` + metadata element; add equation label to possible cross-reference list; + compatible with epigraph feature for XSLT conversion to LaTeX; document + table labeling feature and default to caption if no label present; + +* 1.0.1Multi19.2 - require leading space before unescaping \WikiWord; fixed + bug where attributes not included with images; add `Bibliography Title` + metadata key; fix bug with invalid leading characters in header id + attributes; allow '-' and '_' in metadata; fix handling of citations in + footnotes; fix issue with quotes in link attributes. + +* 1.0.1Multi19.1 - minor change to bibliography formatting to allow + translation into a \BibTeX compatible format *without* the use of a `.bib` + file; + +* 1.0.1Multi19 - Major update; fix bugs discovered by testing with + MarkdownTest 1.0; don't add leading blank line if no metadata exists; fix + parsing of link definitions, including attribute parsing; various clean- ups + to code and documentation; improve cross-reference handling of special + characters; fix bug in handling of wiki links (`/` is not automatically + added any more); fix bug in `title` attributes of images; re-enable the + inclusion of `DOCTYPE` in complete documents (this requires the use of the + `-nonet` and `-novalid` options in xsltproc; fix bug in handling of `**`; + fix bug where WikiWords in code blocks and spans were not unescaped; fix bug + where digits were not allowed in metadata keys; fix numbering of footnotes + so that they remain in proper order; add basic citation and bibliography + features; major bug fixes and testing to precede the release of version 20 + (2.0) + +* 1.0.1Multi18 - further work to make WikiWord escaping work properly... + +* 1.0.1Multi17 - add support for "char" alignment in table columns (**NOTE**: + browsers do not currently support this); fix bug with `\` in code spans when + WikiWords are disabled; fix bug in bold/italic detection + +* 1.0.1Multi16 - can now optionally have header in first cell of each row; fix + bug in footnote counting (thanks to Mark Eli Kalderon for pointing this + out); + +* 1.0.1Multi15 - allow for multiple `<tbody>` span's within a table; ensure + that the variable`$g_empty_element_suffix` is used everywhere; protect code + spans from table parsing + +* 1.0.1Multi14 - captions can now be before or after table; add syntax for + column spanning within tables (body and header) + +* 1.0.1Multi13 - added support for CSS metadata key; allow no alignment option + on table cells; support for captions for tables + +* 1.0.1Multi12 - added support for image/link attributes; fixed bug in table + handling + +* 1.0.1Multi11 - added support for table syntax + +* 1.0.1Multi10 - allow emphasis at beginning of line + +* 1.0.1Multi9 - fix bug in metadata parsing + +* 1.0.1Multi8 - first draft of fix for "underscore within a word" problem that + causes so many errors with URL's. Now a leading whitespace is required in + front of the "opening" `_` or `*` for it to be interpreted as emphasis or + strong. + +* 1.0.1Multi7 - add Wiki Links support + +* 1.0.1Multi6 - correct bug in footnote id handling (Thanks to Jonathan Weber + for pointing this out) + +* 1.0.1Multi5 - allow disabling of metadata feature + +* 1.0.1Multi4 - convert `©` entities to `©` (compatible with XSLT); + generate cross-refs for images + +* 1.0.1Multi3 - fix metadata parsing in the event a key was empty + +* 1.0.1Multi2 - add support for footnotes. **Major** change - no longer use + templates, but rather will focus on using XSLT to convert from XHTML output + to other formats. I think this will be more flexible and less error prone. + +* 1.0.1M - initial release + diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/SmartyPants Readme.txt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/SmartyPants Readme.txt new file mode 100755 index 00000000..8ad3b3e6 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Documentation/SmartyPants Readme.txt @@ -0,0 +1,681 @@ +SmartyPants +=========== + +by John Gruber +http://daringfireball.net/ + +Version 1.5.1 - Fri 12 Mar 2004 + + +SmartyPants is a free web publishing plug-in for Movable Type, Blosxom, +and BBEdit that easily translates plain ASCII punctuation characters +into "smart" typographic punctuation HTML entities. SmartyPants can also +be invoked as a standalone Perl script. + +SmartyPants can perform the following transformations: + +* Straight quotes (`"` and `'`) into "curly" quote HTML entities + +* Backtick-style quotes (` ``like this'' `) into "curly" quote HTML + entities + +* Dashes (`--` and `---`) into en- and em-dash entities + +* Three consecutive dots (`...`) into an ellipsis entity + +This means you can write, edit, and save your posts using plain old +ASCII straight quotes, plain dashes, and plain dots, but your published +posts (and final HTML output) will appear with smart quotes, em-dashes, +and proper ellipses. + +SmartyPants is a combination plug-in -- the same file works with Movable +Type, Blosxom, and BBEdit. It can also be used from a Unix-style +command-line. Version requirements and installation instructions for +each of these tools can be found in the corresponding sub-section under +"Installation", below. + +SmartyPants does not modify characters within `<pre>`, `<code>`, +`<kbd>`, or `<script>` tag blocks. Typically, these tags are used to +display text where smart quotes and other "smart punctuation" would not +be appropriate, such as source code or example markup. + + +### Backslash Escapes ### + +If you need to use literal straight quotes (or plain hyphens and +periods), SmartyPants accepts the following backslash escape sequences +to force non-smart punctuation. It does so by transforming the escape +sequence into a decimal-encoded HTML entity: + + + Escape Value Character + ------ ----- --------- + \\ \ \ + \" " " + \' ' ' + \. . . + \- - - + \` ` ` + + +This is useful, for example, when you want to use straight quotes as +foot and inch marks: + + 6\'2\" tall + +translates into: + + 6'2" tall + +in SmartyPants's HTML output. Which, when rendered by a web browser, +looks like: + + 6'2" tall + + +### Markdown and MT-Textile Integration ### + +Movable Type users should also note that SmartyPants can be used in +conjunction with two text filtering plug-ins: [Markdown] [1] and Brad +Choate's [MT-Textile] [2]. + + [1]: http://daringfireball.net/projects/markdown/ + [2]: http://www.bradchoate.com/mt-plugins/textile + +Markdown is my text-to-HTML filter, and is intended to be an +easy-to-write and easy-to-read structured text format for writing for +the web. You write plain text; Markdown turns it into HTML. This readme +file is formatted in Markdown. + +When Markdown and SmartyPants are both present in the same Movable Type +installation, the "Markdown With SmartyPants" filter will be available +from MT's Text Formatting pop-up menu. The "Markdown With SmartyPants" +filter automatically applies SmartyPants to the bodies of your entries; +the regular "Markdown" filter does not. See the Markdown web page for +more details. + +MT-Textile is a port of Dean Allen's original [Textile] [3] project to +Perl and Movable Type. MT-Textile by itself only translates Textile +markup to HTML. However, if SmartyPants is also installed, MT-Textile +will call on SmartyPants to educate quotes, dashes, and ellipses, +automatically. Textile is Dean Allen's "humane web text generator", +another easy-to-write and easy-to-read shorthand for web writing. An +[online Textile web application] [3] is available at Mr. Allen's site. + + [3]: http://textism.com/tools/textile/ + +Using SmartyPants in conjunction with MT-Textile or the "Markdown With +SmartyPants" filter requires no modifications to your Movable Type +templates. You simply choose the appropriate filter from the Text +Formatting menu, on a per-post basis. However, note that as of this +writing, Movable Type does not apply text filters to article titles or +excerpts; you'll need to edit your templates to get SmartyPants +processing for those fields. + +You'll also need to invoke SmartyPants from your templates if you want +to use non-default settings, such as en-dash support. For explicit +control, I recommend using the regular "Markdown" text filter, and +invoking SmartyPants from your templates. + + +Installation +------------ + +### Movable Type ### + +SmartyPants works with Movable Type version 2.5 or later. + +1. Copy the "SmartyPants.pl" file into your Movable Type "plugins" + directory. The "plugins" directory should be in the same directory + as "mt.cgi"; if it doesn't already exist, use your FTP program to + create it. Your installation should look like this: + + (mt home)/plugins/SmartyPants.pl + +2. If you're using SmartyPants with Markdown or MT-Textile, you're + done. + + If not, or if you want explicit control over SmartyPants's behavior, + you need to edit your MT templates. The easiest way is to add the + "smarty_pants" attribute to each MT template tag whose contents you + wish to apply SmartyPants's transformations. Obvious tags would + include `MTEntryTitle`, `MTEntryBody`, and `MTEntryMore`. + SmartyPants should work within any MT content tag. + + For example, to apply SmartyPants to your entry titles: + + <$MTEntryTitle smarty_pants="1"$> + + The value passed to the `smarty_pants` attribute specifies the way + SmartyPants works. See "Options", below, for full details on all of + the supported options. + + +### Blosxom ### + +SmartyPants works with Blosxom version 2.0 or later. + +1. Rename the "SmartyPants.pl" plug-in to "SmartyPants" (case is + important). Movable Type requires plug-ins to have a ".pl" + extension; Blosxom forbids it (at least as of this writing). + +2. Copy the "SmartyPants" plug-in file to your Blosxom plug-ins folder. + If you're not sure where your Blosxom plug-ins folder is, see the + Blosxom documentation for information. + +3. That's it. The entries in your weblog should now automatically have + SmartyPants's default transformations applied. + +4. If you wish to configure SmartyPants's behavior, open the + "SmartyPants" plug-in, and edit the value of the `$smartypants_attr` + configuration variable, located near the top of the script. The + default value is 1; see "Options", below, for the full list of + supported values. + + +### BBEdit ### + +SmartyPants works with BBEdit 6.1 or later on Mac OS X; and BBEdit 5.1 +or later on Mac OS 9 or earlier (provided you have MacPerl installed). + +1. Copy the "SmartyPants.pl" file to appropriate filters folder in your + "BBEdit Support" folder. On Mac OS X, this should be: + + BBEdit Support/Unix Support/Unix Filters/ + + On Mac OS 9 or earlier, this should be: + + BBEdit Support:MacPerl Support:Perl Filters: + + See the BBEdit documentation for more details on the location of + these folders. + + You can rename "SmartyPants.pl" to whatever you wish. + +2. That's it. To use SmartyPants, select some text in a BBEdit + document, then choose SmartyPants from the Filters sub-menu or the + Filters floating palette. On Mac OS 9, the Filters sub-menu is in + the "Camel" menu; on Mac OS X, it is in the "#!" menu. + +3. If you wish to configure SmartyPants's behavior, open the SmartyPants + file and edit the value of the `$smartypants_attr` configuration + variable, located near the top of the script. The default value is + 1; see "Options", below, for the full list of supported values. + + +### Perl ### + +SmartyPants works as a standalone Perl script. You can invoke it from a +Unix-style command line, passing input as a file argument or as piped +input via STDIN. See the POD documentation for information on the +command-line switches SmartyPants accepts. + + +Options and Configuration +------------------------- + +For MT users, the `smarty_pants` template tag attribute is where you +specify configuration options. For Blosxom and BBEdit users, settings +are specified by editing the value of the `$smartypants_attr` variable in +the script itself. + +Numeric values are the easiest way to configure SmartyPants's behavior: + +"0" + Suppress all transformations. (Do nothing.) + +"1" + Performs default SmartyPants transformations: quotes (including + backticks-style), em-dashes, and ellipses. `--` (dash dash) is + used to signify an em-dash; there is no support for en-dashes. + +"2" + Same as smarty_pants="1", except that it uses the old-school + typewriter shorthand for dashes: `--` (dash dash) for en-dashes, + `---` (dash dash dash) for em-dashes. + +"3" + Same as smarty_pants="2", but inverts the shorthand for dashes: `--` + (dash dash) for em-dashes, and `---` (dash dash dash) for en-dashes. + +"-1" + Stupefy mode. Reverses the SmartyPants transformation process, + turning the HTML entities produced by SmartyPants into their ASCII + equivalents. E.g. `“` is turned into a simple double-quote + (`"`), `—` is turned into two dashes, etc. This is useful if you + are using SmartyPants from Brad Choate's MT-Textile text filter, but + wish to suppress smart punctuation in specific MT templates, such as + RSS feeds. Text filters do their work before templates are + processed; but you can use smarty_pants="-1" to reverse the + transformations in specific templates. + +The following single-character attribute values can be combined to +toggle individual transformations from within the smarty_pants +attribute. For example, to educate normal quotes and em-dashes, but not +ellipses or backticks-style quotes: + + <$MTFoo smarty_pants="qd"$> + +"q" + Educates normal quote characters: (`"`) and (`'`). + +"b" + Educates ` ``backticks'' ` double quotes. + +"B" + Educates backticks-style double quotes and ` `single' ` quotes. + +"d" + Educates em-dashes. + +"D" + Educates em-dashes and en-dashes, using old-school typewriter + shorthand: (dash dash) for en-dashes, (dash dash dash) for + em-dashes. + +"i" + Educates em-dashes and en-dashes, using inverted old-school + typewriter shorthand: (dash dash) for em-dashes, (dash dash dash) + for en-dashes. + +"e" + Educates ellipses. + +"w" + Translates any instance of `"` into a normal double-quote + character. This should be of no interest to most people, but of + particular interest to anyone who writes their posts using + Dreamweaver, as Dreamweaver inexplicably uses this entity to + represent a literal double-quote character. SmartyPants only + educates normal quotes, not entities (because ordinarily, entities + are used for the explicit purpose of representing the specific + character they represent). The "w" option must be used in + conjunction with one (or both) of the other quote options ("q" or + "b"). Thus, if you wish to apply all SmartyPants transformations + (quotes, en- and em-dashes, and ellipses) and also translate + `"` entities into regular quotes so SmartyPants can educate + them, you should pass the following to the smarty_pants attribute: + + <$MTFoo smarty_pants="qDew"$> + + For Blosxom and BBEdit users, set: + + my $smartypants_attr = "qDew"; + + +### Deprecated MT Attributes ### + +Older versions of SmartyPants supplied optional `smart_quotes`, +`smart_dashes`, and `smart_ellipses` MT template attributes. These +attributes are now officially deprecated. + + +### Version Info Tag ### + +If you include this tag in a Movable Type template: + + <$MTSmartyPantsVersion$> + +it will be replaced with a string representing the version number of the +installed version of SmartyPants, e.g. "1.5". + + +Caveats +------- + +### Why You Might Not Want to Use Smart Quotes in Your Weblog ### + +For one thing, you might not care. + +Most normal, mentally stable individuals do not take notice of proper +typographic punctuation. Many design and typography nerds, however, +break out in a nasty rash when they encounter, say, a restaurant sign +that uses a straight apostrophe to spell "Joe's". + +If you're the sort of person who just doesn't care, you might well want +to continue not caring. Using straight quotes -- and sticking to the +7-bit ASCII character set in general -- is certainly a simpler way to +live. + +Even if you *do* care about accurate typography, you still might want to +think twice before educating the quote characters in your weblog. One +side effect of publishing curly quote HTML entities is that it makes +your weblog a bit harder for others to quote from using copy-and-paste. +What happens is that when someone copies text from your blog, the copied +text contains the 8-bit curly quote characters (as well as the 8-bit +characters for em-dashes and ellipses, if you use these options). These +characters are not standard across different text encoding methods, +which is why they need to be encoded as HTML entities. + +People copying text from your weblog, however, may not notice that +you're using curly quotes, and they'll go ahead and paste the unencoded +8-bit characters copied from their browser into an email message or +their own weblog. When pasted as raw "smart quotes", these characters +are likely to get mangled beyond recognition. + +That said, my own opinion is that any decent text editor or email client +makes it easy to stupefy smart quote characters into their 7-bit +equivalents, and I don't consider it my problem if you're using an +indecent text editor or email client. + +### Algorithmic Shortcomings ### + +One situation in which quotes will get curled the wrong way is when +apostrophes are used at the start of leading contractions. For example: + + 'Twas the night before Christmas. + +In the case above, SmartyPants will turn the apostrophe into an opening +single-quote, when in fact it should be a closing one. I don't think +this problem can be solved in the general case -- every word processor +I've tried gets this wrong as well. In such cases, it's best to use the +proper HTML entity for closing single-quotes (`’` or `’`) by +hand. + + +Bugs +---- + +To file bug reports or feature requests (other than topics listed in the +Caveats section above) please send email to: + + smartypants@daringfireball.net + +If the bug involves quotes being curled the wrong way, please send +example text to illustrate. + + +Version History +--------------- + +1.5.1: Fri 12 Mar 2004 + +* Fixed a goof where if you had SmartyPants 1.5.0 installed, + but didn't have Markdown installed, when SmartyPants checked + for Markdown's presence, it created a blank entry in MT's + global hash of installed text filters. This showed up in MT's + Text Formatting pop-up menu as a blank entry. + + +1.5: Mon 29 Dec 2003 + +* Integration with Markdown. If Markdown is already loaded + when SmartyPants loads, SmartyPants will add a new global + text filter, "Markdown With Smartypants". + +* Preliminary command-line options parsing. -1 -2 -3 + -v -V + +* dot-space-dot-space-dot now counts as an ellipsis. + This is the style used by Project Gutenberg: + http://www.gutenberg.net/faq/index.shtml#V.110 + (Thanks to Fred Condo for the patch.) + +* Added `<math>` to the list of tags to skip (pre, code, etc.). + + +1.4.1: Sat 8 Nov 2003 + +* The bug fix from 1.4 for dashes followed by quotes with no + intervening spaces now actually works. + +* ` ` now counts as whitespace where necessary. (Thanks to + Greg Knauss for the patch.) + + +1.4: Mon 30 Jun 2003 + +* Improved the HTML tokenizer so that it will parse nested <> pairs + up to five levels deep. Previously, it only parsed up to two + levels. What we *should* do is allow for any arbitrary level of + nesting, but to do so, we would need to use Perl's `??` construct + (see Fried's "Mastering Regular Expressions", 2nd Ed., pp. + 328-331), and sadly, this would only work in Perl 5.6 or later. + SmartyPants still supports Perl 5.00503. I suppose we could test + for the version and build a regex accordingly, but I don't think + I want to maintain two separate patterns. + +* Thanks to Stepan Riha, the tokenizer now handles HTML comments: + + <!-- comment --> + + and PHP-style processor instructions: + + <?php code ?> + +* The quote educator now handles situations where dashes are used + without whitespace, e.g.: + + "dashes"--without spaces--"are tricky" + +* Special case for decade abbreviations like this: `the '80s`. + This only works for the sequence appostrophe-digit-digit-s. + + +1.3: Tue 13 May 2003 + +* Plugged the biggest hole in SmartyPants's smart quotes algorithm. + Previous versions were hopelessly confused by single-character + quote tokens, such as: + + <p>"<i>Tricky!</i>"</p> + + The problem was that the EducateQuotes() function works on each + token separately, with no means of getting surrounding context + from the previous or next tokens. The solution is to curl these + single-character quote tokens as a special case, *before* calling + EducateQuotes(). + +* New single-quotes backtick mode for smarty_pants attribute. + The only way to turn it on is to include "B" in the configuration + string, e.g. to translate backtick quotes, dashes, and ellipses: + + smarty_pants="Bde" + +* Fixed a bug where an opening quote would get curled the wrong way + if the quote started with three dots, e.g.: + + <p>"...meanwhile"</p> + +* Fixed a bug where opening quotes would get curled the wrong way + if there were double sets of quotes within each other, e.g.: + + <p>"'Some' people."</p> + +* Due to popular demand, four consecutive dots (....) will now be + turned into an ellipsis followed by a period. Previous versions + would turn this into a period followed by an ellipsis. If you + really want a period-then-ellipsis sequence, escape the first + period with a backslash: \.... + +* Removed `&` from our home-grown punctuation class, since it + denotes an entity, not a literal ampersand punctuation + character. This fixes a bug where SmartyPants would mis-curl + the opening quote in something like this: + + "…whatever" + +* SmartyPants has always had a special case where it looks for + "'s" in situations like this: + + <i>Custer</i>'s Last Stand + + This special case is now case-insensitive. + + +1.2.2: Thu Mar 13, 2003 + +* 1.2.1 contained a boneheaded addition which prevented SmartyPants + from compiling under Perl 5.005. This has been remedied, and is + the only change from 1.2.1. + + +1.2.1: Mon Mar 10, 2003 + +* New "stupefy mode" for smarty_pants attribute. If you set + + smarty_pants="-1" + + SmartyPants will perform reverse transformations, turning HTML + entities into plain ASCII equivalents. E.g. "“" is turned + into a simple double-quote ("), "—" is turned into two + dashes, etc. This is useful if you are using SmartyPants from Brad + Choate's MT-Textile text filter, but wish to suppress smart + punctuation in specific MT templates, such as RSS feeds. Text + filters do their work before templates are processed; but you can + use smarty_pants="-1" to reverse the transformations in specific + templates. + +* Replaced the POSIX-style regex character class `[:punct:]` with an + ugly hard-coded normal character class of all punctuation; POSIX + classes require Perl 5.6 or later, but SmartyPants still supports + back to 5.005. + +* Several small changes to allow SmartyPants to work when Blosxom + is running in static mode. + + +1.2: Thu Feb 27, 2003 + +* SmartyPants is now a combination plug-in, supporting both + Movable Type (2.5 or later) and Blosxom (2.0 or later). + It also works as a BBEdit text filter and standalone + command-line Perl program. Thanks to Rael Dornfest for the + initial Blosxom port (and for the excellent Blosxom plug-in + API). + +* SmartyPants now accepts the following backslash escapes, + to force non-smart punctuation. It does so by transforming + the escape sequence into a decimal-encoded HTML entity: + + Escape Value Character + ------ ----- --------- + \\ \ \ + \" " " + \' ' ' + \. . . + \- - - + \` ` ` + + Note that this could produce different results than previous + versions of SmartyPants, if for some reason you have an article + containing one or more of these sequences. (Thanks to Charles + Wiltgen for the suggestion.) + +* Added a new option to support inverted en- and em-dash notation: + `--` for em-dashes, `---` for en-dashes. This is compatible with + SmartyPants's original `--` syntax for em-dashes, but also allows + you to specify en-dashes. It can be invoked by using + smart_dashes="3", smarty_pants="3", or smarty_pants="i". + (Suggested by Aaron Swartz.) + +* Added a new option to automatically convert `"` entities into + regular double-quotes before sending text to EducateQuotes() for + processing. This is mainly for the benefit of people who write + posts using Dreamweaver, which substitutes this entity for any + literal quote char. The one and only way to invoke this option + is to use the letter shortcuts for the smarty_pants attribute; + the shortcut for this option is "w" (for Dream_w_eaver). + (Suggested by Jonathon Delacour.) + +* Added `<script>` to the list of tags in which SmartyPants doesn't + touch the contents. + +* Fixed a very subtle bug that would occur if a quote was the very + last character in a body of text, preceded immediately by a tag. + Lacking any context, previous versions of SmartyPants would turn + this into an opening quote mark. It's now correctly turned into + a closing one. + +* Opening quotes were being curled the wrong way when the + subsequent character was punctuation. E.g.: "a '.foo' file". + Fixed. + +* New MT global template tag: `<$MTSmartyPantsVersion$>` + Prints the version number of SmartyPants, e.g. "1.2". + + +1.1: Wed Feb 5, 2003 + +* The smart_dashes template attribute now offers an option to + use `--` for *en* dashes, and `---` for *em* dashes. + +* The default smart_dashes behavior now simply translates `--` + (dash dash) into an em-dash. Previously, it would look for + ` -- ` (space dash dash space), which was dumb, since many + people do not use spaces around their em dashes. + +* Using the smarty_pants attribute with a value of "2" will + do the same thing as smarty_pants="1", with one difference: + it will use the new shortcuts for en- and em-dashes. + +* Closing quotes (single and double) were incorrectly curled in + situations like this: + + "<a>foo</a>", + + where the comma could be just about any punctuation character. + Fixed. + +* Added `<kbd>` to the list of tags in which text shouldn't be + educated. + + +1.0: Wed Nov 13, 2002 + +* Initial release. + + +Author +------ + +John Gruber +http://daringfireball.net + + +Additional Credits +------------------ + +Portions of this plug-in are based on Brad Choate's nifty MTRegex +plug-in. Brad Choate also contributed a few bits of source code to this +plug-in. Brad Choate is a fine hacker indeed. (http://bradchoate.com/) + +Jeremy Hedley (http://antipixel.com/) and Charles Wiltgen +(http://playbacktime.com/) deserve mention for exemplary beta testing. + +Rael Dornfest (http://raelity.org/) ported SmartyPants to Blosxom. + + +Copyright and License +--------------------- + +Copyright (c) 2004 John Gruber +(http://daringfireball.net/) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name "SmartyPants" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/README b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/README new file mode 100755 index 00000000..a98ef86e --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/README @@ -0,0 +1,103 @@ +(NOTE: mmltex.xsl was modified slightly to put an `\equation` tag around +mathml that is in a paragraph by itself, as well as to allow labels for +equations -- Fletcher T. Penney) + +README for the XSLT MathML Library + +MultiMarkdown Version - 2.0.b6 + +XSLT MathML Library is a set of XSLT stylesheets to transform +MathML 2.0 to LaTeX. + +For more information, see +http://www.raleigh.ru/MathML/mmltex/index.php?lang=en + +Manifest +-------- + +README this file +mmltex.xsl +tokens.xsl +glayout.xsl +scripts.xsl +tables.xsl +entities.xsl +cmarkup.xsl + +Use +--- + +There are two ways of using the library: + + * Use a local copy of the library. + + 1. Download the distribution (see below). + + 2. Unpack the distribution, using unzip. + + 3. In your stylesheet import or include either the main + stylesheet, mmltex.xsl, or the stylesheet module you + wish to use, such as tokens.xsl. This example assumes + that the distribution has been extracted into the same + directory as your own stylesheet: + + <xsl:import href="mmltex.xsl"/> + + * Import or include either the main stylesheet, or the + stylesheet module you wish to use, directly from the library + website; http://www.raleigh.ru/MathML/mmltex/. For example: + + <xsl:import href="http://www.raleigh.ru/MathML/mmltex/mmltex.xsl"/> + +Obtaining The Library +--------------------- + +The XSLT MathML Library is available for download as: + + * Zip file: http://www.raleigh.ru/MathML/mmltex/xsltml_2.1.2.zip + +Copyright +--------- + +Copyright (C) 2001-2003 Vasil Yaroshevich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the ``Software''), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +Except as contained in this notice, the names of individuals +credited with contribution to this software shall not be used in +advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization +from the individuals in question. + +Any stylesheet derived from this Software that is publically +distributed will be identified with a different name and the +version strings in any derived Software will be changed so that +no possibility of confusion between the derived package and this +Software will exist. + +Warranty +-------- + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER +CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Contacting the Author +--------------------- + +These stylesheets are maintained by Vasil Yaroshevich, <yarosh@raleigh.ru>. diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/cmarkup.xsl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/cmarkup.xsl new file mode 100755 index 00000000..b64a973b --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/cmarkup.xsl @@ -0,0 +1,1107 @@ +<?xml version='1.0' encoding="UTF-8"?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:m="http://www.w3.org/1998/Math/MathML" + version='1.0'> + +<!-- ====================================================================== --> +<!-- $Id: cmarkup.xsl 149 2006-09-12 21:23:53Z fletcher $ + This file is part of the XSLT MathML Library distribution. + See ./README or http://www.raleigh.ru/MathML/mmltex for + copyright and other information + Modified by Fletcher T. Penney for MultiMarkdown Version 2.0.a --> +<!-- ====================================================================== --> + +<!-- 4.4.1.1 cn --> +<xsl:template match="m:cn"><xsl:apply-templates/></xsl:template> + +<xsl:template match="m:cn[@type='complex-cartesian']"> + <xsl:apply-templates select="text()[1]"/> + <xsl:text>+</xsl:text> + <xsl:apply-templates select="text()[2]"/> + <xsl:text>i</xsl:text> +</xsl:template> + +<xsl:template match="m:cn[@type='rational']"> + <xsl:apply-templates select="text()[1]"/> + <xsl:text>/</xsl:text> + <xsl:apply-templates select="text()[2]"/> +</xsl:template> + +<xsl:template match="m:cn[@type='integer' and @base!=10]"> + <xsl:apply-templates/> + <xsl:text>_{</xsl:text><xsl:value-of select="@base"/><xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="m:cn[@type='complex-polar']"> + <xsl:apply-templates select="text()[1]"/> + <xsl:text>e^{i </xsl:text> + <xsl:apply-templates select="text()[2]"/> + <xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="m:cn[@type='e-notation']"> + <xsl:apply-templates select="text()[1]"/> + <xsl:text>E</xsl:text> + <xsl:apply-templates select="text()[2]"/> +</xsl:template> + +<!-- 4.4.1.1 ci 4.4.1.2 csymbol --> +<xsl:template match="m:ci | m:csymbol"> + <xsl:choose> + <xsl:when test="string-length(normalize-space(text()))>1"> + <xsl:text>\mathrm{</xsl:text><xsl:apply-templates/><xsl:text>}</xsl:text> + </xsl:when> + <xsl:otherwise><xsl:apply-templates/></xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- 4.4.2.1 apply 4.4.2.2 reln --> +<xsl:template match="m:apply | m:reln"> + <xsl:apply-templates select="*[1]"> + <!-- <? --> + <xsl:with-param name="p" select="10"/> + </xsl:apply-templates> + <!-- ?> --> + <xsl:text>(</xsl:text> + <xsl:for-each select="*[position()>1]"> + <xsl:apply-templates select="."/> + <xsl:if test="not(position()=last())"><xsl:text>, </xsl:text></xsl:if> + </xsl:for-each> + <xsl:text>)</xsl:text> +</xsl:template> + +<!-- 4.4.2.3 fn --> +<xsl:template match="m:fn[m:apply[1]]"> <!-- for m:fn using default rule --> + <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text> +</xsl:template> + +<!-- 4.4.2.4 interval --> +<xsl:template match="m:interval[*[2]]"> + <xsl:choose> + <xsl:when test="@closure='open' or @closure='open-closed'"> + <xsl:text>\left(</xsl:text> + </xsl:when> + <xsl:otherwise><xsl:text>\left[</xsl:text></xsl:otherwise> + </xsl:choose> + <xsl:apply-templates select="*[1]"/> + <xsl:text> , </xsl:text> + <xsl:apply-templates select="*[2]"/> + <xsl:choose> + <xsl:when test="@closure='open' or @closure='closed-open'"> + <xsl:text>\right)</xsl:text> + </xsl:when> + <xsl:otherwise><xsl:text>\right]</xsl:text></xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="m:interval"> + <xsl:text>\left\{</xsl:text><xsl:apply-templates/><xsl:text>\right\}</xsl:text> +</xsl:template> + +<!-- 4.4.2.5 inverse --> +<xsl:template match="m:apply[*[1][self::m:inverse]]"> + <xsl:apply-templates select="*[2]"/><xsl:text>^{(-1)}</xsl:text> +</xsl:template> + +<!-- 4.4.2.6 sep 4.4.2.7 condition --> +<xsl:template match="m:sep | m:condition"><xsl:apply-templates/></xsl:template> + +<!-- 4.4.2.9 lambda --> +<xsl:template match="m:lambda"> + <xsl:apply-templates select="m:bvar/*"/> + <xsl:text>\mapsto </xsl:text> + <xsl:apply-templates select="*[last()]"/> +<!-- Other variant + <xsl:text>\mathrm{lambda}\: </xsl:text> + <xsl:apply-templates select="m:bvar/*"/> + <xsl:text>.\: </xsl:text> + <xsl:apply-templates select="*[last()]"/> --> +</xsl:template> + +<!-- 4.4.2.10 compose --> +<xsl:template match="m:apply[*[1][self::m:compose]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="1"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\circ </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.2.11 ident --> +<xsl:template match="m:ident"><xsl:text>\mathrm{id}</xsl:text></xsl:template> + +<!-- 4.4.2.12 domain 4.4.2.13 codomain 4.4.2.14 image 4.4.3.21 arg 4.4.3.24 lcm + 4.4.5.9 grad 4.4.5.10 curl 4.4.9.4 median 4.4.9.5 mode--> +<xsl:template match="m:domain | m:codomain | m:image | m:arg | m:lcm | m:grad | + m:curl | m:median | m:mode"> + <xsl:text>\mathop{\mathrm{</xsl:text> + <xsl:value-of select="local-name()"/> + <xsl:text>}}</xsl:text> +</xsl:template> + +<!-- 4.4.2.15 domainofapplication --> +<xsl:template match="m:domainofapplication"/> + +<!-- 4.4.2.16 piecewise --> +<xsl:template match="m:piecewise"> + <xsl:text>\begin{cases}</xsl:text> + <xsl:apply-templates select="m:piece"/> + <xsl:apply-templates select="m:otherwise"/> + <xsl:text>\end{cases}</xsl:text> +</xsl:template> + +<xsl:template match="m:piece"> + <xsl:apply-templates select="*[1]"/> + <xsl:text> & \text{if $</xsl:text> + <xsl:apply-templates select="*[2]"/> + <xsl:text>$}</xsl:text> + <xsl:if test="not(position()=last()) or ../m:otherwise"><xsl:text>\\ </xsl:text></xsl:if> +</xsl:template> + +<xsl:template match="m:otherwise"> + <xsl:apply-templates select="*[1]"/> + <xsl:text> & \text{otherwise}</xsl:text> +</xsl:template> + +<!-- 4.4.3.1 quotient --> +<xsl:template match="m:apply[*[1][self::m:quotient]]"> + <xsl:text>\left\lfloor\frac{</xsl:text> + <xsl:apply-templates select="*[2]"/> + <xsl:text>}{</xsl:text> + <xsl:apply-templates select="*[3]"/> + <xsl:text>}\right\rfloor </xsl:text> +</xsl:template> + +<!-- 4.4.3.2 factorial --> +<xsl:template match="m:apply[*[1][self::m:factorial]]"> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="7"/> + </xsl:apply-templates> + <xsl:text>!</xsl:text> +</xsl:template> + +<!-- 4.4.3.3 divide --> +<xsl:template match="m:apply[*[1][self::m:divide]]"> + <xsl:param name="p" select="0"/> + <xsl:param name="this-p" select="3"/> + <xsl:if test="$this-p < $p"><xsl:text>\left(</xsl:text></xsl:if> + <xsl:text>\frac{</xsl:text> + <xsl:apply-templates select="*[2]"/> +<!-- <xsl:with-param name="p" select="$this-p"/> + </xsl:apply-templates>--> + <xsl:text>}{</xsl:text> + <xsl:apply-templates select="*[3]"/> +<!-- <xsl:with-param name="p" select="$this-p"/> + </xsl:apply-templates>--> + <xsl:text>}</xsl:text> + <xsl:if test="$this-p < $p"><xsl:text>\right)</xsl:text></xsl:if> +</xsl:template> + +<!-- 4.4.3.4 max min --> +<xsl:template match="m:apply[*[1][self::m:max or self::m:min]]"> + <xsl:text>\</xsl:text> + <xsl:value-of select="local-name(*[1])"/> + <xsl:text>\{</xsl:text> + <xsl:choose> + <xsl:when test="m:condition"> + <xsl:apply-templates select="*[last()]"/> + <xsl:text>\mid </xsl:text> + <xsl:apply-templates select="m:condition/node()"/> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="*[position() > 1]"> + <xsl:apply-templates select="."/> + <xsl:if test="position() !=last()"><xsl:text> , </xsl:text></xsl:if> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + <xsl:text>\}</xsl:text> +</xsl:template> + +<!-- 4.4.3.5 minus--> +<xsl:template match="m:apply[*[1][self::m:minus] and count(*)=2]"> + <xsl:text>-</xsl:text> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="5"/> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="m:apply[*[1][self::m:minus] and count(*)>2]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="binary"> + <xsl:with-param name="mo">-</xsl:with-param> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="this-p" select="2"/> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.3.6 plus--> +<xsl:template match="m:apply[*[1][self::m:plus]]"> + <xsl:param name="p" select="0"/> + <xsl:if test="$p > 2"> + <xsl:text>(</xsl:text> + </xsl:if> + <xsl:for-each select="*[position()>1]"> + <xsl:if test="position() > 1"> + <xsl:choose> + <xsl:when test="self::m:apply[*[1][self::m:times] and + *[2][self::m:apply/*[1][self::m:minus] or self::m:cn[not(m:sep) and + (number(.) < 0)]]]">-</xsl:when> + <xsl:otherwise>+</xsl:otherwise> + </xsl:choose> + </xsl:if> + <xsl:choose> + <xsl:when test="self::m:apply[*[1][self::m:times] and + *[2][self::m:cn[not(m:sep) and (number(.) <0)]]]"> + <xsl:value-of select="-(*[2])"/> + <xsl:apply-templates select="."> + <xsl:with-param name="first" select="2"/> + <xsl:with-param name="p" select="2"/> + </xsl:apply-templates> + </xsl:when> + <xsl:when test="self::m:apply[*[1][self::m:times] and + *[2][self::m:apply/*[1][self::m:minus]]]"> + <xsl:apply-templates select="./*[2]/*[2]"/> + <xsl:apply-templates select="."> + <xsl:with-param name="first" select="2"/> + <xsl:with-param name="p" select="2"/> + </xsl:apply-templates> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="."> + <xsl:with-param name="p" select="2"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <xsl:if test="$p > 2"> + <xsl:text>)</xsl:text> + </xsl:if> +</xsl:template> + +<!-- 4.4.3.7 power --> +<xsl:template match="m:apply[*[1][self::m:power]]"> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="5"/> + </xsl:apply-templates> + <xsl:text>^{</xsl:text> + <xsl:apply-templates select="*[3]"> + <xsl:with-param name="p" select="5"/> + </xsl:apply-templates> + <xsl:text>}</xsl:text> +</xsl:template> + +<!-- 4.4.3.8 remainder --> +<xsl:template match="m:apply[*[1][self::m:rem]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="binary"> + <xsl:with-param name="mo">\mod </xsl:with-param> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="this-p" select="3"/> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.3.9 times--> +<xsl:template match="m:apply[*[1][self::m:times]]" name="times"> + <xsl:param name="p" select="0"/> + <xsl:param name="first" select="1"/> + <xsl:if test="$p > 3"><xsl:text>(</xsl:text></xsl:if> + <xsl:for-each select="*[position()>1]"> + <xsl:if test="position() > 1"> + <xsl:choose> + <xsl:when test="self::m:cn">\times <!-- times --></xsl:when> + <xsl:otherwise><!--invisible times--></xsl:otherwise> + </xsl:choose> + </xsl:if> + <xsl:if test="position()>= $first"> + <xsl:apply-templates select="."> + <xsl:with-param name="p" select="3"/> + </xsl:apply-templates> + </xsl:if> + </xsl:for-each> + <xsl:if test="$p > 3"><xsl:text>)</xsl:text></xsl:if> +</xsl:template> + +<!-- 4.4.3.10 root --> +<xsl:template match="m:apply[*[1][self::m:root]]"> + <xsl:text>\sqrt</xsl:text> + <xsl:if test="m:degree!=2"> + <xsl:text>[</xsl:text> + <xsl:apply-templates select="m:degree/*"/> + <xsl:text>]</xsl:text> + </xsl:if> + <xsl:text>{</xsl:text> + <xsl:apply-templates select="*[position()>1 and not(self::m:degree)]"/> + <xsl:text>}</xsl:text> +</xsl:template> + +<!-- 4.4.3.11 gcd --> +<xsl:template match="m:gcd"><xsl:text>\gcd </xsl:text></xsl:template> + +<!-- 4.4.3.12 and --> +<xsl:template match="m:apply[*[1][self::m:and]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\land <!-- and --></xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.3.13 or --> +<xsl:template match="m:apply[*[1][self::m:or]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="3"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\lor </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.3.14 xor --> +<xsl:template match="m:apply[*[1][self::m:xor]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="3"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\mathop{\mathrm{xor}}</xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.3.15 not --> +<xsl:template match="m:apply[*[1][self::m:not]]"> + <xsl:text>\neg </xsl:text> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="7"/> + </xsl:apply-templates> +</xsl:template> + +<!-- 4.4.3.16 implies --> +<xsl:template match="m:apply[*[1][self::m:implies]] | m:reln[*[1][self::m:implies]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="binary"> + <xsl:with-param name="mo">\implies </xsl:with-param> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="this-p" select="3"/> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.3.17 forall 4.4.3.18 exists --> +<xsl:template match="m:apply[*[1][self::m:forall or self::m:exists]]"> + <xsl:text>\</xsl:text> + <xsl:value-of select="local-name(*[1])"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="m:bvar"/> + <xsl:if test="m:condition"> + <xsl:text>, </xsl:text><xsl:apply-templates select="m:condition"/> + </xsl:if> + <xsl:if test="*[last()][local-name()!='condition'][local-name()!='bvar']"> + <xsl:text>\colon </xsl:text> + <xsl:apply-templates select="*[last()]"/> + </xsl:if> +</xsl:template> + +<!-- 4.4.3.19 abs --> +<xsl:template match="m:apply[*[1][self::m:abs]]"> + <xsl:text>\left|</xsl:text> + <xsl:apply-templates select="*[2]"/> + <xsl:text>\right|</xsl:text> +</xsl:template> + +<!-- 4.4.3.20 conjugate --> +<xsl:template match="m:apply[*[1][self::m:conjugate]]"> + <xsl:text>\overline{</xsl:text><xsl:apply-templates select="*[2]"/><xsl:text>}</xsl:text> +</xsl:template> + +<!-- 4.4.3.22 real --> +<xsl:template match="m:real"><xsl:text>\Re </xsl:text></xsl:template> + +<!-- 4.4.3.23 imaginary --> +<xsl:template match="m:imaginary"><xsl:text>\Im </xsl:text></xsl:template> + +<!-- 4.4.3.25 floor --> +<xsl:template match="m:apply[*[1][self::m:floor]]"> + <xsl:text>\lfloor </xsl:text> + <xsl:apply-templates select="*[2]"/> + <xsl:text>\rfloor </xsl:text> +</xsl:template> + +<!-- 4.4.3.25 ceiling --> +<xsl:template match="m:apply[*[1][self::m:ceiling]]"> + <xsl:text>\lceil </xsl:text> + <xsl:apply-templates select="*[2]"/> + <xsl:text>\rceil </xsl:text> +</xsl:template> + +<!-- 4.4.4.1 eq --> +<xsl:template match="m:apply[*[1][self::m:eq]] | m:reln[*[1][self::m:eq]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="1"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">=</xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.4.2 neq --> +<xsl:template match="m:apply[*[1][self::m:neq]] | m:reln[*[1][self::m:neq]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="1"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\neq </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.4.3 gt --> +<xsl:template match="m:apply[*[1][self::m:gt]] | m:reln[*[1][self::m:gt]]"> +<xsl:param name="p" select="0"/> +<xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="1"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">> </xsl:with-param> +</xsl:call-template> +</xsl:template> + +<!-- 4.4.4.4 lt --> +<xsl:template match="m:apply[*[1][self::m:lt]] | m:reln[*[1][self::m:lt]]"> +<xsl:param name="p" select="0"/> +<xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="1"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">< </xsl:with-param> +</xsl:call-template> +</xsl:template> + +<!-- 4.4.4.5 geq --> +<xsl:template match="m:apply[*[1][self::m:geq]] | m:reln[*[1][self::m:geq]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="1"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\ge </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.4.6 leq --> +<xsl:template match="m:apply[*[1][self::m:leq]] | m:reln[*[1][self::m:leq]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="1"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\le </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.4.7 equivalent --> +<xsl:template match="m:apply[*[1][self::m:equivalent]] | m:reln[*[1][self::m:equivalent]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="1"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\equiv </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.4.8 approx --> +<xsl:template match="m:apply[*[1][self::m:approx]] | m:reln[*[1][self::m:approx]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="1"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\approx </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.4.9 factorof --> +<xsl:template match="m:apply[*[1][self::m:factorof]] | m:reln[*[1][self::m:factorof]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="binary"> + <xsl:with-param name="mo"> | </xsl:with-param> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="this-p" select="3"/> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.5.1 int --> +<xsl:template match="m:apply[*[1][self::m:int]]"> + <xsl:text>\int</xsl:text> + <xsl:if test="m:lowlimit/*|m:interval/*[1]|m:condition/*"> + <xsl:text>_{</xsl:text> + <xsl:apply-templates select="m:lowlimit/*|m:interval/*[1]|m:condition/*"/> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:if test="m:uplimit/*|m:interval/*[2]"> + <xsl:text>^{</xsl:text> + <xsl:apply-templates select="m:uplimit/*|m:interval/*[2]"/> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:text> </xsl:text> + <xsl:apply-templates select="*[last()]"/> + <xsl:text>\,d </xsl:text> + <xsl:apply-templates select="m:bvar"/> +</xsl:template> + +<!-- 4.4.5.2 diff --> +<xsl:template match="m:apply[*[1][self::m:diff] and m:ci and count(*)=2]" priority="2"> + <xsl:apply-templates select="*[2]"/> + <xsl:text>^\prime </xsl:text> +</xsl:template> + +<xsl:template match="m:apply[*[1][self::m:diff]]" priority="1"> + <xsl:text>\frac{</xsl:text> + <xsl:choose> + <xsl:when test="m:bvar/m:degree"> + <xsl:text>d^{</xsl:text> + <xsl:apply-templates select="m:bvar/m:degree/node()"/> + <xsl:text>}</xsl:text> + <xsl:apply-templates select="*[last()]"/> + <xsl:text>}{d</xsl:text> + <xsl:apply-templates select="m:bvar/node()"/> + <xsl:text>^{</xsl:text> + <xsl:apply-templates select="m:bvar/m:degree/node()"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>d </xsl:text> + <xsl:apply-templates select="*[last()]"/> + <xsl:text>}{d </xsl:text> + <xsl:apply-templates select="m:bvar"/> + </xsl:otherwise> + </xsl:choose> + <xsl:text>}</xsl:text> +</xsl:template> + +<!-- 4.4.5.3 partialdiff --> +<xsl:template match="m:apply[*[1][self::m:partialdiff] and m:list and m:ci and count(*)=3]" priority="2"> + <xsl:text>D_{</xsl:text> + <xsl:for-each select="m:list[1]/*"> + <xsl:apply-templates select="."/> + <xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if> + </xsl:for-each> + <xsl:text>}</xsl:text> + <xsl:apply-templates select="*[3]"/> +</xsl:template> + +<xsl:template match="m:apply[*[1][self::m:partialdiff]]" priority="1"> + <xsl:text>\frac{\partial^{</xsl:text> + <xsl:choose> + <xsl:when test="m:degree"> + <xsl:apply-templates select="m:degree/node()"/> + </xsl:when> + <xsl:when test="m:bvar/m:degree[string(number(.))='NaN']"> + <xsl:for-each select="m:bvar/m:degree"> + <xsl:apply-templates select="node()"/> + <xsl:if test="position()<last()"><xsl:text>+</xsl:text></xsl:if> + </xsl:for-each> + <xsl:if test="count(m:bvar[not(m:degree)])>0"> + <xsl:text>+</xsl:text> + <xsl:value-of select="count(m:bvar[not(m:degree)])"/> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="sum(m:bvar/m:degree)+count(m:bvar[not(m:degree)])"/> + </xsl:otherwise> + </xsl:choose> + <xsl:text>}</xsl:text> + <xsl:apply-templates select="*[last()]"/> + <xsl:text>}{</xsl:text> + <xsl:for-each select="m:bvar"> + <xsl:text>\partial </xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:if test="m:degree"> + <xsl:text>^{</xsl:text> + <xsl:apply-templates select="m:degree/node()"/> + <xsl:text>}</xsl:text> + </xsl:if> + </xsl:for-each> + <xsl:text>}</xsl:text> +</xsl:template> + +<!-- 4.4.2.8 declare 4.4.5.4 lowlimit 4.4.5.5 uplimit 4.4.5.7 degree 4.4.9.5 momentabout --> +<xsl:template match="m:declare | m:lowlimit | m:uplimit | m:degree | m:momentabout"/> + +<!-- 4.4.5.6 bvar--> +<xsl:template match="m:bvar"> + <xsl:apply-templates/> + <xsl:if test="following-sibling::m:bvar"><xsl:text>, </xsl:text></xsl:if> +</xsl:template> + +<!-- 4.4.5.8 divergence--> +<xsl:template match="m:divergence"><xsl:text>\mathop{\mathrm{div}}</xsl:text></xsl:template> + +<!-- 4.4.5.11 laplacian--> +<xsl:template match="m:laplacian"><xsl:text>\nabla^2 </xsl:text></xsl:template> + +<!-- 4.4.6.1 set --> +<xsl:template match="m:set"> + <xsl:text>\{</xsl:text><xsl:call-template name="set"/><xsl:text>\}</xsl:text> +</xsl:template> + +<!-- 4.4.6.2 list --> +<xsl:template match="m:list"> + <xsl:text>\left[</xsl:text><xsl:call-template name="set"/><xsl:text>\right]</xsl:text> +</xsl:template> + +<xsl:template name="set"> + <xsl:choose> + <xsl:when test="m:condition"> + <xsl:apply-templates select="m:bvar/*[not(self::bvar or self::condition)]"/> + <xsl:text>\colon </xsl:text> + <xsl:apply-templates select="m:condition/node()"/> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="*"> + <xsl:apply-templates select="."/> + <xsl:if test="position()!=last()"><xsl:text>, </xsl:text></xsl:if> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- 4.4.6.3 union --> +<xsl:template match="m:apply[*[1][self::m:union]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\cup </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.6.4 intersect --> +<xsl:template match="m:apply[*[1][self::m:intersect]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="3"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\cap </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.6.5 in --> +<xsl:template match="m:apply[*[1][self::m:in]] | m:reln[*[1][self::m:in]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="binary"> + <xsl:with-param name="mo">\in </xsl:with-param> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="this-p" select="3"/> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.6.6 notin --> +<xsl:template match="m:apply[*[1][self::m:notin]] | m:reln[*[1][self::m:notin]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="binary"> + <xsl:with-param name="mo">\notin </xsl:with-param> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="this-p" select="3"/> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.6.7 subset --> +<xsl:template match="m:apply[*[1][self::m:subset]] | m:reln[*[1][self::m:subset]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\subseteq </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.6.8 prsubset --> +<xsl:template match="m:apply[*[1][self::m:prsubset]] | m:reln[*[1][self::m:prsubset]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\subset </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.6.9 notsubset --> +<xsl:template match="m:apply[*[1][self::m:notsubset]] | m:reln[*[1][self::m:notsubset]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="binary"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\nsubseteq </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.6.10 notprsubset --> +<xsl:template match="m:apply[*[1][self::m:notprsubset]] | m:reln[*[1][self::m:notprsubset]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="binary"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\not\subset </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.6.11 setdiff --> +<xsl:template match="m:apply[*[1][self::m:setdiff]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="binary"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\setminus </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.6.12 card --> +<xsl:template match="m:apply[*[1][self::m:card]]"> + <xsl:text>|</xsl:text> + <xsl:apply-templates select="*[2]"/> + <xsl:text>|</xsl:text> +</xsl:template> + +<!-- 4.4.6.13 cartesianproduct 4.4.10.6 vectorproduct --> +<xsl:template match="m:apply[*[1][self::m:cartesianproduct or self::m:vectorproduct]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\times </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template +match="m:apply[*[1][self::m:cartesianproduct][count(following-sibling::m:reals)=count(following-sibling::*)]]" +priority="2"> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="5"/> + </xsl:apply-templates> + <xsl:text>^{</xsl:text> + <xsl:value-of select="count(*)-1"/> + <xsl:text>}</xsl:text> +</xsl:template> + +<!-- 4.4.7.1 sum --> +<xsl:template match="m:apply[*[1][self::m:sum]]"> + <xsl:text>\sum</xsl:text><xsl:call-template name="series"/> +</xsl:template> + +<!-- 4.4.7.2 product --> +<xsl:template match="m:apply[*[1][self::m:product]]"> + <xsl:text>\prod</xsl:text><xsl:call-template name="series"/> +</xsl:template> + +<xsl:template name="series"> + <xsl:if test="m:lowlimit/*|m:interval/*[1]|m:condition/*"> + <xsl:text>_{</xsl:text> + <xsl:if test="not(m:condition)"> + <xsl:apply-templates select="m:bvar"/> + <xsl:text>=</xsl:text> + </xsl:if> + <xsl:apply-templates select="m:lowlimit/*|m:interval/*[1]|m:condition/*"/> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:if test="m:uplimit/*|m:interval/*[2]"> + <xsl:text>^{</xsl:text> + <xsl:apply-templates select="m:uplimit/*|m:interval/*[2]"/> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:text> </xsl:text> + <xsl:apply-templates select="*[last()]"/> +</xsl:template> + +<!-- 4.4.7.3 limit --> +<xsl:template match="m:apply[*[1][self::m:limit]]"> + <xsl:text>\lim_{</xsl:text> + <xsl:apply-templates select="m:lowlimit|m:condition/*"/> + <xsl:text>}</xsl:text> + <xsl:apply-templates select="*[last()]"/> +</xsl:template> + +<xsl:template match="m:apply[m:limit]/m:lowlimit" priority="3"> + <xsl:apply-templates select="../m:bvar/node()"/> + <xsl:text>\to </xsl:text> + <xsl:apply-templates/> +</xsl:template> + +<!-- 4.4.7.4 tendsto --> +<xsl:template match="m:apply[*[1][self::m:tendsto]] | m:reln[*[1][self::m:tendsto]]"> + <xsl:param name="p"/> + <xsl:call-template name="binary"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo"> + <xsl:choose> + <xsl:when test="*[1][@type='above']">\searrow </xsl:when> + <xsl:when test="*[1][@type='below']">\nearrow </xsl:when> + <xsl:when test="*[1][@type='two-sided']">\rightarrow </xsl:when> + <xsl:otherwise>\to </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.8.1 common tringonometric functions 4.4.8.3 natural logarithm --> +<xsl:template match="m:apply[*[1][ + self::m:sin or self::m:cos or self::m:tan or self::m:sec or + self::m:csc or self::m:cot or self::m:sinh or self::m:cosh or + self::m:tanh or self::m:coth or self::m:arcsin or self::m:arccos or + self::m:arctan or self::m:ln]]"> + <xsl:text>\</xsl:text> + <xsl:value-of select="local-name(*[1])"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="7"/> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="m:sin | m:cos | m:tan | m:sec | m:csc | + m:cot | m:sinh | m:cosh | m:tanh | m:coth | + m:arcsin | m:arccos | m:arctan | m:ln"> + <xsl:text>\</xsl:text> + <xsl:value-of select="local-name(.)"/> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="m:apply[*[1][ + self::m:sech or self::m:csch or self::m:arccosh or + self::m:arccot or self::m:arccoth or self::m:arccsc or + self::m:arccsch or self::m:arcsec or self::m:arcsech or + self::m:arcsinh or self::m:arctanh]]"> + <xsl:text>\mathrm{</xsl:text> + <xsl:value-of select="local-name(*[1])"/> + <xsl:text>\,}</xsl:text> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="7"/> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="m:sech | m:csch | m:arccosh | m:arccot | + m:arccoth | m:arccsc |m:arccsch |m:arcsec | + m:arcsech | m:arcsinh | m:arctanh"> + <xsl:text>\mathrm{</xsl:text> + <xsl:value-of select="local-name(.)"/> + <xsl:text>}</xsl:text> +</xsl:template> + +<!-- 4.4.8.2 exp --> +<xsl:template match="m:apply[*[1][self::m:exp]]"> + <xsl:text>e^{</xsl:text><xsl:apply-templates select="*[2]"/><xsl:text>}</xsl:text> +</xsl:template> + +<!-- 4.4.8.4 log --> +<xsl:template match="m:apply[*[1][self::m:log]]"> + <xsl:text>\lg </xsl:text> + <xsl:apply-templates select="*[last()]"> + <xsl:with-param name="p" select="7"/> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="m:apply[*[1][self::m:log] and m:logbase != 10]"> + <xsl:text>\log_{</xsl:text> + <xsl:apply-templates select="m:logbase/node()"/> + <xsl:text>}</xsl:text> + <xsl:apply-templates select="*[last()]"> + <xsl:with-param name="p" select="7"/> + </xsl:apply-templates> +</xsl:template> + +<!-- 4.4.9.1 mean --> +<xsl:template match="m:apply[*[1][self::m:mean]]"> + <xsl:text>\langle </xsl:text> + <xsl:for-each select="*[position()>1]"> + <xsl:apply-templates select="."/> + <xsl:if test="position() !=last()"><xsl:text>, </xsl:text></xsl:if> + </xsl:for-each> + <xsl:text>\rangle </xsl:text> +</xsl:template> + +<!-- 4.4.9.2 sdef --> +<xsl:template match="m:sdev"><xsl:text>\sigma </xsl:text></xsl:template> + +<!-- 4.4.9.3 variance --> +<xsl:template match="m:apply[*[1][self::m:variance]]"> + <xsl:text>\sigma(</xsl:text> + <xsl:apply-templates select="*[2]"/> + <xsl:text>)^2</xsl:text> +</xsl:template> + +<!-- 4.4.9.5 moment --> +<xsl:template match="m:apply[*[1][self::m:moment]]"> + <xsl:text>\langle </xsl:text> + <xsl:apply-templates select="*[last()]"/> + <xsl:text>^{</xsl:text> + <xsl:apply-templates select="m:degree/node()"/> + <xsl:text>}\rangle</xsl:text> + <xsl:if test="m:momentabout"> + <xsl:text>_{</xsl:text> + <xsl:apply-templates select="m:momentabout/node()"/> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:text> </xsl:text> +</xsl:template> + +<!-- 4.4.10.1 vector --> +<xsl:template match="m:vector"> + <xsl:text>\left(\begin{array}{c}</xsl:text> + <xsl:for-each select="*"> + <xsl:apply-templates select="."/> + <xsl:if test="position()!=last()"><xsl:text>\\ </xsl:text></xsl:if> + </xsl:for-each> + <xsl:text>\end{array}\right)</xsl:text> +</xsl:template> + +<!-- 4.4.10.2 matrix --> +<xsl:template match="m:matrix"> + <xsl:text>\begin{pmatrix}</xsl:text> + <xsl:apply-templates/> + <xsl:text>\end{pmatrix}</xsl:text> +</xsl:template> + +<!-- 4.4.10.3 matrixrow --> +<xsl:template match="m:matrixrow"> + <xsl:for-each select="*"> + <xsl:apply-templates select="."/> + <xsl:if test="position()!=last()"><xsl:text> & </xsl:text></xsl:if> + </xsl:for-each> + <xsl:if test="position()!=last()"><xsl:text>\\ </xsl:text></xsl:if> +</xsl:template> + +<!-- 4.4.10.4 determinant --> +<xsl:template match="m:apply[*[1][self::m:determinant]]"> + <xsl:text>\det </xsl:text> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="7"/> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="m:apply[*[1][self::m:determinant]][*[2][self::m:matrix]]" priority="2"> + <xsl:text>\begin{vmatrix}</xsl:text> + <xsl:apply-templates select="m:matrix/*"/> + <xsl:text>\end{vmatrix}</xsl:text> +</xsl:template> + +<!-- 4.4.10.5 transpose --> +<xsl:template match="m:apply[*[1][self::m:transpose]]"> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="7"/> + </xsl:apply-templates> + <xsl:text>^T</xsl:text> +</xsl:template> + +<!-- 4.4.10.6 selector --> +<xsl:template match="m:apply[*[1][self::m:selector]]"> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="7"/> + </xsl:apply-templates> + <xsl:text>_{</xsl:text> + <xsl:for-each select="*[position()>2]"> + <xsl:apply-templates select="."/> + <xsl:if test="position() !=last()"><xsl:text>, </xsl:text></xsl:if> + </xsl:for-each> + <xsl:text>}</xsl:text> +</xsl:template> + +<!-- 4.4.10.8 scalarproduct --> +<xsl:template match="m:apply[*[1][self::m:scalarproduct]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\cdot </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.10.9 outerproduct --> +<xsl:template match="m:apply[*[1][self::m:outerproduct]]"> + <xsl:param name="p" select="0"/> + <xsl:call-template name="infix"> + <xsl:with-param name="this-p" select="2"/> + <xsl:with-param name="p" select="$p"/> + <xsl:with-param name="mo">\otimes </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- 4.4.11.2 semantics --> +<xsl:template match="m:semantics"><xsl:apply-templates select="*[1]"/></xsl:template> + +<xsl:template match="m:semantics[m:annotation/@encoding='TeX']"> + <xsl:apply-templates select="m:annotation[@encoding='TeX']/node()"/> +</xsl:template> + +<!-- 4.4.12.1 integers --> +<xsl:template match="m:integers"><xsl:text>\mathbb{Z}</xsl:text></xsl:template> + +<!-- 4.4.12.2 reals --> +<xsl:template match="m:reals"><xsl:text>\mathbb{R}</xsl:text></xsl:template> + +<!-- 4.4.12.3 rationals --> +<xsl:template match="m:rationals"><xsl:text>\mathbb{Q}</xsl:text></xsl:template> + +<!-- 4.4.12.4 naturalnumbers --> +<xsl:template match="m:naturalnumbers"><xsl:text>\mathbb{N}</xsl:text></xsl:template> + +<!-- 4.4.12.5 complexes --> +<xsl:template match="m:complexes"><xsl:text>\mathbb{C}</xsl:text></xsl:template> + +<!-- 4.4.12.6 primes --> +<xsl:template match="m:primes"><xsl:text>\mathbb{P}</xsl:text></xsl:template> + +<!-- 4.4.12.7 exponentiale --> +<xsl:template match="m:exponentiale"><xsl:text>e</xsl:text></xsl:template> + +<!-- 4.4.12.8 imaginaryi --> +<xsl:template match="m:imaginaryi"><xsl:text>i</xsl:text></xsl:template> + +<!-- 4.4.12.9 notanumber --> +<xsl:template match="m:notanumber"><xsl:text>NaN</xsl:text></xsl:template> + +<!-- 4.4.12.10 true --> +<xsl:template match="m:true"><xsl:text>\mbox{true}</xsl:text></xsl:template> + +<!-- 4.4.12.11 false --> +<xsl:template match="m:false"><xsl:text>\mbox{false}</xsl:text></xsl:template> + +<!-- 4.4.12.12 emptyset --> +<xsl:template match="m:emptyset"><xsl:text>\emptyset </xsl:text></xsl:template> + +<!-- 4.4.12.13 pi --> +<xsl:template match="m:pi"><xsl:text>\pi </xsl:text></xsl:template> + +<!-- 4.4.12.14 eulergamma --> +<xsl:template match="m:eulergamma"><xsl:text>\gamma </xsl:text></xsl:template> + +<!-- 4.4.12.15 infinity --> +<xsl:template match="m:infinity"><xsl:text>\infty </xsl:text></xsl:template> + +<!-- ****************************** --> +<xsl:template name="infix" > + <xsl:param name="mo"/> + <xsl:param name="p" select="0"/> + <xsl:param name="this-p" select="0"/> + <xsl:if test="$this-p < $p"><xsl:text>(</xsl:text></xsl:if> + <xsl:for-each select="*[position()>1]"> + <xsl:if test="position() > 1"> + <xsl:copy-of select="$mo"/> + </xsl:if> + <xsl:apply-templates select="."> + <xsl:with-param name="p" select="$this-p"/> + </xsl:apply-templates> + </xsl:for-each> + <xsl:if test="$this-p < $p"><xsl:text>)</xsl:text></xsl:if> +</xsl:template> + +<xsl:template name="binary" > + <xsl:param name="mo"/> + <xsl:param name="p" select="0"/> + <xsl:param name="this-p" select="0"/> + <xsl:if test="$this-p < $p"><xsl:text>(</xsl:text></xsl:if> + <xsl:apply-templates select="*[2]"> + <xsl:with-param name="p" select="$this-p"/> + </xsl:apply-templates> + <xsl:value-of select="$mo"/> + <xsl:apply-templates select="*[3]"> + <xsl:with-param name="p" select="$this-p"/> + </xsl:apply-templates> + <xsl:if test="$this-p < $p"><xsl:text>)</xsl:text></xsl:if> +</xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/entities.xsl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/entities.xsl new file mode 100755 index 00000000..1d39b9f6 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/entities.xsl @@ -0,0 +1,460 @@ +<?xml version='1.0' encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:m="http://www.w3.org/1998/Math/MathML" + version='1.0'> + +<!-- ====================================================================== --> +<!-- $Id: entities.xsl 149 2006-09-12 21:23:53Z fletcher $ + This file is part of the XSLT MathML Library distribution. + See ./README or http://www.raleigh.ru/MathML/mmltex for + copyright and other information + Modified by Fletcher T. Penney for MultiMarkdown Version 2.0.a --> +<!-- ====================================================================== --> + +<xsl:template name="replaceEntities"> + <xsl:param name="content"/> + <xsl:if test="string-length($content)>0"> + <xsl:choose> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select="'\; '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> + <xsl:when test="starts-with($content,'ɛ')"><xsl:value-of select="'\varepsilon '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ɛ')"/></xsl:call-template></xsl:when> <!--/varepsilon --> + <xsl:when test="starts-with($content,'˙')"><xsl:value-of select="'\dot{}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '˙')"/></xsl:call-template></xsl:when> <!--/DiacriticalDot --> +<!-- ====================================================================== --> +<!-- Unicode 3.2 + C1 Controls and Latin-1 Supplement + Range: 0080-00FF + http://www.unicode.org/charts/PDF/U0080.pdf --> +<!-- ====================================================================== --> + <xsl:when test="starts-with($content,'£')"><xsl:value-of select="'\pounds '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '£')"/></xsl:call-template></xsl:when> <!--pound sign --> + <xsl:when test="starts-with($content,'¥')"><xsl:value-of select="'\yen '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '¥')"/></xsl:call-template></xsl:when> <!--/yen =yen sign --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'§')"><xsl:value-of select="'\S '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '§')"/></xsl:call-template></xsl:when> <!--section sign --> + <xsl:when test="starts-with($content,'©')"><xsl:value-of select="'\copyright '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '©')"/></xsl:call-template></xsl:when> <!--copyright sign --> + <xsl:when test="starts-with($content,'¬')"><xsl:value-of select="'\neg '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '¬')"/></xsl:call-template></xsl:when> <!--/neg /lnot =not sign --> + <xsl:when test="starts-with($content,'®')"><xsl:value-of select="'\circledR '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '®')"/></xsl:call-template></xsl:when> <!--/circledR =registered sign --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'±')"><xsl:value-of select="'\pm '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '±')"/></xsl:call-template></xsl:when> <!--/pm B: =plus-or-minus sign --> + <xsl:when test="starts-with($content,'µ')"><xsl:value-of select="'\mu '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'µ')"/></xsl:call-template></xsl:when> <!--=micro sign --> + <xsl:when test="starts-with($content,'¶')"><xsl:value-of select="'\P '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '¶')"/></xsl:call-template></xsl:when> <!--pilcrow (paragraph sign) --> + <xsl:when test="starts-with($content,'Å')"><xsl:value-of select="'\AA '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Å')"/></xsl:call-template></xsl:when> <!--capital A, ring --> <!-- invalid in math mode --> + <xsl:when test="starts-with($content,'Æ')"><xsl:value-of select="'\AE '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Æ')"/></xsl:call-template></xsl:when> <!--capital AE diphthong (ligature) --> <!-- invalid in math mode --> + <xsl:when test="starts-with($content,'×')"><xsl:value-of select="'\times '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '×')"/></xsl:call-template></xsl:when> <!--/times B: =multiply sign --> + <xsl:when test="starts-with($content,'æ')"><xsl:value-of select="'\ae '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'æ')"/></xsl:call-template></xsl:when> <!--small ae diphthong (ligature) --> <!-- invalid in math mode --> + +<!-- ====================================================================== --> +<!-- Unicode 3.2 + Greek + Range: 0370-03FF + http://www.unicode.org/charts/PDF/U0370.pdf --> +<!-- ====================================================================== --> + <xsl:when test="starts-with($content,'Α')"><xsl:value-of select="'{\rm A}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Α')"/></xsl:call-template></xsl:when> <!--greek capital letter alpha --> + <xsl:when test="starts-with($content,'Β')"><xsl:value-of select="'{\rm B}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Β')"/></xsl:call-template></xsl:when> <!-- greek capital letter beta --> + <xsl:when test="starts-with($content,'Γ')"><xsl:value-of select="'\Gamma '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Γ')"/></xsl:call-template></xsl:when> <!--/Gamma capital Gamma, Greek --> + <xsl:when test="starts-with($content,'Δ')"><xsl:value-of select="'\Delta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Δ')"/></xsl:call-template></xsl:when> <!--/Delta capital Delta, Greek --> + <xsl:when test="starts-with($content,'Ε')"><xsl:value-of select="'{\rm E}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ε')"/></xsl:call-template></xsl:when> <!-- greek capital letter epsilon --> + <xsl:when test="starts-with($content,'Ζ')"><xsl:value-of select="'{\rm Z}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ζ')"/></xsl:call-template></xsl:when> <!-- greek capital letter zeta --> + <xsl:when test="starts-with($content,'Η')"><xsl:value-of select="'{\rm H}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Η')"/></xsl:call-template></xsl:when> <!-- greek capital letter eta --> + <xsl:when test="starts-with($content,'Θ')"><xsl:value-of select="'\Theta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Θ')"/></xsl:call-template></xsl:when> <!--/Theta capital Theta, Greek --> + <xsl:when test="starts-with($content,'Ι')"><xsl:value-of select="'{\rm I}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ι')"/></xsl:call-template></xsl:when> <!-- greek capital letter iota --> + <xsl:when test="starts-with($content,'Κ')"><xsl:value-of select="'{\rm K}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Κ')"/></xsl:call-template></xsl:when> <!-- greek capital letter kappa --> + <xsl:when test="starts-with($content,'Λ')"><xsl:value-of select="'\Lambda '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Λ')"/></xsl:call-template></xsl:when> <!--/Lambda capital Lambda, Greek --> + <xsl:when test="starts-with($content,'Μ')"><xsl:value-of select="'{\rm M}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Μ')"/></xsl:call-template></xsl:when> <!-- greek capital letter mu --> + <xsl:when test="starts-with($content,'Ν')"><xsl:value-of select="'{\rm N}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ν')"/></xsl:call-template></xsl:when> <!-- greek capital letter nu --> + <xsl:when test="starts-with($content,'Ξ')"><xsl:value-of select="'\Xi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ξ')"/></xsl:call-template></xsl:when> <!--/Xi capital Xi, Greek --> + <xsl:when test="starts-with($content,'Ο')"><xsl:value-of select="'{\rm O}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ο')"/></xsl:call-template></xsl:when> <!-- greek capital letter omicron --> + <xsl:when test="starts-with($content,'Π')"><xsl:value-of select="'\Pi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Π')"/></xsl:call-template></xsl:when> <!--/Pi capital Pi, Greek --> + <xsl:when test="starts-with($content,'Ρ')"><xsl:value-of select="'{\rm P}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ρ')"/></xsl:call-template></xsl:when> <!-- greek capital letter rho --> + <xsl:when test="starts-with($content,'Σ')"><xsl:value-of select="'\Sigma '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Σ')"/></xsl:call-template></xsl:when> <!--/Sigma capital Sigma, Greek --> + <xsl:when test="starts-with($content,'Τ')"><xsl:value-of select="'{\rm T}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Τ')"/></xsl:call-template></xsl:when> <!-- greek capital letter tau --> + <xsl:when test="starts-with($content,'Υ')"><xsl:value-of select="'{\rm Y}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Υ')"/></xsl:call-template></xsl:when> <!-- greek capital letter upsilon --> + <xsl:when test="starts-with($content,'Φ')"><xsl:value-of select="'\Phi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Φ')"/></xsl:call-template></xsl:when> <!--/Phi capital Phi, Greek --> + <xsl:when test="starts-with($content,'Χ')"><xsl:value-of select="'{\rm X}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Χ')"/></xsl:call-template></xsl:when> <!-- greek capital letter chi --> + <xsl:when test="starts-with($content,'Ψ')"><xsl:value-of select="'\Psi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ψ')"/></xsl:call-template></xsl:when> <!--/Psi capital Psi, Greek --> + <xsl:when test="starts-with($content,'Ω')"><xsl:value-of select="'\Omega '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ω')"/></xsl:call-template></xsl:when> <!--/Omega capital Omega, Greek --> + <xsl:when test="starts-with($content,'α')"><xsl:value-of select="'\alpha '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'α')"/></xsl:call-template></xsl:when> <!--/alpha small alpha, Greek --> + <xsl:when test="starts-with($content,'β')"><xsl:value-of select="'\beta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'β')"/></xsl:call-template></xsl:when> <!--/beta small beta, Greek --> + <xsl:when test="starts-with($content,'γ')"><xsl:value-of select="'\gamma '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'γ')"/></xsl:call-template></xsl:when> <!--/gamma small gamma, Greek --> + <xsl:when test="starts-with($content,'δ')"><xsl:value-of select="'\delta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'δ')"/></xsl:call-template></xsl:when> <!--/delta small delta, Greek --> + <xsl:when test="starts-with($content,'ε')"><xsl:value-of select="'\epsilon '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ε')"/></xsl:call-template></xsl:when> <!--/straightepsilon, small epsilon, Greek --> + <xsl:when test="starts-with($content,'ζ')"><xsl:value-of select="'\zeta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ζ')"/></xsl:call-template></xsl:when> <!--/zeta small zeta, Greek --> + <xsl:when test="starts-with($content,'η')"><xsl:value-of select="'\eta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'η')"/></xsl:call-template></xsl:when> <!--/eta small eta, Greek --> + <xsl:when test="starts-with($content,'θ')"><xsl:value-of select="'\theta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'θ')"/></xsl:call-template></xsl:when> <!--/theta straight theta, small theta, Greek --> + <xsl:when test="starts-with($content,'ι')"><xsl:value-of select="'\iota '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ι')"/></xsl:call-template></xsl:when> <!--/iota small iota, Greek --> + <xsl:when test="starts-with($content,'κ')"><xsl:value-of select="'\kappa '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'κ')"/></xsl:call-template></xsl:when> <!--/kappa small kappa, Greek --> + <xsl:when test="starts-with($content,'λ')"><xsl:value-of select="'\lambda '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'λ')"/></xsl:call-template></xsl:when> <!--/lambda small lambda, Greek --> + <xsl:when test="starts-with($content,'μ')"><xsl:value-of select="'\mu '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'μ')"/></xsl:call-template></xsl:when> <!--/mu small mu, Greek --> + <xsl:when test="starts-with($content,'ν')"><xsl:value-of select="'\nu '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ν')"/></xsl:call-template></xsl:when> <!--/nu small nu, Greek --> + <xsl:when test="starts-with($content,'ξ')"><xsl:value-of select="'\xi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ξ')"/></xsl:call-template></xsl:when> <!--/xi small xi, Greek --> + <xsl:when test="starts-with($content,'ο')"><xsl:value-of select="'o'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ο')"/></xsl:call-template></xsl:when> <!--small omicron, Greek --> + <xsl:when test="starts-with($content,'π')"><xsl:value-of select="'\pi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'π')"/></xsl:call-template></xsl:when> <!--/pi small pi, Greek --> + <xsl:when test="starts-with($content,'ρ')"><xsl:value-of select="'\rho '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ρ')"/></xsl:call-template></xsl:when> <!--/rho small rho, Greek --> + <xsl:when test="starts-with($content,'ς')"><xsl:value-of select="'\varsigma '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ς')"/></xsl:call-template></xsl:when> <!--/varsigma --> + <xsl:when test="starts-with($content,'σ')"><xsl:value-of select="'\sigma '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'σ')"/></xsl:call-template></xsl:when> <!--/sigma small sigma, Greek --> + <xsl:when test="starts-with($content,'τ')"><xsl:value-of select="'\tau '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'τ')"/></xsl:call-template></xsl:when> <!--/tau small tau, Greek --> + <xsl:when test="starts-with($content,'υ')"><xsl:value-of select="'\upsilon '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'υ')"/></xsl:call-template></xsl:when> <!--/upsilon small upsilon, Greek --> + <xsl:when test="starts-with($content,'φ')"><xsl:value-of select="'\phi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'φ')"/></xsl:call-template></xsl:when> <!--/straightphi - small phi, Greek --> + <xsl:when test="starts-with($content,'χ')"><xsl:value-of select="'\chi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'χ')"/></xsl:call-template></xsl:when> <!--/chi small chi, Greek --> + <xsl:when test="starts-with($content,'ψ')"><xsl:value-of select="'\psi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ψ')"/></xsl:call-template></xsl:when> <!--/psi small psi, Greek --> + <xsl:when test="starts-with($content,'ω')"><xsl:value-of select="'\omega '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ω')"/></xsl:call-template></xsl:when> <!--/omega small omega, Greek --> + <xsl:when test="starts-with($content,'ϑ')"><xsl:value-of select="'\vartheta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϑ')"/></xsl:call-template></xsl:when> <!--/vartheta - curly or open theta --> + <xsl:when test="starts-with($content,'ϒ')"><xsl:value-of select="'\Upsilon '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϒ')"/></xsl:call-template></xsl:when> <!--/Upsilon capital Upsilon, Greek --> + <xsl:when test="starts-with($content,'ϕ')"><xsl:value-of select="'\varphi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϕ')"/></xsl:call-template></xsl:when> <!--/varphi - curly or open phi --> + <xsl:when test="starts-with($content,'ϖ')"><xsl:value-of select="'\varpi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϖ')"/></xsl:call-template></xsl:when> <!--/varpi --> + <xsl:when test="starts-with($content,'ϰ')"><xsl:value-of select="'\varkappa '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϰ')"/></xsl:call-template></xsl:when> <!--/varkappa --> + <xsl:when test="starts-with($content,'ϱ')"><xsl:value-of select="'\varrho '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϱ')"/></xsl:call-template></xsl:when> <!--/varrho --> + +<!-- ====================================================================== --> +<!-- Unicode 3.2 + General Punctuation + Range: 2000-206F + http://www.unicode.org/charts/PDF/U2000.pdf --> +<!-- ====================================================================== --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{0.5em}"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> <!-- en space (1/2-em) --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{1em}"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> <!-- emsp - space of width 1em --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{0.33em}"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> <!-- emsp13 - space of width 1/3 em --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{0.25em}"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> <!-- ThickSpace - space of width 1/4 em --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{0.17em}"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> <!-- ThinSpace - space of width 3/18 em --> + <xsl:when test="starts-with($content,'​')"><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '​')"/></xsl:call-template></xsl:when> <!--zero width space --> + <xsl:when test="starts-with($content,'‖')"><xsl:value-of select="'\Vert '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '‖')"/></xsl:call-template></xsl:when> <!--/Vert dbl vertical bar --> + <xsl:when test="starts-with($content,'…')"><xsl:value-of select="'\dots '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '…')"/></xsl:call-template></xsl:when> <!--horizontal ellipsis = three dot leader --> + <xsl:when test="starts-with($content,'′')"><xsl:value-of select="'\prime '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '′')"/></xsl:call-template></xsl:when> <!--/prime prime or minute --> + <xsl:when test="starts-with($content,'⁡')"><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⁡')"/></xsl:call-template></xsl:when> <!-- ApplyFunction --> + <xsl:when test="starts-with($content,'⁢')"><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⁢')"/></xsl:call-template></xsl:when> <!-- InvisibleTimes --> + <xsl:when test="starts-with($content,'⁣')"><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⁣')"/></xsl:call-template></xsl:when> <!-- InvisibleComma, used as a separator, e.g., in indices --> +<!-- ====================================================================== --> +<!-- Unicode 3.2 + Letterlike Symbols + Range: 2100-214F + http://www.unicode.org/charts/PDF/U2100.pdf --> +<!-- ====================================================================== --> + <xsl:when test="starts-with($content,'ℋ')"><xsl:value-of select="'\mathscr{H}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℋ')"/></xsl:call-template></xsl:when> <!--H Hamiltonian --> + <xsl:when test="starts-with($content,'ℏ︀')"><xsl:value-of select="'\hbar '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℏ︀')"/></xsl:call-template></xsl:when> <!--/hbar - Planck's over 2pi --> + <xsl:when test="starts-with($content,'ℏ')"><xsl:value-of select="'\hslash '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℏ')"/></xsl:call-template></xsl:when> <!--/hslash - variant Planck's over 2pi --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'ℑ')"><xsl:value-of select="'\Im '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℑ')"/></xsl:call-template></xsl:when> <!--/Im - imaginary --> + <xsl:when test="starts-with($content,'ℓ')"><xsl:value-of select="'\ell '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℓ')"/></xsl:call-template></xsl:when> <!--/ell - cursive small l --> + <xsl:when test="starts-with($content,'ℕ')"><xsl:value-of select="'\mathbb{N}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℕ')"/></xsl:call-template></xsl:when> <!--the semi-ring of natural numbers --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'℘')"><xsl:value-of select="'\wp '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '℘')"/></xsl:call-template></xsl:when> <!--/wp - Weierstrass p --> + <xsl:when test="starts-with($content,'ℙ')"><xsl:value-of select="'\mathbb{P}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℙ')"/></xsl:call-template></xsl:when> <!--the prime natural numbers --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'ℚ')"><xsl:value-of select="'\mathbb{Q}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℚ')"/></xsl:call-template></xsl:when> <!--the field of rational numbers --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'ℜ')"><xsl:value-of select="'\Re '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℜ')"/></xsl:call-template></xsl:when> <!--/Re - real --> + <xsl:when test="starts-with($content,'ℤ')"><xsl:value-of select="'\mathbb{Z}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℤ')"/></xsl:call-template></xsl:when> <!--the ring of integers --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'Ω')"><xsl:value-of select="'\Omega '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ω')"/></xsl:call-template></xsl:when> <!--ohm sign --> + <xsl:when test="starts-with($content,'℧')"><xsl:value-of select="'\mho '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '℧')"/></xsl:call-template></xsl:when> <!--/mho - conductance --> + <xsl:when test="starts-with($content,'ℵ')"><xsl:value-of select="'\aleph '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℵ')"/></xsl:call-template></xsl:when> <!--/aleph aleph, Hebrew --> + <xsl:when test="starts-with($content,'ℶ')"><xsl:value-of select="'\beth '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℶ')"/></xsl:call-template></xsl:when> <!--/beth - beth, Hebrew --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'ℷ')"><xsl:value-of select="'\gimel '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℷ')"/></xsl:call-template></xsl:when> <!--/gimel - gimel, Hebrew --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'ℸ')"><xsl:value-of select="'\daleth '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℸ')"/></xsl:call-template></xsl:when> <!--/daleth - daleth, Hebrew --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'ⅅ')"><xsl:value-of select="'D'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ⅅ')"/></xsl:call-template></xsl:when> <!--D for use in differentials, e.g., within integrals --> + <xsl:when test="starts-with($content,'ⅆ')"><xsl:value-of select="'d'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ⅆ')"/></xsl:call-template></xsl:when> <!--d for use in differentials, e.g., within integrals --> + <xsl:when test="starts-with($content,'ⅇ')"><xsl:value-of select="'e'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ⅇ')"/></xsl:call-template></xsl:when> <!--e use for the exponential base of the natural logarithms --> + <xsl:when test="starts-with($content,'ⅈ')"><xsl:value-of select="'i'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ⅈ')"/></xsl:call-template></xsl:when> <!--i for use as a square root of -1 --> + <xsl:when test="starts-with($content,'ⅉ')"><xsl:value-of select="'j'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ⅉ')"/></xsl:call-template></xsl:when> + +<!-- ====================================================================== --> +<!-- Unicode 3.2 + Arrows + Range: 2190-21FF + http://www.unicode.org/charts/PDF/U2190.pdf --> +<!-- ====================================================================== --> + <xsl:when test="starts-with($content,'←')"><xsl:value-of select="'\leftarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '←')"/></xsl:call-template></xsl:when> <!--/leftarrow /gets A: =leftward arrow --> + <xsl:when test="starts-with($content,'↑')"><xsl:value-of select="'\uparrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↑')"/></xsl:call-template></xsl:when> <!--/uparrow A: =upward arrow --> + <xsl:when test="starts-with($content,'→')"><xsl:value-of select="'\to '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '→')"/></xsl:call-template></xsl:when> <!--/rightarrow /to A: =rightward arrow --> + <xsl:when test="starts-with($content,'↓')"><xsl:value-of select="'\downarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↓')"/></xsl:call-template></xsl:when> <!--/downarrow A: =downward arrow --> + <xsl:when test="starts-with($content,'↔')"><xsl:value-of select="'\leftrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↔')"/></xsl:call-template></xsl:when> <!--/leftrightarrow A: l&r arrow --> + <xsl:when test="starts-with($content,'↕')"><xsl:value-of select="'\updownarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↕')"/></xsl:call-template></xsl:when> <!--/updownarrow A: up&down arrow --> + <xsl:when test="starts-with($content,'↖')"><xsl:value-of select="'\nwarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↖')"/></xsl:call-template></xsl:when> <!--/nwarrow A: NW pointing arrow --> + <xsl:when test="starts-with($content,'↗')"><xsl:value-of select="'\nearrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↗')"/></xsl:call-template></xsl:when> <!--/nearrow A: NE pointing arrow --> + <xsl:when test="starts-with($content,'↘')"><xsl:value-of select="'\searrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↘')"/></xsl:call-template></xsl:when> <!--/searrow A: SE pointing arrow --> + <xsl:when test="starts-with($content,'↙')"><xsl:value-of select="'\swarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↙')"/></xsl:call-template></xsl:when> <!--/swarrow A: SW pointing arrow --> + <xsl:when test="starts-with($content,'↚')"><xsl:value-of select="'\nleftarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↚')"/></xsl:call-template></xsl:when> <!--/nleftarrow A: not left arrow --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↛')"><xsl:value-of select="'\nrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↛')"/></xsl:call-template></xsl:when> <!--/nrightarrow A: not right arrow --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↝')"><xsl:value-of select="'\rightsquigarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↝')"/></xsl:call-template></xsl:when> <!--/rightsquigarrow A: rt arrow-wavy --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↞')"><xsl:value-of select="'\twoheadleftarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↞')"/></xsl:call-template></xsl:when> <!--/twoheadleftarrow A: --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↠')"><xsl:value-of select="'\twoheadrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↠')"/></xsl:call-template></xsl:when> <!--/twoheadrightarrow A: --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↢')"><xsl:value-of select="'\leftarrowtail '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↢')"/></xsl:call-template></xsl:when> <!--/leftarrowtail A: left arrow-tailed --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↣')"><xsl:value-of select="'\rightarrowtail '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↣')"/></xsl:call-template></xsl:when> <!--/rightarrowtail A: rt arrow-tailed --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↦')"><xsl:value-of select="'\mapsto '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↦')"/></xsl:call-template></xsl:when> <!--/mapsto A: --> + <xsl:when test="starts-with($content,'↩')"><xsl:value-of select="'\hookleftarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↩')"/></xsl:call-template></xsl:when> <!--/hookleftarrow A: left arrow-hooked --> + <xsl:when test="starts-with($content,'↪')"><xsl:value-of select="'\hookrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↪')"/></xsl:call-template></xsl:when> <!--/hookrightarrow A: rt arrow-hooked --> + <xsl:when test="starts-with($content,'↫')"><xsl:value-of select="'\looparrowleft '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↫')"/></xsl:call-template></xsl:when> <!--/looparrowleft A: left arrow-looped --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↬')"><xsl:value-of select="'\looparrowright '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↬')"/></xsl:call-template></xsl:when> <!--/looparrowright A: rt arrow-looped --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↭')"><xsl:value-of select="'\leftrightsquigarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↭')"/></xsl:call-template></xsl:when> <!--/leftrightsquigarrow A: l&r arr-wavy --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↮')"><xsl:value-of select="'\nleftrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↮')"/></xsl:call-template></xsl:when> <!--/nleftrightarrow A: not l&r arrow --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↰')"><xsl:value-of select="'\Lsh '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↰')"/></xsl:call-template></xsl:when> <!--/Lsh A: --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↱')"><xsl:value-of select="'\Rsh '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↱')"/></xsl:call-template></xsl:when> <!--/Rsh A: --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↶')"><xsl:value-of select="'\curvearrowleft '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↶')"/></xsl:call-template></xsl:when> <!--/curvearrowleft A: left curved arrow --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↷')"><xsl:value-of select="'\curvearrowright '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↷')"/></xsl:call-template></xsl:when> <!--/curvearrowright A: rt curved arrow --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↺')"><xsl:value-of select="'\circlearrowleft '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↺')"/></xsl:call-template></xsl:when> <!--/circlearrowleft A: l arr in circle --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↻')"><xsl:value-of select="'\circlearrowright '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↻')"/></xsl:call-template></xsl:when> <!--/circlearrowright A: r arr in circle --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↼')"><xsl:value-of select="'\leftharpoonup '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↼')"/></xsl:call-template></xsl:when> <!--/leftharpoonup A: left harpoon-up --> + <xsl:when test="starts-with($content,'↽')"><xsl:value-of select="'\leftharpoondown '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↽')"/></xsl:call-template></xsl:when> <!--/leftharpoondown A: l harpoon-down --> + <xsl:when test="starts-with($content,'↾')"><xsl:value-of select="'\upharpoonright '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↾')"/></xsl:call-template></xsl:when> <!--/upharpoonright /restriction A: up harp-r --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'↿')"><xsl:value-of select="'\upharpoonleft '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '↿')"/></xsl:call-template></xsl:when> <!--/upharpoonleft A: up harpoon-left --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇀')"><xsl:value-of select="'\rightharpoonup '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇀')"/></xsl:call-template></xsl:when> <!--/rightharpoonup A: rt harpoon-up --> + <xsl:when test="starts-with($content,'⇁')"><xsl:value-of select="'\rightharpoondown '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇁')"/></xsl:call-template></xsl:when> <!--/rightharpoondown A: rt harpoon-down --> + <xsl:when test="starts-with($content,'⇂')"><xsl:value-of select="'\downharpoonright '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇂')"/></xsl:call-template></xsl:when> <!--/downharpoonright A: down harpoon-rt --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇃')"><xsl:value-of select="'\downharpoonleft '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇃')"/></xsl:call-template></xsl:when> <!--/downharpoonleft A: dn harpoon-left --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇄')"><xsl:value-of select="'\rightleftarrows '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇄')"/></xsl:call-template></xsl:when> <!--/rightleftarrows A: r arr over l arr --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇆')"><xsl:value-of select="'\leftrightarrows '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇆')"/></xsl:call-template></xsl:when> <!--/leftrightarrows A: l arr over r arr --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇇')"><xsl:value-of select="'\leftleftarrows '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇇')"/></xsl:call-template></xsl:when> <!--/leftleftarrows A: two left arrows --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇈')"><xsl:value-of select="'\upuparrows '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇈')"/></xsl:call-template></xsl:when> <!--/upuparrows A: two up arrows --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇉')"><xsl:value-of select="'\rightrightarrows '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇉')"/></xsl:call-template></xsl:when> <!--/rightrightarrows A: two rt arrows --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇊')"><xsl:value-of select="'\downdownarrows '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇊')"/></xsl:call-template></xsl:when> <!--/downdownarrows A: two down arrows --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇋')"><xsl:value-of select="'\leftrightharpoons '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇋')"/></xsl:call-template></xsl:when> <!--/leftrightharpoons A: l harp over r --> + <xsl:when test="starts-with($content,'⇌')"><xsl:value-of select="'\rightleftharpoons '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇌')"/></xsl:call-template></xsl:when> <!--/rightleftharpoons A: r harp over l --> + <xsl:when test="starts-with($content,'⇍')"><xsl:value-of select="'\nLeftarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇍')"/></xsl:call-template></xsl:when> <!--/nLeftarrow A: not implied by --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇎')"><xsl:value-of select="'\nLeftrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇎')"/></xsl:call-template></xsl:when> <!--/nLeftrightarrow A: not l&r dbl arr --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇏')"><xsl:value-of select="'\nRightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇏')"/></xsl:call-template></xsl:when> <!--/nRightarrow A: not implies --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇐')"><xsl:value-of select="'\Leftarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇐')"/></xsl:call-template></xsl:when> <!--/Leftarrow A: is implied by --> + <xsl:when test="starts-with($content,'⇑')"><xsl:value-of select="'\Uparrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇑')"/></xsl:call-template></xsl:when> <!--/Uparrow A: up dbl arrow --> + <xsl:when test="starts-with($content,'⇒')"><xsl:value-of select="'\Rightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇒')"/></xsl:call-template></xsl:when> <!--/Rightarrow A: implies --> + <xsl:when test="starts-with($content,'⇓')"><xsl:value-of select="'\Downarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇓')"/></xsl:call-template></xsl:when> <!--/Downarrow A: down dbl arrow --> +<!-- <xsl:when test="starts-with($content,'⇔')"><xsl:value-of select="'\Leftrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇔')"/></xsl:call-template></xsl:when> /Leftrightarrow A: l&r dbl arrow --> + <xsl:when test="starts-with($content,'⇔')"><xsl:value-of select="'\iff '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇔')"/></xsl:call-template></xsl:when> <!--/iff if and only if --> + <xsl:when test="starts-with($content,'⇕')"><xsl:value-of select="'\Updownarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇕')"/></xsl:call-template></xsl:when> <!--/Updownarrow A: up&down dbl arrow --> + <xsl:when test="starts-with($content,'⇚')"><xsl:value-of select="'\Lleftarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇚')"/></xsl:call-template></xsl:when> <!--/Lleftarrow A: left triple arrow --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⇛')"><xsl:value-of select="'\Rrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⇛')"/></xsl:call-template></xsl:when> <!--/Rrightarrow A: right triple arrow --> <!-- Required amssymb --> + +<!-- ====================================================================== --> +<!-- Unicode 3.2 + Mathematical Operators + Range: 2200-22FF + http://www.unicode.org/charts/PDF/U2200.pdf --> +<!-- ====================================================================== --> + <xsl:when test="starts-with($content,'∀')"><xsl:value-of select="'\forall '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∀')"/></xsl:call-template></xsl:when> <!--/forall for all --> + <xsl:when test="starts-with($content,'∁')"><xsl:value-of select="'\complement '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∁')"/></xsl:call-template></xsl:when> <!--/complement - complement sign --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'∂')"><xsl:value-of select="'\partial '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∂')"/></xsl:call-template></xsl:when> <!--/partial partial differential --> + <xsl:when test="starts-with($content,'∃')"><xsl:value-of select="'\exists '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∃')"/></xsl:call-template></xsl:when> <!--/exists at least one exists --> + <xsl:when test="starts-with($content,'∄')"><xsl:value-of select="'\nexists '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∄')"/></xsl:call-template></xsl:when> <!--/nexists - negated exists --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'∅︀')"><xsl:value-of select="'\emptyset '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∅︀')"/></xsl:call-template></xsl:when> <!--/emptyset - zero, slash --> + <xsl:when test="starts-with($content,'∅')"><xsl:value-of select="'\varnothing '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∅')"/></xsl:call-template></xsl:when> <!--/varnothing - circle, slash --> <!-- Required amssymb --> +<!-- <xsl:when test="starts-with($content,'∆')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∆')"/></xsl:call-template></xsl:when>--> + <xsl:when test="starts-with($content,'∇')"><xsl:value-of select="'\nabla '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∇')"/></xsl:call-template></xsl:when> <!--/nabla del, Hamilton operator --> + <xsl:when test="starts-with($content,'∈')"><xsl:value-of select="'\in '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∈')"/></xsl:call-template></xsl:when> <!--/in R: set membership --> + <xsl:when test="starts-with($content,'∉')"><xsl:value-of select="'\notin '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∉')"/></xsl:call-template></xsl:when> <!--/notin N: negated set membership --> + <xsl:when test="starts-with($content,'∋')"><xsl:value-of select="'\ni '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∋')"/></xsl:call-template></xsl:when> <!--/ni /owns R: contains --> + <xsl:when test="starts-with($content,'∌')"><xsl:value-of select="'\not\ni '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∌')"/></xsl:call-template></xsl:when> <!--negated contains --> + <xsl:when test="starts-with($content,'∏')"><xsl:value-of select="'\prod '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∏')"/></xsl:call-template></xsl:when> <!--/prod L: product operator --> + <xsl:when test="starts-with($content,'∐')"><xsl:value-of select="'\coprod '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∐')"/></xsl:call-template></xsl:when> <!--/coprod L: coproduct operator --> + <xsl:when test="starts-with($content,'∑')"><xsl:value-of select="'\sum '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∑')"/></xsl:call-template></xsl:when> <!--/sum L: summation operator --> + <xsl:when test="starts-with($content,'−')"><xsl:value-of select="'-'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '−')"/></xsl:call-template></xsl:when> <!--B: minus sign --> + <xsl:when test="starts-with($content,'∓')"><xsl:value-of select="'\mp '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∓')"/></xsl:call-template></xsl:when> <!--/mp B: minus-or-plus sign --> + <xsl:when test="starts-with($content,'∔')"><xsl:value-of select="'\dotplus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∔')"/></xsl:call-template></xsl:when> <!--/dotplus B: plus sign, dot above --> <!-- Required amssymb --> +<!-- <xsl:when test="starts-with($content,'∕')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∕')"/></xsl:call-template></xsl:when>--> + <xsl:when test="starts-with($content,'∖')"><xsl:value-of select="'\setminus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∖')"/></xsl:call-template></xsl:when> <!--/setminus B: reverse solidus --> + <xsl:when test="starts-with($content,'∗')"><xsl:value-of select="'\ast '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∗')"/></xsl:call-template></xsl:when> <!--low asterisk --> + <xsl:when test="starts-with($content,'∘')"><xsl:value-of select="'\circ '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∘')"/></xsl:call-template></xsl:when> <!--/circ B: composite function (small circle) --> + <xsl:when test="starts-with($content,'∙')"><xsl:value-of select="'\bullet '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∙')"/></xsl:call-template></xsl:when> + <xsl:when test="starts-with($content,'√')"><xsl:value-of select="'\surd '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '√')"/></xsl:call-template></xsl:when> <!--/surd radical --> + <xsl:when test="starts-with($content,'∝')"><xsl:value-of select="'\propto '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∝')"/></xsl:call-template></xsl:when> <!--/propto R: is proportional to --> + <xsl:when test="starts-with($content,'∞')"><xsl:value-of select="'\infty '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∞')"/></xsl:call-template></xsl:when> <!--/infty infinity --> +<!-- <xsl:when test="starts-with($content,'∟')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∟')"/></xsl:call-template></xsl:when> right (90 degree) angle --> + <xsl:when test="starts-with($content,'∠')"><xsl:value-of select="'\angle '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∠')"/></xsl:call-template></xsl:when> <!--/angle - angle --> + <xsl:when test="starts-with($content,'∡')"><xsl:value-of select="'\measuredangle '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∡')"/></xsl:call-template></xsl:when> <!--/measuredangle - angle-measured --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'∢')"><xsl:value-of select="'\sphericalangle '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∢')"/></xsl:call-template></xsl:when><!--/sphericalangle angle-spherical --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'∣')"><xsl:value-of select="'\mid '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∣')"/></xsl:call-template></xsl:when> <!--/mid R: --> + <xsl:when test="starts-with($content,'∤︀')"><xsl:value-of select="'\nshortmid '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∤︀')"/></xsl:call-template></xsl:when> <!--/nshortmid --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'∤')"><xsl:value-of select="'\nmid '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∤')"/></xsl:call-template></xsl:when> <!--/nmid --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'∥')"><xsl:value-of select="'\parallel '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∥')"/></xsl:call-template></xsl:when> <!--/parallel R: parallel --> + <xsl:when test="starts-with($content,'∦︀')"><xsl:value-of select="'\nshortparallel '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∦︀')"/></xsl:call-template></xsl:when> <!--/nshortparallel N: not short par --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'∦')"><xsl:value-of select="'\nparallel '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∦')"/></xsl:call-template></xsl:when> <!--/nparallel N: not parallel --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'∧')"><xsl:value-of select="'\wedge '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∧')"/></xsl:call-template></xsl:when> <!--/wedge /land B: logical and --> + <xsl:when test="starts-with($content,'∨')"><xsl:value-of select="'\vee '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∨')"/></xsl:call-template></xsl:when> <!--/vee /lor B: logical or --> + <xsl:when test="starts-with($content,'∩')"><xsl:value-of select="'\cap '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∩')"/></xsl:call-template></xsl:when> <!--/cap B: intersection --> + <xsl:when test="starts-with($content,'∪')"><xsl:value-of select="'\cup '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∪')"/></xsl:call-template></xsl:when> <!--/cup B: union or logical sum --> + <xsl:when test="starts-with($content,'∫')"><xsl:value-of select="'\int '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∫')"/></xsl:call-template></xsl:when> <!--/int L: integral operator --> + <xsl:when test="starts-with($content,'∬')"><xsl:value-of select="'\iint '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∬')"/></xsl:call-template></xsl:when> <!--double integral operator --> <!-- Required amsmath --> + <xsl:when test="starts-with($content,'∭')"><xsl:value-of select="'\iiint '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∭')"/></xsl:call-template></xsl:when> <!--/iiint triple integral operator --> <!-- Required amsmath --> + <xsl:when test="starts-with($content,'∮')"><xsl:value-of select="'\oint '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∮')"/></xsl:call-template></xsl:when> <!--/oint L: contour integral operator --> +<!-- <xsl:when test="starts-with($content,'∯')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∯')"/></xsl:call-template></xsl:when>--> +<!-- <xsl:when test="starts-with($content,'∰')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∰')"/></xsl:call-template></xsl:when>--> +<!-- <xsl:when test="starts-with($content,'∱')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∱')"/></xsl:call-template></xsl:when>--> +<!-- <xsl:when test="starts-with($content,'∲')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∲')"/></xsl:call-template></xsl:when>--> +<!-- <xsl:when test="starts-with($content,'∳')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∳')"/></xsl:call-template></xsl:when>--> + <xsl:when test="starts-with($content,'∴')"><xsl:value-of select="'\therefore '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∴')"/></xsl:call-template></xsl:when> <!--/therefore R: therefore --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'∵')"><xsl:value-of select="'\because '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∵')"/></xsl:call-template></xsl:when> <!--/because R: because --> <!-- Required amssymb --> +<!-- ? --> <xsl:when test="starts-with($content,'∶')"><xsl:value-of select="':'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∶')"/></xsl:call-template></xsl:when> <!--/ratio --> +<!-- ? --> <xsl:when test="starts-with($content,'∷')"><xsl:value-of select="'\colon\colon '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∷')"/></xsl:call-template></xsl:when> <!--/Colon, two colons --> +<!-- ? --> <xsl:when test="starts-with($content,'∸')"><xsl:value-of select="'\dot{-}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∸')"/></xsl:call-template></xsl:when> <!--/dotminus B: minus sign, dot above --> +<!-- <xsl:when test="starts-with($content,'∹')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∹')"/></xsl:call-template></xsl:when> --> +<!-- <xsl:when test="starts-with($content,'∺')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∺')"/></xsl:call-template></xsl:when> minus with four dots, geometric properties --> +<!-- <xsl:when test="starts-with($content,'∻')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∻')"/></xsl:call-template></xsl:when> homothetic --> + <xsl:when test="starts-with($content,'∼')"><xsl:value-of select="'\sim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∼')"/></xsl:call-template></xsl:when> <!--/sim R: similar --> + <xsl:when test="starts-with($content,'∽')"><xsl:value-of select="'\backsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∽')"/></xsl:call-template></xsl:when> <!--/backsim R: reverse similar --> <!-- Required amssymb --> +<!-- <xsl:when test="starts-with($content,'∾')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∾')"/></xsl:call-template></xsl:when> most positive --> +<!-- <xsl:when test="starts-with($content,'∿')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∿')"/></xsl:call-template></xsl:when> ac current --> + <xsl:when test="starts-with($content,'≀')"><xsl:value-of select="'\wr '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≀')"/></xsl:call-template></xsl:when> <!--/wr B: wreath product --> + <xsl:when test="starts-with($content,'≁')"><xsl:value-of select="'\nsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≁')"/></xsl:call-template></xsl:when> <!--/nsim N: not similar --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≂')"><xsl:value-of select="'\eqsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≂')"/></xsl:call-template></xsl:when> <!--/esim R: equals, similar --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≃')"><xsl:value-of select="'\simeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≃')"/></xsl:call-template></xsl:when> <!--/simeq R: similar, equals --> + <xsl:when test="starts-with($content,'≄')"><xsl:value-of select="'\not\simeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≄')"/></xsl:call-template></xsl:when> <!--/nsimeq N: not similar, equals --> + <xsl:when test="starts-with($content,'≅')"><xsl:value-of select="'\cong '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≅')"/></xsl:call-template></xsl:when> <!--/cong R: congruent with --> +<!-- <xsl:when test="starts-with($content,'≆')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≆')"/></xsl:call-template></xsl:when> similar, not equals --> + <xsl:when test="starts-with($content,'≇')"><xsl:value-of select="'\ncong '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≇')"/></xsl:call-template></xsl:when> <!--/ncong N: not congruent with --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≈')"><xsl:value-of select="'\approx '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≈')"/></xsl:call-template></xsl:when> <!--/approx R: approximate --> +<!-- <xsl:when test="starts-with($content,'≉̸')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≉̸')"/></xsl:call-template></xsl:when> not, vert, approximate --> + <xsl:when test="starts-with($content,'≉')"><xsl:value-of select="'\not\approx '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≉')"/></xsl:call-template></xsl:when> <!--/napprox N: not approximate --> + <xsl:when test="starts-with($content,'≊')"><xsl:value-of select="'\approxeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≊')"/></xsl:call-template></xsl:when> <!--/approxeq R: approximate, equals --> <!-- Required amssymb --> +<!-- <xsl:when test="starts-with($content,'≋')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≋')"/></xsl:call-template></xsl:when> approximately identical to --> +<!-- <xsl:when test="starts-with($content,'≌')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≌')"/></xsl:call-template></xsl:when> /backcong R: reverse congruent --> + <xsl:when test="starts-with($content,'≍')"><xsl:value-of select="'\asymp '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≍')"/></xsl:call-template></xsl:when> <!--/asymp R: asymptotically equal to --> + <xsl:when test="starts-with($content,'≎')"><xsl:value-of select="'\Bumpeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≎')"/></xsl:call-template></xsl:when> <!--/Bumpeq R: bumpy equals --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≏')"><xsl:value-of select="'\bumpeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≏')"/></xsl:call-template></xsl:when> <!--/bumpeq R: bumpy equals, equals --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≐')"><xsl:value-of select="'\doteq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≐')"/></xsl:call-template></xsl:when> <!--/doteq R: equals, single dot above --> + <xsl:when test="starts-with($content,'≑')"><xsl:value-of select="'\doteqdot '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≑')"/></xsl:call-template></xsl:when> <!--/doteqdot /Doteq R: eq, even dots --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≒')"><xsl:value-of select="'\fallingdotseq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≒')"/></xsl:call-template></xsl:when> <!--/fallingdotseq R: eq, falling dots --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≓')"><xsl:value-of select="'\risingdotseq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≓')"/></xsl:call-template></xsl:when> <!--/risingdotseq R: eq, rising dots --> <!-- Required amssymb --> +<!-- <xsl:when test="starts-with($content,'≔')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≔')"/></xsl:call-template></xsl:when> /coloneq R: colon, equals --> +<!-- <xsl:when test="starts-with($content,'≕')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≕')"/></xsl:call-template></xsl:when> /eqcolon R: equals, colon --> + <xsl:when test="starts-with($content,'≖')"><xsl:value-of select="'\eqcirc '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≖')"/></xsl:call-template></xsl:when> <!--/eqcirc R: circle on equals sign --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≗')"><xsl:value-of select="'\circeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≗')"/></xsl:call-template></xsl:when> <!--/circeq R: circle, equals --> <!-- Required amssymb --> +<!-- ? --> <xsl:when test="starts-with($content,'≘')"><xsl:value-of select="'\stackrel{\frown}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≘')"/></xsl:call-template></xsl:when> +<!-- ? --> <xsl:when test="starts-with($content,'≙')"><xsl:value-of select="'\stackrel{\wedge}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≙')"/></xsl:call-template></xsl:when> <!--/wedgeq R: corresponds to (wedge, equals) --> +<!-- ? --> <xsl:when test="starts-with($content,'≚')"><xsl:value-of select="'\stackrel{\vee}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≚')"/></xsl:call-template></xsl:when> <!--logical or, equals --> +<!-- ? --> <xsl:when test="starts-with($content,'≛')"><xsl:value-of select="'\stackrel{\star}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≛')"/></xsl:call-template></xsl:when> <!--equal, asterisk above --> + <xsl:when test="starts-with($content,'≜')"><xsl:value-of select="'\triangleq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≜')"/></xsl:call-template></xsl:when> <!--/triangleq R: triangle, equals --> <!-- Required amssymb --> +<!-- ? --> <xsl:when test="starts-with($content,'≝')"><xsl:value-of select="'\stackrel{\scriptscriptstyle\mathrm{def}}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≝')"/></xsl:call-template></xsl:when> +<!-- ? --> <xsl:when test="starts-with($content,'≞')"><xsl:value-of select="'\stackrel{\scriptscriptstyle\mathrm{m}}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≞')"/></xsl:call-template></xsl:when> +<!-- ? --> <xsl:when test="starts-with($content,'≟')"><xsl:value-of select="'\stackrel{?}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≟')"/></xsl:call-template></xsl:when> <!--/questeq R: equal with questionmark --> +<!-- <xsl:when test="starts-with($content,'≠︀')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≠︀')"/></xsl:call-template></xsl:when> not equal, dot --> + <xsl:when test="starts-with($content,'≠')"><xsl:value-of select="'\ne '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≠')"/></xsl:call-template></xsl:when> <!--/ne /neq R: not equal --> +<!-- <xsl:when test="starts-with($content,'≡⃥')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≡⃥')"/></xsl:call-template></xsl:when> reverse not equivalent --> + <xsl:when test="starts-with($content,'≡')"><xsl:value-of select="'\equiv '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≡')"/></xsl:call-template></xsl:when> <!--/equiv R: identical with --> + <xsl:when test="starts-with($content,'≢')"><xsl:value-of select="'\not\equiv '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≢')"/></xsl:call-template></xsl:when> <!--/nequiv N: not identical with --> +<!-- <xsl:when test="starts-with($content,'≣')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≣')"/></xsl:call-template></xsl:when> --> + <xsl:when test="starts-with($content,'≤')"><xsl:value-of select="'\le '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≤')"/></xsl:call-template></xsl:when> <!--/leq /le R: less-than-or-equal --> + <xsl:when test="starts-with($content,'≥')"><xsl:value-of select="'\ge '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≥')"/></xsl:call-template></xsl:when> <!--/geq /ge R: greater-than-or-equal --> + <xsl:when test="starts-with($content,'≦')"><xsl:value-of select="'\leqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≦')"/></xsl:call-template></xsl:when> <!--/leqq R: less, double equals --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≧')"><xsl:value-of select="'\geqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≧')"/></xsl:call-template></xsl:when> <!--/geqq R: greater, double equals --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≨')"><xsl:value-of select="'\lneqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≨')"/></xsl:call-template></xsl:when> <!--/lneqq N: less, not double equals --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≩')"><xsl:value-of select="'\gneqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≩')"/></xsl:call-template></xsl:when> <!--/gneqq N: greater, not dbl equals --> <!-- Required amssymb --> +<!-- <xsl:when test="starts-with($content,'≪̸︀')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≪̸︀')"/></xsl:call-template></xsl:when> not much less than, variant --> +<!-- <xsl:when test="starts-with($content,'≪̸')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≪̸')"/></xsl:call-template></xsl:when> not, vert, much less than --> + <xsl:when test="starts-with($content,'≪')"><xsl:value-of select="'\ll '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≪')"/></xsl:call-template></xsl:when> <!--/ll R: double less-than sign --> +<!-- <xsl:when test="starts-with($content,'≫̸︀')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≫̸︀')"/></xsl:call-template></xsl:when> not much greater than, variant --> +<!-- <xsl:when test="starts-with($content,'≫̸')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≫̸')"/></xsl:call-template></xsl:when> not, vert, much greater than --> + <xsl:when test="starts-with($content,'≫')"><xsl:value-of select="'\gg '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≫')"/></xsl:call-template></xsl:when> <!--/gg R: dbl greater-than sign --> + <xsl:when test="starts-with($content,'≬')"><xsl:value-of select="'\between '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≬')"/></xsl:call-template></xsl:when> <!--/between R: between --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≭')"><xsl:value-of select="'\not\asymp '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≭')"/></xsl:call-template></xsl:when> + <xsl:when test="starts-with($content,'≮')"><xsl:value-of select="'\nless '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≮')"/></xsl:call-template></xsl:when> <!--/nless N: not less-than --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≯')"><xsl:value-of select="'\ngtr '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≯')"/></xsl:call-template></xsl:when> <!--/ngtr N: not greater-than --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≰⃥')"><xsl:value-of select="'\nleq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≰⃥')"/></xsl:call-template></xsl:when> <!--/nleq N: not less-than-or-equal --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≰')"><xsl:value-of select="'\nleqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≰')"/></xsl:call-template></xsl:when> <!--/nleqq N: not less, dbl equals --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≱⃥')"><xsl:value-of select="'\ngeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≱⃥')"/></xsl:call-template></xsl:when> <!--/ngeq N: not greater-than-or-equal --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≱')"><xsl:value-of select="'\ngeqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≱')"/></xsl:call-template></xsl:when> <!--/ngeqq N: not greater, dbl equals --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≲')"><xsl:value-of select="'\lesssim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≲')"/></xsl:call-template></xsl:when> <!--/lesssim R: less, similar --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≳')"><xsl:value-of select="'\gtrsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≳')"/></xsl:call-template></xsl:when> <!--/gtrsim R: greater, similar --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≴')"><xsl:value-of select="'\not\lesssim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≴')"/></xsl:call-template></xsl:when> <!--not less, similar --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≵')"><xsl:value-of select="'\not\gtrsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≵')"/></xsl:call-template></xsl:when> <!--not greater, similar --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≶')"><xsl:value-of select="'\lessgtr '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≶')"/></xsl:call-template></xsl:when> <!--/lessgtr R: less, greater --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≷')"><xsl:value-of select="'\gtrless '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≷')"/></xsl:call-template></xsl:when> <!--/gtrless R: greater, less --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≸')"><xsl:value-of select="'\not\lessgtr '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≸')"/></xsl:call-template></xsl:when> <!--not less, greater --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≹')"><xsl:value-of select="'\not\gtrless '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≹')"/></xsl:call-template></xsl:when> <!--not greater, less --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≺')"><xsl:value-of select="'\prec '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≺')"/></xsl:call-template></xsl:when> <!--/prec R: precedes --> + <xsl:when test="starts-with($content,'≻')"><xsl:value-of select="'\succ '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≻')"/></xsl:call-template></xsl:when> <!--/succ R: succeeds --> + <xsl:when test="starts-with($content,'≼')"><xsl:value-of select="'\preccurlyeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≼')"/></xsl:call-template></xsl:when> <!--/preccurlyeq R: precedes, curly eq --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≽')"><xsl:value-of select="'\succcurlyeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≽')"/></xsl:call-template></xsl:when> <!--/succcurlyeq R: succeeds, curly eq --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≾')"><xsl:value-of select="'\precsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≾')"/></xsl:call-template></xsl:when> <!--/precsim R: precedes, similar --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'≿')"><xsl:value-of select="'\succsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≿')"/></xsl:call-template></xsl:when> <!--/succsim R: succeeds, similar --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⊀')"><xsl:value-of select="'\nprec '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊀')"/></xsl:call-template></xsl:when> <!--/nprec N: not precedes --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⊁')"><xsl:value-of select="'\nsucc '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊁')"/></xsl:call-template></xsl:when> <!--/nsucc N: not succeeds --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⊂')"><xsl:value-of select="'\subset '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊂')"/></xsl:call-template></xsl:when> <!--/subset R: subset or is implied by --> + <xsl:when test="starts-with($content,'⊃')"><xsl:value-of select="'\supset '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊃')"/></xsl:call-template></xsl:when> <!--/supset R: superset or implies --> + <xsl:when test="starts-with($content,'⊄')"><xsl:value-of select="'\not\subset '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊄')"/></xsl:call-template></xsl:when> <!--not subset --> + <xsl:when test="starts-with($content,'⊅')"><xsl:value-of select="'\not\supset '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊅')"/></xsl:call-template></xsl:when> <!--not superset --> + <xsl:when test="starts-with($content,'⊆')"><xsl:value-of select="'\subseteq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊆')"/></xsl:call-template></xsl:when> <!--/subseteq R: subset, equals --> + <xsl:when test="starts-with($content,'⊇')"><xsl:value-of select="'\supseteq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊇')"/></xsl:call-template></xsl:when> <!--/supseteq R: superset, equals --> + <xsl:when test="starts-with($content,'⊎')"><xsl:value-of select="'\uplus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊎')"/></xsl:call-template></xsl:when> <!--/uplus B: plus sign in union --> + <xsl:when test="starts-with($content,'⊓')"><xsl:value-of select="'\sqcap '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊓')"/></xsl:call-template></xsl:when> <!--/sqcap B: square intersection --> + <xsl:when test="starts-with($content,'⊔')"><xsl:value-of select="'\bigsqcup '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊔')"/></xsl:call-template></xsl:when> <!--/sqcup B: square union --> + <xsl:when test="starts-with($content,'⊕')"><xsl:value-of select="'\oplus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊕')"/></xsl:call-template></xsl:when> <!--/oplus B: plus sign in circle --> + <xsl:when test="starts-with($content,'⊖')"><xsl:value-of select="'\ominus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊖')"/></xsl:call-template></xsl:when> <!--/ominus B: minus sign in circle --> + <xsl:when test="starts-with($content,'⊗')"><xsl:value-of select="'\otimes '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊗')"/></xsl:call-template></xsl:when> <!--/otimes B: multiply sign in circle --> + <xsl:when test="starts-with($content,'⊘')"><xsl:value-of select="'\oslash '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊘')"/></xsl:call-template></xsl:when> <!--/oslash B: solidus in circle --> +<!-- ? --> <xsl:when test="starts-with($content,'⊙')"><xsl:value-of select="'\odot '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊙')"/></xsl:call-template></xsl:when> <!--/odot B: middle dot in circle --> <!--/bigodot L: circle dot operator --> + <xsl:when test="starts-with($content,'⊟')"><xsl:value-of select="'\boxminus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊟')"/></xsl:call-template></xsl:when> <!--/boxminus B: minus sign in box --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⊤')"><xsl:value-of select="'\top '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊤')"/></xsl:call-template></xsl:when> <!--/top top --> + <xsl:when test="starts-with($content,'⊥')"><xsl:value-of select="'\perp '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊥')"/></xsl:call-template></xsl:when> <!--/perp R: perpendicular --><!--/bot bottom --> + <xsl:when test="starts-with($content,'⊦')"><xsl:value-of select="'\vdash '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊦')"/></xsl:call-template></xsl:when> <!--/vdash R: vertical, dash --> + <xsl:when test="starts-with($content,'⊧')"><xsl:value-of select="'\vDash '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊧')"/></xsl:call-template></xsl:when> <!--/vDash R: vertical, dbl dash --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⊨')"><xsl:value-of select="'\models '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊨')"/></xsl:call-template></xsl:when> <!--/models R: --> + <xsl:when test="starts-with($content,'⊪')"><xsl:value-of select="'\Vvdash '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊪')"/></xsl:call-template></xsl:when> <!--/Vvdash R: triple vertical, dash --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⋀')"><xsl:value-of select="'\bigwedge '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋀')"/></xsl:call-template></xsl:when> <!--/bigwedge L: logical or operator --> + <xsl:when test="starts-with($content,'⋁')"><xsl:value-of select="'\bigvee '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋁')"/></xsl:call-template></xsl:when> <!--/bigcap L: intersection operator --> + <xsl:when test="starts-with($content,'⋂')"><xsl:value-of select="'\bigcap '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋂')"/></xsl:call-template></xsl:when> <!--/bigvee L: logical and operator --> + <xsl:when test="starts-with($content,'⋃')"><xsl:value-of select="'\bigcup '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋃')"/></xsl:call-template></xsl:when> <!--/bigcup L: union operator --> + <xsl:when test="starts-with($content,'⋄')"><xsl:value-of select="'\diamond '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋄')"/></xsl:call-template></xsl:when> <!--/diamond B: open diamond --> + <xsl:when test="starts-with($content,'⋅')"><xsl:value-of select="'\cdot '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋅')"/></xsl:call-template></xsl:when> <!--/cdot B: small middle dot --> + <xsl:when test="starts-with($content,'⋆')"><xsl:value-of select="'\star '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋆')"/></xsl:call-template></xsl:when> <!--/star B: small star, filled --> + <xsl:when test="starts-with($content,'⋇')"><xsl:value-of select="'\divideontimes '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋇')"/></xsl:call-template></xsl:when> <!--/divideontimes B: division on times --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⋈')"><xsl:value-of select="'\bowtie '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋈')"/></xsl:call-template></xsl:when> <!--/bowtie R: --> + <xsl:when test="starts-with($content,'⋍')"><xsl:value-of select="'\backsimeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋍')"/></xsl:call-template></xsl:when> <!--/backsimeq R: reverse similar, eq --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'⋯')"><xsl:value-of select="'\cdots '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋯')"/></xsl:call-template></xsl:when> <!--/cdots, three dots, centered --> +<!-- <xsl:when test="starts-with($content,'⋰')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋰')"/></xsl:call-template></xsl:when> three dots, ascending --> + <xsl:when test="starts-with($content,'⋱')"><xsl:value-of select="'\ddots '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋱')"/></xsl:call-template></xsl:when> <!--/ddots, three dots, descending --> + +<!-- ====================================================================== --> +<!-- Unicode 3.2 + Miscellaneous Technical + Range: 2300-23FF + http://www.unicode.org/charts/PDF/U2300.pdf --> +<!-- ====================================================================== --> + <xsl:when test="starts-with($content,'⌈')"><xsl:value-of select="'\lceil '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⌈')"/></xsl:call-template></xsl:when> <!--/lceil O: left ceiling --> + <xsl:when test="starts-with($content,'⌉')"><xsl:value-of select="'\rceil '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⌉')"/></xsl:call-template></xsl:when> <!--/rceil C: right ceiling --> + <xsl:when test="starts-with($content,'⌊')"><xsl:value-of select="'\lfloor '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⌊')"/></xsl:call-template></xsl:when> <!--/lfloor O: left floor --> + <xsl:when test="starts-with($content,'⌋')"><xsl:value-of select="'\rfloor '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⌋')"/></xsl:call-template></xsl:when> <!--/rfloor C: right floor --> + <xsl:when test="starts-with($content,'〈')"><xsl:value-of select="'\langle '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '〈')"/></xsl:call-template></xsl:when> <!--/langle O: left angle bracket --> + <xsl:when test="starts-with($content,'〉')"><xsl:value-of select="'\rangle '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '〉')"/></xsl:call-template></xsl:when> <!--/rangle O: right angle bracket --> +<!-- ====================================================================== --> + <xsl:when test="starts-with($content,'□')"><xsl:value-of select="'\square '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '□')"/></xsl:call-template></xsl:when> <!--/square, square --> <!-- Required amssymb --> + <xsl:when test="starts-with($content,'▪')"><xsl:value-of select="'\blacksquare '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '▪')"/></xsl:call-template></xsl:when> <!--/blacksquare, square, filled --> <!-- Required amssymb --> + + <xsl:when test='starts-with($content,"'")'><xsl:value-of select='"\text{'}"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select='substring-after($content, "'")'/></xsl:call-template></xsl:when><!-- \text required amslatex --> + + <xsl:when test='starts-with($content,"{")'><xsl:value-of select='"\{"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '{')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"}")'><xsl:value-of select='"\}"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '}')"/></xsl:call-template></xsl:when> + +<!--- special characters --> + <xsl:when test='starts-with($content,"$")'><xsl:value-of select='"\$"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '$')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"#")'><xsl:value-of select='"\#"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '#')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"&")'><xsl:value-of select='"\&"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"%")'><xsl:value-of select='"\%"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '%')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"_")'><xsl:value-of select='"\_"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '_')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"\")'><xsl:value-of select='"\backslash "' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '\')"/></xsl:call-template></xsl:when> + + <xsl:otherwise> + <xsl:value-of select="substring($content,1,1)"/> + <xsl:call-template name="replaceEntities"> + <xsl:with-param name="content" select="substring($content, 2)"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose></xsl:if> +</xsl:template> + +<xsl:template name="replaceMtextEntities"> + <xsl:param name="content"/> + <xsl:if test="string-length($content)>0"> + <xsl:choose> + <xsl:when test="starts-with($content,'   ')"><xsl:value-of select='"\hspace{0.28em}"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, '   ')"/></xsl:call-template></xsl:when> <!-- ThickSpace - space of width 5/18 em --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{0.5em}"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> <!-- en space (1/2-em) --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{1em}"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> <!-- emsp - space of width 1em --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{0.33em}"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> <!-- emsp13 - space of width 1/3 em --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{0.25em}"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> <!-- ThickSpace - space of width 1/4 em --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{0.17em}"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> <!-- ThinSpace - space of width 3/18 em --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{0.05em}"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> + <xsl:when test="starts-with($content,'​')"><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, '​')"/></xsl:call-template></xsl:when> <!--zero width space --> + <xsl:when test="starts-with($content,' ')"><xsl:value-of select='"\hspace{0.22em}"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, ' ')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"$")'><xsl:value-of select='"\$"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, '$')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"#")'><xsl:value-of select='"\#"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, '#')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"&")'><xsl:value-of select='"\&"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, '&')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"%")'><xsl:value-of select='"\%"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, '%')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"_")'><xsl:value-of select='"\_"' /><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, '_')"/></xsl:call-template></xsl:when> + <xsl:when test='starts-with($content,"\")'><xsl:call-template name="replaceMtextEntities"><xsl:with-param name="content" select="substring-after($content, '\')"/></xsl:call-template></xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring($content,1,1)"/> + <xsl:call-template name="replaceMtextEntities"> + <xsl:with-param name="content" select="substring($content, 2)"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:if> +</xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/glayout.xsl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/glayout.xsl new file mode 100755 index 00000000..6ba600bc --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/glayout.xsl @@ -0,0 +1,223 @@ +<?xml version='1.0' encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:m="http://www.w3.org/1998/Math/MathML" + version='1.0'> + +<!-- ====================================================================== --> +<!-- $Id: glayout.xsl 149 2006-09-12 21:23:53Z fletcher $ + This file is part of the XSLT MathML Library distribution. + See ./README or http://www.raleigh.ru/MathML/mmltex for + copyright and other information + Modified by Fletcher T. Penney for MultiMarkdown Version 2.0.a --> +<!-- ====================================================================== --> + +<!-- 3.3.2 mfrac --> +<xsl:template match="m:mfrac"> + <xsl:choose> + <xsl:when test="@linethickness"> + <xsl:text>\genfrac{}{}{</xsl:text> + <xsl:choose> + <xsl:when test="number(@linethickness)"> + <xsl:value-of select="@linethickness div 10"/> + <xsl:text>ex</xsl:text> + </xsl:when> + <xsl:when test="@linethickness='0'"> + <xsl:text>0ex</xsl:text> + </xsl:when> + <xsl:when test="@linethickness='thin'"> + <xsl:text>.05ex</xsl:text> + </xsl:when> + <xsl:when test="@linethickness='medium'"/> + <xsl:when test="@linethickness='thick'"> + <xsl:text>.2ex</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@linethickness"/> + </xsl:otherwise> + </xsl:choose> + <xsl:text>}{}{</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\frac{</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="@numalign='right'"> + <xsl:text>\hfill </xsl:text> + </xsl:if> + <xsl:apply-templates select="./*[1]"/> + <xsl:if test="@numalign='left'"> + <xsl:text>\hfill </xsl:text> + </xsl:if> + <xsl:text>}{</xsl:text> + <xsl:if test="@denomalign='right'"> + <xsl:text>\hfill </xsl:text> + </xsl:if> + <xsl:apply-templates select="./*[2]"/> + <xsl:if test="@denomalign='left'"> + <xsl:text>\hfill </xsl:text> + </xsl:if> + <xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="m:mfrac[@bevelled='true']"> + <xsl:text>\raisebox{1ex}{$</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>$}\!\left/ \!\raisebox{-1ex}{$</xsl:text> + <xsl:apply-templates select="./*[2]"/> + <xsl:text>$}\right.</xsl:text> +</xsl:template> + + +<xsl:template match="m:mroot"> + <xsl:choose> + <xsl:when test="count(./*)=2"> + <xsl:text>\sqrt[</xsl:text> + <xsl:apply-templates select="./*[2]"/> + <xsl:text>]{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:otherwise> + <!-- number of argumnets is not 2 - code 25 --> + <xsl:message>exception 25:</xsl:message> + <xsl:text>\text{exception 25:}</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="m:msqrt"> + <xsl:text>\sqrt{</xsl:text> + <xsl:apply-templates/> + <xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="m:mfenced"> + <xsl:choose> + <xsl:when test="@open"> + <xsl:if test="translate(@open,'{}[]()|','{{{{{{{')='{'"> + <xsl:text>\left</xsl:text> + </xsl:if> + <xsl:if test="@open='{' or @open='}'"> + <xsl:text>\</xsl:text> + </xsl:if> + <xsl:if test="translate(@open,'{}[]()|','{{{{{{{')!='{' and (translate(@close,'{}[]()|','{{{{{{{')='{' or not(@close))"> + <xsl:text>\left.</xsl:text> + </xsl:if> + <xsl:value-of select="@open"/> + </xsl:when> + <xsl:otherwise><xsl:text>\left(</xsl:text></xsl:otherwise> + </xsl:choose> + <xsl:variable name="sep"> + <xsl:choose> + <xsl:when test="@separators"> + <xsl:value-of select="translate(@separators,' ','')"/> + </xsl:when> + <xsl:otherwise>,</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:for-each select="./*"> + <xsl:apply-templates select="."/> + <xsl:if test="not(position()=last())"> + <xsl:choose> + <xsl:when test="position()>string-length($sep)"> + <xsl:value-of select="substring($sep,string-length($sep))"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring($sep,position(),1)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + </xsl:for-each> + <xsl:choose> + <xsl:when test="@close"> + <xsl:if test="translate(@close,'{}[]()|','{{{{{{{')='{'"> + <xsl:text>\right</xsl:text> + </xsl:if> + <xsl:if test="@close='{' or @close='}'"> + <xsl:text>\</xsl:text> + </xsl:if> + <xsl:if test="translate(@close,'{}[]()|','{{{{{{{')!='{' and (translate(@open,'{}[]()|','{{{{{{{')='{' or not(@open))"> + <xsl:text>\right.</xsl:text> + </xsl:if> + <xsl:value-of select="@close"/> + </xsl:when> + <xsl:otherwise><xsl:text>\right)</xsl:text></xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="m:mphantom"> + <xsl:text>\phantom{</xsl:text> + <xsl:apply-templates/> + <xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="m:menclose"> + <xsl:choose> + <xsl:when test="@notation = 'actuarial'"> + <xsl:text>\overline{</xsl:text> + <xsl:apply-templates/> + <xsl:text>\hspace{.2em}|}</xsl:text> + </xsl:when> + <xsl:when test="@notation = 'radical'"> + <xsl:text>\sqrt{</xsl:text> + <xsl:apply-templates/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\overline{)</xsl:text> + <xsl:apply-templates/> + <xsl:text>}</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="m:mrow"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="m:mstyle"> + <xsl:if test="@displaystyle='true'"> + <xsl:text>{\displaystyle </xsl:text> + </xsl:if> + <xsl:if test="@scriptlevel and not(@displaystyle='true')"> + <xsl:text>{</xsl:text> + <xsl:choose> + <xsl:when test="@scriptlevel=0"><xsl:text>\textstyle </xsl:text></xsl:when> + <xsl:when test="@scriptlevel=1"><xsl:text>\scriptstyle </xsl:text></xsl:when> + <xsl:otherwise><xsl:text>\scriptscriptstyle </xsl:text></xsl:otherwise> + </xsl:choose> + </xsl:if> + <xsl:if test="@background"> + <xsl:text>\colorbox[rgb]{</xsl:text> + <xsl:call-template name="color"> + <xsl:with-param name="color" select="@background"/> + </xsl:call-template> + <xsl:text>}{$</xsl:text> + </xsl:if> + <xsl:if test="@color[not(@mathcolor)] or @mathcolor"> + <xsl:text>\textcolor[rgb]{</xsl:text> + <xsl:call-template name="color"> + <xsl:with-param name="color" select="@color|@mathcolor"/> + </xsl:call-template> + <xsl:text>}{</xsl:text> + </xsl:if> + <xsl:apply-templates/> + <xsl:if test="@color[not(@mathcolor)] or @mathcolor"> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:if test="@background"> + <xsl:text>$}</xsl:text> + </xsl:if> + <xsl:if test="@scriptlevel and not(@displaystyle='true')"> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:if test="@displaystyle='true'"> + <xsl:text>}</xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="m:merror"> + <xsl:apply-templates/> +</xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/mmltex.xsl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/mmltex.xsl new file mode 100755 index 00000000..79aaa780 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/mmltex.xsl @@ -0,0 +1,64 @@ +<?xml version='1.0' encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:m="http://www.w3.org/1998/Math/MathML" + xmlns:html="http://www.w3.org/1999/xhtml" + version='1.0'> + +<xsl:output method="text" indent="no" encoding="UTF-8"/> + +<!-- ====================================================================== --> +<!-- $Id: mmltex.xsl 441 2007-09-16 23:21:16Z fletcher $ + This file is part of the XSLT MathML Library distribution. + See ./README or http://www.raleigh.ru/MathML/mmltex for + copyright and other information + Modified by Fletcher T. Penney for MultiMarkdown Version 2.0.a --> +<!-- ====================================================================== --> + +<!-- modified by Fletcher T. Penney to handle equation labels --> + +<xsl:include href="tokens.xsl"/> +<xsl:include href="glayout.xsl"/> +<xsl:include href="scripts.xsl"/> +<xsl:include href="tables.xsl"/> +<xsl:include href="entities.xsl"/> +<xsl:include href="cmarkup.xsl"/> + +<xsl:strip-space elements="m:*"/> + +<xsl:template match="m:math[not(@mode) or @mode='inline'][not(@display)] | m:math[@display='inline']"> + <xsl:text>$ </xsl:text> + <xsl:apply-templates/> + <xsl:text>$</xsl:text> +</xsl:template> + +<xsl:template match="m:math[@display='block'] | m:math[@mode='display'][not(@display)]"> + <xsl:text> \[ </xsl:text> + <xsl:apply-templates/> + <xsl:text> \]</xsl:text> +</xsl:template> + +<xsl:template match="m:math[last()=1]"> + <xsl:choose> + <xsl:when test="not(parent::html:p/text() or parent::html:li or parent::html:th or parent::html:td)"> + <xsl:value-of select="parent::html:p/text()"/> + <xsl:text>\begin{equation} +</xsl:text> + <xsl:if test="@id"> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>} +</xsl:text> + </xsl:if> + <xsl:apply-templates/> + <xsl:text> +\end{equation}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>$</xsl:text> + <xsl:apply-templates/> + <xsl:text>$</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/scripts.xsl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/scripts.xsl new file mode 100755 index 00000000..1395ef0f --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/scripts.xsl @@ -0,0 +1,376 @@ +<?xml version='1.0' encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:m="http://www.w3.org/1998/Math/MathML" + version='1.0'> + +<!-- ====================================================================== --> +<!-- $Id: scripts.xsl 149 2006-09-12 21:23:53Z fletcher $ + This file is part of the XSLT MathML Library distribution. + See ./README or http://www.raleigh.ru/MathML/mmltex for + copyright and other information + Modified by Fletcher T. Penney for MultiMarkdown Version 2.0.a --> +<!-- ====================================================================== --> + +<xsl:template match="m:munderover"> + <xsl:variable name="base" select="translate(./*[1],' ','')"/> + <xsl:variable name="under" select="translate(./*[2],' ','')"/> + <xsl:variable name="over" select="translate(./*[3],' ','')"/> + <xsl:choose> + <xsl:when test="$over='¯'"> <!-- OverBar - over bar --> + <xsl:text>\overline{</xsl:text> + <xsl:call-template name="munder"> + <xsl:with-param name="base" select="$base"/> + <xsl:with-param name="under" select="$under"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='︷'"> <!-- OverBrace - over brace --> + <xsl:text>\overbrace{</xsl:text> + <xsl:call-template name="munder"> + <xsl:with-param name="base" select="$base"/> + <xsl:with-param name="under" select="$under"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='←'"> <!--/leftarrow /gets A: =leftward arrow --> + <xsl:text>\overleftarrow{</xsl:text> + <xsl:call-template name="munder"> + <xsl:with-param name="base" select="$base"/> + <xsl:with-param name="under" select="$under"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='→'"> <!--/rightarrow /to A: =rightward arrow --> + <xsl:text>\overrightarrow{</xsl:text> + <xsl:call-template name="munder"> + <xsl:with-param name="base" select="$base"/> + <xsl:with-param name="under" select="$under"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='↔'"> <!--/leftrightarrow A: l&r arrow --> + <xsl:text>\overleftrightarrow{</xsl:text> + <xsl:call-template name="munder"> + <xsl:with-param name="base" select="$base"/> + <xsl:with-param name="under" select="$under"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$under='̲'"> <!-- UnderBar - combining low line --> + <xsl:text>\underline{</xsl:text> + <xsl:call-template name="mover"> + <xsl:with-param name="base" select="$base"/> + <xsl:with-param name="over" select="$over"/> + <xsl:with-param name="pos_over" select="3"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$under='︸'"> <!-- UnderBrace - under brace --> + <xsl:text>\underbrace{</xsl:text> + <xsl:call-template name="mover"> + <xsl:with-param name="base" select="$base"/> + <xsl:with-param name="over" select="$over"/> + <xsl:with-param name="pos_over" select="3"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$under='←'"> <!--/leftarrow /gets A: =leftward arrow --> + <xsl:text>\underleftarrow{</xsl:text> + <xsl:call-template name="mover"> + <xsl:with-param name="base" select="$base"/> + <xsl:with-param name="over" select="$over"/> + <xsl:with-param name="pos_over" select="3"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$under='→'"> <!--/rightarrow /to A: =rightward arrow --> + <xsl:text>\underrightarrow{</xsl:text> + <xsl:call-template name="mover"> + <xsl:with-param name="base" select="$base"/> + <xsl:with-param name="over" select="$over"/> + <xsl:with-param name="pos_over" select="3"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$under='↔'"> <!--/leftrightarrow A: l&r arrow --> + <xsl:text>\underleftrightarrow{</xsl:text> + <xsl:call-template name="mover"> + <xsl:with-param name="base" select="$base"/> + <xsl:with-param name="over" select="$over"/> + <xsl:with-param name="pos_over" select="3"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="translate($base,'∏∐⋂⋃⊔', + '∑∑∑∑∑')='∑'"> +<!-- if $base is operator, such as + ∑ /sum L: summation operator + ∏ /prod L: product operator + ∐ /coprod L: coproduct operator + ⋂ /bigcap + ⋃ /bigcup + ⊔ /bigsqcup +--> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>_{</xsl:text> + <xsl:apply-templates select="./*[2]"/> + <xsl:text>}^{</xsl:text> + <xsl:apply-templates select="./*[3]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\underset{</xsl:text> + <xsl:apply-templates select="./*[2]"/> + <xsl:text>}{\overset{</xsl:text> + <xsl:apply-templates select="./*[3]"/> + <xsl:text>}{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}}</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="m:mover"> + <xsl:call-template name="mover"> + <xsl:with-param name="base" select="translate(./*[1],' ','')"/> + <xsl:with-param name="over" select="translate(./*[2],' ','')"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="m:munder"> + <xsl:call-template name="munder"> + <xsl:with-param name="base" select="translate(./*[1],' ','')"/> + <xsl:with-param name="under" select="translate(./*[2],' ','')"/> + </xsl:call-template> +</xsl:template> + +<xsl:template name="mover"> + <xsl:param name="base"/> + <xsl:param name="over"/> + <xsl:param name="pos_over" select="2"/> + <xsl:choose> + <xsl:when test="$over='¯'"> <!-- OverBar - over bar --> + <xsl:text>\overline{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='︷'"> <!-- OverBrace - over brace --> + <xsl:text>\overbrace{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='←'"> <!--/leftarrow /gets A: =leftward arrow --> + <xsl:text>\overleftarrow{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='→'"> <!--/rightarrow /to A: =rightward arrow --> + <xsl:text>\overrightarrow{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='↔'"> <!--/leftrightarrow A: l&r arrow --> + <xsl:text>\overleftrightarrow{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='˜'"> <!-- small tilde --> + <xsl:text>\tilde{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='✓'"> <!-- /checkmark =tick, check mark --> + <xsl:text>\check{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='˙'"> <!-- dot above --> + <xsl:text>\dot{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='¨'"> <!-- DoubleDot - dieresis or umlaut mark --> + <xsl:text>\ddot{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$over='̂' or $over='^'"> <!-- Hat or circ - circumflex accent --> + <xsl:choose> + <xsl:when test="@accent='true'"> + <xsl:text>\widehat{</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\hat{</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:apply-templates select="./*[1]"/><xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="translate($base,'∏∐⋂⋃⊔', + '∑∑∑∑∑')='∑'"> +<!-- if $base is operator, such as + ∑ /sum L: summation operator + ∏ /prod L: product operator + ∐ /coprod L: coproduct operator + ⋂ /bigcap + ⋃ /bigcup + ⊔ /bigsqcup +--> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>^{</xsl:text> + <xsl:apply-templates select="./*[$pos_over]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\stackrel{</xsl:text> + <xsl:apply-templates select="./*[$pos_over]"/> + <xsl:text>}{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + <!-- + <xsl:text>\overset{</xsl:text> + <xsl:apply-templates select="./*[$pos_over]"/> + <xsl:text>}{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text>--> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="munder"> + <xsl:param name="base"/> + <xsl:param name="under"/> + <xsl:choose> + <xsl:when test="$under='̲'"> <!-- UnderBar - combining low line --> + <xsl:text>\underline{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$under='︸'"> <!-- UnderBrace - under brace --> + <xsl:text>\underbrace{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$under='←'"> <!--/leftarrow /gets A: =leftward arrow --> + <xsl:text>\underleftarrow{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$under='→'"> <!--/rightarrow /to A: =rightward arrow --> + <xsl:text>\underrightarrow{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="$under='↔'"> <!--/leftrightarrow A: l&r arrow --> + <xsl:text>\underleftrightarrow{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="translate($base,'∏∐⋂⋃⊔', + '∑∑∑∑∑')='∑'"> +<!-- if $base is operator, such as + ∑ /sum L: summation operator + ∏ /prod L: product operator + ∐ /coprod L: coproduct operator + ⋂ /bigcap + ⋃ /bigcup + ⊔ /bigsqcup +--> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>_{</xsl:text> + <xsl:apply-templates select="./*[2]"/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\underset{</xsl:text> <!-- Required AmsMath package --> + <xsl:apply-templates select="./*[2]"/> + <xsl:text>}{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="m:msubsup"> + <xsl:text>{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}_{</xsl:text> + <xsl:apply-templates select="./*[2]"/> + <xsl:text>}^{</xsl:text> + <xsl:apply-templates select="./*[3]"/> + <xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="m:msup"> + <xsl:text>{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}^{</xsl:text> + <xsl:apply-templates select="./*[2]"/> + <xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="m:msub"> + <xsl:text>{</xsl:text> + <xsl:apply-templates select="./*[1]"/> + <xsl:text>}_{</xsl:text> + <xsl:apply-templates select="./*[2]"/> + <xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="m:mmultiscripts" mode="mprescripts"> + <xsl:for-each select="m:mprescripts/following-sibling::*"> + <xsl:if test="position() mod 2 and local-name(.)!='none'"> + <xsl:text>{}_{</xsl:text> + <xsl:apply-templates select="."/> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:if test="not(position() mod 2) and local-name(.)!='none'"> + <xsl:text>{}^{</xsl:text> + <xsl:apply-templates select="."/> + <xsl:text>}</xsl:text> + </xsl:if> + </xsl:for-each> + <xsl:apply-templates select="./*[1]"/> + <xsl:for-each select="m:mprescripts/preceding-sibling::*[position()!=last()]"> + <xsl:if test="position()>2 and local-name(.)!='none'"> + <xsl:text>{}</xsl:text> + </xsl:if> + <xsl:if test="position() mod 2 and local-name(.)!='none'"> + <xsl:text>_{</xsl:text> + <xsl:apply-templates select="."/> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:if test="not(position() mod 2) and local-name(.)!='none'"> + <xsl:text>^{</xsl:text> + <xsl:apply-templates select="."/> + <xsl:text>}</xsl:text> + </xsl:if> + </xsl:for-each> +</xsl:template> + +<xsl:template match="m:mmultiscripts"> + <xsl:choose> + <xsl:when test="m:mprescripts"> + <xsl:apply-templates select="." mode="mprescripts"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="./*[1]"/> + <xsl:for-each select="*[position()>1]"> + <xsl:if test="position()>2 and local-name(.)!='none'"> + <xsl:text>{}</xsl:text> + </xsl:if> + <xsl:if test="position() mod 2 and local-name(.)!='none'"> + <xsl:text>_{</xsl:text> + <xsl:apply-templates select="."/> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:if test="not(position() mod 2) and local-name(.)!='none'"> + <xsl:text>^{</xsl:text> + <xsl:apply-templates select="."/> + <xsl:text>}</xsl:text> + </xsl:if> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/tables.xsl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/tables.xsl new file mode 100755 index 00000000..b41f6d3e --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/tables.xsl @@ -0,0 +1,131 @@ +<?xml version='1.0' encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:m="http://www.w3.org/1998/Math/MathML" + version='1.0'> + +<!-- ====================================================================== --> +<!-- $Id: tables.xsl 149 2006-09-12 21:23:53Z fletcher $ + This file is part of the XSLT MathML Library distribution. + See ./README or http://www.raleigh.ru/MathML/mmltex for + copyright and other information + Modified by Fletcher T. Penney for MultiMarkdown Version 2.0.a --> +<!-- ====================================================================== --> + +<xsl:template match="m:mtd[@columnspan]"> + <xsl:text>\multicolumn{</xsl:text> + <xsl:value-of select="@columnspan"/> + <xsl:text>}{c}{</xsl:text> + <xsl:apply-templates/> + <xsl:text>}</xsl:text> + <xsl:if test="count(following-sibling::*)>0"> + <xsl:text>& </xsl:text> + </xsl:if> +</xsl:template> + + +<xsl:template match="m:mtd"> + <xsl:if test="@columnalign='right' or @columnalign='center'"> + <xsl:text>\hfill </xsl:text> + </xsl:if> + <xsl:apply-templates/> + <xsl:if test="@columnalign='left' or @columnalign='center'"> + <xsl:text>\hfill </xsl:text> + </xsl:if> + <xsl:if test="count(following-sibling::*)>0"> +<!-- this test valid for Sablotron, another form - test="not(position()=last())". + Also for m:mtd[@columnspan] and m:mtr --> + <xsl:text>& </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="m:mtr"> + <xsl:apply-templates/> + <xsl:if test="count(following-sibling::*)>0"> + <xsl:text>\\ </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="m:mtable"> + <xsl:text>\begin{array}{</xsl:text> + <xsl:if test="@frame='solid'"> + <xsl:text>|</xsl:text> + </xsl:if> + <xsl:variable name="numbercols" select="count(./m:mtr[1]/m:mtd[not(@columnspan)])+sum(./m:mtr[1]/m:mtd/@columnspan)"/> + <xsl:choose> + <xsl:when test="@columnalign"> + <xsl:variable name="colalign"> + <xsl:call-template name="colalign"> + <xsl:with-param name="colalign" select="@columnalign"/> + </xsl:call-template> + </xsl:variable> + <xsl:choose> + <xsl:when test="string-length($colalign) > $numbercols"> + <xsl:value-of select="substring($colalign,1,$numbercols)"/> + </xsl:when> + <xsl:when test="string-length($colalign) < $numbercols"> + <xsl:value-of select="$colalign"/> + <xsl:call-template name="generate-string"> + <xsl:with-param name="text" select="substring($colalign,string-length($colalign))"/> + <xsl:with-param name="count" select="$numbercols - string-length($colalign)"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$colalign"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="generate-string"> + <xsl:with-param name="text" select="'c'"/> + <xsl:with-param name="count" select="$numbercols"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="@frame='solid'"> + <xsl:text>|</xsl:text> + </xsl:if> + <xsl:text>}</xsl:text> + <xsl:if test="@frame='solid'"> + <xsl:text>\hline </xsl:text> + </xsl:if> + <xsl:apply-templates/> + <xsl:if test="@frame='solid'"> + <xsl:text>\\ \hline</xsl:text> + </xsl:if> + <xsl:text>\end{array}</xsl:text> +</xsl:template> + +<xsl:template name="colalign"> + <xsl:param name="colalign"/> + <xsl:choose> + <xsl:when test="contains($colalign,' ')"> + <xsl:value-of select="substring($colalign,1,1)"/> + <xsl:call-template name="colalign"> + <xsl:with-param name="colalign" select="substring-after($colalign,' ')"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring($colalign,1,1)"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="generate-string"> +<!-- template from XSLT Standard Library v1.1 --> + <xsl:param name="text"/> + <xsl:param name="count"/> + + <xsl:choose> + <xsl:when test="string-length($text) = 0 or $count <= 0"/> + + <xsl:otherwise> + <xsl:value-of select="$text"/> + <xsl:call-template name="generate-string"> + <xsl:with-param name="text" select="$text"/> + <xsl:with-param name="count" select="$count - 1"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/tokens.xsl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/tokens.xsl new file mode 100755 index 00000000..fff92b08 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/MultiMarkdownXSLTMathML/tokens.xsl @@ -0,0 +1,329 @@ +<?xml version='1.0' encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:m="http://www.w3.org/1998/Math/MathML" + version='1.0'> + +<!-- ====================================================================== --> +<!-- $Id: tokens.xsl 282 2006-11-19 16:28:39Z fletcher $ + This file is part of the XSLT MathML Library distribution. + See ./README or http://www.raleigh.ru/MathML/mmltex for + copyright and other information + Modified by Fletcher T. Penney for MultiMarkdown Version 2.0.a --> +<!-- ====================================================================== --> + +<xsl:template match="m:mi|m:mn|m:mo|m:mtext|m:ms"> + <xsl:call-template name="CommonTokenAtr"/> +</xsl:template> + +<!-- 3.2.9 mglyph --> +<xsl:template match="m:mglyph"> + <xsl:text>\textcolor{red}{</xsl:text> + <xsl:value-of select="@alt"/> + <xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template name="mi"> + <xsl:choose> + <xsl:when test="string-length(normalize-space(.))>1 and not(@mathvariant)"> + <xsl:text>\mathrm{</xsl:text> + <xsl:apply-templates/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="mn"> + <xsl:choose> + <xsl:when test="string(number(.))='NaN' and not(@mathvariant)"> + <xsl:text>\mathrm{</xsl:text> + <xsl:apply-templates/> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- 3.2.5 Math Operator --> +<xsl:template name="mo"> +<xsl:if test="translate(normalize-space(.),'()[]}|','{{{{{{')='{'"> + <xsl:choose> + <xsl:when test="not(@stretchy='false') and count(preceding-sibling::m:mo[translate(normalize-space(.),'()[]}|','{{{{{{')='{'])mod 2=0 and following-sibling::m:mo[1][not(@stretchy='false')][translate(normalize-space(.),'()[]}|','{{{{{{')='{']"> + <xsl:text>\left</xsl:text> + </xsl:when> + <xsl:when test="not(@stretchy='false') and count(preceding-sibling::m:mo[translate(normalize-space(.),'()[]}|','{{{{{{')='{'])mod 2=1 and preceding-sibling::m:mo[1][not(@stretchy='false')][translate(normalize-space(.),'()[]}|','{{{{{{')='{']"> + <xsl:text>\right</xsl:text> + </xsl:when> + </xsl:choose> +</xsl:if> +<xsl:apply-templates/> +</xsl:template> + +<xsl:template name="mtext"> + <xsl:variable name="content"> + <xsl:call-template name="replaceMtextEntities"> + <xsl:with-param name="content" select="normalize-space(.)"/> + </xsl:call-template> + </xsl:variable> + <xsl:text>\text{</xsl:text> + <xsl:value-of select="$content"/> + <xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="m:mspace"> + <xsl:text>\phantom{\rule</xsl:text> + <xsl:if test="@depth"> + <xsl:text>[-</xsl:text> + <xsl:value-of select="@depth"/> + <xsl:text>]</xsl:text> + </xsl:if> + <xsl:text>{</xsl:text> + <xsl:if test="not(@width)"> + <xsl:text>0ex</xsl:text> + </xsl:if> + <xsl:value-of select="@width"/> + <xsl:text>}{</xsl:text> + <xsl:if test="not(@height)"> + <xsl:text>0ex</xsl:text> + </xsl:if> + <xsl:value-of select="@height"/> + <xsl:text>}}</xsl:text> +</xsl:template> + +<xsl:template name="ms"> + <xsl:choose> + <xsl:when test="@lquote"><xsl:value-of select="@lquote"/></xsl:when> + <xsl:otherwise><xsl:text>''</xsl:text></xsl:otherwise> + </xsl:choose><xsl:apply-templates/><xsl:choose> + <xsl:when test="@rquote"><xsl:value-of select="@rquote"/></xsl:when> + <xsl:otherwise><xsl:text>''</xsl:text></xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="CommonTokenAtr"> + <xsl:if test="@mathbackground"> + <xsl:text>\colorbox[rgb]{</xsl:text> + <xsl:call-template name="color"> + <xsl:with-param name="color" select="@mathbackground"/> + </xsl:call-template> + <xsl:text>}{$</xsl:text> + </xsl:if> + <xsl:if test="@color[not(@mathcolor)] or @mathcolor"> <!-- Note: @color is deprecated in MathML 2.0 --> + <xsl:text>\textcolor[rgb]{</xsl:text> + <xsl:call-template name="color"> + <xsl:with-param name="color" select="@color|@mathcolor"/> + </xsl:call-template> + <xsl:text>}{</xsl:text> + </xsl:if> + <xsl:if test="@mathvariant"> + <xsl:choose> + <xsl:when test="@mathvariant='normal'"> + <xsl:text>\mathrm{</xsl:text> + </xsl:when> + <xsl:when test="@mathvariant='bold'"> + <xsl:text>\mathbf{</xsl:text> + </xsl:when> + <xsl:when test="@mathvariant='italic'"> + <xsl:text>\mathit{</xsl:text> + </xsl:when> + <xsl:when test="@mathvariant='bold-italic'"> <!-- not supported --> + <xsl:text>\mathit{</xsl:text> + <xsl:message>The value bold-italic for mathvariant is not supported</xsl:message> + </xsl:when> + <xsl:when test="@mathvariant='double-struck'"> <!-- Required amsfonts --> + <xsl:text>\mathbb{</xsl:text> + </xsl:when> + <xsl:when test="@mathvariant='bold-fraktur'"> <!-- not supported --> + <xsl:text>\mathfrak{</xsl:text> + <xsl:message>The value bold-fraktur for mathvariant is not supported</xsl:message> + </xsl:when> + <xsl:when test="@mathvariant='script'"> + <xsl:text>\mathcal{</xsl:text> + </xsl:when> + <xsl:when test="@mathvariant='bold-script'"> <!-- not supported --> + <xsl:text>\mathcal{</xsl:text> + <xsl:message>The value bold-script for mathvariant is not supported</xsl:message> + </xsl:when> + <xsl:when test="@mathvariant='fraktur'"> <!-- Required amsfonts --> + <xsl:text>\mathfrak{</xsl:text> + </xsl:when> + <xsl:when test="@mathvariant='sans-serif'"> + <xsl:text>\mathsf{</xsl:text> + </xsl:when> + <xsl:when test="@mathvariant='bold-sans-serif'"> <!-- not supported --> + <xsl:text>\mathsf{</xsl:text> + <xsl:message>The value bold-sans-serif for mathvariant is not supported</xsl:message> + </xsl:when> + <xsl:when test="@mathvariant='sans-serif-italic'"> <!-- not supported --> + <xsl:text>\mathsf{</xsl:text> + <xsl:message>The value sans-serif-italic for mathvariant is not supported</xsl:message> + </xsl:when> + <xsl:when test="@mathvariant='sans-serif-bold-italic'"> <!-- not supported --> + <xsl:text>\mathsf{</xsl:text> + <xsl:message>The value sans-serif-bold-italic for mathvariant is not supported</xsl:message> + </xsl:when> + <xsl:when test="@mathvariant='monospace'"> + <xsl:text>\mathtt{</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>{</xsl:text> + <xsl:message>Error at mathvariant attribute</xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + <xsl:call-template name="selectTemplate"/> + <xsl:if test="@mathvariant"> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:if test="@color or @mathcolor"> + <xsl:text>}</xsl:text> + </xsl:if> + <xsl:if test="@mathbackground"> + <xsl:text>$}</xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template name="selectTemplate"> + <xsl:choose> + <xsl:when test="local-name(.)='mi'"> + <xsl:call-template name="mi"/> + </xsl:when> + <xsl:when test="local-name(.)='mn'"> + <xsl:call-template name="mn"/> + </xsl:when> + <xsl:when test="local-name(.)='mo'"> + <xsl:call-template name="mo"/> + </xsl:when> + <xsl:when test="local-name(.)='mtext'"> + <xsl:call-template name="mtext"/> + </xsl:when> + <xsl:when test="local-name(.)='ms'"> + <xsl:call-template name="ms"/> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template name="color"> +<!-- NB: Variables colora and valueColor{n} only for Sablotron --> + <xsl:param name="color"/> + <xsl:variable name="colora" select="translate($color,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/> + <xsl:choose> + <xsl:when test="starts-with($colora,'#') and string-length($colora)=4"> + <xsl:variable name="valueColor"> + <xsl:call-template name="Hex2Decimal"> + <xsl:with-param name="arg" select="substring($colora,2,1)"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$valueColor div 15"/><xsl:text>,</xsl:text> + <xsl:variable name="valueColor1"> + <xsl:call-template name="Hex2Decimal"> + <xsl:with-param name="arg" select="substring($colora,3,1)"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$valueColor1 div 15"/><xsl:text>,</xsl:text> + <xsl:variable name="valueColor2"> + <xsl:call-template name="Hex2Decimal"> + <xsl:with-param name="arg" select="substring($colora,4,1)"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$valueColor2 div 15"/> + </xsl:when> + <xsl:when test="starts-with($colora,'#') and string-length($colora)=7"> + <xsl:variable name="valueColor1"> + <xsl:call-template name="Hex2Decimal"> + <xsl:with-param name="arg" select="substring($colora,2,1)"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="valueColor2"> + <xsl:call-template name="Hex2Decimal"> + <xsl:with-param name="arg" select="substring($colora,3,1)"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="($valueColor1*16 + $valueColor2) div 255"/><xsl:text>,</xsl:text> + <xsl:variable name="valueColor1a"> + <xsl:call-template name="Hex2Decimal"> + <xsl:with-param name="arg" select="substring($colora,4,1)"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="valueColor2a"> + <xsl:call-template name="Hex2Decimal"> + <xsl:with-param name="arg" select="substring($colora,5,1)"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="($valueColor1a*16 + $valueColor2a) div 255"/><xsl:text>,</xsl:text> + <xsl:variable name="valueColor1b"> + <xsl:call-template name="Hex2Decimal"> + <xsl:with-param name="arg" select="substring($colora,6,1)"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="valueColor2b"> + <xsl:call-template name="Hex2Decimal"> + <xsl:with-param name="arg" select="substring($colora,7,1)"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="($valueColor1b*16 + $valueColor2b) div 255"/> + </xsl:when> +<!-- ======================= if color specifed as an html-color-name ========================================== --> + <xsl:when test="$colora='aqua'"><xsl:text>0,1,1</xsl:text></xsl:when> + <xsl:when test="$colora='black'"><xsl:text>0,0,0</xsl:text></xsl:when> + <xsl:when test="$colora='blue'"><xsl:text>0,0,1</xsl:text></xsl:when> + <xsl:when test="$colora='fuchsia'"><xsl:text>1,0,1</xsl:text></xsl:when> + <xsl:when test="$colora='gray'"><xsl:text>.5,.5,.5</xsl:text></xsl:when> + <xsl:when test="$colora='green'"><xsl:text>0,.5,0</xsl:text></xsl:when> + <xsl:when test="$colora='lime'"><xsl:text>0,1,0</xsl:text></xsl:when> + <xsl:when test="$colora='maroon'"><xsl:text>.5,0,0</xsl:text></xsl:when> + <xsl:when test="$colora='navy'"><xsl:text>0,0,.5</xsl:text></xsl:when> + <xsl:when test="$colora='olive'"><xsl:text>.5,.5,0</xsl:text></xsl:when> + <xsl:when test="$colora='purple'"><xsl:text>.5,0,.5</xsl:text></xsl:when> + <xsl:when test="$colora='red'"><xsl:text>1,0,0</xsl:text></xsl:when> + <xsl:when test="$colora='silver'"><xsl:text>.75,.75,.75</xsl:text></xsl:when> + <xsl:when test="$colora='teal'"><xsl:text>0,.5,.5</xsl:text></xsl:when> + <xsl:when test="$colora='white'"><xsl:text>1,1,1</xsl:text></xsl:when> + <xsl:when test="$colora='yellow'"><xsl:text>1,1,0</xsl:text></xsl:when> + <xsl:otherwise> + <xsl:message>Exception at color template</xsl:message> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="Hex2Decimal"> + <xsl:param name="arg"/> + <xsl:choose> + <xsl:when test="$arg='f'"> + <xsl:value-of select="15"/> + </xsl:when> + <xsl:when test="$arg='e'"> + <xsl:value-of select="14"/> + </xsl:when> + <xsl:when test="$arg='d'"> + <xsl:value-of select="13"/> + </xsl:when> + <xsl:when test="$arg='c'"> + <xsl:value-of select="12"/> + </xsl:when> + <xsl:when test="$arg='b'"> + <xsl:value-of select="11"/> + </xsl:when> + <xsl:when test="$arg='a'"> + <xsl:value-of select="10"/> + </xsl:when> + <xsl:when test="translate($arg, '0123456789', '9999999999')='9'"> <!-- if $arg is number --> + <xsl:value-of select="$arg"/> + </xsl:when> + <xsl:otherwise> + <xsl:message>Exception at Hex2Decimal template</xsl:message> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="m:*/text()"> + <xsl:call-template name="replaceEntities"> + <xsl:with-param name="content" select="normalize-space()"/> + </xsl:call-template> +</xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/README.txt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/README.txt new file mode 100755 index 00000000..95e72273 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/README.txt @@ -0,0 +1,103 @@ +NAME + MultiMarkdown + +SYNOPSIS + MultiMarkdown.pl [ --html4tags ] [ --version ] [ -shortversion ] [ + *file* ... ] + +DESCRIPTION + MultiMarkdown is an extended version of Markdown. See the website for + more information. + + http://fletcherpenney.net/multimarkdown/ + + Markdown is a text-to-HTML filter; it translates an easy-to-read / + easy-to-write structured text format into HTML. Markdown's text format + is most similar to that of plain text email, and supports features such + as headers, *emphasis*, code blocks, blockquotes, and links. + + Markdown's syntax is designed not as a generic markup language, but + specifically to serve as a front-end to (X)HTML. You can use span-level + HTML tags anywhere in a Markdown document, and you can use block level + HTML tags (like <div> and <table> as well). + + For more information about Markdown's syntax, see: + + http://daringfireball.net/projects/markdown/ + +OPTIONS + Use "--" to end switch parsing. For example, to open a file named "-z", + use: + + Markdown.pl -- -z + + --html4tags + Use HTML 4 style for empty element tags, e.g.: + + <br> + + instead of Markdown's default XHTML style tags, e.g.: + + <br /> + + -v, --version + Display Markdown's version number and copyright information. + + -s, --shortversion + Display the short-form version number. + +BUGS + To file bug reports or feature requests (other than topics listed in the + Caveats section above) please send email to: + + support@daringfireball.net (for Markdown issues) + + owner@fletcherpenney.net (for MultiMarkdown issues) + + Please include with your report: (1) the example input; (2) the output + you expected; (3) the output (Multi)Markdown actually produced. + +AUTHOR + John Gruber + http://daringfireball.net/ + + PHP port and other contributions by Michel Fortin + http://michelf.com/ + + MultiMarkdown changes by Fletcher Penney + http://fletcherpenney.net/ + +COPYRIGHT AND LICENSE + Original Markdown Code Copyright (c) 2003-2007 John Gruber + <http://daringfireball.net/> All rights reserved. + + MultiMarkdown changes Copyright (c) 2005-2009 Fletcher T. Penney + <http://fletcherpenney.net/> All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name "Markdown" nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + + This software is provided by the copyright holders and contributors "as + is" and any express or implied warranties, including, but not limited + to, the implied warranties of merchantability and fitness for a + particular purpose are disclaimed. In no event shall the copyright owner + or contributors be liable for any direct, indirect, incidental, special, + exemplary, or consequential damages (including, but not limited to, + procurement of substitute goods or services; loss of use, data, or + profits; or business interruption) however caused and on any theory of + liability, whether in contract, strict liability, or tort (including + negligence or otherwise) arising in any way out of the use of this + software, even if advised of the possibility of such damage. + diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/align_elastic_tabstops.pl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/align_elastic_tabstops.pl new file mode 100755 index 00000000..54f5252f --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/align_elastic_tabstops.pl @@ -0,0 +1,143 @@ +#!/usr/bin/env perl +# +# $Id: align_elastic_tabstops.pl 525 2009-06-15 18:45:44Z fletcher $ +# +# Adds support for a modified implementation of "elastic tabstops": +# <http://nickgravgaard.com/elastictabstops/> +# +# Also formats for the new MMD table syntax +# +# Copyright (c) 2009 Fletcher T. Penney +# <http://fletcherpenney.net/> +# +# MultiMarkdown Version 2.0.b6 +# +# TODO: no padding if only 1 line in group +# + +$cur_indent = 0; # Number of leading tabs +$cur_columns = 0; # Number of columns +@bits = (); # Store previous lines +$output = ""; +$minimum_width = 3; +$padding = 1; +$g_is_final_newline = 0; +$g_empty_line = 0; + +# Iteratively work through text: +# Does line match number of opening tabs? +# Does line match number of total tabs? +# As long as yes, process, and move to next line + +while ($line = <>) { + if ($line =~ /\n$/) { + # Require two blank lines to reset + if ($g_empty_line == 1) { + $g_is_final_newline = 1; + } else { + $g_empty_line = 1; + $g_is_final_newline = 0; + } + } else { + $g_empty_line = 0; + $g_is_final_newline = 0; + } + chomp $line; + + # Trim spaces before and after tabs + $line =~ s/ +\t/\t/g; + $line =~ s/\t +/\t/g; + + # Add space to end of line to prevent deleting lines with only tabs + $line .= " "; + + $line =~ /^(\t*)/; +# if (length($1) == $cur_indent) { +# This check was disabled to simplify things - may need to add it back + if ($cur_indent == $cur_indent) { + # We're at the same level of indentation + # Do we have the same number of columns? + $columns = ($line =~ tr/\t/\t/); + if ($columns == $cur_columns) { + # yup + push @bits, [split (/\t/, $line)]; + } else { + # Nope - new block + $output .= alignbits(@bits); + $line =~ /^(\t*)/; + $cur_indent = length($1); + $cur_columns = ($line =~ tr/\t/\t/); + @bits = (); + push @bits, [split (/\t/, $line)]; + } + } else { + # New indent, so it's a new block + + $output .= alignbits(@bits); + $line =~ /^(\t*)/; + $cur_indent = length($1); + $cur_columns = ($line =~ tr/\t/\t/); + @bits = (); + push @bits, [split (/\t/, $line)]; + } +} + +$output .= alignbits(@bits); + + +print $output; + +sub alignbits{ + my(@bits) = @_; + my $output = ""; + my @width = (); + + # Remove space that was added to end of lines + for $i (0 .. $#bits) { + $bits[$i][$#{$bits[$i]}] =~ s/ $//; + } + + for $i (0 .. $#bits) { + for $j (0 .. $#{$bits[$i]}) { + if ($bits[$i][$j] =~ /^\s*\-+\s*$/) { + # Special case for table headers + $bits[$i][$j] = "-"; + } + if (length($bits[$i][$j]) + $padding > $width[$j]) { + $width[$j] = length($bits[$i][$j]) + $padding; + } + } + } + + for $i (0 .. $#bits) { + for $j (0 .. $#{$bits[$i]} ) { + if ($bits[$i][$j] =~ /^\s*\-+\s*$/) { + # Special case for table headers + $bits[$i][$j] = "-" x ($width[$j]); + } + if ($bits[$i][$j] =~ /^[\d\$\-\.,]*\d[,\d\$\-\.]*$/) { + # Numeric field + $output .= ( $width[$j] > $minimum_width || $bits[$i][$j] =~ /\S/ )? sprintf "%*s", $width[$j], $bits[$i][$j] : ""; + # $output .= " " x $padding if ($j != $#{$bits[$i]}); + } else { + # Non-numeric field + if ($j == $#{$bits[$i]}) { + $output .= $bits[$i][$j]; + } else { + $output .= ($width[$j] > $minimum_width || $bits[$i][$j] =~ /\S/ )? sprintf "%-*s", $width[$j], $bits[$i][$j] : ""; + } + } + if ($j == $#{$bits[$i]}) { + $output .= "\n"; + } else { + $output .= "\t"; + } + } + } + + if (! $g_is_final_newline) { + $output =~ s/\n$//s; + } + return $output; +} + diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/autocomplete.pl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/autocomplete.pl new file mode 100755 index 00000000..9216ea9a --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/autocomplete.pl @@ -0,0 +1,88 @@ +#!/usr/bin/env perl +# +# $Id: autocomplete.pl 499 2008-03-23 13:03:19Z fletcher $ +# +# Find possible autocompletions in a MultiMarkdown file +# ( Designed to be called from TextMate, but the concept can be used elsewhere. ) +# +# +# Copyright (c) 2006-2008 Fletcher T. Penney +# <http://fletcherpenney.net/> +# +# MultiMarkdown Version 2.0.b6 +# + +# local $/; +$word_to_match = $ENV{'TM_CURRENT_WORD'}; + +# Read in source file +$multimarkdown_file = $ENV{'TM_FILEPATH'}; + + +open(MULTI, "<$multimarkdown_file"); +local $/; +$multi_source = <MULTI>; + +if ( $word_to_match =~ s/^\^/\\^/) { + + # Match Footnotes + # the '^' makes things tricky + + $multi_source =~ s/^(?:\[($word_to_match.+?)\]:)?.*$/$1/img; + $word_to_match =~ s/\\\^/^/g; + +} elsif ($word_to_match =~ /^\#/) { + + # Match MultiMarkdown Citations + + $multi_source =~ s/^(?:\[($word_to_match.+?)\]:)?.*$/$1/img; + + #BibTex Citations + + # Slurp any .bib files + open (BIB, "cd $ENV{'TM_DIRECTORY'}; cat *.bib |"); + local $/; + $bibtex = <BIB>; + $word_only = $word_to_match; + $word_only =~ s/^#//; + $bibtex =~ s{ + ^(?:@.*?\{($word_only.+?)\,)?.*$ + }{ + $match = $1; + $match =~ s/(...)/#$1/; + $match; + }xeimg; + $multi_source .= $bibtex; + +} else { + + # Match regular anchor (link or image) + + $multi_source =~ s{ + ^(?: + (?:\#{1,6}\s*|\[) + ($word_to_match.+?) # Match Heading + (?:\]:|\s*\#) + )? + (?:.*\[($word_to_match.+?)\]>>)? # Match Equation label + (?:\[($word_to_match.+?)\])? # Match image or anchor def + (?:\[.*?\]\[($word_to_match.+?)\])? # Match Table label (or at least a label + .*?$ # at the beginning of a line) + }{ + "$1$2$3$4"; + }gemix; +} + +# Strip blank lines +$multi_source =~ s/\n\s*\n/\n/gs; + +# Fix case (TextMate won't autocomplete different cases) +if ($word_to_match =~ /^\^/) { + $multi_source =~ s/\^+$word_to_match/$word_to_match/igm; +} else { + $multi_source =~ s/^$word_to_match/$word_to_match/igm; +} + +# Print + +print $multi_source; diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/cleancites.pl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/cleancites.pl new file mode 100755 index 00000000..7d9147be --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/cleancites.pl @@ -0,0 +1,40 @@ +#!/usr/bin/env perl +# +# $Id: cleancites.pl 499 2008-03-23 13:03:19Z fletcher $ +# +# Adds some utilities for making fancier citations with natbib +# +# Copyright (c) 2006-2008 Fletcher T. Penney +# <http://fletcherpenney.net/> +# +# MultiMarkdown Version 2.0.b6 +# + + +undef $/; +$data = <>; + +# Clean up strings of \cites into one citation + +while ($data =~ s{ + (\\cite[tp]?\*?)((?:\[(?:see|e\.g\.)\]\[\])?\{)(.*?)\} + \1\{(.*?)\} +}{ + $1 . "$2$3, $4\}"; +}egmx) { + + +} + + +# And clean up custom cites that got escaped +# e.g. $\backslash$citeyearpar\{Dewey:1997\} + +$data =~ s{ + \$\\backslash\$(cite.*?) + \\\{(.*?)\\\} +}{ + "\\" . $1 . "{$2}"; +}egmx; + +print $data; \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/mmd_merge.pl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/mmd_merge.pl new file mode 100755 index 00000000..50021215 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/mmd_merge.pl @@ -0,0 +1,126 @@ +#!/usr/bin/env perl +# +# mmd_merge.pl +# +# Combine text documents to create a MultiMarkdown structured document +# +# Copyright (c) 2009 Fletcher T. Penney +# <http://fletcherpenney.net/> +# +# MultiMarkdown Version 2.0.b6 +# + +use strict; +use warnings; + +my $data = ""; +my $line = ""; + +my $count = @ARGV; + +if ($count == 0) { + # We're in "stdin mode" + + # process stdin + undef $/; + my $data .= <>; + + mergeLines($data); +} else { + foreach(@ARGV) { + open(INPUT, "<$_"); + local $/; + my $data = <INPUT>; + close(INPUT); + mergeLines($data); + } +} + + +sub mergeLines { + my $file = shift; + + while ($file =~ /^(.*?)$/mg) { + $line = $1; + if (($line !~ /^\s*$/) && ($line !~ /^\#/)) { + $line =~ s/ {4}/\t/g; + $line =~ s/\s*$//; + my $indent = ($line =~ tr/\t/\t/); + $line =~ /^\s*(.*?)\s*$/; + + open(FILE, "<$1"); + local $/; + my $file = <FILE>; + close FILE; + + for (my $i = 0; $i< $indent; $i++) { + $file =~ s/^\#/##/gm; + } + + $data .= $file; + } + } + + print $data; +} + +=head1 NAME + +mmd_merge.pl - Combine text documents to create a MultiMarkdown structured +document. + +=head1 SYNOPSIS + +mmd_merge.pl [file ...] + + +=head1 DESCRIPTION + +This script is designed to allow you to use different files to store parts of +a larger MultiMarkdown document, making it easier to reorganize the document +if you so desire. Each line consists of the url or filename of the next +document. If the line is indented, each tab (or 4 spaces) will increase the +header level of the document by 1 (similar to the `Base Header Level` +metadata). Blank lines are ignored. Lines starting with `#` are treated as +comments. Only metadata from the first file would be properly handles, since +it would be the only metadata at the top of the new "virtual" document. + +=head1 SEE ALSO + +Designed for use with MultiMarkdown. + +<http://fletcherpenney.net/multimarkdown/> + +Mailing list support for MultiMarkdown: + +<http://groups.google.com/group/multimarkdown/> + + OR + +<mailto:multimarkdown@googlegroups.com> + +=head1 AUTHOR + +Fletcher T. Penney, E<lt>owner@fletcherpenney.netE<gt> + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2009 by Fletcher T. Penney + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the + Free Software Foundation, Inc. + 59 Temple Place, Suite 330 + Boston, MA 02111-1307 USA + +=cut diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/table_cleanup.pl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/table_cleanup.pl new file mode 100755 index 00000000..f6445342 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/Utilities/table_cleanup.pl @@ -0,0 +1,354 @@ +#!/usr/bin/env perl +# +# $Id: table_cleanup.pl 499 2008-03-23 13:03:19Z fletcher $ +# +# Cleanup the spacing and alignment of MultiMarkdown tables +# +# Used by my TextMate Bundle, but can be used elsewhere as well +# +# Copyright (c) 2006-2008 Fletcher T. Penney +# <http://fletcherpenney.net/> +# +# MultiMarkdown Version 2.0.b6 +# + +local $/; +$text = <>; + +my %max_width = (); +my @alignments = (); + + +# Reusable regexp's to match table +my $less_than_tab = 3; + +my $line_start = qr{ + [ ]{0,$less_than_tab} +}mx; + +my $table_row = qr{ + [^\n]*?\|[^\n]*?\n +}mx; + +my $first_row = qr{ + $line_start + \S+.*?\|.*?\n +}mx; + +my $table_rows = qr{ + (?:\n?$table_row) +}mx; + +my $table_caption = qr{ + $line_start + \[.*?\][ \t]*\n +}mx; + +my $table_divider = qr{ + $line_start + [\|\-\+\:\.][ \-\+\|\:\.]*?\|[ \-\+\|\:\.]* +}mx; + +my $whole_table = qr{ + ($table_caption)? # Optional caption + ($first_row # First line must start at beginning + ($table_row)*?)? # Header Rows + $table_divider # Divider/Alignment definitions + $table_rows+ # Body Rows + \n?[^\n]*?\|[^\n]*? # Allow last row not to have a "\n" for cleaning while editing + ($table_caption)? # Optional caption +}mx; + + +# Find whole tables, then break them up and process them + +$text =~ s{ + ^($whole_table) # Whole table in $1 + (\n|\Z) # End of file or 2 blank lines +}{ + my $table = $1 . "\n"; + my $table_original = $table; + $result = ""; + @alignments = (); + %max_width = (); + + # Strip Caption and Summary + $table =~ s/^$line_start\[\s*(.*?)\s*\](\[\s*(.*?)\s*\])?[ \t]*$//m; + $table =~ s/\n$line_start\[\s*(.*?)\s*\][ \t]*\n/\n/s; + + $table = "\n" . $table; + # Need to be greedy + $table =~ s/\n($table_divider)\n($table_rows+)//s; + my $alignment_string = $1; + my $body = $2; + my $header = $table; + + # Process column alignment + while ($alignment_string =~ /\|?\s*(.+?)\s*(\||\Z)/gs) { + my $cell = $1; + if ($cell =~ /\:$/) { + if ($cell =~ /^\:/) { + push(@alignments,"center"); + } else { + push(@alignments,"right"); + } + } else { + if ($cell =~ /^\:/) { + push(@alignments,"left"); + } else { + if (($cell =~ /^\./) || ($cell =~ /\.$/)) { + push(@alignments,"char"); + } else { + push(@alignments,""); + } + } + } + } + + $table = $header . "\n" . $body; + + # First pass - find widest cell in each column (for single column cells only) + foreach my $line (split(/\n/, $table)) { + my $count = 0; + while ($line =~ /(\|?\s*[^\|]+?\s*(\|+|\Z))/gs) { + my $cell = $1; # Width of actual text in cell + my $ending = $2; # Is there a trailing `|`? + + if ($ending =~ /\|\|/) { + # For first pass, do single cells only + $count += (length($ending)); + next; + } + + setWidth($count, $cell); + $count++ + } + } + + # Second pass - handle cells that span multiple rows + foreach my $line (split(/\n/, $table)) { + my $count = 0; + while ($line =~ /(\|?\s*[^\|]+?\s*(\|+|\Z))/gs) { + my $cell = $1; # Width of actual text in cell + my $ending = $2; # Is there a trailing `|`? + + if ($ending =~ /\|\|/) { + setWidth($count, $cell); + $count += (length($ending)); + next; + } + $count++ + } + } + + # Fix length of alignment definitions + + $table_original =~ s{ + \n($table_divider)\n + }{ + my $divider = $1; + my $count = 0; + $divider =~ s{ + (\|?)\s*([^\|]+?)\s*(\|+|\Z) + }{ + my $opening = $1; + my $cell = $2; + my $ending = $3; + my $result = ""; + + my $goal_length = $max_width{$count} -3; + if ($count == 0) { + if ($opening eq ""){ + $goal_length++; + } else { + $goal_length--; + } + } + if ($cell =~ /^\:/) { + $goal_length--; + $result = ":"; + } + if ($cell =~ /\:$/) { + $goal_length--; + } + for (my $i=0;$i < $goal_length;$i++){ + $result.="-"; + } + if ($cell =~ /\:$/) { + $result .=":"; + } + + $count++; + $opening . "$result" . $ending; + }xsge; + "\n$divider\n"; + }sxe; + + # Second pass - reformat table cells to appropriate width + + $table_original =~ s{ + # match each line + (.*) + }{ + $line = $1; + my $result = ""; + my $count = 0; + + # Now process them + + if (($line =~ /^\[/) && ($line !~ /\|/)){ + $result .= $line; + } else { + while ($line =~ /(\|?)\s*([^\|]+?)\s*(\|+|\Z)/gs) { + my $opening = $1; + my $cell = $2; + my $ending = $3; + my $lead = 0; + my $pad_lead = 0; + my $pad_trail = 0; + my $len = length($2); # Length of actual contents + + # Not all first column cells have a leading `|` + if ($count > 0) { + $pad_lead = 1; + } elsif (length($opening) > 0) { + $pad_lead = 1; + } + + # Buffer before trailing `|` + if (length($ending) > 0) { + $pad_trail = 1; + } + + # How much space to fill? (account for multiple columns) + my $width = 0; + if ($ending =~ /\|/) { + $width = maxWidth($count,length($ending)); + } else { + $width = maxWidth($count, 1); + } + + if ($alignments[$count] =~ /^(left)?$/) { + $lead = $len + $pad_lead; + $trail = $width - $lead - length($opening); + } + + if ($alignments[$count] =~ /^right$/) { + if ($count == 0) { + if ($opening eq "") { + $opening = "|"; + $pad_lead = 1; + $width++; + } + } + $trail = $pad_trail+length($ending); + $lead = $width - $trail - length($opening); + } + + if ($alignments[$count] =~ /^center$/) { + if ($count == 0) { + if ($opening eq "") { + $opening = "|"; + $pad_lead = 1; + $width++; + } + } + # Divide padding space + my $pad_total = $width - $len; + $pad_lead = int($pad_total/2)+1; + $pad_trail = $pad_total - $pad_lead; + $trail = $pad_trail+length($ending); + $lead = $width - $trail - length($opening); + } + + $result .= $opening . sprintf("%*s", $lead, $cell) . sprintf("%*s", $trail, $ending); + + if ($ending =~ /\|\|/) { + $count += (length($ending)); + } else { + $count++; + } + } + } + + $result; + }xmge; + + $table_original; +}xsge; + + +print $text; + + +sub maxWidth { + # Return the total width for a range of columns + my ($start_col, $cols) = @_; + my $total = 0; + + for (my $i = $start_col;$i < ($start_col + $cols);$i++) { + $total += $max_width{$i}; + } + + return $total; +} + +sub setWidth { + # Set widths for column(s) based on cell contents + my ($start_col, $cell) = @_; + + $cell =~ /(\|?)\s*([^\|]+?)\s*(\|+|\Z)/; + my $opening = $1; + my $contents = $2; + my $closing = $3; + + my $padding = 0; + + $padding++ if (length($opening) > 0); # For first cell + $padding++ if ($start_col > 0); # All cells except first definitely have an opening `|` + $padding++ if (length($closing) > 0); + + $contents =~ s/&\s*(.*?)\s*$/$1/; # I don't remember what this does + + my $cell_length = length($contents) + $padding + length($opening) + length($closing); + + if ($closing =~ /\|\|/) { + # This cell spans multiple columns + my @current_max = (); + my $cols = length($closing); + my $current_total = 0; + + for (my $i = $start_col;$i < ($start_col + $cols);$i++) { + $current_total += $max_width{$i}; + } + + if ($current_total < $cell_length) { + my %columns = (); + # Proportionally divide extra space + for (my $i = $start_col; $i < ($start_col + $cols);$i++) { + $max_width{$i} = int($max_width{$i} * ($cell_length/$current_total)); + $columns{$i} = $max_width{$i}; + } + $current_total = 0; + for (my $i = $start_col;$i < ($start_col + $cols);$i++) { + $current_total += $max_width{$i}; + } + my $missing = $cell_length - $current_total; + + # Now find the amount lost from fractions, and add back to largest columns + foreach my $a_col (sort { $max_width{$b} <=> $max_width{$a} }keys %columns) { + if ($missing > 0) { + $max_width{$a_col}++; + $missing--; + } + } + } + + } else { + if ($max_width{$start_col}< $cell_length) { + $max_width{$start_col} = $cell_length; + } + } + +} + diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/6x9book-poetry.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/6x9book-poetry.xslt new file mode 100755 index 00000000..91056109 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/6x9book-poetry.xslt @@ -0,0 +1,68 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Memoir converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX memoir class for output with the twoside option + + Format as 6.0in x 9.0in page size + + Code blocks display in poetry mode + + MultiMarkdown Version 2.0.b6 + + $Id: 6x9book-poetry.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="6x9book.xslt"/> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + + <!-- code block => Now it's poetry --> + <xsl:template match="html:pre[child::html:code]"> + <xsl:text>\begin{adjustwidth}{4em}{4em} +\setverbatimfont{\normalfont} +\begin{verbatim} + +</xsl:text> + <xsl:value-of select="."/> + <xsl:text> +\end{verbatim} +\end{adjustwidth} + +</xsl:text> + </xsl:template> + + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/6x9book-real-poetry.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/6x9book-real-poetry.xslt new file mode 100755 index 00000000..fe02e472 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/6x9book-real-poetry.xslt @@ -0,0 +1,212 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Memoir converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX memoir class for output with the twoside option + + Format as 6.0 in x 9.0 in page size + + Code blocks display in poetry mode using `clean-text-poetry` + + MultiMarkdown Version 2.0.b6 + + $Id: 6x9book-real-poetry.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="6x9book.xslt"/> + <xsl:import href="clean-text-poetry.xslt"/> + + <xsl:template name="latex-paper-size"> + <xsl:text>%% Widen indentions for poetry +\setlength{\vgap}{\vindent} + +%%% need more space for ToC page numbers +\setpnumwidth{2.55em} +\setrmarg{3.55em} + +%%% need more space for ToC section numbers +\cftsetindents{part}{0em}{3em} +\cftsetindents{chapter}{0em}{3em} +\cftsetindents{section}{3em}{3em} +\cftsetindents{subsection}{4.5em}{3.9em} +\cftsetindents{subsubsection}{8.4em}{4.8em} +\cftsetindents{paragraph}{10.7em}{5.7em} +\cftsetindents{subparagraph}{12.7em}{6.7em} + +%%% need more space for LoF numbers +\cftsetindents{figure}{0em}{3.0em} + +%%% and do the same for the LoT +\cftsetindents{table}{0em}{3.0em} + +%%% set up the page layout +\setstocksize{9in}{6in} +\settrimmedsize{9in}{6in}{*} % Use entire page +\settrims{0pt}{0pt} + +\setlrmarginsandblock{1.2in}{0.8in}{*} +\setulmarginsandblock{1in}{1in}{*} + +\setmarginnotes{0.1pt}{0.2in}{\onelineskip} +\setheadfoot{\onelineskip}{2\onelineskip} +\setheaderspaces{*}{2\onelineskip}{*} + +%% Fix for the companion style header issue +%% http://www.codecomments.com/message459639.html + +\setlength{\headwidth}{\textwidth} + \addtolength{\headwidth}{\marginparsep} + + \addtolength{\headwidth}{\marginparwidth} + \makerunningwidth{companion}{\headwidth} + \makeheadrule{companion}{\headwidth}{\normalrulethickness} + \makeheadposition{companion}{flushright}{flushleft}{}{} + +\checkandfixthelayout + +</xsl:text> + </xsl:template> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:text>\newcommand{\attrib}[1]{% +\nopagebreak{\raggedleft\footnotesize #1\par}} + + +</xsl:text> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="latex-footer"> + <xsl:text>% +% Back Matter +% + +\backmatter +%\appendixpage + +% Bibliography +\bibliographystyle{\mybibliostyle} +\bibliocommand + +% Glossary +\printglossary + + +% Indexes +\def\indexname{Index of Titles} +\printindex + +\def\indexname{Index of First Lines} +\printindex[firstlines] + +\end{document} +</xsl:text> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[10pt,twoside]{memoir} +\usepackage{layouts}[2001/04/29] +\usepackage{modified-bringhurst} % Available from http://fletcherpenney.net/ +\makeglossary +\makeindex +\makeindex[firstlines] + +\def\mychapterstyle{companion} +\def\mypagestyle{companion} +\def\revision{} + + </xsl:text> + </xsl:template> + + <!-- code block => Now it's poetry --> + <xsl:template match="html:pre[child::html:code]"> + <xsl:text>\settowidth{\versewidth}{</xsl:text> + <xsl:call-template name="longest-line"> + <xsl:with-param name="source"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + <xsl:text>} +\begin{verse} %[\versewidth] +</xsl:text> + <!-- Create an index of first lines --> + <xsl:text>\index[firstlines]{</xsl:text> + <xsl:value-of select="substring-before(., $newline)"/> + <xsl:text>} +</xsl:text> + <xsl:call-template name="poetry-text"> + <xsl:with-param name="source"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + <xsl:text> +\end{verse} +</xsl:text> + <!-- Display attribution if present --> + <xsl:text>\attrib{</xsl:text> + <xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p']/html:em" mode="attrib"/> + <xsl:text>} +\vspace*{\fill} + + +</xsl:text> + <apply-templates select="preceding-sibling::*[1][local-name() = 'p']" mode="attrib"/> + </xsl:template> + + <xsl:template match="html:h3"> + <xsl:if test="preceding-sibling::*[1][local-name() != 'h2']"> + <xsl:text>\pagebreak +</xsl:text> + </xsl:if> +<xsl:text>\vspace*{\fill} +\poemtitle{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\index{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + </xsl:template> + + <!-- attrib (italics following verse) --> + <!-- ignore it by itself --> + <xsl:template match="html:p[following-sibling::*[1][local-name() = 'pre']]"> + </xsl:template> + + <xsl:template match="html:p" mode="attrib"> + <xsl:text>\attrib{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/6x9book.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/6x9book.xslt new file mode 100755 index 00000000..f38c7b26 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/6x9book.xslt @@ -0,0 +1,116 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Memoir converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX memoir class for output with the twoside option + + Format as 6.0in x 9.0in page size + + MultiMarkdown Version 2.0.b6 + + $Id: 6x9book.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="memoir.xslt"/> + + <xsl:output method='text' encoding='utf-8'/> + + <xsl:strip-space elements="*" /> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[10pt,twoside]{memoir} +\usepackage{layouts}[2001/04/29] +\makeglossary +\makeindex + +\def\mychapterstyle{companion} +\def\mypagestyle{companion} +\def\revision{} + +</xsl:text> + </xsl:template> + + <!-- Change paper size for 6 x 9 book --> + + <xsl:template name="latex-paper-size"> + <xsl:text>%%% need more space for ToC page numbers +\setpnumwidth{2.55em} +\setrmarg{3.55em} + +%%% need more space for ToC section numbers +\cftsetindents{part}{0em}{3em} +\cftsetindents{chapter}{0em}{3em} +\cftsetindents{section}{3em}{3em} +\cftsetindents{subsection}{4.5em}{3.9em} +\cftsetindents{subsubsection}{8.4em}{4.8em} +\cftsetindents{paragraph}{10.7em}{5.7em} +\cftsetindents{subparagraph}{12.7em}{6.7em} + +%%% need more space for LoF numbers +\cftsetindents{figure}{0em}{3.0em} + +%%% and do the same for the LoT +\cftsetindents{table}{0em}{3.0em} + +%%% set up the page layout +\setstocksize{9in}{6in} +\settrimmedsize{9in}{6in}{*} % Use entire page +\settrims{0pt}{0pt} + +\setlrmarginsandblock{1in}{0.6in}{*} +\setulmarginsandblock{1in}{0.8in}{*} + +\setmarginnotes{0.1pt}{0.2in}{\onelineskip} +\setheadfoot{\onelineskip}{2\onelineskip} +\setheaderspaces{*}{2\onelineskip}{*} + +%% Fix for the companion style header issue +%% http://www.codecomments.com/message459639.html + +\setlength{\headwidth}{\textwidth} + \addtolength{\headwidth}{\marginparsep} + + \addtolength{\headwidth}{\marginparwidth} + \makerunningwidth{companion}{\headwidth} + \makeheadrule{companion}{\headwidth}{\normalrulethickness} + \makeheadposition{companion}{flushright}{flushleft}{}{} + +\checkandfixthelayout + +</xsl:text> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/article-natbib.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/article-natbib.xslt new file mode 100755 index 00000000..fd8b30b9 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/article-natbib.xslt @@ -0,0 +1,106 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Article converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Adds support for natbib citations to the memoir article class. + + MultiMarkdown Version 2.0.b6 + + $Id: article-natbib.xslt 517 2008-09-12 19:37:52Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="memoir.xslt"/> + <xsl:import href="natbib-support.xslt"/> + + <xsl:output method='text' encoding='utf-8'/> + + <xsl:strip-space elements="*" /> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[oneside,article]{memoir} +\usepackage{layouts}[2001/04/29] +\usepackage{xmpincl} % Seems to be required to get the pdf to generate?? +\usepackage[round,sort&compress]{natbib} +\setcitestyle{super,open={},close={},comma} + +\makeglossary +\makeindex + +\def\mychapterstyle{default} +\def\mypagestyle{headings} +\def\revision{} +</xsl:text> + </xsl:template> + + <xsl:template name="latex-title"> + <xsl:text> +% Title +\mainmatter + +\maketitle + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-copyright"> + <xsl:text>% Copyright Info +\setlength{\parindent}{0pt} + +\ifx\mycopyright\undefined +\else + \textcopyright{} \mycopyright +\fi + +\revision + +\setlength{\parindent}{1em} + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-begin-body"> + <xsl:text>% +% Main Content +% + + +% Layout settings +\setlength{\parindent}{1em} + +</xsl:text> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/article.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/article.xslt new file mode 100755 index 00000000..bc064221 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/article.xslt @@ -0,0 +1,106 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Article converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX memoir class with the article option for output + + MultiMarkdown Version 2.0.b6 + + $Id: article.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="memoir.xslt"/> + + <xsl:output method='text' encoding='utf-8'/> + + <xsl:strip-space elements="*" /> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[oneside,article]{memoir} +\usepackage{layouts}[2001/04/29] +\usepackage{xmpincl} % Seems to be required to get the pdf to generate?? + +\makeglossary +\makeindex + +\def\mychapterstyle{default} +\def\mypagestyle{headings} +\def\revision{} +</xsl:text> + </xsl:template> + + <xsl:template name="latex-title"> + <xsl:text> +\chapterstyle{\mychapterstyle} +\pagestyle{\mypagestyle} + +% Title +\mainmatter + +\maketitle + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-copyright"> + <xsl:text>% Copyright Info +\setlength{\parindent}{0pt} + +\ifx\mycopyright\undefined +\else + \textcopyright{} \mycopyright +\fi + +\revision + +\setlength{\parindent}{1em} + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-begin-body"> + <xsl:text>% +% Main Content +% + + +% Layout settings +\setlength{\parindent}{1em} + +</xsl:text> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/beamer.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/beamer.xslt new file mode 100755 index 00000000..be09506a --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/beamer.xslt @@ -0,0 +1,426 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Beamer converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX beamer class to generate a series of PDF "slides" + + MultiMarkdown Version 2.0.b6 + + TODO: Currently only <?-> is recognized as dot-notation, <1-2> is not +--> + +<!-- +# Copyright (C) 2009 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + xmlns:beamer="http://fletcherpenney.net/mmd/" + exclude-result-prefixes="beamer" + version="1.0"> + + <xsl:import href="xhtml2latex.xslt"/> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template match="html:body"> + <body> + <xsl:apply-templates select="html:h1|html:h2|html:h3|html:h4|html:h5|html:h6"/> + </body> + </xsl:template> + + <xsl:template name="latex-footer"> +% <xsl:text>\begin{frame}[allowframebreaks] +%\frametitle{Bibliography} + +% Bibliography +%\bibliographystyle{\mybibliostyle} +%\bibliocommand +%\end{frame} + +\end{document} +</xsl:text> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[ignorenonframetext,11pt]{beamer} +%\documentclass[onesided]{article} +%\usepackage{graphicx} +%\usepackage{beamerarticle} + +\usepackage{beamerthemesplit} +\usepackage{patchcmd} +\usepackage{tabulary} % Support longer table cells +\usepackage{booktabs} % Support better tables + +\usepackage{subfigure} + +\let\oldSubtitle\subtitle + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-intro"> + <xsl:text> +\ifx\subtitle\undefined +\else + \oldSubtitle{\subtitle} +\fi + +\ifx\affiliation\undefined +\else + \institute{\affiliation} +\fi + +\ifx\event\undefined +\else + \date[\mydate]{\mydate~ / \event } +\fi + +\ifx\graphic\undefined +\else + \pgfdeclareimage[height=0.75cm]{university-logo}{\graphic} + \logo{\pgfuseimage{university-logo}} +\fi + +\ifx\theme\undefined +\else + \usetheme{\theme} +\fi + + +\AtBeginSubsection[] +{ + \begin{frame} + \frametitle{Outline} + \tableofcontents[currentsection,currentsubsection] + \end{frame} +} + +%\title{\mytitle} + +% Show "current/total" slide counter in footer +\title[\mytitle\hspace{2em}\insertframenumber/ +\inserttotalframenumber]{\mytitle} + + +\author{\myauthor} +\addtolength{\parskip}{\baselineskip} + +\begin{document} +</xsl:text> + </xsl:template> + + <xsl:template name="latex-paper-size"> + <xsl:text></xsl:text> + </xsl:template> + + <xsl:template name="latex-copyright"> + <xsl:text></xsl:text> + </xsl:template> + + <xsl:template name="latex-begin-body"> + <xsl:text></xsl:text> + </xsl:template> + + <xsl:template name="latex-header"> + <xsl:text>\def\myauthor{Author} % In case these were not included in metadata +\def\mytitle{Title} +\def\mykeywords{} +\def\mybibliostyle{plain} +\def\bibliocommand{} +</xsl:text> +</xsl:template> + + <xsl:template name="latex-title"> + <xsl:text>\frame{\setlength\parskip{0pt}\titlepage} + + +</xsl:text> + </xsl:template> + + <!-- Convert headers into chapters, etc --> + + <xsl:template match="html:h1"> + <xsl:text>\part{</xsl:text> + <xsl:value-of select="."/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + <xsl:text>\frame{\partpage} +</xsl:text> + <xsl:variable name="children" select="count(following-sibling::*) - count(following-sibling::*[local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h3' or local-name() = 'h4' or local-name() = 'h5' or local-name() = 'h6'][1]/following-sibling::*) - count(following-sibling::*[local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h3' or local-name() = 'h4' or local-name() = 'h5' or local-name() = 'h6'][1])"/> + + <xsl:apply-templates select="following-sibling::*[position() <= $children]"/> + </xsl:template> + + <xsl:template match="html:h2"> + <xsl:choose> + <xsl:when test="substring(node(), (string-length(node()) - string-length('*')) + 1) = '*'"> + <xsl:text>\section*{}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\section{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + + <xsl:variable name="children" select="count(following-sibling::*) - count(following-sibling::*[local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h3' or local-name() = 'h4' or local-name() = 'h5' or local-name() = 'h6'][1]/following-sibling::*) - count(following-sibling::*[local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h3' or local-name() = 'h4' or local-name() = 'h5' or local-name() = 'h6'][1])"/> + + <xsl:apply-templates select="following-sibling::*[position() <= $children]"/> + </xsl:template> + + <xsl:template match="html:h3"> + <xsl:choose> + <xsl:when test="substring(node(), (string-length(node()) - string-length('*')) + 1) = '*'"> + <xsl:text>\subsection*{}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\subsection{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + + <xsl:variable name="children" select="count(following-sibling::*) - count(following-sibling::*[local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h3' or local-name() = 'h4' or local-name() = 'h5' or local-name() = 'h6'][1]/following-sibling::*) - count(following-sibling::*[local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h3' or local-name() = 'h4' or local-name() = 'h5' or local-name() = 'h6'][1])"/> + + <xsl:apply-templates select="following-sibling::*[position() <= $children]"/> + </xsl:template> + + <xsl:template match="html:h4"> + <xsl:text>\begin{frame}</xsl:text> + <xsl:variable name="children" select="count(following-sibling::*) - count(following-sibling::*[local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h3' or local-name() = 'h4' or local-name() = 'h5' or local-name() = 'h6'][1]/following-sibling::*) - count(following-sibling::*[local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h3' or local-name() = 'h4' or local-name() = 'h5' or local-name() = 'h6'][1])"/> + <xsl:if test="count(following-sibling::*[position() <= $children][local-name() = 'pre']) > 0"> + <xsl:text>[fragile]</xsl:text> + </xsl:if> + <xsl:text> +\frametitle{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + + <xsl:apply-templates select="following-sibling::*[position() <= $children]"/> + <xsl:text> +\end{frame} + </xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h5"> + <xsl:text disable-output-escaping="yes"> +<![CDATA[\mode<article>{]]></xsl:text> + <xsl:variable name="children" select="count(following-sibling::*) - count(following-sibling::*[local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h3' or local-name() = 'h4' or local-name() = 'h5' or local-name() = 'h6'][1]/following-sibling::*) - count(following-sibling::*[local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h3' or local-name() = 'h4' or local-name() = 'h5' or local-name() = 'h6'][1])"/> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + + <xsl:apply-templates select="following-sibling::*[position() <= $children]"/> + <xsl:text>} +</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h6"> + <xsl:text>\subsubsection{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + + <!-- code block --> + <xsl:template match="html:pre[child::html:code]"> + <xsl:text>\begin{semiverbatim} +</xsl:text> + <xsl:value-of select="./html:code"/> + <xsl:text> +\end{semiverbatim} + +</xsl:text> + </xsl:template> + + <!-- no code, so treat as poetry --> + <xsl:template match="html:pre"> + <xsl:text>\begin{adjustwidth}{4em}{4em} +\setverbatimfont{\normalfont} +\begin{verbatim} + +</xsl:text> + <xsl:value-of select="."/> + <xsl:text> +\end{verbatim} +\end{adjustwidth} + +</xsl:text> + </xsl:template> + + + <!-- epigraph (a blockquote immediately following a header 1-3) --> + <xsl:template match="html:blockquote[preceding-sibling::*[1][local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h2' or local-name() = 'h3' ]]"> + <xsl:text>\epigraph{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>} + +</xsl:text> + </xsl:template> + + <!-- epigraph author (a blockquote within blockquote) --> + <xsl:template match="html:blockquote[last()][parent::*[preceding-sibling::*[1][local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h2' or local-name() = 'h3']]] "> + <xsl:text>}{</xsl:text> + <xsl:apply-templates select="node()"/> + </xsl:template> + + <!-- images --> + <xsl:template match="html:img"> + <xsl:text>\begin{figure} + </xsl:text> + <xsl:if test="@id"> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>} + </xsl:text> + </xsl:if> + <xsl:text>\begin{center} + </xsl:text> + <xsl:text>\includegraphics[keepaspectratio,width=\textwidth, height=.75\textheight]{</xsl:text> + <xsl:value-of select="@src"/> + <xsl:text>} + \end{center} + </xsl:text> + <xsl:if test="@title"> + <xsl:if test="not(@title = '')"> + <xsl:text>\caption{</xsl:text> + <xsl:apply-templates select="@title"/> + <xsl:text>} + </xsl:text> + </xsl:if> + </xsl:if> + <xsl:text>\end{figure} + </xsl:text> + </xsl:template> + + <xsl:template match="html:img" mode="images"> + <xsl:if test="@id"> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>} +</xsl:text> + </xsl:if> + <xsl:text>\subfigure</xsl:text> + <xsl:if test="@title"> + <xsl:if test="not(@title = '')"> + <xsl:text>[</xsl:text> + <xsl:apply-templates select="@title"/> + <xsl:text>]</xsl:text> + </xsl:if> + </xsl:if> + <xsl:text>{\includegraphics[keepaspectratio,width=\textwidth, height=.75\textheight]{</xsl:text> + <xsl:value-of select="@src"/> + <xsl:text>}}\quad +</xsl:text> + </xsl:template> + + <!-- paragraph with multiple images --> + <xsl:template match="html:p[count(child::html:img) > '1']"> + <xsl:text>\begin{figure} +\begin{center} +</xsl:text> + + <xsl:apply-templates select="node()" mode="images"/> + <xsl:text>\end{center} +\end{figure} +</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:div[@class='bibliography']"> + <!-- close the preceding frame first - we want to be our own slide(s) --> + <xsl:text>\end{frame} + +\part{Bibliography} +\begin{frame}[allowframebreaks] +\frametitle{Bibliography} +\begin{thebibliography}{</xsl:text> + <xsl:value-of select="count(div[@id])"/> + <xsl:text>} +</xsl:text> + <xsl:apply-templates select="html:div"/> + <xsl:text> + +\end{thebibliography} + +</xsl:text> + </xsl:template> + + <!-- list item --> + <xsl:template match="html:li"> + <xsl:text> +\item</xsl:text> + <xsl:choose> + <xsl:when test="substring(node(), (string-length(node()) - 1)) = '->'"> + <xsl:value-of select="substring(node(), (string-length(node()) - 3))"/> + <xsl:text> </xsl:text> + <xsl:value-of select="substring(node(),1,(string-length(node()) - 4))"/> + </xsl:when> + <xsl:otherwise> + <xsl:text> </xsl:text> + <xsl:apply-templates select="node()"/> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$newline"/> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text-allow-latex.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text-allow-latex.xslt new file mode 100755 index 00000000..6f8a8313 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text-allow-latex.xslt @@ -0,0 +1,278 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML2LaTeX replace-substring utility file by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Extracted this routine so that it can be changed more easily by users. + + This file is responsible for cleaning up special characters into + a LaTeX-friendly format. + + The `allow-latex` variant does not protect characters needed to express + LaTeX commands. Use with caution. + + MultiMarkdown Version 2.0.b6 + + $Id: clean-text-allow-latex.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <!-- Pass XHTML Comments through unaltered (useful for including + raw LaTeX in your MultiMarkdown document) --> + <xsl:template match="comment()"> + <xsl:value-of select="."/> + </xsl:template> + + <!-- It's easier (for now) to rewrite the entire function, since + certain substitutions need to be deleted... --> + <xsl:template name="clean-text"> + <xsl:param name="source" /> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:value-of select="$source"/> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>%20</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text> </xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>e.g. </xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>e.g.\ </xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>i.e. </xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>i.e.\ </xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>—</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>---</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>–</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>--</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>‘</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>`</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>”</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>''</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>“</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>``</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>’</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>'</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>%</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\%</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>&</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\&</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>_</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\_</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>©</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\textcopyright{}</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>#</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\#</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>\$\backslash\$</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>$\backslash$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>~</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\ensuremath{\sim}</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text> </xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>~</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text><</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>$<$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>></xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>$>$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>↓</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>${\displaystyle \downarrow}$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>↑</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>${\displaystyle \uparrow}$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>…</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>{\ldots}</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text-poetry.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text-poetry.xslt new file mode 100755 index 00000000..98138e4c --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text-poetry.xslt @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- XHTML2LaTeX replace-substring utility file by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Extracted this routine so that it can be changed more easily by users. + + This file is responsible for cleaning up special characters into + a LaTeX-friendly format. + + Modified to support features needed for poetry. + + MultiMarkdown Version 2.0.b6 + + $Id: clean-text-poetry.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <!-- It's still built on the original --> + <xsl:import href="clean-text.xslt"/> + + + <!-- Find the longest line of a poem --> + <xsl:template name="longest-line"> + <xsl:param name="source"/> + <xsl:variable name="first"> + <xsl:value-of select="substring-before($source, $newline)"/> + </xsl:variable> + <xsl:variable name="rest"> + <xsl:value-of select="substring-after($source, $newline)"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="contains($rest, $newline)"> + <xsl:variable name="second"> + <xsl:call-template name="longest-line"> + <xsl:with-param name="source"> + <xsl:value-of select="$rest"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:choose> + <xsl:when test="string-length($first) > string-length($second)"> + <xsl:value-of select="$first"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$second"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$rest"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <!-- This version is for blocks of poetry. In additional to the usual + cleanup, it changes the newlines for poetry typesetting, and replaces + leading spaces or tabs with \vin --> + <xsl:template name="poetry-text"> + <xsl:param name="source"/> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="clean-text-utility"> + <xsl:with-param name="source"> + <xsl:value-of select="$source"/> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:value-of select="$newline"/> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text> \\</xsl:text> + <xsl:value-of select="$newline"/> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:value-of select="$newline"/> + <xsl:text> \\</xsl:text> + <xsl:value-of select="$newline"/> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>!</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text> </xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\vin </xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + +</xsl:stylesheet> diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text-rtf.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text-rtf.xslt new file mode 100755 index 00000000..43ff5c9f --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text-rtf.xslt @@ -0,0 +1,220 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- xhtml2rtf replace-substring utility file by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Extracted this routine so that it can be changed more easily by users. + + This file is responsible for cleaning up special characters into + an RTF-friendly format. + + MultiMarkdown Version 2.0.b6 + +--> + +<!-- +# Copyright (C) 2009 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <!-- Pass XHTML Comments through unaltered (useful for including + raw RTF in your MultiMarkdown document) --> + <xsl:template match="comment()"> + <xsl:value-of select="."/> + </xsl:template> + + <!-- This is a "pointer" function that can be over-ridden easily + in order to add quick additional changes --> + <xsl:template name="clean-text"> + <xsl:param name="source"/> + <xsl:call-template name="clean-text-utility"> + <xsl:with-param name="source"> + <xsl:value-of select="$source"/> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <!-- This is the "real" function that does the work. You can also + override this if you need to make some real changes --> + <xsl:template name="clean-text-utility"> + <xsl:param name="source" /> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:value-of select="$source"/> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>\</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\\</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>’</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\'92</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>‘</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\'91</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>“</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\'93</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>”</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\'94</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>–</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\endash </xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>—</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\emdash </xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>…</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\'85</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>{</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\{</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>}</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\}</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + + <!-- replace-substring routine by Doug Tidwell - XSLT, O'Reilly Media --> + <xsl:template name="replace-substring"> + <xsl:param name="original" /> + <xsl:param name="substring" /> + <xsl:param name="replacement" select="''"/> + <xsl:variable name="first"> + <xsl:choose> + <xsl:when test="contains($original, $substring)" > + <xsl:value-of select="substring-before($original, $substring)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$original"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="middle"> + <xsl:choose> + <xsl:when test="contains($original, $substring)" > + <xsl:value-of select="$replacement"/> + </xsl:when> + <xsl:otherwise> + <xsl:text></xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="last"> + <xsl:choose> + <xsl:when test="contains($original, $substring)"> + <xsl:choose> + <xsl:when test="contains(substring-after($original, $substring), $substring)"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:value-of select="substring-after($original, $substring)" /> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:value-of select="$substring" /> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:value-of select="$replacement" /> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring-after($original, $substring)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:text></xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:value-of select="concat($first, $middle, $last)"/> + </xsl:template> +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text.xslt new file mode 100755 index 00000000..e13d3377 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/clean-text.xslt @@ -0,0 +1,336 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML2LaTeX replace-substring utility file by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Extracted this routine so that it can be changed more easily by users. + + This file is responsible for cleaning up special characters into + a LaTeX-friendly format. + + MultiMarkdown Version 2.0.b6 + + $Id: clean-text.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <!-- Pass XHTML Comments through unaltered (useful for including + raw LaTeX in your MultiMarkdown document) --> + <xsl:template match="comment()"> + <xsl:value-of select="."/> + </xsl:template> + + <!-- This is a "pointer" function that can be over-ridden easily + in order to add quick additional changes --> + <xsl:template name="clean-text"> + <xsl:param name="source"/> + <xsl:call-template name="clean-text-utility"> + <xsl:with-param name="source"> + <xsl:value-of select="$source"/> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <!-- This is the "real" function that does the work. You can also + override this if you need to make some real changes --> + <xsl:template name="clean-text-utility"> + <xsl:param name="source" /> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:value-of select="$source"/> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>%20</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text> </xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>\</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>$\backslash$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>e.g. </xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>e.g.\ </xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>i.e. </xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>i.e.\ </xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>—</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>---</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>–</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>--</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>‘</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>`</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>”</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>''</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>“</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>``</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>’</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>'</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>%</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\%</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>&</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\&</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>}</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\}</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>{</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\{</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>_</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\_</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>$</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>©</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\textcopyright{}</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>#</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\#</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>\$\backslash\$</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>$\backslash$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>^</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\^{}</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>~</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>\ensuremath{\sim}</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text> </xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>~</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text><</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>$<$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>></xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>$>$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>↓</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>${\displaystyle \downarrow}$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>↑</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>${\displaystyle \uparrow}$</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:text>…</xsl:text> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:text>{\ldots}</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/custom-envelope.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/custom-envelope.xslt new file mode 100755 index 00000000..0253ab5d --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/custom-envelope.xslt @@ -0,0 +1,74 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- Custom Envelope by Fletcher Penney + + Demonstration of how to customize the default envelope template + in MultiMarkdown with default return address information. + + MultiMarkdown Version 2.0.b6 + + $Id: custom-envelope.xslt 525 2009-06-15 18:45:44Z fletcher $ +--> + +<!-- +# Copyright (C) 2008-2009 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="envelope.xslt"/> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="return-address-defaults"> + <xsl:text>% Default info for return address +% These should include '\\' where appropriate for line endings + +\def\defaultemail{\href{mailto:owner@fletcherpenney.net}{owner@fletcherpenney.net} \\} +\def\defaultposition{} +\def\defaultdepartment{\coverlogo \normalfont \\} +\def\defaultaddress{123 Fake St \\ Charleston, SC 29401 \\} +\def\defaultweb{} + +% Define the fl ligature for linux compatibility +\chardef\fl="FB02 + +% Define Logo or something for upper left corner +\def\coverlogo{ +\font\logo="Didot:mapping=tex-text" at 24pt \logo +\href{http://fletcherpenney.net/}{\fl etcherpenney.\color{accent}net\color{black}} +} + + +% Use my stylesheet +\usepackage{fletcherpenney} + +</xsl:text> + </xsl:template> + + + +</xsl:stylesheet> diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/custom-letterhead.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/custom-letterhead.xslt new file mode 100755 index 00000000..2ee5f175 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/custom-letterhead.xslt @@ -0,0 +1,100 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- Custom Letterhead by Fletcher Penney + + Demonstration of how to customize the default letterhead template + in MultiMarkdown with default return address information, as + well as a custom logotype. + + Uses the fletcherpenney.sty file available at: + http://fletcherpenney.net/XSLT_Files + + To include a signature, add `Graphic Signature` to your metadata, + and include a `signature.pdf` file in your LaTeX class files. + + Must be processed with XeLaTeX + + MultiMarkdown Version 2.0.b6 + + $Id: custom-letterhead.xslt 525 2009-06-15 18:45:44Z fletcher $ +--> + +<!-- +# Copyright (C) 2007-2009 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="letterhead.xslt"/> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="return-address-defaults"> + <xsl:text>% Default info for return address +% These should include '\\' where appropriate for line endings + +\def\defaultemail{\href{mailto:owner@fletcherpenney.net}{owner@fletcherpenney.net} \\} +\def\defaultposition{} +\def\defaultdepartment{} +\def\defaultaddress{123 Fake St \\ Charleston, SC 29401 \\} +\def\defaultphone{Tel 843 555 1234 \\} +\def\defaultfax{Fax 843 555 2345 \\} +\def\defaultweb{} + +% Define height for logo and return address +\def\logoheight{1.2in} + +% Define the fl ligature for linux compatibility +\chardef\fl="FB02 + +% Define Logo or something for upper left corner +\def\coverlogo{ +\font\logo="Didot:mapping=tex-text" at 24pt \logo +\href{http://fletcherpenney.net/}{\fl etcherpenney.\color{accent}net\color{black}} +} + +% Use my stylesheet +\usepackage{fletcherpenney} + +% Define signature +\ifx\signature\undefined + \def\signature{~ \\ Sincerely,\\ + \ifx\graphicsignature\undefined + + \else + \resizebox{2in}{!}{\includegraphics{signature}}\\ + \fi +\myauthor} +\else +\fi + +</xsl:text> + </xsl:template> + + + +</xsl:stylesheet> diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/envelope.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/envelope.xslt new file mode 100755 index 00000000..333989f1 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/envelope.xslt @@ -0,0 +1,216 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Envelope converter by Fletcher Penney + + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX memoir class for output + + Creates an envelope to go along with letterhead + + *Requires that you use the mmd-envelope style package for LaTeX, + which is available at http://fletcherpenney.net/XSLT_Files* + + MultiMarkdown Version 2.0.b6 + + $Id: envelope.xslt 525 2009-06-15 18:45:44Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2009 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="memoir.xslt"/> + + <xsl:output method='text' encoding='utf-8'/> + + <xsl:strip-space elements="*" /> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <!-- rely on the mmd-envelope style to set up paper size --> + <xsl:template name="latex-paper-size"> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[oneside,article]{memoir} +\usepackage{layouts}[2001/04/29] + + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-header"> + <xsl:text>\usepackage{graphicx} % To include graphics in pdf's (jpg, gif, png, etc) +\usepackage[utf8]{inputenc} % For UTF-8 support +\usepackage[T1]{fontenc} % Use T1 font encoding for accented characters +\usepackage{xcolor} % Allow for color (annotations) + +\def\myauthor{Author} % In case these were not included in metadata +\def\mytitle{Title} +\def\mykeywords{} +\def\myrecipient{} + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-intro"> + <xsl:text> + +% +% PDF Stuff +% + +%\ifpdf % Removed for XeLaTeX compatibility +% \pdfoutput=1 % Removed for XeLaTeX compatibility + \usepackage[ + plainpages=false, + pdfpagelabels, + pdftitle={\mytitle}, + pagebackref, + pdfauthor={\myauthor}, + pdfkeywords={\mykeywords} + ]{hyperref} + \usepackage{memhfixc} +%\fi % Removed for XeLaTeX compatibility + +\ifx\recipient\undefined +\else + \addtodef{\myrecipient}{}{\recipient \\} +\fi + +\ifx\recipientaddress\undefined +\else + \addtodef{\myrecipient}{}{\recipientaddress} +\fi + +\ifx\mydate\undefined + \def\mydate{\today} +\fi + +</xsl:text> + </xsl:template> + + <xsl:template name="return-address"> + <xsl:call-template name="return-address-defaults"/> + <xsl:text>% Create return address +\def\returnaddress{\raggedright +\normalsize +\renewcommand{\baselinestretch}{1.1} + +\textbf{\myauthor} \\} + +\ifx\position\undefined +\addtodef{\returnaddress}{}{\textit{\defaultposition}} +\else + \addtodef{\returnaddress}{}{\textit{\position} \\} +\fi + + +\ifx\department\undefined +\addtodef{\returnaddress}{}{\textbf{\defaultdepartment}} +\else + \addtodef{\returnaddress}{}{\textbf{\department} \\} +\fi + +\ifx\address\undefined +\addtodef{\returnaddress}{}{\defaultaddress} +\else + \addtodef{\returnaddress}{}{\address \\} +\fi + + </xsl:text> + </xsl:template> + + <xsl:template name="return-address-defaults"> + <xsl:text>% Default info for return address +% These should include '\\' where appropriate for line endings + +\def\defaultemail{} +\def\defaultposition{} +\def\defaultdepartment{} +\def\defaultaddress{} +\def\defaultphone{} +\def\defaultfax{} +\def\defaultweb{} + +% Define height for logo and return address +\def\logoheight{1.5in} + +% Define Logo or something for upper left corner +\def\coverlogo{} + + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-begin-body"> + <xsl:call-template name="return-address"/> + <xsl:text>\usepackage{mmd-envelope} +\begin{document} + +% Layout settings +\setlength{\parindent}{0pt} + +\mainmatter +\thispagestyle{envelope} + +% Insert return address + +{\renewcommand{\baselinestretch}{1.1} +\color{returnaddress}\returnaddress} +\vspace*{\fill} + +% Return to main settings +\large + +\renewcommand{\baselinestretch}{1.2} +\setlength{\parskip}{12pt} + +% Insert Recipient +\begin{adjustwidth}{3in}{0in} +\myrecipient +\vspace*{\fill} +\end{adjustwidth} +</xsl:text> +</xsl:template> + + <xsl:template name="latex-title"> + </xsl:template> + + <xsl:template name="latex-copyright"> + </xsl:template> + + <xsl:template name="latex-footer"> + <xsl:text> +\end{document} +</xsl:text> + </xsl:template> + + +</xsl:stylesheet> diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/latex-snippet.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/latex-snippet.xslt new file mode 100755 index 00000000..94e12d1f --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/latex-snippet.xslt @@ -0,0 +1,263 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-LaTeX converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Strip out all the "header" information - just output the actual content. + + Useful when you already have a LaTeX template that you will use. + + MultiMarkdown Version 2.0.b6 + + $Id: latex-snippet.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="xhtml2latex.xslt"/> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template match="html:meta"> + </xsl:template> + + <xsl:template match="*[local-name() = 'title']"> + </xsl:template> + + <xsl:template name="latex-header"> + </xsl:template> + + <xsl:template name="latex-footer"> + </xsl:template> + + <xsl:template name="latex-intro"> + </xsl:template> + + <xsl:template name="latex-document-class"> + </xsl:template> + + <xsl:template name="latex-paper-size"> + </xsl:template> + + <xsl:template name="latex-title"> + </xsl:template> + + <xsl:template name="latex-copyright"> + </xsl:template> + + <xsl:template name="latex-begin-body"> + </xsl:template> + + <!-- Rename Bibliography --> + <xsl:template name="rename-bibliography"> + </xsl:template> + + <!-- Convert headers into chapters, etc --> + + <xsl:template match="html:h1"> + <xsl:text>\part{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h2"> + <xsl:text>\chapter{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h3"> + <xsl:text>\section{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h4"> + <xsl:text>\subsection{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h5"> + <xsl:text>\subsubsection{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h6"> + <xsl:text>{\itshape </xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <!-- support for abstracts --> + <xsl:template match="html:h2[1][translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'abstract']"> + <xsl:text>\begin{abstract}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\addcontentsline{toc}{chapter}{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h2[position() = '2'][preceding-sibling::html:h2[position()='1'][translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'abstract']]"> + <xsl:text>\end{abstract}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + <xsl:text>\chapter{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h3[count(preceding-sibling::html:h2) = '1'][preceding-sibling::html:h2[position()='1'][translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'abstract']]"> + <xsl:text>\section*{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h4[count(preceding-sibling::html:h2) = '1'][preceding-sibling::html:h2[position()='1'][translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'abstract']]"> + <xsl:text>\subsection*{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <!-- code block --> + <xsl:template match="html:pre[child::html:code]"> + <xsl:text>\begin{adjustwidth}{2.5em}{2.5em} +\begin{verbatim} + + +</xsl:text> + <xsl:value-of select="./html:code"/> + <xsl:text> +\end{verbatim} +\end{adjustwidth} + +</xsl:text> + </xsl:template> + + <!-- no code, so treat as poetry --> + <xsl:template match="html:pre"> + <xsl:text>\begin{adjustwidth}{4em}{4em} +\setverbatimfont{\normalfont} +\begin{verbatim} + + +</xsl:text> + <xsl:value-of select="."/> + <xsl:text> +\end{verbatim} +\end{adjustwidth} + +</xsl:text> + </xsl:template> + + + <!-- epigraph (a blockquote immediately following a header 1-3) --> + <xsl:template match="html:blockquote[preceding-sibling::*[1][local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h2' or local-name() = 'h3' ]]"> + <xsl:text>\epigraph{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>} + +</xsl:text> + </xsl:template> + + <!-- epigraph author (a blockquote within blockquote) --> + <xsl:template match="html:blockquote[last()][parent::*[preceding-sibling::*[1][local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h2' or local-name() = 'h3']]] "> + <xsl:text>}{</xsl:text> + <xsl:apply-templates select="node()"/> + </xsl:template> + + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/letterhead.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/letterhead.xslt new file mode 100755 index 00000000..70c231dd --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/letterhead.xslt @@ -0,0 +1,306 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Memoir converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX memoir class for output + + The first page can include letterhead graphic elements (e.g. logo) + + It is simplified from the full memoir version, removing items + not likely to be included in a letter or simple document + + *Requires that you use the mmd-letterhead style package for LaTeX, + which is available at http://fletcherpenney.net/XSLT_Files* + + MultiMarkdown Version 2.0.b6 + + $Id: letterhead.xslt 525 2009-06-15 18:45:44Z fletcher $ +--> + +<!-- +# Copyright (C) 2007-2009 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="memoir.xslt"/> + + <xsl:output method='text' encoding='utf-8'/> + + <xsl:strip-space elements="*" /> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <!-- rely on the mmd-letterhead style to set up paper size --> + <xsl:template name="latex-paper-size"> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[oneside,article]{memoir} +\usepackage{layouts}[2001/04/29] + + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-header"> + <xsl:text>\usepackage{fancyvrb} % Allow \verbatim et al. in footnotes +\usepackage{graphicx} % To include graphics in pdf's (jpg, gif, png, etc) +\usepackage{booktabs} % Better tables +\usepackage{tabulary} % Support longer table cells +\usepackage[utf8]{inputenc} % For UTF-8 support +\usepackage[T1]{fontenc} % Use T1 font encoding for accented characters +\usepackage{xcolor} % Allow for color (annotations) + +%\geometry{landscape} % Activate for rotated page geometry + +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty + % line rather than an indent + + +\def\myauthor{Author} % In case these were not included in metadata +\def\mytitle{Title} +\def\mykeywords{} +\def\mybibliostyle{plain} +\def\bibliocommand{} +\def\myrecipient{} + +\VerbatimFootnotes +</xsl:text> + </xsl:template> + + <xsl:template name="latex-intro"> + <xsl:text> + +% +% PDF Stuff +% + +%\ifpdf % Removed for XeLaTeX compatibility +% \pdfoutput=1 % Removed for XeLaTeX compatibility + \usepackage[ + plainpages=false, + pdfpagelabels, + pdftitle={\mytitle}, + pagebackref, + pdfauthor={\myauthor}, + pdfkeywords={\mykeywords} + ]{hyperref} + \usepackage{memhfixc} +%\fi % Removed for XeLaTeX compatibility + +\ifx\recipient\undefined +\else + \addtodef{\myrecipient}{}{\recipient \\} +\fi + +\ifx\recipientaddress\undefined +\else + \addtodef{\myrecipient}{}{\recipientaddress} +\fi + +\ifx\mydate\undefined + \def\mydate{\today} +\fi + +</xsl:text> + </xsl:template> + + <xsl:template name="return-address"> + <xsl:call-template name="return-address-defaults"/> + <xsl:text>% Create return address +\def\returnaddress{\raggedleft +\footnotesize +\renewcommand{\baselinestretch}{1.1} + +\textbf{\myauthor} \\} + +\ifx\position\undefined +\addtodef{\returnaddress}{}{\textit{\defaultposition}} +\else + \addtodef{\returnaddress}{}{\textit{\position} \\} +\fi + +\ifx\email\undefined +\addtodef{\returnaddress}{}{\textit{\defaultemail} + +~ + +} +\else + \addtodef{\returnaddress}{}{\textit{\email} + +~ + +} +\fi + +\ifx\department\undefined +\addtodef{\returnaddress}{}{\textbf{\defaultdepartment}} +\else + \addtodef{\returnaddress}{}{\textbf{\department} \\} +\fi + +\ifx\address\undefined +\addtodef{\returnaddress}{}{\defaultaddress} +\else + \addtodef{\returnaddress}{}{\address \\} +\fi + +\ifx\phone\undefined +\addtodef{\returnaddress}{}{\defaultphone} +\else + \addtodef{\returnaddress}{}{Tel \phone \\} +\fi + + +\ifx\fax\undefined +\addtodef{\returnaddress}{}{\defaultfax} +\else + \addtodef{\returnaddress}{}{Fax \fax \\} +\fi + +\ifx\web\undefined +\addtodef{\returnaddress}{}{\defaultweb +} +\else + \addtodef{\returnaddress}{}{ \web \\ +} +\fi + </xsl:text> + </xsl:template> + + <xsl:template name="return-address-defaults"> + <xsl:text>% Default info for return address +% These should include '\\' where appropriate for line endings + +\def\defaultemail{} +\def\defaultposition{} +\def\defaultdepartment{} +\def\defaultaddress{} +\def\defaultphone{} +\def\defaultfax{} +\def\defaultweb{} + +% Define height for logo and return address +\def\logoheight{1.5in} + +% Define Logo or something for upper left corner +\def\coverlogo{} + +% Define signature +\ifx\signature\undefined + \def\signature{~ \\ Sincerely, \\ + +\myauthor} +\else +\fi + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-begin-body"> + <xsl:call-template name="return-address"/> + <xsl:text>\usepackage{mmd-letterhead} +\begin{document} + +% Layout settings +\setlength{\parindent}{0pt} + +\mainmatter + +% Use coverpage style +\thispagestyle{letterhead-cover} + +% Insert return address + +\begin{figure}[t] +\begin{adjustwidth}{-0.5in}{-0.5in} +\begin{minipage}[l][\logoheight]{4in} + \coverlogo + \vspace*{\fill} +\end{minipage} +\hfill +\begin{minipage}[r][\logoheight]{2in} + {\renewcommand{\baselinestretch}{1.1} + \color{returnaddress}\returnaddress} + \vspace*{\fill} +\end{minipage} +\end{adjustwidth} +\end{figure} + + +\pagestyle{letterhead} +\large +% Return to main settings + +\renewcommand{\baselinestretch}{1.2} +\setlength{\parskip}{12pt} + +% Insert Recipient +\myrecipient + +% Insert date +\mydate + +</xsl:text> +</xsl:template> + + <xsl:template name="latex-title"> + </xsl:template> + + <xsl:template name="latex-copyright"> + </xsl:template> + + <xsl:template name="latex-footer"> + <xsl:text>\signature + +% +% Back Matter +% + +\backmatter +%\appendixpage + +% Bibliography +\bibliographystyle{\mybibliostyle} +\bibliocommand + +% Glossary +\printglossary + + +% Index +\printindex + +\end{document} +</xsl:text> + </xsl:template> + + +</xsl:stylesheet> diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/manuscript-novel.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/manuscript-novel.xslt new file mode 100755 index 00000000..f05f93bb --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/manuscript-novel.xslt @@ -0,0 +1,278 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Manuscript converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses my manuscript class for output + + MultiMarkdown Version 2.0.b6 + + $Id: manuscript-novel.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="xhtml2latex.xslt"/> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="latex-footer"> + <xsl:text>% +% Back Matter +% + +\backmatter +%\appendixpage + +% Bibliography +\bibliographystyle{\mybibliostyle} +\bibliocommand + +% Glossary +% \printglossary + + +% Index +% \printindex + +\end{document} +</xsl:text> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[10pt,oneside]{memoir} +\usepackage{layouts}[2001/04/29] +\usepackage{manuscript} +\makeglossary +\makeindex + +\def\revision{} + + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-paper-size"> + <xsl:text> +</xsl:text> + </xsl:template> + + <xsl:template name="latex-intro"> + <xsl:text> + + % + % PDF Stuff + % + +% \ifpdf % Removed for XeLaTeX compatibility +% \pdfoutput=1 % Removed for XeLaTeX compatibility + \usepackage[ + plainpages=false, + pdfpagelabels, + pdftitle={\mytitle}, + pagebackref, + pdfauthor={\myauthor}, + pdfkeywords={\mykeywords} + ]{hyperref} + \usepackage{memhfixc} +% \fi % Removed for XeLaTeX compatibility + + + \title{\mytitle} + \author{\myauthor} + + \begin{document} + </xsl:text> + </xsl:template> <xsl:template name="latex-title"> + <xsl:text> + +% Title Page +\begin{titlingpage} +\aliaspagestyle{titlingpage}{title} +\setlength{\droptitle}{30pt} + +\manuscript\noindent\myauthor \\ +\address +\vskip 12pt +\noindent\agent + +\vfill +\renewcommand{\baselinestretch}{2} +\normalsize\manuscript\centering\MakeUppercase\mytitle + +by \myauthor +\vskip 4in + +\end{titlingpage} + + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-copyright"> + <xsl:text></xsl:text> + </xsl:template> + + <xsl:template name="latex-begin-body"> + <xsl:text>% +% Main Content +% + +% Manuscript settings +\renewcommand{\baselinestretch}{2} +\raggedright\normalsize +\font\body="Courier New" at 12pt\body + +% Layout settings +\setlength{\parindent}{0.5in} + +\mainmatter +</xsl:text> + </xsl:template> + + <!-- Rename Bibliography --> + <xsl:template name="rename-bibliography"> + <xsl:param name="source" /> + <xsl:text>\renewcommand\bibname{</xsl:text> + <xsl:value-of select="$source" /> + <xsl:text>} +</xsl:text> + </xsl:template> + + <!-- Convert headers into chapters, etc --> + + <xsl:template match="html:h1"> + <xsl:text>\part{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h2"> + <xsl:text>\chapter{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h3"> + <xsl:text>\begin{center} +\# +\end{center} + +</xsl:text> + + </xsl:template> + + <xsl:template match="html:h4"> + <xsl:text>\subsection{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h5"> + <xsl:text>\subsubsection{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h6"> + <xsl:text>{\itshape </xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + + <!-- code block --> + <xsl:template match="html:pre/html:code"> + <xsl:text>\begin{adjustwidth}{2.5em}{2.5em} +\begin{verbatim} + +</xsl:text> + <xsl:value-of select="."/> + <xsl:text> +\end{verbatim} +\end{adjustwidth} + +</xsl:text> + </xsl:template> + + <!-- Changes due to limitations of manuscript format --> + <xsl:template match="html:a[@href]"> + <xsl:value-of select="."/> + <xsl:text>(</xsl:text> + <xsl:value-of select="@href"/> + <xsl:text>)</xsl:text> + </xsl:template> + + <!-- emphasis --> + <xsl:template match="html:em"> + <xsl:text>\underline{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + </xsl:template> + + <!-- strong --> + <xsl:template match="html:strong"> + <xsl:text>\textbf{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-natbib.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-natbib.xslt new file mode 100755 index 00000000..bfa28062 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-natbib.xslt @@ -0,0 +1,69 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Article converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Adds support for natbib citations to the memoir class. + + MultiMarkdown Version 2.0.b6 + + $Id: memoir-natbib.xslt 517 2008-09-12 19:37:52Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="memoir.xslt"/> + <xsl:import href="natbib-support.xslt"/> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[10pt,oneside]{memoir} +\usepackage{layouts}[2001/04/29] +\usepackage[round,sort&compress]{natbib} +\setcitestyle{super,open={},close={},comma} + +\makeglossary +\makeindex + +\def\mychapterstyle{default} +\def\mypagestyle{headings} +\def\revision{} + +</xsl:text> + </xsl:template> + + <xsl:output method='text' encoding='utf-8'/> + + <xsl:strip-space elements="*" /> + + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-poetry.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-poetry.xslt new file mode 100755 index 00000000..bd1e4c6d --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-poetry.xslt @@ -0,0 +1,66 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Memoir converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX memoir class for output + + Code bLocks display in poetry mode + + MultiMarkdown Version 2.0.b6 + + $Id: memoir-poetry.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="memoir.xslt"/> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + + <!-- code block => Now it's poetry --> + <xsl:template match="html:pre[child::html:code]"> + <xsl:text>\begin{adjustwidth}{4em}{4em} +\setverbatimfont{\normalfont} +\begin{verbatim} + +</xsl:text> + <xsl:value-of select="."/> + <xsl:text> +\end{verbatim} +\end{adjustwidth} + +</xsl:text> + </xsl:template> + + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-twosided.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-twosided.xslt new file mode 100755 index 00000000..b4b4dfb6 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-twosided.xslt @@ -0,0 +1,64 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Memoir converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX memoir class for output with the twoside option + + MultiMarkdown Version 2.0.b6 + + $Id: memoir-twosided.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="memoir.xslt"/> + + <xsl:output method='text' encoding='utf-8'/> + + <xsl:strip-space elements="*" /> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[10pt,twoside]{memoir} +\usepackage{layouts}[2001/04/29] +\makeglossary +\makeindex + +\def\mychapterstyle{default} +\def\mypagestyle{headings} +\def\revision{} +</xsl:text> + </xsl:template> + + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-xelatex.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-xelatex.xslt new file mode 100755 index 00000000..21c74ad0 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir-xelatex.xslt @@ -0,0 +1,82 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Memoir converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX memoir class for output + + Modified for use XeLaTeX (suggested by Talazem Al-Azem) + + MultiMarkdown Version 2.0.b6 + + $Id: memoir-xelatex.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="memoir.xslt"/> + + <xsl:output method='text' encoding='utf-8'/> + + <xsl:strip-space elements="*" /> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="latex-header"> + <xsl:text>\usepackage{fontspec} +\setromanfont[Mapping=tex-text]{Palatino} + +\usepackage{fancyvrb} % Allow \verbatim et al. in footnotes +\usepackage{graphicx} % To include graphics in pdf's (jpg, gif, png, etc) +\usepackage{booktabs} % Better tables +\usepackage{tabulary} % Support longer table cells +%\usepackage[utf8]{inputenc} % For UTF-8 support +\usepackage[T1]{fontenc} % Use T1 font encoding for accented characters +\usepackage{xcolor} % Allow for color (annotations) + +%\geometry{landscape} % Activate for rotated page geometry + +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty + % line rather than an indent + + +\def\myauthor{Author} % In case these were not included in metadata +\def\mytitle{Title} +\def\mykeywords{} +\def\mybibliostyle{plain} +\def\bibliocommand{} + +\VerbatimFootnotes +</xsl:text> + </xsl:template> + + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir.xslt new file mode 100755 index 00000000..4719800e --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/memoir.xslt @@ -0,0 +1,435 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Memoir converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Uses the LaTeX memoir class for output + + MultiMarkdown Version 2.0.b6 + + $Id: memoir.xslt 525 2009-06-15 18:45:44Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="xhtml2latex.xslt"/> + + <xsl:template match="/"> + <xsl:apply-templates select="html:html/html:head"/> + <xsl:apply-templates select="html:html/html:body"/> + <xsl:call-template name="latex-footer"/> + </xsl:template> + + <xsl:template name="latex-footer"> + <xsl:text>% +% Back Matter +% + +\backmatter +%\appendixpage + +% Bibliography +\bibliographystyle{\mybibliostyle} +\bibliocommand + +% Glossary +\printglossary + + +% Index +\printindex + +\end{document} +</xsl:text> + </xsl:template> + + <xsl:template name="latex-document-class"> + <xsl:text>\documentclass[10pt,oneside]{memoir} +\usepackage{layouts}[2001/04/29] +\makeglossary +\makeindex + +\def\mychapterstyle{default} +\def\mypagestyle{headings} +\def\revision{} + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-paper-size"> + <xsl:text>%%% need more space for ToC page numbers +\setpnumwidth{2.55em} +\setrmarg{3.55em} + +%%% need more space for ToC section numbers +\cftsetindents{part}{0em}{3em} +\cftsetindents{chapter}{0em}{3em} +\cftsetindents{section}{3em}{3em} +\cftsetindents{subsection}{4.5em}{3.9em} +\cftsetindents{subsubsection}{8.4em}{4.8em} +\cftsetindents{paragraph}{10.7em}{5.7em} +\cftsetindents{subparagraph}{12.7em}{6.7em} + +%%% need more space for LoF numbers +\cftsetindents{figure}{0em}{3.0em} + +%%% and do the same for the LoT +\cftsetindents{table}{0em}{3.0em} + +%%% set up the page layout +\settrimmedsize{\stockheight}{\stockwidth}{*} % Use entire page +\settrims{0pt}{0pt} + +\setlrmarginsandblock{1.5in}{1.5in}{*} +\setulmarginsandblock{1.5in}{1.5in}{*} + +\setmarginnotes{17pt}{51pt}{\onelineskip} +\setheadfoot{\onelineskip}{2\onelineskip} +\setheaderspaces{*}{2\onelineskip}{*} +\checkandfixthelayout + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-title"> + <xsl:text> +\chapterstyle{\mychapterstyle} +\pagestyle{\mypagestyle} + +% +% Front Matter +% + +\frontmatter + + +% Title Page + +\maketitle +\clearpage + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-copyright"> + <xsl:text>% Copyright Page +\vspace*{\fill} + +\setlength{\parindent}{0pt} + +\ifx\mycopyright\undefined +\else + \textcopyright{} \mycopyright +\fi + +\revision + +\begin{center} +\framebox{ \parbox[t]{1.5in}{\centering Formatted for \LaTeX \\ + by MultiMarkdown}} +\end{center} + +\setlength{\parindent}{1em} +\clearpage + +</xsl:text> + </xsl:template> + + <xsl:template name="latex-begin-body"> + <xsl:text>% Table of Contents +\tableofcontents +%\listoffigures % activate to include a List of Figures +%\listoftables % activate to include a List of Tables + + +% +% Main Content +% + + +% Layout settings +\setlength{\parindent}{1em} + +\mainmatter +</xsl:text> + </xsl:template> + + <!-- Rename Bibliography --> + <xsl:template name="rename-bibliography"> + <xsl:param name="source" /> + <xsl:text>\renewcommand\bibname{</xsl:text> + <xsl:value-of select="$source" /> + <xsl:text>} +</xsl:text> + </xsl:template> + + <!-- Convert headers into chapters, etc --> + + <xsl:template match="html:h1"> + <xsl:choose> + <xsl:when test="substring(node(), (string-length(node()) - string-length('*')) + 1) = '*'"> + <xsl:text>\part*{}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\part{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h2"> + <xsl:choose> + <xsl:when test="substring(node(), (string-length(node()) - string-length('*')) + 1) = '*'"> + <xsl:text>\chapter*{}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\chapter{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h3"> + <xsl:text>\section{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h4"> + <xsl:text>\subsection{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h5"> + <xsl:text>\subsubsection{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h6"> + <xsl:text>{\itshape </xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <!-- add support for Appendices - include a part or chapter named 'Appendices' to trigger--> + + <xsl:template match="html:h2[translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'appendices']"> + <xsl:text>\appendixpage* +\appendix</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h1[translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'appendices']"> + <xsl:text>\appendixpage* +\appendix</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <!-- support for abstracts --> + + <xsl:template match="html:h2[1][translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'abstract']"> + <xsl:text>\begin{abstract}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\addcontentsline{toc}{chapter}{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h2[position()='2'][preceding-sibling::html:h2[position()='1'][translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'abstract']]"> + <xsl:text>\end{abstract}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + <xsl:choose> + <xsl:when test="substring(node(), (string-length(node()) - string-length('*')) + 1) = '*'"> + <xsl:text>\chapter*{}</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>\chapter{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h3[count(preceding-sibling::html:h2) = '1'][preceding-sibling::html:h2[position()='1'][translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'abstract']]"> + <xsl:text>\section*{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <xsl:template match="html:h4[count(preceding-sibling::html:h2) = '1'][preceding-sibling::html:h2[position()='1'][translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'abstract']]"> + <xsl:text>\subsection*{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:text>\label{</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>}</xsl:text> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$newline"/> + </xsl:template> + + <!-- code block --> + <xsl:template match="html:pre[child::html:code]"> + <xsl:text>\begin{adjustwidth}{2.5em}{2.5em} +\begin{verbatim} + +</xsl:text> + <xsl:value-of select="./html:code"/> + <xsl:text> + +\end{verbatim} +\end{adjustwidth} + +</xsl:text> + </xsl:template> + + <!-- no code, so treat as poetry --> + <xsl:template match="html:pre"> + <xsl:text>\begin{adjustwidth}{4em}{4em} +\setverbatimfont{\normalfont} +\begin{verbatim} + +</xsl:text> + <xsl:value-of select="."/> + <xsl:text> +\end{verbatim} +\end{adjustwidth} + +</xsl:text> + </xsl:template> + + + <!-- epigraph (a blockquote immediately following a header 1-3) --> + <xsl:template match="html:blockquote[preceding-sibling::*[1][local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h2' or local-name() = 'h3' ]]"> + <xsl:text>\epigraph{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>} + +</xsl:text> + </xsl:template> + + <!-- epigraph author (a blockquote within blockquote) --> + <xsl:template match="html:blockquote[last()][parent::*[preceding-sibling::*[1][local-name() = 'h1' or local-name() = 'h2' or local-name() = 'h2' or local-name() = 'h3']]] "> + <xsl:text>}{</xsl:text> + <xsl:apply-templates select="node()"/> + </xsl:template> + + <!-- Memoir handles glossaries differently --> + + <xsl:template match="html:li" mode="glossary"> + <xsl:param name="footnoteId"/> + <xsl:if test="parent::html:ol/parent::html:div/@class = 'footnotes'"> + <xsl:if test="concat('#',@id) = $footnoteId"> + <xsl:apply-templates select="html:span[@class='glossary sort']" mode="glossary"/> + <xsl:apply-templates select="html:span[@class='glossary name']" mode="glossary"/> + <xsl:text>{</xsl:text> + <xsl:apply-templates select="html:p" mode="glossary"/> + <xsl:text>}</xsl:text> + </xsl:if> + </xsl:if> + </xsl:template> + + <xsl:template match="html:span[@class='glossary name']" mode="glossary"> + <xsl:text>{</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>}</xsl:text> + </xsl:template> + + <xsl:template match="html:span[@class='glossary sort']" mode="glossary"> + <xsl:text>(</xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text>)</xsl:text> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/multimarkdown.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/multimarkdown.xslt new file mode 100755 index 00000000..9d0d1d98 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/multimarkdown.xslt @@ -0,0 +1,481 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- XHTML to MultiMarkdown converter by Fletcher Penney + + modified from: + + XHTML-to-Markdown converter by Andrew Green, Article Seven, + http://www.article7.co.uk/ + + TODO: support for citations + TODO: support for footnotes + TODO: support for tables + TODO: support for definition lists + TODO: support for glossary entries + TODO: support for link/image attributes (and use a reference style link?) + TODO: support for MathML->ASCIIMathML??? + +--> + +<!-- This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. --> +<xsl:stylesheet version="1.0" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:output method="text" encoding="utf-8"/> + + <xsl:strip-space elements="*"/> + + <xsl:variable name="newline"> +<xsl:text> +</xsl:text> + </xsl:variable> + + <xsl:variable name="tab"> + <xsl:text> </xsl:text> + </xsl:variable> + + <xsl:template match="/"> + <xsl:apply-templates select="h:html/h:head"/> + <xsl:apply-templates select="h:html/h:body/node()"> + <xsl:with-param name="context" select="markdown"/> + </xsl:apply-templates> + </xsl:template> + + <xsl:template match="@*"> + <xsl:text> </xsl:text> + <xsl:value-of select="local-name()"/> + <xsl:text>="</xsl:text> + <xsl:value-of select="."/> + <xsl:text>"</xsl:text> + </xsl:template> + + <xsl:template match="text()"> + <!-- it might be possible to use replace-substring to backslash special characters, but that's not implemented yet --> + <xsl:if test="normalize-space(.)"> + <xsl:value-of select="."/> + </xsl:if> + </xsl:template> + + <xsl:template match="text()[parent::h:code[parent::h:pre]]"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:value-of select="."/> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:value-of select="$newline"/> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:value-of select="$newline"/> + <xsl:value-of select="$tab"/> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <xsl:template name="newblock"> + <xsl:param name="context"/> + <xsl:if test="not(not(preceding-sibling::*) and (parent::h:body or parent::h:li))"> + <xsl:value-of select="$newline"/> + <xsl:if test="not(self::h:li) or (self::h:li and h:p)"> + <xsl:value-of select="$newline"/> + </xsl:if> + <xsl:if test="parent::h:blockquote[parent::h:li and preceding-sibling::*] or (parent::h:li and preceding-sibling::*)"> + <xsl:text> </xsl:text> + </xsl:if> + <xsl:if test="not($context = 'html') and parent::h:blockquote"> + <xsl:text>> </xsl:text> + </xsl:if> + </xsl:if> + </xsl:template> + + <!-- if an element isn't templated elsewhere, we move into html context and stay there for any descendent nodes --> + <xsl:template match="h:*"> + <xsl:if test="self::h:h1 or self::h:h2 or self::h:h3 or self::h:h4 or self::h:h5 or self::h:h6 or self::h:p or self::h:pre or self::h:table or self::h:form or self::h:ul or self::h:ol or self::h:address or self::h:blockquote or self::h:dl or self::h:fieldset or self::h:hr or self::h:noscript"> + <xsl:call-template name="newblock"> + <xsl:with-param name="context" select="'html'"/> + </xsl:call-template> + </xsl:if> + <xsl:call-template name="element"/> + </xsl:template> + + <xsl:template name="element"> + <xsl:text><</xsl:text> + <xsl:value-of select="local-name()"/> + <xsl:apply-templates select="@*"/> + <xsl:text>></xsl:text> + <xsl:apply-templates select="node()"> + <xsl:with-param name="context" select="'html'"/> + </xsl:apply-templates> + <xsl:text></</xsl:text> + <xsl:value-of select="local-name()"/> + <xsl:text>></xsl:text> + </xsl:template> + + <xsl:template match="h:div"> + <xsl:apply-templates select="node()"/> + </xsl:template> + + <xsl:template match="h:p"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="newblock"/> + <xsl:apply-templates select="node()"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:h1"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="newblock"/> + <xsl:text># </xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text> #</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:h2"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="newblock"/> + <xsl:text>## </xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text> ##</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:h3"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="newblock"/> + <xsl:text>### </xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text> ###</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:h4"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="newblock"/> + <xsl:text>#### </xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text> ####</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:h5"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="newblock"/> + <xsl:text>##### </xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text> #####</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:h6"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="newblock"/> + <xsl:text>###### </xsl:text> + <xsl:apply-templates select="node()"/> + <xsl:text> ######</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:br"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:text> </xsl:text> + <xsl:value-of select="$newline"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:blockquote"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:if test="node()[1] = text()"> + <xsl:call-template name="newblock"/> + <xsl:text>> </xsl:text> + </xsl:if> + <xsl:apply-templates select="node()"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- this transformation won't backslash the period of a genuine textual newline-number-period combo --> + + <xsl:template match="h:ul | h:ol"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="node()"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:li"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:when test="parent::h:ul"> + <xsl:call-template name="newblock"/> + <xsl:text>* </xsl:text> + <xsl:apply-templates select="node()"/> + </xsl:when> + <xsl:when test="parent::h:ol"> + <xsl:call-template name="newblock"/> + <xsl:value-of select="position()"/> + <xsl:text>. </xsl:text> + <xsl:apply-templates select="node()"/> + </xsl:when> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:pre[h:code]"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="newblock"/> + <xsl:value-of select="$tab"/> + <xsl:apply-templates select="h:code/node()"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:hr"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="newblock"/> + <xsl:text>- - - - - -</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:a[@href]"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>[</xsl:text> + <xsl:apply-templates select="text()"/> + <xsl:text>](</xsl:text> + <xsl:value-of select="@href"/> + <xsl:if test="@title"> + <xsl:text> "</xsl:text> + <xsl:value-of select="@title"/> + <xsl:text>"</xsl:text> + </xsl:if> + <xsl:text>)</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- this transformation won't backslash literal asterisks or underscores in text --> + + <xsl:template match="h:em"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>*</xsl:text> + <xsl:apply-templates select="text()"/> + <xsl:text>*</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:strong"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>**</xsl:text> + <xsl:apply-templates select="text()"/> + <xsl:text>**</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- this transformation won't backslash literal backticks in text --> + + <xsl:template match="h:code"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>`</xsl:text> + <xsl:apply-templates select="text()"/> + <xsl:text>`</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:img[not(@width | @height)]"> + <xsl:param name="context"/> + <xsl:choose> + <xsl:when test="$context = 'html'"> + <xsl:call-template name="element"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>![</xsl:text> + <xsl:value-of select="@alt"/> + <xsl:text>](</xsl:text> + <xsl:value-of select="@src"/> + <xsl:if test="@title"> + <xsl:text> "</xsl:text> + <xsl:value-of select="@title"/> + <xsl:text>"</xsl:text> + </xsl:if> + <xsl:text>)</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="h:head"> + <xsl:apply-templates match="h:meta"/> + <xsl:text> + +</xsl:text> +</xsl:template> + + <xsl:template match="h:head/h:link"> + <xsl:text>css: </xsl:text> + <xsl:value-of select="@href"/> + <xsl:text> +</xsl:text> + </xsl:template> + + <xsl:template match="h:meta"> + <xsl:value-of select="@name"/> + <xsl:text>: </xsl:text> + <xsl:value-of select="@content"/> + <xsl:text> +</xsl:text> + </xsl:template> + + <xsl:template match="h:title"> + <xsl:text>Title: </xsl:text> + <xsl:value-of select="."/> + <xsl:text> +</xsl:text> + </xsl:template> + + + <!-- The following template is taken from the book "XSLT" by Doug Tidwell (O'Reilly and Associates, August 2001, ISBN 0-596-00053-7) --> + <xsl:template name="replace-substring"> + <xsl:param name="original"/> + <xsl:param name="substring"/> + <xsl:param name="replacement" select="''"/> + <xsl:variable name="first"> + <xsl:choose> + <xsl:when test="contains($original, $substring)"> + <xsl:value-of select="substring-before($original, $substring)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$original"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="middle"> + <xsl:choose> + <xsl:when test="contains($original, $substring)"> + <xsl:value-of select="$replacement"/> + </xsl:when> + <xsl:otherwise> + <xsl:text/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="last"> + <xsl:choose> + <xsl:when test="contains($original, $substring)"> + <xsl:choose> + <xsl:when test="contains(substring-after($original, $substring), $substring)"> + <xsl:call-template name="replace-substring"> + <xsl:with-param name="original"> + <xsl:value-of select="substring-after($original, $substring)"/> + </xsl:with-param> + <xsl:with-param name="substring"> + <xsl:value-of select="$substring"/> + </xsl:with-param> + <xsl:with-param name="replacement"> + <xsl:value-of select="$replacement"/> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring-after($original, $substring)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:text/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:value-of select="concat($first, $middle, $last)"/> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/natbib-support.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/natbib-support.xslt new file mode 100755 index 00000000..f7fa5852 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/natbib-support.xslt @@ -0,0 +1,86 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-Article converter by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + Adds support for natbib citations. + + Requires that the following command (or equivalent) be included + in the header: + + \usepackage[round]{natbib} + + + MultiMarkdown Version 2.0.b6 + + $Id: natbib-support.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:html="http://www.w3.org/1999/xhtml" + version="1.0"> + + <xsl:import href="xhtml2latex.xslt"/> + + <xsl:output method='text' encoding='utf-8'/> + + <xsl:strip-space elements="*" /> + + <!-- use \citep by default --> + <xsl:template match="html:span[@class='externalcitation']"> + <xsl:text>\citep</xsl:text> + <xsl:apply-templates select="html:span" mode="citation"/> + <xsl:apply-templates select="html:a" mode="citation"/> + <xsl:text>}</xsl:text> + </xsl:template> + + <xsl:template match="html:span[@class='markdowncitation']"> + <xsl:text>~\citep</xsl:text> + <xsl:apply-templates select="html:span" mode="citation"/> + <xsl:apply-templates select="html:a" mode="markdowncitation"/> + <xsl:text>}</xsl:text> + </xsl:template> + + <!-- use \citet when indicated --> + <xsl:template match="html:span[@class='externalcitation'][child::html:span[position()='1'][@class='textual citation']]"> + <xsl:text>\citet</xsl:text> + <xsl:apply-templates select="html:span" mode="citation"/> + <xsl:apply-templates select="html:a" mode="citation"/> + <xsl:text>}</xsl:text> + </xsl:template> + + <xsl:template match="html:span[@class='markdowncitation'][child::html:span[position()='1'][@class='textual citation']]"> + <xsl:text>~\citet</xsl:text> + <xsl:apply-templates select="html:span" mode="citation"/> + <xsl:apply-templates select="html:a" mode="markdowncitation"/> + <xsl:text>}</xsl:text> + </xsl:template> + + <!-- Disable the text (not used for LaTeX output) --> + <xsl:template match="html:span[@class='textual citation']" mode="citation"> + <xsl:text></xsl:text> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/opml2mmd.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/opml2mmd.xslt new file mode 100755 index 00000000..ca77d5d3 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/opml2mmd.xslt @@ -0,0 +1,112 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- OPML-to-text converter by Fletcher Penney + + +--> + +<!-- +# Copyright (C) 2010 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:output method="text" encoding="utf-8"/> + + <xsl:preserve-space elements="*"/> + + <xsl:template match="/opml"> + <xsl:apply-templates select="head/titledisabled"/> + <xsl:apply-templates select="/opml/body/outline[last()]" mode="meta"/> + <xsl:apply-templates select="body"/> + </xsl:template> + + <xsl:template match="title"> + <xsl:text>Title: </xsl:text> + <xsl:value-of select="."/> + <xsl:text> +</xsl:text> + </xsl:template> + + <xsl:template match="body"> + <xsl:param name="header"/> + <xsl:text> + +</xsl:text> + <xsl:apply-templates select="outline"> + <xsl:with-param name="header" select="concat($header,'#')"/> + </xsl:apply-templates> + </xsl:template> + + <xsl:template match="outline"> + <xsl:param name="header"/> + <xsl:value-of select="concat($header,' ')"/> + <xsl:value-of select="@text"/> + <xsl:value-of select="concat(' ',$header)"/> + <xsl:text> + +</xsl:text> + <xsl:value-of select="@_note"/> + <xsl:text> + +</xsl:text> + <xsl:apply-templates select="outline"> + <xsl:with-param name="header" select="concat($header,'#')"/> + </xsl:apply-templates> + </xsl:template> + + <xsl:template match="/opml/body/outline[last()]"> + <xsl:if test="not(translate(@text,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'metadata')"> + <xsl:apply-templates select="outline" mode="metadata"/> + <xsl:param name="header"/> + <xsl:value-of select="concat($header,' ')"/> + <xsl:value-of select="@text"/> + <xsl:value-of select="concat(' ',$header)"/> + <xsl:text> + + </xsl:text> + <xsl:value-of select="@_note"/> + <xsl:text> + + </xsl:text> + <xsl:apply-templates select="outline"> + <xsl:with-param name="header" select="concat($header,'#')"/> + </xsl:apply-templates> + </xsl:if> + </xsl:template> + + <xsl:template match="/opml/body/outline[last()]" mode="meta"> + <xsl:if test="(translate(@text,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'abcdefghijklmnopqrstuvwxyz') = 'metadata')"> + <xsl:apply-templates select="outline" mode="metadata"/> + </xsl:if> + </xsl:template> + + <xsl:template match="outline" mode="metadata"> + <xsl:value-of select="@text"/> + <xsl:text>: </xsl:text> + <xsl:value-of select="@_note"/> + <xsl:text> +</xsl:text> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/s5.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/s5.xslt new file mode 100755 index 00000000..7b88dfc9 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/s5.xslt @@ -0,0 +1,157 @@ +<?xml version='1.0' encoding='utf-8'?> + +<!-- XHTML-to-S5 converted by Fletcher Penney + specifically designed for use with MultiMarkdown created XHTML + + MultiMarkdown Version 2.0.b6 + + $Id: s5.xslt 499 2008-03-23 13:03:19Z fletcher $ +--> + +<!-- +# Copyright (C) 2005-2008 Fletcher T. Penney <fletcher@fletcherpenney.net> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA +--> + +<!-- + TODO: an option to select what h-level should be slides (for instance, if h2, then each h1 would be a slide, containing list of h2's. Then h2's converted into slides.... + + --> + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xhtml="http://www.w3.org/1999/xhtml" + xmlns="http://www.w3.org/1999/xhtml" + exclude-result-prefixes="xhtml xsl" + version="1.0"> + + <xsl:output method='xml' encoding='utf-8' indent="yes"/> + + <xsl:strip-space elements="*" /> + + <xsl:variable name="theme">default</xsl:variable> + + <xsl:param name="match"/> + + <xsl:template match="/"> + <html> + <xsl:apply-templates select="node()"/> + </html> + </xsl:template> + + <xsl:template match="xhtml:head"> + <head> + <xsl:apply-templates select="xhtml:meta"/> + <xsl:apply-templates select="node()"/> + <meta name="version" content="S5 1.1" /> + <meta name="generator" content="MultiMarkdown"/> + <meta name="controlVis" content="hidden"/> + <link rel="stylesheet" href="ui/{$theme}/slides.css" type="text/css" media="projection" id="slideProj" /> + <link rel="stylesheet" href="ui/default/outline.css" type="text/css" media="screen" id="outlineStyle" /> + <link rel="stylesheet" href="ui/default/print.css" type="text/css" media="print" id="slidePrint" /> + <link rel="stylesheet" href="ui/default/opera.css" type="text/css" media="projection" id="operaFix" /> + <script src="ui/default/slides.js" type="text/javascript"></script> + </head> + </xsl:template> + + <xsl:template match="xhtml:title"> + <title><xsl:value-of select="."/> + + + + +

    +
    +
    + + +
    +
    +
    +

    +

    +

    + +

    + + + +

    + +

    +

    + +

    +
    + + +
    + + + + + +
    +

    + + +
    +
    + + +
    +

    + + +
    +
    + + + + + + + + + + +
  • + +
  • +
    + + + +
      + +
    +
    + + +
      + +
    +
    + + + diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/science.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/science.xslt new file mode 100755 index 00000000..178ced85 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/science.xslt @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + \documentclass[oneside,article,9pt]{memoir} +\usepackage{layouts}[2001/04/29] +\usepackage{science} +\usepackage{xmpincl} % Seems to be required to get the pdf to generate?? + +\def\revision{} + + + + + + + + + + + \begin{abstract} + + \addcontentsline{toc}{section}{ + + } + + +\begin{body} + +% Layout settings +\setlength{\parindent}{1em} + +\section{ + + } + + + \label{ + + } + + + + + + + \end{abstract} + +\begin{body} + +% Layout settings +\setlength{\parindent}{1em} + + + \section{ + + } + + \label{ + + } + + + + + + \subsection*{ + + } + + \label{ + + } + + + + + + + \begin{verbatim} + + + + +\end{verbatim} + + + + + \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/sffms-no-chapter-titles.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/sffms-no-chapter-titles.xslt new file mode 100755 index 00000000..4c4ee243 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/sffms-no-chapter-titles.xslt @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + \chapter*{ + + } + + \label{ + + } + + + + + \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/sffms.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/sffms.xslt new file mode 100755 index 00000000..af54350f --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/sffms.xslt @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + + + + \end{document} + + + + + \documentclass[courier,novel]{sffms} + + + + + + + + + +\begin{document} + + + + + + + + + + + + + + + + + + + + + + + + + + + \chapter*{ + + } + + \label{ + + } + + + + + + \chapter{ + + } + + \label{ + + } + + + + + + \newscene + + + + + + + + + + + + + + + + + + \begin{verbatim} + + + + + \end{verbatim} + + + + + + \title{ + + + + + + } + + + + + + + \author{ + + + + + + } + + + + \def\latexauthor{ + + } + + + + \authorname{ + + + + + + } + + + + \title{ + + + + + + + + + + + + + + \\ + + + } + + + + \runningtitle{ + + + + + + } + + + + \surname{ + + + + + + } + + + + \address{ + + + + + + + + + + + + + + \\ + + + } + + + + \wordcount{ + + + + + + } + + + + + + + + + + ( + + + + + + ) + + + + + \underline{ + + } + + + + + \textbf{ + + } + + + \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/snippet.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/snippet.xslt new file mode 100755 index 00000000..a2d32456 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/snippet.xslt @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-google-docs.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-google-docs.xslt new file mode 100755 index 00000000..efb6aef6 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-google-docs.xslt @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Bibliography

    +
      + +
    +
    + + +
  • + [# + + ] + +
  • +
    + + + + + + + + + + + # + + + + +
    \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-poetry-support.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-poetry-support.xslt new file mode 100755 index 00000000..477d703a --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-poetry-support.xslt @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +					
    +				
    +
    + + + + + +
    +
    + + + + + +
    \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-static-site.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-static-site.xslt new file mode 100755 index 00000000..4bc727fc --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-static-site.xslt @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + ]]> + +

    +
    + +
    +
    +
    + + ]]> + + + ]]> +
    +
    + + +
    \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc-h2.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc-h2.xslt new file mode 100755 index 00000000..da05e504 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc-h2.xslt @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Table of Contents

    + +
      + + +
    + +
    +
    + + + + + + + + + + + +
  • + + + + + +
      + + +
    + +
    +
  • +
    + + + + + + +
  • + + + +
  • +
    + + + + + + + + +  ↩ + + + + + + + + + +  ↩ + + + +
    \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc.xslt new file mode 100755 index 00000000..2d49746d --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc.xslt @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Table of Contents

    + +
      + + +
    + +
    +
    + + + + + + + + + + + +
  • + + + + + +
      + + +
    + +
    +
  • +
    + + + + + + +
  • + + + +
  • +
    + + + + + + + + +  ↩ + + + + + + + + + +  ↩ + + + +
    \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2latex.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2latex.xslt new file mode 100755 index 00000000..a95371ac --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2latex.xslt @@ -0,0 +1,1238 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \def\mytitle{ + + + + + + } + + + + + + + + \def\myauthor{ + + + + + + } + + + + \def\latexauthor{ + + } + + + + \date{ + + + + + + } +\def\mydate{ + + + + + + } + + + + \def\affiliation{ + + + + + + + + + + + + + + \\ + + + } + + + + \def\revision{Revision: + + + + + + } + + + + \def\email{ \href{mailto: + + + + + + + + + + + + + + \\ + + + }{ + + + + + + + + + + + + + + \\ + + + }} + + + + \def\web{\href{ + + http:// + + + + + + + + + + + + + + + \\ + + + }{ + + + + + + + + + + + + + + \\ + + + }} + + + + \def\mykeywords{ + + + + + + ,, + + + , + + + } + + + + \usepackage{xmpincl} +\includexmp{ + + + + + + } + + + + \def\bibliocommand{\bibliography{ + + + + + + }} + + + + \def\mybibliostyle{ + + + + + + } + + + + + + + + + + + \def\mychapterstyle{ + + + + + + } + + + + \def\mypagestyle{ + + + + + + } + + + + \def\mycopyright{ + + + + + + + + + + + + + + \\ + + + } + + + + \def\myclosing{ + + + + + + + + + + + + + + \\ + + + } + + + + \def\ + + { + + + + + + + + + + + + + + \\ + + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +% Title Page + +\maketitle + + + + + + + % Copyright Page +\ifx\mycopyright\undefined +\else + \textcopyright{} \mycopyright +\fi + + + + + + + + % +% Main Content +% + + + + + + + + + + + + + + + + + + + + + + + + \renewcommand\refname{ + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + description= + + } + + + + + + + + \\ +\\ + + + + + + + + + + + {name= + + , + + + + sort= + + , + + + + + + + + + + + + + + + + \footnote{ + + + + } + + + + \glossary + + + + + + + + + + + + + \url{ + + + + + + } + + + + + \href{ + + }{ + + + + + + } + + + + + + + \autoref{ + + } + + + + (\autoref{ + + }) + + + + + + + \href{ + + }{ + + + + + + }\footnote{\href{ + + }{ + + + + + + }} + + + + + + + \begin{enumerate} + + + + \end{enumerate} + + + + + + + \begin{itemize} + + + + \end{itemize} + + + + + + + +\item + + + + + + \begin{description} + + \end{description} + + + + + \item[ + + ] + + + + + + + + + + + \texttt{ + + } + + + + + \\ + + + + + \begin{quotation} + + + \end{quotation} + + + + + + + {\itshape + + } + + + + + \textbf{ + + } + + + + + \vskip 2em +\hrule height 0.4pt +\vskip 2em + + + + + + + \begin{figure} + + \begin{center} + + + + + \resizebox{ + + + + + + + + px + + + pt + + + + + pt + + + + ! + + + }{ + + + + + + + + px + + + pt + + + + + pt + + + + ! + + + }{ + + + + \resizebox{1\linewidth}{!}{ + + \includegraphics{ + + }} +\end{center} + + + + \caption{ + + } + + + + + \label{ + + } + + + \end{figure} + + + + + + + + + + + + + + \begin{table}[htbp] +\begin{minipage}{\linewidth} +\centering + + + \begin{tabular}{@{}p{0.5\linewidth}@{}} \\ \toprule + + + + \end{tabular} +\end{minipage} +\end{table} + + + + + + + \begin{table}[htbp] +\begin{minipage}{\linewidth} +\setlength{\tymax}{0.5\linewidth} +\centering +\small + + + \begin{tabulary}{\linewidth}{@{} + + @{}} \\ \toprule + + + + \end{tabulary} +\end{minipage} +\end{table} + + + + + + + \bottomrule + + + + + + + + C + + + c + + + + + + + R + + + r + + + + + + + J + + + l + + + + + + + + + \midrule + + + + + \caption{ + + } + + + \label{ + + } + + + + + + + + + \\ + + + + + + + + + + + \cmidrule{ + + - + + } + + + + + + + + + + + \\ + + + + + \\ + + + + + + \multicolumn{ + + + + }{c}{ + + + + } + + + & + + + + + + + \cite + + + } + + + + ~\cite + + + } + + + + ~\nocite{ + + } + + + + { + + + + + { + + + + + [ + + ] + + + + + + + + + \begin{thebibliography}{ + + } + + + + +\end{thebibliography} + + + + + + + +\bibitem{ + + } + + + + + + + + + + + + + \usepackage{fancyvrb} % Allow \verbatim et al. in footnotes +\usepackage{graphicx} % To include graphics in pdf's (jpg, gif, png, etc) +\usepackage{booktabs} % Better tables +\usepackage{tabulary} % Support longer table cells +\usepackage[utf8]{inputenc} % For UTF-8 support +\usepackage[T1]{fontenc} % Use T1 font encoding for accented characters +\usepackage{xcolor} % Allow for color (annotations) + +%\geometry{landscape} % Activate for rotated page geometry + +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty + % line rather than an indent + + +\def\myauthor{Author} % In case these were not included in metadata +\def\mytitle{Title} +\def\mykeywords{} +\def\mybibliostyle{plain} +\def\bibliocommand{} + +\VerbatimFootnotes + + + + + + +% +% PDF Stuff +% + +%\ifpdf % Removed for XeLaTeX compatibility +% \pdfoutput=1 % Removed for XeLaTeX compatibility + \usepackage[ + plainpages=false, + pdfpagelabels, + pdftitle={\mytitle}, + pagebackref, + pdfauthor={\myauthor}, + pdfkeywords={\mykeywords} + ]{hyperref} + \usepackage{memhfixc} +%\fi % Removed for XeLaTeX compatibility + + +% +% Title Information +% + + +\ifx\latexauthor\undefined +\else + \def\myauthor{\latexauthor} +\fi + +\ifx\subtitle\undefined +\else + \addtodef{\mytitle}{}{ \\ \subtitle} +\fi + +\ifx\affiliation\undefined +\else + \addtodef{\myauthor}{}{ \\ \affiliation} +\fi + +\ifx\address\undefined +\else + \addtodef{\myauthor}{}{ \\ \address} +\fi + +\ifx\phone\undefined +\else + \addtodef{\myauthor}{}{ \\ \phone} +\fi + +\ifx\email\undefined +\else + \addtodef{\myauthor}{}{ \\ \email} +\fi + +\ifx\web\undefined + \else + \addtodef{\myauthor}{}{ \\ \web} +\fi + +\title{\mytitle} +\author{\myauthor} + +\begin{document} + + + + + + + + % Bibliography +\bibliographystyle{\mybibliostyle} +\bibliocommand + +\end{document} + + + + + + + {\color[HTML]{ + + + + + + color:# + + + + + + } + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2rtf.xslt b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2rtf.xslt new file mode 100755 index 00000000..9040a1b3 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2rtf.xslt @@ -0,0 +1,540 @@ + + + + + + + + + + + + + + + + + + + + + + +\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\fonttbl{\f0\froman Times;} +{\f1\fmodern Courier;}} +{\stylesheet{\s0\f0\fs24\qj\sb280\sa280 Normal;} +{\s1\fs48\f0\sb280\sa280 Header1;} +{\s2\fs40\f0\sb280\sa280 Header2;} +{\s3\fs32\f0\sb280\sa280 Header3;} +{\s4\fs24\f0\sb280\sa280 Header4;} +{\s5\fs24\f0\sb280\sa280 Header5;} +{\s6\fs24\f0\sb280\sa280 Header6;} +{\s7\f1\fs20 Mono;} +} +{\colortbl;\red255\green255\blue255;} +{\info + + + + + }\margl1440\margr1440 +\f0\pard\sa280 + + + + + } + + + + {\title + + + + + + } + + + + + + + {\author + + + + + + } + + + + {\*\company + + + + + + + + + + + + + + + + + } + + + + {\keywords + + + + + + ,, + + + , + + + } + + + + {\*\copyright + + + + + + + + + + + + + + + + + } + + + + + + + + + \s0\qj + + \ + + + + + + +\i + + +\i0 + + + + + +\b + + +\b0 + + + + + +\s1 {\*\bkmkstart }{\*\bkmkend } + + + + +\s2 {\*\bkmkstart }{\*\bkmkend } + + + + +\s3 + + + + +\s4 + + + + +\s5 + + + + +\s6 + + + + + \line + + + + + + + + +\lin\rin750 + + + + \lin0\rin0 + + + + +\lin\rin750 + + + + \lin0\rin0 + + + + + + + + + + + {\super \chftn{\*\footnote{ + + + + }}} + + + + {\super \chftn{\*\footnote{ + + + + }}} + + + + + + + + + \url{ + + + + + + } + + + + + {\field{\*\fldinst{HYPERLINK " + + "}}{\fldrslt \b \cf0 + + + + + + }} + + + + + {\field{\*\fldinst REF + + }{\fldrslt \b \cf0 + + + + + + }} + + + + + {\field{\*\fldinst{HYPERLINK " + + "}}{\fldrslt \b \cf0 + + + + + + }}{\super \chftn{\*\footnote{ + + + + + + }}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ + + + + + + + + : + + + + + + + + + {\super \chftn{\*\footnote{ + + + + }}} + + + + + + + + + + + + + + + + \f1\fs20 + + \f0\fs24 + + + + + + + + + \f1\fs20 + + \f0\fs24 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/base.css b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/base.css new file mode 100755 index 00000000..21d3bd9d --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/base.css @@ -0,0 +1,375 @@ +/* + base.css + MultiMarkdown Zettel rendering + + Created by Christian Tietze on 2010-09-28. + http://christiantietze.de +*/ + +/* based on: + * base.css | v0.4 (06132010) | Thierry Koblentz + * See: http://thinkvitamin.com/design/setting-rather-than-resetting-default-styling/ + * typography guide: + * Azbuka - CSS Typographical Base Rendering Library + * http://code.google.com/p/azbuka/ + */ + +/* HTML 5 fix */ +header, nav, article, footer, aside, address, section { display: block; } + +/* * * * * * + * + * T Y P O G R A P H Y + * + */ + +/* using height:100% on html and body allows to style containers with a 100% height + * the overflow declaration is to make sure there is a gutter for the scollbar in all browsers regardless of content + * note that there is no font-size declaration set in this rule. If you wish to include one, you should use font-size: 100.01% to prevent bugs in IE and Opera + */ +html { + height: 100%; + overflow-y: scroll; + font-size: 100.01%; +} +/* not all browsers set white as the default background color + * color is set to create not too much contrast with the background color + * line-height is to ensure that text is legible enough (that there is enough space between the upper and lower line) + */ +body { +/* height: 100%;*/ +/* font-size: 0.8125em; */ + line-height: 1.618em; /* 13px, golden rule line-height */ + font-size-adjust:none; + font-style:normal; + font-variant:normal; + font-weight:normal; +} + +/* this choice of font-family is supposed to render text the same across platforms + * letter-spacing makes the font a bit more legible + * + * See Eric Meyer's article about Fixed Monospace Sizing + * http://meyerweb.com/eric/thoughts/2010/02/12/fixed-monospace-sizing/ + */ + +body, input, button, textarea, select, h1, h2, h3, h4, h5, h6 { + font-family: Georgia, "DejaVu Serif", serif; + letter-spacing: .05em; +} +pre, tt, code, kbd, samp, var { + font-family: "Anonymous Pro", "Courier New", Courier, monospace, serif; +} + +/* These should be self explanatory + */ +/* h1 { font-size: 2.615em; line-height: 1.18; } /* 34px */ +h1 { font-size: 2em; line-height: 1.19; } /* 26px */ +h2 { font-size: 1.618em; line-height: 1.24; } /* 21 */ +h3 { font-size: 1.308em; line-height: 1.23; } /* 17*/ +h4, h5, h6 { font-size: 1em; line-height: 1.3; font-weight: 700; } /* 13px */ + +h2, h3, h4, h5 { font-weight: normal; } + +/* styling for links and visited links as well as for links in a hovered, focus and active state + * make sure to keep these rules in that order, with :active being last + * text-decoration: none is to make the links more legible while they are in a hovered, focus or active state + * a:focus and :focus are used to help keyboard users, you may change their styling, but make sure to give users a visual clue of the element's state. + * outline:none used with the pseudo-class :hover is to avoid outline when a user clicks on links + * note that these last rules do not do anything in IE as this browser does not support "outline" + */ +a:link {text-decoration: none;border-bottom: 1px solid #000;color: #000;} +a:visited {} +a:hover {border-bottom-color: transparent;} +a:focus {text-decoration: none;} +a:focus,:focus {outline: 1px dotted #000;} +a:hover,a:active {outline: none;} + +/* + * This one is commented out as it may be overkill (users who use both a mouse and the keyboard would lose keyboard focus) + * Besides, this may create a performance issue + * html:hover a {outline: none;} + */ + +/* margin and padding values are reset for all these elements + * you could remove from there elements you do not used in your documents, but I don't think it'd worth it + */ +p, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, blockquote, th, td { + margin: 0; + padding: 0; +} + +body { padding: 0.8125em 0; } + +/* this is to prevent border from showing around fieldsets and images (i.e., images inside anchors) + */ +fieldset, img { + border: 0; +} + +/* to prevent a gap from showing below images in some browsers + */ +img {vertical-align: bottom;} + +/* Styling of list items + * This styles sheet contains a class to apply on lists to reset list-type and margin on LIs + */ +ol li, +ul ol li {list-style-type: decimal;} +ul li {list-style-type: disc;} +ul ul li {list-style-type: circle;} +ul ul ul li {list-style-type: square;} +ol ol li {list-style-type: lower-alpha;} +ol ol ol li {list-style-type: lower-roman;} + +/* These should be self explanatory + * I believe *most* UAs style sub and sup like this by default so I am not sure there is value to include these rules here + */ +sub { + vertical-align: sub; + font-size: smaller; +} + +sup { + vertical-align: super; + font-size: smaller; +} + +/* color is to make that element stands out (see color set via body) + * padding is used so Internet Explorer does not cut-off descenders in letters like p, g, etc.) + */ +legend { + color: #000; + padding-bottom: .5em; +} + +/* according to Eric Meyer's reset: tables still need 'cellspacing="0"' in the markup + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* caption and summary are very important for tabular data but because caption is nearly impossible to style across browsers many authors do not use it or use display:none to "hide" it (which is almost the same as not using it). + * so to prevent such workaround, I am positioning this element off-screen + */ +caption { + position: absolute; + left: -999em; +} + +/* all th should be centered unless they are in tbody (table body) + */ +th {text-align: center;} +tbody th {text-align: left;} + +/* code {color: #06f;} */ +code { background: rgba(255,255,255,0.8); padding: 0 0.404em; } +pre code { padding: 0; } +code, pre { font-size: 1em;} + +/* This should be self explanatory + */ +blockquote, q, em, cite, dfn, i, cite, var, address { + font-style: italic; +} + +blockquote em, q em, cite em { + margin-left: 0.3em; + letter-spacing: 0.2em; + word-spacing: 0.3em; +} + +/* to prevent some browsers from inserting quotes on "q" and "p" ("p" in blockquotes) + */ +blockquote p:before, blockquote p:after, q:before, q:after {content: '';} + +/* These should be self explanatory + */ +th, strong, dt, b { + font-weight: bold; +} + +ins { + text-decoration: none; + border-bottom: 3px double #333; +} + +del {text-decoration: line-through;} + +abbr { + border-bottom: 1px dotted #333; + font-variant: normal; +} + +/* Creating white space (vertical gutters) via padding + * most authors do not set right/left padding or margin on these elements, they rather use an extra wrapper or style the container with padding to create the left and right gap/gutter they need + * I find that the latter creates less robust layouts because it leads authors to mix padding with width which creates issue with the broken box model (IE5 or IE6 in quirks mode) + * so imho, setting this style using the child combinator (i.e., div > h1) should be the best way to do it, but unfortunately IE 6 does not support such syntax, so I have to go with the following + a reset (see next rule) + * + * Only applicable for non-iOS devices to preserve screen real estate. + */ +@media screen and (min-device-width: 480px) { +h1, h2, h3, h4, h5, h6, p, pre, ul, ol, dl, fieldset, address {padding:0 30px;} +} + +/* this is to reset the left/right gaps (created by the previous and next rules) on nested elements + */ +dd p, dd pre, dd ul, dd ol, dd dl, li p, li pre, li ul, li ol, li dl, fieldset p, fieldset ul, fieldset ol, blockquote p { + padding-right: 0; + padding-left: 0; +} + +ul { list-style-position:outside; } +li ul, +li ol { margin:0 1.618em; } +ul, ol { margin: 0 0 1.618em 0; } + +dl { margin: 0 0 1.618em 0; } +dl dt { font-weight: 700; } +dl dd { margin-left: 1.618em; } + +/* These should be self explanatory + */ +dd { + padding-left: 20px; + margin-top: .5em; +} + +/* we cannot use padding on a table to create left and right gaps (as we do with the elements above), instead we use margin + */ +table { + margin-right: 30px; + margin-left: 30px; +} + +/* we use margin for hr for the same reason we do for table + */ +hr { + margin-right: 30px; + margin-left: 30px; + border-style: inset; + border-width: 1px; + margin-bottom:1.618em; +} + +/* same here for blockquote to display a decent border */ +blockquote { margin-left: 30px; border-left: 0.8125em solid #ddd; padding-left: 0.8125em;} + +/* --top-- bottom margin solution */ +/* this is my approach to create white space between elements, you do not have to adhere to it + * rather than styling these elements with top and bottom margin, or simply bottom margin I only use top margin + */ +h1, h2, h3, h4, h5, h6 { margin-bottom: 5px;} +pre, dl, legend, input, button, textarea, select, address, table { margin-bottom: 1.618em; } +p { margin-bottom: 0.8125em; } + +/* top padding solution */ +/* this is a different approach which may be less frustrating for novice because it avoids running into collapsing margin and allows to clear floats while preserving space above the element + * if you decide to give this a try, then comment out the above rule and uncomment the two next ones + */ + /* + h1, h2, h3, h4, h5, h6, p, pre, dt, dd, li, legend, address {padding-top: 1.2em;} + hr, input, button, textarea, select, table {margin-top: 1.2em;} + */ + +address { margin-top:1.618em; font-style: italic; } + + +/* * * * * * + * + * F O R M E L E M E N T S + * + */ + +/* this should not affect the layout of the labels unless you style them in a way that padding applies + * if I include this here it is mostly because when labels are styled with float and clear, top padding creates a gap between labels (bottom margin would, but not top margin) + */ +label {padding-top: 1.618em;} + +/* line height helps to set the vertical alignment of radio buttons and check boxes (remember to group these in fieldsets) + */ +fieldset {line-height: 1;} + +/* vertical alignment of checkboxes (a different value is served to IE 7) + */ +input[type="checkbox"] { + vertical-align: bottom; + *vertical-align: baseline; +} + +/* vertical alignment of radio buttons + */ +input[type="radio"] {vertical-align: text-bottom;} + +/* vertical alignment of input fields for IE 6 + */ +input {_vertical-align: text-bottom;} + +/* a specific font-size is set for these elements + * the line-height is to override FF's default styling + */ +input, button, textarea, select, optgroup, option { + font-size: .9em; + line-height: 1.4 !important; +} + +/* this is to fix IE 6 and 7 which create extra right/left padding on buttons + * IMPORTANT: because IE 6 does not understand the first selector below, you need to apply the class "inputButton" to all input of type="button" in your documents + * the first declaration is for IE 6 and 7, the second one for IE 6 only, the third one is for all browsers. + */ +button, +input[type="submit"], +input[type="reset"], +input[type="button"], +.inputButton { + *overflow: visible; + _width: 0; + padding: .2em .4em; +} + + +/* * * * * * + * + * C L A S S E S + * + */ + +/* to style elements with the default padding and margin we set on headings, paragraphs, lists, etc. + * for example, this class could be used on a DIV inside a blockquote or a DIV inside a FORM, etc. + */ +.block { + padding: 0 30px; + margin-top: 1.618em; +} + +/* to swap padding for margin + * for example, this class could be used on a heading you'd style with a bottom border + */ +.padding2margin { + margin-right: 30px; + margin-left: 30px; + padding-right: 0; + padding-left: 0; +} + +/* list items are styled by default with markers (disc, etc.) and left margin + * if you apply the class "noMarker" to a list, its items won't display markers and won't have left margin + */ +.noMarker li { + list-style: none; + margin-left: 0; +} + +.footnotes ol { + list-style-position: inside; +} + +sup.footnote { + line-height: 0px; +} + +/* ease clickability */ +sup.footnote a { + padding: 0.1em 0.15em; +} \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/ASCIIMathML.pm b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/ASCIIMathML.pm new file mode 100755 index 00000000..ce568723 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/ASCIIMathML.pm @@ -0,0 +1,1785 @@ +package Text::ASCIIMathML; + +=pod +=head1 NAME + +Text::ASCIIMathML - Perl extension for parsing ASCIIMathML text into MathML + +=head1 SYNOPSIS + + use Text::ASCIIMathML; + + $parser=new Text::ASCIIMathML(); + + $parser->SetAttributes(ForMoz => 1); + + $ASCIIMathML = "int_0^1 e^x dx"; + $mathML = $parser->TextToMathML($ASCIIMathML); + $mathML = $parser->TextToMathML($ASCIIMathML, [title=>$ASCIIMathML]); + $mathML = $parser->TextToMathML($ASCIIMathML, undef, [displaystyle=>1]); + + $mathMLTree = $parser->TextToMathMLTree($ASCIIMathML); + $mathMLTree = $parser->TextToMathMLTree($ASCIIMathML, [title=>$ASCIIMathML]); + $mathMLTree = $parser->TextToMathMLTree($ASCIIMathML,undef,[displaystyle=>1]); + + $mathML = $mathMLTree->text(); + $latex = $mathMLTree->latex(); + +=head1 DESCRIPTION + +Text::ASCIIMathML is a parser for ASCIIMathML text which produces +MathML XML markup strings that are suitable for rendering by any +MathML-compliant browser. + +The parser uses the following attributes which are settable through +the SetAttributes method: + +=over 4 + +=item C + +Specifies that the fonts should be optimized for Netscape/Mozilla/Firefox. + +=back + +The output of the TextToMathML method always follows the schema + ... +The first argument of TextToMathML is the ASCIIMathML text to be +parsed into MathML. The second argument is a reference to an array of +attribute/value pairs to be attached to the node and the third +argument is a reference to an array of attribute/value pairs for the + node. Common attributes for the node are "title" and +"xmlns"=>"&mathml;". Common attributes for the node are +"mathcolor" (for text color), "displaystyle"=>"true" for using display +style instead of inline style, and "fontfamily". + +=head2 ASCIIMathML markup + +The syntax is very permissive and does not generate syntax +errors. This allows mathematically incorrect expressions to be +displayed, which is important for teaching purposes. It also causes +less frustration when previewing formulas. + +If you encode 'x^2' or 'a_(mn)' or 'a_{mn}' or '(x+1)/y' or 'sqrtx', +you pretty much get what you expect. The choice of grouping +parenthesis is up to you (they don't have to match either). If the +displayed expression can be parsed uniquely without them, they are +omitted. Most LaTeX commands are also supported, so the last two +formulas above can also be written as '\frac{x+1}{y}' and '\sqrt{x}'. + +The parser uses no operator precedence and only respects the grouping +brackets, subscripts, superscript, fractions and (square) roots. This +is done for reasons of efficiency and generality. The resulting MathML +code can quite easily be processed further to ensure additional +syntactic requirements of any particular application. + +=head3 The grammar + +Here is a definition of the grammar used to parse +ASCIIMathML expressions. In the Backus-Naur form given below, the +letter on the left of the C<::=> represents a category of symbols that +could be one of the possible sequences of symbols listed on the right. +The vertical bar C<|> separates the alternatives. + +=over 4 + + c ::= [A-z] | numbers | greek letters | other constant symbols + (see below) + u ::= 'sqrt' | 'text' | 'bb' | other unary symbols for font commands + b ::= 'frac' | 'root' | 'stackrel' | 'newcommand' | 'newsymbol' + binary symbols + l ::= ( | [ | { | (: | {: left brackets + r ::= ) | ] | } | :) | :} right brackets + S ::= c | lEr | uS | bSS | "any" simple expression + E ::= SE | S/S |S_S | S^S | S_S^S expression (fraction, sub-, + super-, subsuperscript) + +=back + +=head3 The translation rules + +Each terminal symbol is translated into a corresponding MathML +node. The constants are mostly converted to their respective Unicode +symbols. The other expressions are converted as follows: + +=over 4 + + lSr -> lSr + (note that any pair of brackets can be used to + delimit subexpressions, they don't have to match) + sqrt S -> S' + text S -> S' + "any" -> any + frac S1 S2 -> S1' S2' + root S1 S2 -> S2' S1' + stackrel S1 S2 -> S2' S1' + S1/S2 -> S1' S2' + S1_S2 -> S1 S2' + S1^S2 -> S1 S2' + S1_S2^S3 -> S1 S2' S3' or + S1 S2' S3' (in some cases) + S1^S2_S3 -> S1 S3' S2' or + S1 S3' S2' (in some cases) + +=back + +In the rules above, the expression C is the same as C, except that if +C has an outer level of brackets, then C is the expression inside +these brackets. + +=head3 Matrices + +A simple syntax for matrices is also recognized: + + l(S11,...,S1n),(...),(Sm1,...,Smn)r + or + l[S11,...,S1n],[...],[Sm1,...,Smn]r. + +Here C and C stand for any of the left and right +brackets (just like in the grammar they do not have to match). Both of +these expressions are translated to + + lS11... + S1n... + Sm1... + Smnr. + +Note that each row must have the same number of expressions, and there +should be at least two rows. + +LaTeX matrix commands are not recognized. + +=head3 Tokenization + +The input formula is broken into tokens using a "longest matching +initial substring search". Suppose the input formula has been +processed from left to right up to a fixed position. The longest +string from the list of constants (given below) that matches the +initial part of the remainder of the formula is the next token. If +there is no matching string, then the first character of the remainder +is the next token. The symbol table at the top of the ASCIIMathML.js +script specifies whether a symbol is a math operator (surrounded by a +C<< >> tag) or a math identifier (surrounded by a C<< >> +tag). For single character tokens, letters are treated as math +identifiers, and non-alphanumeric characters are treated as math +operators. For digits, see "Numbers" below. + +Spaces are significant when they separate characters and thus prevent +a certain string of characters from matching one of the +constants. Multiple spaces and end-of-line characters are equivalent +to a single space. + +=head3 Numbers + +A string of digits, optionally followed by a decimal point (a period) +and another string of digits, is parsed as a single token and +converted to a MathML number, i.e., enclosed with the C<< >> +tag. + +=head3 Greek letters + +=over 4 + +=item Lowercase letters + +C C C C C C C C +C C C C C C C C C +C C C C C C + +=item Uppercase letters + +C C C C C C C C +C C + +=item Variants + +C C C + +=back + +=head3 Standard functions + +sin cos tan csc sec cot sinh cosh tanh log ln det dim lim mod gcd lcm +min max + +=head3 Operation symbols + + Type Description Entity + + + + + - - - + * Mid dot ⋅ + ** Star ⋆ + // / / + \\ \ \ + xx Cross product × + -: Divided by ÷ + @ Compose functions ∘ + o+ Circle with plus ⊕ + ox Circle with x ⊗ + o. Circle with dot ⊙ + sum Sum for sub- and superscript ∑ + prod Product for sub- and superscript ∏ + ^^ Logic "and" ∧ + ^^^ Logic "and" for sub- and superscript ⋀ + vv Logic "or" ∨ + vvv Logic "or" for sub- and superscript ⋁ + nn Logic "intersect" ∩ + nnn Logic "intersect" for sub- and superscript ⋂ + uu Logic "union" ∪ + uuu Logic "union" for sub- and superscript ⋃ + +=head3 Relation symbols + + Type Description Entity + = = = + != Not equals ≠ + < < < + > > > + <= Less than or equal ≤ + >= Greater than or equal ≥ + -lt Precedes ≺ + >- Succeeds ≻ + in Element of ∈ + !in Not an element of ∉ + sub Subset ⊂ + sup Superset ⊃ + sube Subset or equal ⊆ + supe Superset or equal ⊇ + -= Equivalent ≡ + ~= Congruent to ≅ + ~~ Asymptotically equal to ≈ + prop Proportional to ∝ + +=head3 Logical symbols + + Type Description Entity + and And " and " + or Or " or " + not Not ¬ + => Implies ⇒ + if If " if " + iff If and only if ⇔ + AA For all ∀ + EE There exists ∃ + _|_ Perpendicular, bottom ⊥ + TT Top ⊤ + |-- Right tee ⊢ + |== Double right tee ⊨ + +=head3 Grouping brackets + + Type Description Entity + ( ( ( + ) ) ) + [ [ [ + ] ] ] + { { { + } } } + (: Left angle bracket ⟨ + :) Right angle bracket ⟩ + {: Invisible left grouping element + :} Invisible right grouping element + +=head3 Miscellaneous symbols + + Type Description Entity + int Integral ∫ + oint Countour integral ∮ + del Partial derivative &del; + grad Gradient ∇ + +- Plus or minus ± + O/ Null set ∅ + oo Infinity ∞ + aleph Hebrew letter aleph ℵ + & Ampersand & + /_ Angle ∠ + :. Therefore ∴ + ... Ellipsis ... + cdots Three centered dots ⋯ + \ Non-breaking space ( means space)   + quad Quad space    + diamond Diamond ⋄ + square Square □ + |__ Left floor ⌊ + __| Right floor ⌋ + |~ Left ceiling ⌈ + ~| Right ceiling ⌉ + CC Complex numbers ℂ + NN Natural numbers ℕ + QQ Rational numbers ℚ + RR Real numbers ℝ + ZZ Integers ℤ + +=head3 Arrows + + Type Description Entity + uarr Up arrow ↑ + darr Down arrow ↓ + rarr Right arrow → + -> Right arrow → + larr Left arrow ← + harr Horizontal (two-way) arrow ↔ + rArr Right double arrow ⇒ + lArr Left double arrow ⇐ + hArr Horizontal double arrow ⇔ + +=head3 Accents + + Type Description Output + hat x Hat over x x^ + bar x Bar over x x¯ + ul x Underbar under x x_ + vec x Right arrow over x x + dot x Dot over x x. + ddot x Double dot over x x.. + +=head3 Font commands + + Type Description + bb A Bold A + bbb A Double-struck A + cc A Calligraphic (script) A + tt A Teletype (monospace) A + fr A Fraktur A + sf A Sans-serif A + +=head3 Defining new commands and symbols + +It is possible to define new commands and symbols using the +'newcommand' and 'newsymbol' binary operators. The former defines a +macro that gets expanded and reparsed as ASCIIMathML and the latter +defines a constant that gets used as a math operator (C<< >>) +element. Both of the arguments must be text, optionally enclosed in +grouping operators. The 'newsymbol' operator also allows the +second argument to be a group of two text strings where the first is +the mathml operator and the second is the latex code to be output. + +For example, 'newcommand "DDX" "{:d/dx:}"' would define a new command +'DDX'. It could then be invoked like 'DDXf(x)', which would +expand to '{:d/dx:}f(x)'. The text 'newsymbol{"!le"}{"≰"}' +could be used to create a symbol you could invoke with '!le', as in 'a +!le b'. + +=head2 Attributes for + +=over 4 + +=item C + +The title attribute for the element, if specified. In many browsers, +this string will appear if you hover over the MathML markup. + +=item C + +The id attribute for the element, if specified. + +=item C + +The class attribute for the element, if specified. + +=back + +=head2 Attributes for + +=over 4 + +=item C + +The displaystyle attribute for the element, if specified. One of the +values "true" or "false". If the displaystyle is false, then fractions +are represented with a smaller font size and the placement of +subscripts and superscripts of sums and integrals changes. + +=item C + +The mathvariant attribute for the element, if specified. One of the +values "normal", "bold", "italic", "bold-italic", "double-struck", +"bold-fraktur", "script", "bold-script", "fraktur", "sans-serif", +"bold-sans-serif", "sans-serif-italic", "sans-serif-bold-italic", or +"monospace". + +=item C + +The mathsize attribute for the element, if specified. Either "small", +"normal" or "big", or of the form "number v-unit". + +=item C + +A string representing the font family. + +=item C + +The mathcolor attribute for the element, if specified. It be in one of +the forms "#rgb" or "#rrggbb", or should be an html-color-name. + +=item C + +The mathbackground attribute for the element, if specified. It should +be in one of the forms "#rgb" or "#rrggbb", or an html-color-name, or +the keyword "transparent". + + +=head1 METHODS + +=head2 C + +=head3 C + +Converts C<$text> to a MathML string. If the optional C<$math_attr> +argument is provided, it should be a reference to a hash of +attribute/value pairs for the C< > node. If the optional +C<$mstyle_attr> argument is provided, it should be a reference to a +hash of attribute/value pairs for the C< > node. + +=head3 C + +Like C except that instead of returning a string, it +returns a C representing the parsed MathML +structure. + +=head2 C + +=head3 C + +Returns a MathML string representing the parsed MathML structure +encoded by the C. + +=head3 C + +Returns a LaTeX string representing the parsed MathML structure +encoded by the C. + +=head1 BUGS AND SUGGESTIONS + +If you find bugs, think of anything that could improve Text::ASCIIMathML +or have any questions related to it, feel free to contact the author. + +=head1 AUTHOR + +Mark Nodine + +=head1 SEE ALSO + + MathML::Entities, + + +=head1 ACKNOWLEDGEMENTS + +This Perl module has been created by modifying Peter Jipsen's +ASCIIMathML.js script. He deserves full credit for the original +implementation; any bugs have probably been introduced by me. + +=head1 COPYRIGHT + +The Text::ASCIIMathML module is copyright (c) 2006 Mark Nodine, +USA. All rights reserved. + +You may use and distribute them under the terms of either the GNU +General Public License or the Artistic License, as specified in the +Perl README file. + +=cut + +use strict; +use warnings; + +our $VERSION = '0.81'; + +# Creates a new Text::ASCIIMathML parser object +sub new { + my ($class) = @_; + return bless {}, $class; +} + +# Sets an attribute to a given value +# Arguments: Attribute name, attribute value +# Returns: None +# Supported attributes: +# ForMoz Boolean to optimize for Netscape/Mozilla/Firefox +sub SetAttribute : method { + my ($self, $attr, $val) = @_; + $self->{attr}{$attr} = $val; +} + +# Converts an AsciiMathML string to a MathML one +# Arguments: AsciiMathML string, +# optional ref to array of attribute/value pairs for math node, +# optional ref to array of attribute/value pairs for mstyle node +# Returns: MathML string +sub TextToMathML : method { + my $tree = TextToMathMLTree(@_); + return $tree ? $tree->text : ''; +} + +# Converts an AsciiMathML string to a tree of MathML nodes +# Arguments: AsciiMathML string, +# optional ref to array of attribute/value pairs for math node, +# optional ref to array of attribute/value pairs for mstyle node +# Returns: top Text::ASCIIMathML::Node object or undefined +sub TextToMathMLTree : method { + my ($self, $expr, $mathAttr, $mstyleAttr) = @_; + $expr = '' unless defined $expr; + my $mstyle = $self->_createElementMathML('mstyle'); + $mstyle->setAttribute + (ref $mstyleAttr eq 'ARRAY' ? @$mstyleAttr : %$mstyleAttr) + if $mstyleAttr; + $self->{nestingDepth} = 0; + $expr =~ s/^\s+//; + $mstyle->appendChild(($self->_parseExpr($expr, 0))[0]); + return unless $mstyle->childNodes > 0; + my $math = $self->_createMmlNode('math', $mstyle); + $expr =~ s/\n\s*//g; + $math->setAttribute(ref $mathAttr eq 'ARRAY' ? @$mathAttr : %$mathAttr) + if $mathAttr; + + return $math; +} + + + +# Creates an Text::ASCIIMathML::Node object with no tag +# Arguments: None +# Returns: node object +sub _createDocumentFragment : method { + my ($self) = @_; + return Text::ASCIIMathML::Node->new($self); +} + +# Creates an Text::ASCIIMathML::Node object +# Arguments: tag +# Returns: node object +sub _createElementMathML : method { + my ($self, $t) = @_; + return Text::ASCIIMathML::Node->new($self, $t); +} + +# Creates an Text::ASCIIMathML::Node object and appends a node as a child +# Arguments: tag, node +# Returns: node object +sub _createMmlNode : method { + my ($self, $t, $obj) = @_; + my $node = Text::ASCIIMathML::Node->new($self, $t); + $node->appendChild($obj); + return $node; +} + +# Creates an Text::ASCIIMathML::Node text object with the given text +# Arguments: text +# Returns: node object +sub _createTextNode : method { + my ($self, $text) = @_; + return Text::ASCIIMathML::Node->newText ($self, $text); +} + +# Finds maximal initial substring of str that appears in names +# return null if there is none +# Arguments: string +# Returns: matched input, entry from AMSymbol (if any) +sub _getSymbol : method { + my $self = shift; + my ($input, $symbol) = $self->_getSymbol_(@_); + $self->{previousSymbol} = $symbol->{ttype} if $symbol; + return $input, $symbol; +} + +BEGIN { +# character lists for Mozilla/Netscape fonts +my $AMcal = [0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF39,0xEF3A,0x2112,0x2133,0xEF3B,0xEF3C,0xEF3D,0xEF3E,0x211B,0xEF3F,0xEF40,0xEF41,0xEF42,0xEF43,0xEF44,0xEF45,0xEF46]; +my $AMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128]; +my $AMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124]; + +# Create closure for static variables +my %AMSymbol = ( +"sqrt" => { tag=>"msqrt", output=>"sqrt", tex=>'', ttype=>"UNARY" }, +"root" => { tag=>"mroot", output=>"root", tex=>'', ttype=>"BINARY" }, +"frac" => { tag=>"mfrac", output=>"/", tex=>'', ttype=>"BINARY" }, +"/" => { tag=>"mfrac", output=>"/", tex=>'', ttype=>"INFIX" }, +"stackrel" => { tag=>"mover", output=>"stackrel", tex=>'', ttype=>"BINARY" }, +"_" => { tag=>"msub", output=>"_", tex=>'', ttype=>"INFIX" }, +"^" => { tag=>"msup", output=>"^", tex=>'', ttype=>"INFIX" }, +"text" => { tag=>"mtext", output=>"text", tex=>'', ttype=>"TEXT" }, +"mbox" => { tag=>"mtext", output=>"mbox", tex=>'', ttype=>"TEXT" }, +"\"" => { tag=>"mtext", output=>"mbox", tex=>'', ttype=>"TEXT" }, + +# new for perl +"newcommand" => { ttype=>"BINARY"}, +"newsymbol" => { ttype=>"BINARY" }, + +# some greek symbols +"alpha" => { tag=>"mi", output=>"α", tex=>'', ttype=>"CONST" }, +"beta" => { tag=>"mi", output=>"β", tex=>'', ttype=>"CONST" }, +"chi" => { tag=>"mi", output=>"χ", tex=>'', ttype=>"CONST" }, +"delta" => { tag=>"mi", output=>"δ", tex=>'', ttype=>"CONST" }, +"Delta" => { tag=>"mo", output=>"Δ", tex=>'', ttype=>"CONST" }, +"epsi" => { tag=>"mi", output=>"ε", tex=>"epsilon", ttype=>"CONST" }, +"varepsilon" => { tag=>"mi", output=>"ɛ", tex=>'', ttype=>"CONST" }, +"eta" => { tag=>"mi", output=>"η", tex=>'', ttype=>"CONST" }, +"gamma" => { tag=>"mi", output=>"γ", tex=>'', ttype=>"CONST" }, +"Gamma" => { tag=>"mo", output=>"Γ", tex=>'', ttype=>"CONST" }, +"iota" => { tag=>"mi", output=>"ι", tex=>'', ttype=>"CONST" }, +"kappa" => { tag=>"mi", output=>"κ", tex=>'', ttype=>"CONST" }, +"lambda" => { tag=>"mi", output=>"λ", tex=>'', ttype=>"CONST" }, +"Lambda" => { tag=>"mo", output=>"Λ", tex=>'', ttype=>"CONST" }, +"mu" => { tag=>"mi", output=>"μ", tex=>'', ttype=>"CONST" }, +"nu" => { tag=>"mi", output=>"ν", tex=>'', ttype=>"CONST" }, +"omega" => { tag=>"mi", output=>"ω", tex=>'', ttype=>"CONST" }, +"Omega" => { tag=>"mo", output=>"Ω", tex=>'', ttype=>"CONST" }, +"phi" => { tag=>"mi", output=>"ϕ", tex=>'', ttype=>"CONST" }, +"varphi" => { tag=>"mi", output=>"φ", tex=>'', ttype=>"CONST" }, +"Phi" => { tag=>"mo", output=>"Φ", tex=>'', ttype=>"CONST" }, +"pi" => { tag=>"mi", output=>"π", tex=>'', ttype=>"CONST" }, +"Pi" => { tag=>"mo", output=>"Π", tex=>'', ttype=>"CONST" }, +"psi" => { tag=>"mi", output=>"ψ", tex=>'', ttype=>"CONST" }, +"Psi" => { tag=>"mi", output=>"Ψ", tex=>'', ttype=>"CONST" }, +"rho" => { tag=>"mi", output=>"ρ", tex=>'', ttype=>"CONST" }, +"sigma" => { tag=>"mi", output=>"σ", tex=>'', ttype=>"CONST" }, +"Sigma" => { tag=>"mo", output=>"Σ", tex=>'', ttype=>"CONST" }, +"tau" => { tag=>"mi", output=>"τ", tex=>'', ttype=>"CONST" }, +"theta" => { tag=>"mi", output=>"θ", tex=>'', ttype=>"CONST" }, +"vartheta" => { tag=>"mi", output=>"ϑ", tex=>'', ttype=>"CONST" }, +"Theta" => { tag=>"mo", output=>"Θ", tex=>'', ttype=>"CONST" }, +"upsilon" => { tag=>"mi", output=>"υ", tex=>'', ttype=>"CONST" }, +"xi" => { tag=>"mi", output=>"ξ", tex=>'', ttype=>"CONST" }, +"Xi" => { tag=>"mo", output=>"Ξ", tex=>'', ttype=>"CONST" }, +"zeta" => { tag=>"mi", output=>"ζ", tex=>'', ttype=>"CONST" }, + +# binary operation symbols +"*" => { tag=>"mo", output=>"⋅", tex=>"cdot", ttype=>"CONST" }, +"**" => { tag=>"mo", output=>"⋆", tex=>"star", ttype=>"CONST" }, +"//" => { tag=>"mo", output=>"/", tex=>'', ttype=>"CONST" }, +"\\\\" => { tag=>"mo", output=>"\\", tex=>"backslash", ttype=>"CONST" }, +"setminus" => { tag=>"mo", output=>"\\", tex=>'', ttype=>"CONST" }, +"xx" => { tag=>"mo", output=>"×", tex=>"times", ttype=>"CONST" }, +"-:" => { tag=>"mo", output=>"÷", tex=>"div", ttype=>"CONST" }, +"@" => { tag=>"mo", output=>"∘", tex=>"circ", ttype=>"CONST" }, +"o+" => { tag=>"mo", output=>"⊕", tex=>"oplus", ttype=>"CONST" }, +"ox" => { tag=>"mo", output=>"⊗", tex=>"otimes", ttype=>"CONST" }, +"o." => { tag=>"mo", output=>"⊙", tex=>"odot", ttype=>"CONST" }, +"sum" => { tag=>"mo", output=>"∑", tex=>'', ttype=>"UNDEROVER" }, +"prod" => { tag=>"mo", output=>"∏", tex=>'', ttype=>"UNDEROVER" }, +"^^" => { tag=>"mo", output=>"∧", tex=>"wedge", ttype=>"CONST" }, +"^^^" => { tag=>"mo", output=>"⋀", tex=>"bigwedge", ttype=>"UNDEROVER" }, +"vv" => { tag=>"mo", output=>"∨", tex=>"vee", ttype=>"CONST" }, +"vvv" => { tag=>"mo", output=>"⋁", tex=>"bigvee", ttype=>"UNDEROVER" }, +"nn" => { tag=>"mo", output=>"∩", tex=>"cap", ttype=>"CONST" }, +"nnn" => { tag=>"mo", output=>"⋂", tex=>"bigcap", ttype=>"UNDEROVER" }, +"uu" => { tag=>"mo", output=>"∪", tex=>"cup", ttype=>"CONST" }, +"uuu" => { tag=>"mo", output=>"⋃", tex=>"bigcup", ttype=>"UNDEROVER" }, + +# binary relation symbols +"!=" => { tag=>"mo", output=>"≠", tex=>"ne", ttype=>"CONST" }, +":=" => { tag=>"mo", output=>":=", tex=>'', ttype=>"CONST" }, +#"lt" => { tag=>"mo", output=>"<", tex=>'', ttype=>"CONST" }, +"lt" => { tag=>"mo", output=>"<", tex=>'', ttype=>"CONST" }, +"<=" => { tag=>"mo", output=>"≤", tex=>"le", ttype=>"CONST" }, +"lt=" => { tag=>"mo", output=>"≤", tex=>"leq", ttype=>"CONST", latex=>1 }, +">=" => { tag=>"mo", output=>"≥", tex=>"ge", ttype=>"CONST" }, +"geq" => { tag=>"mo", output=>"≥", tex=>'', ttype=>"CONST", latex=>1 }, +"-<" => { tag=>"mo", output=>"≺", tex=>"prec", ttype=>"CONST", latex=>1 }, +"-lt" => { tag=>"mo", output=>"≺", tex=>'', ttype=>"CONST" }, +">-" => { tag=>"mo", output=>"≻", tex=>"succ", ttype=>"CONST" }, +"in" => { tag=>"mo", output=>"∈", tex=>'', ttype=>"CONST" }, +"!in" => { tag=>"mo", output=>"∉", tex=>"notin", ttype=>"CONST" }, +"sub" => { tag=>"mo", output=>"⊂", tex=>"subset", ttype=>"CONST" }, +"sup" => { tag=>"mo", output=>"⊃", tex=>"supset", ttype=>"CONST" }, +"sube" => { tag=>"mo", output=>"⊆", tex=>"subseteq", ttype=>"CONST" }, +"supe" => { tag=>"mo", output=>"⊇", tex=>"supseteq", ttype=>"CONST" }, +"-=" => { tag=>"mo", output=>"≡", tex=>"equiv", ttype=>"CONST" }, +"~=" => { tag=>"mo", output=>"≅", tex=>"cong", ttype=>"CONST" }, +"~~" => { tag=>"mo", output=>"≈", tex=>"approx", ttype=>"CONST" }, +"prop" => { tag=>"mo", output=>"∝", tex=>"propto", ttype=>"CONST" }, + +# new for perl +"<" => { tag=>"mo", output=>"<", tex=>'', ttype=>"CONST" }, +"gt" => { tag=>"mo", output=>">", tex=>'', ttype=>"CONST" }, +">" => { tag=>"mo", output=>">", tex=>'', ttype=>"CONST" }, +"\\!" => { tag=>"", output=>'', tex=>'', ttype=>"NOP" }, + + +# logical symbols +"and" => { tag=>"mtext", output=>"and", tex=>'', ttype=>"SPACE" }, +"or" => { tag=>"mtext", output=>"or", tex=>'', ttype=>"SPACE" }, +"not" => { tag=>"mo", output=>"¬", tex=>"neg", ttype=>"CONST" }, +"=>" => { tag=>"mo", output=>"⇒", tex=>"implies", ttype=>"CONST" }, +"if" => { tag=>"mo", output=>"if", tex=>'if', ttype=>"SPACE" }, +"<=>" => { tag=>"mo", output=>"⇔", tex=>"iff", ttype=>"CONST" }, +"AA" => { tag=>"mo", output=>"∀", tex=>"forall", ttype=>"CONST" }, +"EE" => { tag=>"mo", output=>"∃", tex=>"exists", ttype=>"CONST" }, +"_|_" => { tag=>"mo", output=>"⊥", tex=>"bot", ttype=>"CONST" }, +"TT" => { tag=>"mo", output=>"⊤", tex=>"top", ttype=>"CONST" }, +"|--" => { tag=>"mo", output=>"⊢", tex=>"vdash", ttype=>"CONST" }, +"|==" => { tag=>"mo", output=>"⊨", tex=>"models", ttype=>"CONST" }, + +# grouping brackets +"(" => { tag=>"mo", output=>"(", tex=>'', ttype=>"LEFTBRACKET" }, +")" => { tag=>"mo", output=>")", tex=>'', ttype=>"RIGHTBRACKET" }, +"[" => { tag=>"mo", output=>"[", tex=>'', ttype=>"LEFTBRACKET" }, +"]" => { tag=>"mo", output=>"]", tex=>'', ttype=>"RIGHTBRACKET" }, +"{" => { tag=>"mo", output=>"{", tex=>'', ttype=>"LEFTBRACKET" }, +"}" => { tag=>"mo", output=>"}", tex=>'', ttype=>"RIGHTBRACKET" }, +"|" => { tag=>"mo", output=>"|", tex=>'', ttype=>"LEFTRIGHT" }, +# {input:"||", tag:"mo", output:"||", tex:null, ttype:LEFTRIGHT}, +"(:" => { tag=>"mo", output=>"〈", tex=>"langle", ttype=>"LEFTBRACKET" }, +":)" => { tag=>"mo", output=>"〉", tex=>"rangle", ttype=>"RIGHTBRACKET" }, +"<<" => { tag=>"mo", output=>"〈", tex=>'langle', ttype=>"LEFTBRACKET" }, +">>" => { tag=>"mo", output=>"〉", tex=>'rangle', ttype=>"RIGHTBRACKET" }, +"{:" => { tag=>"mo", output=>"{:", tex=>'', ttype=>"LEFTBRACKET", invisible=>"true" }, +":}" => { tag=>"mo", output=>":}", tex=>'', ttype=>"RIGHTBRACKET", invisible=>"true" }, + +# miscellaneous symbols +"int" => { tag=>"mo", output=>"∫", tex=>'', ttype=>"CONST" }, +"dx" => { tag=>"mi", output=>"{:d x:}", tex=>'', ttype=>"DEFINITION" }, +"dy" => { tag=>"mi", output=>"{:d y:}", tex=>'', ttype=>"DEFINITION" }, +"dz" => { tag=>"mi", output=>"{:d z:}", tex=>'', ttype=>"DEFINITION" }, +"dt" => { tag=>"mi", output=>"{:d t:}", tex=>'', ttype=>"DEFINITION" }, +"oint" => { tag=>"mo", output=>"∮", tex=>'', ttype=>"CONST" }, +"del" => { tag=>"mo", output=>"∂", tex=>"partial", ttype=>"CONST" }, +"grad" => { tag=>"mo", output=>"∇", tex=>"nabla", ttype=>"CONST" }, +"+-" => { tag=>"mo", output=>"±", tex=>"pm", ttype=>"CONST" }, +"O/" => { tag=>"mo", output=>"∅", tex=>"emptyset", ttype=>"CONST" }, +"oo" => { tag=>"mo", output=>"∞", tex=>"infty", ttype=>"CONST" }, +"aleph" => { tag=>"mo", output=>"ℵ", tex=>'', ttype=>"CONST" }, +"..." => { tag=>"mo", output=>"...", tex=>"ldots", ttype=>"CONST" }, +":." => { tag=>"mo", output=>"∴", tex=>"therefore", ttype=>"CONST" }, +"/_" => { tag=>"mo", output=>"∠", tex=>"angle", ttype=>"CONST" }, +"&" => { tag=>"mo", output=>"&", tex=>'\&', ttype=>"CONST" }, +"\\ " => { tag=>"mo", output=>" ", tex=>'\,', ttype=>"CONST" }, +"quad" => { tag=>"mo", output=>"  ", tex=>'', ttype=>"CONST" }, +"qquad" => { tag=>"mo", output=>"    ", tex=>'', ttype=>"CONST" }, +"cdots" => { tag=>"mo", output=>"⋯", tex=>'', ttype=>"CONST" }, +"vdots" => { tag=>"mo", output=>"⋮", tex=>'', ttype=>"CONST" }, +"ddots" => { tag=>"mo", output=>"⋱", tex=>'', ttype=>"CONST" }, +"diamond" => { tag=>"mo", output=>"⋄", tex=>'', ttype=>"CONST" }, +"square" => { tag=>"mo", output=>"□", tex=>'', ttype=>"CONST" }, +"|__" => { tag=>"mo", output=>"⌊", tex=>"lfloor", ttype=>"CONST" }, +"__|" => { tag=>"mo", output=>"⌋", tex=>"rfloor", ttype=>"CONST" }, +"|~" => { tag=>"mo", output=>"⌈", tex=>"lceil", ttype=>"CONST" }, +"~|" => { tag=>"mo", output=>"⌉", tex=>"rceil", ttype=>"CONST" }, +"CC" => { tag=>"mo", output=>"ℂ", tex=>'', ttype=>"CONST" }, +"NN" => { tag=>"mo", output=>"ℕ", tex=>'', ttype=>"CONST" }, +"QQ" => { tag=>"mo", output=>"ℚ", tex=>'', ttype=>"CONST" }, +"RR" => { tag=>"mo", output=>"ℝ", tex=>'', ttype=>"CONST" }, +"ZZ" => { tag=>"mo", output=>"ℤ", tex=>'', ttype=>"CONST" }, +"f" => { tag=>"mi", output=>"f", tex=>'', ttype=>"UNARY", func=>"true" }, +"g" => { tag=>"mi", output=>"g", tex=>'', ttype=>"UNARY", func=>"true" }, + +# standard functions +"lim" => { tag=>"mo", output=>"lim", tex=>'', ttype=>"UNDEROVER" }, +"Lim" => { tag=>"mo", output=>"Lim", tex=>'', ttype=>"UNDEROVER" }, +"sin" => { tag=>"mo", output=>"sin", tex=>'', ttype=>"UNARY", func=>"true" }, +"cos" => { tag=>"mo", output=>"cos", tex=>'', ttype=>"UNARY", func=>"true" }, +"tan" => { tag=>"mo", output=>"tan", tex=>'', ttype=>"UNARY", func=>"true" }, +"sinh" => { tag=>"mo", output=>"sinh", tex=>'', ttype=>"UNARY", func=>"true" }, +"cosh" => { tag=>"mo", output=>"cosh", tex=>'', ttype=>"UNARY", func=>"true" }, +"tanh" => { tag=>"mo", output=>"tanh", tex=>'', ttype=>"UNARY", func=>"true" }, +"cot" => { tag=>"mo", output=>"cot", tex=>'', ttype=>"UNARY", func=>"true" }, +"sec" => { tag=>"mo", output=>"sec", tex=>'', ttype=>"UNARY", func=>"true" }, +"csc" => { tag=>"mo", output=>"csc", tex=>'', ttype=>"UNARY", func=>"true" }, +"log" => { tag=>"mo", output=>"log", tex=>'', ttype=>"UNARY", func=>"true" }, +"ln" => { tag=>"mo", output=>"ln", tex=>'', ttype=>"UNARY", func=>"true" }, +"det" => { tag=>"mo", output=>"det", tex=>'', ttype=>"UNARY", func=>"true" }, +"dim" => { tag=>"mo", output=>"dim", tex=>'', ttype=>"CONST" }, +"mod" => { tag=>"mo", output=>"mod", tex=>'', ttype=>"CONST" }, +"gcd" => { tag=>"mo", output=>"gcd", tex=>'', ttype=>"UNARY", func=>"true" }, +"lcm" => { tag=>"mo", output=>"lcm", tex=>'', ttype=>"UNARY", func=>"true" }, +"lub" => { tag=>"mo", output=>"lub", tex=>'', ttype=>"CONST" }, +"glb" => { tag=>"mo", output=>"glb", tex=>'', ttype=>"CONST" }, +"min" => { tag=>"mo", output=>"min", tex=>'', ttype=>"UNDEROVER" }, +"max" => { tag=>"mo", output=>"max", tex=>'', ttype=>"UNDEROVER" }, + +# arrows +"uarr" => { tag=>"mo", output=>"↑", tex=>"uparrow", ttype=>"CONST" }, +"darr" => { tag=>"mo", output=>"↓", tex=>"downarrow", ttype=>"CONST" }, +"rarr" => { tag=>"mo", output=>"→", tex=>"rightarrow", ttype=>"CONST" }, +"->" => { tag=>"mo", output=>"→", tex=>"to", ttype=>"CONST", latex=>1 }, +"|->" => { tag=>"mo", output=>"↦", tex=>"mapsto", ttype=>"CONST" }, +"larr" => { tag=>"mo", output=>"←", tex=>"leftarrow", ttype=>"CONST" }, +"harr" => { tag=>"mo", output=>"↔", tex=>"leftrightarrow", ttype=>"CONST" }, +"rArr" => { tag=>"mo", output=>"⇒", tex=>"Rightarrow", ttype=>"CONST", latex=>1 }, +"lArr" => { tag=>"mo", output=>"⇐", tex=>"Leftarrow", ttype=>"CONST" }, +"hArr" => { tag=>"mo", output=>"⇔", tex=>"Leftrightarrow", ttype=>"CONST", latex=>1 }, + +# commands with argument + +"hat" => { tag=>"mover", output=>"^", tex=>'', ttype=>"UNARY", acc=>"true" }, +"bar" => { tag=>"mover", output=>"¯", tex=>"overline", ttype=>"UNARY", acc=>"true" }, +"vec" => { tag=>"mover", output=>"→", tex=>'', ttype=>"UNARY", acc=>"true" }, +"dot" => { tag=>"mover", output=>".", tex=>'', ttype=>"UNARY", acc=>"true" }, +"ddot" => { tag=>"mover", output=>"..", tex=>'', ttype=>"UNARY", acc=>"true" }, +"ul" => { tag=>"munder", output=>"̲", tex=>"underline", ttype=>"UNARY", acc=>"true" }, + +"bb" => { tag=>"mstyle", atname=>"fontweight", atval=>"bold", output=>"bb", tex=>'', ttype=>"UNARY" }, +"mathbf" => { tag=>"mstyle", atname=>"fontweight", atval=>"bold", output=>"mathbf", tex=>'', ttype=>"UNARY" }, +"sf" => { tag=>"mstyle", atname=>"fontfamily", atval=>"sans-serif", output=>"sf", tex=>'', ttype=>"UNARY" }, +"mathsf" => { tag=>"mstyle", atname=>"fontfamily", atval=>"sans-serif", output=>"mathsf", tex=>'', ttype=>"UNARY" }, +"bbb" => { tag=>"mstyle", atname=>"mathvariant", atval=>"double-struck", output=>"bbb", tex=>'', ttype=>"UNARY", codes=>$AMbbb }, +"mathbb" => { tag=>"mstyle", atname=>"mathvariant", atval=>"double-struck", output=>"mathbb", tex=>'', ttype=>"UNARY", codes=>$AMbbb }, +"cc" => { tag=>"mstyle", atname=>"mathvariant", atval=>"script", output=>"cc", tex=>'', ttype=>"UNARY", codes=>$AMcal }, +"mathcal" => { tag=>"mstyle", atname=>"mathvariant", atval=>"script", output=>"mathcal", tex=>'', ttype=>"UNARY", codes=>$AMcal }, +"tt" => { tag=>"mstyle", atname=>"fontfamily", atval=>"monospace", output=>"tt", tex=>'', ttype=>"UNARY" }, +"mathtt" => { tag=>"mstyle", atname=>"fontfamily", atval=>"monospace", output=>"mathtt", tex=>'', ttype=>"UNARY" }, +"fr" => { tag=>"mstyle", atname=>"mathvariant", atval=>"fraktur", output=>"fr", tex=>'', ttype=>"UNARY", codes=>$AMfrk }, +"mathfrak" => { tag=>"mstyle", atname=>"mathvariant", atval=>"fraktur", output=>"mathfrak", tex=>'', ttype=>"UNARY", codes=>$AMfrk }, +); + +# Preprocess AMSymbol for lexer regular expression +# Preprocess AMSymbol for tex input +my %AMTexSym = map(($AMSymbol{$_}{tex} || $_, $_), + grep($AMSymbol{$_}{tex}, keys %AMSymbol)); +my $Ident_RE = join '|', map("\Q$_\E", + sort {length($b) - length($a)} (keys %AMSymbol, + keys %AMTexSym)); + +sub _getSymbol_ : method { + my ($self, $str) = @_; + for ($str) { + /^(\d+(\.\d+)?)/ || /^(\.\d+)/ + and return $1, {tag=>'mn', output=>$1, ttype=>'CONST'}; + $self->{Definition_RE} && /^($self->{Definition_RE})/ and + return $1, $self->{Definitions}{$1}; + /^($Ident_RE)/o and + return $1,$AMTexSym{$1} ? $AMSymbol{$AMTexSym{$1}} : $AMSymbol{$1}; + /^([A-Za-z])/ and + return $1, {tag=>'mi', output=>$1, ttype=>'CONST'}; + /^(.)/ and + return $1 eq '-' && defined $self->{previousSymbol} && + $self->{previousSymbol} eq 'INFIX' ? + ($1, {tag=>'mo', output=>$1, ttype=>'UNARY', func=>"true"} ) : + ($1, {tag=>'mo', output=>$1, ttype=>'CONST'}); + } +} + +# Used so that Text::ASCIIMathML::Node can get access to the symbol table +sub _get_amsymbol_ { + return \%AMSymbol; +} +} + +# Parses an E expression +# Arguments: string to parse, whether to look for a right bracket +# Returns: parsed node (if successful), remaining unparsed string +sub _parseExpr : method { + my ($self, $str, $rightbracket) = @_; + my $newFrag = $self->_createDocumentFragment(); + my ($node, $input, $symbol); + do { + $str = _removeCharsAndBlanks($str, 0); + ($node, $str) = $self->_parseIexpr($str); + ($input, $symbol) = $self->_getSymbol($str); + if (defined $symbol && $symbol->{ttype} eq 'INFIX' && $input eq '/') { + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseIexpr($str); + if ($result[0]) { + _removeBrackets($result[0]); + } + else { # show box in place of missing argument + $result[0] = $self->_createMmlNode + ('mo', $self->_createTextNode('A1;')); + } + $str = $result[1]; + _removeBrackets($node); + $node = $self->_createMmlNode($symbol->{tag}, $node); + $node->appendChild($result[0]); + $newFrag->appendChild($node); + ($input, $symbol) = $self->_getSymbol($str); + } + elsif (defined $node) { + $newFrag->appendChild($node); + } + } while (defined $symbol && ($symbol->{ttype} ne 'RIGHTBRACKET' && + ($symbol->{ttype} ne 'LEFTRIGHT' || + $rightbracket) + || $self->{nestingDepth} == 0) && + $symbol->{output} ne ''); + if (defined $symbol && $symbol->{ttype} =~ /RIGHTBRACKET|LEFTRIGHT/) { + my @childNodes = $newFrag->childNodes; + if (@childNodes > 1 && + $childNodes[-1]->nodeName eq 'mrow' && + $childNodes[-2]->nodeName eq 'mo' && + $childNodes[-2]->firstChild->nodeValue eq ',') { # matrix + my $right = $childNodes[-1]->lastChild->firstChild->nodeValue; + if ($right =~ /[\)\]]/) { + my $left = $childNodes[-1]->firstChild->firstChild->nodeValue; + if ("$left$right" =~ /^\(\)$/ && $symbol->{output} ne '}' || + "$left$right" =~ /^\[\]$/) { + my @pos; # positions of commas + my $matrix = 1; + my $m = @childNodes; + for (my $i=0; $matrix && $i < $m; $i += 2) { + $pos[$i] = []; + $node = $childNodes[$i]; + $matrix = + $node->nodeName eq 'mrow' && + ($i == $m-1 || + $node->nextSibling->nodeName eq 'mo' && + $node->nextSibling->firstChild->nodeValue eq ',')&& + $node->firstChild->firstChild->nodeValue eq $left&& + $node->lastChild->firstChild->nodeValue eq $right + if $matrix; + if ($matrix) { + for (my $j=0; $j<($node->childNodes); $j++) { + if (($node->childNodes)[$j]->firstChild-> + nodeValue eq ',') { + push @{$pos[$i]}, $j; + } + } + } + if ($matrix && $i > 1) { + $matrix = @{$pos[$i]} == @{$pos[$i-2]}; + } + } + if ($matrix) { + my $table = $self->_createDocumentFragment(); + for (my $i=0; $i<$m; $i += 2) { + my $row = $self->_createDocumentFragment(); + my $frag = $self->_createDocumentFragment(); + # (-,-,...,-,-) + $node = $newFrag->firstChild; + my $n = $node->childNodes; + my $k = 0; + $node->removeChild($node->firstChild); # remove ( + for (my $j=1; $j<$n-1; $j++) { + if ($k < @{$pos[$i]} && $j == $pos[$i][$k]) { + # remove , + $row->appendChild + ($self->_createMmlNode('mtd', $frag)); + $frag = $self->_createDocumentFragment(); + $k++; + } + else { + $frag->appendChild($node->firstChild); + } + $node->removeChild($node->firstChild); + } + $row->appendChild + ($self->_createMmlNode('mtd', $frag)); + if ($newFrag->childNodes > 2) { + # remove ) + $newFrag->removeChild($newFrag->firstChild); + # remove , + $newFrag->removeChild($newFrag->firstChild); + } + $table->appendChild + ($self->_createMmlNode('mtr', $row)); + } + $node = $self->_createMmlNode('mtable', $table); + $node->setAttribute('columnalign', 'left') + if $symbol->{invisible}; + $newFrag->replaceChild($node, $newFrag->firstChild); + } + } + } + } + $str = _removeCharsAndBlanks($str, length $input); + if (! $symbol->{invisible}) { + $node = $self->_createMmlNode + ('mo', $self->_createTextNode($symbol->{output})); + $newFrag->appendChild($node); + } + } + return $newFrag, $str; +} + +# Parses an I expression +# Arguments: string to parse +# Returns: parsed node (if successful), remaining unparsed string +sub _parseIexpr : method { + my ($self, $str) = @_; + $str = _removeCharsAndBlanks($str, 0); + my ($in1, $sym1) = $self->_getSymbol($str); + my $node; + ($node, $str) = $self->_parseSexpr($str); + my ($input, $symbol) = $self->_getSymbol($str); + if (defined $symbol && $symbol->{ttype} eq 'INFIX' && $input ne '/') { +# if (symbol.input == "/") result = AMparseIexpr(str); else ... + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseSexpr($str); + if ($result[0]) { + _removeBrackets($result[0]); + } + else { # show box in place of missing argument + $result[0] = $self->_createMmlNode + ('mo', $self->_createTextNode("A1;")); + } + $str = $result[1]; + if ($input eq '_') { + my ($in2, $sym2) = $self->_getSymbol($str); + my $underover = $sym1->{ttype} eq 'UNDEROVER'; + if ($in2 eq '^') { + $str = _removeCharsAndBlanks($str, length $in2); + my @res2 = $self->_parseSexpr($str); + _removeBrackets($res2[0]); + $str = $res2[1]; + $node = $self->_createMmlNode + ($underover ? 'munderover' : 'msubsup', $node); + $node->appendChild($result[0]); + $node->appendChild($res2[0]); + $node = $self->_createMmlNode('mrow',$node); # so sum does not stretch + } + else { + $node = $self->_createMmlNode + ($underover ? 'munder' : 'msub', $node); + $node->appendChild($result[0]); + } + } + elsif ($input eq '^') { + my ($in2, $sym2) = $self->_getSymbol($str); + my $underover = $sym1->{ttype} eq 'UNDEROVER'; + if ($in2 eq '_') { + $str = _removeCharsAndBlanks($str, length $in2); + my @res2 = $self->_parseSexpr($str); + _removeBrackets($res2[0]); + $str = $res2[1]; + $node = $self->_createMmlNode + ($underover ? 'munderover' : 'msubsup', $node); + $node->appendChild($res2[0]); + $node->appendChild($result[0]); + $node = $self->_createMmlNode('mrow',$node); # so sum does not stretch + } + else { + $node = $self->_createMmlNode + ($underover ? 'mover' : 'msup', $node); + $node->appendChild($result[0]); + } + } + else { + $node = $self->_createMmlNode($symbol->{tag}, $node); + $node->appendChild($result[0]); + } + } + return $node, $str; +} + +# Parses an S expression +# Arguments: string to parse +# Returns: parsed node (if successful), remaining unparsed string +sub _parseSexpr : method { + my ($self, $str) = @_; + my $newFrag = $self->_createDocumentFragment(); + $str = _removeCharsAndBlanks($str, 0); + my ($input, $symbol) = $self->_getSymbol($str); + return (undef, $str) + if ! defined $symbol || + $symbol->{ttype} eq 'RIGHTBRACKET' && $self->{nestingDepth} > 0; + if ($symbol->{ttype} eq 'DEFINITION') { + $str = $symbol->{output} . _removeCharsAndBlanks($str, length $input); + ($input, $symbol) = $self->_getSymbol($str); + } + my $ttype = $symbol->{ttype}; + if ($ttype =~ /UNDEROVER|CONST/) { + $str = _removeCharsAndBlanks($str, length $input); + return + $self->_createMmlNode($symbol->{tag}, + $self->_createTextNode($symbol->{output})), + $str; + } + if ($ttype eq 'LEFTBRACKET') { + $self->{nestingDepth}++; + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseExpr($str, 1); + $self->{nestingDepth}--; + my $node; + if ($symbol->{invisible}) { + $node = $self->_createMmlNode('mrow', $result[0]); + } + else { + $node = $self->_createMmlNode + ('mo', $self->_createTextNode($symbol->{output})); + $node = $self->_createMmlNode('mrow', $node); + $node->appendChild($result[0]); + } + return $node, $result[1]; + } + if ($ttype eq 'TEXT') { + $str = _removeCharsAndBlanks($str, length $input) unless $input eq '"'; + my $st; + ($input, $st) = ($1, $2) + if $str =~ /^(\"()\")/ || $str =~ /^(\"((?:\\\\|\\\"|.)+?)\")/; + ($input, $st) = ($1, $2) + if ($str =~ /^(\((.*?)\))/ || + $str =~ /^(\[(.*?)\])/ || + $str =~ /^(\{(.*?)\})/); + ($input, $st) = ($str) x 2 unless defined $st; + if (substr($st, 0, 1) eq ' ') { + my $node = $self->_createElementMathML('mspace'); + $node->setAttribute(width=>'1ex'); + $newFrag->appendChild($node); + } + $newFrag->appendChild + ($self->_createMmlNode($symbol->{tag}, + $self->_createTextNode($st))); + if (substr($st, -1) eq ' ') { + my $node = $self->_createElementMathML('mspace'); + $node->setAttribute(width=>'1ex'); + $newFrag->appendChild($node); + } + $str = _removeCharsAndBlanks($str, length $input); + return $self->_createMmlNode('mrow', $newFrag), $str; + } + if ($ttype eq 'UNARY') { + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseSexpr($str); + return ($self->_createMmlNode + ($symbol->{tag}, + $self->_createTextNode($symbol->{output})), $str) + if ! defined $result[0]; + if ($symbol->{func}) { + return ($self->_createMmlNode + ($symbol->{tag}, + $self->_createTextNode($symbol->{output})), $str) + if $str =~ m!^[\^_/|]!; + my $node = $self->_createMmlNode + ('mrow', $self->_createMmlNode + ($symbol->{tag}, $self->_createTextNode($symbol->{output}))); + $node->appendChild($result[0]); + return $node, $result[1]; + } + _removeBrackets($result[0]); + if ($symbol->{acc}) { # accent + my $node = $self->_createMmlNode($symbol->{tag}, $result[0]); + $node->appendChild + ($self->_createMmlNode + ('mo', $self->_createTextNode($symbol->{output}))); + return $node, $result[1]; + } + if ($symbol->{atname}) { # font change command + if ($self->{attr}{ForMoz} && $symbol->{codes}) { + my @childNodes = $result[0]->childNodes; + my $nodeName = $result[0]->nodeName; + for (my $i=0; $i<@childNodes; $i++) { + if ($childNodes[$i]->nodeName eq 'mi'||$nodeName eq 'mi') { + my $st = $nodeName eq 'mi' ? + $result[0] ->firstChild->nodeValue : + $childNodes[$i]->firstChild->nodeValue; + $st =~ s/([A-Z])/sprintf "&#x%X;",$symbol->{codes}[ord($1)-65]/ge; + if ($nodeName eq 'mi') { + $result[0] = $self->_createTextNode($st); + } + else { + $result[0]->replaceChild + ($self->_createTextNode($st), $childNodes[$i]); + } + } + } + } + my $node = $self->_createMmlNode($symbol->{tag}, $result[0]); + $node->setAttribute($symbol->{atname}=>$symbol->{atval}); + return $node, $result[1]; + } + return $self->_createMmlNode($symbol->{tag}, $result[0]), $result[1]; + } + if ($ttype eq 'BINARY') { + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseSexpr($str); + return ($self->_createMmlNode + ('mo', $self->_createTextNode($input)), $str) + if ! defined $result[0]; + _removeBrackets($result[0]); + my @result2 = $self->_parseSexpr($result[1]); + return ($self->_createMmlNode + ('mo', $self->_createTextNode($input)), $str) + if ! defined $result2[0]; + _removeBrackets($result2[0]); + if ($input =~ /new(command|symbol)/) { + my $what = $1; + # Look for text in both arguments + my $text1 = $result[0]; + my $haveTextArgs = 0; + $text1 = $text1->firstChild while $text1->nodeName eq 'mrow'; + if ($text1->nodeName eq 'mtext') { + my $text2 = $result2[0]; + $text2 = $text2->firstChild while $text2->nodeName eq 'mrow'; + my $latex; + if ($result2[0]->childNodes > 1 && $input eq 'newsymbol') { + # Process the latex string for a newsymbol + my $latexdef = $result2[0]->child(1); + $latexdef = $latexdef->firstChild + while $latexdef->nodeName eq 'mrow'; + $latex = $latexdef->firstChild->nodeValue; + } + if ($text2->nodeName eq 'mtext') { + $self->{Definitions}{$text1->firstChild->nodeValue} = { + tag =>'mo', + output=>$text2->firstChild->nodeValue, + ttype =>$what eq 'symbol' ? 'CONST' : 'DEFINITION', + }; + $self->{Definition_RE} = join '|', + map("\Q$_\E", sort {length($b) - length($a)} + keys %{$self->{Definitions}}); + $self->{Latex}{$text2->firstChild->nodeValue} = $latex + if defined $latex; + $haveTextArgs = 1; + } + } + if (! $haveTextArgs) { + $newFrag->appendChild($self->_createMmlNode + ('mo', $self->_createTextNode($input)), + $result[0], $result2[0]); + return $self->_createMmlNode('mrow', $newFrag), $result2[1]; + } + return undef, $result2[1]; + } + if ($input =~ /root|stackrel/) { + $newFrag->appendChild($result2[0]); + } + $newFrag->appendChild($result[0]); + if ($input eq 'frac') { + $newFrag->appendChild($result2[0]); + } + return $self->_createMmlNode($symbol->{tag}, $newFrag), $result2[1]; + } + if ($ttype eq 'INFIX') { + $str = _removeCharsAndBlanks($str, length $input); + return $self->_createMmlNode + ('mo', $self->_createTextNode($symbol->{output})), $str; + } + if ($ttype eq 'SPACE') { + $str = _removeCharsAndBlanks($str, length $input); + my $node = $self->_createElementMathML('mspace'); + $node->setAttribute('width', '1ex'); + $newFrag->appendChild($node); + $newFrag->appendChild + ($self->_createMmlNode($symbol->{tag}, + $self->_createTextNode($symbol->{output}))); + $node = $self->_createElementMathML('mspace'); + $node->setAttribute('width', '1ex'); + $newFrag->appendChild($node); + return $self->_createMmlNode('mrow', $newFrag), $str; + } + if ($ttype eq 'LEFTRIGHT') { + $self->{nestingDepth}++; + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseExpr($str, 0); + $self->{nestingDepth}--; + my $st = $result[0]->lastChild ? + $result[0]->lastChild->firstChild->nodeValue : ''; + my $node = $self->_createMmlNode + ('mo',$self->_createTextNode($symbol->{output})); + $node = $self->_createMmlNode('mrow', $node); + if ($st eq '|') { # it's an absolute value subterm + $node->appendChild($result[0]); + return $node, $result[1]; + } + # the "|" is a \mid + return $node, $str; + } + if ($ttype eq 'NOP') { + $str = _removeCharsAndBlanks($str, length $input); + return $self->_parseSexpr($str); + } + $str = _removeCharsAndBlanks($str, length $input); + return $self->_createMmlNode + ($symbol->{tag}, # it's a constant + $self->_createTextNode($symbol->{output})), $str; +} + +# Removes brackets at the beginning or end of an mrow node +# Arguments: node object +# Returns: None +# Side-effects: may change children of node object +sub _removeBrackets { + my ($node) = @_; + if ($node->nodeName eq 'mrow') { + my $st = $node->firstChild->firstChild->nodeValue; + $node->removeChild($node->firstChild) if $st =~ /^[\(\[\{]$/; + $st = $node->lastChild->firstChild->nodeValue; + $node->removeChild($node->lastChild) if $st =~ /^[\)\]\}]$/; + } +} + +# Removes the first n characters and any following blanks +# Arguments: string, n +# Returns: resultant string +sub _removeCharsAndBlanks { + my ($str, $n) = @_; + my $st = substr($str, + substr($str, $n) =~ /^\\[^\\ ,!]/ ? $n+1 : $n); + $st =~ s/^[\x00-\x20]+//; + return $st; +} + +# Removes outermost parenthesis +# Arguments: string +# Returns: string with parentheses removed +sub _unparen { + my ($s) = @_; + $s =~ s!^()[\(\[\{]!$1!; + $s =~ s![\)\]\}]()$!$1!; + $s; +} + +BEGIN { +my %Conversion = ('<'=>'lt', '>'=>'gt', '"'=>'quot', '&'=>'amp'); + +# Encodes special xml characters +# Arguments: string +# Returns: encoded string +sub _xml_encode { + my ($s) = @_; + $s =~ s/([<>\"&])/&$Conversion{$1};/g; + $s; +} +} + +package Text::ASCIIMathML::Node; + +{ + # Create a closure for the following attributes + my %parser_of; + +# Creates a new Text::ASCIIMathML::Node object +# Arguments: Text::ASCIIMathML object, optional tag +# Returns: new object +sub new { + my ($class, $parser, $tag) = @_; + my $obj = bless { children=>[] }, $class; + if (defined $tag) { $obj->{tag} = $tag } + else { $obj->{frag} = 1 } + $parser_of{$obj} = $parser; + return $obj; +} + +# Creates a new Text::ASCIIMathML::Node text object +# Arguments: Text::ASCIIMathML object, text +# Returns: new object +sub newText { + my ($class, $parser, $text) = @_; + $text =~ s/^\s*(.*?)\s*$/$1/; # Delete leading/trailing spaces + my $obj = bless { text=>$text }, $class; + $parser_of{$obj} = $parser; + return $obj; +} + +my %Parent; +my $Null; +BEGIN { + $Null = new Text::ASCIIMathML::Node; +} + +# Appends one or more node objects to the children of an object +# Arguments: list of objects to append +# Returns: self +sub appendChild : method { + my $self = shift; + my @new = map $_->{frag} ? @{$_->{children}} : $_, @_; + push @{$self->{children}}, @new; + map do {$Parent{$_} = $self}, @new; + return $self; +} + +# Returns a the value for an attribute of a node object +# Arguments: Attribute name +# Returns: Value for the attribute +sub attribute { + my ($self, $attr) = @_; + return $self->{attr}{$attr}; +} + +# Returns a list of the attributes of a node object +# Arguments: None +# Returns: Array of attribute names +sub attributeList { + my ($self) = @_; + return $self->{attrlist} ? @{$self->{attrlist}} : (); +} + +# Returns a child with a given index in the array of children of a node +# Arguments: index +# Returns: Array of node objects +sub child { + my ($self, $index) = @_; + return $self->{children} && @{$self->{children}} > $index ? + $self->{children}[$index] : $Null; +} + +# Returns an array of children of a node +# Arguments: None +# Returns: Array of node objects +sub childNodes { + my ($self) = @_; + return $self->{children} ? @{$self->{children}} : (); +} + +# Returns the first child of a node; ignores any fragments +# Arguments: None +# Returns: node object or self +sub firstChild { + my ($self) = @_; + return $self->{children} && @{$self->{children}} ? + $self->{children}[0] : $Null; +} + +# Returns true if the object is a fragment +# Arguments: None +# Returns: Boolean +sub isFragment { + return $_[0]->{frag}; +} + +# Returns true if the object is a named node +# Arguments: None +# Returns: Boolean +sub isNamed { + return $_[0]->{tag}; +} + +# Returns true if the object is a text node +# Arguments: None +# Returns: Boolean +sub isText { + return defined $_[0]->{text}; +} + +# Returns the last child of a node +# Arguments: None +# Returns: node object or self +sub lastChild { + my ($self) = @_; + return $self->{children} && @{$self->{children}} ? + $self->{children}[-1] : $Null; +} + +BEGIN { +# Creates closure for following "static" variables +my (%LatexSym, %LatexMover, %LatexFont, %LatexOp); + +# Returns a latex representation of a node object +# Arguments: None +# Returns: Text string +sub latex : method { + my ($self) = @_; + + my $parser = $parser_of{$self}; + if (! %LatexSym) { + # Build the entity to latex symbol translator + my $amsymbol = Text::ASCIIMathML::_get_amsymbol_(); + foreach my $sym (keys %$amsymbol) { + next unless (defined $amsymbol->{$sym}{output} && + $amsymbol->{$sym}{output} =~ /&\#x.*;/); + my ($output, $tex) = map $amsymbol->{$sym}{$_}, qw(output tex); + next if defined $LatexSym{$output} && ! $amsymbol->{$sym}{latex}; + $tex = $sym if $tex eq ''; + $LatexSym{$output} = "\\$tex"; + } + my %math_font = (bbb => 'mathds', + mathbb => 'mathds', + cc => 'cal', + mathcal => 'cal', + fr => 'mathfrak', + mathfrak => 'mathfrak', + ); + # Add character codes + foreach my $coded (grep $amsymbol->{$_}{codes}, keys %$amsymbol) { + @LatexSym{map(sprintf("&#x%X;", $_), + @{$amsymbol->{$coded}{codes}})} = + map("\\$math_font{$coded}\{$_}", ('A' .. 'Z')); + } + # Post-process protected symbols + $LatexSym{$_} =~ s/^\\\\/\\/ foreach keys %LatexSym; + %LatexMover = ('^' => '\hat', + '\overline' => '\overline', + '\to' => '\vec', + '\vec' => '\vec', + '\rightarrow' => '\vec', + '.' => '\dot', + '..' => '\ddot', + ); + %LatexFont = (bold => '\bf', + 'double-struck' => '\mathds', + fraktur => '\mathfrak', + monospace => '\tt', + 'sans-serif' => '\sf', + script => '\cal', + ); + %LatexOp = (if => '\mbox{if }', + lcm => '\mbox{lcm}', + newcommand => '\mbox{newcommand}', + "\\" => '\backslash', + '<' => '<', + '>' => '>', + '&' => '\&', + '...' => '\ldots', + ); + } + if (defined $self->{text}) { + my $text = $self->{text}; + $text =~ s/([{}])/\\$1/; + $text =~ s/(&\#x.*?;)/ + defined $parser->{Latex}{$1} ? $parser->{Latex}{$1} : + defined $LatexSym{$1} ? $LatexSym{$1} : $1/eg; + $text =~ s/([\#])/\\$1/; + return $text; + } + my $tag = $self->{tag}; + my @child_str; + my $child_str = ''; + if (@{$self->{children}}) { + foreach (@{$self->{children}}) { + push @child_str, $_->latex($parser); + } + } + +# mo + if ($tag eq 'mo') { + # Need to distinguish bmod from pmod + my $parent = $self->parent; + return $self eq $parent->child(1) && + $parent->firstChild->firstChild->{text} eq '(' + ? '\pmod' : '\bmod' + if $child_str[0] eq 'mod'; + return $LatexOp{$child_str[0]} if $LatexOp{$child_str[0]}; + return $child_str[0] =~ /^\w+$/ ? "\\$child_str[0]" : $child_str[0]; + } + +# mrow + if ($tag eq 'mrow') { + @child_str = grep $_ ne '', @child_str; + # Check for pmod function + if (@child_str > 1 && $child_str[1] eq '\pmod') { + pop @child_str if $child_str[-1] eq ')'; + splice @child_str, 0, 2; + return "\\pmod{@child_str}"; + } + # Check if we need \left ... \right + my $is_tall = grep(/[_^]|\\(begin\{array\}|frac|sqrt|stackrel)/, + @child_str); + if ($is_tall && @child_str > 1 && + ($child_str[0] =~ /^([\(\[|]|\\\{)$/ || + $child_str[-1] =~ /^([\)\]|]|\\\})$/)) { + if ($child_str[0] =~ /^([\(\[|]|\\\{)$/) { + $child_str[0] = "\\left$child_str[0]"; + } + else { + unshift @child_str, "\\left."; + } + if ($child_str[-1] =~ /^([\)\]|]|\\\})$/) { + $child_str[-1] = "\\right$child_str[-1]"; + } + else { + push @child_str, "\\right."; + } + } + return "@child_str"; + } + + +# mi +# mn +# math +# mtd + if ($tag =~ /^m([in]|ath|row|td)$/) { + @child_str = grep $_ ne '', @child_str; + return "@child_str"; + } + +# msub +# msup +# msubsup +# munderover + if ($tag =~ /^(msu[bp](sup)?|munderover)$/) { + my $base = shift @child_str; + $base = '\mbox{}' if $base eq ''; + # Put {} around arguments with more than one character + @child_str = map length($_) > 1 ? "{$_}" : $_, @child_str; + return ($tag eq 'msub' ? "${base}_$child_str[0]" : + $tag eq 'msup' ? "${base}^$child_str[0]" : + "${base}_$child_str[0]^$child_str[1]"); + } + +# mover + if ($tag eq 'mover') { + # Need to special-case math mode accents + return + ($child_str[1] eq '\overline' && length($child_str[0]) == 1 ? + "\\bar{$child_str[0]}" : + $LatexMover{$child_str[1]} ? + "$LatexMover{$child_str[1]}\{$child_str[0]\}" : + "\\stackrel{$child_str[1]}{$child_str[0]}"); + } + +# munder + if ($tag eq 'munder') { + return $child_str[1] eq '\underline' ? "$child_str[1]\{$child_str[0]}" + : "$child_str[0]_\{$child_str[1]\}"; + } + +# mfrac + if ($tag eq 'mfrac') { + return "\\frac{$child_str[0]}{$child_str[1]}"; + } + +# msqrt + if ($tag eq 'msqrt') { + return "\\sqrt{$child_str[0]}"; + } + +# mroot + if ($tag eq 'mroot') { + return "\\sqrt[$child_str[1]]{$child_str[0]}"; + } + +# mtext + if ($tag eq 'mtext') { + my $text = $child_str[0]; + my $next = $self->nextSibling; + my $prev = $self->previousSibling; + if (defined $next->{tag} && $next->{tag} eq 'mspace') { + $text = "$text "; + } + if (defined $prev->{tag} && $prev->{tag} eq 'mspace') { + $text = " $text"; + } + $text = ' ' if $text eq ' '; + return "\\mbox{$text}"; + } + + +# mspace + if ($tag eq 'mspace') { + return ''; + } + +# mtable + if ($tag eq 'mtable') { + my $cols = ($child_str[0] =~ tr/&//) + 1; + my $colspec = ($self->{attr}{columnalign} || '') eq 'left' ? 'l' : 'c'; + my $colspecs = $colspec x $cols; + return ("\\begin{array}{$colspecs}\n" . + join('', map(" $_ \\\\\n", @child_str)) . + "\\end{array}\n"); + } + +# mtr + if ($tag eq 'mtr') { + return join ' & ', @child_str; + } + +# mstyle + if ($tag eq 'mstyle') { + @child_str = grep $_ ne '', @child_str; + if ($self->parent->{tag} eq 'math') { + push @child_str, ' ' unless @child_str; + # The top-level mstyle + return (defined $self->{attr}{displaystyle} && + $self->{attr}{displaystyle} eq 'true') ? + "\$\$@child_str\$\$" : "\$@child_str\$"; + } + else { + # It better be a font changing command + return $child_str[0] if $self->{attr}{mathvariant}; + my ($attr) = map($self->{attr}{$_}, + grep $self->{attr}{$_}, + qw(fontweight fontfamily)); + return $attr && $LatexFont{$attr} ? + "$LatexFont{$attr}\{$child_str[0]}" : $child_str[0]; + } + } +} +} + +# Returns the next sibling of a node +# Arguments: None +# Returns: node object or undef +sub nextSibling { + my ($self) = @_; + my $parent = $self->parent; + for (my $i=0; $i<@{$parent->{children}}; $i++) { + return $parent->{children}[$i+1] if $self eq $parent->{children}[$i]; + } + return $Null; +} + +# Returns the tag of a node +# Arguments: None +# Returns: string +sub nodeName : method { + return $_[0]{tag} || ''; +} + +# Returns the text of a text node +# Arguments: None +# Returns: string +sub nodeValue : method { + return $_[0]{text} || ''; +} + +# Returns the parent of a node +# Arguments: none +# Returns: parent node object or undef +sub parent : method { + return $Parent{$_[0]} || $Null; +} + +# Returns the previous sibling of a node +# Arguments: None +# Returns: node object or undef +sub previousSibling { + my ($self) = @_; + my $parent = $self->parent; + for (my $i=1; $i<@{$parent->{children}}; $i++) { + return $parent->{children}[$i-1] if $self eq $parent->{children}[$i]; + } + return $Null; +} + +# Removes a given child node from a node +# Arguments: child node +# Returns: None +# Side-effects: May affect children of the node +sub removeChild : method { + my ($self, $child) = @_; + @{$self->{children}} = grep $_ ne $child, @{$self->{children}} + if $self->{children}; + delete $Parent{$child}; +} + +# Replaces one child node object with another +# Arguments: old child node object, new child node object +# Returns: None +sub replaceChild : method { + my ($self, $new, $old) = @_; + @{$self->{children}} = map $_ eq $old ? $new : $_, @{$self->{children}}; + delete $Parent{$old}; + $Parent{$new} = $self; +} + +# Sets one or more attributes on a node object +# Arguments: set of attribute/value pairs +# Returns: None +sub setAttribute : method { + my $self = shift; + if (@_) { + $self->{attr} = {} unless $self->{attr}; + $self->{attrlist} = [] unless $self->{attrlist}; + } + while (my($aname, $aval) = splice(@_, 0, 2)) { + $aval =~ s/\n//g; + push @{$self->{attrlist}}, $aname unless defined $self->{attr}{$aname}; + $self->{attr}{$aname} = $aval; + } +} + +# Returns the ASCII representation of a node object +# Arguments: None +# Returns: Text string +sub text : method { + my ($self) = @_; + return $self->{text} if defined $self->{text}; + my $tag = $self->{tag}; + my $attr = join '', map(" $_=\"" . + ($_ eq 'xmlns' ? $self->{attr}{$_} : + Text::ASCIIMathML::_xml_encode($self->{attr}{$_})) . + "\"", @{$self->{attrlist}}) + if $tag; + if (@{$self->{children}}) { + my $child_str; + foreach (@{$self->{children}}) { + $child_str .= $_->text; + } + return $tag ? "<$tag$attr>$child_str" : $child_str; + } + return $tag ? "<$tag$attr/>" : ''; +} +} + +1; diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown.pl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown.pl new file mode 100755 index 00000000..9c9f5b15 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown.pl @@ -0,0 +1,2728 @@ +#!/usr/bin/env perl + +# MultiMarkdown -- A modification of John Gruber's original Markdown +# that adds new features and an output format that can more readily +# be converted into other document formats +# +# $Id: MultiMarkdown.pl 525 2009-06-15 18:45:44Z fletcher $ +# +# Original Code Copyright (c) 2004-2007 John Gruber +# +# +# MultiMarkdown changes Copyright (c) 2005-2009 Fletcher T. Penney +# +# +# MultiMarkdown Version 2.0.b6 +# +# Based on Markdown.pl 1.0.2b8 - Wed 09 May 2007 +# +# +# TODO: Change math mode delimiter? +# TODO: Still need to get the glossary working in non-memoir documents +# TODO: A mechanism to include arbitrary code (LaTeX, etc) without being "ugly" +# TODO: Look into discussion re: assigning classes to div's/span's on Markdown list. +# TODO: Improve support for tables with long items and overall width in LaTeX +# TODO: Need a syntax for long table cells in MMD, even if no rowspan feature yet +# TODO: Create utilities to convert MMD tables to/from tab-delimited + + +package MultiMarkdown; +require 5.006_000; +use strict; +use warnings; + +use File::Basename; + +eval {require MT}; # Test to see if we're running in MT. +unless ($@) { + require Text::ASCIIMathML; +} else { # Otherwise look for ASCIIMathML.pm next to MultiMarkdown.pl + my $me = $0; # Where am I? + + # Am I running in Windoze? + my $os = $^O; + + # Get just the directory portion + if ($os =~ /MSWin/) { + $me = dirname($me) . "\\"; + } else { + $me = dirname($me) . "/"; + } + require $me ."ASCIIMathML.pm"; +} + + +use Digest::MD5 qw(md5_hex); +use vars qw($VERSION $g_use_metadata $g_base_url + $g_bibliography_title $g_allow_mathml $g_base_header_level $mathParser); +$VERSION = '2.0.b6'; + +$mathParser = new Text::ASCIIMathML(); + +## Disabled; causes problems under Perl 5.6.1: +# use utf8; +# binmode( STDOUT, ":utf8" ); # c.f.: http://acis.openlib.org/dev/perl-unicode-struggle.html + +# +# Global default settings: +# +my $g_empty_element_suffix = " />"; # Change to ">" for HTML output +my $g_tab_width = 4; +my $g_allow_mathml = 1; +my $g_base_header_level = 1; + +# +# Globals: +# + +# Reusable patterns to match balanced [brackets] and (parens). See +# Friedl's "Mastering Regular Expressions", 2nd Ed., pp. 328-331. +my ($g_nested_brackets, $g_nested_parens); +$g_nested_brackets = qr{ + (?> # Atomic matching + [^\[\]]+ # Anything other than brackets + | + \[ + (??{ $g_nested_brackets }) # Recursive set of nested brackets + \] + )* +}x; + +# Doesn't allow for whitespace, because we're using it to match URLs: +$g_nested_parens = qr{ + (?> # Atomic matching + [^()\s]+ # Anything other than parens or whitespace + | + \( + (??{ $g_nested_parens }) # Recursive set of nested brackets + \) + )* +}x; + + +# Table of hash values for escaped characters: +my %g_escape_table; +foreach my $char (split //, '\\`*_{}[]()>#+-.!') { + $g_escape_table{$char} = md5_hex($char); +} + + +# Global hashes, used by various utility routines +my %g_urls = (); +my %g_titles= (); +my %g_html_blocks = (); +my %g_metadata = (); +my %g_metadata_newline = (); +my %g_crossrefs = (); +my %g_footnotes = (); +my %g_attributes = (); +my @g_used_footnotes = (); +my $g_footnote_counter = 0; + +my $g_citation_counter = 0; +my @g_used_references = (); +my %g_references = (); +$g_bibliography_title = "Bibliography"; + +$g_use_metadata = 1; +$g_metadata_newline{default} = "\n"; +$g_metadata_newline{keywords} = ", "; +my $g_document_format = ""; + +# Used to track when we're inside an ordered or unordered list +# (see _ProcessListItems() for details): +my $g_list_level = 0; + + +#### Blosxom plug-in interface ########################################## + +# Set $g_blosxom_use_meta to 1 to use Blosxom's meta plug-in to determine +# which posts Markdown should process, using a "meta-markup: markdown" +# header. If it's set to 0 (the default), Markdown will process all +# entries. +my $g_blosxom_use_meta = 0; + +sub start { 1; } +sub story { + my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; + + if ( (! $g_blosxom_use_meta) or + (defined($meta::markup) and ($meta::markup =~ /^\s*markdown\s*$/i)) + ){ + $$body_ref = Markdown($$body_ref); + } + 1; +} + + +#### Movable Type plug-in interface ##################################### +eval {require MT}; # Test to see if we're running in MT. +unless ($@) { + require MT; + import MT; + require MT::Template::Context; + import MT::Template::Context; + + eval {require MT::Plugin}; # Test to see if we're running >= MT 3.0. + unless ($@) { + require MT::Plugin; + import MT::Plugin; + my $plugin = new MT::Plugin({ + name => "MultiMarkdown", + description => "Based on the original Markdown", + doc_link => 'http://fletcherpenney.net/MultiMarkdown/' + }); + MT->add_plugin( $plugin ); + } + + MT::Template::Context->add_container_tag(MultiMarkdownOptions => sub { + my $ctx = shift; + my $args = shift; + my $builder = $ctx->stash('builder'); + my $tokens = $ctx->stash('tokens'); + + if (defined ($args->{'output'}) ) { + $ctx->stash('multimarkdown_output', lc $args->{'output'}); + } + + defined (my $str = $builder->build($ctx, $tokens) ) + or return $ctx->error($builder->errstr); + $str; # return value + }); + + MT->add_text_filter('multimarkdown' => { + label => 'MultiMarkdown', + docs => 'http://fletcherpenney.net/MultiMarkdown/', + on_format => sub { + my $text = shift; + my $ctx = shift; + my $raw = 0; + if (defined $ctx) { + my $output = $ctx->stash('multimarkdown_output'); + if (defined $output && $output =~ m/^html/i) { + $g_empty_element_suffix = ">"; + $ctx->stash('multimarkdown_output', ''); + } + elsif (defined $output && $output eq 'raw') { + $raw = 1; + $ctx->stash('multimarkdown_output', ''); + } + else { + $raw = 0; + $g_empty_element_suffix = " />"; + } + } + $text = $raw ? $text : Markdown($text); + $text; + }, + }); + + # If SmartyPants is loaded, add a combo Markdown/SmartyPants text filter: + my $smartypants; + + { + no warnings "once"; + $smartypants = $MT::Template::Context::Global_filters{'smarty_pants'}; + } + + if ($smartypants) { + MT->add_text_filter('multimarkdown_with_smartypants' => { + label => 'MultiMarkdown With SmartyPants', + docs => 'http://fletcherpenney.net/MultiMarkdown/', + on_format => sub { + my $text = shift; + my $ctx = shift; + if (defined $ctx) { + my $output = $ctx->stash('multimarkdown_output'); + if (defined $output && $output eq 'html') { + $g_empty_element_suffix = ">"; + } + else { + $g_empty_element_suffix = " />"; + } + } + $text = Markdown($text); + $text = $smartypants->($text, '1'); + }, + }); + } +} +else { +#### BBEdit/command-line text filter interface ########################## +# Needs to be hidden from MT (and Blosxom when running in static mode). + + # We're only using $blosxom::version once; tell Perl not to warn us: + no warnings 'once'; + unless ( defined($blosxom::version) ) { + use warnings; + + #### Check for command-line switches: ################# + my %cli_opts; + use Getopt::Long; + Getopt::Long::Configure('pass_through'); + GetOptions(\%cli_opts, + 'version', + 'shortversion', + 'html4tags', + ); + if ($cli_opts{'version'}) { # Version info + print "\nThis is MultiMarkdown, version $VERSION.\n"; + print "Original code Copyright 2004 John Gruber\n"; + print "MultiMarkdown changes Copyright 2005-2009 Fletcher Penney\n"; + print "http://fletcherpenney.net/multimarkdown/\n"; + print "http://daringfireball.net/projects/markdown/\n\n"; + exit 0; + } + if ($cli_opts{'shortversion'}) { # Just the version number string. + print $VERSION; + exit 0; + } + if ($cli_opts{'html4tags'}) { # Use HTML tag style instead of XHTML + $g_empty_element_suffix = ">"; + } + + + #### Process incoming text: ########################### + my $text; + { + local $/; # Slurp the whole file + $text = <>; + } + print Markdown($text); + } +} + + + +sub Markdown { +# +# Main function. The order in which other subs are called here is +# essential. Link and image substitutions need to happen before +# _EscapeSpecialCharsWithinTagAttributes(), so that any *'s or _'s in the +# and tags get encoded. +# + my $text = shift; + + # Clear the global hashes. If we don't clear these, you get conflicts + # from other articles when generating a page which contains more than + # one article (e.g. an index page that shows the N most recent + # articles): + %g_urls = (); + %g_titles = (); + %g_html_blocks = (); + %g_metadata = (); + %g_crossrefs = (); + %g_footnotes = (); + @g_used_footnotes = (); + $g_footnote_counter = 0; + @g_used_references = (); + %g_references = (); + $g_citation_counter = 0; + %g_attributes = (); + + + # Standardize line endings: + $text =~ s{\r\n}{\n}g; # DOS to Unix + $text =~ s{\r}{\n}g; # Mac to Unix + + # Make sure $text ends with a couple of newlines: + $text .= "\n\n"; + + # Convert all tabs to spaces. + $text = _Detab($text); + + # Strip any lines consisting only of spaces and tabs. + # This makes subsequent regexen easier to write, because we can + # match consecutive blank lines with /\n+/ instead of something + # contorted like /[ \t]*\n+/ . + $text =~ s/^[ \t]+$//mg; + + # Strip out MetaData + $text = _ParseMetaData($text) if $g_use_metadata; + + # And recheck for leading blank lines + $text =~ s/^\n+//s; + + # Turn block-level HTML blocks into hash entries + $text = _HashHTMLBlocks($text); + + # Strip footnote and link definitions, store in hashes. + $text = _StripFootnoteDefinitions($text); + + $text = _StripLinkDefinitions($text); + + _GenerateImageCrossRefs($text); + + $text = _StripMarkdownReferences($text); + + $text = _RunBlockGamut($text); + + $text = _DoMarkdownCitations($text); + + $text = _DoFootnotes($text); + + $text = _UnescapeSpecialChars($text); + + # Clean encoding within HTML comments + $text = _UnescapeComments($text); + + $text = _FixFootnoteParagraphs($text); + $text .= _PrintFootnotes(); + + $text .= _PrintMarkdownBibliography(); + + $text = _ConvertCopyright($text); + + if (lc($g_document_format) =~ /^complete\s*$/i) { + return xhtmlMetaData() . "\n\n" . $text . "\n\n"; + } elsif (lc($g_document_format) =~ /^snippet\s*$/i) { + return $text . "\n"; + } else { + return $g_document_format . textMetaData() . $text . "\n"; + } + +} + + +sub _StripLinkDefinitions { +# +# Strips link definitions from text, stores the URLs and titles in +# hash references. +# + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + # Link defs are in the form: ^[id]: url "optional title" + while ($text =~ s{ + # Pattern altered for MultiMarkdown + # in order to not match citations or footnotes + ^[ ]{0,$less_than_tab}\[([^#^].*)\]: # id = $1 + [ \t]* + \n? # maybe *one* newline + [ \t]* + ? # url = $2 + [ \t]* + \n? # maybe one newline + [ \t]* + (?: + (?<=\s) # lookbehind for whitespace + ["(] + (.+?) # title = $3 + [")] + [ \t]* + )? # title is optional + + # MultiMarkdown addition for attribute support + \n? + ( # Attributes = $4 + (?<=\s) # lookbehind for whitespace + (([ \t]*\n)?[ \t]*((\S+=\S+)|(\S+=".*?")))* + )? + [ \t]* + # /addition + (?:\n+|\Z) + } + {}mx) { + $g_urls{lc $1} = _EncodeAmpsAndAngles( $2 ); # Link IDs are case-insensitive + if ($3) { + $g_titles{lc $1} = $3; + $g_titles{lc $1} =~ s/"/"/g; + } + + # MultiMarkdown addition " + if ($4) { + $g_attributes{lc $1} = $4; + } + # /addition + } + + return $text; +} + +sub _StripHTML { + # Strip (X)HTML code from string + my $text = shift; + + $text =~ s/<.*?>//g; + + return $text; +} + +sub _HashHTMLBlocks { + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + # Hashify HTML blocks: + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

    s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded: + my $block_tags = qr{ + (?: + p | div | h[1-6] | blockquote | pre | table | + dl | ol | ul | script | noscript | form | + fieldset | iframe | ins | del + ) + }x; # MultiMarkdown does not include `math` in the above list so that + # Equations can optionally be included in separate paragraphs + + my $tag_attrs = qr{ + (?: # Match one attr name/value pair + \s+ # There needs to be at least some whitespace + # before each attribute name. + [\w.:_-]+ # Attribute name + \s*=\s* + (?: + ".+?" # "Attribute value" + | + '.+?' # 'Attribute value' + ) + )* # Zero or more + }x; + + my $empty_tag = qr{< \w+ $tag_attrs \s* />}xms; + my $open_tag = qr{< $block_tags $tag_attrs \s* >}xms; + my $close_tag = undef; # let Text::Balanced handle this + + use Text::Balanced qw(gen_extract_tagged); + my $extract_block = gen_extract_tagged($open_tag, $close_tag, undef, { ignore => [$empty_tag] }); + + my @chunks; + ## TO-DO: the 0,3 on the next line ought to respect the + ## tabwidth, or else, we should mandate 4-space tabwidth and + ## be done with it: + while ($text =~ s{^(([ ]{0,3}<)?.*\n)}{}m) { + my $cur_line = $1; + if (defined $2) { + # current line could be start of code block + + my ($tag, $remainder) = $extract_block->($cur_line . $text); + if ($tag) { + my $key = md5_hex($tag); + $g_html_blocks{$key} = $tag; + push @chunks, "\n\n" . $key . "\n\n"; + $text = $remainder; + } + else { + # No tag match, so toss $cur_line into @chunks + push @chunks, $cur_line; + } + } + else { + # current line could NOT be start of code block + push @chunks, $cur_line; + } + + } + push @chunks, $text; # Whatever is left. + + $text = join '', @chunks; + + + + # Special case just for


    . It was easier to make a special case than + # to make the other regex more complicated. + $text =~ s{ + (?: + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + [ ]{0,$less_than_tab} + <(hr) # start tag = $2 + \b # word break + ([^<>])*? # + /?> # the matching end tag + [ \t]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + ) + }{ + my $key = md5_hex($1); + $g_html_blocks{$key} = $1; + "\n\n" . $key . "\n\n"; + }egx; + + # Special case for standalone HTML comments: + $text =~ s{ + (?: + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + [ ]{0,$less_than_tab} + (?s: + + ) + [ \t]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + ) + }{ + my $key = md5_hex($1); + $g_html_blocks{$key} = $1; + "\n\n" . $key . "\n\n"; + }egx; + + # PHP and ASP-style processor instructions ( and <%…%>) + $text =~ s{ + (?: + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + [ ]{0,$less_than_tab} + (?s: + <([?%]) # $2 + .*? + \2> + ) + [ \t]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + ) + }{ + my $key = md5_hex($1); + $g_html_blocks{$key} = $1; + "\n\n" . $key . "\n\n"; + }egx; + + + return $text; +} + + +sub _RunBlockGamut { +# +# These are all the transformations that form block-level +# tags like paragraphs, headers, and list items. +# + my $text = shift; + + $text = _DoHeaders($text); + + # Do tables first to populate the table id's for cross-refs + # Escape
     so we don't get greedy with tables
    +	$text = _DoTables($text);
    +	
    +	# And now, protect our tables
    +	$text = _HashHTMLBlocks($text);
    +
    +	# Do Horizontal Rules:
    +	$text =~ s{^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$}{\n tags around block-level tags.
    +	$text = _HashHTMLBlocks($text);
    +	$text = _FormParagraphs($text);
    +
    +	return $text;
    +}
    +
    +
    +sub _RunSpanGamut {
    +#
    +# These are all the transformations that occur *within* block-level
    +# tags like paragraphs, headers, and list items.
    +#
    +	my $text = shift;
    +
    +	$text = _DoCodeSpans($text);
    +	$text = _DoMathSpans($text);
    +	$text = _EscapeSpecialCharsWithinTagAttributes($text);
    +	$text = _EncodeBackslashEscapes($text);
    +
    +	# Process anchor and image tags. Images must come first,
    +	# because ![foo][f] looks like an anchor.
    +	$text = _DoImages($text);
    +	$text = _DoAnchors($text);	
    +
    +	# Make links out of things like ``
    +	# Must come after _DoAnchors(), because you can use < and >
    +	# delimiters in inline links like [this]().
    +	$text = _DoAutoLinks($text);
    +	$text = _EncodeAmpsAndAngles($text);
    +	$text = _DoItalicsAndBold($text);
    +
    +	# Do hard breaks:
    +	$text =~ s/ {2,}\n/  -- encode [\ ` * _] so they
    +# don't conflict with their use in Markdown for code, italics and strong.
    +# We're replacing each such character with its corresponding MD5 checksum
    +# value; this is likely overkill, but it should prevent us from colliding
    +# with the escape values by accident.
    +#
    +	my $text = shift;
    +	my $tokens ||= _TokenizeHTML($text);
    +	$text = '';   # rebuild $text from the tokens
    +
    +	foreach my $cur_token (@$tokens) {
    +		if ($cur_token->[0] eq "tag") {
    +			$cur_token->[1] =~  s! \\ !$g_escape_table{'\\'}!gx;
    +			$cur_token->[1] =~  s{ (?<=.)(?=.)  }{$g_escape_table{'`'}}gx;
    +			$cur_token->[1] =~  s! \* !$g_escape_table{'*'}!gx;
    +			$cur_token->[1] =~  s! _  !$g_escape_table{'_'}!gx;
    +		}
    +		$text .= $cur_token->[1];
    +	}
    +	return $text;
    +}
    +
    +
    +sub _DoAnchors {
    +#
    +# Turn Markdown link shortcuts into XHTML  tags.
    +#
    +	my $text = shift;
    +
    +	#
    +	# First, handle reference-style links: [link text] [id]
    +	#
    +	$text =~ s{
    +		(					# wrap whole match in $1
    +		  \[
    +		    ($g_nested_brackets)	# link text = $2
    +		  \]
    +
    +		  [ ]?				# one optional space
    +		  (?:\n[ ]*)?		# one optional newline followed by spaces
    +
    +		  \[
    +		    (.*?)		# id = $3
    +		  \]
    +		)
    +	}{
    +		my $result;
    +		my $whole_match = $1;
    +		my $link_text   = $2;
    +		my $link_id     = lc $3;
    +
    +		if ($link_id eq "") {
    +			$link_id = lc $link_text;     # for shortcut links like [this][].
    +		}
    +
    +		# Allow automatic cross-references to headers
    +		my $label = Header2Label($link_id);
    +		if (defined $g_urls{$link_id}) {
    +			my $url = $g_urls{$link_id};
    +			$url =~ s! \* !$g_escape_table{'*'}!gx;		# We've got to encode these to avoid
    +			$url =~ s!  _ !$g_escape_table{'_'}!gx;		# conflicting with italics/bold.
    +			$result = "$}{$1};					# Remove <>'s surrounding URL, if present
    +		$result = " tags.
    +#
    +	my $text = shift;
    +
    +	#
    +	# First, handle reference-style labeled images: ![alt text][id]
    +	#
    +	$text =~ s{
    +		(				# wrap whole match in $1
    +		  !\[
    +		    (.*?)		# alt text = $2
    +		  \]
    +
    +		  [ ]?				# one optional space
    +		  (?:\n[ ]*)?		# one optional newline followed by spaces
    +
    +		  \[
    +		    (.*?)		# id = $3
    +		  \]
    +
    +		)
    +	}{
    +		my $result;
    +		my $whole_match = $1;
    +		my $alt_text    = $2;
    +		my $link_id     = lc $3;
    +
    +		if ($link_id eq "") {
    +			$link_id = lc $alt_text;     # for shortcut links like ![this][].
    +		}
    +
    +		$alt_text =~ s/"/"/g;
    +		if (defined $g_urls{$link_id}) {
    +			my $url = $g_urls{$link_id};
    +			$url =~ s! \* !$g_escape_table{'*'}!gx;		# We've got to encode these to avoid
    +			$url =~ s!  _ !$g_escape_table{'_'}!gx;		# conflicting with italics/bold.
    +			
    +			my $label = Header2Label($alt_text);
    +			$g_crossrefs{$label} = "#$label";
    +			if (! defined $g_titles{$link_id}) {
    +				$g_titles{$link_id} = $alt_text;
    +			}
    +			
    +			$result = "\"$alt_text\"";$}{$1};					# Remove <>'s surrounding URL, if present
    +
    +		my $label = Header2Label($alt_text);
    +		$g_crossrefs{$label} = "#$label";
    +#		$g_titles{$label} = $alt_text;			# I think this line should not be here
    +			
    +		$result = "\"$alt_text\"";"  .  $header  .  "\n\n";
    +	}egmx;
    +
    +	$text =~ s{ ^(.+?)(?:\s*(?"  .  $header  .  "\n\n";
    +	}egmx;
    +
    +
    +	# atx-style headers:
    +	#	# Header 1
    +	#	## Header 2
    +	#	## Header 2 with closing hashes ##
    +	#	...
    +	#	###### Header 6
    +	#
    +	$text =~ s{
    +			^(\#{1,6})	# $1 = string of #'s
    +			[ \t]*
    +			(.+?)		# $2 = Header text
    +			[ \t]*
    +			(?:(?"  .  $header  .  "\n\n";
    +		}egmx;
    +
    +	return $text;
    +}
    +
    +
    +sub _DoLists {
    +#
    +# Form HTML ordered (numbered) and unordered (bulleted) lists.
    +#
    +	my $text = shift;
    +	my $less_than_tab = $g_tab_width - 1;
    +
    +	# Re-usable patterns to match list item bullets and number markers:
    +	my $marker_ul  = qr/[*+-]/;
    +	my $marker_ol  = qr/\d+[.]/;
    +	my $marker_any = qr/(?:$marker_ul|$marker_ol)/;
    +
    +	# Re-usable pattern to match any entirel ul or ol list:
    +	my $whole_list = qr{
    +		(								# $1 = whole list
    +		  (								# $2
    +			[ ]{0,$less_than_tab}
    +			(${marker_any})				# $3 = first list item marker
    +			[ \t]+
    +		  )
    +		  (?s:.+?)
    +		  (								# $4
    +			  \z
    +			|
    +			  \n{2,}
    +			  (?=\S)
    +			  (?!						# Negative lookahead for another list item marker
    +				[ \t]*
    +				${marker_any}[ \t]+
    +			  )
    +		  )
    +		)
    +	}mx;
    +
    +	# We use a different prefix before nested lists than top-level lists.
    +	# See extended comment in _ProcessListItems().
    +	#
    +	# Note: There's a bit of duplication here. My original implementation
    +	# created a scalar regex pattern as the conditional result of the test on
    +	# $g_list_level, and then only ran the $text =~ s{...}{...}egmx
    +	# substitution once, using the scalar as the pattern. This worked,
    +	# everywhere except when running under MT on my hosting account at Pair
    +	# Networks. There, this caused all rebuilds to be killed by the reaper (or
    +	# perhaps they crashed, but that seems incredibly unlikely given that the
    +	# same script on the same server ran fine *except* under MT. I've spent
    +	# more time trying to figure out why this is happening than I'd like to
    +	# admit. My only guess, backed up by the fact that this workaround works,
    +	# is that Perl optimizes the substition when it can figure out that the
    +	# pattern will never change, and when this optimization isn't on, we run
    +	# afoul of the reaper. Thus, the slightly redundant code that uses two
    +	# static s/// patterns rather than one conditional pattern.
    +
    +	if ($g_list_level) {
    +		$text =~ s{
    +				^
    +				$whole_list
    +			}{
    +				my $list = $1;
    +				my $list_type = ($3 =~ m/$marker_ul/) ? "ul" : "ol";
    +
    +				# Turn double returns into triple returns, so that we can make a
    +				# paragraph for the last item in a list, if necessary:
    +				$list =~ s/\n{2,}/\n\n\n/g;
    +				my $result = _ProcessListItems($list, $marker_any);
    +
    +				# Trim any trailing whitespace, to put the closing ``
    +				# up on the preceding line, to get it past the current stupid
    +				# HTML block parser. This is a hack to work around the terrible
    +				# hack that is the HTML block parser.
    +				$result =~ s{\s+$}{};
    +				$result = "<$list_type>" . $result . "\n";
    +				$result;
    +			}egmx;
    +	}
    +	else {
    +		$text =~ s{
    +				(?:(?<=\n\n)|\A\n?)
    +				$whole_list
    +			}{
    +				my $list = $1;
    +				my $list_type = ($3 =~ m/$marker_ul/) ? "ul" : "ol";
    +				# Turn double returns into triple returns, so that we can make a
    +				# paragraph for the last item in a list, if necessary:
    +				$list =~ s/\n{2,}/\n\n\n/g;
    +				my $result = _ProcessListItems($list, $marker_any);
    +				$result = "<$list_type>\n" . $result . "\n";
    +				$result;
    +			}egmx;
    +	}
    +
    +
    +	return $text;
    +}
    +
    +
    +sub _ProcessListItems {
    +#
    +#	Process the contents of a single ordered or unordered list, splitting it
    +#	into individual list items.
    +#
    +
    +	my $list_str = shift;
    +	my $marker_any = shift;
    +
    +
    +	# The $g_list_level global keeps track of when we're inside a list.
    +	# Each time we enter a list, we increment it; when we leave a list,
    +	# we decrement. If it's zero, we're not in a list anymore.
    +	#
    +	# We do this because when we're not inside a list, we want to treat
    +	# something like this:
    +	#
    +	#		I recommend upgrading to version
    +	#		8. Oops, now this line is treated
    +	#		as a sub-list.
    +	#
    +	# As a single paragraph, despite the fact that the second line starts
    +	# with a digit-period-space sequence.
    +	#
    +	# Whereas when we're inside a list (or sub-list), that line will be
    +	# treated as the start of a sub-list. What a kludge, huh? This is
    +	# an aspect of Markdown's syntax that's hard to parse perfectly
    +	# without resorting to mind-reading. Perhaps the solution is to
    +	# change the syntax rules such that sub-lists must start with a
    +	# starting cardinal number; e.g. "1." or "a.".
    +
    +	$g_list_level++;
    +
    +	# trim trailing blank lines:
    +	$list_str =~ s/\n{2,}\z/\n/;
    +
    +
    +	$list_str =~ s{
    +		(\n)?							# leading line = $1
    +		(^[ \t]*)						# leading whitespace = $2
    +		($marker_any) [ \t]+			# list marker = $3
    +		((?s:.+?)						# list item text   = $4
    +		(\n{1,2}))
    +		(?= \n* (\z | \2 ($marker_any) [ \t]+))
    +	}{
    +		my $item = $4;
    +		my $leading_line = $1;
    +		my $leading_space = $2;
    +
    +		if ($leading_line or ($item =~ m/\n{2,}/)) {
    +			$item = _RunBlockGamut(_Outdent($item));
    +		}
    +		else {
    +			# Recursion for sub-lists:
    +			$item = _DoLists(_Outdent($item));
    +			chomp $item;
    +			$item = _RunSpanGamut($item);
    +		}
    +
    +		"
  • " . $item . "
  • \n"; + }egmx; + + $g_list_level--; + return $list_str; +} + + + +sub _DoCodeBlocks { +# +# Process Markdown `
    ` blocks.
    +#	
    +
    +	my $text = shift;
    +
    +	$text =~ s{
    +			(?:\n\n|\A)
    +			(	            # $1 = the code block -- one or more lines, starting with a space/tab
    +			  (?:
    +			    (?:[ ]{$g_tab_width} | \t)  # Lines must start with a tab or a tab-width of spaces
    +			    .*\n+
    +			  )+
    +			)
    +			((?=^[ ]{0,$g_tab_width}\S)|\Z)	# Lookahead for non-space at line-start, or end of doc
    +		}{
    +			my $codeblock = $1;
    +			my $result; # return value
    +
    +			$codeblock = _EncodeCode(_Outdent($codeblock));
    +			$codeblock = _Detab($codeblock);
    +			$codeblock =~ s/\A\n+//; # trim leading newlines
    +			$codeblock =~ s/\n+\z//; # trim trailing newlines
    +
    +			$result = "\n\n
    " . $codeblock . "
    \n\n"; # CHANGED: Removed newline for MMD + + $result; + }egmx; + + return $text; +} + + +sub _DoCodeSpans { +# +# * Backtick quotes are used for spans. +# +# * You can use multiple backticks as the delimiters if you want to +# include literal backticks in the code span. So, this input: +# +# Just type ``foo `bar` baz`` at the prompt. +# +# Will translate to: +# +#

    Just type foo `bar` baz at the prompt.

    +# +# There's no arbitrary limit to the number of backticks you +# can use as delimters. If you need three consecutive backticks +# in your code, use four for delimiters, etc. +# +# * You can use spaces to get literal backticks at the edges: +# +# ... type `` `bar` `` ... +# +# Turns to: +# +# ... type `bar` ... +# + + my $text = shift; + + $text =~ s@ + (?$c
    "; + @egsx; + + return $text; +} + + +sub _EncodeCode { +# +# Encode/escape certain characters inside Markdown code runs. +# The point is that in code, these characters are literals, +# and lose their special Markdown meanings. +# + local $_ = shift; + + # Encode all ampersands; HTML entities are not + # entities within a Markdown code span. + s/&/&/g; + + # Encode $'s, but only if we're running under Blosxom. + # (Blosxom interpolates Perl variables in article bodies.) + { + no warnings 'once'; + if (defined($blosxom::version)) { + s/\$/$/g; + } + } + + + # Do the angle bracket song and dance: + s! < !<!gx; + s! > !>!gx; + + # Now, escape characters that are magic in Markdown: + s! \* !$g_escape_table{'*'}!gx; + s! _ !$g_escape_table{'_'}!gx; + s! { !$g_escape_table{'{'}!gx; + s! } !$g_escape_table{'}'}!gx; + s! \[ !$g_escape_table{'['}!gx; + s! \] !$g_escape_table{']'}!gx; + s! \\ !$g_escape_table{'\\'}!gx; + + return $_; +} + + +sub _DoItalicsAndBold { + my $text = shift; + + # Cave in - `*` and `_` behave differently... We'll see how it works out + + + # must go first: + $text =~ s{ (?$2}gsx; + + $text =~ s{ (?$2}gsx; + + # And now, a second pass to catch nested strong and emphasis special cases + $text =~ s{ (?$2}gsx; + + $text =~ s{ (?$2}gsx; + + # And now, allow `*` in the middle of words + + # must go first: + $text =~ s{ (\*\*) (?=\S) (.+?[*]*) (?<=\S) \1 } + {$2}gsx; + + $text =~ s{ (\*) (?=\S) (.+?) (?<=\S) \1 } + {$2}gsx; + + return $text; +} + + +sub _DoBlockQuotes { + my $text = shift; + + $text =~ s{ + ( # Wrap whole match in $1 + ( + ^[ \t]*>[ \t]? # '>' at the start of a line + .+\n # rest of the first line + (.+\n)* # subsequent consecutive lines + \n* # blanks + )+ + ) + }{ + my $bq = $1; + $bq =~ s/^[ \t]*>[ \t]?//gm; # trim one level of quoting + $bq =~ s/^[ \t]+$//mg; # trim whitespace-only lines + $bq = _RunBlockGamut($bq); # recurse + + $bq =~ s/^/ /g; + # These leading spaces screw with
     content, so we need to fix that:
    +			$bq =~ s{
    +					(\s*
    .+?
    ) + }{ + my $pre = $1; + $pre =~ s/^ //mg; + $pre; + }egsx; + + "
    \n$bq\n
    \n\n"; + }egmx; + + + return $text; +} + + +sub _FormParagraphs { +# +# Params: +# $text - string to process with html

    tags +# + my $text = shift; + + # Strip leading and trailing lines: + $text =~ s/\A\n+//; + $text =~ s/\n+\z//; + + my @grafs = split(/\n{2,}/, $text); + + # + # Wrap

    tags. + # + foreach (@grafs) { + unless (defined( $g_html_blocks{$_} )) { + $_ = _RunSpanGamut($_); + s/^([ \t]*)/

    /; + $_ .= "

    "; + } + } + + # + # Unhashify HTML blocks + # +# foreach my $graf (@grafs) { +# my $block = $g_html_blocks{$graf}; +# if (defined $block) { +# $graf = $block; +# } +# } + + foreach my $graf (@grafs) { + # Modify elements of @grafs in-place... + my $block = $g_html_blocks{$graf}; + if (defined $block) { + $graf = $block; + if ($block =~ m{ + \A + ( # $1 =
    tag +
    ]* + \b + markdown\s*=\s* (['"]) # $2 = attr quote char + 1 + \2 + [^>]* + > + ) + ( # $3 = contents + .* + ) + (
    ) # $4 = closing tag + \z + + }xms + ) { + my ($div_open, $div_content, $div_close) = ($1, $3, $4); + + # We can't call Markdown(), because that resets the hash; + # that initialization code should be pulled into its own sub, though. + $div_content = _HashHTMLBlocks($div_content); + $div_content = _StripLinkDefinitions($div_content); + $div_content = _RunBlockGamut($div_content); + $div_content = _UnescapeSpecialChars($div_content); + + $div_open =~ s{\smarkdown\s*=\s*(['"]).+?\1}{}ms; + + $graf = $div_open . "\n" . $div_content . "\n" . $div_close; + } + } + } + + + return join "\n\n", @grafs; +} + + +sub _EncodeAmpsAndAngles { +# Smart processing for ampersands and angle brackets that need to be encoded. + + my $text = shift; + + # Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin: + # http://bumppo.net/projects/amputator/ + $text =~ s/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/&/g; + + # Encode naked <'s + $text =~ s{<(?![a-z/?\$!])}{<}gi; + + return $text; +} + + +sub _EncodeBackslashEscapes { +# +# Parameter: String. +# Returns: The string, with after processing the following backslash +# escape sequences. +# + local $_ = shift; + + s! \\\\ !$g_escape_table{'\\'}!gx; # Must process escaped backslashes first. + s! \\` !$g_escape_table{'`'}!gx; + s! \\\* !$g_escape_table{'*'}!gx; + s! \\_ !$g_escape_table{'_'}!gx; + s! \\\{ !$g_escape_table{'{'}!gx; + s! \\\} !$g_escape_table{'}'}!gx; + s! \\\[ !$g_escape_table{'['}!gx; + s! \\\] !$g_escape_table{']'}!gx; + s! \\\( !$g_escape_table{'('}!gx; + s! \\\) !$g_escape_table{')'}!gx; + s! \\> !$g_escape_table{'>'}!gx; + s! \\\# !$g_escape_table{'#'}!gx; + s! \\\+ !$g_escape_table{'+'}!gx; + s! \\\- !$g_escape_table{'-'}!gx; + s! \\\. !$g_escape_table{'.'}!gx; + s{ \\! }{$g_escape_table{'!'}}gx; + + return $_; +} + + +sub _DoAutoLinks { + my $text = shift; + + $text =~ s{<((https?|ftp|dict):[^'">\s]+)>}{
    $1}gi; + + # Email addresses: + $text =~ s{ + < + (?:mailto:)? + ( + [-.\w]+ + \@ + [-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+ + ) + > + }{ + _EncodeEmailAddress( _UnescapeSpecialChars($1) ); + }egix; + + return $text; +} + + +sub _EncodeEmailAddress { +# +# Input: an email address, e.g. "foo@example.com" +# +# Output: the email address as a mailto link, with each character +# of the address encoded as either a decimal or hex entity, in +# the hopes of foiling most address harvesting spam bots. E.g.: +# +# foo +# @example.com +# +# Based on a filter by Matthew Wickline, posted to the BBEdit-Talk +# mailing list: +# + + my $addr = shift; + + srand; + my @encode = ( + sub { '&#' . ord(shift) . ';' }, + sub { '&#x' . sprintf( "%X", ord(shift) ) . ';' }, + sub { shift }, + ); + + $addr = "mailto:" . $addr; + + $addr =~ s{(.)}{ + my $char = $1; + if ( $char eq '@' ) { + # this *must* be encoded. I insist. + $char = $encode[int rand 1]->($char); + } elsif ( $char ne ':' ) { + # leave ':' alone (to spot mailto: later) + my $r = rand; + # roughly 10% raw, 45% hex, 45% dec + $char = ( + $r > .9 ? $encode[2]->($char) : + $r < .45 ? $encode[1]->($char) : + $encode[0]->($char) + ); + } + $char; + }gex; + + $addr = qq{$addr}; + $addr =~ s{">.+?:}{">}; # strip the mailto: from the visible part + + return $addr; +} + + +sub _UnescapeSpecialChars { +# +# Swap back in all the special characters we've hidden. +# + my $text = shift; + + while( my($char, $hash) = each(%g_escape_table) ) { + $text =~ s/$hash/$char/g; + } + return $text; +} + + +sub _TokenizeHTML { +# +# Parameter: String containing HTML markup. +# Returns: Reference to an array of the tokens comprising the input +# string. Each token is either a tag (possibly with nested, +# tags contained therein, such as , or a +# run of text between tags. Each element of the array is a +# two-element array; the first is either 'tag' or 'text'; +# the second is the actual value. +# +# +# Derived from the _tokenize() subroutine from Brad Choate's MTRegex plugin. +# +# + + my $str = shift; + my $pos = 0; + my $len = length $str; + my @tokens; + + my $depth = 6; + my $nested_tags = join('|', ('(?:<[a-z/!$](?:[^<>]') x $depth) . (')*>)' x $depth); + my $match = qr/(?s: ) | # comment + (?s: <\? .*? \?> ) | # processing instruction + $nested_tags/ix; # nested tags + + while ($str =~ m/($match)/g) { + my $whole_tag = $1; + my $sec_start = pos $str; + my $tag_start = $sec_start - length $whole_tag; + if ($pos < $tag_start) { + push @tokens, ['text', substr($str, $pos, $tag_start - $pos)]; + } + push @tokens, ['tag', $whole_tag]; + $pos = pos $str; + } + push @tokens, ['text', substr($str, $pos, $len - $pos)] if $pos < $len; + + return \@tokens; +} + + +sub _Outdent { +# +# Remove one level of line-leading tabs or spaces +# + my $text = shift; + + $text =~ s/^(\t|[ ]{1,$g_tab_width})//gm; + return $text; +} + + +sub _Detab { +# +# Cribbed from a post by Bart Lateur: +# +# + my $text = shift; + + $text =~ s{(.*?)\t}{$1.(' ' x ($g_tab_width - length($1) % $g_tab_width))}ge; + return $text; +} + +# +# MultiMarkdown Routines +# + +sub _ParseMetaData { + my $text = shift; + my $clean_text = ""; + + my ($inMetaData, $currentKey) = (1,''); + + # If only metadata is "Format: complete" then skip + + if ($text =~ s/^(Format):\s*complete\n(.*?)\n/$2\n/is) { + # If "Format: complete" was added automatically, don't force first + # line of text to be metadata + $g_metadata{$1}= "complete"; + $g_document_format = "complete"; + } + + foreach my $line ( split /\n/, $text ) { + $line =~ /^$/ and $inMetaData = 0; + if ($inMetaData) { + if ($line =~ /^([a-zA-Z0-9][0-9a-zA-Z _-]*?):\s*(.*)$/ ) { + $currentKey = $1; + my $meta = $2; + $currentKey =~ s/\s+/ /g; + $currentKey =~ s/\s$//; + $g_metadata{$currentKey} = $meta; + if (lc($currentKey) eq "format") { + $g_document_format = lc($g_metadata{$currentKey}); + } + if (lc($currentKey) eq "base url") { + $g_base_url = $g_metadata{$currentKey}; + } + if (lc($currentKey) eq "bibliography title") { + $g_bibliography_title = $g_metadata{$currentKey}; + $g_bibliography_title =~ s/\s*$//; + } + if (lc($currentKey) eq "base header level") { + $g_base_header_level = $g_metadata{$currentKey}; + } + if (!$g_metadata_newline{$currentKey}) { + $g_metadata_newline{$currentKey} = $g_metadata_newline{default}; + } + } else { + if ($currentKey eq "") { + # No metadata present + $clean_text .= "$line\n"; + $inMetaData = 0; + next; + } + if ($line =~ /^\s*(.+)$/ ) { + $g_metadata{$currentKey} .= "$g_metadata_newline{$currentKey}$1"; + } + } + } else { + $clean_text .= "$line\n"; + } + } + + return $clean_text; +} + +sub _StripFootnoteDefinitions { + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + while ($text =~ s{ + \n[ ]{0,$less_than_tab}\[\^([^\n]+?)\]\:[ \t]*# id = $1 + \n? + (.*?)\n{1,2} # end at new paragraph + ((?=\n[ ]{0,$less_than_tab}\S)|\Z) # Lookahead for non-space at line-start, or end of doc + } + {\n}sx) + { + my $id = $1; + my $footnote = "$2\n"; + $footnote =~ s/^[ ]{0,$g_tab_width}//gm; + + $g_footnotes{id2footnote($id)} = $footnote; + } + + return $text; +} + +sub _DoFootnotes { + my $text = shift; + + # First, run routines that get skipped in footnotes + foreach my $label (sort keys %g_footnotes) { + my $footnote = _RunBlockGamut($g_footnotes{$label}); + + $footnote = _DoMarkdownCitations($footnote); + $g_footnotes{$label} = $footnote; + } + + $text =~ s{ + \[\^(.+?)\] # id = $1 + }{ + my $result = ""; + my $id = id2footnote($1); + if (defined $g_footnotes{$id} ) { + $g_footnote_counter++; + if ($g_footnotes{$id} =~ /^(

    )?glossary:/i) { + $result = "$g_footnote_counter"; + } else { + $result = "$g_footnote_counter"; + } + push (@g_used_footnotes,$id); + } + $result; + }xsge; + + return $text; +} + +sub _FixFootnoteParagraphs { + my $text = shift; + + $text =~ s/^\\<\/footnote\>/<\/footnote>/gm; + + return $text; +} + +sub _PrintFootnotes{ + my $footnote_counter = 0; + my $result = ""; + + foreach my $id (@g_used_footnotes) { + $footnote_counter++; + my $footnote = $g_footnotes{$id}; + my $footnote_closing_tag = ""; + + $footnote =~ s/(\<\/(p(re)?|ol|ul)\>)$//; + $footnote_closing_tag = $1; + + if ($footnote =~ s/^(

    )?glossary:\s*//i) { + # Add some formatting for glossary entries + + $footnote =~ s{ + ^(.*?) # $1 = term + \s* + (?:\(([^\(\)]*)\)[^\n]*)? # $2 = optional sort key + \n + }{ + my $glossary = "$1"; + + if ($2) { + $glossary.="$2"; + }; + + $glossary . ":

    "; + }egsx; + + $result.="

  • $footnote ↩$footnote_closing_tag
  • \n\n"; + } else { + $result.="
  • $footnote ↩$footnote_closing_tag
  • \n\n"; + } + } + $result .= "\n
    "; + + if ($footnote_counter > 0) { + $result = "\n\n
    \n\n\n".$result; + } else { + $result = ""; + } + + $result= _UnescapeSpecialChars($result); + return $result; +} + +sub Header2Label { + my $header = shift; + my $label = lc $header; + $label =~ s/[^A-Za-z0-9:_.-]//g; # Strip illegal characters + while ($label =~ s/^[^A-Za-z]//g) + {}; # Strip illegal leading characters + return $label; +} + +sub id2footnote { + # Since we prepend "fn:", we can allow leading digits in footnotes + my $id = shift; + my $footnote = lc $id; + $footnote =~ s/[^A-Za-z0-9:_.-]//g; # Strip illegal characters + return $footnote; +} + + +sub xhtmlMetaData { + my $result = qq{\n}; + + # This screws up xsltproc - make sure to use `-nonet -novalid` if you + # have difficulty + if ($g_allow_mathml) { + $result .= qq{ +\n}; + + $result.= qq{\n\t\n}; + } else { + $result .= qq{\n}; + + $result.= qq!\n\t\n!; + } + + $result.= "\t\t\n"; + + foreach my $key (sort keys %g_metadata ) { + # Strip trailing spaces + $g_metadata{$key} =~ s/(\s)*$//s; + + # Strip spaces from key + my $export_key = $key; + $export_key =~ s/\s//g; + + if (lc($key) eq "title") { + $result.= "\t\t" . _EncodeAmpsAndAngles($g_metadata{$key}) . "\n"; + } elsif (lc($key) eq "css") { + $result.= "\t\t\n/g; + + if ($result ne "") { + $result.= "\n"; + } + + return $result; +} + +sub _ConvertCopyright{ + my $text = shift; + # Convert to an XML compatible form of copyright symbol + + $text =~ s/©/©/gi; + + return $text; +} + + +sub _DoTables { + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + # Algorithm inspired by PHP Markdown Extra's table support + # + + # Reusable regexp's to match table + + my $line_start = qr{ + [ ]{0,$less_than_tab} + }mx; + + my $table_row = qr{ + [^\n]*?\|[^\n]*?\n + }mx; + + my $first_row = qr{ + $line_start + \S+.*?\|.*?\n + }mx; + + my $table_rows = qr{ + (\n?$table_row) + }mx; + + my $table_caption = qr{ + $line_start + \[.*?\][ \t]*\n + }mx; + + my $table_divider = qr{ + $line_start + [\|\-\+\:\.][ \-\+\|\:\.]* \| [ \-\+\|\:\.]* + }mx; + + my $whole_table = qr{ + ($table_caption)? # Optional caption + ($first_row # First line must start at beginning + ($table_row)*?)? # Header Rows + $table_divider # Divider/Alignment definitions + $table_rows+ # Body Rows + ($table_caption)? # Optional caption + }mx; + + + # Find whole tables, then break them up and process them + + $text =~ s{ + ^($whole_table) # Whole table in $1 + (\n|\Z) # End of file or 2 blank lines + }{ + my $table = $1; + + # Clean extra spaces at end of lines - + # they cause the processing to choke + $table =~ s/[\t ]*\n/\n/gs; + + my $result = "
    \n"; + my @alignments; + my $use_row_header = 1; + + # Add Caption, if present + + if ($table =~ s/^$line_start(?:\[\s*(.*)\s*\])?(?:\[\s*(.*?)\s*\])[ \t]*$//m) { + my $table_id = ""; + my $table_caption = ""; + + $table_id = Header2Label($2); + + if (defined $1) { + $table_caption = $1; + } else { + $table_caption = $2; + } + $result .= "\n"; + + $g_crossrefs{$table_id} = "#$table_id"; + $g_titles{$table_id} = "see table"; # captions with "stuff" in them break links + } + + # If a second "caption" is present, treat it as a summary + # However, this is not valid in XHTML 1.0 Strict + # But maybe in future + + # A summary might be longer than one line + if ($table =~ s/\n$line_start\[\s*(.*?)\s*\][ \t]*\n/\n/s) { + # $result .= "" . _RunSpanGamut($1) . "\n"; + } + + # Now, divide table into header, alignment, and body + + # First, add leading \n in case there is no header + + $table = "\n" . $table; + + # Need to be greedy + + $table =~ s/\n($table_divider)\n(($table_rows)+)//s; + + my $body = ""; + my $alignment_string = ""; + if (defined $1){ + $alignment_string = $1; + } + if (defined $2){ + $body = $2; + } + + # Process column alignment + while ($alignment_string =~ /\|?\s*(.+?)\s*(\||\Z)/gs) { + my $cell = _RunSpanGamut($1); + if ($cell =~ /\+/){ + $result .= "$cell\n"; + } else { + $result .= "\t<$cell_type$colspan>$cell\n"; + } + $count++; + } + $result .= "\n"; + } + + # Strip out empty sections + $result =~ s/\s*<\/thead>\s*//s; + + # Handle pull-quotes + + # This might be too specific for my needs. If others want it + # removed, I am open to discussion. + + $result =~ s/
    " . _RunSpanGamut($table_caption). "
    \s*\s*/
    \n\n/s; + + $result .= "\n
    \n"; + $result + }egmx; + + my $table_body = qr{ + ( # wrap whole match in $2 + + (.*?\|.*?)\n # wrap headers in $3 + + [ ]{0,$less_than_tab} + ($table_divider) # alignment in $4 + + ( # wrap cells in $5 + $table_rows + ) + ) + }mx; + + return $text; +} + + +sub _DoAttributes{ + my $id = shift; + my $result = ""; + + if (defined $g_attributes{$id}) { + my $attributes = $g_attributes{$id}; + while ($attributes =~ s/(\S+)="(.*?)"//) { + $result .= " $1=\"$2\""; + } + while ($attributes =~ /(\S+)=(\S+)/g) { + $result .= " $1=\"$2\""; + } + } + + return $result; +} + + +sub _StripMarkdownReferences { + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + while ($text =~ s{ + \n\[\#(.+?)\]:[ \t]* # id = $1 + \n? + (.*?)\n{1,2} # end at new paragraph + ((?=\n[ ]{0,$less_than_tab}\S)|\Z) # Lookahead for non-space at line-start, or end of doc + } + {\n}sx) + { + my $id = $1; + my $reference = "$2\n"; + + $reference =~ s/^[ ]{0,$g_tab_width}//gm; + + $reference = _RunBlockGamut($reference); + + # strip leading and trailing

    tags (they will be added later) + $reference =~ s/^\//s; + $reference =~ s/\<\/p\>\s*$//s; + + $g_references{$id} = $reference; + } + + return $text; +} + +sub _DoMarkdownCitations { + my $text = shift; + + $text =~ s{ # Allow for citations without locator to be written + \[\#([^\[]*?)\] # in usual manner, e.g. [#author][] rather than + [ ]? # [][#author] + (?:\n[ ]*)? + \[\s*\] + }{ + "[][#$1]"; + }xsge; + + $text =~ s{ + \[([^\[]*?)\] # citation text = $1 + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + \[\#(.*?)\] # id = $2 + }{ + my $result; + my $anchor_text = $1; + my $id = $2; + my $count; + + # implement equivalent to \citet + my $textual_string = ""; + if ($anchor_text =~ s/^(.*?);\s*//) { + $textual_string = "$1"; + } + + if (defined $g_references{$id} ) { + my $citation_counter=0; + + # See if citation has been used before + foreach my $old_id (@g_used_references) { + $citation_counter++; + $count = $citation_counter if ($old_id eq $id); + } + + if (! defined $count) { + $g_citation_counter++; + $count = $g_citation_counter; + push (@g_used_references,$id); + } + + $result = "$textual_string ($count"; + + if ($anchor_text ne "") { + $result .=", $anchor_text"; + } + + $result .= ")"; + } else { + # No reference exists + $result = "$textual_string ($id"; + + if ($anchor_text ne "") { + $result .=", $anchor_text"; + } + + $result .= ")"; + } + + if (Header2Label($anchor_text) eq "notcited"){ + $result = ""; + } + $result; + }xsge; + + return $text; + +} + +sub _PrintMarkdownBibliography{ + my $citation_counter = 0; + my $result; + + foreach my $id (@g_used_references) { + $citation_counter++; + $result.="

    [$citation_counter] $g_references{$id}

    \n\n"; + } + $result .= "
    "; + + if ($citation_counter > 0) { + $result = "\n\n
    \n$g_bibliography_title

    \n\n".$result; + } else { + $result = ""; + } + + return $result; +} + +sub _GenerateImageCrossRefs { + my $text = shift; + + # + # First, handle reference-style labeled images: ![alt text][id] + # + $text =~ s{ + ( # wrap whole match in $1 + !\[ + (.*?) # alt text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + + ) + }{ + my $result; + my $whole_match = $1; + my $alt_text = $2; + my $link_id = lc $3; + + if ($link_id eq "") { + $link_id = lc $alt_text; # for shortcut links like ![this][]. + } + + $alt_text =~ s/"/"/g; + if (defined $g_urls{$link_id}) { + my $label = Header2Label($alt_text); + $g_crossrefs{$label} = "#$label"; + } + else { + # If there's no such link ID, leave intact: + $result = $whole_match; + } + + $whole_match; + }xsge; + + # + # Next, handle inline images: ![alt text](url "optional title") + # Don't forget: encode * and _ + + $text =~ s{ + ( # wrap whole match in $1 + !\[ + (.*?) # alt text = $2 + \] + \( # literal paren + [ \t]* + ? # src url = $3 + [ \t]* + ( # $4 + (['"]) # quote char = $5 ' + (.*?) # title = $6 + \5 # matching quote + [ \t]* + )? # title is optional + \) + ) + }{ + my $result; + my $whole_match = $1; + my $alt_text = $2; + + $alt_text =~ s/"/"/g; + my $label = Header2Label($alt_text); + $g_crossrefs{$label} = "#$label"; + $whole_match; + }xsge; + + return $text; +} + +sub _FindMathEquations{ + my $text = shift; + + $text =~ s{ + (\]*)id=\"(.*?)\"> # " + }{ + my $label = Header2Label($2); + my $header = _RunSpanGamut($2); + + $g_crossrefs{$label} = "#$label"; + $g_titles{$label} = $header; + + $1 . "id=\"$label\">"; + }xsge; + + return $text; +} + +sub _DoMathSpans { + # Based on Gruber's _DoCodeSpans + + my $text = shift; + my $display_as_block = 0; + $display_as_block = 1 if ($text =~ /^<<[^\>\>]*>>$/); + + $text =~ s{ + (?>) + }{ + my $m = "$2"; + my $label = ""; + my @attr = (xmlns=>"http://www.w3.org/1998/Math/MathML"); + + if (defined $3) { + $label = Header2Label($3); + my $header = _RunSpanGamut($3); + + $g_crossrefs{$label} = "#$label"; + $g_titles{$label} = $header; + } + $m =~ s/^[ \t]*//g; # leading whitespace + $m =~ s/[ \t]*$//g; # trailing whitespace + push(@attr,(id=>"$label")) if ($label ne ""); + push(@attr,(display=>"block")) if ($display_as_block == 1); + + $m = $mathParser->TextToMathML($m,\@attr); + "$m"; + }egsx; + + return $text; +} + +sub _DoDefinitionLists { + # Uses the syntax proposed by Michel Fortin in PHP Markdown Extra + + my $text = shift; + my $less_than_tab = $g_tab_width -1; + + my $line_start = qr{ + [ ]{0,$less_than_tab} + }mx; + + my $term = qr{ + $line_start + [^:\s][^\n]*\n + }sx; + + my $definition = qr{ + \n?[ ]{0,$less_than_tab} + \:[ \t]+(.*?)\n + ((?=\n?\:)|\n|\Z) # Lookahead for next definition, two returns, + # or the end of the document + }sx; + + my $definition_block = qr{ + ((?:$term)+) # $1 = one or more terms + ((?:$definition)+) # $2 = by one or more definitions + }sx; + + my $definition_list = qr{ + (?:$definition_block\n*)+ # One ore more definition blocks + }sx; + + $text =~ s{ + ($definition_list) # $1 = the whole list + }{ + my $list = $1; + my $result = $1; + + $list =~ s{ + (?:$definition_block)\n* + }{ + my $terms = $1; + my $defs = $2; + + $terms =~ s{ + [ ]{0,$less_than_tab} + (.*) + \s* + }{ + my $term = $1; + my $result = ""; + $term =~ s/^\s*(.*?)\s*$/$1/; + if ($term !~ /^\s*$/){ + $result = "
    " . _RunSpanGamut($1) . "
    \n"; + } + $result; + }xmge; + + $defs =~ s{ + $definition + }{ + my $def = $1 . "\n"; + $def =~ s/^[ ]{0,$g_tab_width}//gm; + "
    \n" . _RunBlockGamut($def) . "\n
    \n"; + }xsge; + + $terms . $defs . "\n"; + }xsge; + + "
    \n" . $list . "
    \n\n"; + }xsge; + + return $text +} + +sub _UnescapeComments{ + # Remove encoding inside comments + # Based on proposal by Toras Doran (author of Text::MultiMarkdown) + + my $text = shift; + $text =~ s{ + (?<=) # End comments + }{ + my $t = $1; + $t =~ s/&/&/g; + $t =~ s/</ + + +=head1 SYNOPSIS + +B [ B<--html4tags> ] [ B<--version> ] [ B<-shortversion> ] + [ I ... ] + + +=head1 DESCRIPTION + +MultiMarkdown is an extended version of Markdown. See the website for more +information. + + http://fletcherpenney.net/multimarkdown/ + +Markdown is a text-to-HTML filter; it translates an easy-to-read / +easy-to-write structured text format into HTML. Markdown's text format +is most similar to that of plain text email, and supports features such +as headers, *emphasis*, code blocks, blockquotes, and links. + +Markdown's syntax is designed not as a generic markup language, but +specifically to serve as a front-end to (X)HTML. You can use span-level +HTML tags anywhere in a Markdown document, and you can use block level +HTML tags (like
    and as well). + +For more information about Markdown's syntax, see: + + http://daringfireball.net/projects/markdown/ + + +=head1 OPTIONS + +Use "--" to end switch parsing. For example, to open a file named "-z", use: + + Markdown.pl -- -z + +=over 4 + + +=item B<--html4tags> + +Use HTML 4 style for empty element tags, e.g.: + +
    + +instead of Markdown's default XHTML style tags, e.g.: + +
    + + +=item B<-v>, B<--version> + +Display Markdown's version number and copyright information. + + +=item B<-s>, B<--shortversion> + +Display the short-form version number. + + +=back + + + +=head1 BUGS + +To file bug reports or feature requests (other than topics listed in the +Caveats section above) please send email to: + + support@daringfireball.net (for Markdown issues) + + owner@fletcherpenney.net (for MultiMarkdown issues) + +Please include with your report: (1) the example input; (2) the output +you expected; (3) the output (Multi)Markdown actually produced. + + +=head1 AUTHOR + + John Gruber + http://daringfireball.net/ + + PHP port and other contributions by Michel Fortin + http://michelf.com/ + + MultiMarkdown changes by Fletcher Penney + http://fletcherpenney.net/ + +=head1 COPYRIGHT AND LICENSE + +Original Markdown Code Copyright (c) 2003-2007 John Gruber + +All rights reserved. + +MultiMarkdown changes Copyright (c) 2005-2009 Fletcher T. Penney + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. + +=cut + diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown/Support.pm b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown/Support.pm new file mode 100755 index 00000000..a0e03abb --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown/Support.pm @@ -0,0 +1,622 @@ +# +# $Id: Support.pm 534 2009-06-19 20:52:55Z fletcher $ +# +# MultiMarkdown Version 2.0.b6 +# + +# TODO: Add an option to turn SmartyPants off? + +package MultiMarkdown::Support; + +# use 5.00; +use strict; +use warnings; + +use File::Basename; +use File::Path; +use File::Temp qw/tempdir/; +use File::Copy; +use File::Glob qw/:globally/; +use Cwd; +use Cwd 'abs_path'; + + +use vars qw(%g_metadata); + +our $VERSION = '1.0'; + +sub ProcessMMD2XHTML { + my $MMDPath = shift; + my $input_file = shift; + my $text = "Format: complete\n"; + $text .= shift; + + my $output_file = ""; + $output_file = _Input2Output($input_file, "html") if ($input_file ne ""); + + my $SmartyPants = _WhichSmarty($text); + my $xslt_file = _XhtmlXSLT($text); + + # Generate the pipe command and run + + my $os = $^O; + my $xslt = ""; + my $out = ""; + + if ($input_file ne "") { + $out = "> \"$output_file\""; + } + + if ($os =~ /MSWin/) { + $xslt = "| xsltproc -nonet -novalid XSLT\\$xslt_file -" if ($xslt_file ne ""); + $MMDPath =~ s/\//\\/g; + open (MultiMarkdown, "| cd $MMDPath & perl bin\\MultiMarkdown.pl | perl bin\\$SmartyPants $xslt $out"); + } else { + $xslt = "| xsltproc -nonet -novalid XSLT/$xslt_file -" if ($xslt_file ne ""); + open (MultiMarkdown, "| cd \"$MMDPath\"; bin/MultiMarkdown.pl | bin/$SmartyPants $xslt $out"); + } + + print MultiMarkdown $text; + close (MultiMarkdown); +} + +sub ProcessMMD2RTF { + my $MMDPath = shift; + my $input_file = shift; + my $text = "Format: complete\n"; + $text .= shift; + + my $output_file = ""; + $output_file = _Input2Output($input_file, "rtf") if ($input_file ne ""); + + my $SmartyPants = _WhichSmarty($text); + my $xslt_file = _RTFXSLT($text); + $xslt_file = "xhtml2rtf.xslt" if ($xslt_file eq ""); # Default + + # Generate the pipe command and run + + my $os = $^O; + my $xslt = ""; + my $out = ""; + + if ($input_file ne "") { + $out = "> \"$output_file\""; + } + + if ($os =~ /MSWin/) { + $xslt = "| xsltproc -nonet -novalid XSLT\\$xslt_file -" if ($xslt_file ne ""); + $MMDPath =~ s/\//\\/g; + # TOD: This version won't crash on windows, but the regexp's aren't + # quite right. I welcome input from Windows users but I'm tired of + # messing with it myself for the time being. + my $command = "| cd \"$MMDPath\" & perl -pi -e \"s/(? \"$output_file\""; + } + + if ($os =~ /MSWin/) { + $xslt = "| xsltproc -nonet -novalid XSLT\\$xslt_file -" if ($xslt_file ne ""); + $MMDPath =~ s/\//\\/g; + open (MultiMarkdown, "| cd \"$MMDPath\" & perl bin\\MultiMarkdown.pl | perl bin\\$SmartyPants $xslt | perl Utilities\\cleancites.pl $out"); + } else { + $xslt = "| xsltproc -nonet -novalid XSLT/$xslt_file -" if ($xslt_file ne ""); + open (MultiMarkdown, "| cd \"$MMDPath\"; bin/MultiMarkdown.pl | bin/$SmartyPants $xslt | Utilities/cleancites.pl $out"); + } + + print MultiMarkdown $text; + close (MultiMarkdown); +} + + +sub ProcessMMD2PDF { + my $MMDPath = shift; + my $input_file = shift; + my $text = shift; + + # These are not all necessary for simple files, but are included to try + # and be as thorough as possible... Sort of a poor man's latexmk.pl + + my $tex_string = "; pdflatex mmd.tex; bibtex mmd; makeindex -t mmd.glg -o mmd.gls -s mmd.ist mmd.glo; makeindex -s `kpsewhich basic.gst` -o mmd.gls mmd.glo; pdflatex mmd.tex; pdflatex mmd.tex; pdflatex mmd.tex; pdflatex mmd.tex"; + + if ($^O =~ /MSWin/) { + $tex_string = "& pdflatex mmd.tex & bibtex mmd & makeindex -t mmd.glg -o mmd.gls -s mmd.ist mmd.glo & makeindex -s `kpsewhich basic.gst` -o mmd.gls mmd.glo & pdflatex mmd.tex & pdflatex mmd.tex & pdflatex mmd.tex & pdflatex mmd.tex"; + } + PDFEngine($MMDPath, $input_file, $tex_string, $text); + +} + + +sub ProcessMMD2PDFXeLaTeX { + my $MMDPath = shift; + my $input_file = shift; + my $text = shift; + + # These are not all necessary for simple files, but are included to try + # and be as thorough as possible... Sort of a poor man's latexmk.pl + + my $tex_string = "; xelatex mmd.tex; bibtex mmd; makeindex -t mmd.glg -o mmd.gls -s mmd.ist mmd.glo; makeindex -s `kpsewhich basic.gst` -o mmd.gls mmd.glo; xelatex mmd.tex; xelatex mmd.tex; xelatex mmd.tex; xelatex mmd.tex"; + + if ($^O =~ /MSWin/) { + $tex_string = "& xelatex mmd.tex & bibtex mmd & makeindex -t mmd.glg -o mmd.gls -s mmd.ist mmd.glo & makeindex -s `kpsewhich basic.gst` -o mmd.gls mmd.glo & xelatex mmd.tex & xelatex mmd.tex & xelatex mmd.tex & xelatex mmd.tex"; + } + PDFEngine($MMDPath, $input_file, $tex_string, $text); +} + +sub ProcessXHTML2MMD { + my $MMDPath = shift; + my $input_file = shift; + my $text = shift; + + my $output_file = ""; + $output_file = _Input2Output($input_file, "txt") if ($input_file ne ""); + + my $xslt_file = "multimarkdown.xslt"; + + # Generate the pipe command and run + + my $os = $^O; + my $xslt = ""; + my $out = ""; + + if ($input_file ne "") { + $out = "> \"$output_file\""; + } + + if ($os =~ /MSWin/) { + $xslt = "| xsltproc -nonet -novalid XSLT\\$xslt_file -" if ($xslt_file ne ""); + $MMDPath =~ s/\//\\/g; + open (MultiMarkdown, "| cd \"$MMDPath\" & xsltproc -nonet -novalid XSLT\\$xslt_file - $out"); + } else { + $xslt = "| xsltproc -nonet -novalid XSLT/$xslt_file -" if ($xslt_file ne ""); + open (MultiMarkdown, "| cd \"$MMDPath\"; xsltproc -nonet -novalid XSLT/$xslt_file - $out"); + } + + print MultiMarkdown $text; + close (MultiMarkdown); +} + + +sub ProcessOPML2MMD { + my $MMDPath = shift; + my $input_file = shift; + my $text = shift; + + # Preserve tab characters + $text =~ s/\t/ /g; + + my $output_file = ""; + $output_file = _Input2Output($input_file, "txt") if ($input_file ne ""); + + my $xslt_file = "opml2mmd.xslt"; + + # Generate the pipe command and run + + my $os = $^O; + my $xslt = ""; + my $out = ""; + + if ($input_file ne "") { + $out = "> \"$output_file\""; + } + + if ($os =~ /MSWin/) { + $xslt = "| xsltproc -nonet -novalid XSLT\\$xslt_file -" if ($xslt_file ne ""); + $MMDPath =~ s/\//\\/g; + open (MultiMarkdown, "| cd \"$MMDPath\" & xsltproc -nonet -novalid XSLT\\$xslt_file - $out"); + } else { + $xslt = "| xsltproc -nonet -novalid XSLT/$xslt_file -" if ($xslt_file ne ""); + open (MultiMarkdown, "| cd \"$MMDPath\"; xsltproc -nonet -novalid XSLT/$xslt_file - $out"); + } + + print MultiMarkdown $text; + close (MultiMarkdown); +} + + +sub PDFEngine { + my $MMDPath = shift; + my $input_file = shift; + my $tex_string = shift; + my $text = shift; + + my $latex_file = _Input2Output($input_file, "tex"); + my $output_file = _Input2Output($input_file, "pdf"); + my $parent_folder = dirname($latex_file); + my $temp_tex_file = ""; + my @support_files = (); + + # Create a temporary working folder + my $temp_folder = tempdir(); + + # Create the LaTeX file + ProcessMMD2LaTeX($MMDPath, $input_file, $text); + + if ($^O =~ /MSWin/) { + # We're in Windows + $temp_folder =~ s/\//\\/g; + $parent_folder =~ s/\\/\//g; + $temp_tex_file = "$temp_folder\\mmd.tex"; + @support_files = <'$parent_folder\\*.{bib,pdf,png,gif,jpg}'>; + } else { + # Not in Windows + $temp_tex_file = "$temp_folder/mmd.tex"; + my $temp_parent_folder = $parent_folder; + $temp_parent_folder =~ s/ /\\ /g; + @support_files = <$temp_parent_folder/*.{bib,pdf,png,gif,jpg}>; + + # Try to be sure we have access to the LaTeX binaries in our PATH, + # especially if they were installed by Fink + $ENV{'PATH'} .= ':/usr/texbin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/sw/bin'; + } + + # Copy tex into temp directory + copy($latex_file, $temp_tex_file); + + # Copy possible images, .bib files, etc to the temp folder + copy($_,$temp_folder) foreach(@support_files); + + # Now, do the latex stuff + system("cd \"$temp_folder\" $tex_string"); + + # Retrieve the pdf + my $temp_pdf_file = _Input2Output($temp_tex_file, "pdf"); + copy($temp_pdf_file, $output_file); + + # Remove temporary files + File::Path::rmtree($temp_folder); +} + +sub _Input2Output { + # Convert the filename given to an output file with new extension + my $input_file = shift; + my $file_extension = shift; + my $output_file = abs_path($input_file); + + $output_file =~ s/\.[^\.\\\/]*?$/.$file_extension/; # strip extension + + return $output_file; +} + +sub _WhichSmarty { + my $text = shift; + my $language = _Language($text); + + if ($language =~ /^\s*german\s*$/i) { + return "SmartyPantsGerman.pl"; + } elsif ($language =~ /^\s*french\s*$/i) { + return "SmartyPantsFrench.pl"; + } elsif ($language =~ /^\s*swedish|norwegian|finnish|danish\s*$/i) { + return "SmartyPantsSwedish.pl"; + } elsif ($language =~ /^\s*dutch\s*$/i) { + return "SmartyPantsDutch.pl"; + } + + return "SmartyPants.pl"; +} + +sub _Language { + my $text = shift; + + my ($inMetaData, $currentKey) = (1,''); + + foreach my $line ( split /\n/, $text ) { + $line =~ /^$/ and $inMetaData = 0 and next; + if ($inMetaData) { + if ($line =~ /^([a-zA-Z0-9][0-9a-zA-Z _-]*?):\s*(.*)$/ ) { + $currentKey = $1; + $currentKey =~ s/ / /g; + $g_metadata{$currentKey} = $2; + if (lc($currentKey) eq "language") { + return $g_metadata{$currentKey}; + } + } else { + if ($currentKey eq "") { + # No metadata present + $inMetaData = 0; + next; + } + } + } + } + + return ""; +} + +sub _XhtmlXSLT { + my $text = shift; + + my ($inMetaData, $currentKey) = (1,''); + + foreach my $line ( split /\n/, $text ) { + $line =~ /^$/ and $inMetaData = 0 and next; + if ($inMetaData) { + if ($line =~ /^([a-zA-Z0-9][0-9a-zA-Z _-]*?):\s*(.*)$/ ) { + $currentKey = $1; + my $temp = $2; + $currentKey =~ s/ //g; + $g_metadata{$currentKey} = $temp; + if (lc($currentKey) eq "xhtmlxslt") { + $g_metadata{$currentKey} =~ s/\s*(\.xslt)?\s*$/.xslt/; + return $g_metadata{$currentKey}; + } + } else { + if ($currentKey eq "") { + # No metadata present + $inMetaData = 0; + next; + } + } + } + } + + return ""; +} + +sub _LatexXSLT { + my $text = shift; + + my ($inMetaData, $currentKey) = (1,''); + + foreach my $line ( split /\n/, $text ) { + $line =~ /^$/ and $inMetaData = 0 and next; + if ($inMetaData) { + if ($line =~ /^([a-zA-Z0-9][0-9a-zA-Z _-]*?):\s*(.*)$/ ) { + $currentKey = $1; + my $temp = $2; + $currentKey =~ s/ //g; + $g_metadata{$currentKey} = $temp; + if (lc($currentKey) eq "latexxslt") { + $g_metadata{$currentKey} =~ s/\s*(\.xslt)?\s*$/.xslt/; + return $g_metadata{$currentKey}; + } + } else { + if ($currentKey eq "") { + # No metadata present + $inMetaData = 0; + next; + } + } + } + } + + return ""; +} + + +sub _RTFXSLT { + my $text = shift; + + my ($inMetaData, $currentKey) = (1,''); + + foreach my $line ( split /\n/, $text ) { + $line =~ /^$/ and $inMetaData = 0 and next; + if ($inMetaData) { + if ($line =~ /^([a-zA-Z0-9][0-9a-zA-Z _-]*?):\s*(.*)$/ ) { + $currentKey = $1; + my $temp = $2; + $currentKey =~ s/ //g; + $g_metadata{$currentKey} = $temp; + if (lc($currentKey) eq "rtfxslt") { + $g_metadata{$currentKey} =~ s/\s*(\.xslt)?\s*$/.xslt/; + return $g_metadata{$currentKey}; + } + } else { + if ($currentKey eq "") { + # No metadata present + $inMetaData = 0; + next; + } + } + } + } + + return ""; +} + +sub LocateMMD { + my $me = shift; # Where am I running from? + + my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin + my $MMDPath = ""; + + # Determine where MMD is installed. Use a "common installation" + # if available. + + $me = dirname($me); + + if ($os =~ /MSWin/) { + # We're running Windows + + # First check our directory to see if we're running inside MMD + + if ( -f "$me\\MultiMarkdown\\Support.pm") { + $MMDPath = "$me\\.."; + } + + # Next, look in user's home directory, then in common directories + if ($MMDPath eq "") { + if ( -d "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown") { + $MMDPath = "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown"; + } elsif ( -d "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown") { + $MMDPath = "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown"; + } + } + + # Load the MultiMarkdown::Support.pm module + do "$MMDPath\\bin\\MultiMarkdown\\Support.pm" if ($MMDPath ne ""); + } else { + # We're running Mac OS X or some *nix + + # First check our directory to see if we're running inside MMD + + if ( -f "$me/MultiMarkdown/Support.pm") { + $MMDPath = "$me/.."; + } + + # Next, look in user's home directory, then in common directories + if ($MMDPath eq "") { + if (defined($ENV{HOME})) { + if ( -d "$ENV{HOME}/Library/Application Support/MultiMarkdown") { + $MMDPath = "$ENV{HOME}/Library/Application Support/MultiMarkdown"; + } elsif ( -d "$ENV{HOME}/.multimarkdown") { + $MMDPath = "$ENV{HOME}/.multimarkdown"; + } + } + if ($MMDPath eq "") { + if ( -d "/Library/Application Support/MultiMarkdown") { + $MMDPath = "/Library/Application Support/MultiMarkdown"; + } elsif ( -d "/usr/share/multimarkdown") { + $MMDPath = "/usr/share/multimarkdown"; + } + } + } + } + + if ($MMDPath eq "") { + die "You do not appear to have MultiMarkdown installed.\n"; + } else { + # Load the MultiMarkdown::Support.pm module + $MMDPath = abs_path($MMDPath); + LoadModule("$MMDPath/bin/MultiMarkdown/Support.pm"); + } + + # Clean up the path + $MMDPath = abs_path($MMDPath); + + return $MMDPath; +} + +sub LoadModule { + my $file = shift; + my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin + + if ($os =~ /MSWin/) { + # Not sure what I can do here + } else { + unless (my $return = eval `cat "$file"`) { + warn "couldn't parse $file: $@" if $@; + warn "couldn't do $file: $!" unless defined $return; + warn "couldn't run $file" unless $return; + } + } +} + + +1; +__END__ + +=head1 NAME + +MultiMarkdown::Support - Perl extension to provide support routines to +MultiMarkdown utility scripts. + +=head1 SYNOPSIS + +use MultiMarkdown::Support; + +=head1 FUNCTIONS + +LocateMMD(path/to/script/that/was/running); + +=over 4 + +Returns the path to the MultiMarkdown installation to be used. It first tries +for a "common installation", and then checks the parent of the running script. + +Unless the module is properly installed, and loaded first, this routine is not +likely to be needed and should be embedded in the utility script. See +mmd2XHTML for an example. + +=back + +ProcessMMD2XHTML(Path/to/MultiMarkdown, input_filename, multimarkdown_text); + +ProcessMMD2LaTeX(Path/to/MultiMarkdown, input_filename, multimarkdown_text); + +ProcessMMD2PDF(Path/to/MultiMarkdown, input_filename, multimarkdown_text); + +ProcessMMD2PDFXeLaTeX(Path/to/MultiMarkdown, input_filename, multimarkdown_text); + +=over 4 + +These routines convert the raw MultiMarkdown text into the appropriate format. +If a filename is specified, the output is written to a file with an +appropriate extension. Otherwise, when possible, it is presented on stdout. + +=back + +=head1 DESCRIPTION + +This module contains some of the core code used by the MultiMarkdown utility +scripts (mmd2XHTML, mmd2LaTeX, etc). The idea is to try and centralize as +much of that code as possible to simplify maintaining everything else. + + +=head1 SEE ALSO + +Designed for use with MultiMarkdown. + + + +Mailing list support for MultiMarkdown: + + + + OR + + + +=head1 AUTHOR + +Fletcher T. Penney, Eowner@fletcherpenney.netE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2009 by Fletcher T. Penney + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the + Free Software Foundation, Inc. + 59 Temple Place, Suite 330 + Boston, MA 02111-1307 USA + +=cut \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/OPML2mmd.pl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/OPML2mmd.pl new file mode 100755 index 00000000..3eb06f61 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/OPML2mmd.pl @@ -0,0 +1,212 @@ +#!/usr/bin/env perl +## +# Utility script to process OPML files back into MMD +# +# Copyright (c) 2010 Fletcher T. Penney +# +# + +# This script will process the text received via stdin, and output to stdout, +# OR +# will accept a list of files, and process each file individually. +# +# If a list of files is received, the input from "test.opml" will be output +# to "test.txt", for example. + +use strict; +use warnings; + +use File::Basename; +use Cwd; +use Cwd 'abs_path'; + + +# Determine where MMD is installed. Use a "common installation" if available. + +my $me = $0; # Where is this script located? +my $MMDPath = LocateMMD($me); + + +# Determine whether we are in "file mode" or "stdin mode" + +my $count = @ARGV; + +if ($count == 0) { + # We're in "stdin mode" + + # process stdin + undef $/; + my $data .= <>; + + MultiMarkdown::Support::ProcessOPML2MMD($MMDPath, "", $data); + +} else { + # We're in "file mode" + + foreach(@ARGV) { + # process each file individually + + # warn if directory + if ( -d $_ ) { + warn "This utility will not process directories. Please specify the files to process.\n"; + } elsif ( -f $_ ) { + # Determine filenames + my $filename = $_; + + # Read input and process + open(INPUT, "<$filename"); + local $/; + my $data = ; + close(INPUT); + + MultiMarkdown::Support::ProcessOPML2MMD($MMDPath, $filename, $data); + } else { + system("perldoc $0"); + } + } +} + +sub LocateMMD { + my $me = shift; # Where am I running from? + + my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin + my $MMDPath = ""; + + # Determine where MMD is installed. Use a "common installation" + # if available. + + $me = dirname($me); + + if ($os =~ /MSWin/) { + # We're running Windows + + # First check our directory to see if we're running inside MMD + + if ( -f "$me\\MultiMarkdown\\Support.pm") { + $MMDPath = "$me\\.."; + } + + # Next, look in user's home directory, then in common directories + if ($MMDPath eq "") { + if ( -d "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown") { + $MMDPath = "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown"; + } elsif ( -d "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown") { + $MMDPath = "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown"; + } + } + + # Load the MultiMarkdown::Support.pm module + do "$MMDPath\\bin\\MultiMarkdown\\Support.pm" if ($MMDPath ne ""); + } else { + # We're running Mac OS X or some *nix + + # First check our directory to see if we're running inside MMD + + if ( -f "$me/MultiMarkdown/Support.pm") { + $MMDPath = "$me/.."; + } + + # Next, look in user's home directory, then in common directories + if ($MMDPath eq "") { + if (defined($ENV{HOME})) { + if ( -d "$ENV{HOME}/Library/Application Support/MultiMarkdown") { + $MMDPath = "$ENV{HOME}/Library/Application Support/MultiMarkdown"; + } elsif ( -d "$ENV{HOME}/.multimarkdown") { + $MMDPath = "$ENV{HOME}/.multimarkdown"; + } + } + if ($MMDPath eq "") { + if ( -d "/Library/Application Support/MultiMarkdown") { + $MMDPath = "/Library/Application Support/MultiMarkdown"; + } elsif ( -d "/usr/share/multimarkdown") { + $MMDPath = "/usr/share/multimarkdown"; + } + } + } + } + + if ($MMDPath eq "") { + die "You do not appear to have MultiMarkdown installed.\n"; + } else { + # Load the MultiMarkdown::Support.pm module + $MMDPath = abs_path($MMDPath); + LoadModule("$MMDPath/bin/MultiMarkdown/Support.pm"); + } + + # Clean up the path + $MMDPath = abs_path($MMDPath); + + return $MMDPath; +} + +sub LoadModule { + my $file = shift; + my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin + + if ($os =~ /MSWin/) { + # Not sure what I can do her + } else { + unless (my $return = eval `cat "$file"`) { + warn "couldn't parse $file: $@" if $@; + warn "couldn't do $file: $!" unless defined $return; + warn "couldn't run $file" unless $return; + } + } +} + +=head1 NAME + +OPML2mmd - utility script for MultiMarkdown to convert OPML back into +MultiMarkdown text. + +=head1 SYNOPSIS + +OPML2mmd.pl [file ...] + + +=head1 DESCRIPTION + +This script is designed as a "reversal" for MultiMarkdown generated OPML +files. It can convert a series of text files from OPML back into MultiMarkdown +text files. + + +=head1 SEE ALSO + +Designed for use with MultiMarkdown. + + + +Mailing list support for MultiMarkdown: + + + + OR + + + +=head1 AUTHOR + +Fletcher T. Penney, Eowner@fletcherpenney.netE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2010 by Fletcher T. Penney + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the + + Free Software Foundation, Inc. + 59 Temple Place, Suite 330 + Boston, MA 02111-1307 USA + +=cut \ No newline at end of file diff --git a/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/SmartyPants.pl b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/SmartyPants.pl new file mode 100755 index 00000000..f22cdf45 --- /dev/null +++ b/build/Deployment/nvALT.app/Contents/Resources/MultiMarkdown/bin/SmartyPants.pl @@ -0,0 +1,1175 @@ +#!/usr/bin/perl -w + +# +# SmartyPants - A Plug-In for Movable Type, Blosxom, and BBEdit +# by John Gruber +# http://daringfireball.net +# +# See the readme or POD for details, installation instructions, and +# license information. +# +# Copyright (c) 2003-2004 John Gruber +# + +package SmartyPants; +use strict; +use vars qw($VERSION); +$VERSION = "1.5.1"; +# Fri 12 Mar 2004 + + +# Configurable variables: +my $smartypants_attr = "2"; # Blosxom and BBEdit users: change this to configure. + # 1 => "--" for em-dashes; no en-dash support + # 2 => "---" for em-dashes; "--" for en-dashes + # 3 => "--" for em-dashes; "---" for en-dashes + # See docs for more configuration options. + + +# Globals: +my $tags_to_skip = qr!<(/?)(?:pre|code|kbd|script|math|style)[\s>]!; + + +# Blosxom plug-in interface: +sub start { 1; } +sub story { + my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; + + $$title_ref = SmartyPants($$title_ref, $smartypants_attr, undef); + $$body_ref = SmartyPants($$body_ref, $smartypants_attr, undef); + 1; +} + + +# Movable Type plug-in interface: +eval {require MT::Template::Context}; # Test to see if we're running in MT. +unless ($@) { + require MT::Template::Context; + import MT::Template::Context; + MT::Template::Context->add_global_filter( smarty_pants => \&SmartyPants); + MT::Template::Context->add_global_filter( smart_quotes => \&SmartQuotes); + MT::Template::Context->add_global_filter( smart_dashes => \&SmartDashes); + MT::Template::Context->add_global_filter( smart_ellipses => \&SmartEllipses); + MT::Template::Context->add_tag( SmartyPantsVersion => \&SmartyPantsVersion); + + # If Markdown is loaded, add a combo Markdown/SmartyPants text filter: + my $filters = MT->all_text_filters(); + if (exists( $filters->{'markdown'} )) { + my $markdown_ref = $filters->{'markdown'}{on_format}; + if ($markdown_ref) { + MT->add_text_filter('markdown_with_smartypants' => { + label => 'Markdown With SmartyPants', + on_format => sub { + my $text = shift; + $text = &$markdown_ref($text); + $text = SmartyPants($text, $smartypants_attr); + }, + docs => 'http://daringfireball.net/projects/markdown/' + }); + } + } +} +else { + # BBEdit text filter interface; needs to be hidden from MT + # (and Blosxom when running in static mode). + + # Set up a do-nothing variable to keep Perl from warning us that + # we're only using $blosxom::version once. The right way to do this + # is to use "no warnings", but that doesn't work in Perl 5.005. + my $in_blosxom = defined($blosxom::version); + + unless ( defined($blosxom::version) ) { + #### Check for command-line switches: ########################### + my %cli_opts; + use Getopt::Long; + Getopt::Long::Configure('pass_through'); + GetOptions(\%cli_opts, + 'version', + 'shortversion', + '1', + '2', + '3', + ); + if ($cli_opts{'version'}) { # Version info + print "\nThis is Markdown, version $VERSION.\n"; + print "Copyright 2004 John Gruber\n"; + print "http://daringfireball.net/projects/markdown/\n"; + exit 0; + } + if ($cli_opts{'shortversion'}) { # Just the version number string. + print $VERSION; + exit 0; + } + if ($cli_opts{'1'}) { $smartypants_attr = 1 }; + if ($cli_opts{'2'}) { $smartypants_attr = 2 }; + if ($cli_opts{'3'}) { $smartypants_attr = 3 }; + + + #### Process incoming text: ##################################### + my $old = $/; + undef $/; # slurp the whole file + my $text = <>; + $/ = $old; + print SmartyPants($text, $smartypants_attr, undef); + } +} + + +sub SmartyPants { + # Paramaters: + my $text = shift; # text to be parsed + my $attr = shift; # value of the smart_quotes="" attribute + my $ctx = shift; # MT context object (unused) + + # Options to specify which transformations to make: + my ($do_quotes, $do_backticks, $do_dashes, $do_ellipses, $do_stupefy); + my $convert_quot = 0; # should we translate " entities into normal quotes? + + # Parse attributes: + # 0 : do nothing + # 1 : set all + # 2 : set all, using old school en- and em- dash shortcuts + # 3 : set all, using inverted old school en and em- dash shortcuts + # + # q : quotes + # b : backtick quotes (``double'' only) + # B : backtick quotes (``double'' and `single') + # d : dashes + # D : old school dashes + # i : inverted old school dashes + # e : ellipses + # w : convert " entities to " for Dreamweaver users + + if ($attr eq "0") { + # Do nothing. + return $text; + } + elsif ($attr eq "1") { + # Do everything, turn all options on. + $do_quotes = 1; + $do_backticks = 1; + $do_dashes = 1; + $do_ellipses = 1; + } + elsif ($attr eq "2") { + # Do everything, turn all options on, use old school dash shorthand. + $do_quotes = 1; + $do_backticks = 1; + $do_dashes = 2; + $do_ellipses = 1; + } + elsif ($attr eq "3") { + # Do everything, turn all options on, use inverted old school dash shorthand. + $do_quotes = 1; + $do_backticks = 1; + $do_dashes = 3; + $do_ellipses = 1; + } + elsif ($attr eq "-1") { + # Special "stupefy" mode. + $do_stupefy = 1; + } + else { + my @chars = split(//, $attr); + foreach my $c (@chars) { + if ($c eq "q") { $do_quotes = 1; } + elsif ($c eq "b") { $do_backticks = 1; } + elsif ($c eq "B") { $do_backticks = 2; } + elsif ($c eq "d") { $do_dashes = 1; } + elsif ($c eq "D") { $do_dashes = 2; } + elsif ($c eq "i") { $do_dashes = 3; } + elsif ($c eq "e") { $do_ellipses = 1; } + elsif ($c eq "w") { $convert_quot = 1; } + else { + # Unknown attribute option, ignore. + } + } + } + + my $tokens ||= _tokenize($text); + my $result = ''; + my $in_pre = 0; # Keep track of when we're inside
     or  tags.
    +
    +    my $prev_token_last_char = "";  # This is a cheat, used to get some context
    +                                    # for one-character tokens that consist of 
    +                                    # just a quote char. What we do is remember
    +                                    # the last character of the previous text
    +                                    # token, to use as context to curl single-
    +                                    # character quote tokens correctly.
    +
    +    foreach my $cur_token (@$tokens) {
    +        if ($cur_token->[0] eq "tag") {
    +            # Don't mess with quotes inside tags.
    +            $result .= $cur_token->[1];
    +            if ($cur_token->[1] =~ m/$tags_to_skip/) {
    +                $in_pre = defined $1 && $1 eq '/' ? 0 : 1;
    +            }
    +        } else {
    +            my $t = $cur_token->[1];
    +            my $last_char = substr($t, -1); # Remember last char of this token before processing.
    +            if (! $in_pre) {
    +                $t = ProcessEscapes($t);
    +
    +                if ($convert_quot) {
    +                    $t =~ s/"/"/g;
    +                }
    +
    +                if ($do_dashes) {
    +                    $t = EducateDashes($t)                  if ($do_dashes == 1);
    +                    $t = EducateDashesOldSchool($t)         if ($do_dashes == 2);
    +                    $t = EducateDashesOldSchoolInverted($t) if ($do_dashes == 3);
    +                }
    +
    +                $t = EducateEllipses($t) if $do_ellipses;
    +
    +                # Note: backticks need to be processed before quotes.
    +                if ($do_backticks) {
    +                    $t = EducateBackticks($t);
    +                    $t = EducateSingleBackticks($t) if ($do_backticks == 2);
    +                }
    +
    +                if ($do_quotes) {
    +                    if ($t eq q/'/) {
    +                        # Special case: single-character ' token
    +                        if ($prev_token_last_char =~ m/\S/) {
    +                            $t = "’";
    +                        }
    +                        else {
    +                            $t = "‘";
    +                        }
    +                    }
    +                    elsif ($t eq q/"/) {
    +                        # Special case: single-character " token
    +                        if ($prev_token_last_char =~ m/\S/) {
    +                            $t = "”";
    +                        }
    +                        else {
    +                            $t = "“";
    +                        }
    +                    }
    +                    else {
    +                        # Normal case:                  
    +                        $t = EducateQuotes($t);
    +                    }
    +                }
    +
    +                $t = StupefyEntities($t) if $do_stupefy;
    +            }
    +            $prev_token_last_char = $last_char;
    +            $result .= $t;
    +        }
    +    }
    +
    +    return $result;
    +}
    +
    +
    +sub SmartQuotes {
    +    # Paramaters:
    +    my $text = shift;   # text to be parsed
    +    my $attr = shift;   # value of the smart_quotes="" attribute
    +    my $ctx  = shift;   # MT context object (unused)
    +
    +    my $do_backticks;   # should we educate ``backticks'' -style quotes?
    +
    +    if ($attr == 0) {
    +        # do nothing;
    +        return $text;
    +    }
    +    elsif ($attr == 2) {
    +        # smarten ``backticks'' -style quotes
    +        $do_backticks = 1;
    +    }
    +    else {
    +        $do_backticks = 0;
    +    }
    +
    +    # Special case to handle quotes at the very end of $text when preceded by
    +    # an HTML tag. Add a space to give the quote education algorithm a bit of
    +    # context, so that it can guess correctly that it's a closing quote:
    +    my $add_extra_space = 0;
    +    if ($text =~ m/>['"]\z/) {
    +        $add_extra_space = 1; # Remember, so we can trim the extra space later.
    +        $text .= " ";
    +    }
    +
    +    my $tokens ||= _tokenize($text);
    +    my $result = '';
    +    my $in_pre = 0;  # Keep track of when we're inside 
     or  tags
    +
    +    my $prev_token_last_char = "";  # This is a cheat, used to get some context
    +                                    # for one-character tokens that consist of 
    +                                    # just a quote char. What we do is remember
    +                                    # the last character of the previous text
    +                                    # token, to use as context to curl single-
    +                                    # character quote tokens correctly.
    +
    +    foreach my $cur_token (@$tokens) {
    +        if ($cur_token->[0] eq "tag") {
    +            # Don't mess with quotes inside tags
    +            $result .= $cur_token->[1];
    +            if ($cur_token->[1] =~ m/$tags_to_skip/) {
    +                $in_pre = defined $1 && $1 eq '/' ? 0 : 1;
    +            }
    +        } else {
    +            my $t = $cur_token->[1];
    +            my $last_char = substr($t, -1); # Remember last char of this token before processing.
    +            if (! $in_pre) {
    +                $t = ProcessEscapes($t);
    +                if ($do_backticks) {
    +                    $t = EducateBackticks($t);
    +                }
    +
    +                if ($t eq q/'/) {
    +                    # Special case: single-character ' token
    +                    if ($prev_token_last_char =~ m/\S/) {
    +                        $t = "’";
    +                    }
    +                    else {
    +                        $t = "‘";
    +                    }
    +                }
    +                elsif ($t eq q/"/) {
    +                    # Special case: single-character " token
    +                    if ($prev_token_last_char =~ m/\S/) {
    +                        $t = "”";
    +                    }
    +                    else {
    +                        $t = "“";
    +                    }
    +                }
    +                else {
    +                    # Normal case:                  
    +                    $t = EducateQuotes($t);
    +                }
    +
    +            }
    +            $prev_token_last_char = $last_char;
    +            $result .= $t;
    +        }
    +    }
    +
    +    if ($add_extra_space) {
    +        $result =~ s/ \z//;  # Trim trailing space if we added one earlier.
    +    }
    +    return $result;
    +}
    +
    +
    +sub SmartDashes {
    +    # Paramaters:
    +    my $text = shift;   # text to be parsed
    +    my $attr = shift;   # value of the smart_dashes="" attribute
    +    my $ctx  = shift;   # MT context object (unused)
    +
    +    # reference to the subroutine to use for dash education, default to EducateDashes:
    +    my $dash_sub_ref = \&EducateDashes;
    +
    +    if ($attr == 0) {
    +        # do nothing;
    +        return $text;
    +    }
    +    elsif ($attr == 2) {
    +        # use old smart dash shortcuts, "--" for en, "---" for em
    +        $dash_sub_ref = \&EducateDashesOldSchool; 
    +    }
    +    elsif ($attr == 3) {
    +        # inverse of 2, "--" for em, "---" for en
    +        $dash_sub_ref = \&EducateDashesOldSchoolInverted; 
    +    }
    +
    +    my $tokens;
    +    $tokens ||= _tokenize($text);
    +
    +    my $result = '';
    +    my $in_pre = 0;  # Keep track of when we're inside 
     or  tags
    +    foreach my $cur_token (@$tokens) {
    +        if ($cur_token->[0] eq "tag") {
    +            # Don't mess with quotes inside tags
    +            $result .= $cur_token->[1];
    +            if ($cur_token->[1] =~ m/$tags_to_skip/) {
    +                $in_pre = defined $1 && $1 eq '/' ? 0 : 1;
    +            }
    +        } else {
    +            my $t = $cur_token->[1];
    +            if (! $in_pre) {
    +                $t = ProcessEscapes($t);
    +                $t = $dash_sub_ref->($t);
    +            }
    +            $result .= $t;
    +        }
    +    }
    +    return $result;
    +}
    +
    +
    +sub SmartEllipses {
    +    # Paramaters:
    +    my $text = shift;   # text to be parsed
    +    my $attr = shift;   # value of the smart_ellipses="" attribute
    +    my $ctx  = shift;   # MT context object (unused)
    +
    +    if ($attr == 0) {
    +        # do nothing;
    +        return $text;
    +    }
    +
    +    my $tokens;
    +    $tokens ||= _tokenize($text);
    +
    +    my $result = '';
    +    my $in_pre = 0;  # Keep track of when we're inside 
     or  tags
    +    foreach my $cur_token (@$tokens) {
    +        if ($cur_token->[0] eq "tag") {
    +            # Don't mess with quotes inside tags
    +            $result .= $cur_token->[1];
    +            if ($cur_token->[1] =~ m/$tags_to_skip/) {
    +                $in_pre = defined $1 && $1 eq '/' ? 0 : 1;
    +            }
    +        } else {
    +            my $t = $cur_token->[1];
    +            if (! $in_pre) {
    +                $t = ProcessEscapes($t);
    +                $t = EducateEllipses($t);
    +            }
    +            $result .= $t;
    +        }
    +    }
    +    return $result;
    +}
    +
    +
    +sub EducateQuotes {
    +#
    +#   Parameter:  String.
    +#
    +#   Returns:    The string, with "educated" curly quote HTML entities.
    +#
    +#   Example input:  "Isn't this fun?"
    +#   Example output: “Isn’t this fun?”
    +#
    +
    +    local $_ = shift;
    +
    +    # Tell perl not to gripe when we use $1 in substitutions,
    +    # even when it's undefined. Use $^W instead of "no warnings"
    +    # for compatibility with Perl 5.005:
    +    local $^W = 0;
    +
    +
    +    # Make our own "punctuation" character class, because the POSIX-style
    +    # [:PUNCT:] is only available in Perl 5.6 or later:
    +    my $punct_class = qr/[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]/;
    +
    +    # Special case if the very first character is a quote
    +    # followed by punctuation at a non-word-break. Close the quotes by brute force:
    +    s/^'(?=$punct_class\B)/’/;
    +    s/^"(?=$punct_class\B)/”/;
    +
    +
    +    # Special case for double sets of quotes, e.g.:
    +    #   

    He said, "'Quoted' words in a larger quote."

    + s/"'(?=\w)/“‘/g; + s/'"(?=\w)/‘“/g; + + # Special case for decade abbreviations (the '80s): + s/'(?=\d{2}s)/’/g; + + my $close_class = qr![^\ \t\r\n\[\{\(\-]!; + my $dec_dashes = qr/–|—/; + + # Get most opening single quotes: + s { + ( + \s | # a whitespace char, or +   | # a non-breaking space entity, or + -- | # dashes, or + &[mn]dash; | # named dash entities + $dec_dashes | # or decimal entities + &\#x201[34]; # or hex + ) + ' # the quote + (?=\w) # followed by a word character + } {$1‘}xg; + # Single closing quotes: + s { + ($close_class)? + ' + (?(1)| # If $1 captured, then do nothing; + (?=\s | s\b) # otherwise, positive lookahead for a whitespace + ) # char or an 's' at a word ending position. This + # is a special case to handle something like: + # "Custer's Last Stand." + } {$1’}xgi; + + # Any remaining single quotes should be opening ones: + s/'/‘/g; + + + # Get most opening double quotes: + s { + ( + \s | # a whitespace char, or +   | # a non-breaking space entity, or + -- | # dashes, or + &[mn]dash; | # named dash entities + $dec_dashes | # or decimal entities + &\#x201[34]; # or hex + ) + " # the quote + (?=\w) # followed by a word character + } {$1“}xg; + + # Double closing quotes: + s { + ($close_class)? + " + (?(1)|(?=\s)) # If $1 captured, then do nothing; + # if not, then make sure the next char is whitespace. + } {$1”}xg; + + # Any remaining quotes should be opening ones. + s/"/“/g; + + return $_; +} + + +sub EducateBackticks { +# +# Parameter: String. +# Returns: The string, with ``backticks'' -style double quotes +# translated into HTML curly quote entities. +# +# Example input: ``Isn't this fun?'' +# Example output: “Isn't this fun?” +# + + local $_ = shift; + s/``/“/g; + s/''/”/g; + return $_; +} + + +sub EducateSingleBackticks { +# +# Parameter: String. +# Returns: The string, with `backticks' -style single quotes +# translated into HTML curly quote entities. +# +# Example input: `Isn't this fun?' +# Example output: ‘Isn’t this fun?’ +# + + local $_ = shift; + s/`/‘/g; + s/'/’/g; + return $_; +} + + +sub EducateDashes { +# +# Parameter: String. +# +# Returns: The string, with each instance of "--" translated to +# an em-dash HTML entity. +# + + local $_ = shift; + s/--/—/g; + return $_; +} + + +sub EducateDashesOldSchool { +# +# Parameter: String. +# +# Returns: The string, with each instance of "--" translated to +# an en-dash HTML entity, and each "---" translated to +# an em-dash HTML entity. +# + + local $_ = shift; + s/---/—/g; # em + s/--/–/g; # en + return $_; +} + + +sub EducateDashesOldSchoolInverted { +# +# Parameter: String. +# +# Returns: The string, with each instance of "--" translated to +# an em-dash HTML entity, and each "---" translated to +# an en-dash HTML entity. Two reasons why: First, unlike the +# en- and em-dash syntax supported by +# EducateDashesOldSchool(), it's compatible with existing +# entries written before SmartyPants 1.1, back when "--" was +# only used for em-dashes. Second, em-dashes are more +# common than en-dashes, and so it sort of makes sense that +# the shortcut should be shorter to type. (Thanks to Aaron +# Swartz for the idea.) +# + + local $_ = shift; + s/---/–/g; # en + s/--/—/g; # em + return $_; +} + + +sub EducateEllipses { +# +# Parameter: String. +# Returns: The string, with each instance of "..." translated to +# an ellipsis HTML entity. Also converts the case where +# there are spaces between the dots. +# +# Example input: Huh...? +# Example output: Huh…? +# + + local $_ = shift; + s/\.\.\./…/g; + s/\. \. \./…/g; + return $_; +} + + +sub StupefyEntities { +# +# Parameter: String. +# Returns: The string, with each SmartyPants HTML entity translated to +# its ASCII counterpart. +# +# Example input: “Hello — world.” +# Example output: "Hello -- world." +# + + local $_ = shift; + + s/–/-/g; # en-dash + s/—/--/g; # em-dash + + s/‘/'/g; # open single quote + s/’/'/g; # close single quote + + s/“/"/g; # open double quote + s/”/"/g; # close double quote + + s/…/.../g; # ellipsis + + return $_; +} + + +sub SmartyPantsVersion { + return $VERSION; +} + + +sub ProcessEscapes { +# +# Parameter: String. +# Returns: The string, with after processing the following backslash +# escape sequences. This is useful if you want to force a "dumb" +# quote or other character to appear. +# +# Escape Value +# ------ ----- +# \\ \ +# \" " +# \' ' +# \. . +# \- - +# \` ` +# + local $_ = shift; + + s! \\\\ !\!gx; + s! \\" !"!gx; + s! \\' !'!gx; + s! \\\. !.!gx; + s! \\- !-!gx; + s! \\` !`!gx; + + return $_; +} + + +sub _tokenize { +# +# Parameter: String containing HTML markup. +# Returns: Reference to an array of the tokens comprising the input +# string. Each token is either a tag (possibly with nested, +# tags contained therein, such as , or a +# run of text between tags. Each element of the array is a +# two-element array; the first is either 'tag' or 'text'; +# the second is the actual value. +# +# +# Based on the _tokenize() subroutine from Brad Choate's MTRegex plugin. +# +# + + my $str = shift; + my $pos = 0; + my $len = length $str; + my @tokens; + + my $depth = 6; + my $nested_tags = join('|', ('(?:<(?:[^<>]') x $depth) . (')*>)' x $depth); + my $match = qr/(?s: ) | # comment + (?s: <\? .*? \?> ) | # processing instruction + $nested_tags/x; # nested tags + + while ($str =~ m/($match)/g) { + my $whole_tag = $1; + my $sec_start = pos $str; + my $tag_start = $sec_start - length $whole_tag; + if ($pos < $tag_start) { + push @tokens, ['text', substr($str, $pos, $tag_start - $pos)]; + } + push @tokens, ['tag', $whole_tag]; + $pos = pos $str; + } + push @tokens, ['text', substr($str, $pos, $len - $pos)] if $pos < $len; + \@tokens; +} + + +1; +__END__ + + +=pod + +=head1 NAME + +B + + +=head1 SYNOPSIS + +B [ B<-1> ] [ B<-2> ] [ B<-3> ] [ B<--version> ] [ B<--shortversion> ] + [ I ... ] + + +=head1 DESCRIPTION + +SmartyPants is a web publishing utility that translates plain ASCII +punctuation characters into "smart" typographic punctuation HTML +entities. SmartyPants can perform the following transformations: + +=over 4 + +=item * + +Straight quotes ( " and ' ) into "curly" quote HTML entities + +=item * + +Backticks-style quotes (``like this'') into "curly" quote HTML entities + +=item * + +Dashes (C<--> and C<--->) into en- and em-dash entities + +=item * + +Three consecutive dots (C<...>) into an ellipsis entity + +=back + +SmartyPants is a combination plug-in -- the same file works with Movable +Type, Blosxom, BBEdit, and as a standalone Perl script. Version +requirements and installation instructions for each of these tools can +be found in the readme file that accompanies this script. + +SmartyPants does not modify characters within C<<
     >>, C<<  >>,
    +C<<  >>, C<< 
    +		
    +	
    +
    +	
    +		<xsl:value-of select="."/>
    +	
    +
    +	
    +		
    +		
    +
    +
    + + +
    +
    + + + + + +
    +

    + + +
    +
    + + +
    +

    + + +
    +
    + + + + + + + + + + +
  • + +
  • +
    + + + +
      + +
    +
    + + +
      + +
    +
    + + + diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/science.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/science.xslt new file mode 100755 index 00000000..178ced85 --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/science.xslt @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + \documentclass[oneside,article,9pt]{memoir} +\usepackage{layouts}[2001/04/29] +\usepackage{science} +\usepackage{xmpincl} % Seems to be required to get the pdf to generate?? + +\def\revision{} + + + + + + + + + + + \begin{abstract} + + \addcontentsline{toc}{section}{ + + } + + +\begin{body} + +% Layout settings +\setlength{\parindent}{1em} + +\section{ + + } + + + \label{ + + } + + + + + + + \end{abstract} + +\begin{body} + +% Layout settings +\setlength{\parindent}{1em} + + + \section{ + + } + + \label{ + + } + + + + + + \subsection*{ + + } + + \label{ + + } + + + + + + + \begin{verbatim} + + + + +\end{verbatim} + + + + + \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/sffms-no-chapter-titles.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/sffms-no-chapter-titles.xslt new file mode 100755 index 00000000..4c4ee243 --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/sffms-no-chapter-titles.xslt @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + \chapter*{ + + } + + \label{ + + } + + + + + \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/sffms.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/sffms.xslt new file mode 100755 index 00000000..af54350f --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/sffms.xslt @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + + + + \end{document} + + + + + \documentclass[courier,novel]{sffms} + + + + + + + + + +\begin{document} + + + + + + + + + + + + + + + + + + + + + + + + + + + \chapter*{ + + } + + \label{ + + } + + + + + + \chapter{ + + } + + \label{ + + } + + + + + + \newscene + + + + + + + + + + + + + + + + + + \begin{verbatim} + + + + + \end{verbatim} + + + + + + \title{ + + + + + + } + + + + + + + \author{ + + + + + + } + + + + \def\latexauthor{ + + } + + + + \authorname{ + + + + + + } + + + + \title{ + + + + + + + + + + + + + + \\ + + + } + + + + \runningtitle{ + + + + + + } + + + + \surname{ + + + + + + } + + + + \address{ + + + + + + + + + + + + + + \\ + + + } + + + + \wordcount{ + + + + + + } + + + + + + + + + + ( + + + + + + ) + + + + + \underline{ + + } + + + + + \textbf{ + + } + + + \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/snippet.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/snippet.xslt new file mode 100755 index 00000000..a2d32456 --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/snippet.xslt @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-google-docs.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-google-docs.xslt new file mode 100755 index 00000000..efb6aef6 --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-google-docs.xslt @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Bibliography

    +
      + +
    +
    + + +
  • + [# + + ] + +
  • +
    + + + + + + + + + + + # + + + + +
    \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-poetry-support.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-poetry-support.xslt new file mode 100755 index 00000000..477d703a --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-poetry-support.xslt @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +					
    +				
    +
    + + + + + +
    +
    + + + + + +
    \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-static-site.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-static-site.xslt new file mode 100755 index 00000000..4bc727fc --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-static-site.xslt @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + ]]> + +

    +
    + +
    +
    +
    + + ]]> + + + ]]> +
    +
    + + +
    \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc-h2.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc-h2.xslt new file mode 100755 index 00000000..da05e504 --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc-h2.xslt @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Table of Contents

    + +
      + + +
    + +
    +
    + + + + + + + + + + + +
  • + + + + + +
      + + +
    + +
    +
  • +
    + + + + + + +
  • + + + +
  • +
    + + + + + + + + +  ↩ + + + + + + + + + +  ↩ + + + +
    \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc.xslt new file mode 100755 index 00000000..2d49746d --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml-toc.xslt @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Table of Contents

    + +
      + + +
    + +
    +
    + + + + + + + + + + + +
  • + + + + + +
      + + +
    + +
    +
  • +
    + + + + + + +
  • + + + +
  • +
    + + + + + + + + +  ↩ + + + + + + + + + +  ↩ + + + +
    \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2latex.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2latex.xslt new file mode 100755 index 00000000..a95371ac --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2latex.xslt @@ -0,0 +1,1238 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \def\mytitle{ + + + + + + } + + + + + + + + \def\myauthor{ + + + + + + } + + + + \def\latexauthor{ + + } + + + + \date{ + + + + + + } +\def\mydate{ + + + + + + } + + + + \def\affiliation{ + + + + + + + + + + + + + + \\ + + + } + + + + \def\revision{Revision: + + + + + + } + + + + \def\email{ \href{mailto: + + + + + + + + + + + + + + \\ + + + }{ + + + + + + + + + + + + + + \\ + + + }} + + + + \def\web{\href{ + + http:// + + + + + + + + + + + + + + + \\ + + + }{ + + + + + + + + + + + + + + \\ + + + }} + + + + \def\mykeywords{ + + + + + + ,, + + + , + + + } + + + + \usepackage{xmpincl} +\includexmp{ + + + + + + } + + + + \def\bibliocommand{\bibliography{ + + + + + + }} + + + + \def\mybibliostyle{ + + + + + + } + + + + + + + + + + + \def\mychapterstyle{ + + + + + + } + + + + \def\mypagestyle{ + + + + + + } + + + + \def\mycopyright{ + + + + + + + + + + + + + + \\ + + + } + + + + \def\myclosing{ + + + + + + + + + + + + + + \\ + + + } + + + + \def\ + + { + + + + + + + + + + + + + + \\ + + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +% Title Page + +\maketitle + + + + + + + % Copyright Page +\ifx\mycopyright\undefined +\else + \textcopyright{} \mycopyright +\fi + + + + + + + + % +% Main Content +% + + + + + + + + + + + + + + + + + + + + + + + + \renewcommand\refname{ + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + description= + + } + + + + + + + + \\ +\\ + + + + + + + + + + + {name= + + , + + + + sort= + + , + + + + + + + + + + + + + + + + \footnote{ + + + + } + + + + \glossary + + + + + + + + + + + + + \url{ + + + + + + } + + + + + \href{ + + }{ + + + + + + } + + + + + + + \autoref{ + + } + + + + (\autoref{ + + }) + + + + + + + \href{ + + }{ + + + + + + }\footnote{\href{ + + }{ + + + + + + }} + + + + + + + \begin{enumerate} + + + + \end{enumerate} + + + + + + + \begin{itemize} + + + + \end{itemize} + + + + + + + +\item + + + + + + \begin{description} + + \end{description} + + + + + \item[ + + ] + + + + + + + + + + + \texttt{ + + } + + + + + \\ + + + + + \begin{quotation} + + + \end{quotation} + + + + + + + {\itshape + + } + + + + + \textbf{ + + } + + + + + \vskip 2em +\hrule height 0.4pt +\vskip 2em + + + + + + + \begin{figure} + + \begin{center} + + + + + \resizebox{ + + + + + + + + px + + + pt + + + + + pt + + + + ! + + + }{ + + + + + + + + px + + + pt + + + + + pt + + + + ! + + + }{ + + + + \resizebox{1\linewidth}{!}{ + + \includegraphics{ + + }} +\end{center} + + + + \caption{ + + } + + + + + \label{ + + } + + + \end{figure} + + + + + + + + + + + + + + \begin{table}[htbp] +\begin{minipage}{\linewidth} +\centering + + + \begin{tabular}{@{}p{0.5\linewidth}@{}} \\ \toprule + + + + \end{tabular} +\end{minipage} +\end{table} + + + + + + + \begin{table}[htbp] +\begin{minipage}{\linewidth} +\setlength{\tymax}{0.5\linewidth} +\centering +\small + + + \begin{tabulary}{\linewidth}{@{} + + @{}} \\ \toprule + + + + \end{tabulary} +\end{minipage} +\end{table} + + + + + + + \bottomrule + + + + + + + + C + + + c + + + + + + + R + + + r + + + + + + + J + + + l + + + + + + + + + \midrule + + + + + \caption{ + + } + + + \label{ + + } + + + + + + + + + \\ + + + + + + + + + + + \cmidrule{ + + - + + } + + + + + + + + + + + \\ + + + + + \\ + + + + + + \multicolumn{ + + + + }{c}{ + + + + } + + + & + + + + + + + \cite + + + } + + + + ~\cite + + + } + + + + ~\nocite{ + + } + + + + { + + + + + { + + + + + [ + + ] + + + + + + + + + \begin{thebibliography}{ + + } + + + + +\end{thebibliography} + + + + + + + +\bibitem{ + + } + + + + + + + + + + + + + \usepackage{fancyvrb} % Allow \verbatim et al. in footnotes +\usepackage{graphicx} % To include graphics in pdf's (jpg, gif, png, etc) +\usepackage{booktabs} % Better tables +\usepackage{tabulary} % Support longer table cells +\usepackage[utf8]{inputenc} % For UTF-8 support +\usepackage[T1]{fontenc} % Use T1 font encoding for accented characters +\usepackage{xcolor} % Allow for color (annotations) + +%\geometry{landscape} % Activate for rotated page geometry + +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty + % line rather than an indent + + +\def\myauthor{Author} % In case these were not included in metadata +\def\mytitle{Title} +\def\mykeywords{} +\def\mybibliostyle{plain} +\def\bibliocommand{} + +\VerbatimFootnotes + + + + + + +% +% PDF Stuff +% + +%\ifpdf % Removed for XeLaTeX compatibility +% \pdfoutput=1 % Removed for XeLaTeX compatibility + \usepackage[ + plainpages=false, + pdfpagelabels, + pdftitle={\mytitle}, + pagebackref, + pdfauthor={\myauthor}, + pdfkeywords={\mykeywords} + ]{hyperref} + \usepackage{memhfixc} +%\fi % Removed for XeLaTeX compatibility + + +% +% Title Information +% + + +\ifx\latexauthor\undefined +\else + \def\myauthor{\latexauthor} +\fi + +\ifx\subtitle\undefined +\else + \addtodef{\mytitle}{}{ \\ \subtitle} +\fi + +\ifx\affiliation\undefined +\else + \addtodef{\myauthor}{}{ \\ \affiliation} +\fi + +\ifx\address\undefined +\else + \addtodef{\myauthor}{}{ \\ \address} +\fi + +\ifx\phone\undefined +\else + \addtodef{\myauthor}{}{ \\ \phone} +\fi + +\ifx\email\undefined +\else + \addtodef{\myauthor}{}{ \\ \email} +\fi + +\ifx\web\undefined + \else + \addtodef{\myauthor}{}{ \\ \web} +\fi + +\title{\mytitle} +\author{\myauthor} + +\begin{document} + + + + + + + + % Bibliography +\bibliographystyle{\mybibliostyle} +\bibliocommand + +\end{document} + + + + + + + {\color[HTML]{ + + + + + + color:# + + + + + + } + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2rtf.xslt b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2rtf.xslt new file mode 100755 index 00000000..9040a1b3 --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/XSLT/xhtml2rtf.xslt @@ -0,0 +1,540 @@ + + + + + + + + + + + + + + + + + + + + + + +\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\fonttbl{\f0\froman Times;} +{\f1\fmodern Courier;}} +{\stylesheet{\s0\f0\fs24\qj\sb280\sa280 Normal;} +{\s1\fs48\f0\sb280\sa280 Header1;} +{\s2\fs40\f0\sb280\sa280 Header2;} +{\s3\fs32\f0\sb280\sa280 Header3;} +{\s4\fs24\f0\sb280\sa280 Header4;} +{\s5\fs24\f0\sb280\sa280 Header5;} +{\s6\fs24\f0\sb280\sa280 Header6;} +{\s7\f1\fs20 Mono;} +} +{\colortbl;\red255\green255\blue255;} +{\info + + + + + }\margl1440\margr1440 +\f0\pard\sa280 + + + + + } + + + + {\title + + + + + + } + + + + + + + {\author + + + + + + } + + + + {\*\company + + + + + + + + + + + + + + + + + } + + + + {\keywords + + + + + + ,, + + + , + + + } + + + + {\*\copyright + + + + + + + + + + + + + + + + + } + + + + + + + + + \s0\qj + + \ + + + + + + +\i + + +\i0 + + + + + +\b + + +\b0 + + + + + +\s1 {\*\bkmkstart }{\*\bkmkend } + + + + +\s2 {\*\bkmkstart }{\*\bkmkend } + + + + +\s3 + + + + +\s4 + + + + +\s5 + + + + +\s6 + + + + + \line + + + + + + + + +\lin\rin750 + + + + \lin0\rin0 + + + + +\lin\rin750 + + + + \lin0\rin0 + + + + + + + + + + + {\super \chftn{\*\footnote{ + + + + }}} + + + + {\super \chftn{\*\footnote{ + + + + }}} + + + + + + + + + \url{ + + + + + + } + + + + + {\field{\*\fldinst{HYPERLINK " + + "}}{\fldrslt \b \cf0 + + + + + + }} + + + + + {\field{\*\fldinst REF + + }{\fldrslt \b \cf0 + + + + + + }} + + + + + {\field{\*\fldinst{HYPERLINK " + + "}}{\fldrslt \b \cf0 + + + + + + }}{\super \chftn{\*\footnote{ + + + + + + }}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ + + + + + + + + : + + + + + + + + + {\super \chftn{\*\footnote{ + + + + }}} + + + + + + + + + + + + + + + + \f1\fs20 + + \f0\fs24 + + + + + + + + + \f1\fs20 + + \f0\fs24 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/base.css b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/base.css new file mode 100755 index 00000000..21d3bd9d --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/base.css @@ -0,0 +1,375 @@ +/* + base.css + MultiMarkdown Zettel rendering + + Created by Christian Tietze on 2010-09-28. + http://christiantietze.de +*/ + +/* based on: + * base.css | v0.4 (06132010) | Thierry Koblentz + * See: http://thinkvitamin.com/design/setting-rather-than-resetting-default-styling/ + * typography guide: + * Azbuka - CSS Typographical Base Rendering Library + * http://code.google.com/p/azbuka/ + */ + +/* HTML 5 fix */ +header, nav, article, footer, aside, address, section { display: block; } + +/* * * * * * + * + * T Y P O G R A P H Y + * + */ + +/* using height:100% on html and body allows to style containers with a 100% height + * the overflow declaration is to make sure there is a gutter for the scollbar in all browsers regardless of content + * note that there is no font-size declaration set in this rule. If you wish to include one, you should use font-size: 100.01% to prevent bugs in IE and Opera + */ +html { + height: 100%; + overflow-y: scroll; + font-size: 100.01%; +} +/* not all browsers set white as the default background color + * color is set to create not too much contrast with the background color + * line-height is to ensure that text is legible enough (that there is enough space between the upper and lower line) + */ +body { +/* height: 100%;*/ +/* font-size: 0.8125em; */ + line-height: 1.618em; /* 13px, golden rule line-height */ + font-size-adjust:none; + font-style:normal; + font-variant:normal; + font-weight:normal; +} + +/* this choice of font-family is supposed to render text the same across platforms + * letter-spacing makes the font a bit more legible + * + * See Eric Meyer's article about Fixed Monospace Sizing + * http://meyerweb.com/eric/thoughts/2010/02/12/fixed-monospace-sizing/ + */ + +body, input, button, textarea, select, h1, h2, h3, h4, h5, h6 { + font-family: Georgia, "DejaVu Serif", serif; + letter-spacing: .05em; +} +pre, tt, code, kbd, samp, var { + font-family: "Anonymous Pro", "Courier New", Courier, monospace, serif; +} + +/* These should be self explanatory + */ +/* h1 { font-size: 2.615em; line-height: 1.18; } /* 34px */ +h1 { font-size: 2em; line-height: 1.19; } /* 26px */ +h2 { font-size: 1.618em; line-height: 1.24; } /* 21 */ +h3 { font-size: 1.308em; line-height: 1.23; } /* 17*/ +h4, h5, h6 { font-size: 1em; line-height: 1.3; font-weight: 700; } /* 13px */ + +h2, h3, h4, h5 { font-weight: normal; } + +/* styling for links and visited links as well as for links in a hovered, focus and active state + * make sure to keep these rules in that order, with :active being last + * text-decoration: none is to make the links more legible while they are in a hovered, focus or active state + * a:focus and :focus are used to help keyboard users, you may change their styling, but make sure to give users a visual clue of the element's state. + * outline:none used with the pseudo-class :hover is to avoid outline when a user clicks on links + * note that these last rules do not do anything in IE as this browser does not support "outline" + */ +a:link {text-decoration: none;border-bottom: 1px solid #000;color: #000;} +a:visited {} +a:hover {border-bottom-color: transparent;} +a:focus {text-decoration: none;} +a:focus,:focus {outline: 1px dotted #000;} +a:hover,a:active {outline: none;} + +/* + * This one is commented out as it may be overkill (users who use both a mouse and the keyboard would lose keyboard focus) + * Besides, this may create a performance issue + * html:hover a {outline: none;} + */ + +/* margin and padding values are reset for all these elements + * you could remove from there elements you do not used in your documents, but I don't think it'd worth it + */ +p, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, blockquote, th, td { + margin: 0; + padding: 0; +} + +body { padding: 0.8125em 0; } + +/* this is to prevent border from showing around fieldsets and images (i.e., images inside anchors) + */ +fieldset, img { + border: 0; +} + +/* to prevent a gap from showing below images in some browsers + */ +img {vertical-align: bottom;} + +/* Styling of list items + * This styles sheet contains a class to apply on lists to reset list-type and margin on LIs + */ +ol li, +ul ol li {list-style-type: decimal;} +ul li {list-style-type: disc;} +ul ul li {list-style-type: circle;} +ul ul ul li {list-style-type: square;} +ol ol li {list-style-type: lower-alpha;} +ol ol ol li {list-style-type: lower-roman;} + +/* These should be self explanatory + * I believe *most* UAs style sub and sup like this by default so I am not sure there is value to include these rules here + */ +sub { + vertical-align: sub; + font-size: smaller; +} + +sup { + vertical-align: super; + font-size: smaller; +} + +/* color is to make that element stands out (see color set via body) + * padding is used so Internet Explorer does not cut-off descenders in letters like p, g, etc.) + */ +legend { + color: #000; + padding-bottom: .5em; +} + +/* according to Eric Meyer's reset: tables still need 'cellspacing="0"' in the markup + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* caption and summary are very important for tabular data but because caption is nearly impossible to style across browsers many authors do not use it or use display:none to "hide" it (which is almost the same as not using it). + * so to prevent such workaround, I am positioning this element off-screen + */ +caption { + position: absolute; + left: -999em; +} + +/* all th should be centered unless they are in tbody (table body) + */ +th {text-align: center;} +tbody th {text-align: left;} + +/* code {color: #06f;} */ +code { background: rgba(255,255,255,0.8); padding: 0 0.404em; } +pre code { padding: 0; } +code, pre { font-size: 1em;} + +/* This should be self explanatory + */ +blockquote, q, em, cite, dfn, i, cite, var, address { + font-style: italic; +} + +blockquote em, q em, cite em { + margin-left: 0.3em; + letter-spacing: 0.2em; + word-spacing: 0.3em; +} + +/* to prevent some browsers from inserting quotes on "q" and "p" ("p" in blockquotes) + */ +blockquote p:before, blockquote p:after, q:before, q:after {content: '';} + +/* These should be self explanatory + */ +th, strong, dt, b { + font-weight: bold; +} + +ins { + text-decoration: none; + border-bottom: 3px double #333; +} + +del {text-decoration: line-through;} + +abbr { + border-bottom: 1px dotted #333; + font-variant: normal; +} + +/* Creating white space (vertical gutters) via padding + * most authors do not set right/left padding or margin on these elements, they rather use an extra wrapper or style the container with padding to create the left and right gap/gutter they need + * I find that the latter creates less robust layouts because it leads authors to mix padding with width which creates issue with the broken box model (IE5 or IE6 in quirks mode) + * so imho, setting this style using the child combinator (i.e., div > h1) should be the best way to do it, but unfortunately IE 6 does not support such syntax, so I have to go with the following + a reset (see next rule) + * + * Only applicable for non-iOS devices to preserve screen real estate. + */ +@media screen and (min-device-width: 480px) { +h1, h2, h3, h4, h5, h6, p, pre, ul, ol, dl, fieldset, address {padding:0 30px;} +} + +/* this is to reset the left/right gaps (created by the previous and next rules) on nested elements + */ +dd p, dd pre, dd ul, dd ol, dd dl, li p, li pre, li ul, li ol, li dl, fieldset p, fieldset ul, fieldset ol, blockquote p { + padding-right: 0; + padding-left: 0; +} + +ul { list-style-position:outside; } +li ul, +li ol { margin:0 1.618em; } +ul, ol { margin: 0 0 1.618em 0; } + +dl { margin: 0 0 1.618em 0; } +dl dt { font-weight: 700; } +dl dd { margin-left: 1.618em; } + +/* These should be self explanatory + */ +dd { + padding-left: 20px; + margin-top: .5em; +} + +/* we cannot use padding on a table to create left and right gaps (as we do with the elements above), instead we use margin + */ +table { + margin-right: 30px; + margin-left: 30px; +} + +/* we use margin for hr for the same reason we do for table + */ +hr { + margin-right: 30px; + margin-left: 30px; + border-style: inset; + border-width: 1px; + margin-bottom:1.618em; +} + +/* same here for blockquote to display a decent border */ +blockquote { margin-left: 30px; border-left: 0.8125em solid #ddd; padding-left: 0.8125em;} + +/* --top-- bottom margin solution */ +/* this is my approach to create white space between elements, you do not have to adhere to it + * rather than styling these elements with top and bottom margin, or simply bottom margin I only use top margin + */ +h1, h2, h3, h4, h5, h6 { margin-bottom: 5px;} +pre, dl, legend, input, button, textarea, select, address, table { margin-bottom: 1.618em; } +p { margin-bottom: 0.8125em; } + +/* top padding solution */ +/* this is a different approach which may be less frustrating for novice because it avoids running into collapsing margin and allows to clear floats while preserving space above the element + * if you decide to give this a try, then comment out the above rule and uncomment the two next ones + */ + /* + h1, h2, h3, h4, h5, h6, p, pre, dt, dd, li, legend, address {padding-top: 1.2em;} + hr, input, button, textarea, select, table {margin-top: 1.2em;} + */ + +address { margin-top:1.618em; font-style: italic; } + + +/* * * * * * + * + * F O R M E L E M E N T S + * + */ + +/* this should not affect the layout of the labels unless you style them in a way that padding applies + * if I include this here it is mostly because when labels are styled with float and clear, top padding creates a gap between labels (bottom margin would, but not top margin) + */ +label {padding-top: 1.618em;} + +/* line height helps to set the vertical alignment of radio buttons and check boxes (remember to group these in fieldsets) + */ +fieldset {line-height: 1;} + +/* vertical alignment of checkboxes (a different value is served to IE 7) + */ +input[type="checkbox"] { + vertical-align: bottom; + *vertical-align: baseline; +} + +/* vertical alignment of radio buttons + */ +input[type="radio"] {vertical-align: text-bottom;} + +/* vertical alignment of input fields for IE 6 + */ +input {_vertical-align: text-bottom;} + +/* a specific font-size is set for these elements + * the line-height is to override FF's default styling + */ +input, button, textarea, select, optgroup, option { + font-size: .9em; + line-height: 1.4 !important; +} + +/* this is to fix IE 6 and 7 which create extra right/left padding on buttons + * IMPORTANT: because IE 6 does not understand the first selector below, you need to apply the class "inputButton" to all input of type="button" in your documents + * the first declaration is for IE 6 and 7, the second one for IE 6 only, the third one is for all browsers. + */ +button, +input[type="submit"], +input[type="reset"], +input[type="button"], +.inputButton { + *overflow: visible; + _width: 0; + padding: .2em .4em; +} + + +/* * * * * * + * + * C L A S S E S + * + */ + +/* to style elements with the default padding and margin we set on headings, paragraphs, lists, etc. + * for example, this class could be used on a DIV inside a blockquote or a DIV inside a FORM, etc. + */ +.block { + padding: 0 30px; + margin-top: 1.618em; +} + +/* to swap padding for margin + * for example, this class could be used on a heading you'd style with a bottom border + */ +.padding2margin { + margin-right: 30px; + margin-left: 30px; + padding-right: 0; + padding-left: 0; +} + +/* list items are styled by default with markers (disc, etc.) and left margin + * if you apply the class "noMarker" to a list, its items won't display markers and won't have left margin + */ +.noMarker li { + list-style: none; + margin-left: 0; +} + +.footnotes ol { + list-style-position: inside; +} + +sup.footnote { + line-height: 0px; +} + +/* ease clickability */ +sup.footnote a { + padding: 0.1em 0.15em; +} \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/ASCIIMathML.pm b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/ASCIIMathML.pm new file mode 100755 index 00000000..ce568723 --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/ASCIIMathML.pm @@ -0,0 +1,1785 @@ +package Text::ASCIIMathML; + +=pod +=head1 NAME + +Text::ASCIIMathML - Perl extension for parsing ASCIIMathML text into MathML + +=head1 SYNOPSIS + + use Text::ASCIIMathML; + + $parser=new Text::ASCIIMathML(); + + $parser->SetAttributes(ForMoz => 1); + + $ASCIIMathML = "int_0^1 e^x dx"; + $mathML = $parser->TextToMathML($ASCIIMathML); + $mathML = $parser->TextToMathML($ASCIIMathML, [title=>$ASCIIMathML]); + $mathML = $parser->TextToMathML($ASCIIMathML, undef, [displaystyle=>1]); + + $mathMLTree = $parser->TextToMathMLTree($ASCIIMathML); + $mathMLTree = $parser->TextToMathMLTree($ASCIIMathML, [title=>$ASCIIMathML]); + $mathMLTree = $parser->TextToMathMLTree($ASCIIMathML,undef,[displaystyle=>1]); + + $mathML = $mathMLTree->text(); + $latex = $mathMLTree->latex(); + +=head1 DESCRIPTION + +Text::ASCIIMathML is a parser for ASCIIMathML text which produces +MathML XML markup strings that are suitable for rendering by any +MathML-compliant browser. + +The parser uses the following attributes which are settable through +the SetAttributes method: + +=over 4 + +=item C + +Specifies that the fonts should be optimized for Netscape/Mozilla/Firefox. + +=back + +The output of the TextToMathML method always follows the schema + ... +The first argument of TextToMathML is the ASCIIMathML text to be +parsed into MathML. The second argument is a reference to an array of +attribute/value pairs to be attached to the node and the third +argument is a reference to an array of attribute/value pairs for the + node. Common attributes for the node are "title" and +"xmlns"=>"&mathml;". Common attributes for the node are +"mathcolor" (for text color), "displaystyle"=>"true" for using display +style instead of inline style, and "fontfamily". + +=head2 ASCIIMathML markup + +The syntax is very permissive and does not generate syntax +errors. This allows mathematically incorrect expressions to be +displayed, which is important for teaching purposes. It also causes +less frustration when previewing formulas. + +If you encode 'x^2' or 'a_(mn)' or 'a_{mn}' or '(x+1)/y' or 'sqrtx', +you pretty much get what you expect. The choice of grouping +parenthesis is up to you (they don't have to match either). If the +displayed expression can be parsed uniquely without them, they are +omitted. Most LaTeX commands are also supported, so the last two +formulas above can also be written as '\frac{x+1}{y}' and '\sqrt{x}'. + +The parser uses no operator precedence and only respects the grouping +brackets, subscripts, superscript, fractions and (square) roots. This +is done for reasons of efficiency and generality. The resulting MathML +code can quite easily be processed further to ensure additional +syntactic requirements of any particular application. + +=head3 The grammar + +Here is a definition of the grammar used to parse +ASCIIMathML expressions. In the Backus-Naur form given below, the +letter on the left of the C<::=> represents a category of symbols that +could be one of the possible sequences of symbols listed on the right. +The vertical bar C<|> separates the alternatives. + +=over 4 + + c ::= [A-z] | numbers | greek letters | other constant symbols + (see below) + u ::= 'sqrt' | 'text' | 'bb' | other unary symbols for font commands + b ::= 'frac' | 'root' | 'stackrel' | 'newcommand' | 'newsymbol' + binary symbols + l ::= ( | [ | { | (: | {: left brackets + r ::= ) | ] | } | :) | :} right brackets + S ::= c | lEr | uS | bSS | "any" simple expression + E ::= SE | S/S |S_S | S^S | S_S^S expression (fraction, sub-, + super-, subsuperscript) + +=back + +=head3 The translation rules + +Each terminal symbol is translated into a corresponding MathML +node. The constants are mostly converted to their respective Unicode +symbols. The other expressions are converted as follows: + +=over 4 + + lSr -> lSr + (note that any pair of brackets can be used to + delimit subexpressions, they don't have to match) + sqrt S -> S' + text S -> S' + "any" -> any + frac S1 S2 -> S1' S2' + root S1 S2 -> S2' S1' + stackrel S1 S2 -> S2' S1' + S1/S2 -> S1' S2' + S1_S2 -> S1 S2' + S1^S2 -> S1 S2' + S1_S2^S3 -> S1 S2' S3' or + S1 S2' S3' (in some cases) + S1^S2_S3 -> S1 S3' S2' or + S1 S3' S2' (in some cases) + +=back + +In the rules above, the expression C is the same as C, except that if +C has an outer level of brackets, then C is the expression inside +these brackets. + +=head3 Matrices + +A simple syntax for matrices is also recognized: + + l(S11,...,S1n),(...),(Sm1,...,Smn)r + or + l[S11,...,S1n],[...],[Sm1,...,Smn]r. + +Here C and C stand for any of the left and right +brackets (just like in the grammar they do not have to match). Both of +these expressions are translated to + + lS11... + S1n... + Sm1... + Smnr. + +Note that each row must have the same number of expressions, and there +should be at least two rows. + +LaTeX matrix commands are not recognized. + +=head3 Tokenization + +The input formula is broken into tokens using a "longest matching +initial substring search". Suppose the input formula has been +processed from left to right up to a fixed position. The longest +string from the list of constants (given below) that matches the +initial part of the remainder of the formula is the next token. If +there is no matching string, then the first character of the remainder +is the next token. The symbol table at the top of the ASCIIMathML.js +script specifies whether a symbol is a math operator (surrounded by a +C<< >> tag) or a math identifier (surrounded by a C<< >> +tag). For single character tokens, letters are treated as math +identifiers, and non-alphanumeric characters are treated as math +operators. For digits, see "Numbers" below. + +Spaces are significant when they separate characters and thus prevent +a certain string of characters from matching one of the +constants. Multiple spaces and end-of-line characters are equivalent +to a single space. + +=head3 Numbers + +A string of digits, optionally followed by a decimal point (a period) +and another string of digits, is parsed as a single token and +converted to a MathML number, i.e., enclosed with the C<< >> +tag. + +=head3 Greek letters + +=over 4 + +=item Lowercase letters + +C C C C C C C C +C C C C C C C C C +C C C C C C + +=item Uppercase letters + +C C C C C C C C +C C + +=item Variants + +C C C + +=back + +=head3 Standard functions + +sin cos tan csc sec cot sinh cosh tanh log ln det dim lim mod gcd lcm +min max + +=head3 Operation symbols + + Type Description Entity + + + + + - - - + * Mid dot ⋅ + ** Star ⋆ + // / / + \\ \ \ + xx Cross product × + -: Divided by ÷ + @ Compose functions ∘ + o+ Circle with plus ⊕ + ox Circle with x ⊗ + o. Circle with dot ⊙ + sum Sum for sub- and superscript ∑ + prod Product for sub- and superscript ∏ + ^^ Logic "and" ∧ + ^^^ Logic "and" for sub- and superscript ⋀ + vv Logic "or" ∨ + vvv Logic "or" for sub- and superscript ⋁ + nn Logic "intersect" ∩ + nnn Logic "intersect" for sub- and superscript ⋂ + uu Logic "union" ∪ + uuu Logic "union" for sub- and superscript ⋃ + +=head3 Relation symbols + + Type Description Entity + = = = + != Not equals ≠ + < < < + > > > + <= Less than or equal ≤ + >= Greater than or equal ≥ + -lt Precedes ≺ + >- Succeeds ≻ + in Element of ∈ + !in Not an element of ∉ + sub Subset ⊂ + sup Superset ⊃ + sube Subset or equal ⊆ + supe Superset or equal ⊇ + -= Equivalent ≡ + ~= Congruent to ≅ + ~~ Asymptotically equal to ≈ + prop Proportional to ∝ + +=head3 Logical symbols + + Type Description Entity + and And " and " + or Or " or " + not Not ¬ + => Implies ⇒ + if If " if " + iff If and only if ⇔ + AA For all ∀ + EE There exists ∃ + _|_ Perpendicular, bottom ⊥ + TT Top ⊤ + |-- Right tee ⊢ + |== Double right tee ⊨ + +=head3 Grouping brackets + + Type Description Entity + ( ( ( + ) ) ) + [ [ [ + ] ] ] + { { { + } } } + (: Left angle bracket ⟨ + :) Right angle bracket ⟩ + {: Invisible left grouping element + :} Invisible right grouping element + +=head3 Miscellaneous symbols + + Type Description Entity + int Integral ∫ + oint Countour integral ∮ + del Partial derivative &del; + grad Gradient ∇ + +- Plus or minus ± + O/ Null set ∅ + oo Infinity ∞ + aleph Hebrew letter aleph ℵ + & Ampersand & + /_ Angle ∠ + :. Therefore ∴ + ... Ellipsis ... + cdots Three centered dots ⋯ + \ Non-breaking space ( means space)   + quad Quad space    + diamond Diamond ⋄ + square Square □ + |__ Left floor ⌊ + __| Right floor ⌋ + |~ Left ceiling ⌈ + ~| Right ceiling ⌉ + CC Complex numbers ℂ + NN Natural numbers ℕ + QQ Rational numbers ℚ + RR Real numbers ℝ + ZZ Integers ℤ + +=head3 Arrows + + Type Description Entity + uarr Up arrow ↑ + darr Down arrow ↓ + rarr Right arrow → + -> Right arrow → + larr Left arrow ← + harr Horizontal (two-way) arrow ↔ + rArr Right double arrow ⇒ + lArr Left double arrow ⇐ + hArr Horizontal double arrow ⇔ + +=head3 Accents + + Type Description Output + hat x Hat over x x^ + bar x Bar over x x¯ + ul x Underbar under x x_ + vec x Right arrow over x x + dot x Dot over x x. + ddot x Double dot over x x.. + +=head3 Font commands + + Type Description + bb A Bold A + bbb A Double-struck A + cc A Calligraphic (script) A + tt A Teletype (monospace) A + fr A Fraktur A + sf A Sans-serif A + +=head3 Defining new commands and symbols + +It is possible to define new commands and symbols using the +'newcommand' and 'newsymbol' binary operators. The former defines a +macro that gets expanded and reparsed as ASCIIMathML and the latter +defines a constant that gets used as a math operator (C<< >>) +element. Both of the arguments must be text, optionally enclosed in +grouping operators. The 'newsymbol' operator also allows the +second argument to be a group of two text strings where the first is +the mathml operator and the second is the latex code to be output. + +For example, 'newcommand "DDX" "{:d/dx:}"' would define a new command +'DDX'. It could then be invoked like 'DDXf(x)', which would +expand to '{:d/dx:}f(x)'. The text 'newsymbol{"!le"}{"≰"}' +could be used to create a symbol you could invoke with '!le', as in 'a +!le b'. + +=head2 Attributes for + +=over 4 + +=item C + +The title attribute for the element, if specified. In many browsers, +this string will appear if you hover over the MathML markup. + +=item C + +The id attribute for the element, if specified. + +=item C + +The class attribute for the element, if specified. + +=back + +=head2 Attributes for + +=over 4 + +=item C + +The displaystyle attribute for the element, if specified. One of the +values "true" or "false". If the displaystyle is false, then fractions +are represented with a smaller font size and the placement of +subscripts and superscripts of sums and integrals changes. + +=item C + +The mathvariant attribute for the element, if specified. One of the +values "normal", "bold", "italic", "bold-italic", "double-struck", +"bold-fraktur", "script", "bold-script", "fraktur", "sans-serif", +"bold-sans-serif", "sans-serif-italic", "sans-serif-bold-italic", or +"monospace". + +=item C + +The mathsize attribute for the element, if specified. Either "small", +"normal" or "big", or of the form "number v-unit". + +=item C + +A string representing the font family. + +=item C + +The mathcolor attribute for the element, if specified. It be in one of +the forms "#rgb" or "#rrggbb", or should be an html-color-name. + +=item C + +The mathbackground attribute for the element, if specified. It should +be in one of the forms "#rgb" or "#rrggbb", or an html-color-name, or +the keyword "transparent". + + +=head1 METHODS + +=head2 C + +=head3 C + +Converts C<$text> to a MathML string. If the optional C<$math_attr> +argument is provided, it should be a reference to a hash of +attribute/value pairs for the C< > node. If the optional +C<$mstyle_attr> argument is provided, it should be a reference to a +hash of attribute/value pairs for the C< > node. + +=head3 C + +Like C except that instead of returning a string, it +returns a C representing the parsed MathML +structure. + +=head2 C + +=head3 C + +Returns a MathML string representing the parsed MathML structure +encoded by the C. + +=head3 C + +Returns a LaTeX string representing the parsed MathML structure +encoded by the C. + +=head1 BUGS AND SUGGESTIONS + +If you find bugs, think of anything that could improve Text::ASCIIMathML +or have any questions related to it, feel free to contact the author. + +=head1 AUTHOR + +Mark Nodine + +=head1 SEE ALSO + + MathML::Entities, + + +=head1 ACKNOWLEDGEMENTS + +This Perl module has been created by modifying Peter Jipsen's +ASCIIMathML.js script. He deserves full credit for the original +implementation; any bugs have probably been introduced by me. + +=head1 COPYRIGHT + +The Text::ASCIIMathML module is copyright (c) 2006 Mark Nodine, +USA. All rights reserved. + +You may use and distribute them under the terms of either the GNU +General Public License or the Artistic License, as specified in the +Perl README file. + +=cut + +use strict; +use warnings; + +our $VERSION = '0.81'; + +# Creates a new Text::ASCIIMathML parser object +sub new { + my ($class) = @_; + return bless {}, $class; +} + +# Sets an attribute to a given value +# Arguments: Attribute name, attribute value +# Returns: None +# Supported attributes: +# ForMoz Boolean to optimize for Netscape/Mozilla/Firefox +sub SetAttribute : method { + my ($self, $attr, $val) = @_; + $self->{attr}{$attr} = $val; +} + +# Converts an AsciiMathML string to a MathML one +# Arguments: AsciiMathML string, +# optional ref to array of attribute/value pairs for math node, +# optional ref to array of attribute/value pairs for mstyle node +# Returns: MathML string +sub TextToMathML : method { + my $tree = TextToMathMLTree(@_); + return $tree ? $tree->text : ''; +} + +# Converts an AsciiMathML string to a tree of MathML nodes +# Arguments: AsciiMathML string, +# optional ref to array of attribute/value pairs for math node, +# optional ref to array of attribute/value pairs for mstyle node +# Returns: top Text::ASCIIMathML::Node object or undefined +sub TextToMathMLTree : method { + my ($self, $expr, $mathAttr, $mstyleAttr) = @_; + $expr = '' unless defined $expr; + my $mstyle = $self->_createElementMathML('mstyle'); + $mstyle->setAttribute + (ref $mstyleAttr eq 'ARRAY' ? @$mstyleAttr : %$mstyleAttr) + if $mstyleAttr; + $self->{nestingDepth} = 0; + $expr =~ s/^\s+//; + $mstyle->appendChild(($self->_parseExpr($expr, 0))[0]); + return unless $mstyle->childNodes > 0; + my $math = $self->_createMmlNode('math', $mstyle); + $expr =~ s/\n\s*//g; + $math->setAttribute(ref $mathAttr eq 'ARRAY' ? @$mathAttr : %$mathAttr) + if $mathAttr; + + return $math; +} + + + +# Creates an Text::ASCIIMathML::Node object with no tag +# Arguments: None +# Returns: node object +sub _createDocumentFragment : method { + my ($self) = @_; + return Text::ASCIIMathML::Node->new($self); +} + +# Creates an Text::ASCIIMathML::Node object +# Arguments: tag +# Returns: node object +sub _createElementMathML : method { + my ($self, $t) = @_; + return Text::ASCIIMathML::Node->new($self, $t); +} + +# Creates an Text::ASCIIMathML::Node object and appends a node as a child +# Arguments: tag, node +# Returns: node object +sub _createMmlNode : method { + my ($self, $t, $obj) = @_; + my $node = Text::ASCIIMathML::Node->new($self, $t); + $node->appendChild($obj); + return $node; +} + +# Creates an Text::ASCIIMathML::Node text object with the given text +# Arguments: text +# Returns: node object +sub _createTextNode : method { + my ($self, $text) = @_; + return Text::ASCIIMathML::Node->newText ($self, $text); +} + +# Finds maximal initial substring of str that appears in names +# return null if there is none +# Arguments: string +# Returns: matched input, entry from AMSymbol (if any) +sub _getSymbol : method { + my $self = shift; + my ($input, $symbol) = $self->_getSymbol_(@_); + $self->{previousSymbol} = $symbol->{ttype} if $symbol; + return $input, $symbol; +} + +BEGIN { +# character lists for Mozilla/Netscape fonts +my $AMcal = [0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF39,0xEF3A,0x2112,0x2133,0xEF3B,0xEF3C,0xEF3D,0xEF3E,0x211B,0xEF3F,0xEF40,0xEF41,0xEF42,0xEF43,0xEF44,0xEF45,0xEF46]; +my $AMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128]; +my $AMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124]; + +# Create closure for static variables +my %AMSymbol = ( +"sqrt" => { tag=>"msqrt", output=>"sqrt", tex=>'', ttype=>"UNARY" }, +"root" => { tag=>"mroot", output=>"root", tex=>'', ttype=>"BINARY" }, +"frac" => { tag=>"mfrac", output=>"/", tex=>'', ttype=>"BINARY" }, +"/" => { tag=>"mfrac", output=>"/", tex=>'', ttype=>"INFIX" }, +"stackrel" => { tag=>"mover", output=>"stackrel", tex=>'', ttype=>"BINARY" }, +"_" => { tag=>"msub", output=>"_", tex=>'', ttype=>"INFIX" }, +"^" => { tag=>"msup", output=>"^", tex=>'', ttype=>"INFIX" }, +"text" => { tag=>"mtext", output=>"text", tex=>'', ttype=>"TEXT" }, +"mbox" => { tag=>"mtext", output=>"mbox", tex=>'', ttype=>"TEXT" }, +"\"" => { tag=>"mtext", output=>"mbox", tex=>'', ttype=>"TEXT" }, + +# new for perl +"newcommand" => { ttype=>"BINARY"}, +"newsymbol" => { ttype=>"BINARY" }, + +# some greek symbols +"alpha" => { tag=>"mi", output=>"α", tex=>'', ttype=>"CONST" }, +"beta" => { tag=>"mi", output=>"β", tex=>'', ttype=>"CONST" }, +"chi" => { tag=>"mi", output=>"χ", tex=>'', ttype=>"CONST" }, +"delta" => { tag=>"mi", output=>"δ", tex=>'', ttype=>"CONST" }, +"Delta" => { tag=>"mo", output=>"Δ", tex=>'', ttype=>"CONST" }, +"epsi" => { tag=>"mi", output=>"ε", tex=>"epsilon", ttype=>"CONST" }, +"varepsilon" => { tag=>"mi", output=>"ɛ", tex=>'', ttype=>"CONST" }, +"eta" => { tag=>"mi", output=>"η", tex=>'', ttype=>"CONST" }, +"gamma" => { tag=>"mi", output=>"γ", tex=>'', ttype=>"CONST" }, +"Gamma" => { tag=>"mo", output=>"Γ", tex=>'', ttype=>"CONST" }, +"iota" => { tag=>"mi", output=>"ι", tex=>'', ttype=>"CONST" }, +"kappa" => { tag=>"mi", output=>"κ", tex=>'', ttype=>"CONST" }, +"lambda" => { tag=>"mi", output=>"λ", tex=>'', ttype=>"CONST" }, +"Lambda" => { tag=>"mo", output=>"Λ", tex=>'', ttype=>"CONST" }, +"mu" => { tag=>"mi", output=>"μ", tex=>'', ttype=>"CONST" }, +"nu" => { tag=>"mi", output=>"ν", tex=>'', ttype=>"CONST" }, +"omega" => { tag=>"mi", output=>"ω", tex=>'', ttype=>"CONST" }, +"Omega" => { tag=>"mo", output=>"Ω", tex=>'', ttype=>"CONST" }, +"phi" => { tag=>"mi", output=>"ϕ", tex=>'', ttype=>"CONST" }, +"varphi" => { tag=>"mi", output=>"φ", tex=>'', ttype=>"CONST" }, +"Phi" => { tag=>"mo", output=>"Φ", tex=>'', ttype=>"CONST" }, +"pi" => { tag=>"mi", output=>"π", tex=>'', ttype=>"CONST" }, +"Pi" => { tag=>"mo", output=>"Π", tex=>'', ttype=>"CONST" }, +"psi" => { tag=>"mi", output=>"ψ", tex=>'', ttype=>"CONST" }, +"Psi" => { tag=>"mi", output=>"Ψ", tex=>'', ttype=>"CONST" }, +"rho" => { tag=>"mi", output=>"ρ", tex=>'', ttype=>"CONST" }, +"sigma" => { tag=>"mi", output=>"σ", tex=>'', ttype=>"CONST" }, +"Sigma" => { tag=>"mo", output=>"Σ", tex=>'', ttype=>"CONST" }, +"tau" => { tag=>"mi", output=>"τ", tex=>'', ttype=>"CONST" }, +"theta" => { tag=>"mi", output=>"θ", tex=>'', ttype=>"CONST" }, +"vartheta" => { tag=>"mi", output=>"ϑ", tex=>'', ttype=>"CONST" }, +"Theta" => { tag=>"mo", output=>"Θ", tex=>'', ttype=>"CONST" }, +"upsilon" => { tag=>"mi", output=>"υ", tex=>'', ttype=>"CONST" }, +"xi" => { tag=>"mi", output=>"ξ", tex=>'', ttype=>"CONST" }, +"Xi" => { tag=>"mo", output=>"Ξ", tex=>'', ttype=>"CONST" }, +"zeta" => { tag=>"mi", output=>"ζ", tex=>'', ttype=>"CONST" }, + +# binary operation symbols +"*" => { tag=>"mo", output=>"⋅", tex=>"cdot", ttype=>"CONST" }, +"**" => { tag=>"mo", output=>"⋆", tex=>"star", ttype=>"CONST" }, +"//" => { tag=>"mo", output=>"/", tex=>'', ttype=>"CONST" }, +"\\\\" => { tag=>"mo", output=>"\\", tex=>"backslash", ttype=>"CONST" }, +"setminus" => { tag=>"mo", output=>"\\", tex=>'', ttype=>"CONST" }, +"xx" => { tag=>"mo", output=>"×", tex=>"times", ttype=>"CONST" }, +"-:" => { tag=>"mo", output=>"÷", tex=>"div", ttype=>"CONST" }, +"@" => { tag=>"mo", output=>"∘", tex=>"circ", ttype=>"CONST" }, +"o+" => { tag=>"mo", output=>"⊕", tex=>"oplus", ttype=>"CONST" }, +"ox" => { tag=>"mo", output=>"⊗", tex=>"otimes", ttype=>"CONST" }, +"o." => { tag=>"mo", output=>"⊙", tex=>"odot", ttype=>"CONST" }, +"sum" => { tag=>"mo", output=>"∑", tex=>'', ttype=>"UNDEROVER" }, +"prod" => { tag=>"mo", output=>"∏", tex=>'', ttype=>"UNDEROVER" }, +"^^" => { tag=>"mo", output=>"∧", tex=>"wedge", ttype=>"CONST" }, +"^^^" => { tag=>"mo", output=>"⋀", tex=>"bigwedge", ttype=>"UNDEROVER" }, +"vv" => { tag=>"mo", output=>"∨", tex=>"vee", ttype=>"CONST" }, +"vvv" => { tag=>"mo", output=>"⋁", tex=>"bigvee", ttype=>"UNDEROVER" }, +"nn" => { tag=>"mo", output=>"∩", tex=>"cap", ttype=>"CONST" }, +"nnn" => { tag=>"mo", output=>"⋂", tex=>"bigcap", ttype=>"UNDEROVER" }, +"uu" => { tag=>"mo", output=>"∪", tex=>"cup", ttype=>"CONST" }, +"uuu" => { tag=>"mo", output=>"⋃", tex=>"bigcup", ttype=>"UNDEROVER" }, + +# binary relation symbols +"!=" => { tag=>"mo", output=>"≠", tex=>"ne", ttype=>"CONST" }, +":=" => { tag=>"mo", output=>":=", tex=>'', ttype=>"CONST" }, +#"lt" => { tag=>"mo", output=>"<", tex=>'', ttype=>"CONST" }, +"lt" => { tag=>"mo", output=>"<", tex=>'', ttype=>"CONST" }, +"<=" => { tag=>"mo", output=>"≤", tex=>"le", ttype=>"CONST" }, +"lt=" => { tag=>"mo", output=>"≤", tex=>"leq", ttype=>"CONST", latex=>1 }, +">=" => { tag=>"mo", output=>"≥", tex=>"ge", ttype=>"CONST" }, +"geq" => { tag=>"mo", output=>"≥", tex=>'', ttype=>"CONST", latex=>1 }, +"-<" => { tag=>"mo", output=>"≺", tex=>"prec", ttype=>"CONST", latex=>1 }, +"-lt" => { tag=>"mo", output=>"≺", tex=>'', ttype=>"CONST" }, +">-" => { tag=>"mo", output=>"≻", tex=>"succ", ttype=>"CONST" }, +"in" => { tag=>"mo", output=>"∈", tex=>'', ttype=>"CONST" }, +"!in" => { tag=>"mo", output=>"∉", tex=>"notin", ttype=>"CONST" }, +"sub" => { tag=>"mo", output=>"⊂", tex=>"subset", ttype=>"CONST" }, +"sup" => { tag=>"mo", output=>"⊃", tex=>"supset", ttype=>"CONST" }, +"sube" => { tag=>"mo", output=>"⊆", tex=>"subseteq", ttype=>"CONST" }, +"supe" => { tag=>"mo", output=>"⊇", tex=>"supseteq", ttype=>"CONST" }, +"-=" => { tag=>"mo", output=>"≡", tex=>"equiv", ttype=>"CONST" }, +"~=" => { tag=>"mo", output=>"≅", tex=>"cong", ttype=>"CONST" }, +"~~" => { tag=>"mo", output=>"≈", tex=>"approx", ttype=>"CONST" }, +"prop" => { tag=>"mo", output=>"∝", tex=>"propto", ttype=>"CONST" }, + +# new for perl +"<" => { tag=>"mo", output=>"<", tex=>'', ttype=>"CONST" }, +"gt" => { tag=>"mo", output=>">", tex=>'', ttype=>"CONST" }, +">" => { tag=>"mo", output=>">", tex=>'', ttype=>"CONST" }, +"\\!" => { tag=>"", output=>'', tex=>'', ttype=>"NOP" }, + + +# logical symbols +"and" => { tag=>"mtext", output=>"and", tex=>'', ttype=>"SPACE" }, +"or" => { tag=>"mtext", output=>"or", tex=>'', ttype=>"SPACE" }, +"not" => { tag=>"mo", output=>"¬", tex=>"neg", ttype=>"CONST" }, +"=>" => { tag=>"mo", output=>"⇒", tex=>"implies", ttype=>"CONST" }, +"if" => { tag=>"mo", output=>"if", tex=>'if', ttype=>"SPACE" }, +"<=>" => { tag=>"mo", output=>"⇔", tex=>"iff", ttype=>"CONST" }, +"AA" => { tag=>"mo", output=>"∀", tex=>"forall", ttype=>"CONST" }, +"EE" => { tag=>"mo", output=>"∃", tex=>"exists", ttype=>"CONST" }, +"_|_" => { tag=>"mo", output=>"⊥", tex=>"bot", ttype=>"CONST" }, +"TT" => { tag=>"mo", output=>"⊤", tex=>"top", ttype=>"CONST" }, +"|--" => { tag=>"mo", output=>"⊢", tex=>"vdash", ttype=>"CONST" }, +"|==" => { tag=>"mo", output=>"⊨", tex=>"models", ttype=>"CONST" }, + +# grouping brackets +"(" => { tag=>"mo", output=>"(", tex=>'', ttype=>"LEFTBRACKET" }, +")" => { tag=>"mo", output=>")", tex=>'', ttype=>"RIGHTBRACKET" }, +"[" => { tag=>"mo", output=>"[", tex=>'', ttype=>"LEFTBRACKET" }, +"]" => { tag=>"mo", output=>"]", tex=>'', ttype=>"RIGHTBRACKET" }, +"{" => { tag=>"mo", output=>"{", tex=>'', ttype=>"LEFTBRACKET" }, +"}" => { tag=>"mo", output=>"}", tex=>'', ttype=>"RIGHTBRACKET" }, +"|" => { tag=>"mo", output=>"|", tex=>'', ttype=>"LEFTRIGHT" }, +# {input:"||", tag:"mo", output:"||", tex:null, ttype:LEFTRIGHT}, +"(:" => { tag=>"mo", output=>"〈", tex=>"langle", ttype=>"LEFTBRACKET" }, +":)" => { tag=>"mo", output=>"〉", tex=>"rangle", ttype=>"RIGHTBRACKET" }, +"<<" => { tag=>"mo", output=>"〈", tex=>'langle', ttype=>"LEFTBRACKET" }, +">>" => { tag=>"mo", output=>"〉", tex=>'rangle', ttype=>"RIGHTBRACKET" }, +"{:" => { tag=>"mo", output=>"{:", tex=>'', ttype=>"LEFTBRACKET", invisible=>"true" }, +":}" => { tag=>"mo", output=>":}", tex=>'', ttype=>"RIGHTBRACKET", invisible=>"true" }, + +# miscellaneous symbols +"int" => { tag=>"mo", output=>"∫", tex=>'', ttype=>"CONST" }, +"dx" => { tag=>"mi", output=>"{:d x:}", tex=>'', ttype=>"DEFINITION" }, +"dy" => { tag=>"mi", output=>"{:d y:}", tex=>'', ttype=>"DEFINITION" }, +"dz" => { tag=>"mi", output=>"{:d z:}", tex=>'', ttype=>"DEFINITION" }, +"dt" => { tag=>"mi", output=>"{:d t:}", tex=>'', ttype=>"DEFINITION" }, +"oint" => { tag=>"mo", output=>"∮", tex=>'', ttype=>"CONST" }, +"del" => { tag=>"mo", output=>"∂", tex=>"partial", ttype=>"CONST" }, +"grad" => { tag=>"mo", output=>"∇", tex=>"nabla", ttype=>"CONST" }, +"+-" => { tag=>"mo", output=>"±", tex=>"pm", ttype=>"CONST" }, +"O/" => { tag=>"mo", output=>"∅", tex=>"emptyset", ttype=>"CONST" }, +"oo" => { tag=>"mo", output=>"∞", tex=>"infty", ttype=>"CONST" }, +"aleph" => { tag=>"mo", output=>"ℵ", tex=>'', ttype=>"CONST" }, +"..." => { tag=>"mo", output=>"...", tex=>"ldots", ttype=>"CONST" }, +":." => { tag=>"mo", output=>"∴", tex=>"therefore", ttype=>"CONST" }, +"/_" => { tag=>"mo", output=>"∠", tex=>"angle", ttype=>"CONST" }, +"&" => { tag=>"mo", output=>"&", tex=>'\&', ttype=>"CONST" }, +"\\ " => { tag=>"mo", output=>" ", tex=>'\,', ttype=>"CONST" }, +"quad" => { tag=>"mo", output=>"  ", tex=>'', ttype=>"CONST" }, +"qquad" => { tag=>"mo", output=>"    ", tex=>'', ttype=>"CONST" }, +"cdots" => { tag=>"mo", output=>"⋯", tex=>'', ttype=>"CONST" }, +"vdots" => { tag=>"mo", output=>"⋮", tex=>'', ttype=>"CONST" }, +"ddots" => { tag=>"mo", output=>"⋱", tex=>'', ttype=>"CONST" }, +"diamond" => { tag=>"mo", output=>"⋄", tex=>'', ttype=>"CONST" }, +"square" => { tag=>"mo", output=>"□", tex=>'', ttype=>"CONST" }, +"|__" => { tag=>"mo", output=>"⌊", tex=>"lfloor", ttype=>"CONST" }, +"__|" => { tag=>"mo", output=>"⌋", tex=>"rfloor", ttype=>"CONST" }, +"|~" => { tag=>"mo", output=>"⌈", tex=>"lceil", ttype=>"CONST" }, +"~|" => { tag=>"mo", output=>"⌉", tex=>"rceil", ttype=>"CONST" }, +"CC" => { tag=>"mo", output=>"ℂ", tex=>'', ttype=>"CONST" }, +"NN" => { tag=>"mo", output=>"ℕ", tex=>'', ttype=>"CONST" }, +"QQ" => { tag=>"mo", output=>"ℚ", tex=>'', ttype=>"CONST" }, +"RR" => { tag=>"mo", output=>"ℝ", tex=>'', ttype=>"CONST" }, +"ZZ" => { tag=>"mo", output=>"ℤ", tex=>'', ttype=>"CONST" }, +"f" => { tag=>"mi", output=>"f", tex=>'', ttype=>"UNARY", func=>"true" }, +"g" => { tag=>"mi", output=>"g", tex=>'', ttype=>"UNARY", func=>"true" }, + +# standard functions +"lim" => { tag=>"mo", output=>"lim", tex=>'', ttype=>"UNDEROVER" }, +"Lim" => { tag=>"mo", output=>"Lim", tex=>'', ttype=>"UNDEROVER" }, +"sin" => { tag=>"mo", output=>"sin", tex=>'', ttype=>"UNARY", func=>"true" }, +"cos" => { tag=>"mo", output=>"cos", tex=>'', ttype=>"UNARY", func=>"true" }, +"tan" => { tag=>"mo", output=>"tan", tex=>'', ttype=>"UNARY", func=>"true" }, +"sinh" => { tag=>"mo", output=>"sinh", tex=>'', ttype=>"UNARY", func=>"true" }, +"cosh" => { tag=>"mo", output=>"cosh", tex=>'', ttype=>"UNARY", func=>"true" }, +"tanh" => { tag=>"mo", output=>"tanh", tex=>'', ttype=>"UNARY", func=>"true" }, +"cot" => { tag=>"mo", output=>"cot", tex=>'', ttype=>"UNARY", func=>"true" }, +"sec" => { tag=>"mo", output=>"sec", tex=>'', ttype=>"UNARY", func=>"true" }, +"csc" => { tag=>"mo", output=>"csc", tex=>'', ttype=>"UNARY", func=>"true" }, +"log" => { tag=>"mo", output=>"log", tex=>'', ttype=>"UNARY", func=>"true" }, +"ln" => { tag=>"mo", output=>"ln", tex=>'', ttype=>"UNARY", func=>"true" }, +"det" => { tag=>"mo", output=>"det", tex=>'', ttype=>"UNARY", func=>"true" }, +"dim" => { tag=>"mo", output=>"dim", tex=>'', ttype=>"CONST" }, +"mod" => { tag=>"mo", output=>"mod", tex=>'', ttype=>"CONST" }, +"gcd" => { tag=>"mo", output=>"gcd", tex=>'', ttype=>"UNARY", func=>"true" }, +"lcm" => { tag=>"mo", output=>"lcm", tex=>'', ttype=>"UNARY", func=>"true" }, +"lub" => { tag=>"mo", output=>"lub", tex=>'', ttype=>"CONST" }, +"glb" => { tag=>"mo", output=>"glb", tex=>'', ttype=>"CONST" }, +"min" => { tag=>"mo", output=>"min", tex=>'', ttype=>"UNDEROVER" }, +"max" => { tag=>"mo", output=>"max", tex=>'', ttype=>"UNDEROVER" }, + +# arrows +"uarr" => { tag=>"mo", output=>"↑", tex=>"uparrow", ttype=>"CONST" }, +"darr" => { tag=>"mo", output=>"↓", tex=>"downarrow", ttype=>"CONST" }, +"rarr" => { tag=>"mo", output=>"→", tex=>"rightarrow", ttype=>"CONST" }, +"->" => { tag=>"mo", output=>"→", tex=>"to", ttype=>"CONST", latex=>1 }, +"|->" => { tag=>"mo", output=>"↦", tex=>"mapsto", ttype=>"CONST" }, +"larr" => { tag=>"mo", output=>"←", tex=>"leftarrow", ttype=>"CONST" }, +"harr" => { tag=>"mo", output=>"↔", tex=>"leftrightarrow", ttype=>"CONST" }, +"rArr" => { tag=>"mo", output=>"⇒", tex=>"Rightarrow", ttype=>"CONST", latex=>1 }, +"lArr" => { tag=>"mo", output=>"⇐", tex=>"Leftarrow", ttype=>"CONST" }, +"hArr" => { tag=>"mo", output=>"⇔", tex=>"Leftrightarrow", ttype=>"CONST", latex=>1 }, + +# commands with argument + +"hat" => { tag=>"mover", output=>"^", tex=>'', ttype=>"UNARY", acc=>"true" }, +"bar" => { tag=>"mover", output=>"¯", tex=>"overline", ttype=>"UNARY", acc=>"true" }, +"vec" => { tag=>"mover", output=>"→", tex=>'', ttype=>"UNARY", acc=>"true" }, +"dot" => { tag=>"mover", output=>".", tex=>'', ttype=>"UNARY", acc=>"true" }, +"ddot" => { tag=>"mover", output=>"..", tex=>'', ttype=>"UNARY", acc=>"true" }, +"ul" => { tag=>"munder", output=>"̲", tex=>"underline", ttype=>"UNARY", acc=>"true" }, + +"bb" => { tag=>"mstyle", atname=>"fontweight", atval=>"bold", output=>"bb", tex=>'', ttype=>"UNARY" }, +"mathbf" => { tag=>"mstyle", atname=>"fontweight", atval=>"bold", output=>"mathbf", tex=>'', ttype=>"UNARY" }, +"sf" => { tag=>"mstyle", atname=>"fontfamily", atval=>"sans-serif", output=>"sf", tex=>'', ttype=>"UNARY" }, +"mathsf" => { tag=>"mstyle", atname=>"fontfamily", atval=>"sans-serif", output=>"mathsf", tex=>'', ttype=>"UNARY" }, +"bbb" => { tag=>"mstyle", atname=>"mathvariant", atval=>"double-struck", output=>"bbb", tex=>'', ttype=>"UNARY", codes=>$AMbbb }, +"mathbb" => { tag=>"mstyle", atname=>"mathvariant", atval=>"double-struck", output=>"mathbb", tex=>'', ttype=>"UNARY", codes=>$AMbbb }, +"cc" => { tag=>"mstyle", atname=>"mathvariant", atval=>"script", output=>"cc", tex=>'', ttype=>"UNARY", codes=>$AMcal }, +"mathcal" => { tag=>"mstyle", atname=>"mathvariant", atval=>"script", output=>"mathcal", tex=>'', ttype=>"UNARY", codes=>$AMcal }, +"tt" => { tag=>"mstyle", atname=>"fontfamily", atval=>"monospace", output=>"tt", tex=>'', ttype=>"UNARY" }, +"mathtt" => { tag=>"mstyle", atname=>"fontfamily", atval=>"monospace", output=>"mathtt", tex=>'', ttype=>"UNARY" }, +"fr" => { tag=>"mstyle", atname=>"mathvariant", atval=>"fraktur", output=>"fr", tex=>'', ttype=>"UNARY", codes=>$AMfrk }, +"mathfrak" => { tag=>"mstyle", atname=>"mathvariant", atval=>"fraktur", output=>"mathfrak", tex=>'', ttype=>"UNARY", codes=>$AMfrk }, +); + +# Preprocess AMSymbol for lexer regular expression +# Preprocess AMSymbol for tex input +my %AMTexSym = map(($AMSymbol{$_}{tex} || $_, $_), + grep($AMSymbol{$_}{tex}, keys %AMSymbol)); +my $Ident_RE = join '|', map("\Q$_\E", + sort {length($b) - length($a)} (keys %AMSymbol, + keys %AMTexSym)); + +sub _getSymbol_ : method { + my ($self, $str) = @_; + for ($str) { + /^(\d+(\.\d+)?)/ || /^(\.\d+)/ + and return $1, {tag=>'mn', output=>$1, ttype=>'CONST'}; + $self->{Definition_RE} && /^($self->{Definition_RE})/ and + return $1, $self->{Definitions}{$1}; + /^($Ident_RE)/o and + return $1,$AMTexSym{$1} ? $AMSymbol{$AMTexSym{$1}} : $AMSymbol{$1}; + /^([A-Za-z])/ and + return $1, {tag=>'mi', output=>$1, ttype=>'CONST'}; + /^(.)/ and + return $1 eq '-' && defined $self->{previousSymbol} && + $self->{previousSymbol} eq 'INFIX' ? + ($1, {tag=>'mo', output=>$1, ttype=>'UNARY', func=>"true"} ) : + ($1, {tag=>'mo', output=>$1, ttype=>'CONST'}); + } +} + +# Used so that Text::ASCIIMathML::Node can get access to the symbol table +sub _get_amsymbol_ { + return \%AMSymbol; +} +} + +# Parses an E expression +# Arguments: string to parse, whether to look for a right bracket +# Returns: parsed node (if successful), remaining unparsed string +sub _parseExpr : method { + my ($self, $str, $rightbracket) = @_; + my $newFrag = $self->_createDocumentFragment(); + my ($node, $input, $symbol); + do { + $str = _removeCharsAndBlanks($str, 0); + ($node, $str) = $self->_parseIexpr($str); + ($input, $symbol) = $self->_getSymbol($str); + if (defined $symbol && $symbol->{ttype} eq 'INFIX' && $input eq '/') { + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseIexpr($str); + if ($result[0]) { + _removeBrackets($result[0]); + } + else { # show box in place of missing argument + $result[0] = $self->_createMmlNode + ('mo', $self->_createTextNode('A1;')); + } + $str = $result[1]; + _removeBrackets($node); + $node = $self->_createMmlNode($symbol->{tag}, $node); + $node->appendChild($result[0]); + $newFrag->appendChild($node); + ($input, $symbol) = $self->_getSymbol($str); + } + elsif (defined $node) { + $newFrag->appendChild($node); + } + } while (defined $symbol && ($symbol->{ttype} ne 'RIGHTBRACKET' && + ($symbol->{ttype} ne 'LEFTRIGHT' || + $rightbracket) + || $self->{nestingDepth} == 0) && + $symbol->{output} ne ''); + if (defined $symbol && $symbol->{ttype} =~ /RIGHTBRACKET|LEFTRIGHT/) { + my @childNodes = $newFrag->childNodes; + if (@childNodes > 1 && + $childNodes[-1]->nodeName eq 'mrow' && + $childNodes[-2]->nodeName eq 'mo' && + $childNodes[-2]->firstChild->nodeValue eq ',') { # matrix + my $right = $childNodes[-1]->lastChild->firstChild->nodeValue; + if ($right =~ /[\)\]]/) { + my $left = $childNodes[-1]->firstChild->firstChild->nodeValue; + if ("$left$right" =~ /^\(\)$/ && $symbol->{output} ne '}' || + "$left$right" =~ /^\[\]$/) { + my @pos; # positions of commas + my $matrix = 1; + my $m = @childNodes; + for (my $i=0; $matrix && $i < $m; $i += 2) { + $pos[$i] = []; + $node = $childNodes[$i]; + $matrix = + $node->nodeName eq 'mrow' && + ($i == $m-1 || + $node->nextSibling->nodeName eq 'mo' && + $node->nextSibling->firstChild->nodeValue eq ',')&& + $node->firstChild->firstChild->nodeValue eq $left&& + $node->lastChild->firstChild->nodeValue eq $right + if $matrix; + if ($matrix) { + for (my $j=0; $j<($node->childNodes); $j++) { + if (($node->childNodes)[$j]->firstChild-> + nodeValue eq ',') { + push @{$pos[$i]}, $j; + } + } + } + if ($matrix && $i > 1) { + $matrix = @{$pos[$i]} == @{$pos[$i-2]}; + } + } + if ($matrix) { + my $table = $self->_createDocumentFragment(); + for (my $i=0; $i<$m; $i += 2) { + my $row = $self->_createDocumentFragment(); + my $frag = $self->_createDocumentFragment(); + # (-,-,...,-,-) + $node = $newFrag->firstChild; + my $n = $node->childNodes; + my $k = 0; + $node->removeChild($node->firstChild); # remove ( + for (my $j=1; $j<$n-1; $j++) { + if ($k < @{$pos[$i]} && $j == $pos[$i][$k]) { + # remove , + $row->appendChild + ($self->_createMmlNode('mtd', $frag)); + $frag = $self->_createDocumentFragment(); + $k++; + } + else { + $frag->appendChild($node->firstChild); + } + $node->removeChild($node->firstChild); + } + $row->appendChild + ($self->_createMmlNode('mtd', $frag)); + if ($newFrag->childNodes > 2) { + # remove ) + $newFrag->removeChild($newFrag->firstChild); + # remove , + $newFrag->removeChild($newFrag->firstChild); + } + $table->appendChild + ($self->_createMmlNode('mtr', $row)); + } + $node = $self->_createMmlNode('mtable', $table); + $node->setAttribute('columnalign', 'left') + if $symbol->{invisible}; + $newFrag->replaceChild($node, $newFrag->firstChild); + } + } + } + } + $str = _removeCharsAndBlanks($str, length $input); + if (! $symbol->{invisible}) { + $node = $self->_createMmlNode + ('mo', $self->_createTextNode($symbol->{output})); + $newFrag->appendChild($node); + } + } + return $newFrag, $str; +} + +# Parses an I expression +# Arguments: string to parse +# Returns: parsed node (if successful), remaining unparsed string +sub _parseIexpr : method { + my ($self, $str) = @_; + $str = _removeCharsAndBlanks($str, 0); + my ($in1, $sym1) = $self->_getSymbol($str); + my $node; + ($node, $str) = $self->_parseSexpr($str); + my ($input, $symbol) = $self->_getSymbol($str); + if (defined $symbol && $symbol->{ttype} eq 'INFIX' && $input ne '/') { +# if (symbol.input == "/") result = AMparseIexpr(str); else ... + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseSexpr($str); + if ($result[0]) { + _removeBrackets($result[0]); + } + else { # show box in place of missing argument + $result[0] = $self->_createMmlNode + ('mo', $self->_createTextNode("A1;")); + } + $str = $result[1]; + if ($input eq '_') { + my ($in2, $sym2) = $self->_getSymbol($str); + my $underover = $sym1->{ttype} eq 'UNDEROVER'; + if ($in2 eq '^') { + $str = _removeCharsAndBlanks($str, length $in2); + my @res2 = $self->_parseSexpr($str); + _removeBrackets($res2[0]); + $str = $res2[1]; + $node = $self->_createMmlNode + ($underover ? 'munderover' : 'msubsup', $node); + $node->appendChild($result[0]); + $node->appendChild($res2[0]); + $node = $self->_createMmlNode('mrow',$node); # so sum does not stretch + } + else { + $node = $self->_createMmlNode + ($underover ? 'munder' : 'msub', $node); + $node->appendChild($result[0]); + } + } + elsif ($input eq '^') { + my ($in2, $sym2) = $self->_getSymbol($str); + my $underover = $sym1->{ttype} eq 'UNDEROVER'; + if ($in2 eq '_') { + $str = _removeCharsAndBlanks($str, length $in2); + my @res2 = $self->_parseSexpr($str); + _removeBrackets($res2[0]); + $str = $res2[1]; + $node = $self->_createMmlNode + ($underover ? 'munderover' : 'msubsup', $node); + $node->appendChild($res2[0]); + $node->appendChild($result[0]); + $node = $self->_createMmlNode('mrow',$node); # so sum does not stretch + } + else { + $node = $self->_createMmlNode + ($underover ? 'mover' : 'msup', $node); + $node->appendChild($result[0]); + } + } + else { + $node = $self->_createMmlNode($symbol->{tag}, $node); + $node->appendChild($result[0]); + } + } + return $node, $str; +} + +# Parses an S expression +# Arguments: string to parse +# Returns: parsed node (if successful), remaining unparsed string +sub _parseSexpr : method { + my ($self, $str) = @_; + my $newFrag = $self->_createDocumentFragment(); + $str = _removeCharsAndBlanks($str, 0); + my ($input, $symbol) = $self->_getSymbol($str); + return (undef, $str) + if ! defined $symbol || + $symbol->{ttype} eq 'RIGHTBRACKET' && $self->{nestingDepth} > 0; + if ($symbol->{ttype} eq 'DEFINITION') { + $str = $symbol->{output} . _removeCharsAndBlanks($str, length $input); + ($input, $symbol) = $self->_getSymbol($str); + } + my $ttype = $symbol->{ttype}; + if ($ttype =~ /UNDEROVER|CONST/) { + $str = _removeCharsAndBlanks($str, length $input); + return + $self->_createMmlNode($symbol->{tag}, + $self->_createTextNode($symbol->{output})), + $str; + } + if ($ttype eq 'LEFTBRACKET') { + $self->{nestingDepth}++; + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseExpr($str, 1); + $self->{nestingDepth}--; + my $node; + if ($symbol->{invisible}) { + $node = $self->_createMmlNode('mrow', $result[0]); + } + else { + $node = $self->_createMmlNode + ('mo', $self->_createTextNode($symbol->{output})); + $node = $self->_createMmlNode('mrow', $node); + $node->appendChild($result[0]); + } + return $node, $result[1]; + } + if ($ttype eq 'TEXT') { + $str = _removeCharsAndBlanks($str, length $input) unless $input eq '"'; + my $st; + ($input, $st) = ($1, $2) + if $str =~ /^(\"()\")/ || $str =~ /^(\"((?:\\\\|\\\"|.)+?)\")/; + ($input, $st) = ($1, $2) + if ($str =~ /^(\((.*?)\))/ || + $str =~ /^(\[(.*?)\])/ || + $str =~ /^(\{(.*?)\})/); + ($input, $st) = ($str) x 2 unless defined $st; + if (substr($st, 0, 1) eq ' ') { + my $node = $self->_createElementMathML('mspace'); + $node->setAttribute(width=>'1ex'); + $newFrag->appendChild($node); + } + $newFrag->appendChild + ($self->_createMmlNode($symbol->{tag}, + $self->_createTextNode($st))); + if (substr($st, -1) eq ' ') { + my $node = $self->_createElementMathML('mspace'); + $node->setAttribute(width=>'1ex'); + $newFrag->appendChild($node); + } + $str = _removeCharsAndBlanks($str, length $input); + return $self->_createMmlNode('mrow', $newFrag), $str; + } + if ($ttype eq 'UNARY') { + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseSexpr($str); + return ($self->_createMmlNode + ($symbol->{tag}, + $self->_createTextNode($symbol->{output})), $str) + if ! defined $result[0]; + if ($symbol->{func}) { + return ($self->_createMmlNode + ($symbol->{tag}, + $self->_createTextNode($symbol->{output})), $str) + if $str =~ m!^[\^_/|]!; + my $node = $self->_createMmlNode + ('mrow', $self->_createMmlNode + ($symbol->{tag}, $self->_createTextNode($symbol->{output}))); + $node->appendChild($result[0]); + return $node, $result[1]; + } + _removeBrackets($result[0]); + if ($symbol->{acc}) { # accent + my $node = $self->_createMmlNode($symbol->{tag}, $result[0]); + $node->appendChild + ($self->_createMmlNode + ('mo', $self->_createTextNode($symbol->{output}))); + return $node, $result[1]; + } + if ($symbol->{atname}) { # font change command + if ($self->{attr}{ForMoz} && $symbol->{codes}) { + my @childNodes = $result[0]->childNodes; + my $nodeName = $result[0]->nodeName; + for (my $i=0; $i<@childNodes; $i++) { + if ($childNodes[$i]->nodeName eq 'mi'||$nodeName eq 'mi') { + my $st = $nodeName eq 'mi' ? + $result[0] ->firstChild->nodeValue : + $childNodes[$i]->firstChild->nodeValue; + $st =~ s/([A-Z])/sprintf "&#x%X;",$symbol->{codes}[ord($1)-65]/ge; + if ($nodeName eq 'mi') { + $result[0] = $self->_createTextNode($st); + } + else { + $result[0]->replaceChild + ($self->_createTextNode($st), $childNodes[$i]); + } + } + } + } + my $node = $self->_createMmlNode($symbol->{tag}, $result[0]); + $node->setAttribute($symbol->{atname}=>$symbol->{atval}); + return $node, $result[1]; + } + return $self->_createMmlNode($symbol->{tag}, $result[0]), $result[1]; + } + if ($ttype eq 'BINARY') { + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseSexpr($str); + return ($self->_createMmlNode + ('mo', $self->_createTextNode($input)), $str) + if ! defined $result[0]; + _removeBrackets($result[0]); + my @result2 = $self->_parseSexpr($result[1]); + return ($self->_createMmlNode + ('mo', $self->_createTextNode($input)), $str) + if ! defined $result2[0]; + _removeBrackets($result2[0]); + if ($input =~ /new(command|symbol)/) { + my $what = $1; + # Look for text in both arguments + my $text1 = $result[0]; + my $haveTextArgs = 0; + $text1 = $text1->firstChild while $text1->nodeName eq 'mrow'; + if ($text1->nodeName eq 'mtext') { + my $text2 = $result2[0]; + $text2 = $text2->firstChild while $text2->nodeName eq 'mrow'; + my $latex; + if ($result2[0]->childNodes > 1 && $input eq 'newsymbol') { + # Process the latex string for a newsymbol + my $latexdef = $result2[0]->child(1); + $latexdef = $latexdef->firstChild + while $latexdef->nodeName eq 'mrow'; + $latex = $latexdef->firstChild->nodeValue; + } + if ($text2->nodeName eq 'mtext') { + $self->{Definitions}{$text1->firstChild->nodeValue} = { + tag =>'mo', + output=>$text2->firstChild->nodeValue, + ttype =>$what eq 'symbol' ? 'CONST' : 'DEFINITION', + }; + $self->{Definition_RE} = join '|', + map("\Q$_\E", sort {length($b) - length($a)} + keys %{$self->{Definitions}}); + $self->{Latex}{$text2->firstChild->nodeValue} = $latex + if defined $latex; + $haveTextArgs = 1; + } + } + if (! $haveTextArgs) { + $newFrag->appendChild($self->_createMmlNode + ('mo', $self->_createTextNode($input)), + $result[0], $result2[0]); + return $self->_createMmlNode('mrow', $newFrag), $result2[1]; + } + return undef, $result2[1]; + } + if ($input =~ /root|stackrel/) { + $newFrag->appendChild($result2[0]); + } + $newFrag->appendChild($result[0]); + if ($input eq 'frac') { + $newFrag->appendChild($result2[0]); + } + return $self->_createMmlNode($symbol->{tag}, $newFrag), $result2[1]; + } + if ($ttype eq 'INFIX') { + $str = _removeCharsAndBlanks($str, length $input); + return $self->_createMmlNode + ('mo', $self->_createTextNode($symbol->{output})), $str; + } + if ($ttype eq 'SPACE') { + $str = _removeCharsAndBlanks($str, length $input); + my $node = $self->_createElementMathML('mspace'); + $node->setAttribute('width', '1ex'); + $newFrag->appendChild($node); + $newFrag->appendChild + ($self->_createMmlNode($symbol->{tag}, + $self->_createTextNode($symbol->{output}))); + $node = $self->_createElementMathML('mspace'); + $node->setAttribute('width', '1ex'); + $newFrag->appendChild($node); + return $self->_createMmlNode('mrow', $newFrag), $str; + } + if ($ttype eq 'LEFTRIGHT') { + $self->{nestingDepth}++; + $str = _removeCharsAndBlanks($str, length $input); + my @result = $self->_parseExpr($str, 0); + $self->{nestingDepth}--; + my $st = $result[0]->lastChild ? + $result[0]->lastChild->firstChild->nodeValue : ''; + my $node = $self->_createMmlNode + ('mo',$self->_createTextNode($symbol->{output})); + $node = $self->_createMmlNode('mrow', $node); + if ($st eq '|') { # it's an absolute value subterm + $node->appendChild($result[0]); + return $node, $result[1]; + } + # the "|" is a \mid + return $node, $str; + } + if ($ttype eq 'NOP') { + $str = _removeCharsAndBlanks($str, length $input); + return $self->_parseSexpr($str); + } + $str = _removeCharsAndBlanks($str, length $input); + return $self->_createMmlNode + ($symbol->{tag}, # it's a constant + $self->_createTextNode($symbol->{output})), $str; +} + +# Removes brackets at the beginning or end of an mrow node +# Arguments: node object +# Returns: None +# Side-effects: may change children of node object +sub _removeBrackets { + my ($node) = @_; + if ($node->nodeName eq 'mrow') { + my $st = $node->firstChild->firstChild->nodeValue; + $node->removeChild($node->firstChild) if $st =~ /^[\(\[\{]$/; + $st = $node->lastChild->firstChild->nodeValue; + $node->removeChild($node->lastChild) if $st =~ /^[\)\]\}]$/; + } +} + +# Removes the first n characters and any following blanks +# Arguments: string, n +# Returns: resultant string +sub _removeCharsAndBlanks { + my ($str, $n) = @_; + my $st = substr($str, + substr($str, $n) =~ /^\\[^\\ ,!]/ ? $n+1 : $n); + $st =~ s/^[\x00-\x20]+//; + return $st; +} + +# Removes outermost parenthesis +# Arguments: string +# Returns: string with parentheses removed +sub _unparen { + my ($s) = @_; + $s =~ s!^()[\(\[\{]!$1!; + $s =~ s![\)\]\}]()$!$1!; + $s; +} + +BEGIN { +my %Conversion = ('<'=>'lt', '>'=>'gt', '"'=>'quot', '&'=>'amp'); + +# Encodes special xml characters +# Arguments: string +# Returns: encoded string +sub _xml_encode { + my ($s) = @_; + $s =~ s/([<>\"&])/&$Conversion{$1};/g; + $s; +} +} + +package Text::ASCIIMathML::Node; + +{ + # Create a closure for the following attributes + my %parser_of; + +# Creates a new Text::ASCIIMathML::Node object +# Arguments: Text::ASCIIMathML object, optional tag +# Returns: new object +sub new { + my ($class, $parser, $tag) = @_; + my $obj = bless { children=>[] }, $class; + if (defined $tag) { $obj->{tag} = $tag } + else { $obj->{frag} = 1 } + $parser_of{$obj} = $parser; + return $obj; +} + +# Creates a new Text::ASCIIMathML::Node text object +# Arguments: Text::ASCIIMathML object, text +# Returns: new object +sub newText { + my ($class, $parser, $text) = @_; + $text =~ s/^\s*(.*?)\s*$/$1/; # Delete leading/trailing spaces + my $obj = bless { text=>$text }, $class; + $parser_of{$obj} = $parser; + return $obj; +} + +my %Parent; +my $Null; +BEGIN { + $Null = new Text::ASCIIMathML::Node; +} + +# Appends one or more node objects to the children of an object +# Arguments: list of objects to append +# Returns: self +sub appendChild : method { + my $self = shift; + my @new = map $_->{frag} ? @{$_->{children}} : $_, @_; + push @{$self->{children}}, @new; + map do {$Parent{$_} = $self}, @new; + return $self; +} + +# Returns a the value for an attribute of a node object +# Arguments: Attribute name +# Returns: Value for the attribute +sub attribute { + my ($self, $attr) = @_; + return $self->{attr}{$attr}; +} + +# Returns a list of the attributes of a node object +# Arguments: None +# Returns: Array of attribute names +sub attributeList { + my ($self) = @_; + return $self->{attrlist} ? @{$self->{attrlist}} : (); +} + +# Returns a child with a given index in the array of children of a node +# Arguments: index +# Returns: Array of node objects +sub child { + my ($self, $index) = @_; + return $self->{children} && @{$self->{children}} > $index ? + $self->{children}[$index] : $Null; +} + +# Returns an array of children of a node +# Arguments: None +# Returns: Array of node objects +sub childNodes { + my ($self) = @_; + return $self->{children} ? @{$self->{children}} : (); +} + +# Returns the first child of a node; ignores any fragments +# Arguments: None +# Returns: node object or self +sub firstChild { + my ($self) = @_; + return $self->{children} && @{$self->{children}} ? + $self->{children}[0] : $Null; +} + +# Returns true if the object is a fragment +# Arguments: None +# Returns: Boolean +sub isFragment { + return $_[0]->{frag}; +} + +# Returns true if the object is a named node +# Arguments: None +# Returns: Boolean +sub isNamed { + return $_[0]->{tag}; +} + +# Returns true if the object is a text node +# Arguments: None +# Returns: Boolean +sub isText { + return defined $_[0]->{text}; +} + +# Returns the last child of a node +# Arguments: None +# Returns: node object or self +sub lastChild { + my ($self) = @_; + return $self->{children} && @{$self->{children}} ? + $self->{children}[-1] : $Null; +} + +BEGIN { +# Creates closure for following "static" variables +my (%LatexSym, %LatexMover, %LatexFont, %LatexOp); + +# Returns a latex representation of a node object +# Arguments: None +# Returns: Text string +sub latex : method { + my ($self) = @_; + + my $parser = $parser_of{$self}; + if (! %LatexSym) { + # Build the entity to latex symbol translator + my $amsymbol = Text::ASCIIMathML::_get_amsymbol_(); + foreach my $sym (keys %$amsymbol) { + next unless (defined $amsymbol->{$sym}{output} && + $amsymbol->{$sym}{output} =~ /&\#x.*;/); + my ($output, $tex) = map $amsymbol->{$sym}{$_}, qw(output tex); + next if defined $LatexSym{$output} && ! $amsymbol->{$sym}{latex}; + $tex = $sym if $tex eq ''; + $LatexSym{$output} = "\\$tex"; + } + my %math_font = (bbb => 'mathds', + mathbb => 'mathds', + cc => 'cal', + mathcal => 'cal', + fr => 'mathfrak', + mathfrak => 'mathfrak', + ); + # Add character codes + foreach my $coded (grep $amsymbol->{$_}{codes}, keys %$amsymbol) { + @LatexSym{map(sprintf("&#x%X;", $_), + @{$amsymbol->{$coded}{codes}})} = + map("\\$math_font{$coded}\{$_}", ('A' .. 'Z')); + } + # Post-process protected symbols + $LatexSym{$_} =~ s/^\\\\/\\/ foreach keys %LatexSym; + %LatexMover = ('^' => '\hat', + '\overline' => '\overline', + '\to' => '\vec', + '\vec' => '\vec', + '\rightarrow' => '\vec', + '.' => '\dot', + '..' => '\ddot', + ); + %LatexFont = (bold => '\bf', + 'double-struck' => '\mathds', + fraktur => '\mathfrak', + monospace => '\tt', + 'sans-serif' => '\sf', + script => '\cal', + ); + %LatexOp = (if => '\mbox{if }', + lcm => '\mbox{lcm}', + newcommand => '\mbox{newcommand}', + "\\" => '\backslash', + '<' => '<', + '>' => '>', + '&' => '\&', + '...' => '\ldots', + ); + } + if (defined $self->{text}) { + my $text = $self->{text}; + $text =~ s/([{}])/\\$1/; + $text =~ s/(&\#x.*?;)/ + defined $parser->{Latex}{$1} ? $parser->{Latex}{$1} : + defined $LatexSym{$1} ? $LatexSym{$1} : $1/eg; + $text =~ s/([\#])/\\$1/; + return $text; + } + my $tag = $self->{tag}; + my @child_str; + my $child_str = ''; + if (@{$self->{children}}) { + foreach (@{$self->{children}}) { + push @child_str, $_->latex($parser); + } + } + +# mo + if ($tag eq 'mo') { + # Need to distinguish bmod from pmod + my $parent = $self->parent; + return $self eq $parent->child(1) && + $parent->firstChild->firstChild->{text} eq '(' + ? '\pmod' : '\bmod' + if $child_str[0] eq 'mod'; + return $LatexOp{$child_str[0]} if $LatexOp{$child_str[0]}; + return $child_str[0] =~ /^\w+$/ ? "\\$child_str[0]" : $child_str[0]; + } + +# mrow + if ($tag eq 'mrow') { + @child_str = grep $_ ne '', @child_str; + # Check for pmod function + if (@child_str > 1 && $child_str[1] eq '\pmod') { + pop @child_str if $child_str[-1] eq ')'; + splice @child_str, 0, 2; + return "\\pmod{@child_str}"; + } + # Check if we need \left ... \right + my $is_tall = grep(/[_^]|\\(begin\{array\}|frac|sqrt|stackrel)/, + @child_str); + if ($is_tall && @child_str > 1 && + ($child_str[0] =~ /^([\(\[|]|\\\{)$/ || + $child_str[-1] =~ /^([\)\]|]|\\\})$/)) { + if ($child_str[0] =~ /^([\(\[|]|\\\{)$/) { + $child_str[0] = "\\left$child_str[0]"; + } + else { + unshift @child_str, "\\left."; + } + if ($child_str[-1] =~ /^([\)\]|]|\\\})$/) { + $child_str[-1] = "\\right$child_str[-1]"; + } + else { + push @child_str, "\\right."; + } + } + return "@child_str"; + } + + +# mi +# mn +# math +# mtd + if ($tag =~ /^m([in]|ath|row|td)$/) { + @child_str = grep $_ ne '', @child_str; + return "@child_str"; + } + +# msub +# msup +# msubsup +# munderover + if ($tag =~ /^(msu[bp](sup)?|munderover)$/) { + my $base = shift @child_str; + $base = '\mbox{}' if $base eq ''; + # Put {} around arguments with more than one character + @child_str = map length($_) > 1 ? "{$_}" : $_, @child_str; + return ($tag eq 'msub' ? "${base}_$child_str[0]" : + $tag eq 'msup' ? "${base}^$child_str[0]" : + "${base}_$child_str[0]^$child_str[1]"); + } + +# mover + if ($tag eq 'mover') { + # Need to special-case math mode accents + return + ($child_str[1] eq '\overline' && length($child_str[0]) == 1 ? + "\\bar{$child_str[0]}" : + $LatexMover{$child_str[1]} ? + "$LatexMover{$child_str[1]}\{$child_str[0]\}" : + "\\stackrel{$child_str[1]}{$child_str[0]}"); + } + +# munder + if ($tag eq 'munder') { + return $child_str[1] eq '\underline' ? "$child_str[1]\{$child_str[0]}" + : "$child_str[0]_\{$child_str[1]\}"; + } + +# mfrac + if ($tag eq 'mfrac') { + return "\\frac{$child_str[0]}{$child_str[1]}"; + } + +# msqrt + if ($tag eq 'msqrt') { + return "\\sqrt{$child_str[0]}"; + } + +# mroot + if ($tag eq 'mroot') { + return "\\sqrt[$child_str[1]]{$child_str[0]}"; + } + +# mtext + if ($tag eq 'mtext') { + my $text = $child_str[0]; + my $next = $self->nextSibling; + my $prev = $self->previousSibling; + if (defined $next->{tag} && $next->{tag} eq 'mspace') { + $text = "$text "; + } + if (defined $prev->{tag} && $prev->{tag} eq 'mspace') { + $text = " $text"; + } + $text = ' ' if $text eq ' '; + return "\\mbox{$text}"; + } + + +# mspace + if ($tag eq 'mspace') { + return ''; + } + +# mtable + if ($tag eq 'mtable') { + my $cols = ($child_str[0] =~ tr/&//) + 1; + my $colspec = ($self->{attr}{columnalign} || '') eq 'left' ? 'l' : 'c'; + my $colspecs = $colspec x $cols; + return ("\\begin{array}{$colspecs}\n" . + join('', map(" $_ \\\\\n", @child_str)) . + "\\end{array}\n"); + } + +# mtr + if ($tag eq 'mtr') { + return join ' & ', @child_str; + } + +# mstyle + if ($tag eq 'mstyle') { + @child_str = grep $_ ne '', @child_str; + if ($self->parent->{tag} eq 'math') { + push @child_str, ' ' unless @child_str; + # The top-level mstyle + return (defined $self->{attr}{displaystyle} && + $self->{attr}{displaystyle} eq 'true') ? + "\$\$@child_str\$\$" : "\$@child_str\$"; + } + else { + # It better be a font changing command + return $child_str[0] if $self->{attr}{mathvariant}; + my ($attr) = map($self->{attr}{$_}, + grep $self->{attr}{$_}, + qw(fontweight fontfamily)); + return $attr && $LatexFont{$attr} ? + "$LatexFont{$attr}\{$child_str[0]}" : $child_str[0]; + } + } +} +} + +# Returns the next sibling of a node +# Arguments: None +# Returns: node object or undef +sub nextSibling { + my ($self) = @_; + my $parent = $self->parent; + for (my $i=0; $i<@{$parent->{children}}; $i++) { + return $parent->{children}[$i+1] if $self eq $parent->{children}[$i]; + } + return $Null; +} + +# Returns the tag of a node +# Arguments: None +# Returns: string +sub nodeName : method { + return $_[0]{tag} || ''; +} + +# Returns the text of a text node +# Arguments: None +# Returns: string +sub nodeValue : method { + return $_[0]{text} || ''; +} + +# Returns the parent of a node +# Arguments: none +# Returns: parent node object or undef +sub parent : method { + return $Parent{$_[0]} || $Null; +} + +# Returns the previous sibling of a node +# Arguments: None +# Returns: node object or undef +sub previousSibling { + my ($self) = @_; + my $parent = $self->parent; + for (my $i=1; $i<@{$parent->{children}}; $i++) { + return $parent->{children}[$i-1] if $self eq $parent->{children}[$i]; + } + return $Null; +} + +# Removes a given child node from a node +# Arguments: child node +# Returns: None +# Side-effects: May affect children of the node +sub removeChild : method { + my ($self, $child) = @_; + @{$self->{children}} = grep $_ ne $child, @{$self->{children}} + if $self->{children}; + delete $Parent{$child}; +} + +# Replaces one child node object with another +# Arguments: old child node object, new child node object +# Returns: None +sub replaceChild : method { + my ($self, $new, $old) = @_; + @{$self->{children}} = map $_ eq $old ? $new : $_, @{$self->{children}}; + delete $Parent{$old}; + $Parent{$new} = $self; +} + +# Sets one or more attributes on a node object +# Arguments: set of attribute/value pairs +# Returns: None +sub setAttribute : method { + my $self = shift; + if (@_) { + $self->{attr} = {} unless $self->{attr}; + $self->{attrlist} = [] unless $self->{attrlist}; + } + while (my($aname, $aval) = splice(@_, 0, 2)) { + $aval =~ s/\n//g; + push @{$self->{attrlist}}, $aname unless defined $self->{attr}{$aname}; + $self->{attr}{$aname} = $aval; + } +} + +# Returns the ASCII representation of a node object +# Arguments: None +# Returns: Text string +sub text : method { + my ($self) = @_; + return $self->{text} if defined $self->{text}; + my $tag = $self->{tag}; + my $attr = join '', map(" $_=\"" . + ($_ eq 'xmlns' ? $self->{attr}{$_} : + Text::ASCIIMathML::_xml_encode($self->{attr}{$_})) . + "\"", @{$self->{attrlist}}) + if $tag; + if (@{$self->{children}}) { + my $child_str; + foreach (@{$self->{children}}) { + $child_str .= $_->text; + } + return $tag ? "<$tag$attr>$child_str" : $child_str; + } + return $tag ? "<$tag$attr/>" : ''; +} +} + +1; diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown.pl b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown.pl new file mode 100755 index 00000000..9c9f5b15 --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown.pl @@ -0,0 +1,2728 @@ +#!/usr/bin/env perl + +# MultiMarkdown -- A modification of John Gruber's original Markdown +# that adds new features and an output format that can more readily +# be converted into other document formats +# +# $Id: MultiMarkdown.pl 525 2009-06-15 18:45:44Z fletcher $ +# +# Original Code Copyright (c) 2004-2007 John Gruber +# +# +# MultiMarkdown changes Copyright (c) 2005-2009 Fletcher T. Penney +# +# +# MultiMarkdown Version 2.0.b6 +# +# Based on Markdown.pl 1.0.2b8 - Wed 09 May 2007 +# +# +# TODO: Change math mode delimiter? +# TODO: Still need to get the glossary working in non-memoir documents +# TODO: A mechanism to include arbitrary code (LaTeX, etc) without being "ugly" +# TODO: Look into discussion re: assigning classes to div's/span's on Markdown list. +# TODO: Improve support for tables with long items and overall width in LaTeX +# TODO: Need a syntax for long table cells in MMD, even if no rowspan feature yet +# TODO: Create utilities to convert MMD tables to/from tab-delimited + + +package MultiMarkdown; +require 5.006_000; +use strict; +use warnings; + +use File::Basename; + +eval {require MT}; # Test to see if we're running in MT. +unless ($@) { + require Text::ASCIIMathML; +} else { # Otherwise look for ASCIIMathML.pm next to MultiMarkdown.pl + my $me = $0; # Where am I? + + # Am I running in Windoze? + my $os = $^O; + + # Get just the directory portion + if ($os =~ /MSWin/) { + $me = dirname($me) . "\\"; + } else { + $me = dirname($me) . "/"; + } + require $me ."ASCIIMathML.pm"; +} + + +use Digest::MD5 qw(md5_hex); +use vars qw($VERSION $g_use_metadata $g_base_url + $g_bibliography_title $g_allow_mathml $g_base_header_level $mathParser); +$VERSION = '2.0.b6'; + +$mathParser = new Text::ASCIIMathML(); + +## Disabled; causes problems under Perl 5.6.1: +# use utf8; +# binmode( STDOUT, ":utf8" ); # c.f.: http://acis.openlib.org/dev/perl-unicode-struggle.html + +# +# Global default settings: +# +my $g_empty_element_suffix = " />"; # Change to ">" for HTML output +my $g_tab_width = 4; +my $g_allow_mathml = 1; +my $g_base_header_level = 1; + +# +# Globals: +# + +# Reusable patterns to match balanced [brackets] and (parens). See +# Friedl's "Mastering Regular Expressions", 2nd Ed., pp. 328-331. +my ($g_nested_brackets, $g_nested_parens); +$g_nested_brackets = qr{ + (?> # Atomic matching + [^\[\]]+ # Anything other than brackets + | + \[ + (??{ $g_nested_brackets }) # Recursive set of nested brackets + \] + )* +}x; + +# Doesn't allow for whitespace, because we're using it to match URLs: +$g_nested_parens = qr{ + (?> # Atomic matching + [^()\s]+ # Anything other than parens or whitespace + | + \( + (??{ $g_nested_parens }) # Recursive set of nested brackets + \) + )* +}x; + + +# Table of hash values for escaped characters: +my %g_escape_table; +foreach my $char (split //, '\\`*_{}[]()>#+-.!') { + $g_escape_table{$char} = md5_hex($char); +} + + +# Global hashes, used by various utility routines +my %g_urls = (); +my %g_titles= (); +my %g_html_blocks = (); +my %g_metadata = (); +my %g_metadata_newline = (); +my %g_crossrefs = (); +my %g_footnotes = (); +my %g_attributes = (); +my @g_used_footnotes = (); +my $g_footnote_counter = 0; + +my $g_citation_counter = 0; +my @g_used_references = (); +my %g_references = (); +$g_bibliography_title = "Bibliography"; + +$g_use_metadata = 1; +$g_metadata_newline{default} = "\n"; +$g_metadata_newline{keywords} = ", "; +my $g_document_format = ""; + +# Used to track when we're inside an ordered or unordered list +# (see _ProcessListItems() for details): +my $g_list_level = 0; + + +#### Blosxom plug-in interface ########################################## + +# Set $g_blosxom_use_meta to 1 to use Blosxom's meta plug-in to determine +# which posts Markdown should process, using a "meta-markup: markdown" +# header. If it's set to 0 (the default), Markdown will process all +# entries. +my $g_blosxom_use_meta = 0; + +sub start { 1; } +sub story { + my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; + + if ( (! $g_blosxom_use_meta) or + (defined($meta::markup) and ($meta::markup =~ /^\s*markdown\s*$/i)) + ){ + $$body_ref = Markdown($$body_ref); + } + 1; +} + + +#### Movable Type plug-in interface ##################################### +eval {require MT}; # Test to see if we're running in MT. +unless ($@) { + require MT; + import MT; + require MT::Template::Context; + import MT::Template::Context; + + eval {require MT::Plugin}; # Test to see if we're running >= MT 3.0. + unless ($@) { + require MT::Plugin; + import MT::Plugin; + my $plugin = new MT::Plugin({ + name => "MultiMarkdown", + description => "Based on the original Markdown", + doc_link => 'http://fletcherpenney.net/MultiMarkdown/' + }); + MT->add_plugin( $plugin ); + } + + MT::Template::Context->add_container_tag(MultiMarkdownOptions => sub { + my $ctx = shift; + my $args = shift; + my $builder = $ctx->stash('builder'); + my $tokens = $ctx->stash('tokens'); + + if (defined ($args->{'output'}) ) { + $ctx->stash('multimarkdown_output', lc $args->{'output'}); + } + + defined (my $str = $builder->build($ctx, $tokens) ) + or return $ctx->error($builder->errstr); + $str; # return value + }); + + MT->add_text_filter('multimarkdown' => { + label => 'MultiMarkdown', + docs => 'http://fletcherpenney.net/MultiMarkdown/', + on_format => sub { + my $text = shift; + my $ctx = shift; + my $raw = 0; + if (defined $ctx) { + my $output = $ctx->stash('multimarkdown_output'); + if (defined $output && $output =~ m/^html/i) { + $g_empty_element_suffix = ">"; + $ctx->stash('multimarkdown_output', ''); + } + elsif (defined $output && $output eq 'raw') { + $raw = 1; + $ctx->stash('multimarkdown_output', ''); + } + else { + $raw = 0; + $g_empty_element_suffix = " />"; + } + } + $text = $raw ? $text : Markdown($text); + $text; + }, + }); + + # If SmartyPants is loaded, add a combo Markdown/SmartyPants text filter: + my $smartypants; + + { + no warnings "once"; + $smartypants = $MT::Template::Context::Global_filters{'smarty_pants'}; + } + + if ($smartypants) { + MT->add_text_filter('multimarkdown_with_smartypants' => { + label => 'MultiMarkdown With SmartyPants', + docs => 'http://fletcherpenney.net/MultiMarkdown/', + on_format => sub { + my $text = shift; + my $ctx = shift; + if (defined $ctx) { + my $output = $ctx->stash('multimarkdown_output'); + if (defined $output && $output eq 'html') { + $g_empty_element_suffix = ">"; + } + else { + $g_empty_element_suffix = " />"; + } + } + $text = Markdown($text); + $text = $smartypants->($text, '1'); + }, + }); + } +} +else { +#### BBEdit/command-line text filter interface ########################## +# Needs to be hidden from MT (and Blosxom when running in static mode). + + # We're only using $blosxom::version once; tell Perl not to warn us: + no warnings 'once'; + unless ( defined($blosxom::version) ) { + use warnings; + + #### Check for command-line switches: ################# + my %cli_opts; + use Getopt::Long; + Getopt::Long::Configure('pass_through'); + GetOptions(\%cli_opts, + 'version', + 'shortversion', + 'html4tags', + ); + if ($cli_opts{'version'}) { # Version info + print "\nThis is MultiMarkdown, version $VERSION.\n"; + print "Original code Copyright 2004 John Gruber\n"; + print "MultiMarkdown changes Copyright 2005-2009 Fletcher Penney\n"; + print "http://fletcherpenney.net/multimarkdown/\n"; + print "http://daringfireball.net/projects/markdown/\n\n"; + exit 0; + } + if ($cli_opts{'shortversion'}) { # Just the version number string. + print $VERSION; + exit 0; + } + if ($cli_opts{'html4tags'}) { # Use HTML tag style instead of XHTML + $g_empty_element_suffix = ">"; + } + + + #### Process incoming text: ########################### + my $text; + { + local $/; # Slurp the whole file + $text = <>; + } + print Markdown($text); + } +} + + + +sub Markdown { +# +# Main function. The order in which other subs are called here is +# essential. Link and image substitutions need to happen before +# _EscapeSpecialCharsWithinTagAttributes(), so that any *'s or _'s in the +# and tags get encoded. +# + my $text = shift; + + # Clear the global hashes. If we don't clear these, you get conflicts + # from other articles when generating a page which contains more than + # one article (e.g. an index page that shows the N most recent + # articles): + %g_urls = (); + %g_titles = (); + %g_html_blocks = (); + %g_metadata = (); + %g_crossrefs = (); + %g_footnotes = (); + @g_used_footnotes = (); + $g_footnote_counter = 0; + @g_used_references = (); + %g_references = (); + $g_citation_counter = 0; + %g_attributes = (); + + + # Standardize line endings: + $text =~ s{\r\n}{\n}g; # DOS to Unix + $text =~ s{\r}{\n}g; # Mac to Unix + + # Make sure $text ends with a couple of newlines: + $text .= "\n\n"; + + # Convert all tabs to spaces. + $text = _Detab($text); + + # Strip any lines consisting only of spaces and tabs. + # This makes subsequent regexen easier to write, because we can + # match consecutive blank lines with /\n+/ instead of something + # contorted like /[ \t]*\n+/ . + $text =~ s/^[ \t]+$//mg; + + # Strip out MetaData + $text = _ParseMetaData($text) if $g_use_metadata; + + # And recheck for leading blank lines + $text =~ s/^\n+//s; + + # Turn block-level HTML blocks into hash entries + $text = _HashHTMLBlocks($text); + + # Strip footnote and link definitions, store in hashes. + $text = _StripFootnoteDefinitions($text); + + $text = _StripLinkDefinitions($text); + + _GenerateImageCrossRefs($text); + + $text = _StripMarkdownReferences($text); + + $text = _RunBlockGamut($text); + + $text = _DoMarkdownCitations($text); + + $text = _DoFootnotes($text); + + $text = _UnescapeSpecialChars($text); + + # Clean encoding within HTML comments + $text = _UnescapeComments($text); + + $text = _FixFootnoteParagraphs($text); + $text .= _PrintFootnotes(); + + $text .= _PrintMarkdownBibliography(); + + $text = _ConvertCopyright($text); + + if (lc($g_document_format) =~ /^complete\s*$/i) { + return xhtmlMetaData() . "\n\n" . $text . "\n\n"; + } elsif (lc($g_document_format) =~ /^snippet\s*$/i) { + return $text . "\n"; + } else { + return $g_document_format . textMetaData() . $text . "\n"; + } + +} + + +sub _StripLinkDefinitions { +# +# Strips link definitions from text, stores the URLs and titles in +# hash references. +# + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + # Link defs are in the form: ^[id]: url "optional title" + while ($text =~ s{ + # Pattern altered for MultiMarkdown + # in order to not match citations or footnotes + ^[ ]{0,$less_than_tab}\[([^#^].*)\]: # id = $1 + [ \t]* + \n? # maybe *one* newline + [ \t]* + ? # url = $2 + [ \t]* + \n? # maybe one newline + [ \t]* + (?: + (?<=\s) # lookbehind for whitespace + ["(] + (.+?) # title = $3 + [")] + [ \t]* + )? # title is optional + + # MultiMarkdown addition for attribute support + \n? + ( # Attributes = $4 + (?<=\s) # lookbehind for whitespace + (([ \t]*\n)?[ \t]*((\S+=\S+)|(\S+=".*?")))* + )? + [ \t]* + # /addition + (?:\n+|\Z) + } + {}mx) { + $g_urls{lc $1} = _EncodeAmpsAndAngles( $2 ); # Link IDs are case-insensitive + if ($3) { + $g_titles{lc $1} = $3; + $g_titles{lc $1} =~ s/"/"/g; + } + + # MultiMarkdown addition " + if ($4) { + $g_attributes{lc $1} = $4; + } + # /addition + } + + return $text; +} + +sub _StripHTML { + # Strip (X)HTML code from string + my $text = shift; + + $text =~ s/<.*?>//g; + + return $text; +} + +sub _HashHTMLBlocks { + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + # Hashify HTML blocks: + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

    s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded: + my $block_tags = qr{ + (?: + p | div | h[1-6] | blockquote | pre | table | + dl | ol | ul | script | noscript | form | + fieldset | iframe | ins | del + ) + }x; # MultiMarkdown does not include `math` in the above list so that + # Equations can optionally be included in separate paragraphs + + my $tag_attrs = qr{ + (?: # Match one attr name/value pair + \s+ # There needs to be at least some whitespace + # before each attribute name. + [\w.:_-]+ # Attribute name + \s*=\s* + (?: + ".+?" # "Attribute value" + | + '.+?' # 'Attribute value' + ) + )* # Zero or more + }x; + + my $empty_tag = qr{< \w+ $tag_attrs \s* />}xms; + my $open_tag = qr{< $block_tags $tag_attrs \s* >}xms; + my $close_tag = undef; # let Text::Balanced handle this + + use Text::Balanced qw(gen_extract_tagged); + my $extract_block = gen_extract_tagged($open_tag, $close_tag, undef, { ignore => [$empty_tag] }); + + my @chunks; + ## TO-DO: the 0,3 on the next line ought to respect the + ## tabwidth, or else, we should mandate 4-space tabwidth and + ## be done with it: + while ($text =~ s{^(([ ]{0,3}<)?.*\n)}{}m) { + my $cur_line = $1; + if (defined $2) { + # current line could be start of code block + + my ($tag, $remainder) = $extract_block->($cur_line . $text); + if ($tag) { + my $key = md5_hex($tag); + $g_html_blocks{$key} = $tag; + push @chunks, "\n\n" . $key . "\n\n"; + $text = $remainder; + } + else { + # No tag match, so toss $cur_line into @chunks + push @chunks, $cur_line; + } + } + else { + # current line could NOT be start of code block + push @chunks, $cur_line; + } + + } + push @chunks, $text; # Whatever is left. + + $text = join '', @chunks; + + + + # Special case just for


    . It was easier to make a special case than + # to make the other regex more complicated. + $text =~ s{ + (?: + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + [ ]{0,$less_than_tab} + <(hr) # start tag = $2 + \b # word break + ([^<>])*? # + /?> # the matching end tag + [ \t]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + ) + }{ + my $key = md5_hex($1); + $g_html_blocks{$key} = $1; + "\n\n" . $key . "\n\n"; + }egx; + + # Special case for standalone HTML comments: + $text =~ s{ + (?: + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + [ ]{0,$less_than_tab} + (?s: + + ) + [ \t]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + ) + }{ + my $key = md5_hex($1); + $g_html_blocks{$key} = $1; + "\n\n" . $key . "\n\n"; + }egx; + + # PHP and ASP-style processor instructions ( and <%…%>) + $text =~ s{ + (?: + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + [ ]{0,$less_than_tab} + (?s: + <([?%]) # $2 + .*? + \2> + ) + [ \t]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + ) + }{ + my $key = md5_hex($1); + $g_html_blocks{$key} = $1; + "\n\n" . $key . "\n\n"; + }egx; + + + return $text; +} + + +sub _RunBlockGamut { +# +# These are all the transformations that form block-level +# tags like paragraphs, headers, and list items. +# + my $text = shift; + + $text = _DoHeaders($text); + + # Do tables first to populate the table id's for cross-refs + # Escape
     so we don't get greedy with tables
    +	$text = _DoTables($text);
    +	
    +	# And now, protect our tables
    +	$text = _HashHTMLBlocks($text);
    +
    +	# Do Horizontal Rules:
    +	$text =~ s{^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$}{\n tags around block-level tags.
    +	$text = _HashHTMLBlocks($text);
    +	$text = _FormParagraphs($text);
    +
    +	return $text;
    +}
    +
    +
    +sub _RunSpanGamut {
    +#
    +# These are all the transformations that occur *within* block-level
    +# tags like paragraphs, headers, and list items.
    +#
    +	my $text = shift;
    +
    +	$text = _DoCodeSpans($text);
    +	$text = _DoMathSpans($text);
    +	$text = _EscapeSpecialCharsWithinTagAttributes($text);
    +	$text = _EncodeBackslashEscapes($text);
    +
    +	# Process anchor and image tags. Images must come first,
    +	# because ![foo][f] looks like an anchor.
    +	$text = _DoImages($text);
    +	$text = _DoAnchors($text);	
    +
    +	# Make links out of things like ``
    +	# Must come after _DoAnchors(), because you can use < and >
    +	# delimiters in inline links like [this]().
    +	$text = _DoAutoLinks($text);
    +	$text = _EncodeAmpsAndAngles($text);
    +	$text = _DoItalicsAndBold($text);
    +
    +	# Do hard breaks:
    +	$text =~ s/ {2,}\n/  -- encode [\ ` * _] so they
    +# don't conflict with their use in Markdown for code, italics and strong.
    +# We're replacing each such character with its corresponding MD5 checksum
    +# value; this is likely overkill, but it should prevent us from colliding
    +# with the escape values by accident.
    +#
    +	my $text = shift;
    +	my $tokens ||= _TokenizeHTML($text);
    +	$text = '';   # rebuild $text from the tokens
    +
    +	foreach my $cur_token (@$tokens) {
    +		if ($cur_token->[0] eq "tag") {
    +			$cur_token->[1] =~  s! \\ !$g_escape_table{'\\'}!gx;
    +			$cur_token->[1] =~  s{ (?<=.)(?=.)  }{$g_escape_table{'`'}}gx;
    +			$cur_token->[1] =~  s! \* !$g_escape_table{'*'}!gx;
    +			$cur_token->[1] =~  s! _  !$g_escape_table{'_'}!gx;
    +		}
    +		$text .= $cur_token->[1];
    +	}
    +	return $text;
    +}
    +
    +
    +sub _DoAnchors {
    +#
    +# Turn Markdown link shortcuts into XHTML  tags.
    +#
    +	my $text = shift;
    +
    +	#
    +	# First, handle reference-style links: [link text] [id]
    +	#
    +	$text =~ s{
    +		(					# wrap whole match in $1
    +		  \[
    +		    ($g_nested_brackets)	# link text = $2
    +		  \]
    +
    +		  [ ]?				# one optional space
    +		  (?:\n[ ]*)?		# one optional newline followed by spaces
    +
    +		  \[
    +		    (.*?)		# id = $3
    +		  \]
    +		)
    +	}{
    +		my $result;
    +		my $whole_match = $1;
    +		my $link_text   = $2;
    +		my $link_id     = lc $3;
    +
    +		if ($link_id eq "") {
    +			$link_id = lc $link_text;     # for shortcut links like [this][].
    +		}
    +
    +		# Allow automatic cross-references to headers
    +		my $label = Header2Label($link_id);
    +		if (defined $g_urls{$link_id}) {
    +			my $url = $g_urls{$link_id};
    +			$url =~ s! \* !$g_escape_table{'*'}!gx;		# We've got to encode these to avoid
    +			$url =~ s!  _ !$g_escape_table{'_'}!gx;		# conflicting with italics/bold.
    +			$result = "$}{$1};					# Remove <>'s surrounding URL, if present
    +		$result = " tags.
    +#
    +	my $text = shift;
    +
    +	#
    +	# First, handle reference-style labeled images: ![alt text][id]
    +	#
    +	$text =~ s{
    +		(				# wrap whole match in $1
    +		  !\[
    +		    (.*?)		# alt text = $2
    +		  \]
    +
    +		  [ ]?				# one optional space
    +		  (?:\n[ ]*)?		# one optional newline followed by spaces
    +
    +		  \[
    +		    (.*?)		# id = $3
    +		  \]
    +
    +		)
    +	}{
    +		my $result;
    +		my $whole_match = $1;
    +		my $alt_text    = $2;
    +		my $link_id     = lc $3;
    +
    +		if ($link_id eq "") {
    +			$link_id = lc $alt_text;     # for shortcut links like ![this][].
    +		}
    +
    +		$alt_text =~ s/"/"/g;
    +		if (defined $g_urls{$link_id}) {
    +			my $url = $g_urls{$link_id};
    +			$url =~ s! \* !$g_escape_table{'*'}!gx;		# We've got to encode these to avoid
    +			$url =~ s!  _ !$g_escape_table{'_'}!gx;		# conflicting with italics/bold.
    +			
    +			my $label = Header2Label($alt_text);
    +			$g_crossrefs{$label} = "#$label";
    +			if (! defined $g_titles{$link_id}) {
    +				$g_titles{$link_id} = $alt_text;
    +			}
    +			
    +			$result = "\"$alt_text\"";$}{$1};					# Remove <>'s surrounding URL, if present
    +
    +		my $label = Header2Label($alt_text);
    +		$g_crossrefs{$label} = "#$label";
    +#		$g_titles{$label} = $alt_text;			# I think this line should not be here
    +			
    +		$result = "\"$alt_text\"";"  .  $header  .  "\n\n";
    +	}egmx;
    +
    +	$text =~ s{ ^(.+?)(?:\s*(?"  .  $header  .  "\n\n";
    +	}egmx;
    +
    +
    +	# atx-style headers:
    +	#	# Header 1
    +	#	## Header 2
    +	#	## Header 2 with closing hashes ##
    +	#	...
    +	#	###### Header 6
    +	#
    +	$text =~ s{
    +			^(\#{1,6})	# $1 = string of #'s
    +			[ \t]*
    +			(.+?)		# $2 = Header text
    +			[ \t]*
    +			(?:(?"  .  $header  .  "\n\n";
    +		}egmx;
    +
    +	return $text;
    +}
    +
    +
    +sub _DoLists {
    +#
    +# Form HTML ordered (numbered) and unordered (bulleted) lists.
    +#
    +	my $text = shift;
    +	my $less_than_tab = $g_tab_width - 1;
    +
    +	# Re-usable patterns to match list item bullets and number markers:
    +	my $marker_ul  = qr/[*+-]/;
    +	my $marker_ol  = qr/\d+[.]/;
    +	my $marker_any = qr/(?:$marker_ul|$marker_ol)/;
    +
    +	# Re-usable pattern to match any entirel ul or ol list:
    +	my $whole_list = qr{
    +		(								# $1 = whole list
    +		  (								# $2
    +			[ ]{0,$less_than_tab}
    +			(${marker_any})				# $3 = first list item marker
    +			[ \t]+
    +		  )
    +		  (?s:.+?)
    +		  (								# $4
    +			  \z
    +			|
    +			  \n{2,}
    +			  (?=\S)
    +			  (?!						# Negative lookahead for another list item marker
    +				[ \t]*
    +				${marker_any}[ \t]+
    +			  )
    +		  )
    +		)
    +	}mx;
    +
    +	# We use a different prefix before nested lists than top-level lists.
    +	# See extended comment in _ProcessListItems().
    +	#
    +	# Note: There's a bit of duplication here. My original implementation
    +	# created a scalar regex pattern as the conditional result of the test on
    +	# $g_list_level, and then only ran the $text =~ s{...}{...}egmx
    +	# substitution once, using the scalar as the pattern. This worked,
    +	# everywhere except when running under MT on my hosting account at Pair
    +	# Networks. There, this caused all rebuilds to be killed by the reaper (or
    +	# perhaps they crashed, but that seems incredibly unlikely given that the
    +	# same script on the same server ran fine *except* under MT. I've spent
    +	# more time trying to figure out why this is happening than I'd like to
    +	# admit. My only guess, backed up by the fact that this workaround works,
    +	# is that Perl optimizes the substition when it can figure out that the
    +	# pattern will never change, and when this optimization isn't on, we run
    +	# afoul of the reaper. Thus, the slightly redundant code that uses two
    +	# static s/// patterns rather than one conditional pattern.
    +
    +	if ($g_list_level) {
    +		$text =~ s{
    +				^
    +				$whole_list
    +			}{
    +				my $list = $1;
    +				my $list_type = ($3 =~ m/$marker_ul/) ? "ul" : "ol";
    +
    +				# Turn double returns into triple returns, so that we can make a
    +				# paragraph for the last item in a list, if necessary:
    +				$list =~ s/\n{2,}/\n\n\n/g;
    +				my $result = _ProcessListItems($list, $marker_any);
    +
    +				# Trim any trailing whitespace, to put the closing ``
    +				# up on the preceding line, to get it past the current stupid
    +				# HTML block parser. This is a hack to work around the terrible
    +				# hack that is the HTML block parser.
    +				$result =~ s{\s+$}{};
    +				$result = "<$list_type>" . $result . "\n";
    +				$result;
    +			}egmx;
    +	}
    +	else {
    +		$text =~ s{
    +				(?:(?<=\n\n)|\A\n?)
    +				$whole_list
    +			}{
    +				my $list = $1;
    +				my $list_type = ($3 =~ m/$marker_ul/) ? "ul" : "ol";
    +				# Turn double returns into triple returns, so that we can make a
    +				# paragraph for the last item in a list, if necessary:
    +				$list =~ s/\n{2,}/\n\n\n/g;
    +				my $result = _ProcessListItems($list, $marker_any);
    +				$result = "<$list_type>\n" . $result . "\n";
    +				$result;
    +			}egmx;
    +	}
    +
    +
    +	return $text;
    +}
    +
    +
    +sub _ProcessListItems {
    +#
    +#	Process the contents of a single ordered or unordered list, splitting it
    +#	into individual list items.
    +#
    +
    +	my $list_str = shift;
    +	my $marker_any = shift;
    +
    +
    +	# The $g_list_level global keeps track of when we're inside a list.
    +	# Each time we enter a list, we increment it; when we leave a list,
    +	# we decrement. If it's zero, we're not in a list anymore.
    +	#
    +	# We do this because when we're not inside a list, we want to treat
    +	# something like this:
    +	#
    +	#		I recommend upgrading to version
    +	#		8. Oops, now this line is treated
    +	#		as a sub-list.
    +	#
    +	# As a single paragraph, despite the fact that the second line starts
    +	# with a digit-period-space sequence.
    +	#
    +	# Whereas when we're inside a list (or sub-list), that line will be
    +	# treated as the start of a sub-list. What a kludge, huh? This is
    +	# an aspect of Markdown's syntax that's hard to parse perfectly
    +	# without resorting to mind-reading. Perhaps the solution is to
    +	# change the syntax rules such that sub-lists must start with a
    +	# starting cardinal number; e.g. "1." or "a.".
    +
    +	$g_list_level++;
    +
    +	# trim trailing blank lines:
    +	$list_str =~ s/\n{2,}\z/\n/;
    +
    +
    +	$list_str =~ s{
    +		(\n)?							# leading line = $1
    +		(^[ \t]*)						# leading whitespace = $2
    +		($marker_any) [ \t]+			# list marker = $3
    +		((?s:.+?)						# list item text   = $4
    +		(\n{1,2}))
    +		(?= \n* (\z | \2 ($marker_any) [ \t]+))
    +	}{
    +		my $item = $4;
    +		my $leading_line = $1;
    +		my $leading_space = $2;
    +
    +		if ($leading_line or ($item =~ m/\n{2,}/)) {
    +			$item = _RunBlockGamut(_Outdent($item));
    +		}
    +		else {
    +			# Recursion for sub-lists:
    +			$item = _DoLists(_Outdent($item));
    +			chomp $item;
    +			$item = _RunSpanGamut($item);
    +		}
    +
    +		"
  • " . $item . "
  • \n"; + }egmx; + + $g_list_level--; + return $list_str; +} + + + +sub _DoCodeBlocks { +# +# Process Markdown `
    ` blocks.
    +#	
    +
    +	my $text = shift;
    +
    +	$text =~ s{
    +			(?:\n\n|\A)
    +			(	            # $1 = the code block -- one or more lines, starting with a space/tab
    +			  (?:
    +			    (?:[ ]{$g_tab_width} | \t)  # Lines must start with a tab or a tab-width of spaces
    +			    .*\n+
    +			  )+
    +			)
    +			((?=^[ ]{0,$g_tab_width}\S)|\Z)	# Lookahead for non-space at line-start, or end of doc
    +		}{
    +			my $codeblock = $1;
    +			my $result; # return value
    +
    +			$codeblock = _EncodeCode(_Outdent($codeblock));
    +			$codeblock = _Detab($codeblock);
    +			$codeblock =~ s/\A\n+//; # trim leading newlines
    +			$codeblock =~ s/\n+\z//; # trim trailing newlines
    +
    +			$result = "\n\n
    " . $codeblock . "
    \n\n"; # CHANGED: Removed newline for MMD + + $result; + }egmx; + + return $text; +} + + +sub _DoCodeSpans { +# +# * Backtick quotes are used for spans. +# +# * You can use multiple backticks as the delimiters if you want to +# include literal backticks in the code span. So, this input: +# +# Just type ``foo `bar` baz`` at the prompt. +# +# Will translate to: +# +#

    Just type foo `bar` baz at the prompt.

    +# +# There's no arbitrary limit to the number of backticks you +# can use as delimters. If you need three consecutive backticks +# in your code, use four for delimiters, etc. +# +# * You can use spaces to get literal backticks at the edges: +# +# ... type `` `bar` `` ... +# +# Turns to: +# +# ... type `bar` ... +# + + my $text = shift; + + $text =~ s@ + (?$c
    "; + @egsx; + + return $text; +} + + +sub _EncodeCode { +# +# Encode/escape certain characters inside Markdown code runs. +# The point is that in code, these characters are literals, +# and lose their special Markdown meanings. +# + local $_ = shift; + + # Encode all ampersands; HTML entities are not + # entities within a Markdown code span. + s/&/&/g; + + # Encode $'s, but only if we're running under Blosxom. + # (Blosxom interpolates Perl variables in article bodies.) + { + no warnings 'once'; + if (defined($blosxom::version)) { + s/\$/$/g; + } + } + + + # Do the angle bracket song and dance: + s! < !<!gx; + s! > !>!gx; + + # Now, escape characters that are magic in Markdown: + s! \* !$g_escape_table{'*'}!gx; + s! _ !$g_escape_table{'_'}!gx; + s! { !$g_escape_table{'{'}!gx; + s! } !$g_escape_table{'}'}!gx; + s! \[ !$g_escape_table{'['}!gx; + s! \] !$g_escape_table{']'}!gx; + s! \\ !$g_escape_table{'\\'}!gx; + + return $_; +} + + +sub _DoItalicsAndBold { + my $text = shift; + + # Cave in - `*` and `_` behave differently... We'll see how it works out + + + # must go first: + $text =~ s{ (?$2}gsx; + + $text =~ s{ (?$2}gsx; + + # And now, a second pass to catch nested strong and emphasis special cases + $text =~ s{ (?$2}gsx; + + $text =~ s{ (?$2}gsx; + + # And now, allow `*` in the middle of words + + # must go first: + $text =~ s{ (\*\*) (?=\S) (.+?[*]*) (?<=\S) \1 } + {$2}gsx; + + $text =~ s{ (\*) (?=\S) (.+?) (?<=\S) \1 } + {$2}gsx; + + return $text; +} + + +sub _DoBlockQuotes { + my $text = shift; + + $text =~ s{ + ( # Wrap whole match in $1 + ( + ^[ \t]*>[ \t]? # '>' at the start of a line + .+\n # rest of the first line + (.+\n)* # subsequent consecutive lines + \n* # blanks + )+ + ) + }{ + my $bq = $1; + $bq =~ s/^[ \t]*>[ \t]?//gm; # trim one level of quoting + $bq =~ s/^[ \t]+$//mg; # trim whitespace-only lines + $bq = _RunBlockGamut($bq); # recurse + + $bq =~ s/^/ /g; + # These leading spaces screw with
     content, so we need to fix that:
    +			$bq =~ s{
    +					(\s*
    .+?
    ) + }{ + my $pre = $1; + $pre =~ s/^ //mg; + $pre; + }egsx; + + "
    \n$bq\n
    \n\n"; + }egmx; + + + return $text; +} + + +sub _FormParagraphs { +# +# Params: +# $text - string to process with html

    tags +# + my $text = shift; + + # Strip leading and trailing lines: + $text =~ s/\A\n+//; + $text =~ s/\n+\z//; + + my @grafs = split(/\n{2,}/, $text); + + # + # Wrap

    tags. + # + foreach (@grafs) { + unless (defined( $g_html_blocks{$_} )) { + $_ = _RunSpanGamut($_); + s/^([ \t]*)/

    /; + $_ .= "

    "; + } + } + + # + # Unhashify HTML blocks + # +# foreach my $graf (@grafs) { +# my $block = $g_html_blocks{$graf}; +# if (defined $block) { +# $graf = $block; +# } +# } + + foreach my $graf (@grafs) { + # Modify elements of @grafs in-place... + my $block = $g_html_blocks{$graf}; + if (defined $block) { + $graf = $block; + if ($block =~ m{ + \A + ( # $1 =
    tag +
    ]* + \b + markdown\s*=\s* (['"]) # $2 = attr quote char + 1 + \2 + [^>]* + > + ) + ( # $3 = contents + .* + ) + (
    ) # $4 = closing tag + \z + + }xms + ) { + my ($div_open, $div_content, $div_close) = ($1, $3, $4); + + # We can't call Markdown(), because that resets the hash; + # that initialization code should be pulled into its own sub, though. + $div_content = _HashHTMLBlocks($div_content); + $div_content = _StripLinkDefinitions($div_content); + $div_content = _RunBlockGamut($div_content); + $div_content = _UnescapeSpecialChars($div_content); + + $div_open =~ s{\smarkdown\s*=\s*(['"]).+?\1}{}ms; + + $graf = $div_open . "\n" . $div_content . "\n" . $div_close; + } + } + } + + + return join "\n\n", @grafs; +} + + +sub _EncodeAmpsAndAngles { +# Smart processing for ampersands and angle brackets that need to be encoded. + + my $text = shift; + + # Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin: + # http://bumppo.net/projects/amputator/ + $text =~ s/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/&/g; + + # Encode naked <'s + $text =~ s{<(?![a-z/?\$!])}{<}gi; + + return $text; +} + + +sub _EncodeBackslashEscapes { +# +# Parameter: String. +# Returns: The string, with after processing the following backslash +# escape sequences. +# + local $_ = shift; + + s! \\\\ !$g_escape_table{'\\'}!gx; # Must process escaped backslashes first. + s! \\` !$g_escape_table{'`'}!gx; + s! \\\* !$g_escape_table{'*'}!gx; + s! \\_ !$g_escape_table{'_'}!gx; + s! \\\{ !$g_escape_table{'{'}!gx; + s! \\\} !$g_escape_table{'}'}!gx; + s! \\\[ !$g_escape_table{'['}!gx; + s! \\\] !$g_escape_table{']'}!gx; + s! \\\( !$g_escape_table{'('}!gx; + s! \\\) !$g_escape_table{')'}!gx; + s! \\> !$g_escape_table{'>'}!gx; + s! \\\# !$g_escape_table{'#'}!gx; + s! \\\+ !$g_escape_table{'+'}!gx; + s! \\\- !$g_escape_table{'-'}!gx; + s! \\\. !$g_escape_table{'.'}!gx; + s{ \\! }{$g_escape_table{'!'}}gx; + + return $_; +} + + +sub _DoAutoLinks { + my $text = shift; + + $text =~ s{<((https?|ftp|dict):[^'">\s]+)>}{
    $1}gi; + + # Email addresses: + $text =~ s{ + < + (?:mailto:)? + ( + [-.\w]+ + \@ + [-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+ + ) + > + }{ + _EncodeEmailAddress( _UnescapeSpecialChars($1) ); + }egix; + + return $text; +} + + +sub _EncodeEmailAddress { +# +# Input: an email address, e.g. "foo@example.com" +# +# Output: the email address as a mailto link, with each character +# of the address encoded as either a decimal or hex entity, in +# the hopes of foiling most address harvesting spam bots. E.g.: +# +# foo +# @example.com +# +# Based on a filter by Matthew Wickline, posted to the BBEdit-Talk +# mailing list: +# + + my $addr = shift; + + srand; + my @encode = ( + sub { '&#' . ord(shift) . ';' }, + sub { '&#x' . sprintf( "%X", ord(shift) ) . ';' }, + sub { shift }, + ); + + $addr = "mailto:" . $addr; + + $addr =~ s{(.)}{ + my $char = $1; + if ( $char eq '@' ) { + # this *must* be encoded. I insist. + $char = $encode[int rand 1]->($char); + } elsif ( $char ne ':' ) { + # leave ':' alone (to spot mailto: later) + my $r = rand; + # roughly 10% raw, 45% hex, 45% dec + $char = ( + $r > .9 ? $encode[2]->($char) : + $r < .45 ? $encode[1]->($char) : + $encode[0]->($char) + ); + } + $char; + }gex; + + $addr = qq{$addr}; + $addr =~ s{">.+?:}{">}; # strip the mailto: from the visible part + + return $addr; +} + + +sub _UnescapeSpecialChars { +# +# Swap back in all the special characters we've hidden. +# + my $text = shift; + + while( my($char, $hash) = each(%g_escape_table) ) { + $text =~ s/$hash/$char/g; + } + return $text; +} + + +sub _TokenizeHTML { +# +# Parameter: String containing HTML markup. +# Returns: Reference to an array of the tokens comprising the input +# string. Each token is either a tag (possibly with nested, +# tags contained therein, such as , or a +# run of text between tags. Each element of the array is a +# two-element array; the first is either 'tag' or 'text'; +# the second is the actual value. +# +# +# Derived from the _tokenize() subroutine from Brad Choate's MTRegex plugin. +# +# + + my $str = shift; + my $pos = 0; + my $len = length $str; + my @tokens; + + my $depth = 6; + my $nested_tags = join('|', ('(?:<[a-z/!$](?:[^<>]') x $depth) . (')*>)' x $depth); + my $match = qr/(?s: ) | # comment + (?s: <\? .*? \?> ) | # processing instruction + $nested_tags/ix; # nested tags + + while ($str =~ m/($match)/g) { + my $whole_tag = $1; + my $sec_start = pos $str; + my $tag_start = $sec_start - length $whole_tag; + if ($pos < $tag_start) { + push @tokens, ['text', substr($str, $pos, $tag_start - $pos)]; + } + push @tokens, ['tag', $whole_tag]; + $pos = pos $str; + } + push @tokens, ['text', substr($str, $pos, $len - $pos)] if $pos < $len; + + return \@tokens; +} + + +sub _Outdent { +# +# Remove one level of line-leading tabs or spaces +# + my $text = shift; + + $text =~ s/^(\t|[ ]{1,$g_tab_width})//gm; + return $text; +} + + +sub _Detab { +# +# Cribbed from a post by Bart Lateur: +# +# + my $text = shift; + + $text =~ s{(.*?)\t}{$1.(' ' x ($g_tab_width - length($1) % $g_tab_width))}ge; + return $text; +} + +# +# MultiMarkdown Routines +# + +sub _ParseMetaData { + my $text = shift; + my $clean_text = ""; + + my ($inMetaData, $currentKey) = (1,''); + + # If only metadata is "Format: complete" then skip + + if ($text =~ s/^(Format):\s*complete\n(.*?)\n/$2\n/is) { + # If "Format: complete" was added automatically, don't force first + # line of text to be metadata + $g_metadata{$1}= "complete"; + $g_document_format = "complete"; + } + + foreach my $line ( split /\n/, $text ) { + $line =~ /^$/ and $inMetaData = 0; + if ($inMetaData) { + if ($line =~ /^([a-zA-Z0-9][0-9a-zA-Z _-]*?):\s*(.*)$/ ) { + $currentKey = $1; + my $meta = $2; + $currentKey =~ s/\s+/ /g; + $currentKey =~ s/\s$//; + $g_metadata{$currentKey} = $meta; + if (lc($currentKey) eq "format") { + $g_document_format = lc($g_metadata{$currentKey}); + } + if (lc($currentKey) eq "base url") { + $g_base_url = $g_metadata{$currentKey}; + } + if (lc($currentKey) eq "bibliography title") { + $g_bibliography_title = $g_metadata{$currentKey}; + $g_bibliography_title =~ s/\s*$//; + } + if (lc($currentKey) eq "base header level") { + $g_base_header_level = $g_metadata{$currentKey}; + } + if (!$g_metadata_newline{$currentKey}) { + $g_metadata_newline{$currentKey} = $g_metadata_newline{default}; + } + } else { + if ($currentKey eq "") { + # No metadata present + $clean_text .= "$line\n"; + $inMetaData = 0; + next; + } + if ($line =~ /^\s*(.+)$/ ) { + $g_metadata{$currentKey} .= "$g_metadata_newline{$currentKey}$1"; + } + } + } else { + $clean_text .= "$line\n"; + } + } + + return $clean_text; +} + +sub _StripFootnoteDefinitions { + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + while ($text =~ s{ + \n[ ]{0,$less_than_tab}\[\^([^\n]+?)\]\:[ \t]*# id = $1 + \n? + (.*?)\n{1,2} # end at new paragraph + ((?=\n[ ]{0,$less_than_tab}\S)|\Z) # Lookahead for non-space at line-start, or end of doc + } + {\n}sx) + { + my $id = $1; + my $footnote = "$2\n"; + $footnote =~ s/^[ ]{0,$g_tab_width}//gm; + + $g_footnotes{id2footnote($id)} = $footnote; + } + + return $text; +} + +sub _DoFootnotes { + my $text = shift; + + # First, run routines that get skipped in footnotes + foreach my $label (sort keys %g_footnotes) { + my $footnote = _RunBlockGamut($g_footnotes{$label}); + + $footnote = _DoMarkdownCitations($footnote); + $g_footnotes{$label} = $footnote; + } + + $text =~ s{ + \[\^(.+?)\] # id = $1 + }{ + my $result = ""; + my $id = id2footnote($1); + if (defined $g_footnotes{$id} ) { + $g_footnote_counter++; + if ($g_footnotes{$id} =~ /^(

    )?glossary:/i) { + $result = "$g_footnote_counter"; + } else { + $result = "$g_footnote_counter"; + } + push (@g_used_footnotes,$id); + } + $result; + }xsge; + + return $text; +} + +sub _FixFootnoteParagraphs { + my $text = shift; + + $text =~ s/^\\<\/footnote\>/<\/footnote>/gm; + + return $text; +} + +sub _PrintFootnotes{ + my $footnote_counter = 0; + my $result = ""; + + foreach my $id (@g_used_footnotes) { + $footnote_counter++; + my $footnote = $g_footnotes{$id}; + my $footnote_closing_tag = ""; + + $footnote =~ s/(\<\/(p(re)?|ol|ul)\>)$//; + $footnote_closing_tag = $1; + + if ($footnote =~ s/^(

    )?glossary:\s*//i) { + # Add some formatting for glossary entries + + $footnote =~ s{ + ^(.*?) # $1 = term + \s* + (?:\(([^\(\)]*)\)[^\n]*)? # $2 = optional sort key + \n + }{ + my $glossary = "$1"; + + if ($2) { + $glossary.="$2"; + }; + + $glossary . ":

    "; + }egsx; + + $result.="

  • $footnote ↩$footnote_closing_tag
  • \n\n"; + } else { + $result.="
  • $footnote ↩$footnote_closing_tag
  • \n\n"; + } + } + $result .= "\n
    "; + + if ($footnote_counter > 0) { + $result = "\n\n
    \n\n\n".$result; + } else { + $result = ""; + } + + $result= _UnescapeSpecialChars($result); + return $result; +} + +sub Header2Label { + my $header = shift; + my $label = lc $header; + $label =~ s/[^A-Za-z0-9:_.-]//g; # Strip illegal characters + while ($label =~ s/^[^A-Za-z]//g) + {}; # Strip illegal leading characters + return $label; +} + +sub id2footnote { + # Since we prepend "fn:", we can allow leading digits in footnotes + my $id = shift; + my $footnote = lc $id; + $footnote =~ s/[^A-Za-z0-9:_.-]//g; # Strip illegal characters + return $footnote; +} + + +sub xhtmlMetaData { + my $result = qq{\n}; + + # This screws up xsltproc - make sure to use `-nonet -novalid` if you + # have difficulty + if ($g_allow_mathml) { + $result .= qq{ +\n}; + + $result.= qq{\n\t\n}; + } else { + $result .= qq{\n}; + + $result.= qq!\n\t\n!; + } + + $result.= "\t\t\n"; + + foreach my $key (sort keys %g_metadata ) { + # Strip trailing spaces + $g_metadata{$key} =~ s/(\s)*$//s; + + # Strip spaces from key + my $export_key = $key; + $export_key =~ s/\s//g; + + if (lc($key) eq "title") { + $result.= "\t\t" . _EncodeAmpsAndAngles($g_metadata{$key}) . "\n"; + } elsif (lc($key) eq "css") { + $result.= "\t\t\n/g; + + if ($result ne "") { + $result.= "\n"; + } + + return $result; +} + +sub _ConvertCopyright{ + my $text = shift; + # Convert to an XML compatible form of copyright symbol + + $text =~ s/©/©/gi; + + return $text; +} + + +sub _DoTables { + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + # Algorithm inspired by PHP Markdown Extra's table support + # + + # Reusable regexp's to match table + + my $line_start = qr{ + [ ]{0,$less_than_tab} + }mx; + + my $table_row = qr{ + [^\n]*?\|[^\n]*?\n + }mx; + + my $first_row = qr{ + $line_start + \S+.*?\|.*?\n + }mx; + + my $table_rows = qr{ + (\n?$table_row) + }mx; + + my $table_caption = qr{ + $line_start + \[.*?\][ \t]*\n + }mx; + + my $table_divider = qr{ + $line_start + [\|\-\+\:\.][ \-\+\|\:\.]* \| [ \-\+\|\:\.]* + }mx; + + my $whole_table = qr{ + ($table_caption)? # Optional caption + ($first_row # First line must start at beginning + ($table_row)*?)? # Header Rows + $table_divider # Divider/Alignment definitions + $table_rows+ # Body Rows + ($table_caption)? # Optional caption + }mx; + + + # Find whole tables, then break them up and process them + + $text =~ s{ + ^($whole_table) # Whole table in $1 + (\n|\Z) # End of file or 2 blank lines + }{ + my $table = $1; + + # Clean extra spaces at end of lines - + # they cause the processing to choke + $table =~ s/[\t ]*\n/\n/gs; + + my $result = "
    \n"; + my @alignments; + my $use_row_header = 1; + + # Add Caption, if present + + if ($table =~ s/^$line_start(?:\[\s*(.*)\s*\])?(?:\[\s*(.*?)\s*\])[ \t]*$//m) { + my $table_id = ""; + my $table_caption = ""; + + $table_id = Header2Label($2); + + if (defined $1) { + $table_caption = $1; + } else { + $table_caption = $2; + } + $result .= "\n"; + + $g_crossrefs{$table_id} = "#$table_id"; + $g_titles{$table_id} = "see table"; # captions with "stuff" in them break links + } + + # If a second "caption" is present, treat it as a summary + # However, this is not valid in XHTML 1.0 Strict + # But maybe in future + + # A summary might be longer than one line + if ($table =~ s/\n$line_start\[\s*(.*?)\s*\][ \t]*\n/\n/s) { + # $result .= "" . _RunSpanGamut($1) . "\n"; + } + + # Now, divide table into header, alignment, and body + + # First, add leading \n in case there is no header + + $table = "\n" . $table; + + # Need to be greedy + + $table =~ s/\n($table_divider)\n(($table_rows)+)//s; + + my $body = ""; + my $alignment_string = ""; + if (defined $1){ + $alignment_string = $1; + } + if (defined $2){ + $body = $2; + } + + # Process column alignment + while ($alignment_string =~ /\|?\s*(.+?)\s*(\||\Z)/gs) { + my $cell = _RunSpanGamut($1); + if ($cell =~ /\+/){ + $result .= "$cell\n"; + } else { + $result .= "\t<$cell_type$colspan>$cell\n"; + } + $count++; + } + $result .= "\n"; + } + + # Strip out empty sections + $result =~ s/\s*<\/thead>\s*//s; + + # Handle pull-quotes + + # This might be too specific for my needs. If others want it + # removed, I am open to discussion. + + $result =~ s/
    " . _RunSpanGamut($table_caption). "
    \s*\s*/
    \n\n/s; + + $result .= "\n
    \n"; + $result + }egmx; + + my $table_body = qr{ + ( # wrap whole match in $2 + + (.*?\|.*?)\n # wrap headers in $3 + + [ ]{0,$less_than_tab} + ($table_divider) # alignment in $4 + + ( # wrap cells in $5 + $table_rows + ) + ) + }mx; + + return $text; +} + + +sub _DoAttributes{ + my $id = shift; + my $result = ""; + + if (defined $g_attributes{$id}) { + my $attributes = $g_attributes{$id}; + while ($attributes =~ s/(\S+)="(.*?)"//) { + $result .= " $1=\"$2\""; + } + while ($attributes =~ /(\S+)=(\S+)/g) { + $result .= " $1=\"$2\""; + } + } + + return $result; +} + + +sub _StripMarkdownReferences { + my $text = shift; + my $less_than_tab = $g_tab_width - 1; + + while ($text =~ s{ + \n\[\#(.+?)\]:[ \t]* # id = $1 + \n? + (.*?)\n{1,2} # end at new paragraph + ((?=\n[ ]{0,$less_than_tab}\S)|\Z) # Lookahead for non-space at line-start, or end of doc + } + {\n}sx) + { + my $id = $1; + my $reference = "$2\n"; + + $reference =~ s/^[ ]{0,$g_tab_width}//gm; + + $reference = _RunBlockGamut($reference); + + # strip leading and trailing

    tags (they will be added later) + $reference =~ s/^\//s; + $reference =~ s/\<\/p\>\s*$//s; + + $g_references{$id} = $reference; + } + + return $text; +} + +sub _DoMarkdownCitations { + my $text = shift; + + $text =~ s{ # Allow for citations without locator to be written + \[\#([^\[]*?)\] # in usual manner, e.g. [#author][] rather than + [ ]? # [][#author] + (?:\n[ ]*)? + \[\s*\] + }{ + "[][#$1]"; + }xsge; + + $text =~ s{ + \[([^\[]*?)\] # citation text = $1 + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + \[\#(.*?)\] # id = $2 + }{ + my $result; + my $anchor_text = $1; + my $id = $2; + my $count; + + # implement equivalent to \citet + my $textual_string = ""; + if ($anchor_text =~ s/^(.*?);\s*//) { + $textual_string = "$1"; + } + + if (defined $g_references{$id} ) { + my $citation_counter=0; + + # See if citation has been used before + foreach my $old_id (@g_used_references) { + $citation_counter++; + $count = $citation_counter if ($old_id eq $id); + } + + if (! defined $count) { + $g_citation_counter++; + $count = $g_citation_counter; + push (@g_used_references,$id); + } + + $result = "$textual_string ($count"; + + if ($anchor_text ne "") { + $result .=", $anchor_text"; + } + + $result .= ")"; + } else { + # No reference exists + $result = "$textual_string ($id"; + + if ($anchor_text ne "") { + $result .=", $anchor_text"; + } + + $result .= ")"; + } + + if (Header2Label($anchor_text) eq "notcited"){ + $result = ""; + } + $result; + }xsge; + + return $text; + +} + +sub _PrintMarkdownBibliography{ + my $citation_counter = 0; + my $result; + + foreach my $id (@g_used_references) { + $citation_counter++; + $result.="

    [$citation_counter] $g_references{$id}

    \n\n"; + } + $result .= "
    "; + + if ($citation_counter > 0) { + $result = "\n\n
    \n$g_bibliography_title

    \n\n".$result; + } else { + $result = ""; + } + + return $result; +} + +sub _GenerateImageCrossRefs { + my $text = shift; + + # + # First, handle reference-style labeled images: ![alt text][id] + # + $text =~ s{ + ( # wrap whole match in $1 + !\[ + (.*?) # alt text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + + ) + }{ + my $result; + my $whole_match = $1; + my $alt_text = $2; + my $link_id = lc $3; + + if ($link_id eq "") { + $link_id = lc $alt_text; # for shortcut links like ![this][]. + } + + $alt_text =~ s/"/"/g; + if (defined $g_urls{$link_id}) { + my $label = Header2Label($alt_text); + $g_crossrefs{$label} = "#$label"; + } + else { + # If there's no such link ID, leave intact: + $result = $whole_match; + } + + $whole_match; + }xsge; + + # + # Next, handle inline images: ![alt text](url "optional title") + # Don't forget: encode * and _ + + $text =~ s{ + ( # wrap whole match in $1 + !\[ + (.*?) # alt text = $2 + \] + \( # literal paren + [ \t]* + ? # src url = $3 + [ \t]* + ( # $4 + (['"]) # quote char = $5 ' + (.*?) # title = $6 + \5 # matching quote + [ \t]* + )? # title is optional + \) + ) + }{ + my $result; + my $whole_match = $1; + my $alt_text = $2; + + $alt_text =~ s/"/"/g; + my $label = Header2Label($alt_text); + $g_crossrefs{$label} = "#$label"; + $whole_match; + }xsge; + + return $text; +} + +sub _FindMathEquations{ + my $text = shift; + + $text =~ s{ + (\]*)id=\"(.*?)\"> # " + }{ + my $label = Header2Label($2); + my $header = _RunSpanGamut($2); + + $g_crossrefs{$label} = "#$label"; + $g_titles{$label} = $header; + + $1 . "id=\"$label\">"; + }xsge; + + return $text; +} + +sub _DoMathSpans { + # Based on Gruber's _DoCodeSpans + + my $text = shift; + my $display_as_block = 0; + $display_as_block = 1 if ($text =~ /^<<[^\>\>]*>>$/); + + $text =~ s{ + (?>) + }{ + my $m = "$2"; + my $label = ""; + my @attr = (xmlns=>"http://www.w3.org/1998/Math/MathML"); + + if (defined $3) { + $label = Header2Label($3); + my $header = _RunSpanGamut($3); + + $g_crossrefs{$label} = "#$label"; + $g_titles{$label} = $header; + } + $m =~ s/^[ \t]*//g; # leading whitespace + $m =~ s/[ \t]*$//g; # trailing whitespace + push(@attr,(id=>"$label")) if ($label ne ""); + push(@attr,(display=>"block")) if ($display_as_block == 1); + + $m = $mathParser->TextToMathML($m,\@attr); + "$m"; + }egsx; + + return $text; +} + +sub _DoDefinitionLists { + # Uses the syntax proposed by Michel Fortin in PHP Markdown Extra + + my $text = shift; + my $less_than_tab = $g_tab_width -1; + + my $line_start = qr{ + [ ]{0,$less_than_tab} + }mx; + + my $term = qr{ + $line_start + [^:\s][^\n]*\n + }sx; + + my $definition = qr{ + \n?[ ]{0,$less_than_tab} + \:[ \t]+(.*?)\n + ((?=\n?\:)|\n|\Z) # Lookahead for next definition, two returns, + # or the end of the document + }sx; + + my $definition_block = qr{ + ((?:$term)+) # $1 = one or more terms + ((?:$definition)+) # $2 = by one or more definitions + }sx; + + my $definition_list = qr{ + (?:$definition_block\n*)+ # One ore more definition blocks + }sx; + + $text =~ s{ + ($definition_list) # $1 = the whole list + }{ + my $list = $1; + my $result = $1; + + $list =~ s{ + (?:$definition_block)\n* + }{ + my $terms = $1; + my $defs = $2; + + $terms =~ s{ + [ ]{0,$less_than_tab} + (.*) + \s* + }{ + my $term = $1; + my $result = ""; + $term =~ s/^\s*(.*?)\s*$/$1/; + if ($term !~ /^\s*$/){ + $result = "
    " . _RunSpanGamut($1) . "
    \n"; + } + $result; + }xmge; + + $defs =~ s{ + $definition + }{ + my $def = $1 . "\n"; + $def =~ s/^[ ]{0,$g_tab_width}//gm; + "
    \n" . _RunBlockGamut($def) . "\n
    \n"; + }xsge; + + $terms . $defs . "\n"; + }xsge; + + "
    \n" . $list . "
    \n\n"; + }xsge; + + return $text +} + +sub _UnescapeComments{ + # Remove encoding inside comments + # Based on proposal by Toras Doran (author of Text::MultiMarkdown) + + my $text = shift; + $text =~ s{ + (?<=) # End comments + }{ + my $t = $1; + $t =~ s/&/&/g; + $t =~ s/</ + + +=head1 SYNOPSIS + +B [ B<--html4tags> ] [ B<--version> ] [ B<-shortversion> ] + [ I ... ] + + +=head1 DESCRIPTION + +MultiMarkdown is an extended version of Markdown. See the website for more +information. + + http://fletcherpenney.net/multimarkdown/ + +Markdown is a text-to-HTML filter; it translates an easy-to-read / +easy-to-write structured text format into HTML. Markdown's text format +is most similar to that of plain text email, and supports features such +as headers, *emphasis*, code blocks, blockquotes, and links. + +Markdown's syntax is designed not as a generic markup language, but +specifically to serve as a front-end to (X)HTML. You can use span-level +HTML tags anywhere in a Markdown document, and you can use block level +HTML tags (like
    and as well). + +For more information about Markdown's syntax, see: + + http://daringfireball.net/projects/markdown/ + + +=head1 OPTIONS + +Use "--" to end switch parsing. For example, to open a file named "-z", use: + + Markdown.pl -- -z + +=over 4 + + +=item B<--html4tags> + +Use HTML 4 style for empty element tags, e.g.: + +
    + +instead of Markdown's default XHTML style tags, e.g.: + +
    + + +=item B<-v>, B<--version> + +Display Markdown's version number and copyright information. + + +=item B<-s>, B<--shortversion> + +Display the short-form version number. + + +=back + + + +=head1 BUGS + +To file bug reports or feature requests (other than topics listed in the +Caveats section above) please send email to: + + support@daringfireball.net (for Markdown issues) + + owner@fletcherpenney.net (for MultiMarkdown issues) + +Please include with your report: (1) the example input; (2) the output +you expected; (3) the output (Multi)Markdown actually produced. + + +=head1 AUTHOR + + John Gruber + http://daringfireball.net/ + + PHP port and other contributions by Michel Fortin + http://michelf.com/ + + MultiMarkdown changes by Fletcher Penney + http://fletcherpenney.net/ + +=head1 COPYRIGHT AND LICENSE + +Original Markdown Code Copyright (c) 2003-2007 John Gruber + +All rights reserved. + +MultiMarkdown changes Copyright (c) 2005-2009 Fletcher T. Penney + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. + +=cut + diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown/Support.pm b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown/Support.pm new file mode 100755 index 00000000..a0e03abb --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/MultiMarkdown/Support.pm @@ -0,0 +1,622 @@ +# +# $Id: Support.pm 534 2009-06-19 20:52:55Z fletcher $ +# +# MultiMarkdown Version 2.0.b6 +# + +# TODO: Add an option to turn SmartyPants off? + +package MultiMarkdown::Support; + +# use 5.00; +use strict; +use warnings; + +use File::Basename; +use File::Path; +use File::Temp qw/tempdir/; +use File::Copy; +use File::Glob qw/:globally/; +use Cwd; +use Cwd 'abs_path'; + + +use vars qw(%g_metadata); + +our $VERSION = '1.0'; + +sub ProcessMMD2XHTML { + my $MMDPath = shift; + my $input_file = shift; + my $text = "Format: complete\n"; + $text .= shift; + + my $output_file = ""; + $output_file = _Input2Output($input_file, "html") if ($input_file ne ""); + + my $SmartyPants = _WhichSmarty($text); + my $xslt_file = _XhtmlXSLT($text); + + # Generate the pipe command and run + + my $os = $^O; + my $xslt = ""; + my $out = ""; + + if ($input_file ne "") { + $out = "> \"$output_file\""; + } + + if ($os =~ /MSWin/) { + $xslt = "| xsltproc -nonet -novalid XSLT\\$xslt_file -" if ($xslt_file ne ""); + $MMDPath =~ s/\//\\/g; + open (MultiMarkdown, "| cd $MMDPath & perl bin\\MultiMarkdown.pl | perl bin\\$SmartyPants $xslt $out"); + } else { + $xslt = "| xsltproc -nonet -novalid XSLT/$xslt_file -" if ($xslt_file ne ""); + open (MultiMarkdown, "| cd \"$MMDPath\"; bin/MultiMarkdown.pl | bin/$SmartyPants $xslt $out"); + } + + print MultiMarkdown $text; + close (MultiMarkdown); +} + +sub ProcessMMD2RTF { + my $MMDPath = shift; + my $input_file = shift; + my $text = "Format: complete\n"; + $text .= shift; + + my $output_file = ""; + $output_file = _Input2Output($input_file, "rtf") if ($input_file ne ""); + + my $SmartyPants = _WhichSmarty($text); + my $xslt_file = _RTFXSLT($text); + $xslt_file = "xhtml2rtf.xslt" if ($xslt_file eq ""); # Default + + # Generate the pipe command and run + + my $os = $^O; + my $xslt = ""; + my $out = ""; + + if ($input_file ne "") { + $out = "> \"$output_file\""; + } + + if ($os =~ /MSWin/) { + $xslt = "| xsltproc -nonet -novalid XSLT\\$xslt_file -" if ($xslt_file ne ""); + $MMDPath =~ s/\//\\/g; + # TOD: This version won't crash on windows, but the regexp's aren't + # quite right. I welcome input from Windows users but I'm tired of + # messing with it myself for the time being. + my $command = "| cd \"$MMDPath\" & perl -pi -e \"s/(? \"$output_file\""; + } + + if ($os =~ /MSWin/) { + $xslt = "| xsltproc -nonet -novalid XSLT\\$xslt_file -" if ($xslt_file ne ""); + $MMDPath =~ s/\//\\/g; + open (MultiMarkdown, "| cd \"$MMDPath\" & perl bin\\MultiMarkdown.pl | perl bin\\$SmartyPants $xslt | perl Utilities\\cleancites.pl $out"); + } else { + $xslt = "| xsltproc -nonet -novalid XSLT/$xslt_file -" if ($xslt_file ne ""); + open (MultiMarkdown, "| cd \"$MMDPath\"; bin/MultiMarkdown.pl | bin/$SmartyPants $xslt | Utilities/cleancites.pl $out"); + } + + print MultiMarkdown $text; + close (MultiMarkdown); +} + + +sub ProcessMMD2PDF { + my $MMDPath = shift; + my $input_file = shift; + my $text = shift; + + # These are not all necessary for simple files, but are included to try + # and be as thorough as possible... Sort of a poor man's latexmk.pl + + my $tex_string = "; pdflatex mmd.tex; bibtex mmd; makeindex -t mmd.glg -o mmd.gls -s mmd.ist mmd.glo; makeindex -s `kpsewhich basic.gst` -o mmd.gls mmd.glo; pdflatex mmd.tex; pdflatex mmd.tex; pdflatex mmd.tex; pdflatex mmd.tex"; + + if ($^O =~ /MSWin/) { + $tex_string = "& pdflatex mmd.tex & bibtex mmd & makeindex -t mmd.glg -o mmd.gls -s mmd.ist mmd.glo & makeindex -s `kpsewhich basic.gst` -o mmd.gls mmd.glo & pdflatex mmd.tex & pdflatex mmd.tex & pdflatex mmd.tex & pdflatex mmd.tex"; + } + PDFEngine($MMDPath, $input_file, $tex_string, $text); + +} + + +sub ProcessMMD2PDFXeLaTeX { + my $MMDPath = shift; + my $input_file = shift; + my $text = shift; + + # These are not all necessary for simple files, but are included to try + # and be as thorough as possible... Sort of a poor man's latexmk.pl + + my $tex_string = "; xelatex mmd.tex; bibtex mmd; makeindex -t mmd.glg -o mmd.gls -s mmd.ist mmd.glo; makeindex -s `kpsewhich basic.gst` -o mmd.gls mmd.glo; xelatex mmd.tex; xelatex mmd.tex; xelatex mmd.tex; xelatex mmd.tex"; + + if ($^O =~ /MSWin/) { + $tex_string = "& xelatex mmd.tex & bibtex mmd & makeindex -t mmd.glg -o mmd.gls -s mmd.ist mmd.glo & makeindex -s `kpsewhich basic.gst` -o mmd.gls mmd.glo & xelatex mmd.tex & xelatex mmd.tex & xelatex mmd.tex & xelatex mmd.tex"; + } + PDFEngine($MMDPath, $input_file, $tex_string, $text); +} + +sub ProcessXHTML2MMD { + my $MMDPath = shift; + my $input_file = shift; + my $text = shift; + + my $output_file = ""; + $output_file = _Input2Output($input_file, "txt") if ($input_file ne ""); + + my $xslt_file = "multimarkdown.xslt"; + + # Generate the pipe command and run + + my $os = $^O; + my $xslt = ""; + my $out = ""; + + if ($input_file ne "") { + $out = "> \"$output_file\""; + } + + if ($os =~ /MSWin/) { + $xslt = "| xsltproc -nonet -novalid XSLT\\$xslt_file -" if ($xslt_file ne ""); + $MMDPath =~ s/\//\\/g; + open (MultiMarkdown, "| cd \"$MMDPath\" & xsltproc -nonet -novalid XSLT\\$xslt_file - $out"); + } else { + $xslt = "| xsltproc -nonet -novalid XSLT/$xslt_file -" if ($xslt_file ne ""); + open (MultiMarkdown, "| cd \"$MMDPath\"; xsltproc -nonet -novalid XSLT/$xslt_file - $out"); + } + + print MultiMarkdown $text; + close (MultiMarkdown); +} + + +sub ProcessOPML2MMD { + my $MMDPath = shift; + my $input_file = shift; + my $text = shift; + + # Preserve tab characters + $text =~ s/\t/ /g; + + my $output_file = ""; + $output_file = _Input2Output($input_file, "txt") if ($input_file ne ""); + + my $xslt_file = "opml2mmd.xslt"; + + # Generate the pipe command and run + + my $os = $^O; + my $xslt = ""; + my $out = ""; + + if ($input_file ne "") { + $out = "> \"$output_file\""; + } + + if ($os =~ /MSWin/) { + $xslt = "| xsltproc -nonet -novalid XSLT\\$xslt_file -" if ($xslt_file ne ""); + $MMDPath =~ s/\//\\/g; + open (MultiMarkdown, "| cd \"$MMDPath\" & xsltproc -nonet -novalid XSLT\\$xslt_file - $out"); + } else { + $xslt = "| xsltproc -nonet -novalid XSLT/$xslt_file -" if ($xslt_file ne ""); + open (MultiMarkdown, "| cd \"$MMDPath\"; xsltproc -nonet -novalid XSLT/$xslt_file - $out"); + } + + print MultiMarkdown $text; + close (MultiMarkdown); +} + + +sub PDFEngine { + my $MMDPath = shift; + my $input_file = shift; + my $tex_string = shift; + my $text = shift; + + my $latex_file = _Input2Output($input_file, "tex"); + my $output_file = _Input2Output($input_file, "pdf"); + my $parent_folder = dirname($latex_file); + my $temp_tex_file = ""; + my @support_files = (); + + # Create a temporary working folder + my $temp_folder = tempdir(); + + # Create the LaTeX file + ProcessMMD2LaTeX($MMDPath, $input_file, $text); + + if ($^O =~ /MSWin/) { + # We're in Windows + $temp_folder =~ s/\//\\/g; + $parent_folder =~ s/\\/\//g; + $temp_tex_file = "$temp_folder\\mmd.tex"; + @support_files = <'$parent_folder\\*.{bib,pdf,png,gif,jpg}'>; + } else { + # Not in Windows + $temp_tex_file = "$temp_folder/mmd.tex"; + my $temp_parent_folder = $parent_folder; + $temp_parent_folder =~ s/ /\\ /g; + @support_files = <$temp_parent_folder/*.{bib,pdf,png,gif,jpg}>; + + # Try to be sure we have access to the LaTeX binaries in our PATH, + # especially if they were installed by Fink + $ENV{'PATH'} .= ':/usr/texbin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/sw/bin'; + } + + # Copy tex into temp directory + copy($latex_file, $temp_tex_file); + + # Copy possible images, .bib files, etc to the temp folder + copy($_,$temp_folder) foreach(@support_files); + + # Now, do the latex stuff + system("cd \"$temp_folder\" $tex_string"); + + # Retrieve the pdf + my $temp_pdf_file = _Input2Output($temp_tex_file, "pdf"); + copy($temp_pdf_file, $output_file); + + # Remove temporary files + File::Path::rmtree($temp_folder); +} + +sub _Input2Output { + # Convert the filename given to an output file with new extension + my $input_file = shift; + my $file_extension = shift; + my $output_file = abs_path($input_file); + + $output_file =~ s/\.[^\.\\\/]*?$/.$file_extension/; # strip extension + + return $output_file; +} + +sub _WhichSmarty { + my $text = shift; + my $language = _Language($text); + + if ($language =~ /^\s*german\s*$/i) { + return "SmartyPantsGerman.pl"; + } elsif ($language =~ /^\s*french\s*$/i) { + return "SmartyPantsFrench.pl"; + } elsif ($language =~ /^\s*swedish|norwegian|finnish|danish\s*$/i) { + return "SmartyPantsSwedish.pl"; + } elsif ($language =~ /^\s*dutch\s*$/i) { + return "SmartyPantsDutch.pl"; + } + + return "SmartyPants.pl"; +} + +sub _Language { + my $text = shift; + + my ($inMetaData, $currentKey) = (1,''); + + foreach my $line ( split /\n/, $text ) { + $line =~ /^$/ and $inMetaData = 0 and next; + if ($inMetaData) { + if ($line =~ /^([a-zA-Z0-9][0-9a-zA-Z _-]*?):\s*(.*)$/ ) { + $currentKey = $1; + $currentKey =~ s/ / /g; + $g_metadata{$currentKey} = $2; + if (lc($currentKey) eq "language") { + return $g_metadata{$currentKey}; + } + } else { + if ($currentKey eq "") { + # No metadata present + $inMetaData = 0; + next; + } + } + } + } + + return ""; +} + +sub _XhtmlXSLT { + my $text = shift; + + my ($inMetaData, $currentKey) = (1,''); + + foreach my $line ( split /\n/, $text ) { + $line =~ /^$/ and $inMetaData = 0 and next; + if ($inMetaData) { + if ($line =~ /^([a-zA-Z0-9][0-9a-zA-Z _-]*?):\s*(.*)$/ ) { + $currentKey = $1; + my $temp = $2; + $currentKey =~ s/ //g; + $g_metadata{$currentKey} = $temp; + if (lc($currentKey) eq "xhtmlxslt") { + $g_metadata{$currentKey} =~ s/\s*(\.xslt)?\s*$/.xslt/; + return $g_metadata{$currentKey}; + } + } else { + if ($currentKey eq "") { + # No metadata present + $inMetaData = 0; + next; + } + } + } + } + + return ""; +} + +sub _LatexXSLT { + my $text = shift; + + my ($inMetaData, $currentKey) = (1,''); + + foreach my $line ( split /\n/, $text ) { + $line =~ /^$/ and $inMetaData = 0 and next; + if ($inMetaData) { + if ($line =~ /^([a-zA-Z0-9][0-9a-zA-Z _-]*?):\s*(.*)$/ ) { + $currentKey = $1; + my $temp = $2; + $currentKey =~ s/ //g; + $g_metadata{$currentKey} = $temp; + if (lc($currentKey) eq "latexxslt") { + $g_metadata{$currentKey} =~ s/\s*(\.xslt)?\s*$/.xslt/; + return $g_metadata{$currentKey}; + } + } else { + if ($currentKey eq "") { + # No metadata present + $inMetaData = 0; + next; + } + } + } + } + + return ""; +} + + +sub _RTFXSLT { + my $text = shift; + + my ($inMetaData, $currentKey) = (1,''); + + foreach my $line ( split /\n/, $text ) { + $line =~ /^$/ and $inMetaData = 0 and next; + if ($inMetaData) { + if ($line =~ /^([a-zA-Z0-9][0-9a-zA-Z _-]*?):\s*(.*)$/ ) { + $currentKey = $1; + my $temp = $2; + $currentKey =~ s/ //g; + $g_metadata{$currentKey} = $temp; + if (lc($currentKey) eq "rtfxslt") { + $g_metadata{$currentKey} =~ s/\s*(\.xslt)?\s*$/.xslt/; + return $g_metadata{$currentKey}; + } + } else { + if ($currentKey eq "") { + # No metadata present + $inMetaData = 0; + next; + } + } + } + } + + return ""; +} + +sub LocateMMD { + my $me = shift; # Where am I running from? + + my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin + my $MMDPath = ""; + + # Determine where MMD is installed. Use a "common installation" + # if available. + + $me = dirname($me); + + if ($os =~ /MSWin/) { + # We're running Windows + + # First check our directory to see if we're running inside MMD + + if ( -f "$me\\MultiMarkdown\\Support.pm") { + $MMDPath = "$me\\.."; + } + + # Next, look in user's home directory, then in common directories + if ($MMDPath eq "") { + if ( -d "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown") { + $MMDPath = "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown"; + } elsif ( -d "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown") { + $MMDPath = "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown"; + } + } + + # Load the MultiMarkdown::Support.pm module + do "$MMDPath\\bin\\MultiMarkdown\\Support.pm" if ($MMDPath ne ""); + } else { + # We're running Mac OS X or some *nix + + # First check our directory to see if we're running inside MMD + + if ( -f "$me/MultiMarkdown/Support.pm") { + $MMDPath = "$me/.."; + } + + # Next, look in user's home directory, then in common directories + if ($MMDPath eq "") { + if (defined($ENV{HOME})) { + if ( -d "$ENV{HOME}/Library/Application Support/MultiMarkdown") { + $MMDPath = "$ENV{HOME}/Library/Application Support/MultiMarkdown"; + } elsif ( -d "$ENV{HOME}/.multimarkdown") { + $MMDPath = "$ENV{HOME}/.multimarkdown"; + } + } + if ($MMDPath eq "") { + if ( -d "/Library/Application Support/MultiMarkdown") { + $MMDPath = "/Library/Application Support/MultiMarkdown"; + } elsif ( -d "/usr/share/multimarkdown") { + $MMDPath = "/usr/share/multimarkdown"; + } + } + } + } + + if ($MMDPath eq "") { + die "You do not appear to have MultiMarkdown installed.\n"; + } else { + # Load the MultiMarkdown::Support.pm module + $MMDPath = abs_path($MMDPath); + LoadModule("$MMDPath/bin/MultiMarkdown/Support.pm"); + } + + # Clean up the path + $MMDPath = abs_path($MMDPath); + + return $MMDPath; +} + +sub LoadModule { + my $file = shift; + my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin + + if ($os =~ /MSWin/) { + # Not sure what I can do here + } else { + unless (my $return = eval `cat "$file"`) { + warn "couldn't parse $file: $@" if $@; + warn "couldn't do $file: $!" unless defined $return; + warn "couldn't run $file" unless $return; + } + } +} + + +1; +__END__ + +=head1 NAME + +MultiMarkdown::Support - Perl extension to provide support routines to +MultiMarkdown utility scripts. + +=head1 SYNOPSIS + +use MultiMarkdown::Support; + +=head1 FUNCTIONS + +LocateMMD(path/to/script/that/was/running); + +=over 4 + +Returns the path to the MultiMarkdown installation to be used. It first tries +for a "common installation", and then checks the parent of the running script. + +Unless the module is properly installed, and loaded first, this routine is not +likely to be needed and should be embedded in the utility script. See +mmd2XHTML for an example. + +=back + +ProcessMMD2XHTML(Path/to/MultiMarkdown, input_filename, multimarkdown_text); + +ProcessMMD2LaTeX(Path/to/MultiMarkdown, input_filename, multimarkdown_text); + +ProcessMMD2PDF(Path/to/MultiMarkdown, input_filename, multimarkdown_text); + +ProcessMMD2PDFXeLaTeX(Path/to/MultiMarkdown, input_filename, multimarkdown_text); + +=over 4 + +These routines convert the raw MultiMarkdown text into the appropriate format. +If a filename is specified, the output is written to a file with an +appropriate extension. Otherwise, when possible, it is presented on stdout. + +=back + +=head1 DESCRIPTION + +This module contains some of the core code used by the MultiMarkdown utility +scripts (mmd2XHTML, mmd2LaTeX, etc). The idea is to try and centralize as +much of that code as possible to simplify maintaining everything else. + + +=head1 SEE ALSO + +Designed for use with MultiMarkdown. + + + +Mailing list support for MultiMarkdown: + + + + OR + + + +=head1 AUTHOR + +Fletcher T. Penney, Eowner@fletcherpenney.netE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2009 by Fletcher T. Penney + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the + Free Software Foundation, Inc. + 59 Temple Place, Suite 330 + Boston, MA 02111-1307 USA + +=cut \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/OPML2mmd.pl b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/OPML2mmd.pl new file mode 100755 index 00000000..3eb06f61 --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/OPML2mmd.pl @@ -0,0 +1,212 @@ +#!/usr/bin/env perl +## +# Utility script to process OPML files back into MMD +# +# Copyright (c) 2010 Fletcher T. Penney +# +# + +# This script will process the text received via stdin, and output to stdout, +# OR +# will accept a list of files, and process each file individually. +# +# If a list of files is received, the input from "test.opml" will be output +# to "test.txt", for example. + +use strict; +use warnings; + +use File::Basename; +use Cwd; +use Cwd 'abs_path'; + + +# Determine where MMD is installed. Use a "common installation" if available. + +my $me = $0; # Where is this script located? +my $MMDPath = LocateMMD($me); + + +# Determine whether we are in "file mode" or "stdin mode" + +my $count = @ARGV; + +if ($count == 0) { + # We're in "stdin mode" + + # process stdin + undef $/; + my $data .= <>; + + MultiMarkdown::Support::ProcessOPML2MMD($MMDPath, "", $data); + +} else { + # We're in "file mode" + + foreach(@ARGV) { + # process each file individually + + # warn if directory + if ( -d $_ ) { + warn "This utility will not process directories. Please specify the files to process.\n"; + } elsif ( -f $_ ) { + # Determine filenames + my $filename = $_; + + # Read input and process + open(INPUT, "<$filename"); + local $/; + my $data = ; + close(INPUT); + + MultiMarkdown::Support::ProcessOPML2MMD($MMDPath, $filename, $data); + } else { + system("perldoc $0"); + } + } +} + +sub LocateMMD { + my $me = shift; # Where am I running from? + + my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin + my $MMDPath = ""; + + # Determine where MMD is installed. Use a "common installation" + # if available. + + $me = dirname($me); + + if ($os =~ /MSWin/) { + # We're running Windows + + # First check our directory to see if we're running inside MMD + + if ( -f "$me\\MultiMarkdown\\Support.pm") { + $MMDPath = "$me\\.."; + } + + # Next, look in user's home directory, then in common directories + if ($MMDPath eq "") { + if ( -d "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown") { + $MMDPath = "$ENV{HOMEDRIVE}$ENV{HOMEPATH}\\MultiMarkdown"; + } elsif ( -d "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown") { + $MMDPath = "$ENV{HOMEDRIVE}\\Documents and Settings\\All Users\\MultiMarkdown"; + } + } + + # Load the MultiMarkdown::Support.pm module + do "$MMDPath\\bin\\MultiMarkdown\\Support.pm" if ($MMDPath ne ""); + } else { + # We're running Mac OS X or some *nix + + # First check our directory to see if we're running inside MMD + + if ( -f "$me/MultiMarkdown/Support.pm") { + $MMDPath = "$me/.."; + } + + # Next, look in user's home directory, then in common directories + if ($MMDPath eq "") { + if (defined($ENV{HOME})) { + if ( -d "$ENV{HOME}/Library/Application Support/MultiMarkdown") { + $MMDPath = "$ENV{HOME}/Library/Application Support/MultiMarkdown"; + } elsif ( -d "$ENV{HOME}/.multimarkdown") { + $MMDPath = "$ENV{HOME}/.multimarkdown"; + } + } + if ($MMDPath eq "") { + if ( -d "/Library/Application Support/MultiMarkdown") { + $MMDPath = "/Library/Application Support/MultiMarkdown"; + } elsif ( -d "/usr/share/multimarkdown") { + $MMDPath = "/usr/share/multimarkdown"; + } + } + } + } + + if ($MMDPath eq "") { + die "You do not appear to have MultiMarkdown installed.\n"; + } else { + # Load the MultiMarkdown::Support.pm module + $MMDPath = abs_path($MMDPath); + LoadModule("$MMDPath/bin/MultiMarkdown/Support.pm"); + } + + # Clean up the path + $MMDPath = abs_path($MMDPath); + + return $MMDPath; +} + +sub LoadModule { + my $file = shift; + my $os = $^O; # Mac = darwin; Linux = linux; Windows contains MSWin + + if ($os =~ /MSWin/) { + # Not sure what I can do her + } else { + unless (my $return = eval `cat "$file"`) { + warn "couldn't parse $file: $@" if $@; + warn "couldn't do $file: $!" unless defined $return; + warn "couldn't run $file" unless $return; + } + } +} + +=head1 NAME + +OPML2mmd - utility script for MultiMarkdown to convert OPML back into +MultiMarkdown text. + +=head1 SYNOPSIS + +OPML2mmd.pl [file ...] + + +=head1 DESCRIPTION + +This script is designed as a "reversal" for MultiMarkdown generated OPML +files. It can convert a series of text files from OPML back into MultiMarkdown +text files. + + +=head1 SEE ALSO + +Designed for use with MultiMarkdown. + + + +Mailing list support for MultiMarkdown: + + + + OR + + + +=head1 AUTHOR + +Fletcher T. Penney, Eowner@fletcherpenney.netE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2010 by Fletcher T. Penney + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the + + Free Software Foundation, Inc. + 59 Temple Place, Suite 330 + Boston, MA 02111-1307 USA + +=cut \ No newline at end of file diff --git a/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/SmartyPants.pl b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/SmartyPants.pl new file mode 100755 index 00000000..f22cdf45 --- /dev/null +++ b/build/Development/Notational Velocity.app/Contents/Resources/MultiMarkdown/bin/SmartyPants.pl @@ -0,0 +1,1175 @@ +#!/usr/bin/perl -w + +# +# SmartyPants - A Plug-In for Movable Type, Blosxom, and BBEdit +# by John Gruber +# http://daringfireball.net +# +# See the readme or POD for details, installation instructions, and +# license information. +# +# Copyright (c) 2003-2004 John Gruber +# + +package SmartyPants; +use strict; +use vars qw($VERSION); +$VERSION = "1.5.1"; +# Fri 12 Mar 2004 + + +# Configurable variables: +my $smartypants_attr = "2"; # Blosxom and BBEdit users: change this to configure. + # 1 => "--" for em-dashes; no en-dash support + # 2 => "---" for em-dashes; "--" for en-dashes + # 3 => "--" for em-dashes; "---" for en-dashes + # See docs for more configuration options. + + +# Globals: +my $tags_to_skip = qr!<(/?)(?:pre|code|kbd|script|math|style)[\s>]!; + + +# Blosxom plug-in interface: +sub start { 1; } +sub story { + my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; + + $$title_ref = SmartyPants($$title_ref, $smartypants_attr, undef); + $$body_ref = SmartyPants($$body_ref, $smartypants_attr, undef); + 1; +} + + +# Movable Type plug-in interface: +eval {require MT::Template::Context}; # Test to see if we're running in MT. +unless ($@) { + require MT::Template::Context; + import MT::Template::Context; + MT::Template::Context->add_global_filter( smarty_pants => \&SmartyPants); + MT::Template::Context->add_global_filter( smart_quotes => \&SmartQuotes); + MT::Template::Context->add_global_filter( smart_dashes => \&SmartDashes); + MT::Template::Context->add_global_filter( smart_ellipses => \&SmartEllipses); + MT::Template::Context->add_tag( SmartyPantsVersion => \&SmartyPantsVersion); + + # If Markdown is loaded, add a combo Markdown/SmartyPants text filter: + my $filters = MT->all_text_filters(); + if (exists( $filters->{'markdown'} )) { + my $markdown_ref = $filters->{'markdown'}{on_format}; + if ($markdown_ref) { + MT->add_text_filter('markdown_with_smartypants' => { + label => 'Markdown With SmartyPants', + on_format => sub { + my $text = shift; + $text = &$markdown_ref($text); + $text = SmartyPants($text, $smartypants_attr); + }, + docs => 'http://daringfireball.net/projects/markdown/' + }); + } + } +} +else { + # BBEdit text filter interface; needs to be hidden from MT + # (and Blosxom when running in static mode). + + # Set up a do-nothing variable to keep Perl from warning us that + # we're only using $blosxom::version once. The right way to do this + # is to use "no warnings", but that doesn't work in Perl 5.005. + my $in_blosxom = defined($blosxom::version); + + unless ( defined($blosxom::version) ) { + #### Check for command-line switches: ########################### + my %cli_opts; + use Getopt::Long; + Getopt::Long::Configure('pass_through'); + GetOptions(\%cli_opts, + 'version', + 'shortversion', + '1', + '2', + '3', + ); + if ($cli_opts{'version'}) { # Version info + print "\nThis is Markdown, version $VERSION.\n"; + print "Copyright 2004 John Gruber\n"; + print "http://daringfireball.net/projects/markdown/\n"; + exit 0; + } + if ($cli_opts{'shortversion'}) { # Just the version number string. + print $VERSION; + exit 0; + } + if ($cli_opts{'1'}) { $smartypants_attr = 1 }; + if ($cli_opts{'2'}) { $smartypants_attr = 2 }; + if ($cli_opts{'3'}) { $smartypants_attr = 3 }; + + + #### Process incoming text: ##################################### + my $old = $/; + undef $/; # slurp the whole file + my $text = <>; + $/ = $old; + print SmartyPants($text, $smartypants_attr, undef); + } +} + + +sub SmartyPants { + # Paramaters: + my $text = shift; # text to be parsed + my $attr = shift; # value of the smart_quotes="" attribute + my $ctx = shift; # MT context object (unused) + + # Options to specify which transformations to make: + my ($do_quotes, $do_backticks, $do_dashes, $do_ellipses, $do_stupefy); + my $convert_quot = 0; # should we translate " entities into normal quotes? + + # Parse attributes: + # 0 : do nothing + # 1 : set all + # 2 : set all, using old school en- and em- dash shortcuts + # 3 : set all, using inverted old school en and em- dash shortcuts + # + # q : quotes + # b : backtick quotes (``double'' only) + # B : backtick quotes (``double'' and `single') + # d : dashes + # D : old school dashes + # i : inverted old school dashes + # e : ellipses + # w : convert " entities to " for Dreamweaver users + + if ($attr eq "0") { + # Do nothing. + return $text; + } + elsif ($attr eq "1") { + # Do everything, turn all options on. + $do_quotes = 1; + $do_backticks = 1; + $do_dashes = 1; + $do_ellipses = 1; + } + elsif ($attr eq "2") { + # Do everything, turn all options on, use old school dash shorthand. + $do_quotes = 1; + $do_backticks = 1; + $do_dashes = 2; + $do_ellipses = 1; + } + elsif ($attr eq "3") { + # Do everything, turn all options on, use inverted old school dash shorthand. + $do_quotes = 1; + $do_backticks = 1; + $do_dashes = 3; + $do_ellipses = 1; + } + elsif ($attr eq "-1") { + # Special "stupefy" mode. + $do_stupefy = 1; + } + else { + my @chars = split(//, $attr); + foreach my $c (@chars) { + if ($c eq "q") { $do_quotes = 1; } + elsif ($c eq "b") { $do_backticks = 1; } + elsif ($c eq "B") { $do_backticks = 2; } + elsif ($c eq "d") { $do_dashes = 1; } + elsif ($c eq "D") { $do_dashes = 2; } + elsif ($c eq "i") { $do_dashes = 3; } + elsif ($c eq "e") { $do_ellipses = 1; } + elsif ($c eq "w") { $convert_quot = 1; } + else { + # Unknown attribute option, ignore. + } + } + } + + my $tokens ||= _tokenize($text); + my $result = ''; + my $in_pre = 0; # Keep track of when we're inside
     or  tags.
    +
    +    my $prev_token_last_char = "";  # This is a cheat, used to get some context
    +                                    # for one-character tokens that consist of 
    +                                    # just a quote char. What we do is remember
    +                                    # the last character of the previous text
    +                                    # token, to use as context to curl single-
    +                                    # character quote tokens correctly.
    +
    +    foreach my $cur_token (@$tokens) {
    +        if ($cur_token->[0] eq "tag") {
    +            # Don't mess with quotes inside tags.
    +            $result .= $cur_token->[1];
    +            if ($cur_token->[1] =~ m/$tags_to_skip/) {
    +                $in_pre = defined $1 && $1 eq '/' ? 0 : 1;
    +            }
    +        } else {
    +            my $t = $cur_token->[1];
    +            my $last_char = substr($t, -1); # Remember last char of this token before processing.
    +            if (! $in_pre) {
    +                $t = ProcessEscapes($t);
    +
    +                if ($convert_quot) {
    +                    $t =~ s/"/"/g;
    +                }
    +
    +                if ($do_dashes) {
    +                    $t = EducateDashes($t)                  if ($do_dashes == 1);
    +                    $t = EducateDashesOldSchool($t)         if ($do_dashes == 2);
    +                    $t = EducateDashesOldSchoolInverted($t) if ($do_dashes == 3);
    +                }
    +
    +                $t = EducateEllipses($t) if $do_ellipses;
    +
    +                # Note: backticks need to be processed before quotes.
    +                if ($do_backticks) {
    +                    $t = EducateBackticks($t);
    +                    $t = EducateSingleBackticks($t) if ($do_backticks == 2);
    +                }
    +
    +                if ($do_quotes) {
    +                    if ($t eq q/'/) {
    +                        # Special case: single-character ' token
    +                        if ($prev_token_last_char =~ m/\S/) {
    +                            $t = "’";
    +                        }
    +                        else {
    +                            $t = "‘";
    +                        }
    +                    }
    +                    elsif ($t eq q/"/) {
    +                        # Special case: single-character " token
    +                        if ($prev_token_last_char =~ m/\S/) {
    +                            $t = "”";
    +                        }
    +                        else {
    +                            $t = "“";
    +                        }
    +                    }
    +                    else {
    +                        # Normal case:                  
    +                        $t = EducateQuotes($t);
    +                    }
    +                }
    +
    +                $t = StupefyEntities($t) if $do_stupefy;
    +            }
    +            $prev_token_last_char = $last_char;
    +            $result .= $t;
    +        }
    +    }
    +
    +    return $result;
    +}
    +
    +
    +sub SmartQuotes {
    +    # Paramaters:
    +    my $text = shift;   # text to be parsed
    +    my $attr = shift;   # value of the smart_quotes="" attribute
    +    my $ctx  = shift;   # MT context object (unused)
    +
    +    my $do_backticks;   # should we educate ``backticks'' -style quotes?
    +
    +    if ($attr == 0) {
    +        # do nothing;
    +        return $text;
    +    }
    +    elsif ($attr == 2) {
    +        # smarten ``backticks'' -style quotes
    +        $do_backticks = 1;
    +    }
    +    else {
    +        $do_backticks = 0;
    +    }
    +
    +    # Special case to handle quotes at the very end of $text when preceded by
    +    # an HTML tag. Add a space to give the quote education algorithm a bit of
    +    # context, so that it can guess correctly that it's a closing quote:
    +    my $add_extra_space = 0;
    +    if ($text =~ m/>['"]\z/) {
    +        $add_extra_space = 1; # Remember, so we can trim the extra space later.
    +        $text .= " ";
    +    }
    +
    +    my $tokens ||= _tokenize($text);
    +    my $result = '';
    +    my $in_pre = 0;  # Keep track of when we're inside 
     or  tags
    +
    +    my $prev_token_last_char = "";  # This is a cheat, used to get some context
    +                                    # for one-character tokens that consist of 
    +                                    # just a quote char. What we do is remember
    +                                    # the last character of the previous text
    +                                    # token, to use as context to curl single-
    +                                    # character quote tokens correctly.
    +
    +    foreach my $cur_token (@$tokens) {
    +        if ($cur_token->[0] eq "tag") {
    +            # Don't mess with quotes inside tags
    +            $result .= $cur_token->[1];
    +            if ($cur_token->[1] =~ m/$tags_to_skip/) {
    +                $in_pre = defined $1 && $1 eq '/' ? 0 : 1;
    +            }
    +        } else {
    +            my $t = $cur_token->[1];
    +            my $last_char = substr($t, -1); # Remember last char of this token before processing.
    +            if (! $in_pre) {
    +                $t = ProcessEscapes($t);
    +                if ($do_backticks) {
    +                    $t = EducateBackticks($t);
    +                }
    +
    +                if ($t eq q/'/) {
    +                    # Special case: single-character ' token
    +                    if ($prev_token_last_char =~ m/\S/) {
    +                        $t = "’";
    +                    }
    +                    else {
    +                        $t = "‘";
    +                    }
    +                }
    +                elsif ($t eq q/"/) {
    +                    # Special case: single-character " token
    +                    if ($prev_token_last_char =~ m/\S/) {
    +                        $t = "”";
    +                    }
    +                    else {
    +                        $t = "“";
    +                    }
    +                }
    +                else {
    +                    # Normal case:                  
    +                    $t = EducateQuotes($t);
    +                }
    +
    +            }
    +            $prev_token_last_char = $last_char;
    +            $result .= $t;
    +        }
    +    }
    +
    +    if ($add_extra_space) {
    +        $result =~ s/ \z//;  # Trim trailing space if we added one earlier.
    +    }
    +    return $result;
    +}
    +
    +
    +sub SmartDashes {
    +    # Paramaters:
    +    my $text = shift;   # text to be parsed
    +    my $attr = shift;   # value of the smart_dashes="" attribute
    +    my $ctx  = shift;   # MT context object (unused)
    +
    +    # reference to the subroutine to use for dash education, default to EducateDashes:
    +    my $dash_sub_ref = \&EducateDashes;
    +
    +    if ($attr == 0) {
    +        # do nothing;
    +        return $text;
    +    }
    +    elsif ($attr == 2) {
    +        # use old smart dash shortcuts, "--" for en, "---" for em
    +        $dash_sub_ref = \&EducateDashesOldSchool; 
    +    }
    +    elsif ($attr == 3) {
    +        # inverse of 2, "--" for em, "---" for en
    +        $dash_sub_ref = \&EducateDashesOldSchoolInverted; 
    +    }
    +
    +    my $tokens;
    +    $tokens ||= _tokenize($text);
    +
    +    my $result = '';
    +    my $in_pre = 0;  # Keep track of when we're inside 
     or  tags
    +    foreach my $cur_token (@$tokens) {
    +        if ($cur_token->[0] eq "tag") {
    +            # Don't mess with quotes inside tags
    +            $result .= $cur_token->[1];
    +            if ($cur_token->[1] =~ m/$tags_to_skip/) {
    +                $in_pre = defined $1 && $1 eq '/' ? 0 : 1;
    +            }
    +        } else {
    +            my $t = $cur_token->[1];
    +            if (! $in_pre) {
    +                $t = ProcessEscapes($t);
    +                $t = $dash_sub_ref->($t);
    +            }
    +            $result .= $t;
    +        }
    +    }
    +    return $result;
    +}
    +
    +
    +sub SmartEllipses {
    +    # Paramaters:
    +    my $text = shift;   # text to be parsed
    +    my $attr = shift;   # value of the smart_ellipses="" attribute
    +    my $ctx  = shift;   # MT context object (unused)
    +
    +    if ($attr == 0) {
    +        # do nothing;
    +        return $text;
    +    }
    +
    +    my $tokens;
    +    $tokens ||= _tokenize($text);
    +
    +    my $result = '';
    +    my $in_pre = 0;  # Keep track of when we're inside 
     or  tags
    +    foreach my $cur_token (@$tokens) {
    +        if ($cur_token->[0] eq "tag") {
    +            # Don't mess with quotes inside tags
    +            $result .= $cur_token->[1];
    +            if ($cur_token->[1] =~ m/$tags_to_skip/) {
    +                $in_pre = defined $1 && $1 eq '/' ? 0 : 1;
    +            }
    +        } else {
    +            my $t = $cur_token->[1];
    +            if (! $in_pre) {
    +                $t = ProcessEscapes($t);
    +                $t = EducateEllipses($t);
    +            }
    +            $result .= $t;
    +        }
    +    }
    +    return $result;
    +}
    +
    +
    +sub EducateQuotes {
    +#
    +#   Parameter:  String.
    +#
    +#   Returns:    The string, with "educated" curly quote HTML entities.
    +#
    +#   Example input:  "Isn't this fun?"
    +#   Example output: “Isn’t this fun?”
    +#
    +
    +    local $_ = shift;
    +
    +    # Tell perl not to gripe when we use $1 in substitutions,
    +    # even when it's undefined. Use $^W instead of "no warnings"
    +    # for compatibility with Perl 5.005:
    +    local $^W = 0;
    +
    +
    +    # Make our own "punctuation" character class, because the POSIX-style
    +    # [:PUNCT:] is only available in Perl 5.6 or later:
    +    my $punct_class = qr/[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]/;
    +
    +    # Special case if the very first character is a quote
    +    # followed by punctuation at a non-word-break. Close the quotes by brute force:
    +    s/^'(?=$punct_class\B)/’/;
    +    s/^"(?=$punct_class\B)/”/;
    +
    +
    +    # Special case for double sets of quotes, e.g.:
    +    #   

    He said, "'Quoted' words in a larger quote."

    + s/"'(?=\w)/“‘/g; + s/'"(?=\w)/‘“/g; + + # Special case for decade abbreviations (the '80s): + s/'(?=\d{2}s)/’/g; + + my $close_class = qr![^\ \t\r\n\[\{\(\-]!; + my $dec_dashes = qr/–|—/; + + # Get most opening single quotes: + s { + ( + \s | # a whitespace char, or +   | # a non-breaking space entity, or + -- | # dashes, or + &[mn]dash; | # named dash entities + $dec_dashes | # or decimal entities + &\#x201[34]; # or hex + ) + ' # the quote + (?=\w) # followed by a word character + } {$1‘}xg; + # Single closing quotes: + s { + ($close_class)? + ' + (?(1)| # If $1 captured, then do nothing; + (?=\s | s\b) # otherwise, positive lookahead for a whitespace + ) # char or an 's' at a word ending position. This + # is a special case to handle something like: + # "Custer's Last Stand." + } {$1’}xgi; + + # Any remaining single quotes should be opening ones: + s/'/‘/g; + + + # Get most opening double quotes: + s { + ( + \s | # a whitespace char, or +   | # a non-breaking space entity, or + -- | # dashes, or + &[mn]dash; | # named dash entities + $dec_dashes | # or decimal entities + &\#x201[34]; # or hex + ) + " # the quote + (?=\w) # followed by a word character + } {$1“}xg; + + # Double closing quotes: + s { + ($close_class)? + " + (?(1)|(?=\s)) # If $1 captured, then do nothing; + # if not, then make sure the next char is whitespace. + } {$1”}xg; + + # Any remaining quotes should be opening ones. + s/"/“/g; + + return $_; +} + + +sub EducateBackticks { +# +# Parameter: String. +# Returns: The string, with ``backticks'' -style double quotes +# translated into HTML curly quote entities. +# +# Example input: ``Isn't this fun?'' +# Example output: “Isn't this fun?” +# + + local $_ = shift; + s/``/“/g; + s/''/”/g; + return $_; +} + + +sub EducateSingleBackticks { +# +# Parameter: String. +# Returns: The string, with `backticks' -style single quotes +# translated into HTML curly quote entities. +# +# Example input: `Isn't this fun?' +# Example output: ‘Isn’t this fun?’ +# + + local $_ = shift; + s/`/‘/g; + s/'/’/g; + return $_; +} + + +sub EducateDashes { +# +# Parameter: String. +# +# Returns: The string, with each instance of "--" translated to +# an em-dash HTML entity. +# + + local $_ = shift; + s/--/—/g; + return $_; +} + + +sub EducateDashesOldSchool { +# +# Parameter: String. +# +# Returns: The string, with each instance of "--" translated to +# an en-dash HTML entity, and each "---" translated to +# an em-dash HTML entity. +# + + local $_ = shift; + s/---/—/g; # em + s/--/–/g; # en + return $_; +} + + +sub EducateDashesOldSchoolInverted { +# +# Parameter: String. +# +# Returns: The string, with each instance of "--" translated to +# an em-dash HTML entity, and each "---" translated to +# an en-dash HTML entity. Two reasons why: First, unlike the +# en- and em-dash syntax supported by +# EducateDashesOldSchool(), it's compatible with existing +# entries written before SmartyPants 1.1, back when "--" was +# only used for em-dashes. Second, em-dashes are more +# common than en-dashes, and so it sort of makes sense that +# the shortcut should be shorter to type. (Thanks to Aaron +# Swartz for the idea.) +# + + local $_ = shift; + s/---/–/g; # en + s/--/—/g; # em + return $_; +} + + +sub EducateEllipses { +# +# Parameter: String. +# Returns: The string, with each instance of "..." translated to +# an ellipsis HTML entity. Also converts the case where +# there are spaces between the dots. +# +# Example input: Huh...? +# Example output: Huh…? +# + + local $_ = shift; + s/\.\.\./…/g; + s/\. \. \./…/g; + return $_; +} + + +sub StupefyEntities { +# +# Parameter: String. +# Returns: The string, with each SmartyPants HTML entity translated to +# its ASCII counterpart. +# +# Example input: “Hello — world.” +# Example output: "Hello -- world." +# + + local $_ = shift; + + s/–/-/g; # en-dash + s/—/--/g; # em-dash + + s/‘/'/g; # open single quote + s/’/'/g; # close single quote + + s/“/"/g; # open double quote + s/”/"/g; # close double quote + + s/…/.../g; # ellipsis + + return $_; +} + + +sub SmartyPantsVersion { + return $VERSION; +} + + +sub ProcessEscapes { +# +# Parameter: String. +# Returns: The string, with after processing the following backslash +# escape sequences. This is useful if you want to force a "dumb" +# quote or other character to appear. +# +# Escape Value +# ------ ----- +# \\ \ +# \" " +# \' ' +# \. . +# \- - +# \` ` +# + local $_ = shift; + + s! \\\\ !\!gx; + s! \\" !"!gx; + s! \\' !'!gx; + s! \\\. !.!gx; + s! \\- !-!gx; + s! \\` !`!gx; + + return $_; +} + + +sub _tokenize { +# +# Parameter: String containing HTML markup. +# Returns: Reference to an array of the tokens comprising the input +# string. Each token is either a tag (possibly with nested, +# tags contained therein, such as , or a +# run of text between tags. Each element of the array is a +# two-element array; the first is either 'tag' or 'text'; +# the second is the actual value. +# +# +# Based on the _tokenize() subroutine from Brad Choate's MTRegex plugin. +# +# + + my $str = shift; + my $pos = 0; + my $len = length $str; + my @tokens; + + my $depth = 6; + my $nested_tags = join('|', ('(?:<(?:[^<>]') x $depth) . (')*>)' x $depth); + my $match = qr/(?s: ) | # comment + (?s: <\? .*? \?> ) | # processing instruction + $nested_tags/x; # nested tags + + while ($str =~ m/($match)/g) { + my $whole_tag = $1; + my $sec_start = pos $str; + my $tag_start = $sec_start - length $whole_tag; + if ($pos < $tag_start) { + push @tokens, ['text', substr($str, $pos, $tag_start - $pos)]; + } + push @tokens, ['tag', $whole_tag]; + $pos = pos $str; + } + push @tokens, ['text', substr($str, $pos, $len - $pos)] if $pos < $len; + \@tokens; +} + + +1; +__END__ + + +=pod + +=head1 NAME + +B + + +=head1 SYNOPSIS + +B [ B<-1> ] [ B<-2> ] [ B<-3> ] [ B<--version> ] [ B<--shortversion> ] + [ I ... ] + + +=head1 DESCRIPTION + +SmartyPants is a web publishing utility that translates plain ASCII +punctuation characters into "smart" typographic punctuation HTML +entities. SmartyPants can perform the following transformations: + +=over 4 + +=item * + +Straight quotes ( " and ' ) into "curly" quote HTML entities + +=item * + +Backticks-style quotes (``like this'') into "curly" quote HTML entities + +=item * + +Dashes (C<--> and C<--->) into en- and em-dash entities + +=item * + +Three consecutive dots (C<...>) into an ellipsis entity + +=back + +SmartyPants is a combination plug-in -- the same file works with Movable +Type, Blosxom, BBEdit, and as a standalone Perl script. Version +requirements and installation instructions for each of these tools can +be found in the readme file that accompanies this script. + +SmartyPants does not modify characters within C<<
     >>, C<<  >>,
    +C<<  >>, C<<