Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
public-min
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Put all 'bin' dirs beneath node_modules into $PATH so that we're using
# the locally installed AssetGraph:
# Ugly 'subst' hack: Check the Make Manual section 8.1 - Function Call Syntax
NPM_BINS := $(subst bin node,bin:node,$(shell if test -d node_modules; then find node_modules/ -name bin -type d; fi))
ifneq ($(NPM_BINS),)
PATH := ${NPM_BINS}:${PATH}
endif

deps := $(shell find public/ -type f -name "*.*")

public-min: public/index.html $(deps)
buildProduction \
--root public \
--outroot public-min \
$<

PHONY: clean

clean:
rm -rf public-min
2 changes: 1 addition & 1 deletion bin/server
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
var connect = require('connect'),
http = require('http');

var app = connect().use(connect.static('public'));
var app = connect().use(connect.static('public-min'));

http.createServer(app).listen(process.env.PORT || 3000);
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"dependencies": {
"connect": "~2.0.3"
},
"devDependencies": {},
"devDependencies": {
"assetgraph-builder": "latest"
}
"engines": {
"node": ">=0.6"
},
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<div id='content' class='clr'>
<div class='preview_and_configuration'>
<div class='preview'>
<style class='preview_styles'></style>
<div class='arrow_box'>
<h1 class='logo'>css arrow please!</h1>
</div>
Expand Down Expand Up @@ -68,6 +67,7 @@ <h2>Arrow configuration</h2>

<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
<script type="text/javascript" src="js/vendor/jscolor/jscolor.js"></script>
<link rel="stylesheet" type="text/css" href="js/vendor/jscolor/jscolor.css">

<script src='js/lib/models/arrow.js'></script>
<script src='js/lib/views/arrow_configuration_view.js'></script>
Expand Down
2 changes: 1 addition & 1 deletion public/js/lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};

this.views = [
new G.ArrowConfigurationView({ model: model, container: $('.configuration') }),
new G.ArrowPreviewView({ model: model, container: $('.preview_styles') }),
new G.ArrowPreviewView({ model: model, container: $('<style type="text/css"></style>').appendTo('body') }),
new G.ArrowCSSView({ model: model, container: $('.result_code') }),
];
},
Expand Down
26 changes: 5 additions & 21 deletions public/js/vendor/jscolor/jscolor.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ var jscolor = {
var p = jscolor.picker;

// controls interaction
p.box.className = modeID ? 'value' : 'saturation';
p.box.onmouseup =
p.box.onmouseout = function() { target.focus(); };
p.box.onmousedown = function() { abortBlur=true; };
Expand Down Expand Up @@ -637,6 +638,7 @@ var jscolor = {
p.box.style.height = dims[1] + 'px';

// picker border
p.boxB.className = 'jscolor';
p.boxB.style.position = 'absolute';
p.boxB.style.clear = 'both';
p.boxB.style.left = x+'px';
Expand All @@ -647,6 +649,7 @@ var jscolor = {
p.boxB.style.background = THIS.pickerFaceColor;

// pad image
p.pad.className = 'pad';
p.pad.style.width = jscolor.images.pad[0]+'px';
p.pad.style.height = jscolor.images.pad[1]+'px';

Expand All @@ -658,6 +661,7 @@ var jscolor = {
p.padB.style.borderColor = THIS.pickerInsetColor;

// pad mouse area
p.padM.className = 'cross';
p.padM.style.position = 'absolute';
p.padM.style.left = '0';
p.padM.style.top = '0';
Expand All @@ -679,6 +683,7 @@ var jscolor = {
p.sldB.style.borderColor = THIS.pickerInsetColor;

// slider mouse area
p.sldM.className = 'arrow';
p.sldM.style.display = THIS.slider ? 'block' : 'none';
p.sldM.style.position = 'absolute';
p.sldM.style.right = '0';
Expand Down Expand Up @@ -718,19 +723,6 @@ var jscolor = {
};
p.btnS.style.lineHeight = p.btn.style.height;

// load images in optimal order
switch(modeID) {
case 0: var padImg = 'hs.png'; break;
case 1: var padImg = 'hv.png'; break;
}
p.padM.style.backgroundImage = "url('"+jscolor.getDir()+"cross.gif')";
p.padM.style.backgroundRepeat = "no-repeat";
p.sldM.style.backgroundImage = "url('"+jscolor.getDir()+"arrow.gif')";
p.sldM.style.backgroundRepeat = "no-repeat";
p.pad.style.backgroundImage = "url('"+jscolor.getDir()+padImg+"')";
p.pad.style.backgroundRepeat = "no-repeat";
p.pad.style.backgroundPosition = "0 0";

// place pointers
redrawPad();
redrawSld();
Expand Down Expand Up @@ -918,14 +910,6 @@ var jscolor = {
};
}

// require images
switch(modeID) {
case 0: jscolor.requireImage('hs.png'); break;
case 1: jscolor.requireImage('hv.png'); break;
}
jscolor.requireImage('cross.gif');
jscolor.requireImage('arrow.gif');

this.importColor();
}

Expand Down