Skip to content

Commit

Permalink
repo: add ghc colorscheme
Browse files Browse the repository at this point in the history
  • Loading branch information
paveyry committed Aug 22, 2019
1 parent f1a44a4 commit fae912f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@ before_script:
script:
- ./generate_patch.sh t/Chat.app/Contents/Resources/electron.asar

after_script:
- 7z a -tzip out/electron-slack.zip out/slacktheme/electron.asar
- 7z a -tzip out/electron-ghc.zip out/ghctheme/electron.asar
- cp out/slacktheme/gmonkeyscript.js out/gmonkeyscript-slack.js
- cp out/ghctheme/gmonkeyscript.js out/gmonkeyscript-ghc.js

deploy:
provider: releases
api_key: $TOKEN
file:
- "out/slacktheme/electron.asar"
- "out/slacktheme/gmonkeyscript.js"
- "out/electron-ghc.zip"
- "out/electron-slack.zip"
- "out/gmonkeyscript-ghc.js"
- "out/gmonkeyscript-slack.js"
skip-cleanup: true
on:
tags: true
Expand Down
6 changes: 4 additions & 2 deletions generate_patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ ASARFILE="$1"

[ -z "$ASARFILE" ] || asar e "$ASARFILE" "$DIR"

mkdir -p out/slacktheme

[ -z "$ASARFILE" ] || cp "$DIR/renderer/init.js" $DEFAULTINIT

generateFiles() {
mkdir -p "$3"
cat js/plugin.js \
| sed "s/CSSSHAPEURL/$1/g" \
| sed "s/CSSCOLORURL/$2/g" \
Expand All @@ -32,4 +31,7 @@ generateFiles() {

generateFiles "https:\/\/raw.githubusercontent.com\/paveyry\/better-hangoutschat\/master\/css\/shape.css" "https:\/\/raw.githubusercontent.com\/paveyry\/better-hangoutschat\/master\/css\/color_slack.css" "out/slacktheme"

generateFiles "https:\/\/raw.githubusercontent.com\/paveyry\/better-hangoutschat\/master\/css\/shape.css" "" "out/ghctheme"


rm -rf "$DIR" "$DEFAULTINIT" "$PLUGINGEN" "$PLUGINGEN2"
3 changes: 3 additions & 0 deletions js/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ insertionQ('.cZICLc').every(linkFunction);
let webviews = document.querySelectorAll("webview");

function loadCSS(cssPath) {
if (cssPath == '') {
return;
}
// Fetch our CSS in parallel ahead of time
let cssPromise = fetch(cssPath).then(response => response.text());

Expand Down

0 comments on commit fae912f

Please sign in to comment.