-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Stop generating greyscale icons for Safari, since Safari now supports colored toolbar button images - Generate pngs from svg for toolbar using rsvg-convert since toolbars do not support svgs - Update Zotero submodule (for new icons) - Update utilities submodule (for zoteroTypeSchemaData.json)
- Loading branch information
Showing
39 changed files
with
126 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,11 @@ Options | |
-p PLATFORMS platform(s) (b=browserExt, s=safari; defaults to all) | ||
-v VERSION use version VERSION | ||
-d build for debugging (enable translator tester, don't minify) | ||
rsvg-convert is required | ||
brew install librsvg | ||
sudo apt install librsvg2-bin | ||
DONE | ||
exit 1 | ||
} | ||
|
@@ -112,14 +117,15 @@ EXTENSION_SKIN_DIR="$SRCDIR/zotero/chrome/skin/default/zotero" | |
|
||
SAFARI_EXT="$DISTDIR/Zotero_Connector-$VERSION.safariextz" | ||
|
||
ICONS="$EXTENSION_SKIN_DIR/treeitem*png $EXTENSION_SKIN_DIR/treesource-collection.png $EXTENSION_SKIN_DIR/zotero-new-z-16px.png \ | ||
$SRCDIR/common/images/*" | ||
ITEM_IMAGES="$EXTENSION_SKIN_DIR/item-type/16/light/*[!2x].svg" | ||
COLLECTION_IMAGES="$EXTENSION_SKIN_DIR/collection-tree/16/light/collection.svg \ | ||
$EXTENSION_SKIN_DIR/collection-tree/16/light/library.svg" | ||
COLLECTION_WHITE_IMAGES="$EXTENSION_SKIN_DIR/collection-tree/16/white/collection.svg \ | ||
$EXTENSION_SKIN_DIR/collection-tree/16/white/library.svg" | ||
CONNECTOR_COMMON_IMAGES="$SRCDIR/common/images/*" | ||
IMAGES="$EXTENSION_SKIN_DIR/progress_arcs.png \ | ||
$EXTENSION_SKIN_DIR/cross.png \ | ||
$EXTENSION_SKIN_DIR/tick.png $EXTENSION_SKIN_DIR/[email protected] \ | ||
$EXTENSION_SKIN_DIR/spinner-16px.png $EXTENSION_SKIN_DIR/[email protected] \ | ||
$EXTENSION_SKIN_DIR/treesource-library.png" | ||
PREFS_IMAGES="$EXTENSION_SKIN_DIR/prefs-general.png $EXTENSION_SKIN_DIR/prefs-advanced.png $EXTENSION_SKIN_DIR/prefs-proxies.png" | ||
$EXTENSION_SKIN_DIR/tick.png $EXTENSION_SKIN_DIR/[email protected]" | ||
|
||
LIBS=() | ||
|
||
|
@@ -157,11 +163,7 @@ echo -n "Building connectors..." | |
|
||
function copyResources { | ||
browser="$1" | ||
if [ "$browser" == "safari" ]; then | ||
browser_builddir="$BUILD_DIR/safari" | ||
else | ||
browser_builddir="$BUILD_DIR/$browser" | ||
fi | ||
browser_builddir="$BUILD_DIR/$browser" | ||
browser_srcdir="$SRCDIR/$browser" | ||
|
||
# Copy common files | ||
|
@@ -254,47 +256,57 @@ function copyResources { | |
fi | ||
} | ||
|
||
function makeToolbarIcons { | ||
browser="$1" | ||
icon_dir="$BUILD_DIR/$browser/images/toolbar" | ||
|
||
# Check for rsvg-convert | ||
if ! command -v rsvg-convert --version &> /dev/null ; then | ||
echo "" | ||
echo "rsvg-convert is not available" | ||
usage | ||
fi | ||
|
||
set -e | ||
for f in $ITEM_IMAGES $COLLECTION_IMAGES | ||
do | ||
rsvg-convert $f -w 32 -h 32 -o "$icon_dir/"`basename $f .svg`".png" | ||
if [ "$browser" == "browserExt" ]; then | ||
rsvg-convert $f -w 16 -h 16 -o "$icon_dir/"`basename $f .svg`"@16.png" | ||
rsvg-convert $f -w 48 -h 48 -o "$icon_dir/"`basename $f .svg`"@48.png" | ||
fi | ||
done | ||
set +e | ||
} | ||
|
||
if [[ $BUILD_BROWSER_EXT == 1 ]]; then | ||
# Copy images for Chrome | ||
rm -rf "$BUILD_DIR/browserExt/images" | ||
mkdir "$BUILD_DIR/browserExt/images" | ||
cp $ICONS $IMAGES $PREFS_IMAGES "$BUILD_DIR/browserExt/images" | ||
cp "$CWD/icons/Icon-16.png" "$CWD/icons/Icon-48.png" "$CWD/icons/Icon-96.png" "$CWD/icons/Icon-128.png" "$BUILD_DIR/browserExt" | ||
cp -r $ITEM_IMAGES $COLLECTION_IMAGES $CONNECTOR_COMMON_IMAGES $IMAGES "$BUILD_DIR/browserExt/images" | ||
cp $CWD/icons/* "$BUILD_DIR/browserExt" | ||
for f in $COLLECTION_WHITE_IMAGES | ||
do | ||
cp $f "$BUILD_DIR/browserExt/images/"`basename $f .svg`"-white.svg" | ||
done | ||
|
||
copyResources 'browserExt' | ||
makeToolbarIcons 'browserExt' | ||
fi | ||
|
||
if [[ $BUILD_SAFARI == 1 ]]; then | ||
# | ||
# Make alpha images | ||
# | ||
# ImageMagick 7 changes how channels work, so the same command doesn't work properly. Until we | ||
# figure out an equivalent command for ImageMagick 7, continue using version 6 from homebrew. | ||
IMAGEMAGICK_CONVERT=/usr/local/opt/imagemagick@6/bin/convert | ||
rm -rf "$BUILD_DIR/safari/images" | ||
mkdir "$BUILD_DIR/safari/images" | ||
mkdir "$BUILD_DIR/safari/images/toolbar" | ||
set +e | ||
$IMAGEMAGICK_CONVERT -version | grep "ImageMagick 6" > /dev/null 2>&1 | ||
RETVAL=$? | ||
set -e | ||
if [ $RETVAL == 0 ]; then | ||
cp $ICONS $IMAGES $PREFS_IMAGES "$BUILD_DIR/safari/images" | ||
for f in $ICONS | ||
do | ||
$IMAGEMAGICK_CONVERT $f -grayscale Rec709Luminance "$BUILD_DIR/safari/images/toolbar/"`basename $f` | ||
done | ||
else | ||
echo | ||
echo "ImageMagick 6 not installed; not creating monochrome Safari icons" | ||
cp $ICONS "$BUILD_DIR/safari/images" | ||
cp $ICONS "$BUILD_DIR/safari/images/toolbar" | ||
cp $IMAGES $PREFS_IMAGES "$BUILD_DIR/safari/images" | ||
fi | ||
cp -r $ITEM_IMAGES $COLLECTION_IMAGES $CONNECTOR_COMMON_IMAGES $IMAGES "$BUILD_DIR/safari/images" | ||
cp "$CWD/icons/Icon-32.png" "$CWD/icons/Icon-48.png" "$CWD/icons/Icon-64.png" \ | ||
"$BUILD_DIR/safari" | ||
for f in $COLLECTION_WHITE_IMAGES | ||
do | ||
cp $f "$BUILD_DIR/safari/images/"`basename $f .svg`"-white.svg" | ||
done | ||
|
||
copyResources 'safari' | ||
makeToolbarIcons 'safari' | ||
fi | ||
|
||
# Make separate Chrome, Chrome Manifest v3 and Firefox directories | ||
|
@@ -323,35 +335,11 @@ if [[ $BUILD_BROWSER_EXT == 1 ]]; then | |
|
||
# Chrome modifications | ||
|
||
# Use larger icons where available in Chrome, which actually wants 19px icons | ||
# 2x | ||
for img in "$BUILD_DIR"/chrome/images/*2x.png; do | ||
cp $img `echo $img | sed 's/@2x//'` | ||
done | ||
## 2.5x | ||
for img in "$BUILD_DIR"/chrome/images/*48px.png; do | ||
cp $img `echo $img | sed 's/@48px//'` | ||
done | ||
|
||
# Remove the 'applications' property used by Firefox from the manifest | ||
pushd $BUILD_DIR/chrome > /dev/null | ||
cat manifest.json | jq '. |= del(.applications)' > manifest.json-tmp | ||
mv manifest.json-tmp manifest.json | ||
popd > /dev/null | ||
|
||
# Chrome Manifest V3 modifications | ||
rsync -a $BUILD_DIR/chrome/images/ $BUILD_DIR/manifestv3/images/ | ||
|
||
# Firefox modifications | ||
|
||
# TEMP: Copy 2x icons to 1x until getImageSrc() is updated to detect HiDPI | ||
for img in "$BUILD_DIR"/firefox/images/*2x.png; do | ||
cp $img `echo $img | sed 's/@2x//'` | ||
done | ||
## 2.5x | ||
for img in "$BUILD_DIR"/firefox/images/*48px.png; do | ||
cp $img `echo $img | sed 's/@48px//'` | ||
done | ||
|
||
fi | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.