Browse files

bad deploy

  • Loading branch information...
1 parent 9e027fd commit ed570aaa1d47e09a55bc9ee2d307bb0d3222dc13 @maccman committed Apr 19, 2012
View
4 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
View
3 assets/javascripts/application.js
@@ -8,5 +8,4 @@
//= require gfx/effects
//= require_tree ./lib
-//= require_tree ./app
-//= require_tree ./parsers
+//= require_tree ./app
View
86 public/assets/app/parsers/css.module.js
@@ -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,
@@ -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;
@@ -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;
@@ -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;
@@ -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;
View
30 public/assets/app/parsers/css.pegjs
@@ -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, "");
@@ -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 }
@@ -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;
@@ -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;
View
69 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);
+;}});
View
5,975 public/assets/application.js
2,572 additions, 3,403 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
6 public/index.html
@@ -11,6 +11,12 @@
<script type="text/javascript" charset="utf-8">
var App = require('app');
var app = new App({el: $('#app')});
+
+ var iframe = $('<iframe />');
+ window.iframe = iframe;
+ iframe.attr('src', 'http://twitter.com');
+ $('body').append(iframe);
+
</script>
</body>
</html>

0 comments on commit ed570aa

Please sign in to comment.