Skip to content

Commit

Permalink
Merge pull request #14 from rickpastoor/feature/safari-extension
Browse files Browse the repository at this point in the history
Initial support for building the Safari plugin
  • Loading branch information
rickpastoor committed Sep 26, 2015
2 parents 0602272 + 132a41d commit 049a756
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.DS_Store
dist
platform/safari/apple-intermediate.pem
platform/safari/apple-root.pem
platform/safari/cert.pem
platform/safari/privatekey.pem
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,33 @@ npm install jpm --global
```

With JPM, you can run the plugin in a debug environment. Change your directory to `dist/build/scrummer.firefox` and run `jpm run`. Now open your Trello board to see if your changes are working as expected. Happy coding!

## Developing and testing Safari

To build your own version of the Scrummer for Safari plugin, follow these steps:

Install xar-js:

```
npm intall xar-js --global
```

You need to [follow the xar-js README](https://github.com/robertknight/xar-js#building-a-safari-extension) on how to export the required certificate files
in order to build a valid version of the extension.

After following this guide, you should have these files inside your `platform/safari` folder:

| Filename |
|:-----------------------|
| apple-intermediate.pem |
| apple-root.pem |
| cert.pem |
| privatekey.pem |

Almost ready. Now run this command:

```
tools/make-safari.sh all
```

The script will build a `scrummer.safariextz`. Doubleclick it and Safari will ask you if you want to install the extension.
2 changes: 1 addition & 1 deletion platform/chromium/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Scrummer",
"version": "0.18",
"version": "0.19",
"description": "Adds Storypoints to Trello",
"content_scripts": [
{
Expand Down
2 changes: 1 addition & 1 deletion platform/firefox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "scrummer@jetpack",
"title": "Scrummer",
"name": "scrummer",
"version": "0.18",
"version": "0.19",
"description": "",
"main": "index.js",
"author": "Rick Pastoor",
Expand Down
52 changes: 52 additions & 0 deletions platform/safari/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Builder Version</key>
<string>10600.8.9</string>
<key>CFBundleDisplayName</key>
<string>Scrummer</string>
<key>CFBundleIdentifier</key>
<string>nl.rickpastoor.scrummer</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>0.19</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>Chrome</key>
<dict/>
<key>Content</key>
<dict>
<key>Scripts</key>
<dict>
<key>Start</key>
<array>
<string>scrummer.js</string>
</array>
</dict>
<key>Stylesheets</key>
<array>
<string>scrummer.css</string>
</array>
</dict>
<key>DeveloperIdentifier</key>
<string>ZCXSU9SYUC</string>
<key>ExtensionInfoDictionaryVersion</key>
<string>1.0</string>
<key>Permissions</key>
<dict>
<key>Website Access</key>
<dict>
<key>Allowed Domains</key>
<array>
<string>*.trello.com</string>
</array>
<key>Include Secure Pages</key>
<true/>
<key>Level</key>
<string>Some</string>
</dict>
</dict>
</dict>
</plist>
5 changes: 3 additions & 2 deletions src/scrummer.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
font-size: 18px;
padding: 3px 9px;
margin-right: 5px;
color: #fff !important;
}

.scrummer-picker-button:hover {
background-color: #4CB2D9;
color: #ccc !important;
}

.scrummer-separator-card {
Expand All @@ -44,5 +45,5 @@
text-align: center;
top: 2px;
position: relative;
color: #fff;
color: #fff !important;
}
2 changes: 1 addition & 1 deletion tools/make-firefox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This script assumes a linux environment

echo "*** uMatrix.firefox: Copying files"
echo "*** scrummer.firefox: Copying files"

DES=dist/build/scrummer.firefox
rm -rf $DES
Expand Down
20 changes: 20 additions & 0 deletions tools/make-safari.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
#
# This script assumes a linux environment

echo "*** scrummer.safari: Copying files"

DES=dist/build/scrummer.safariextension
rm -rf $DES
mkdir -p $DES

cp -R src/* $DES/
cp platform/safari/Info.plist $DES/

if [ "$1" = all ]; then
echo "*** scrummer.safari: Creating package..."
pushd $(dirname $DES/)
xarjs create scrummer.safariextz --cert ./../../platform/safari/cert.pem --cert ./../../platform/safari/apple-intermediate.pem --cert ./../../platform/safari/apple-root.pem --private-key ./../../platform/safari/privatekey.pem $(basename $DES/)
fi

echo "*** scrummer.safari: Package done."

0 comments on commit 049a756

Please sign in to comment.