Skip to content

Commit

Permalink
bad deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Apr 19, 2012
1 parent 9e027fd commit ed570aa
Show file tree
Hide file tree
Showing 7 changed files with 2,692 additions and 3,481 deletions.
4 changes: 2 additions & 2 deletions assets/javascripts/app/parsers/import.module.coffee
@@ -1,7 +1,7 @@
import = (tree) ->
importPage = (tree) ->
# Iterate recursively over nodes.
# Parse out some css properties, keep unknown ones
# Set position to absolute
# Return array of elements

module.exports = import
module.exports = importPage
3 changes: 1 addition & 2 deletions assets/javascripts/application.js
Expand Up @@ -8,5 +8,4 @@
//= require gfx/effects

//= require_tree ./lib
//= require_tree ./app
//= require_tree ./parsers
//= require_tree ./app
86 changes: 24 additions & 62 deletions public/assets/app/parsers/css.module.js
Expand Up @@ -103,11 +103,10 @@ this.require.define({"app/parsers/css":function(exports, require, module){module
"shadow": parse_shadow,
"backgroundImage": parse_backgroundImage,
"linearGradient": parse_linearGradient,
"radialGradient": parse_radialGradient,
"url": parse_url,
"position": parse_position,
"colorStopList": parse_colorStopList,
"colorStop": parse_colorStop,
"position": parse_position,
"positionKeyword": parse_positionKeyword,
"positionKeywordMultiple": parse_positionKeywordMultiple,
"positionKeywordSingle": parse_positionKeywordSingle,
Expand Down Expand Up @@ -545,43 +544,6 @@ this.require.define({"app/parsers/css":function(exports, require, module){module
return result0;
}

function parse_radialGradient() {
var result0, result1;
var pos0;

pos0 = pos;
if (input.substr(pos, 16) === "radial-gradient(") {
result0 = "radial-gradient(";
pos += 16;
} else {
result0 = null;
if (reportFailures === 0) {
matchFailed("\"radial-gradient(\"");
}
}
if (result0 !== null) {
if (input.charCodeAt(pos) === 41) {
result1 = ")";
pos++;
} else {
result1 = null;
if (reportFailures === 0) {
matchFailed("\")\"");
}
}
if (result1 !== null) {
result0 = [result0, result1];
} else {
result0 = null;
pos = pos0;
}
} else {
result0 = null;
pos = pos0;
}
return result0;
}

function parse_url() {
var result0, result1, result2, result3;
var pos0, pos1, pos2, pos3, pos4;
Expand Down Expand Up @@ -732,27 +694,6 @@ this.require.define({"app/parsers/css":function(exports, require, module){module
return result0;
}

function parse_position() {
var result0;
var pos0;

pos0 = pos;
result0 = parse_angle();
if (result0 === null) {
result0 = parse_positionKeyword();
}
if (result0 !== null) {
result0 = (function(offset, angle) {
var Position = require('app/models/properties/background').Position;
return new Position(angle);
})(pos0, result0);
}
if (result0 === null) {
pos = pos0;
}
return result0;
}

function parse_colorStopList() {
var result0, result1, result2, result3;
var pos0, pos1;
Expand Down Expand Up @@ -861,6 +802,27 @@ this.require.define({"app/parsers/css":function(exports, require, module){module
return result0;
}

function parse_position() {
var result0;
var pos0;

pos0 = pos;
result0 = parse_angle();
if (result0 === null) {
result0 = parse_positionKeyword();
}
if (result0 !== null) {
result0 = (function(offset, angle) {
var Position = require('app/models/properties/background').Position;
return new Position(angle);
})(pos0, result0);
}
if (result0 === null) {
pos = pos0;
}
return result0;
}

function parse_positionKeyword() {
var result0;
var pos0;
Expand All @@ -881,8 +843,8 @@ this.require.define({"app/parsers/css":function(exports, require, module){module
top: 270
};

var x = mapping[keywords[0]] || 0;
var y = mapping[keywords[1]] || 0;
x = mapping[keywords[0]] || 0;
y = mapping[keywords[1]] || 0;

if (y) {
x /= 2;
Expand Down
30 changes: 18 additions & 12 deletions public/assets/app/parsers/css.pegjs
Expand Up @@ -48,16 +48,22 @@ shadow
backgroundImage
= linearGradient / url

// linear-gradient(top left, white, #a6f2c0 30%, rgba(180, 200, 210, .9), black)
// CSS linear gradient parser
//
// Format:
// linear-gradient(top left, white, #a6f2c0 30%, rgba(180, 200, 210, .9), black)
//
linearGradient
= "-webkit-"? "linear-gradient(" _ position:(position _)? stops:colorStopList* ")" {
var LinearGradient = require('app/models/properties/background').LinearGradient;
return new LinearGradient(position[0], stops);
}

radialGradient
= "radial-gradient(" ")"

// CSS background image url parser
//
// Format:
// url('http://example.com/image.png')
//
url
= "url(" href:( !")" s:. { return s; })* ")" {
href = href.join('').replace(/["']{1}/gi, "");
Expand All @@ -66,12 +72,6 @@ url
return new URL(href);
}

position
= angle:(angle / positionKeyword) {
var Position = require('app/models/properties/background').Position;
return new Position(angle);
}

colorStopList
= "," _ stop:colorStop _ { return stop }

Expand All @@ -83,6 +83,12 @@ colorStop

// Position

position
= angle:(angle / positionKeyword) {
var Position = require('app/models/properties/background').Position;
return new Position(angle);
}

positionKeyword
= keywords:(positionKeywordMultiple / positionKeywordSingle) {
var x, y, mapping;
Expand All @@ -94,8 +100,8 @@ positionKeyword
top: 270
};
var x = mapping[keywords[0]] || 0;
var y = mapping[keywords[1]] || 0;
x = mapping[keywords[0]] || 0;
y = mapping[keywords[1]] || 0;
if (y) {
x /= 2;
Expand Down
69 changes: 69 additions & 0 deletions public/assets/app/parsers/import.module.js
@@ -0,0 +1,69 @@
(function() {
if (!this.require) {
var modules = {}, cache = {};

var require = function(name, root) {
var path = expand(root, name), indexPath = expand(path, './index'), module, fn;
module = cache[path] || cache[indexPath];
if (module) {
return module;
} else if (fn = modules[path] || modules[path = indexPath]) {
module = {id: path, exports: {}};
cache[path] = module.exports;
fn(module.exports, function(name) {
return require(name, dirname(path));
}, module);
return cache[path] = module.exports;
} else {
throw 'module ' + name + ' not found';
}
};

var expand = function(root, name) {
var results = [], parts, part;
// If path is relative
if (/^\.\.?(\/|$)/.test(name)) {
parts = [root, name].join('/').split('/');
} else {
parts = name.split('/');
}
for (var i = 0, length = parts.length; i < length; i++) {
part = parts[i];
if (part == '..') {
results.pop();
} else if (part != '.' && part != '') {
results.push(part);
}
}
return results.join('/');
};

var dirname = function(path) {
return path.split('/').slice(0, -1).join('/');
};

this.require = function(name) {
return require(name, '');
};

this.require.define = function(bundle) {
for (var key in bundle) {
modules[key] = bundle[key];
}
};

this.require.modules = modules;
this.require.cache = cache;
}

return this.require;
}).call(this);
this.require.define({"app/parsers/import":function(exports, require, module){(function() {
var importPage;

importPage = function(tree) {};

module.exports = importPage;

}).call(this);
;}});

0 comments on commit ed570aa

Please sign in to comment.