summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMandragorat Wandystanu <wktir@wandystan.eu>2017-11-30 03:14:22 +0100
committerMandragorat Wandystanu <wktir@wandystan.eu>2017-11-30 03:14:22 +0100
commit4ba1297f75258dd8f2c165eead8bc5835ecb93c6 (patch)
treea528eae787e94e27523472e98f3031a7d327b08e
parente75a9830e3ae0f5ec195a3b634f210c4cd8c5f2a (diff)
Embed glyphicons-512-copy.png into app.js.
-rw-r--r--Makefile23
-rw-r--r--static/img/favicon.pngbin838 -> 0 bytes
-rw-r--r--static/img/glyphicons-512-copy.pngbin200 -> 0 bytes
-rw-r--r--static/js/app.js6
4 files changed, 14 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 18efe6e..7f1584f 100644
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,8 @@ TMPDIR := $(shell mktemp -d)
# default modules
MODULES="php"
-all: builddirs npm_dependencies swig htmlmin min-css min-js copy-img submodules
-
+all: builddirs npm_dependencies swig htmlmin min-css min-js submodules
+
swig:
$(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/upload_logged.swig > $(CURDIR)/build/upload_logged.html
$(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/upload_unlogged.swig > $(CURDIR)/build/upload_unlogged.html
@@ -22,26 +22,22 @@ htmlmin:
$(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/404.html -o $(CURDIR)/build/404.html
installdirs:
- mkdir -p $(DESTDIR)/ $(DESTDIR)/img
ifneq (,$(findstring php,$(MODULES)))
mkdir -p $(DESTDIR)/classes $(DESTDIR)/includes
endif
ifneq (,$(findstring moe,$(MODULES)))
mkdir -p $(DESTDIR)/moe/{css,fonts,includes,js,login,panel/css/font,panel/css/images,register,templates}
endif
-
+
min-css:
$(NODE) $(CURDIR)/node_modules/.bin/cleancss --s0 $(CURDIR)/static/css/pomf.css > $(CURDIR)/build/pomf.min.css
min-js:
- echo "// @source https://github.com/pomf/pomf/tree/master/static/js" > $(CURDIR)/build/pomf.min.js
+ echo "// @source https://github.com/pomf/pomf/tree/master/static/js" > $(CURDIR)/build/pomf.min.js
echo "// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat" >> $(CURDIR)/build/pomf.min.js
- $(NODE) $(CURDIR)/node_modules/.bin/uglifyjs --screw-ie8 ./static/js/app.js >> $(CURDIR)/build/pomf.min.js
+ $(NODE) $(CURDIR)/node_modules/.bin/uglifyjs --screw-ie8 ./static/js/app.js >> $(CURDIR)/build/pomf.min.js
echo "// @license-end" >> $(CURDIR)/build/pomf.min.js
-copy-img:
- cp -v $(CURDIR)/static/img/*.png $(CURDIR)/build/img/
-
copy-php:
ifneq ($(wildcard $(CURDIR)/static/php/.),)
cp -rv $(CURDIR)/static/php/* $(CURDIR)/build/
@@ -65,19 +61,18 @@ dist:
install
$(TAR) cJf pomf-$(PKG_VERSION).tar.xz $(DESTDIR)
rm -rf $(TMPDIR)
-
+
clean:
- rm -rvf $(CURDIR)/node_modules
+ rm -rvf $(CURDIR)/node_modules
rm -rvf $(CURDIR)/build
-
+
uninstall:
rm -rvf $(DESTDIR)/
-
+
npm_dependencies:
$(NPM) install
builddirs:
- mkdir -p $(CURDIR)/build $(CURDIR)/build/img
ifneq (,$(findstring php,$(MODULES)))
mkdir -p $(CURDIR)/build/classes $(CURDIR)/build/includes
endif
diff --git a/static/img/favicon.png b/static/img/favicon.png
deleted file mode 100644
index a730cca..0000000
--- a/static/img/favicon.png
+++ /dev/null
Binary files differ
diff --git a/static/img/glyphicons-512-copy.png b/static/img/glyphicons-512-copy.png
deleted file mode 100644
index 23987d5..0000000
--- a/static/img/glyphicons-512-copy.png
+++ /dev/null
Binary files differ
diff --git a/static/js/app.js b/static/js/app.js
index ed894d9..b3cb2c5 100644
--- a/static/js/app.js
+++ b/static/js/app.js
@@ -103,7 +103,11 @@ document.addEventListener('DOMContentLoaded', function() {
var copy = document.createElement('button');
copy.className = 'upload-clipboard-btn';
var glyph = document.createElement('img');
- glyph.src = 'img/glyphicons-512-copy.png';
+ glyph.src = 'data:image/png;base64,' +
+ 'iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAAhUlEQVR4Ac3QBRlD' +
+ 'QQwD4EiYlEmatEo4KZNSBWNqv3R5zNjcf4SrPGHPl4WKBN+4F4ClXxMAjitFr4rX' +
+ '4BW3VGxX6JkbT1EAcc4NzuWOpJ2wNNsDEd66SK4gwiCSK3DKhIG/SMgDIYAjdxWI' +
+ '2sLBoJySBmLRAvC2akDNFajPXQIv6/4P3ABEFCgwSvTAswAAAABJRU5ErkJggg==';
copy.appendChild(glyph);
url.appendChild(copy);
copy.addEventListener("click", function(event) {