├── .all-contributorsrc
├── .gitignore
├── CODE_OF_CONDUCT.md
├── LICENSE
├── Podfile
├── Podfile.lock
├── Popup
├── AppDelegate.swift
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── icon_128@1x.png
│ │ ├── icon_128@2x.png
│ │ ├── icon_16@1x.png
│ │ ├── icon_16@2x.png
│ │ ├── icon_256@1x.png
│ │ ├── icon_256@2x.png
│ │ ├── icon_32@1x.png
│ │ ├── icon_32@2x.png
│ │ ├── icon_512@1x.png
│ │ └── icon_512@2x.png
│ ├── Contents.json
│ ├── StatusBarButtonImage.imageset
│ │ ├── Contents.json
│ │ └── icon.png
│ └── nodejsLogo.imageset
│ │ ├── 1436439824nodejs-logo1.png
│ │ └── Contents.json
├── Base.lproj
│ └── Main.storyboard
├── EventMonitor.swift
├── Info.plist
├── LineNumberRulerView.swift
└── ViewController.swift
├── README.md
├── images
└── scratchpad.gif
├── nodeScratchpad.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ └── contents.xcworkspacedata
└── nodeScratchpad.xcworkspace
├── contents.xcworkspacedata
└── xcshareddata
└── IDEWorkspaceChecks.plist
/.all-contributorsrc:
--------------------------------------------------------------------------------
1 | {
2 | "projectName": "nodeScratchpad",
3 | "projectOwner": "vsaravind007",
4 | "repoType": "github",
5 | "repoHost": "https://github.com",
6 | "files": [
7 | "README.md"
8 | ],
9 | "imageSize": 100,
10 | "commit": true,
11 | "contributors": [
12 | {
13 | "login": "arjunkomath",
14 | "name": "Arjun Komath",
15 | "avatar_url": "https://avatars0.githubusercontent.com/u/2555067?v=4",
16 | "profile": "http://techulus.in",
17 | "contributions": [
18 | "code"
19 | ]
20 | },
21 | {
22 | "login": "sudeepngeorge",
23 | "name": "sudeepngeorge",
24 | "avatar_url": "https://avatars3.githubusercontent.com/u/15260297?v=4",
25 | "profile": "https://github.com/sudeepngeorge",
26 | "contributions": [
27 | "code"
28 | ]
29 | },
30 | {
31 | "login": "vsaravind007",
32 | "name": "Aravind Vijayan",
33 | "avatar_url": "https://avatars0.githubusercontent.com/u/1938082?v=4",
34 | "profile": "http://www.aravindvs.com",
35 | "contributions": [
36 | "code",
37 | "doc"
38 | ]
39 | }
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # General
2 | .DS_Store
3 | .AppleDouble
4 | .LSOverride
5 |
6 | # Icon must end with two \r
7 | Icon
8 |
9 |
10 | # Thumbnails
11 | ._*
12 |
13 | # Files that might appear in the root of a volume
14 | .DocumentRevisions-V100
15 | .fseventsd
16 | .Spotlight-V100
17 | .TemporaryItems
18 | .Trashes
19 | .VolumeIcon.icns
20 | .com.apple.timemachine.donotpresent
21 |
22 | # Directories potentially created on remote AFP share
23 | .AppleDB
24 | .AppleDesktop
25 | Network Trash Folder
26 | Temporary Items
27 | .apdisk
28 |
29 | # OS X
30 | .DS_Store
31 |
32 | # Xcode
33 | build/
34 | *.pbxuser
35 | !default.pbxuser
36 | *.mode1v3
37 | !default.mode1v3
38 | *.mode2v3
39 | !default.mode2v3
40 | *.perspectivev3
41 | !default.perspectivev3
42 | xcuserdata/
43 | *.xccheckout
44 | profile
45 | *.moved-aside
46 | DerivedData
47 | *.hmap
48 | *.ipa
49 |
50 | # Bundler
51 | .bundle
52 |
53 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
54 | # Carthage/Checkouts
55 |
56 | Carthage/Build
57 |
58 | # We recommend against adding the Pods directory to your .gitignore. However
59 | # you should judge for yourself, the pros and cons are mentioned at:
60 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
61 | #
62 | # Note: if you ignore the Pods directory, make sure to uncomment
63 | # `pod install` in .travis.yml
64 | #
65 | Pods/
66 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at vsaravind007@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Aravind Vijayan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | target 'nodeScratchpad' do
5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
6 | use_frameworks!
7 |
8 | # Pods for nodeScratchpad
9 | pod 'Highlightr'
10 |
11 | end
12 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Highlightr (2.0.0)
3 |
4 | DEPENDENCIES:
5 | - Highlightr
6 |
7 | SPEC CHECKSUMS:
8 | Highlightr: e68a91ed9067ef0a787b920dd9becbd9935c2b79
9 |
10 | PODFILE CHECKSUM: 15139e38aac3dd7d4f824d7595274549bcea0925
11 |
12 | COCOAPODS: 1.4.0
13 |
--------------------------------------------------------------------------------
/Popup/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Nodejs Scratchpad
4 | //
5 | // Created by Aravind on 06/12/17.
6 | // Copyright © 2017 ARAVIND VS. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate {
13 |
14 | let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength)
15 | let popover = NSPopover()
16 | var eventMonitor: EventMonitor?
17 |
18 | func applicationDidFinishLaunching(_ aNotification: Notification) {
19 |
20 | if let button = statusItem.button {
21 | button.image = NSImage(named: NSImage.Name(rawValue: "StatusBarButtonImage"))
22 | button.action = #selector(AppDelegate.togglePopover(_:))
23 | }
24 |
25 | let mainViewController = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil).instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "ViewControllerId")) as! ViewController
26 |
27 | popover.contentViewController = mainViewController
28 |
29 | eventMonitor = EventMonitor(mask: [NSEvent.EventTypeMask.leftMouseDown, NSEvent.EventTypeMask.rightMouseDown]) { [weak self] event in
30 | if let popover = self?.popover {
31 | if popover.isShown {
32 | self?.closePopover(event)
33 | }
34 | }
35 | }
36 | eventMonitor?.start()
37 | }
38 |
39 | func applicationWillTerminate(_ aNotification: Notification) {
40 | }
41 |
42 | @objc func togglePopover(_ sender: AnyObject?) {
43 | if popover.isShown {
44 | closePopover(sender)
45 | } else {
46 | showPopover(sender)
47 | }
48 | }
49 |
50 | func showPopover(_ sender: AnyObject?) {
51 | if let button = statusItem.button {
52 | popover.show(relativeTo: button.bounds, of: button, preferredEdge: NSRectEdge.minY)
53 | eventMonitor?.start()
54 | }
55 | }
56 |
57 | func closePopover(_ sender: AnyObject?) {
58 | popover.performClose(sender)
59 | eventMonitor?.stop()
60 | }
61 |
62 | }
63 |
64 |
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {"images":[{"idiom":"mac","size":"16x16","scale":"1x","filename":"icon_16@1x.png"},{"idiom":"mac","size":"16x16","scale":"2x","filename":"icon_16@2x.png"},{"idiom":"mac","size":"32x32","scale":"1x","filename":"icon_32@1x.png"},{"idiom":"mac","size":"32x32","scale":"2x","filename":"icon_32@2x.png"},{"idiom":"mac","size":"128x128","scale":"1x","filename":"icon_128@1x.png"},{"idiom":"mac","size":"128x128","scale":"2x","filename":"icon_128@2x.png"},{"idiom":"mac","size":"256x256","scale":"1x","filename":"icon_256@1x.png"},{"idiom":"mac","size":"256x256","scale":"2x","filename":"icon_256@2x.png"},{"idiom":"mac","size":"512x512","scale":"1x","filename":"icon_512@1x.png"},{"idiom":"mac","size":"512x512","scale":"2x","filename":"icon_512@2x.png"}],"info":{"version":1,"author":"xcode"}}
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/icon_128@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/AppIcon.appiconset/icon_128@1x.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/icon_128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/AppIcon.appiconset/icon_128@2x.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/icon_16@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/AppIcon.appiconset/icon_16@1x.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/icon_16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/AppIcon.appiconset/icon_16@2x.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/icon_256@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/AppIcon.appiconset/icon_256@1x.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/icon_256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/AppIcon.appiconset/icon_256@2x.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/icon_32@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/AppIcon.appiconset/icon_32@1x.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/icon_32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/AppIcon.appiconset/icon_32@2x.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/icon_512@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/AppIcon.appiconset/icon_512@1x.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/AppIcon.appiconset/icon_512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/AppIcon.appiconset/icon_512@2x.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/StatusBarButtonImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac"
5 | },
6 | {
7 | "idiom" : "mac",
8 | "scale" : "1x"
9 | },
10 | {
11 | "idiom" : "mac",
12 | "filename" : "icon.png",
13 | "scale" : "2x"
14 | }
15 | ],
16 | "info" : {
17 | "version" : 1,
18 | "author" : "xcode"
19 | },
20 | "properties" : {
21 | "template-rendering-intent" : "template"
22 | }
23 | }
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/StatusBarButtonImage.imageset/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/StatusBarButtonImage.imageset/icon.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/nodejsLogo.imageset/1436439824nodejs-logo1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/Popup/Assets.xcassets/nodejsLogo.imageset/1436439824nodejs-logo1.png
--------------------------------------------------------------------------------
/Popup/Assets.xcassets/nodejsLogo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "1436439824nodejs-logo1.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Popup/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
747 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
--------------------------------------------------------------------------------
/Popup/EventMonitor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // EventMonitor.swift
3 | // Nodejs Scratchpad
4 | //
5 | // Created by Aravind on 06/12/17.
6 | // Copyright © 2017 ARAVIND VS. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | open class EventMonitor {
12 |
13 | fileprivate var monitor: AnyObject?
14 | fileprivate let mask: NSEvent.EventTypeMask
15 | fileprivate let handler: (NSEvent?) -> ()
16 |
17 | public init(mask: NSEvent.EventTypeMask, handler: @escaping (NSEvent?) -> ()) {
18 | self.mask = mask
19 | self.handler = handler
20 | }
21 |
22 | deinit {
23 | stop()
24 | }
25 |
26 | open func start() {
27 | monitor = NSEvent.addGlobalMonitorForEvents(matching: mask, handler: handler) as AnyObject?
28 | }
29 |
30 | open func stop() {
31 | if monitor != nil {
32 | NSEvent.removeMonitor(monitor!)
33 | monitor = nil
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Popup/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.1
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | LSUIElement
28 |
29 | NSHumanReadableCopyright
30 | Copyright © 2018 Aravind VS. All rights reserved.
31 | NSMainStoryboardFile
32 | Main
33 | NSPrincipalClass
34 | NSApplication
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Popup/LineNumberRulerView.swift:
--------------------------------------------------------------------------------
1 | import AppKit
2 | import Foundation
3 | import ObjectiveC
4 |
5 | var LineNumberViewAssocObjKey: UInt8 = 0
6 |
7 | extension NSTextView {
8 | var lineNumberView:LineNumberRulerView {
9 | get {
10 | return objc_getAssociatedObject(self, &LineNumberViewAssocObjKey) as! LineNumberRulerView
11 | }
12 | set {
13 | objc_setAssociatedObject(self, &LineNumberViewAssocObjKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
14 | }
15 | }
16 |
17 | func lnv_setUpLineNumberView() {
18 | if font == nil {
19 | font = NSFont.systemFont(ofSize: 16)
20 | }
21 |
22 | if let scrollView = enclosingScrollView {
23 | lineNumberView = LineNumberRulerView(textView: self)
24 |
25 | scrollView.verticalRulerView = lineNumberView
26 | scrollView.hasVerticalRuler = true
27 | scrollView.rulersVisible = true
28 | }
29 |
30 | postsFrameChangedNotifications = true
31 | NotificationCenter.default.addObserver(self, selector: #selector(lnv_framDidChange), name: NSView.frameDidChangeNotification, object: self)
32 |
33 | NotificationCenter.default.addObserver(self, selector: #selector(lnv_textDidChange), name: NSText.didChangeNotification, object: self)
34 | }
35 |
36 | @objc func lnv_framDidChange(notification: NSNotification) {
37 |
38 | lineNumberView.needsDisplay = true
39 | }
40 |
41 | @objc func lnv_textDidChange(notification: NSNotification) {
42 |
43 | lineNumberView.needsDisplay = true
44 | }
45 | }
46 |
47 | class LineNumberRulerView: NSRulerView {
48 |
49 | var font: NSFont! {
50 | didSet {
51 | self.needsDisplay = true
52 | }
53 | }
54 |
55 | init(textView: NSTextView) {
56 | super.init(scrollView: textView.enclosingScrollView!, orientation: NSRulerView.Orientation.verticalRuler)
57 | self.font = textView.font ?? NSFont.systemFont(ofSize: NSFont.smallSystemFontSize)
58 | self.clientView = textView
59 | //Width of ruler
60 | self.ruleThickness = 20
61 | }
62 |
63 | required init(coder: NSCoder) {
64 | fatalError("init(coder:) has not been implemented")
65 | }
66 |
67 |
68 | override func drawHashMarksAndLabels(in rect: NSRect) {
69 |
70 | if let textView = self.clientView as? NSTextView {
71 | if let layoutManager = textView.layoutManager {
72 |
73 | let relativePoint = self.convert(NSZeroPoint, from: textView)
74 | let lineNumberAttributes = [NSAttributedStringKey.font: textView.font!, NSAttributedStringKey.foregroundColor: NSColor.gray] as [NSAttributedStringKey : Any]
75 |
76 | let drawLineNumber = { (lineNumberString:String, y:CGFloat) -> Void in
77 | let attString = NSAttributedString(string: lineNumberString, attributes: lineNumberAttributes)
78 | //Margin of ruler on left
79 | let x = 15 - attString.size().width
80 | attString.draw(at: NSPoint(x: x, y: relativePoint.y + y))
81 | }
82 |
83 | let visibleGlyphRange = layoutManager.glyphRange(forBoundingRect: textView.visibleRect, in: textView.textContainer!)
84 | let firstVisibleGlyphCharacterIndex = layoutManager.characterIndexForGlyph(at: visibleGlyphRange.location)
85 |
86 | let newLineRegex = try! NSRegularExpression(pattern: "\n", options: [])
87 | // The line number for the first visible line
88 | var lineNumber = newLineRegex.numberOfMatches(in: textView.string, options: [], range: NSMakeRange(0, firstVisibleGlyphCharacterIndex)) + 1
89 |
90 | var glyphIndexForStringLine = visibleGlyphRange.location
91 |
92 | // Go through each line in the string.
93 | while glyphIndexForStringLine < NSMaxRange(visibleGlyphRange) {
94 |
95 | // Range of current line in the string.
96 | let characterRangeForStringLine = (textView.string as NSString).lineRange(
97 | for: NSMakeRange( layoutManager.characterIndexForGlyph(at: glyphIndexForStringLine), 0 )
98 | )
99 | let glyphRangeForStringLine = layoutManager.glyphRange(forCharacterRange: characterRangeForStringLine, actualCharacterRange: nil)
100 |
101 | var glyphIndexForGlyphLine = glyphIndexForStringLine
102 | var glyphLineCount = 0
103 |
104 | while ( glyphIndexForGlyphLine < NSMaxRange(glyphRangeForStringLine) ) {
105 |
106 | // See if the current line in the string spread across
107 | // several lines of glyphs
108 | var effectiveRange = NSMakeRange(0, 0)
109 |
110 | // Range of current "line of glyphs". If a line is wrapped,
111 | // then it will have more than one "line of glyphs"
112 | let lineRect = layoutManager.lineFragmentRect(forGlyphAt: glyphIndexForGlyphLine, effectiveRange: &effectiveRange, withoutAdditionalLayout: true)
113 |
114 | if glyphLineCount > 0 {
115 | drawLineNumber("-", lineRect.minY)
116 | } else {
117 | drawLineNumber("\(lineNumber)", lineRect.minY)
118 | }
119 |
120 | // Move to next glyph line
121 | glyphLineCount += 1
122 | glyphIndexForGlyphLine = NSMaxRange(effectiveRange)
123 | }
124 |
125 | glyphIndexForStringLine = NSMaxRange(glyphRangeForStringLine)
126 | lineNumber += 1
127 | }
128 |
129 | // Draw line number for the extra line at the end of the text
130 | if layoutManager.extraLineFragmentTextContainer != nil {
131 | drawLineNumber("\(lineNumber)", layoutManager.extraLineFragmentRect.minY)
132 | }
133 | }
134 | }
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/Popup/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // Nodejs Scratchpad
4 | //
5 | // Created by Aravind on 06/12/17.
6 | // Copyright © 2017 ARAVIND VS. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 | import Foundation
11 | import JavaScriptCore
12 | import Highlightr
13 |
14 | class ViewController: NSViewController {
15 | @IBOutlet weak var runCodeButton: NSButton!
16 | @IBOutlet var outputView: NSTextView!
17 | @IBOutlet weak var statusText: NSTextField!
18 | @IBOutlet weak var codeView : NSTextView!
19 | @IBOutlet weak var clipView: NSClipView!
20 |
21 | var codeIsRunning: Bool = false
22 | var currentTask: Process!
23 | var dataObserver : NSObjectProtocol? = nil
24 | var outputPipe:Pipe? = nil
25 | var errpipe:Pipe? = nil
26 | let textStorage = CodeAttributedString()
27 |
28 | override func viewDidLoad() {
29 | super.viewDidLoad();
30 | // Highlighter
31 | textStorage.language = "javascript"
32 | textStorage.highlightr.setTheme(to: "github")
33 | textStorage.highlightr.theme.codeFont = NSFont(name: "Courier", size: 14)
34 | textStorage.addLayoutManager(codeView.layoutManager!)
35 | codeView.backgroundColor = (textStorage.highlightr.theme.themeBackgroundColor)!
36 | codeView.insertionPointColor = NSColor.black
37 | codeView.isAutomaticQuoteSubstitutionEnabled = false
38 | codeView.enabledTextCheckingTypes = 0
39 | codeView.lnv_setUpLineNumberView();
40 | }
41 |
42 | func runInJsCore(cmd: String) -> (output: String?, error: String){
43 | let context = JSContext()!
44 | context.evaluateScript("var console = { log: function(message) { _consoleLog(message) } }")
45 | let consoleLog: @convention(block) (String) -> Void = { message in
46 | print("console.log: " + message)
47 | }
48 | context.setObject(unsafeBitCast(consoleLog, to: AnyObject.self), forKeyedSubscript: "_consoleLog" as (NSCopying & NSObjectProtocol)!)
49 | let tripleNum = context.evaluateScript(cmd)
50 | return(tripleNum!.toString(),"No error");
51 | }
52 |
53 | func captureStandardOutputAndRouteToTextView(_ task:Process) {
54 | outputPipe = Pipe()
55 | task.standardOutput = outputPipe
56 | errpipe = Pipe()
57 | task.standardError = errpipe
58 | outputPipe?.fileHandleForReading.waitForDataInBackgroundAndNotify()
59 | dataObserver = NotificationCenter.default.addObserver(forName: NSNotification.Name.NSFileHandleDataAvailable, object: outputPipe?.fileHandleForReading , queue: nil) {
60 | notification in
61 | if let data = self.outputPipe?.fileHandleForReading.availableData {
62 | DispatchQueue.main.async {
63 | if let outputString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) {
64 | let previousOutput = self.outputView.string
65 | let nextOutput = previousOutput + "\n" + (outputString as String)
66 | if (!nextOutput.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).isEmpty) {
67 | self.outputView.string = nextOutput
68 | print("NEXT OP" + self.outputView.string)
69 | let range = NSRange(location:nextOutput.count,length:0)
70 | self.outputView.scrollRangeToVisible(range)
71 | }
72 | }
73 | }
74 | self.outputPipe?.fileHandleForReading.waitForDataInBackgroundAndNotify()
75 | }
76 | }
77 | }
78 |
79 | private func stringFromFileAndClose(file: FileHandle?) -> String? {
80 | if let data = file?.readDataToEndOfFile() {
81 | file?.closeFile()
82 | let output = String(data: data, encoding: String.Encoding.utf8)
83 | return output
84 | }
85 | return nil
86 | }
87 |
88 | func removeObservers() {
89 | if (dataObserver != nil) {
90 | NotificationCenter.default.removeObserver(dataObserver!)
91 | }
92 | }
93 |
94 | func updateStatus (buttonText: String, statusText: String){
95 | DispatchQueue.main.async( execute: {
96 | self.runCodeButton.title = buttonText
97 | self.statusText.stringValue = statusText
98 | })
99 | }
100 |
101 | func runCommand(view: NSTextView,cmd : String, args : String...) {
102 | let taskQueue = DispatchQueue.global(qos: DispatchQoS.QoSClass.background)
103 | //2.
104 | taskQueue.async {
105 | if(self.codeIsRunning){
106 | self.currentTask.terminate();
107 | self.updateStatus(buttonText: "Run (⌘+R)",statusText: "Idle");
108 | self.codeIsRunning = false
109 | print("runCommand -async -return ")
110 |
111 | return
112 | }
113 | let task = Process()
114 | self.currentTask = task;
115 | task.qualityOfService = QualityOfService.userInteractive
116 | task.launchPath = cmd
117 | task.arguments = args
118 | self.captureStandardOutputAndRouteToTextView(task)
119 | self.codeIsRunning = true;
120 | task.launch()
121 | task.waitUntilExit()
122 | let errorFile = self.errpipe?.fileHandleForReading
123 | if let errorString = self.stringFromFileAndClose(file: errorFile) {
124 | DispatchQueue.main.async(execute: {
125 | //Check if error string is empty
126 | //By default, every Process task returns and empty error string.
127 | if !errorString.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).isEmpty {
128 | self.outputView.string = errorString
129 | print(errorString)
130 | let range = NSRange(location:errorString.count,length:0)
131 | self.outputView.scrollRangeToVisible(range)
132 | }
133 | })
134 |
135 | }
136 | self.codeIsRunning = false;
137 | self.updateStatus(buttonText: "Run (⌘+R)",statusText: "Idle");
138 | }
139 | }
140 | @IBAction func openGit(_ sender: Any) {
141 | if let url = URL.init(string: "https://github.com/vsaravind007/nodeScratchpad") {
142 | NSWorkspace.shared.open(url);
143 | }
144 | }
145 |
146 | @IBAction func closeButtonAction(_ sender: NSButton) {
147 | NSApp.terminate(self)
148 | }
149 |
150 | @IBAction func runCode(_ sender: NSButton) {
151 | DispatchQueue.main.async {
152 | self.outputView.string = "";
153 | print("output set to empty string")
154 | self.updateStatus(buttonText: "Stop",statusText: "Evaluating...")
155 | var code: String = "";
156 | code = self.codeView.textStorage?.string ?? "";
157 | self.runCommand(view:self.outputView,cmd: "/usr/local/bin/node", args: "-e",code);
158 | }
159 | }
160 |
161 | }
162 |
163 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # nodeScratchpad
3 | Evaluate Nodejs Code Snippets From Menubar, pure native implementation, no crossplatform bullsh*t! :computer:
4 |
5 | Now with syntax highlighting! :tada:
6 |
7 | 
8 |
9 | ## Installation
10 |
11 | - Make sure you have Nodejs installed & is added to path
12 | - Download the latest DMG from the [releases page](https://github.com/vsaravind007/nodeScratchpad/releases)
13 | - Mount the DMG & drag nodeScratchpad.app to your Applications Folder
14 | - Profit!
15 |
16 | You might get a warning saying the app is from an unidentified developer, you probably know how to fix it, else GIYF! :smile:
17 |
18 | ## Issues
19 | You can create issues on the github project repo & they'll be addressed. Please make sure you give us the maximum possible information, so that we can fix up issues quickly.
20 |
21 | ## Roadmap
22 |
23 | - Keep the project as simple as possible!
24 | - Support project directory
25 | - Configuration management
26 | - Inspect options
27 |
28 | ## Contributors
29 |
30 | Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
31 |
32 |
33 |
34 | | [
Arjun Komath](http://techulus.in)
[💻](https://github.com/vsaravind007/nodeScratchpad/commits?author=arjunkomath "Code") | [
sudeepngeorge](https://github.com/sudeepngeorge)
[💻](https://github.com/vsaravind007/nodeScratchpad/commits?author=sudeepngeorge "Code") | [
Aravind Vijayan](http://www.aravindvs.com)
[💻](https://github.com/vsaravind007/nodeScratchpad/commits?author=vsaravind007 "Code") [📖](https://github.com/vsaravind007/nodeScratchpad/commits?author=vsaravind007 "Documentation") |
35 | | :---: | :---: | :---: |
36 |
37 |
38 | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
39 |
--------------------------------------------------------------------------------
/images/scratchpad.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vsaravind007/nodeScratchpad/ad1ae63b00248e5097f457ff3cd2d8dfb5cca2fe/images/scratchpad.gif
--------------------------------------------------------------------------------
/nodeScratchpad.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 901D49CD4658A2C306E60ED2 /* Pods_nodeScratchpad.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABA67BD1A364E3031BED415 /* Pods_nodeScratchpad.framework */; };
11 | 94E0FC3F1BD7FC3600A3C537 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E0FC3E1BD7FC3600A3C537 /* AppDelegate.swift */; };
12 | 94E0FC411BD7FC3600A3C537 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E0FC401BD7FC3600A3C537 /* ViewController.swift */; };
13 | 94E0FC431BD7FC3600A3C537 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 94E0FC421BD7FC3600A3C537 /* Assets.xcassets */; };
14 | 94E0FC461BD7FC3600A3C537 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 94E0FC441BD7FC3600A3C537 /* Main.storyboard */; };
15 | 94E0FC4E1BD7FCBE00A3C537 /* EventMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E0FC4D1BD7FCBE00A3C537 /* EventMonitor.swift */; };
16 | F23E6B5C1FD8F8D400478811 /* LineNumberRulerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F23E6B5B1FD8F8D400478811 /* LineNumberRulerView.swift */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXFileReference section */
20 | 2ABA67BD1A364E3031BED415 /* Pods_nodeScratchpad.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_nodeScratchpad.framework; sourceTree = BUILT_PRODUCTS_DIR; };
21 | 94E0FC3B1BD7FC3600A3C537 /* nodeScratchpad.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = nodeScratchpad.app; sourceTree = BUILT_PRODUCTS_DIR; };
22 | 94E0FC3E1BD7FC3600A3C537 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
23 | 94E0FC401BD7FC3600A3C537 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
24 | 94E0FC421BD7FC3600A3C537 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
25 | 94E0FC451BD7FC3600A3C537 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
26 | 94E0FC471BD7FC3600A3C537 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
27 | 94E0FC4D1BD7FCBE00A3C537 /* EventMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventMonitor.swift; sourceTree = ""; };
28 | D20675C329CCAB4A8848C5DB /* Pods-nodeScratchpad.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-nodeScratchpad.debug.xcconfig"; path = "Pods/Target Support Files/Pods-nodeScratchpad/Pods-nodeScratchpad.debug.xcconfig"; sourceTree = ""; };
29 | ED8D797006F8EBAE0B83661D /* Pods-nodeScratchpad.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-nodeScratchpad.release.xcconfig"; path = "Pods/Target Support Files/Pods-nodeScratchpad/Pods-nodeScratchpad.release.xcconfig"; sourceTree = ""; };
30 | F23E6B5B1FD8F8D400478811 /* LineNumberRulerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LineNumberRulerView.swift; sourceTree = ""; };
31 | /* End PBXFileReference section */
32 |
33 | /* Begin PBXFrameworksBuildPhase section */
34 | 94E0FC381BD7FC3600A3C537 /* Frameworks */ = {
35 | isa = PBXFrameworksBuildPhase;
36 | buildActionMask = 2147483647;
37 | files = (
38 | 901D49CD4658A2C306E60ED2 /* Pods_nodeScratchpad.framework in Frameworks */,
39 | );
40 | runOnlyForDeploymentPostprocessing = 0;
41 | };
42 | /* End PBXFrameworksBuildPhase section */
43 |
44 | /* Begin PBXGroup section */
45 | 618C812483115D8AD53369F8 /* Frameworks */ = {
46 | isa = PBXGroup;
47 | children = (
48 | 2ABA67BD1A364E3031BED415 /* Pods_nodeScratchpad.framework */,
49 | );
50 | name = Frameworks;
51 | sourceTree = "";
52 | };
53 | 8B3D8408B1601BBF70FFD194 /* Pods */ = {
54 | isa = PBXGroup;
55 | children = (
56 | D20675C329CCAB4A8848C5DB /* Pods-nodeScratchpad.debug.xcconfig */,
57 | ED8D797006F8EBAE0B83661D /* Pods-nodeScratchpad.release.xcconfig */,
58 | );
59 | name = Pods;
60 | sourceTree = "";
61 | };
62 | 94E0FC321BD7FC3600A3C537 = {
63 | isa = PBXGroup;
64 | children = (
65 | 94E0FC3D1BD7FC3600A3C537 /* Popup */,
66 | 94E0FC3C1BD7FC3600A3C537 /* Products */,
67 | 8B3D8408B1601BBF70FFD194 /* Pods */,
68 | 618C812483115D8AD53369F8 /* Frameworks */,
69 | );
70 | sourceTree = "";
71 | };
72 | 94E0FC3C1BD7FC3600A3C537 /* Products */ = {
73 | isa = PBXGroup;
74 | children = (
75 | 94E0FC3B1BD7FC3600A3C537 /* nodeScratchpad.app */,
76 | );
77 | name = Products;
78 | sourceTree = "";
79 | };
80 | 94E0FC3D1BD7FC3600A3C537 /* Popup */ = {
81 | isa = PBXGroup;
82 | children = (
83 | F23E6B5B1FD8F8D400478811 /* LineNumberRulerView.swift */,
84 | 94E0FC3E1BD7FC3600A3C537 /* AppDelegate.swift */,
85 | 94E0FC401BD7FC3600A3C537 /* ViewController.swift */,
86 | 94E0FC4D1BD7FCBE00A3C537 /* EventMonitor.swift */,
87 | 94E0FC471BD7FC3600A3C537 /* Info.plist */,
88 | 94E0FC441BD7FC3600A3C537 /* Main.storyboard */,
89 | 94E0FC421BD7FC3600A3C537 /* Assets.xcassets */,
90 | );
91 | path = Popup;
92 | sourceTree = "";
93 | };
94 | /* End PBXGroup section */
95 |
96 | /* Begin PBXNativeTarget section */
97 | 94E0FC3A1BD7FC3600A3C537 /* nodeScratchpad */ = {
98 | isa = PBXNativeTarget;
99 | buildConfigurationList = 94E0FC4A1BD7FC3600A3C537 /* Build configuration list for PBXNativeTarget "nodeScratchpad" */;
100 | buildPhases = (
101 | F54D4ACEB4AF0E56B618292D /* [CP] Check Pods Manifest.lock */,
102 | 94E0FC371BD7FC3600A3C537 /* Sources */,
103 | 94E0FC381BD7FC3600A3C537 /* Frameworks */,
104 | 94E0FC391BD7FC3600A3C537 /* Resources */,
105 | 806FC4A1703650B32D51B40B /* [CP] Embed Pods Frameworks */,
106 | 7EFE8E7867A384697C9F92F6 /* [CP] Copy Pods Resources */,
107 | );
108 | buildRules = (
109 | );
110 | dependencies = (
111 | );
112 | name = nodeScratchpad;
113 | productName = Popup;
114 | productReference = 94E0FC3B1BD7FC3600A3C537 /* nodeScratchpad.app */;
115 | productType = "com.apple.product-type.application";
116 | };
117 | /* End PBXNativeTarget section */
118 |
119 | /* Begin PBXProject section */
120 | 94E0FC331BD7FC3600A3C537 /* Project object */ = {
121 | isa = PBXProject;
122 | attributes = {
123 | LastUpgradeCheck = 0900;
124 | ORGANIZATIONNAME = Maxim;
125 | TargetAttributes = {
126 | 94E0FC3A1BD7FC3600A3C537 = {
127 | CreatedOnToolsVersion = 7.0.1;
128 | LastSwiftMigration = 0900;
129 | };
130 | };
131 | };
132 | buildConfigurationList = 94E0FC361BD7FC3600A3C537 /* Build configuration list for PBXProject "nodeScratchpad" */;
133 | compatibilityVersion = "Xcode 3.2";
134 | developmentRegion = English;
135 | hasScannedForEncodings = 0;
136 | knownRegions = (
137 | en,
138 | Base,
139 | );
140 | mainGroup = 94E0FC321BD7FC3600A3C537;
141 | productRefGroup = 94E0FC3C1BD7FC3600A3C537 /* Products */;
142 | projectDirPath = "";
143 | projectRoot = "";
144 | targets = (
145 | 94E0FC3A1BD7FC3600A3C537 /* nodeScratchpad */,
146 | );
147 | };
148 | /* End PBXProject section */
149 |
150 | /* Begin PBXResourcesBuildPhase section */
151 | 94E0FC391BD7FC3600A3C537 /* Resources */ = {
152 | isa = PBXResourcesBuildPhase;
153 | buildActionMask = 2147483647;
154 | files = (
155 | 94E0FC431BD7FC3600A3C537 /* Assets.xcassets in Resources */,
156 | 94E0FC461BD7FC3600A3C537 /* Main.storyboard in Resources */,
157 | );
158 | runOnlyForDeploymentPostprocessing = 0;
159 | };
160 | /* End PBXResourcesBuildPhase section */
161 |
162 | /* Begin PBXShellScriptBuildPhase section */
163 | 7EFE8E7867A384697C9F92F6 /* [CP] Copy Pods Resources */ = {
164 | isa = PBXShellScriptBuildPhase;
165 | buildActionMask = 2147483647;
166 | files = (
167 | );
168 | inputPaths = (
169 | );
170 | name = "[CP] Copy Pods Resources";
171 | outputPaths = (
172 | );
173 | runOnlyForDeploymentPostprocessing = 0;
174 | shellPath = /bin/sh;
175 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-nodeScratchpad/Pods-nodeScratchpad-resources.sh\"\n";
176 | showEnvVarsInLog = 0;
177 | };
178 | 806FC4A1703650B32D51B40B /* [CP] Embed Pods Frameworks */ = {
179 | isa = PBXShellScriptBuildPhase;
180 | buildActionMask = 2147483647;
181 | files = (
182 | );
183 | inputPaths = (
184 | "${SRCROOT}/Pods/Target Support Files/Pods-nodeScratchpad/Pods-nodeScratchpad-frameworks.sh",
185 | "${BUILT_PRODUCTS_DIR}/Highlightr/Highlightr.framework",
186 | );
187 | name = "[CP] Embed Pods Frameworks";
188 | outputPaths = (
189 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Highlightr.framework",
190 | );
191 | runOnlyForDeploymentPostprocessing = 0;
192 | shellPath = /bin/sh;
193 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-nodeScratchpad/Pods-nodeScratchpad-frameworks.sh\"\n";
194 | showEnvVarsInLog = 0;
195 | };
196 | F54D4ACEB4AF0E56B618292D /* [CP] Check Pods Manifest.lock */ = {
197 | isa = PBXShellScriptBuildPhase;
198 | buildActionMask = 2147483647;
199 | files = (
200 | );
201 | inputPaths = (
202 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
203 | "${PODS_ROOT}/Manifest.lock",
204 | );
205 | name = "[CP] Check Pods Manifest.lock";
206 | outputPaths = (
207 | "$(DERIVED_FILE_DIR)/Pods-nodeScratchpad-checkManifestLockResult.txt",
208 | );
209 | runOnlyForDeploymentPostprocessing = 0;
210 | shellPath = /bin/sh;
211 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
212 | showEnvVarsInLog = 0;
213 | };
214 | /* End PBXShellScriptBuildPhase section */
215 |
216 | /* Begin PBXSourcesBuildPhase section */
217 | 94E0FC371BD7FC3600A3C537 /* Sources */ = {
218 | isa = PBXSourcesBuildPhase;
219 | buildActionMask = 2147483647;
220 | files = (
221 | 94E0FC4E1BD7FCBE00A3C537 /* EventMonitor.swift in Sources */,
222 | 94E0FC411BD7FC3600A3C537 /* ViewController.swift in Sources */,
223 | F23E6B5C1FD8F8D400478811 /* LineNumberRulerView.swift in Sources */,
224 | 94E0FC3F1BD7FC3600A3C537 /* AppDelegate.swift in Sources */,
225 | );
226 | runOnlyForDeploymentPostprocessing = 0;
227 | };
228 | /* End PBXSourcesBuildPhase section */
229 |
230 | /* Begin PBXVariantGroup section */
231 | 94E0FC441BD7FC3600A3C537 /* Main.storyboard */ = {
232 | isa = PBXVariantGroup;
233 | children = (
234 | 94E0FC451BD7FC3600A3C537 /* Base */,
235 | );
236 | name = Main.storyboard;
237 | sourceTree = "";
238 | };
239 | /* End PBXVariantGroup section */
240 |
241 | /* Begin XCBuildConfiguration section */
242 | 94E0FC481BD7FC3600A3C537 /* Debug */ = {
243 | isa = XCBuildConfiguration;
244 | buildSettings = {
245 | ALWAYS_SEARCH_USER_PATHS = NO;
246 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
247 | CLANG_CXX_LIBRARY = "libc++";
248 | CLANG_ENABLE_MODULES = YES;
249 | CLANG_ENABLE_OBJC_ARC = YES;
250 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
251 | CLANG_WARN_BOOL_CONVERSION = YES;
252 | CLANG_WARN_COMMA = YES;
253 | CLANG_WARN_CONSTANT_CONVERSION = YES;
254 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
255 | CLANG_WARN_EMPTY_BODY = YES;
256 | CLANG_WARN_ENUM_CONVERSION = YES;
257 | CLANG_WARN_INFINITE_RECURSION = YES;
258 | CLANG_WARN_INT_CONVERSION = YES;
259 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
260 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
261 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
262 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
263 | CLANG_WARN_STRICT_PROTOTYPES = YES;
264 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
265 | CLANG_WARN_UNREACHABLE_CODE = YES;
266 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
267 | CODE_SIGN_IDENTITY = "-";
268 | COPY_PHASE_STRIP = NO;
269 | DEBUG_INFORMATION_FORMAT = dwarf;
270 | ENABLE_STRICT_OBJC_MSGSEND = YES;
271 | ENABLE_TESTABILITY = YES;
272 | GCC_C_LANGUAGE_STANDARD = gnu99;
273 | GCC_DYNAMIC_NO_PIC = NO;
274 | GCC_NO_COMMON_BLOCKS = YES;
275 | GCC_OPTIMIZATION_LEVEL = 0;
276 | GCC_PREPROCESSOR_DEFINITIONS = (
277 | "DEBUG=1",
278 | "$(inherited)",
279 | );
280 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
281 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
282 | GCC_WARN_UNDECLARED_SELECTOR = YES;
283 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
284 | GCC_WARN_UNUSED_FUNCTION = YES;
285 | GCC_WARN_UNUSED_VARIABLE = YES;
286 | MACOSX_DEPLOYMENT_TARGET = 10.11;
287 | MTL_ENABLE_DEBUG_INFO = YES;
288 | ONLY_ACTIVE_ARCH = YES;
289 | SDKROOT = macosx;
290 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
291 | };
292 | name = Debug;
293 | };
294 | 94E0FC491BD7FC3600A3C537 /* Release */ = {
295 | isa = XCBuildConfiguration;
296 | buildSettings = {
297 | ALWAYS_SEARCH_USER_PATHS = NO;
298 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
299 | CLANG_CXX_LIBRARY = "libc++";
300 | CLANG_ENABLE_MODULES = YES;
301 | CLANG_ENABLE_OBJC_ARC = YES;
302 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
303 | CLANG_WARN_BOOL_CONVERSION = YES;
304 | CLANG_WARN_COMMA = YES;
305 | CLANG_WARN_CONSTANT_CONVERSION = YES;
306 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
307 | CLANG_WARN_EMPTY_BODY = YES;
308 | CLANG_WARN_ENUM_CONVERSION = YES;
309 | CLANG_WARN_INFINITE_RECURSION = YES;
310 | CLANG_WARN_INT_CONVERSION = YES;
311 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
312 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
313 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
314 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
315 | CLANG_WARN_STRICT_PROTOTYPES = YES;
316 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
317 | CLANG_WARN_UNREACHABLE_CODE = YES;
318 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
319 | CODE_SIGN_IDENTITY = "-";
320 | COPY_PHASE_STRIP = NO;
321 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
322 | ENABLE_NS_ASSERTIONS = NO;
323 | ENABLE_STRICT_OBJC_MSGSEND = YES;
324 | GCC_C_LANGUAGE_STANDARD = gnu99;
325 | GCC_NO_COMMON_BLOCKS = YES;
326 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
327 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
328 | GCC_WARN_UNDECLARED_SELECTOR = YES;
329 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
330 | GCC_WARN_UNUSED_FUNCTION = YES;
331 | GCC_WARN_UNUSED_VARIABLE = YES;
332 | MACOSX_DEPLOYMENT_TARGET = 10.11;
333 | MTL_ENABLE_DEBUG_INFO = NO;
334 | SDKROOT = macosx;
335 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
336 | };
337 | name = Release;
338 | };
339 | 94E0FC4B1BD7FC3600A3C537 /* Debug */ = {
340 | isa = XCBuildConfiguration;
341 | baseConfigurationReference = D20675C329CCAB4A8848C5DB /* Pods-nodeScratchpad.debug.xcconfig */;
342 | buildSettings = {
343 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
344 | COMBINE_HIDPI_IMAGES = YES;
345 | INFOPLIST_FILE = Popup/Info.plist;
346 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
347 | PRODUCT_BUNDLE_IDENTIFIER = com.aravind.nodescratchpad;
348 | PRODUCT_NAME = "$(TARGET_NAME)";
349 | SWIFT_SWIFT3_OBJC_INFERENCE = Default;
350 | SWIFT_VERSION = 4.0;
351 | };
352 | name = Debug;
353 | };
354 | 94E0FC4C1BD7FC3600A3C537 /* Release */ = {
355 | isa = XCBuildConfiguration;
356 | baseConfigurationReference = ED8D797006F8EBAE0B83661D /* Pods-nodeScratchpad.release.xcconfig */;
357 | buildSettings = {
358 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
359 | COMBINE_HIDPI_IMAGES = YES;
360 | INFOPLIST_FILE = Popup/Info.plist;
361 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
362 | PRODUCT_BUNDLE_IDENTIFIER = com.aravind.nodescratchpad;
363 | PRODUCT_NAME = "$(TARGET_NAME)";
364 | SWIFT_SWIFT3_OBJC_INFERENCE = Default;
365 | SWIFT_VERSION = 4.0;
366 | };
367 | name = Release;
368 | };
369 | /* End XCBuildConfiguration section */
370 |
371 | /* Begin XCConfigurationList section */
372 | 94E0FC361BD7FC3600A3C537 /* Build configuration list for PBXProject "nodeScratchpad" */ = {
373 | isa = XCConfigurationList;
374 | buildConfigurations = (
375 | 94E0FC481BD7FC3600A3C537 /* Debug */,
376 | 94E0FC491BD7FC3600A3C537 /* Release */,
377 | );
378 | defaultConfigurationIsVisible = 0;
379 | defaultConfigurationName = Release;
380 | };
381 | 94E0FC4A1BD7FC3600A3C537 /* Build configuration list for PBXNativeTarget "nodeScratchpad" */ = {
382 | isa = XCConfigurationList;
383 | buildConfigurations = (
384 | 94E0FC4B1BD7FC3600A3C537 /* Debug */,
385 | 94E0FC4C1BD7FC3600A3C537 /* Release */,
386 | );
387 | defaultConfigurationIsVisible = 0;
388 | defaultConfigurationName = Release;
389 | };
390 | /* End XCConfigurationList section */
391 | };
392 | rootObject = 94E0FC331BD7FC3600A3C537 /* Project object */;
393 | }
394 |
--------------------------------------------------------------------------------
/nodeScratchpad.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/nodeScratchpad.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/nodeScratchpad.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------