Skip to content

Instantly share code, notes, and snippets.

@elia
Created July 19, 2014 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elia/0c12c3d7529e042a1503 to your computer and use it in GitHub Desktop.
Save elia/0c12c3d7529e042a1503 to your computer and use it in GitHub Desktop.
Opal Browser v0.2.0.beta1 (Opal v0.6.2) — `opal-build -ropal/browser -oopal-browser.js browser`
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $range = $opal.range, $hash2 = $opal.hash2, $klass = $opal.klass, $gvars = $opal.gvars;
$opal.add_stubs(['$try_convert', '$native?', '$respond_to?', '$to_n', '$raise', '$inspect', '$Native', '$end_with?', '$define_method', '$[]', '$convert', '$call', '$to_proc', '$new', '$each', '$native_reader', '$native_writer', '$extend', '$to_a', '$to_ary', '$include', '$method_missing', '$bind', '$instance_method', '$[]=', '$slice', '$-', '$length', '$enum_for', '$===', '$>=', '$<<', '$==', '$instance_variable_set', '$members', '$each_with_index', '$each_pair', '$name']);
(function($base) {
var self = $module($base, 'Native');
var def = self._proto, $scope = self._scope, TMP_1;
$opal.defs(self, '$is_a?', function(object, klass) {
var self = this;
try {
return object instanceof self.$try_convert(klass);
}
catch (e) {
return false;
}
;
});
$opal.defs(self, '$try_convert', function(value) {
var self = this;
if (self['$native?'](value)) {
return value;
}
else if (value['$respond_to?']("to_n")) {
return value.$to_n();
}
else {
return nil;
}
;
});
$opal.defs(self, '$convert', function(value) {
var self = this;
if (self['$native?'](value)) {
return value;
}
else if (value['$respond_to?']("to_n")) {
return value.$to_n();
}
else {
self.$raise($scope.ArgumentError, "" + (value.$inspect()) + " isn't native");
}
;
});
$opal.defs(self, '$call', TMP_1 = function(obj, key, args) {
var self = this, $iter = TMP_1._p, block = $iter || nil;
args = $slice.call(arguments, 2);
TMP_1._p = null;
var prop = obj[key];
if (prop instanceof Function) {
var converted = new Array(args.length);
for (var i = 0, length = args.length; i < length; i++) {
var item = args[i],
conv = self.$try_convert(item);
converted[i] = conv === nil ? item : conv;
}
if (block !== nil) {
converted.push(block);
}
return self.$Native(prop.apply(obj, converted));
}
else {
return self.$Native(prop);
}
;
});
(function($base) {
var self = $module($base, 'Helpers');
var def = self._proto, $scope = self._scope;
def.$alias_native = function(new$, old, options) {
var $a, $b, TMP_2, $c, TMP_3, $d, TMP_4, self = this, as = nil;
if (old == null) {
old = new$
}
if (options == null) {
options = $hash2([], {})
}
if ((($a = old['$end_with?']("=")) !== nil && (!$a._isBoolean || $a == true))) {
return ($a = ($b = self).$define_method, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this;
if (self["native"] == null) self["native"] = nil;
if (value == null) value = nil;
self["native"][old['$[]']($range(0, -2, false))] = $scope.Native.$convert(value);
return value;}, TMP_2._s = self, TMP_2), $a).call($b, new$)
} else if ((($a = as = options['$[]']("as")) !== nil && (!$a._isBoolean || $a == true))) {
return ($a = ($c = self).$define_method, $a._p = (TMP_3 = function(args){var self = TMP_3._s || this, block, $a, $b, $c;
if (self["native"] == null) self["native"] = nil;
args = $slice.call(arguments, 0);
block = TMP_3._p || nil, TMP_3._p = null;
if ((($a = value = ($b = ($c = $scope.Native).$call, $b._p = block.$to_proc(), $b).apply($c, [self["native"], old].concat(args))) !== nil && (!$a._isBoolean || $a == true))) {
return as.$new(value.$to_n())
} else {
return nil
}}, TMP_3._s = self, TMP_3), $a).call($c, new$)
} else {
return ($a = ($d = self).$define_method, $a._p = (TMP_4 = function(args){var self = TMP_4._s || this, block, $a, $b;
if (self["native"] == null) self["native"] = nil;
args = $slice.call(arguments, 0);
block = TMP_4._p || nil, TMP_4._p = null;
return ($a = ($b = $scope.Native).$call, $a._p = block.$to_proc(), $a).apply($b, [self["native"], old].concat(args))}, TMP_4._s = self, TMP_4), $a).call($d, new$)
};
};
def.$native_reader = function(names) {
var $a, $b, TMP_5, self = this;
names = $slice.call(arguments, 0);
return ($a = ($b = names).$each, $a._p = (TMP_5 = function(name){var self = TMP_5._s || this, $a, $b, TMP_6;
if (name == null) name = nil;
return ($a = ($b = self).$define_method, $a._p = (TMP_6 = function(){var self = TMP_6._s || this;
if (self["native"] == null) self["native"] = nil;
return self.$Native(self["native"][name])}, TMP_6._s = self, TMP_6), $a).call($b, name)}, TMP_5._s = self, TMP_5), $a).call($b);
};
def.$native_writer = function(names) {
var $a, $b, TMP_7, self = this;
names = $slice.call(arguments, 0);
return ($a = ($b = names).$each, $a._p = (TMP_7 = function(name){var self = TMP_7._s || this, $a, $b, TMP_8;
if (name == null) name = nil;
return ($a = ($b = self).$define_method, $a._p = (TMP_8 = function(value){var self = TMP_8._s || this;
if (self["native"] == null) self["native"] = nil;
if (value == null) value = nil;
return self.$Native(self["native"][name] = value)}, TMP_8._s = self, TMP_8), $a).call($b, "" + (name) + "=")}, TMP_7._s = self, TMP_7), $a).call($b);
};
def.$native_accessor = function(names) {
var $a, $b, self = this;
names = $slice.call(arguments, 0);
($a = self).$native_reader.apply($a, [].concat(names));
return ($b = self).$native_writer.apply($b, [].concat(names));
};
;$opal.donate(self, ["$alias_native", "$native_reader", "$native_writer", "$native_accessor"]);
})(self);
$opal.defs(self, '$included', function(klass) {
var self = this;
return klass.$extend($scope.Helpers);
});
def.$initialize = function(native$) {
var $a, self = this;
if ((($a = $scope.Kernel['$native?'](native$)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
$scope.Kernel.$raise($scope.ArgumentError, "" + (native$.$inspect()) + " isn't native")
};
return self["native"] = native$;
};
def.$to_n = function() {
var self = this;
if (self["native"] == null) self["native"] = nil;
return self["native"];
};
;$opal.donate(self, ["$initialize", "$to_n"]);
})(self);
(function($base) {
var self = $module($base, 'Kernel');
var def = self._proto, $scope = self._scope, TMP_9;
def['$native?'] = function(value) {
var self = this;
return value == null || !value._klass;
};
def.$Native = function(obj) {
var $a, self = this;
if ((($a = obj == null) !== nil && (!$a._isBoolean || $a == true))) {
return nil
} else if ((($a = self['$native?'](obj)) !== nil && (!$a._isBoolean || $a == true))) {
return ($scope.Native)._scope.Object.$new(obj)
} else {
return obj
};
};
def.$Array = TMP_9 = function(object, args) {
var $a, $b, self = this, $iter = TMP_9._p, block = $iter || nil;
args = $slice.call(arguments, 1);
TMP_9._p = null;
if (object == null || object === nil) {
return [];
}
else if (self['$native?'](object)) {
return ($a = ($b = ($scope.Native)._scope.Array).$new, $a._p = block.$to_proc(), $a).apply($b, [object].concat(args)).$to_a();
}
else if (object['$respond_to?']("to_ary")) {
return object.$to_ary();
}
else if (object['$respond_to?']("to_a")) {
return object.$to_a();
}
else {
return [object];
}
;
};
;$opal.donate(self, ["$native?", "$Native", "$Array"]);
})(self);
(function($base, $super) {
function $Object(){};
var self = $Object = $klass($base, $super, 'Object', $Object);
var def = self._proto, $scope = self._scope, TMP_10, TMP_11, TMP_12;
def["native"] = nil;
self.$include($scope.Native);
$opal.defn(self, '$==', function(other) {
var self = this;
return self["native"] === $scope.Native.$try_convert(other);
});
$opal.defn(self, '$has_key?', function(name) {
var self = this;
return $opal.hasOwnProperty.call(self["native"], name);
});
$opal.defn(self, '$key?', def['$has_key?']);
$opal.defn(self, '$include?', def['$has_key?']);
$opal.defn(self, '$member?', def['$has_key?']);
$opal.defn(self, '$each', TMP_10 = function(args) {
var $a, self = this, $iter = TMP_10._p, $yield = $iter || nil;
args = $slice.call(arguments, 0);
TMP_10._p = null;
if (($yield !== nil)) {
for (var key in self["native"]) {
((($a = $opal.$yieldX($yield, [key, self["native"][key]])) === $breaker) ? $breaker.$v : $a)
}
;
return self;
} else {
return ($a = self).$method_missing.apply($a, ["each"].concat(args))
};
});
$opal.defn(self, '$[]', function(key) {
var $a, self = this;
var prop = self["native"][key];
if (prop instanceof Function) {
return prop;
}
else {
return (($a = $opal.Object._scope.Native) == null ? $opal.cm('Native') : $a).$call(self["native"], key)
}
;
});
$opal.defn(self, '$[]=', function(key, value) {
var $a, self = this, native$ = nil;
native$ = $scope.Native.$try_convert(value);
if ((($a = native$ === nil) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"][key] = value;
} else {
return self["native"][key] = native$;
};
});
$opal.defn(self, '$merge!', function(other) {
var self = this;
var other = $scope.Native.$convert(other);
for (var prop in other) {
self["native"][prop] = other[prop];
}
;
return self;
});
$opal.defn(self, '$respond_to?', function(name, include_all) {
var self = this;
if (include_all == null) {
include_all = false
}
return $scope.Kernel.$instance_method("respond_to?").$bind(self).$call(name, include_all);
});
$opal.defn(self, '$respond_to_missing?', function(name) {
var self = this;
return $opal.hasOwnProperty.call(self["native"], name);
});
$opal.defn(self, '$method_missing', TMP_11 = function(mid, args) {
var $a, $b, $c, self = this, $iter = TMP_11._p, block = $iter || nil;
args = $slice.call(arguments, 1);
TMP_11._p = null;
if (mid.charAt(mid.length - 1) === '=') {
return self['$[]='](mid.$slice(0, mid.$length()['$-'](1)), args['$[]'](0));
}
else {
return ($a = ($b = (($c = $opal.Object._scope.Native) == null ? $opal.cm('Native') : $c)).$call, $a._p = block.$to_proc(), $a).apply($b, [self["native"], mid].concat(args));
}
;
});
$opal.defn(self, '$nil?', function() {
var self = this;
return false;
});
$opal.defn(self, '$is_a?', function(klass) {
var self = this;
return $opal.is_a(self, klass);
});
$opal.defn(self, '$kind_of?', def['$is_a?']);
$opal.defn(self, '$instance_of?', function(klass) {
var self = this;
return self._klass === klass;
});
$opal.defn(self, '$class', function() {
var self = this;
return self._klass;
});
$opal.defn(self, '$to_a', TMP_12 = function(options) {
var $a, $b, self = this, $iter = TMP_12._p, block = $iter || nil;
if (options == null) {
options = $hash2([], {})
}
TMP_12._p = null;
return ($a = ($b = ($scope.Native)._scope.Array).$new, $a._p = block.$to_proc(), $a).call($b, self["native"], options).$to_a();
});
return ($opal.defn(self, '$inspect', function() {
var self = this;
return "#<Native:" + (String(self["native"])) + ">";
}), nil) && 'inspect';
})($scope.Native, $scope.BasicObject);
(function($base, $super) {
function $Array(){};
var self = $Array = $klass($base, $super, 'Array', $Array);
var def = self._proto, $scope = self._scope, TMP_13, TMP_14;
def.named = def["native"] = def.get = def.block = def.set = def.length = nil;
self.$include($scope.Native);
self.$include($scope.Enumerable);
def.$initialize = TMP_13 = function(native$, options) {
var $a, self = this, $iter = TMP_13._p, block = $iter || nil;
if (options == null) {
options = $hash2([], {})
}
TMP_13._p = null;
$opal.find_super_dispatcher(self, 'initialize', TMP_13, null).apply(self, [native$]);
self.get = ((($a = options['$[]']("get")) !== false && $a !== nil) ? $a : options['$[]']("access"));
self.named = options['$[]']("named");
self.set = ((($a = options['$[]']("set")) !== false && $a !== nil) ? $a : options['$[]']("access"));
self.length = ((($a = options['$[]']("length")) !== false && $a !== nil) ? $a : "length");
self.block = block;
if ((($a = self.$length() == null) !== nil && (!$a._isBoolean || $a == true))) {
return self.$raise($scope.ArgumentError, "no length found on the array-like object")
} else {
return nil
};
};
def.$each = TMP_14 = function() {
var self = this, $iter = TMP_14._p, block = $iter || nil;
TMP_14._p = null;
if (block !== false && block !== nil) {
} else {
return self.$enum_for("each")
};
for (var i = 0, length = self.$length(); i < length; i++) {
var value = $opal.$yield1(block, self['$[]'](i));
if (value === $breaker) {
return $breaker.$v;
}
}
;
return self;
};
def['$[]'] = function(index) {
var $a, self = this, result = nil, $case = nil;
result = (function() {$case = index;if ($scope.String['$===']($case) || $scope.Symbol['$===']($case)) {if ((($a = self.named) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"][self.named](index);
} else {
return self["native"][index];
}}else if ($scope.Integer['$===']($case)) {if ((($a = self.get) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"][self.get](index);
} else {
return self["native"][index];
}}else { return nil }})();
if (result !== false && result !== nil) {
if ((($a = self.block) !== nil && (!$a._isBoolean || $a == true))) {
return self.block.$call(result)
} else {
return self.$Native(result)
}
} else {
return nil
};
};
def['$[]='] = function(index, value) {
var $a, self = this;
if ((($a = self.set) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"][self.set](index, $scope.Native.$convert(value));
} else {
return self["native"][index] = $scope.Native.$convert(value);
};
};
def.$last = function(count) {
var $a, self = this, index = nil, result = nil;
if (count == null) {
count = nil
}
if (count !== false && count !== nil) {
index = self.$length()['$-'](1);
result = [];
while (index['$>='](0)) {
result['$<<'](self['$[]'](index));
index = index['$-'](1);};
return result;
} else {
return self['$[]'](self.$length()['$-'](1))
};
};
def.$length = function() {
var self = this;
return self["native"][self.length];
};
$opal.defn(self, '$to_ary', def.$to_a);
return (def.$inspect = function() {
var self = this;
return self.$to_a().$inspect();
}, nil) && 'inspect';
})($scope.Native, null);
(function($base, $super) {
function $Numeric(){};
var self = $Numeric = $klass($base, $super, 'Numeric', $Numeric);
var def = self._proto, $scope = self._scope;
return (def.$to_n = function() {
var self = this;
return self.valueOf();
}, nil) && 'to_n'
})(self, null);
(function($base, $super) {
function $Proc(){};
var self = $Proc = $klass($base, $super, 'Proc', $Proc);
var def = self._proto, $scope = self._scope;
return (def.$to_n = function() {
var self = this;
return self;
}, nil) && 'to_n'
})(self, null);
(function($base, $super) {
function $String(){};
var self = $String = $klass($base, $super, 'String', $String);
var def = self._proto, $scope = self._scope;
return (def.$to_n = function() {
var self = this;
return self.valueOf();
}, nil) && 'to_n'
})(self, null);
(function($base, $super) {
function $Regexp(){};
var self = $Regexp = $klass($base, $super, 'Regexp', $Regexp);
var def = self._proto, $scope = self._scope;
return (def.$to_n = function() {
var self = this;
return self.valueOf();
}, nil) && 'to_n'
})(self, null);
(function($base, $super) {
function $MatchData(){};
var self = $MatchData = $klass($base, $super, 'MatchData', $MatchData);
var def = self._proto, $scope = self._scope;
def.matches = nil;
return (def.$to_n = function() {
var self = this;
return self.matches;
}, nil) && 'to_n'
})(self, null);
(function($base, $super) {
function $Struct(){};
var self = $Struct = $klass($base, $super, 'Struct', $Struct);
var def = self._proto, $scope = self._scope;
def.$initialize = function(args) {
var $a, $b, TMP_15, $c, TMP_16, self = this, object = nil;
args = $slice.call(arguments, 0);
if ((($a = (($b = args.$length()['$=='](1)) ? self['$native?'](args['$[]'](0)) : $b)) !== nil && (!$a._isBoolean || $a == true))) {
object = args['$[]'](0);
return ($a = ($b = self.$members()).$each, $a._p = (TMP_15 = function(name){var self = TMP_15._s || this;
if (name == null) name = nil;
return self.$instance_variable_set("@" + (name), self.$Native(object[name]))}, TMP_15._s = self, TMP_15), $a).call($b);
} else {
return ($a = ($c = self.$members()).$each_with_index, $a._p = (TMP_16 = function(name, index){var self = TMP_16._s || this;
if (name == null) name = nil;if (index == null) index = nil;
return self.$instance_variable_set("@" + (name), args['$[]'](index))}, TMP_16._s = self, TMP_16), $a).call($c)
};
};
return (def.$to_n = function() {
var $a, $b, TMP_17, self = this, result = nil;
result = {};
($a = ($b = self).$each_pair, $a._p = (TMP_17 = function(name, value){var self = TMP_17._s || this;
if (name == null) name = nil;if (value == null) value = nil;
return result[name] = value.$to_n();}, TMP_17._s = self, TMP_17), $a).call($b);
return result;
}, nil) && 'to_n';
})(self, null);
(function($base, $super) {
function $Array(){};
var self = $Array = $klass($base, $super, 'Array', $Array);
var def = self._proto, $scope = self._scope;
return (def.$to_n = function() {
var self = this;
var result = [];
for (var i = 0, length = self.length; i < length; i++) {
var obj = self[i];
if ((obj)['$respond_to?']("to_n")) {
result.push((obj).$to_n());
}
else {
result.push(obj);
}
}
return result;
;
}, nil) && 'to_n'
})(self, null);
(function($base, $super) {
function $Boolean(){};
var self = $Boolean = $klass($base, $super, 'Boolean', $Boolean);
var def = self._proto, $scope = self._scope;
return (def.$to_n = function() {
var self = this;
return self.valueOf();
}, nil) && 'to_n'
})(self, null);
(function($base, $super) {
function $Time(){};
var self = $Time = $klass($base, $super, 'Time', $Time);
var def = self._proto, $scope = self._scope;
return (def.$to_n = function() {
var self = this;
return self;
}, nil) && 'to_n'
})(self, null);
(function($base, $super) {
function $NilClass(){};
var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass);
var def = self._proto, $scope = self._scope;
return (def.$to_n = function() {
var self = this;
return null;
}, nil) && 'to_n'
})(self, null);
(function($base, $super) {
function $Hash(){};
var self = $Hash = $klass($base, $super, 'Hash', $Hash);
var def = self._proto, $scope = self._scope, TMP_18;
def.$initialize = TMP_18 = function(defaults) {
var self = this, $iter = TMP_18._p, block = $iter || nil;
TMP_18._p = null;
if (defaults != null) {
if (defaults.constructor === Object) {
var map = self.map,
keys = self.keys;
for (var key in defaults) {
var value = defaults[key];
if (value && value.constructor === Object) {
map[key] = $scope.Hash.$new(value);
}
else {
map[key] = self.$Native(defaults[key]);
}
keys.push(key);
}
}
else {
self.none = defaults;
}
}
else if (block !== nil) {
self.proc = block;
}
return self;
};
return (def.$to_n = function() {
var self = this;
var result = {},
keys = self.keys,
map = self.map,
bucket,
value;
for (var i = 0, length = keys.length; i < length; i++) {
var key = keys[i],
obj = map[key];
if ((obj)['$respond_to?']("to_n")) {
result[key] = (obj).$to_n();
}
else {
result[key] = obj;
}
}
return result;
;
}, nil) && 'to_n';
})(self, null);
(function($base, $super) {
function $Module(){};
var self = $Module = $klass($base, $super, 'Module', $Module);
var def = self._proto, $scope = self._scope;
return (def.$native_module = function() {
var self = this;
return Opal.global[self.$name()] = self;
}, nil) && 'native_module'
})(self, null);
(function($base, $super) {
function $Class(){};
var self = $Class = $klass($base, $super, 'Class', $Class);
var def = self._proto, $scope = self._scope;
def.$native_alias = function(jsid, mid) {
var self = this;
return self._proto[jsid] = self._proto['$' + mid];
};
return $opal.defn(self, '$native_class', def.$native_module);
})(self, null);
return $gvars.$ = $gvars.global = self.$Native(Opal.global);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $module = $opal.module;
$opal.add_stubs(['$size', '$min', '$scan', '$gsub', '$proc', '$===', '$merge', '$to_proc', '$merge!']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base) {
var self = $module($base, 'Utils');
var def = self._proto, $scope = self._scope;
$opal.defs(self, '$heredoc', function(string) {
var self = this, indent = nil;
indent = (function() {try {return string.$scan(/^[ \t]*(?=\S)/).$min().$size() } catch ($err) { return 0 }})();
return string.$gsub((new RegExp("^[ \\t]{" + indent + "}")), "");
});
$opal.defs(self, '$deep_merge', function(a, b) {
var $a, $b, TMP_1, $c, self = this, merger = nil;
merger = ($a = ($b = self).$proc, $a._p = (TMP_1 = function(key, v1, v2){var self = TMP_1._s || this, $a, $b;
if (key == null) key = nil;if (v1 == null) v1 = nil;if (v2 == null) v2 = nil;
if ((($a = ($b = $scope.Hash['$==='](v1), $b !== false && $b !== nil ?$scope.Hash['$==='](v2) : $b)) !== nil && (!$a._isBoolean || $a == true))) {
return ($a = ($b = v1).$merge, $a._p = merger.$to_proc(), $a).call($b, v2)
} else {
return v2
}}, TMP_1._s = self, TMP_1), $a).call($b);
return ($a = ($c = a).$merge, $a._p = merger.$to_proc(), $a).call($c, b);
});
$opal.defs(self, '$deep_merge!', function(a, b) {
var $a, $b, TMP_2, $c, self = this, merger = nil;
merger = ($a = ($b = self).$proc, $a._p = (TMP_2 = function(key, v1, v2){var self = TMP_2._s || this, $a, $b;
if (key == null) key = nil;if (v1 == null) v1 = nil;if (v2 == null) v2 = nil;
if ((($a = ($b = $scope.Hash['$==='](v1), $b !== false && $b !== nil ?$scope.Hash['$==='](v2) : $b)) !== nil && (!$a._isBoolean || $a == true))) {
($a = ($b = v1)['$merge!'], $a._p = merger.$to_proc(), $a).call($b, v2);
return v1;
} else {
return v2
}}, TMP_2._s = self, TMP_2), $a).call($b);
return ($a = ($c = a)['$merge!'], $a._p = merger.$to_proc(), $a).call($c, b);
});
})(self)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass;
$opal.add_stubs(['$define_method', '$instance_exec', '$to_proc', '$do', '$defhelper', '$[]=']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope, TMP_1;
$opal.defs(self, '$defhelper', TMP_1 = function(name) {
var $a, $b, TMP_2, self = this, $iter = TMP_1._p, block = $iter || nil;
TMP_1._p = null;
return ($a = ($b = self).$define_method, $a._p = (TMP_2 = function(args){var self = TMP_2._s || this, body, $a, $b, $c;
args = $slice.call(arguments, 0);
body = TMP_2._p || nil, TMP_2._p = null;
($a = ($b = self).$instance_exec, $a._p = block.$to_proc(), $a).apply($b, [].concat(args));
if (body !== false && body !== nil) {
($a = ($c = self).$do, $a._p = body.$to_proc(), $a).call($c)};
return self;}, TMP_2._s = self, TMP_2), $a).call($b, name);
});
return ($opal.defs(self, '$defhelper!', function(name, attribute) {
var $a, $b, TMP_3, self = this;
if (attribute == null) {
attribute = name
}
return ($a = ($b = self).$defhelper, $a._p = (TMP_3 = function(){var self = TMP_3._s || this;
if (self.attributes == null) self.attributes = nil;
return self.attributes['$[]='](attribute, true)}, TMP_3._s = self, TMP_3), $a).call($b, "" + (name) + "!");
}), nil) && 'defhelper!';
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$each', '$defhelper', '$[]=', '$to_s', '$defhelper!', '$<<']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $A(){};
var self = $A = $klass($base, $super, 'A', $A);
var def = self._proto, $scope = self._scope, $a, $b, TMP_1, $c, TMP_3;
($a = ($b = $hash2(["href", "url", "rel", "relative", "target", "type", "lang", "language", "media"], {"href": "href", "url": "href", "rel": "rel", "relative": "rel", "target": "target", "type": "type", "lang": "hreflang", "language": "hreflang", "media": "media"})).$each, $a._p = (TMP_1 = function(name, attribute){var self = TMP_1._s || this, $a, $b, TMP_2;
if (name == null) name = nil;if (attribute == null) attribute = nil;
return ($a = ($b = self).$defhelper, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this;
if (self.attributes == null) self.attributes = nil;
if (value == null) value = nil;
return self.attributes['$[]='](attribute, value.$to_s())}, TMP_2._s = self, TMP_2), $a).call($b, name)}, TMP_1._s = self, TMP_1), $a).call($b);
self['$defhelper!']("download");
self['$defhelper!']("ping");
return ($a = ($c = self).$defhelper, $a._p = (TMP_3 = function(string){var self = TMP_3._s || this;
if (string == null) string = nil;
return self['$<<'](string)}, TMP_3._s = self, TMP_3), $a).call($c, "text");
})(self, self)
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$each', '$defhelper', '$[]=', '$to_s']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Base(){};
var self = $Base = $klass($base, $super, 'Base', $Base);
var def = self._proto, $scope = self._scope, $a, $b, TMP_1;
return ($a = ($b = $hash2(["href", "url", "target"], {"href": "href", "url": "href", "target": "target"})).$each, $a._p = (TMP_1 = function(name, attribute){var self = TMP_1._s || this, $a, $b, TMP_2;
if (name == null) name = nil;if (attribute == null) attribute = nil;
return ($a = ($b = self).$defhelper, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this;
if (self.attributes == null) self.attributes = nil;
if (value == null) value = nil;
return self.attributes['$[]='](attribute, value.$to_s())}, TMP_2._s = self, TMP_2), $a).call($b, name)}, TMP_1._s = self, TMP_1), $a).call($b)
})(self, self)
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass;
$opal.add_stubs(['$defhelper', '$[]=', '$to_s']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Blockquote(){};
var self = $Blockquote = $klass($base, $super, 'Blockquote', $Blockquote);
var def = self._proto, $scope = self._scope, $a, $b, TMP_1;
return ($a = ($b = self).$defhelper, $a._p = (TMP_1 = function(value){var self = TMP_1._s || this;
if (self.attributes == null) self.attributes = nil;
if (value == null) value = nil;
return self.attributes['$[]=']("cite", value.$to_s())}, TMP_1._s = self, TMP_1), $a).call($b, "cite")
})(self, self)
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$each', '$defhelper', '$[]=', '$attribute', '$to_s', '$defhelper!']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Button(){};
var self = $Button = $klass($base, $super, 'Button', $Button);
var def = self._proto, $scope = self._scope, $a, $b, TMP_1;
($a = ($b = $hash2(["form", "name", "type", "value", "action", "encoding", "method", "target"], {"form": "form", "name": "name", "type": "type", "value": "value", "action": "formaction", "encoding": "formenctype", "method": "formmethod", "target": "formtarget"})).$each, $a._p = (TMP_1 = function(name, attributes){var self = TMP_1._s || this, $a, $b, TMP_2;
if (name == null) name = nil;if (attributes == null) attributes = nil;
return ($a = ($b = self).$defhelper, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this;
if (self.attributes == null) self.attributes = nil;
if (value == null) value = nil;
return self.attributes['$[]='](self.$attribute(), value.$to_s())}, TMP_2._s = self, TMP_2), $a).call($b, name)}, TMP_1._s = self, TMP_1), $a).call($b);
self['$defhelper!']("autofocus");
return self['$defhelper!']("disabled");
})(self, self)
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$each', '$defhelper', '$[]=', '$to_s']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Canvas(){};
var self = $Canvas = $klass($base, $super, 'Canvas', $Canvas);
var def = self._proto, $scope = self._scope, $a, $b, TMP_1;
return ($a = ($b = $hash2(["width", "height"], {"width": "width", "height": "height"})).$each, $a._p = (TMP_1 = function(name, attribute){var self = TMP_1._s || this, $a, $b, TMP_2;
if (name == null) name = nil;if (attribute == null) attribute = nil;
return ($a = ($b = self).$defhelper, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this;
if (self.attributes == null) self.attributes = nil;
if (value == null) value = nil;
return self.attributes['$[]='](attribute, value.$to_s())}, TMP_2._s = self, TMP_2), $a).call($b, name)}, TMP_1._s = self, TMP_1), $a).call($b)
})(self, self)
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$each', '$defhelper', '$[]=', '$to_s']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Img(){};
var self = $Img = $klass($base, $super, 'Img', $Img);
var def = self._proto, $scope = self._scope, $a, $b, TMP_1, $c, TMP_3;
($a = ($b = $hash2(["src", "url", "alt", "description", "height", "width", "map"], {"src": "src", "url": "src", "alt": "alt", "description": "alt", "height": "height", "width": "width", "map": "usemap"})).$each, $a._p = (TMP_1 = function(name, attribute){var self = TMP_1._s || this, $a, $b, TMP_2;
if (name == null) name = nil;if (attribute == null) attribute = nil;
return ($a = ($b = self).$defhelper, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this;
if (self.attributes == null) self.attributes = nil;
if (value == null) value = nil;
return self.attributes['$[]='](attribute, value.$to_s())}, TMP_2._s = self, TMP_2), $a).call($b, name)}, TMP_1._s = self, TMP_1), $a).call($b);
return ($a = ($c = self).$defhelper, $a._p = (TMP_3 = function(){var self = TMP_3._s || this;
if (self.attributes == null) self.attributes = nil;
return self.attributes['$[]=']("ismap", true)}, TMP_3._s = self, TMP_3), $a).call($c, "map!");
})(self, self)
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$each', '$defhelper', '$[]=']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Input(){};
var self = $Input = $klass($base, $super, 'Input', $Input);
var def = self._proto, $scope = self._scope, $a, $b, TMP_1;
return ($a = ($b = $hash2(["type", "name", "value", "size", "place_holder", "read_only", "required"], {"type": "type", "name": "name", "value": "value", "size": "size", "place_holder": "placeholder", "read_only": "readonly", "required": "required"})).$each, $a._p = (TMP_1 = function(name, attribute){var self = TMP_1._s || this, $a, $b, TMP_2;
if (name == null) name = nil;if (attribute == null) attribute = nil;
return ($a = ($b = self).$defhelper, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this;
if (self.attributes == null) self.attributes = nil;
if (value == null) value = nil;
return self.attributes['$[]='](attribute, value)}, TMP_2._s = self, TMP_2), $a).call($b, name)}, TMP_1._s = self, TMP_1), $a).call($b)
})(self, self)
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$each', '$defhelper', '$[]=']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Object(){};
var self = $Object = $klass($base, $super, 'Object', $Object);
var def = self._proto, $scope = self._scope, $a, $b, TMP_1;
return ($a = ($b = $hash2(["type", "data", "name", "height", "width"], {"type": "type", "data": "data", "name": "name", "height": "height", "width": "width"})).$each, $a._p = (TMP_1 = function(name, attribute){var self = TMP_1._s || this, $a, $b, TMP_2;
if (name == null) name = nil;if (attribute == null) attribute = nil;
return ($a = ($b = self).$defhelper, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this;
if (self.attributes == null) self.attributes = nil;
if (value == null) value = nil;
return self.attributes['$[]='](attribute, value)}, TMP_2._s = self, TMP_2), $a).call($b, name)}, TMP_1._s = self, TMP_1), $a).call($b)
})(self, self)
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass;
$opal.add_stubs(['$defhelper', '$[]=', '$to_s', '$join']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Td(){};
var self = $Td = $klass($base, $super, 'Td', $Td);
var def = self._proto, $scope = self._scope, $a, $b, TMP_1, $c, TMP_2, $d, TMP_3;
($a = ($b = self).$defhelper, $a._p = (TMP_1 = function(value){var self = TMP_1._s || this;
if (self.attributes == null) self.attributes = nil;
if (value == null) value = nil;
return self.attributes['$[]=']("colspan", value.$to_s())}, TMP_1._s = self, TMP_1), $a).call($b, "columns");
($a = ($c = self).$defhelper, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this;
if (self.attributes == null) self.attributes = nil;
if (value == null) value = nil;
return self.attributes['$[]=']("rowspan", value.$to_s())}, TMP_2._s = self, TMP_2), $a).call($c, "rows");
return ($a = ($d = self).$defhelper, $a._p = (TMP_3 = function(args){var self = TMP_3._s || this;
if (self.attributes == null) self.attributes = nil;
args = $slice.call(arguments, 0);
return self.attributes['$[]=']("headers", args.$join(" "))}, TMP_3._s = self, TMP_3), $a).call($d, "headers");
})(self, self)
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2, $range = $opal.range;
$opal.add_stubs(['$==', '$capitalize', '$const_defined?', '$new', '$const_get', '$each', '$to_proc', '$<<', '$heredoc', '$to_s', '$end_with?', '$[]=', '$[]', '$push', '$extend!', '$pop', '$join', '$defhelper', '$map', '$empty?', '$upcase', '$inspect']);
;
;
;
;
;
;
;
;
;
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope, TMP_1, TMP_2, TMP_3, TMP_4, $a, $b, TMP_5, $c, TMP_7;
def.children = def.attributes = def.class_names = def.owner = def.last = def.name = nil;
$opal.defs(self, '$new', TMP_1 = function(owner, name, attributes) {var $zuper = $slice.call(arguments, 0);
var $a, self = this, $iter = TMP_1._p, $yield = $iter || nil, const$ = nil;
if (attributes == null) {
attributes = $hash2([], {})
}
TMP_1._p = null;
if (self['$==']($scope.Element)) {
} else {
return $opal.find_super_dispatcher(self, 'new', TMP_1, $iter, $Element).apply(self, $zuper)
};
const$ = name.$capitalize();
if ((($a = self['$const_defined?'](const$)) !== nil && (!$a._isBoolean || $a == true))) {
return self.$const_get(const$).$new(owner, name, attributes)
} else {
return $opal.find_super_dispatcher(self, 'new', TMP_1, $iter, $Element).apply(self, $zuper)
};
});
def.$initialize = function(owner, name, attributes) {
var self = this;
if (attributes == null) {
attributes = $hash2([], {})
}
self.owner = owner;
self.name = name;
self.attributes = attributes;
self.children = [];
return self.class_names = [];
};
def.$each = TMP_2 = function() {
var $a, $b, self = this, $iter = TMP_2._p, block = $iter || nil;
TMP_2._p = null;
return ($a = ($b = self.children).$each, $a._p = block.$to_proc(), $a).call($b);
};
def['$<<'] = function(what) {
var self = this;
self.children['$<<'](what);
return self;
};
def.$method_missing = TMP_3 = function(name, content) {
var $a, $b, self = this, $iter = TMP_3._p, block = $iter || nil;
if (content == null) {
content = nil
}
TMP_3._p = null;
if (content !== false && content !== nil) {
self['$<<'](((($a = $opal.Object._scope.Paggio) == null ? $opal.cm('Paggio') : $a))._scope.Utils.$heredoc(content.$to_s()))};
if ((($a = name.$to_s()['$end_with?']("!")) !== nil && (!$a._isBoolean || $a == true))) {
self.attributes['$[]=']("id", name['$[]']($range(0, -2, false)))
} else {
self.last = name;
self.class_names.$push(name);
};
if (block !== false && block !== nil) {
($a = ($b = self.owner)['$extend!'], $a._p = block.$to_proc(), $a).call($b, self)};
return self;
};
def['$[]'] = function(names) {
var $a, self = this;
names = $slice.call(arguments, 0);
if ((($a = self.last) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return nil
};
self.class_names.$pop();
self.class_names.$push([self.last].concat(names).$join("-"));
return self;
};
def.$do = TMP_4 = function() {
var $a, $b, self = this, $iter = TMP_4._p, block = $iter || nil;
TMP_4._p = null;
($a = ($b = self.owner)['$extend!'], $a._p = block.$to_proc(), $a).call($b, self);
return self;
};
($a = ($b = self).$defhelper, $a._p = (TMP_5 = function(hash){var self = TMP_5._s || this, $a, $b, TMP_6;
if (self.attributes == null) self.attributes = nil;
if (hash == null) hash = nil;
return self.attributes['$[]=']("style", ($a = ($b = hash).$map, $a._p = (TMP_6 = function(name, value){var self = TMP_6._s || this;
if (name == null) name = nil;if (value == null) value = nil;
return "" + (name) + ": " + (value)}, TMP_6._s = self, TMP_6), $a).call($b).$join(";"))}, TMP_5._s = self, TMP_5), $a).call($b, "style");
($a = ($c = self).$defhelper, $a._p = (TMP_7 = function(hash){var self = TMP_7._s || this, $a, $b, TMP_8;
if (hash == null) hash = nil;
return ($a = ($b = hash).$each, $a._p = (TMP_8 = function(name, value){var self = TMP_8._s || this;
if (self.attributes == null) self.attributes = nil;
if (name == null) name = nil;if (value == null) value = nil;
return self.attributes['$[]=']("data-" + (name), value.$to_s())}, TMP_8._s = self, TMP_8), $a).call($b)}, TMP_7._s = self, TMP_7), $a).call($c, "data");
return (def.$inspect = function() {
var $a, self = this;
if ((($a = self.children['$empty?']()) !== nil && (!$a._isBoolean || $a == true))) {
return "#<HTML::Element(" + (self.name.$upcase()) + ")>"
} else {
return "#<HTML::Element(" + (self.name.$upcase()) + "): " + (self.children.$inspect()['$[]']($range(1, -2, false))) + ">"
};
}, nil) && 'inspect';
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $range = $opal.range;
$opal.add_stubs(['$attr_reader', '$raise', '$==', '$arity', '$instance_exec', '$to_proc', '$call', '$<<', '$first', '$===', '$instance_eval', '$each', '$end_with?', '$to_s', '$empty?', '$heredoc', '$shift', '$new', '$[]', '$inspect']);
;
;
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope, TMP_1, TMP_2, TMP_4, TMP_5;
def.current = def.roots = def.version = nil;
self.$attr_reader("version");
def.$initialize = TMP_1 = function(version) {
var $a, $b, self = this, $iter = TMP_1._p, block = $iter || nil;
if (version == null) {
version = 5
}
TMP_1._p = null;
if (block !== false && block !== nil) {
} else {
(($a = $opal.Object._scope.Kernel) == null ? $opal.cm('Kernel') : $a).$raise((($a = $opal.Object._scope.ArgumentError) == null ? $opal.cm('ArgumentError') : $a), "no block given")
};
self.version = version;
self.roots = [];
self.current = nil;
if (block.$arity()['$=='](0)) {
return ($a = ($b = self).$instance_exec, $a._p = block.$to_proc(), $a).call($b)
} else {
return block.$call(self)
};
};
def['$<<'] = function(what) {
var $a, self = this;
return (((($a = self.current) !== false && $a !== nil) ? $a : self.roots))['$<<'](what);
};
def['$root!'] = function() {
var self = this;
return self.roots.$first();
};
def['$roots!'] = function() {
var self = this;
return self.roots;
};
def['$element!'] = function() {
var self = this;
return self.current;
};
def['$extend!'] = TMP_2 = function(element) {
var $a, $b, TMP_3, self = this, $iter = TMP_2._p, block = $iter || nil, old = nil, result = nil;
if (element == null) {
element = nil
}
TMP_2._p = null;
$a = [self.current, element], old = $a[0], self.current = $a[1];
result = block.$call(self);
if ((($a = (($b = $opal.Object._scope.String) == null ? $opal.cm('String') : $b)['$==='](result)) !== nil && (!$a._isBoolean || $a == true))) {
($a = ($b = self.current).$instance_eval, $a._p = (TMP_3 = function(){var self = TMP_3._s || this;
return self.inner_html = result}, TMP_3._s = self, TMP_3), $a).call($b)};
self.current = old;
return self;
};
def.$each = TMP_4 = function() {
var $a, $b, self = this, $iter = TMP_4._p, block = $iter || nil;
TMP_4._p = null;
return ($a = ($b = self.roots).$each, $a._p = block.$to_proc(), $a).call($b);
};
def.$method_missing = TMP_5 = function(name, args) {var $zuper = $slice.call(arguments, 0);
var $a, $b, $c, TMP_6, self = this, $iter = TMP_5._p, block = $iter || nil, content = nil, element = nil, parent = nil, result = nil;
args = $slice.call(arguments, 1);
TMP_5._p = null;
if ((($a = name.$to_s()['$end_with?']("!")) !== nil && (!$a._isBoolean || $a == true))) {
return $opal.find_super_dispatcher(self, 'method_missing', TMP_5, $iter).apply(self, $zuper)};
if ((($a = ((($b = args['$empty?']()) !== false && $b !== nil) ? $b : (($c = $opal.Object._scope.Hash) == null ? $opal.cm('Hash') : $c)['$==='](args.$first()))) !== nil && (!$a._isBoolean || $a == true))) {
} else {
content = ((($a = $opal.Object._scope.Paggio) == null ? $opal.cm('Paggio') : $a))._scope.Utils.$heredoc(args.$shift().$to_s())
};
element = ($a = $scope.Element).$new.apply($a, [self, name].concat(args));
if (content !== false && content !== nil) {
element['$<<'](content)};
if (block !== false && block !== nil) {
parent = self.current;
self.current = element;
result = block.$call(self);
self.current = parent;
if ((($b = (($c = $opal.Object._scope.String) == null ? $opal.cm('String') : $c)['$==='](result)) !== nil && (!$b._isBoolean || $b == true))) {
($b = ($c = element).$instance_eval, $b._p = (TMP_6 = function(){var self = TMP_6._s || this;
return self.inner_html = result}, TMP_6._s = self, TMP_6), $b).call($c)};};
self['$<<'](element);
return element;
};
return (def.$inspect = function() {
var $a, self = this;
if ((($a = self.roots['$empty?']()) !== nil && (!$a._isBoolean || $a == true))) {
return "#<HTML(" + (self.version) + ")>"
} else {
return "#<HTML(" + (self.version) + "): " + (self.roots.$inspect()['$[]']($range(1, -2, false))) + ">"
};
}, nil) && 'inspect';
})(self, $scope.BasicObject)
})(self, null);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var $a, $b, TMP_5, self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass;
$opal.add_stubs(['$map', '$to_proc', '$attr_reader', '$===', '$respond_to?', '$raise', '$class', '$to_u', '$new', '$==', '$convert', '$type', '$number', '$hash', '$each', '$define_method', '$+', '$compatible?', '$-', '$*', '$/', '$to_i', '$to_f', '$private', '$include?', '$class_eval', '$old_percent', '$match', '$[]', '$__send__', '$downcase']);
(function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $CSS(){};
var self = $CSS = $klass($base, $super, 'CSS', $CSS);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Unit(){};
var self = $Unit = $klass($base, $super, 'Unit', $Unit);
var def = self._proto, $scope = self._scope, $a, $b, $c, $d, TMP_1;
def.type = def.number = nil;
$opal.cdecl($scope, 'TYPES', ($a = ($b = ["em", "ex", "ch", "rem", "vh", "vw", "vmin", "vmax", "px", "mm", "cm", "in", "pt", "pc", "s", "deg"]).$map, $a._p = "to_sym".$to_proc(), $a).call($b));
$opal.cdecl($scope, 'COMPATIBLE', ($a = ($c = ["in", "pt", "mm", "cm", "px", "pc"]).$map, $a._p = "to_sym".$to_proc(), $a).call($c));
self.$attr_reader("type", "number");
def.$initialize = function(number, type) {
var self = this;
self.number = number;
return self.type = type;
};
def.$coerce = function(other) {
var self = this;
return [self, other];
};
def['$=='] = function(other) {
var $a, self = this;
if ((($a = $scope.Unit['$==='](other)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
if ((($a = other['$respond_to?']("to_u")) !== nil && (!$a._isBoolean || $a == true))) {
} else {
self.$raise($scope.TypeError, "no implicit conversion of " + (other.$class()) + " into Unit")
};
other = other.$to_u();
};
if ((($a = $scope.Unit['$==='](other)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
other = $scope.Unit.$new(other, self.type)
};
return self.number['$=='](self.$convert(other, self.type));
};
def['$==='] = function(other) {
var $a, self = this;
return (($a = self.type['$=='](other.$type())) ? self.number['$=='](other.$number()) : $a);
};
$opal.defn(self, '$eql?', def['$==']);
def.$hash = function() {
var self = this;
return [self.number, self.type].$hash();
};
($a = ($d = $scope.TYPES).$each, $a._p = (TMP_1 = function(name){var self = TMP_1._s || this, $a, $b, TMP_2;
if (name == null) name = nil;
return ($a = ($b = self).$define_method, $a._p = (TMP_2 = function(){var self = TMP_2._s || this;
return $scope.Unit.$new(self.$convert(self, name), name)}, TMP_2._s = self, TMP_2), $a).call($b, name)}, TMP_1._s = self, TMP_1), $a).call($d);
def['$+'] = function(other) {
var $a, $b, self = this;
if ((($a = $scope.Unit['$==='](other)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return $scope.Unit.$new(self.number['$+'](other), self.type)
};
if (self.type['$=='](other.$type())) {
return $scope.Unit.$new(self.number['$+'](other.$number()), self.type)
} else if ((($a = ($b = self['$compatible?'](self), $b !== false && $b !== nil ?self['$compatible?'](other) : $b)) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Unit.$new(self.number['$+'](self.$convert(other, self.type)), self.type)
} else {
return self.$raise($scope.ArgumentError, "" + (other.$type()) + " isn't compatible with " + (self.type))
};
};
def['$-'] = function(other) {
var $a, $b, self = this;
if ((($a = $scope.Unit['$==='](other)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return $scope.Unit.$new(self.number['$-'](other), self.type)
};
if (self.type['$=='](other.$type())) {
return $scope.Unit.$new(self.number['$-'](other.$number()), self.type)
} else if ((($a = ($b = self['$compatible?'](self), $b !== false && $b !== nil ?self['$compatible?'](other) : $b)) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Unit.$new(self.number['$-'](self.$convert(other, self.type)), self.type)
} else {
return self.$raise($scope.ArgumentError, "" + (other.$type()) + " isn't compatible with " + (self.type))
};
};
def['$*'] = function(other) {
var $a, $b, self = this;
if ((($a = $scope.Unit['$==='](other)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return $scope.Unit.$new(self.number['$*'](other), self.type)
};
if (self.type['$=='](other.$type())) {
return $scope.Unit.$new(self.number['$*'](other.$number()), self.type)
} else if ((($a = ($b = self['$compatible?'](self), $b !== false && $b !== nil ?self['$compatible?'](other) : $b)) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Unit.$new(self.number['$*'](self.$convert(other, self.type)), self.type)
} else {
return self.$raise($scope.ArgumentError, "" + (other.$type()) + " isn't compatible with " + (self.type))
};
};
def['$/'] = function(other) {
var $a, $b, self = this;
if ((($a = $scope.Unit['$==='](other)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return $scope.Unit.$new(self.number['$/'](other), self.type)
};
if (self.type['$=='](other.$type())) {
return $scope.Unit.$new(self.number['$/'](other.$number()), self.type)
} else if ((($a = ($b = self['$compatible?'](self), $b !== false && $b !== nil ?self['$compatible?'](other) : $b)) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Unit.$new(self.number['$/'](self.$convert(other, self.type)), self.type)
} else {
return self.$raise($scope.ArgumentError, "" + (other.$type()) + " isn't compatible with " + (self.type))
};
};
def['$-@'] = function() {
var self = this;
return $scope.Unit.$new(self.number['$*'](-1), self.type);
};
def['$+@'] = function() {
var self = this;
return $scope.Unit.$new(self.number, self.type);
};
def.$to_i = function() {
var self = this;
return self.number.$to_i();
};
def.$to_f = function() {
var self = this;
return self.number.$to_f();
};
def.$to_u = function() {
var self = this;
return self;
};
def.$to_s = function() {
var self = this;
return "" + (self.number) + (self.type);
};
$opal.defn(self, '$to_str', def.$to_s);
$opal.defn(self, '$inspect', def.$to_s);
self.$private();
def['$compatible?'] = function(unit) {
var self = this;
return $scope.COMPATIBLE['$include?'](unit.$type());
};
return (def.$convert = function(unit, type) {
var self = this, value = nil, px = nil, $case = nil;
value = unit.$number();
if (unit.$type()['$=='](type)) {
return value};
px = (function() {$case = unit.$type();if ("in"['$===']($case)) {return value['$*'](96)}else if ("pt"['$===']($case)) {return value['$*'](4.0)['$/'](3.0)}else if ("pc"['$===']($case)) {return value['$/'](12)['$*'](4.0)['$/'](3.0)}else if ("mm"['$===']($case)) {return value['$*'](3.77953)}else if ("cm"['$===']($case)) {return value['$*'](10)['$*'](3.77953)}else if ("px"['$===']($case)) {return value}else { return nil }})();
return (function() {$case = type;if ("in"['$===']($case)) {return px['$/'](96.0)}else if ("pt"['$===']($case)) {return px['$/'](4.0)['$/'](3.0)}else if ("pc"['$===']($case)) {return px['$*'](12)['$/'](4.0)['$/'](3.0)}else if ("mm"['$===']($case)) {return px['$/'](3.77953)}else if ("cm"['$===']($case)) {return px['$/'](10)['$/'](3.77953)}else if ("px"['$===']($case)) {return px}else { return nil }})();
}, nil) && 'convert';
})(self, null)
})(self, $scope.BasicObject)
})(self, null);
(function($base, $super) {
function $Numeric(){};
var self = $Numeric = $klass($base, $super, 'Numeric', $Numeric);
var def = self._proto, $scope = self._scope, $a, $b, TMP_3;
($a = ($b = ((($scope.Paggio)._scope.CSS)._scope.Unit)._scope.TYPES).$each, $a._p = (TMP_3 = function(name){var self = TMP_3._s || this, $a, $b, TMP_4;
if (name == null) name = nil;
return ($a = ($b = self).$define_method, $a._p = (TMP_4 = function(){var self = TMP_4._s || this;
return (($scope.Paggio)._scope.CSS)._scope.Unit.$new(self, name)}, TMP_4._s = self, TMP_4), $a).call($b, name)}, TMP_3._s = self, TMP_3), $a).call($b);
return (def.$to_u = function() {
var self = this;
return self;
}, nil) && 'to_u';
})(self, null);
($a = ($b = [$scope.Fixnum, $scope.Float]).$each, $a._p = (TMP_5 = function(klass){var self = TMP_5._s || this, $a, $b, TMP_6;
if (klass == null) klass = nil;
return ($a = ($b = klass).$class_eval, $a._p = (TMP_6 = function(){var self = TMP_6._s || this;
self._proto.$old_percent = self._proto['$%'];
return ($opal.defn(self, '$%', function(other) {
var self = this;
if (other == null) {
other = nil
}
if (other !== false && other !== nil) {
return self.$old_percent(other)
} else {
return (($scope.Paggio)._scope.CSS)._scope.Unit.$new(self, "%")
};
}), nil) && '%';}, TMP_6._s = self, TMP_6), $a).call($b)}, TMP_5._s = self, TMP_5), $a).call($b);
(function($base, $super) {
function $String(){};
var self = $String = $klass($base, $super, 'String', $String);
var def = self._proto, $scope = self._scope;
return (def.$to_u = function() {
var $a, self = this, matches = nil, value = nil, unit = nil;
if ((($a = matches = self.$match(/^([\d+.]+)(.+)?$/)) !== nil && (!$a._isBoolean || $a == true))) {
value = matches['$[]'](1).$to_f();
if ((($a = unit = matches['$[]'](2)) !== nil && (!$a._isBoolean || $a == true))) {
return value.$__send__(unit.$downcase())
} else {
return value
};
} else {
return 0
};
}, nil) && 'to_u'
})(self, null);
return (function($base, $super) {
function $NilClass(){};
var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass);
var def = self._proto, $scope = self._scope;
return (def.$to_u = function() {
var self = this;
return 0;
}, nil) && 'to_u'
})(self, null);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass;
$opal.add_stubs(['$each', '$define_method', '$new', '$map', '$to_proc']);
(function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $CSS(){};
var self = $CSS = $klass($base, $super, 'CSS', $CSS);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Color(){};
var self = $Color = $klass($base, $super, 'Color', $Color);
var def = self._proto, $scope = self._scope;
return (def.$initialize = function(value, type) {
var self = this;
self.internal = value;
return self.type = type;
}, nil) && 'initialize'
})(self, null)
})(self, $scope.BasicObject)
})(self, null);
(function($base, $super) {
function $String(){};
var self = $String = $klass($base, $super, 'String', $String);
var def = self._proto, $scope = self._scope, $a, $b, TMP_1, $c, $d;
return ($a = ($b = ($c = ($d = ["rgb", "rgba", "hsl", "hsla"]).$map, $c._p = "to_sym".$to_proc(), $c).call($d)).$each, $a._p = (TMP_1 = function(name){var self = TMP_1._s || this, $a, $b, TMP_2;
if (name == null) name = nil;
return ($a = ($b = self).$define_method, $a._p = (TMP_2 = function(){var self = TMP_2._s || this;
return (($scope.Paggio)._scope.CSS)._scope.Color.$new(self, name)}, TMP_2._s = self, TMP_2), $a).call($b, name)}, TMP_1._s = self, TMP_1), $a).call($b)
})(self, null);
return (function($base, $super) {
function $Array(){};
var self = $Array = $klass($base, $super, 'Array', $Array);
var def = self._proto, $scope = self._scope, $a, $b, TMP_3, $c, $d;
return ($a = ($b = ($c = ($d = ["rgb", "rgba", "hsl", "hsla"]).$map, $c._p = "to_sym".$to_proc(), $c).call($d)).$each, $a._p = (TMP_3 = function(name){var self = TMP_3._s || this, $a, $b, TMP_4;
if (name == null) name = nil;
return ($a = ($b = self).$define_method, $a._p = (TMP_4 = function(){var self = TMP_4._s || this;
return (($scope.Paggio)._scope.CSS)._scope.Color.$new(self, name)}, TMP_4._s = self, TMP_4), $a).call($b, name)}, TMP_3._s = self, TMP_3), $a).call($b)
})(self, null);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $range = $opal.range, $hash2 = $opal.hash2;
$opal.add_stubs(['$new', '$==', '$arity', '$instance_exec', '$to_proc', '$call', '$empty?', '$each', '$inspect', '$===', '$first', '$>', '$length', '$raise', '$style', '$name', '$value', '$[]', '$join', '$map', '$to_i', '$*', '$to_s', '$end_with?', '$respond_to?', '$__send__', '$<<', '$last', '$pop', '$!', '$other', '$shift', '$horizontal?', '$private']);
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $CSS(){};
var self = $CSS = $klass($base, $super, 'CSS', $CSS);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope, $a, TMP_1, TMP_2, TMP_11;
def.style = def.important = nil;
$opal.cdecl($scope, 'Style', (($a = $opal.Object._scope.Struct) == null ? $opal.cm('Struct') : $a).$new("name", "value", "important"));
def.$initialize = TMP_1 = function() {
var $a, $b, self = this, $iter = TMP_1._p, block = $iter || nil;
TMP_1._p = null;
self.style = [];
if (block !== false && block !== nil) {
if (block.$arity()['$=='](0)) {
return ($a = ($b = self).$instance_exec, $a._p = block.$to_proc(), $a).call($b)
} else {
return block.$call(self)
}
} else {
return nil
};
};
def['$empty?'] = function() {
var self = this;
return self.style['$empty?']();
};
def.$each = TMP_2 = function() {
var $a, $b, self = this, $iter = TMP_2._p, block = $iter || nil;
TMP_2._p = null;
return ($a = ($b = self.style).$each, $a._p = block.$to_proc(), $a).call($b);
};
def.$gradient = function(args) {
var $a, self = this;
args = $slice.call(arguments, 0);
return ($a = $scope.Gradient).$new.apply($a, [].concat(args));
};
def.$url = function(arg) {
var self = this;
return "url(" + (arg.$inspect()) + ")";
};
def.$background = function(args) {
var $a, $b, TMP_3, $c, TMP_4, self = this;
args = $slice.call(arguments, 0);
if ((($a = $scope.Gradient['$==='](args.$first())) !== nil && (!$a._isBoolean || $a == true))) {
if (args.$length()['$>'](1)) {
self.$raise($scope.NotImplementedError, "multiple gradients not implemented yet")};
return ($a = ($b = args.$first()).$each, $a._p = (TMP_3 = function(s){var self = TMP_3._s || this, $a;
if (s == null) s = nil;
return self.$style(((($a = s.$name()) !== false && $a !== nil) ? $a : "background-image"), s.$value())}, TMP_3._s = self, TMP_3), $a).call($b);
} else if ((($a = (($c = $opal.Object._scope.Hash) == null ? $opal.cm('Hash') : $c)['$==='](args.$first())) !== nil && (!$a._isBoolean || $a == true))) {
return ($a = ($c = args.$first()).$each, $a._p = (TMP_4 = function(sub, value){var self = TMP_4._s || this;
if (sub == null) sub = nil;if (value == null) value = nil;
return self.$style("background-" + (sub), value)}, TMP_4._s = self, TMP_4), $a).call($c)
} else {
return self.$style("background", args)
};
};
def.$border = function(args) {
var $a, $b, TMP_5, self = this, options = nil;
args = $slice.call(arguments, 0);
if ((($a = (($b = $opal.Object._scope.Hash) == null ? $opal.cm('Hash') : $b)['$==='](args.$first())) !== nil && (!$a._isBoolean || $a == true))) {
if (args.$length()['$=='](1)) {
options = args.$first()};
return ($a = ($b = options).$each, $a._p = (TMP_5 = function(name, value){var self = TMP_5._s || this, $a, $b, TMP_6, $c, TMP_8, $case = nil;
if (name == null) name = nil;if (value == null) value = nil;
return (function() {$case = name;if ("radius"['$===']($case)) {if ((($a = (($b = $opal.Object._scope.Hash) == null ? $opal.cm('Hash') : $b)['$==='](value)) !== nil && (!$a._isBoolean || $a == true))) {
return ($a = ($b = value).$each, $a._p = (TMP_6 = function(horizontal, value){var self = TMP_6._s || this, $a, $b, TMP_7;
if (horizontal == null) horizontal = nil;if (value == null) value = nil;
return ($a = ($b = value).$each, $a._p = (TMP_7 = function(vertical, value){var self = TMP_7._s || this;
if (vertical == null) vertical = nil;if (value == null) value = nil;
self.$style("-moz-border-radius-" + (horizontal) + (vertical), value);
self.$style("-webkit-border-" + (horizontal) + "-" + (vertical) + "-radius", value);
return self.$style("border-" + (horizontal) + "-" + (vertical) + "-radius", value);}, TMP_7._s = self, TMP_7), $a).call($b)}, TMP_6._s = self, TMP_6), $a).call($b)
} else {
self.$style("-moz-border-radius", value);
self.$style("-webkit-border-radius", value);
return self.$style("border-radius", value);
}}else if ("color"['$===']($case)) {if ((($a = (($c = $opal.Object._scope.Hash) == null ? $opal.cm('Hash') : $c)['$==='](value)) !== nil && (!$a._isBoolean || $a == true))) {
return ($a = ($c = value).$each, $a._p = (TMP_8 = function(name, value){var self = TMP_8._s || this;
if (name == null) name = nil;if (value == null) value = nil;
return self.$style("border-" + (name) + "-color", value)}, TMP_8._s = self, TMP_8), $a).call($c)
} else {
return self.$style("border-color", value)
}}else {return self.$style("border-" + (name), value)}})()}, TMP_5._s = self, TMP_5), $a).call($b);
} else {
return self.$style("border", args)
};
};
def.$box = function(options) {
var $a, $b, TMP_9, self = this;
if ((($a = (($b = $opal.Object._scope.Hash) == null ? $opal.cm('Hash') : $b)['$==='](options)) !== nil && (!$a._isBoolean || $a == true))) {
return ($a = ($b = options).$each, $a._p = (TMP_9 = function(name, value){var self = TMP_9._s || this, $a, $b, TMP_10, $case = nil;
if (name == null) name = nil;if (value == null) value = nil;
return (function() {$case = name;if ("shadow"['$===']($case)) {if ((($a = (($b = $opal.Object._scope.Array) == null ? $opal.cm('Array') : $b)['$==='](value)) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = (($b = $opal.Object._scope.Array) == null ? $opal.cm('Array') : $b)['$==='](value['$[]'](0))) !== nil && (!$a._isBoolean || $a == true))) {
value = ($a = ($b = value).$map, $a._p = (TMP_10 = function(v){var self = TMP_10._s || this;
if (v == null) v = nil;
return v.$join(" ")}, TMP_10._s = self, TMP_10), $a).call($b).$join(", ")
} else {
value = value.$join(" ")
}};
self.$style("-moz-box-shadow", value);
self.$style("-webkit-box-shadow", value);
return self.$style("box-shadow", value);}else {return self.$style("box-" + (name), value)}})()}, TMP_9._s = self, TMP_9), $a).call($b)
} else {
return self.$style("box", options)
};
};
def.$opacity = function(value) {
var self = this;
self.$style("opacity", value);
self.$style("-moz-opacity", value);
self.$style("-ms-filter", "\"progid:DXImageTransform.Microsoft.Alpha(Opacity=" + ((value['$*'](100)).$to_i()) + ")\"");
return self.$style("filter", "alpha(opacity=" + ((value['$*'](100)).$to_i()) + ")");
};
def.$animation = function(args) {
var self = this;
args = $slice.call(arguments, 0);
self.$style("animation", args);
return self.$style("-webkit-animation", args);
};
def.$transition = function(args) {
var self = this;
args = $slice.call(arguments, 0);
self.$style("transition", args);
self.$style("-webkit-transition", args);
return self.$style("-moz-transition", args);
};
def.$method_missing = TMP_11 = function(name, args) {
var $a, $b, $c, TMP_12, self = this, $iter = TMP_11._p, block = $iter || nil, important = nil, argument = nil;
args = $slice.call(arguments, 1);
TMP_11._p = null;
name = name.$to_s();
important = name['$end_with?']("!");
if (important !== false && important !== nil) {
name = name['$[]']($range(0, -2, false))};
if (important !== false && important !== nil) {
self.important = true};
if ((($a = (($b = important !== false && important !== nil) ? self['$respond_to?'](name) : $b)) !== nil && (!$a._isBoolean || $a == true))) {
($a = ($b = self).$__send__, $a._p = block.$to_proc(), $a).apply($b, [name].concat(args));
self.important = false;
return nil;};
if (args.$length()['$=='](1)) {
argument = args.$first();
if ((($a = (($c = $opal.Object._scope.Hash) == null ? $opal.cm('Hash') : $c)['$==='](argument)) !== nil && (!$a._isBoolean || $a == true))) {
($a = ($c = argument).$each, $a._p = (TMP_12 = function(sub, value){var self = TMP_12._s || this;
if (sub == null) sub = nil;if (value == null) value = nil;
return self.$style("" + (name) + "-" + (sub), value)}, TMP_12._s = self, TMP_12), $a).call($c)
} else {
self.$style(name, argument)
};
} else {
self.$style(name, args.$join(" "))
};
self.important = false;
return self;
};
def.$style = function(name, value, important) {
var $a, $b, self = this;
if (value == null) {
value = nil
}
if (important == null) {
important = self.important
}
if ((($a = (($b = $opal.Object._scope.Array) == null ? $opal.cm('Array') : $b)['$==='](value)) !== nil && (!$a._isBoolean || $a == true))) {
value = value.$join(" ")};
if ((($a = $scope.Style['$==='](name)) !== nil && (!$a._isBoolean || $a == true))) {
return self.style['$<<'](name)
} else {
return self.style['$<<']($scope.Style.$new(name, value, important))
};
};
def['$style!'] = function(name, value) {
var self = this;
if (value == null) {
value = nil
}
return self.$style(name, value, true);
};
return (function($base, $super) {
function $Gradient(){};
var self = $Gradient = $klass($base, $super, 'Gradient', $Gradient);
var def = self._proto, $scope = self._scope, TMP_13;
def.to = def.from = def.start = def.end = nil;
def.$initialize = function(args) {
var $a, $b, self = this, options = nil;
args = $slice.call(arguments, 0);
options = (function() {if ((($a = (($b = $opal.Object._scope.Hash) == null ? $opal.cm('Hash') : $b)['$==='](args.$last())) !== nil && (!$a._isBoolean || $a == true))) {
return args.$pop()
} else {
return $hash2([], {})
}; return nil; })();
self.to = options['$[]']("to");
self.from = options['$[]']("from");
if ((($a = ($b = self.to, $b !== false && $b !== nil ?self.from['$!']() : $b)) !== nil && (!$a._isBoolean || $a == true))) {
self.from = self.$other(self.to)
} else if ((($a = ($b = self.from, $b !== false && $b !== nil ?self.to['$!']() : $b)) !== nil && (!$a._isBoolean || $a == true))) {
self.to = self.$other(self.from)};
self.start = args.$shift();
return self.end = args.$shift();
};
def.$each = TMP_13 = function() {
var $a, self = this, $iter = TMP_13._p, block = $iter || nil;
TMP_13._p = null;
block.$call(self.$style("-moz-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)"));
if ((($a = self['$horizontal?']()) !== nil && (!$a._isBoolean || $a == true))) {
block.$call(self.$style("-webkit-gradient(linear, " + (self.from) + " top, " + (self.to) + " top, color-stop(0%, " + (self.start) + "), color-stop(100%, " + (self.end) + "))"))
} else {
block.$call(self.$style("-webkit-gradient(linear, left " + (self.from) + ", left " + (self.to) + ", color-stop(0%, " + (self.start) + "), color-stop(100%, " + (self.end) + "))"))
};
block.$call(self.$style("-webkit-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)"));
block.$call(self.$style("-o-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)"));
block.$call(self.$style("-ms-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)"));
return block.$call(self.$style("linear-gradient(to " + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)"));
};
def['$horizontal?'] = function() {
var $a, self = this;
return ((($a = self.to['$==']("left")) !== false && $a !== nil) ? $a : self.to['$==']("right"));
};
def['$vertical?'] = function() {
var $a, self = this;
return ((($a = self.to['$==']("top")) !== false && $a !== nil) ? $a : self.to['$==']("bottom"));
};
self.$private();
def.$other = function(side) {
var self = this, $case = nil;
return (function() {$case = side;if ("left"['$===']($case)) {return "right"}else if ("right"['$===']($case)) {return "left"}else if ("top"['$===']($case)) {return "bottom"}else if ("bottom"['$===']($case)) {return "top"}else { return nil }})();
};
return (def.$style = function(args) {
var $a, self = this;
args = $slice.call(arguments, 0);
if (args.$length()['$=='](1)) {
return $scope.Style.$new(nil, args.$first())
} else {
return ($a = $scope.Style).$new.apply($a, [].concat(args))
};
}, nil) && 'style';
})(self, null);
})(self, $scope.BasicObject)
})(self, $scope.BasicObject)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $range = $opal.range;
$opal.add_stubs(['$new', '$each', '$start_with?', '$+', '$[]', '$==', '$attr_reader', '$raise', '$arity', '$instance_exec', '$to_proc', '$call', '$any?', '$include?', '$<<', '$selector', '$pop', '$__send__', '$definition', '$last']);
;
;
;
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $CSS(){};
var self = $CSS = $klass($base, $super, 'CSS', $CSS);
var def = self._proto, $scope = self._scope, $a, TMP_2, TMP_3, TMP_6;
def.current = nil;
$opal.cdecl($scope, 'Rule', (($a = $opal.Object._scope.Struct) == null ? $opal.cm('Struct') : $a).$new("selector", "definition"));
$opal.defs(self, '$selector', function(list) {
var $a, $b, TMP_1, self = this, result = nil;
result = "";
($a = ($b = list).$each, $a._p = (TMP_1 = function(part){var self = TMP_1._s || this, $a;
if (part == null) part = nil;
if ((($a = part['$start_with?']("&")) !== nil && (!$a._isBoolean || $a == true))) {
return result = result['$+'](part['$[]']($range(1, -1, false)))
} else {
return result = result['$+'](" "['$+'](part))
}}, TMP_1._s = self, TMP_1), $a).call($b);
if (result['$[]'](0)['$=='](" ")) {
return result['$[]']($range(1, -1, false))
} else {
return result
};
});
self.$attr_reader("rules");
def.$initialize = TMP_2 = function() {
var $a, $b, self = this, $iter = TMP_2._p, block = $iter || nil;
TMP_2._p = null;
if (block !== false && block !== nil) {
} else {
(($a = $opal.Object._scope.Kernel) == null ? $opal.cm('Kernel') : $a).$raise((($a = $opal.Object._scope.ArgumentError) == null ? $opal.cm('ArgumentError') : $a), "no block given")
};
self.selector = [];
self.current = [];
self.rules = [];
if (block.$arity()['$=='](0)) {
return ($a = ($b = self).$instance_exec, $a._p = block.$to_proc(), $a).call($b)
} else {
return block.$call(self)
};
};
def.$rule = TMP_3 = function(names) {
var $a, $b, $c, TMP_4, TMP_5, self = this, $iter = TMP_3._p, block = $iter || nil;
names = $slice.call(arguments, 0);
TMP_3._p = null;
if (block !== false && block !== nil) {
} else {
return nil
};
if ((($a = ($b = ($c = names)['$any?'], $b._p = (TMP_4 = function(n){var self = TMP_4._s || this;
if (n == null) n = nil;
return n['$include?'](",")}, TMP_4._s = self, TMP_4), $b).call($c)) !== nil && (!$a._isBoolean || $a == true))) {
(($a = $opal.Object._scope.Kernel) == null ? $opal.cm('Kernel') : $a).$raise((($a = $opal.Object._scope.ArgumentError) == null ? $opal.cm('ArgumentError') : $a), "selectors cannot contain commas")};
return ($a = ($b = names).$each, $a._p = (TMP_5 = function(name){var self = TMP_5._s || this;
if (self.selector == null) self.selector = nil;
if (self.current == null) self.current = nil;
if (self.rules == null) self.rules = nil;
if (name == null) name = nil;
self.selector['$<<'](name);
self.current['$<<']($scope.Rule.$new($scope.CSS.$selector(self.selector), $scope.Definition.$new()));
block.$call(self);
self.selector.$pop();
return self.rules['$<<'](self.current.$pop());}, TMP_5._s = self, TMP_5), $a).call($b);
};
return (def.$method_missing = TMP_6 = function(name, args) {
var $a, $b, self = this, $iter = TMP_6._p, block = $iter || nil;
args = $slice.call(arguments, 1);
TMP_6._p = null;
return ($a = ($b = self.current.$last().$definition()).$__send__, $a._p = block.$to_proc(), $a).apply($b, [name].concat(args));
}, nil) && 'method_missing';
})(self, $scope.BasicObject);
return (function($base, $super) {
function $HTML(){};
var self = $HTML = $klass($base, $super, 'HTML', $HTML);
var def = self._proto, $scope = self._scope, TMP_7;
def.current = def.roots = nil;
return (def.$style = TMP_7 = function() {
var $a, $b, self = this, $iter = TMP_7._p, block = $iter || nil;
TMP_7._p = null;
return (((($a = self.current) !== false && $a !== nil) ? $a : self.roots))['$<<'](($a = ($b = $scope.CSS).$new, $a._p = block.$to_proc(), $a).call($b));
}, nil) && 'style'
})(self, $scope.BasicObject);
})(self, null);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $range = $opal.range;
$opal.add_stubs(['$include', '$new', '$call', '$close', '$attr_accessor', '$length', '$include?', '$!', '$check_readable', '$==', '$===', '$>=', '$raise', '$>', '$+', '$-', '$seek', '$enum_for', '$eof?', '$ord', '$[]', '$check_writable', '$String', '$write', '$closed_write?', '$closed_read?']);
return (function($base, $super) {
function $StringIO(){};
var self = $StringIO = $klass($base, $super, 'StringIO', $StringIO);
var def = self._proto, $scope = self._scope, TMP_1, TMP_2, TMP_3;
def.position = def.string = def.closed = nil;
self.$include(($scope.IO)._scope.Readable);
self.$include(($scope.IO)._scope.Writable);
$opal.defs(self, '$open', TMP_1 = function(string, mode) {
var self = this, $iter = TMP_1._p, block = $iter || nil, io = nil, res = nil;
if (string == null) {
string = ""
}
if (mode == null) {
mode = nil
}
TMP_1._p = null;
io = self.$new(string, mode);
res = block.$call(io);
io.$close();
return res;
});
self.$attr_accessor("string");
def.$initialize = function(string, mode) {
var $a, $b, self = this;
if (string == null) {
string = ""
}
if (mode == null) {
mode = "rw"
}
self.string = string;
self.position = string.$length();
if ((($a = ($b = mode['$include?']("r"), $b !== false && $b !== nil ?mode['$include?']("w")['$!']() : $b)) !== nil && (!$a._isBoolean || $a == true))) {
return self.closed = "write"
} else if ((($a = ($b = mode['$include?']("w"), $b !== false && $b !== nil ?mode['$include?']("r")['$!']() : $b)) !== nil && (!$a._isBoolean || $a == true))) {
return self.closed = "read"
} else {
return nil
};
};
def['$eof?'] = function() {
var self = this;
self.$check_readable();
return self.position['$=='](self.string.$length());
};
$opal.defn(self, '$eof', def['$eof?']);
def.$seek = function(pos, whence) {
var self = this, $case = nil;
if (whence == null) {
whence = ($scope.IO)._scope.SEEK_SET
}
$case = whence;if (($scope.IO)._scope.SEEK_SET['$===']($case)) {if (pos['$>='](0)) {
} else {
self.$raise(($scope.Errno)._scope.EINVAL)
};
self.position = pos;}else if (($scope.IO)._scope.SEEK_CUR['$===']($case)) {if (self.position['$+'](pos)['$>'](self.string.$length())) {
self.position = self.string.$length()
} else {
self.position = self.position['$+'](pos)
}}else if (($scope.IO)._scope.SEEK_END['$===']($case)) {if (pos['$>'](self.string.$length())) {
self.position = 0
} else {
self.position = self.position['$-'](pos)
}};
return 0;
};
def.$tell = function() {
var self = this;
return self.position;
};
$opal.defn(self, '$pos', def.$tell);
$opal.defn(self, '$pos=', def.$seek);
def.$rewind = function() {
var self = this;
return self.$seek(0);
};
def.$each_byte = TMP_2 = function() {
var $a, $b, self = this, $iter = TMP_2._p, block = $iter || nil, i = nil;
TMP_2._p = null;
if (block !== false && block !== nil) {
} else {
return self.$enum_for("each_byte")
};
self.$check_readable();
i = self.position;
while (!((($b = self['$eof?']()) !== nil && (!$b._isBoolean || $b == true)))) {
block.$call(self.string['$[]'](i).$ord());
i = i['$+'](1);};
return self;
};
def.$each_char = TMP_3 = function() {
var $a, $b, self = this, $iter = TMP_3._p, block = $iter || nil, i = nil;
TMP_3._p = null;
if (block !== false && block !== nil) {
} else {
return self.$enum_for("each_char")
};
self.$check_readable();
i = self.position;
while (!((($b = self['$eof?']()) !== nil && (!$b._isBoolean || $b == true)))) {
block.$call(self.string['$[]'](i));
i = i['$+'](1);};
return self;
};
def.$write = function(string) {
var self = this, before = nil, after = nil;
self.$check_writable();
string = self.$String(string);
if (self.string.$length()['$=='](self.position)) {
self.string = self.string['$+'](string);
return self.position = self.position['$+'](string.$length());
} else {
before = self.string['$[]']($range(0, self.position['$-'](1), false));
after = self.string['$[]']($range(self.position['$+'](string.$length()), -1, false));
self.string = before['$+'](string)['$+'](after);
return self.position = self.position['$+'](string.$length());
};
};
def.$read = function(length, outbuf) {
var $a, self = this, string = nil, str = nil;
if (length == null) {
length = nil
}
if (outbuf == null) {
outbuf = nil
}
self.$check_readable();
if ((($a = self['$eof?']()) !== nil && (!$a._isBoolean || $a == true))) {
return nil};
string = (function() {if (length !== false && length !== nil) {
str = self.string['$[]'](self.position, length);
self.position = self.position['$+'](length);
return str;
} else {
str = self.string['$[]']($range(self.position, -1, false));
self.position = self.string.$length();
return str;
}; return nil; })();
if (outbuf !== false && outbuf !== nil) {
return outbuf.$write(string)
} else {
return string
};
};
def.$close = function() {
var self = this;
return self.closed = "both";
};
def.$close_read = function() {
var self = this;
if (self.closed['$==']("write")) {
return self.closed = "both"
} else {
return self.closed = "read"
};
};
def.$close_write = function() {
var self = this;
if (self.closed['$==']("read")) {
return self.closed = "both"
} else {
return self.closed = "write"
};
};
def['$closed?'] = function() {
var self = this;
return self.closed['$==']("both");
};
def['$closed_read?'] = function() {
var $a, self = this;
return ((($a = self.closed['$==']("read")) !== false && $a !== nil) ? $a : self.closed['$==']("both"));
};
def['$closed_write?'] = function() {
var $a, self = this;
return ((($a = self.closed['$==']("write")) !== false && $a !== nil) ? $a : self.closed['$==']("both"));
};
def.$check_writable = function() {
var $a, self = this;
if ((($a = self['$closed_write?']()) !== nil && (!$a._isBoolean || $a == true))) {
return self.$raise($scope.IOError, "not opened for writing")
} else {
return nil
};
};
return (def.$check_readable = function() {
var $a, self = this;
if ((($a = self['$closed_read?']()) !== nil && (!$a._isBoolean || $a == true))) {
return self.$raise($scope.IOError, "not opened for reading")
} else {
return nil
};
}, nil) && 'check_readable';
})(self, $scope.IO)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$[]=', '$to_h', '$[]', '$dup', '$deep_merge!', '$call', '$replace', '$===', '$new', '$merge', '$each', '$string', '$indent?', '$+', '$-', '$puts', '$*', '$chomp', '$lines', '$print', '$gsub', '$to_s', '$for', '$version', '$indent', '$format', '$instance_eval', '$empty?', '$map', '$escape', '$<<', '$join', '$definition', '$selector', '$name', '$value', '$important', '$reverse', '$rules']);
;
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope, $a, $b, TMP_7, $c, TMP_10, $d, TMP_17;
(function($base, $super) {
function $Formatter(){};
var self = $Formatter = $klass($base, $super, 'Formatter', $Formatter);
var def = self._proto, $scope = self._scope, TMP_1, TMP_2, TMP_4, TMP_5;
def.options = def.io = nil;
$opal.defs(self, '$to_h', function() {
var $a, self = this;
if (self.formatters == null) self.formatters = nil;
return ((($a = self.formatters) !== false && $a !== nil) ? $a : self.formatters = $hash2([], {}));
});
$opal.defs(self, '$for', TMP_1 = function(klass) {
var self = this, $iter = TMP_1._p, block = $iter || nil;
TMP_1._p = null;
if (block !== false && block !== nil) {
return self.$to_h()['$[]='](klass, block)
} else {
return self.$to_h()['$[]'](klass)
};
});
$opal.defs(self, '$options', TMP_2 = function(options) {
var self = this, $iter = TMP_2._p, block = $iter || nil, old = nil, result = nil;
TMP_2._p = null;
old = $scope.OPTIONS.$dup();
$scope.Utils['$deep_merge!']($scope.OPTIONS, options);
result = block.$call();
$scope.OPTIONS.$replace(old);
return result;
});
$opal.cdecl($scope, 'OPTIONS', $hash2(["indent"], {"indent": $hash2(["level", "with"], {"level": 0, "with": "\t"})}));
def.$initialize = function(io, options) {
var $a, self = this;
if (io == null) {
io = nil
}
if (options == null) {
options = $hash2([], {})
}
if ((($a = $scope.Hash['$==='](io)) !== nil && (!$a._isBoolean || $a == true))) {
self.io = $scope.StringIO.$new();
self.options = io;
} else {
self.io = ((($a = io) !== false && $a !== nil) ? $a : $scope.StringIO.$new());
self.options = options;
};
return self.options = $scope.OPTIONS.$merge(self.options);
};
def.$format = function(item) {
var $a, $b, TMP_3, self = this;
($a = ($b = $scope.Formatter.$to_h()).$each, $a._p = (TMP_3 = function(klass, block){var self = TMP_3._s || this, $a;
if (klass == null) klass = nil;if (block == null) block = nil;
if ((($a = klass['$==='](item)) !== nil && (!$a._isBoolean || $a == true))) {
block.$call(self, item);
return ($breaker.$v = nil, $breaker);
} else {
return nil
}}, TMP_3._s = self, TMP_3), $a).call($b);
return self;
};
def.$to_s = function() {
var self = this;
return self.io.$string();
};
def['$indent?'] = TMP_4 = function() {
var self = this, $iter = TMP_4._p, block = $iter || nil;
TMP_4._p = null;
try {
return self.options['$[]']("indent")['$[]']("level")
} catch ($err) {if (true) {
return false
}else { throw $err; }
};
};
def.$indent = TMP_5 = function() {
var $a, $b, self = this, $iter = TMP_5._p, block = $iter || nil;
TMP_5._p = null;
if ((($a = self['$indent?']()) !== nil && (!$a._isBoolean || $a == true))) {
($a = "level", $b = self.options['$[]']("indent"), $b['$[]=']($a, $b['$[]']($a)['$+'](1)));
block.$call();
return ($a = "level", $b = self.options['$[]']("indent"), $b['$[]=']($a, $b['$[]']($a)['$-'](1)));
} else {
return block.$call()
};
};
def.$print = function(text) {
var $a, $b, TMP_6, self = this, level = nil;
if ((($a = level = self['$indent?']()) !== nil && (!$a._isBoolean || $a == true))) {
return ($a = ($b = text.$lines()).$each, $a._p = (TMP_6 = function(line){var self = TMP_6._s || this;
if (self.io == null) self.io = nil;
if (self.options == null) self.options = nil;
if (line == null) line = nil;
return self.io.$puts("" + (self.options['$[]']("indent")['$[]']("with")['$*'](level)) + (line.$chomp()))}, TMP_6._s = self, TMP_6), $a).call($b)
} else {
return self.io.$print(text)
};
};
return (def.$escape = function(string) {
var self = this;
return string.$to_s().$gsub(/["><']|&(?!([a-zA-Z]+|(#\d+));)/, $hash2(["&", ">", "<", "\"", "'"], {"&": "&amp;", ">": "&gt;", "<": "&lt;", "\"": "&quot;", "'": "&#39;"}));
}, nil) && 'escape';
})(self, null);
($a = ($b = $scope.Formatter).$for, $a._p = (TMP_7 = function(f, item){var self = TMP_7._s || this, $a, $b, TMP_8, $case = nil;
if (f == null) f = nil;if (item == null) item = nil;
$case = item.$version();if ((5)['$===']($case)) {f.$print("<!DOCTYPE html>")};
f.$print("<html>");
($a = ($b = f).$indent, $a._p = (TMP_8 = function(){var self = TMP_8._s || this, $a, $b, TMP_9;
return ($a = ($b = item).$each, $a._p = (TMP_9 = function(root){var self = TMP_9._s || this;
if (root == null) root = nil;
return f.$format(root)}, TMP_9._s = self, TMP_9), $a).call($b)}, TMP_8._s = self, TMP_8), $a).call($b);
return f.$print("</html>");}, TMP_7._s = self, TMP_7), $a).call($b, $scope.HTML);
($a = ($c = $scope.Formatter).$for, $a._p = (TMP_10 = function(f, item){var self = TMP_10._s || this, $a, $b, $c, TMP_11, TMP_12, $d, TMP_13, name = nil, attributes = nil, class_names = nil, attrs = nil;
if (f == null) f = nil;if (item == null) item = nil;
$a = $opal.to_ary(($b = ($c = item).$instance_eval, $b._p = (TMP_11 = function(){var self = TMP_11._s || this;
if (self.name == null) self.name = nil;
if (self.attributes == null) self.attributes = nil;
if (self.class_names == null) self.class_names = nil;
return [self.name, self.attributes, self.class_names]}, TMP_11._s = self, TMP_11), $b).call($c)), name = ($a[0] == null ? nil : $a[0]), attributes = ($a[1] == null ? nil : $a[1]), class_names = ($a[2] == null ? nil : $a[2]);
if ((($a = ($b = attributes['$empty?'](), $b !== false && $b !== nil ?class_names['$empty?']() : $b)) !== nil && (!$a._isBoolean || $a == true))) {
f.$print("<" + (name) + ">")
} else {
attrs = ($a = ($b = attributes).$map, $a._p = (TMP_12 = function(key, value){var self = TMP_12._s || this;
if (key == null) key = nil;if (value == null) value = nil;
return "" + (f.$escape(key)) + "=\"" + (f.$escape(value)) + "\""}, TMP_12._s = self, TMP_12), $a).call($b);
if ((($a = class_names['$empty?']()) !== nil && (!$a._isBoolean || $a == true))) {
} else {
attrs['$<<']("class=\"" + (f.$escape(class_names.$join(" "))) + "\"")
};
f.$print("<" + (name) + " " + (attrs.$join(" ")) + ">");
};
($a = ($d = f).$indent, $a._p = (TMP_13 = function(){var self = TMP_13._s || this, $a, $b, $c, TMP_14, TMP_15, inner = nil;
if ((($a = inner = ($b = ($c = item).$instance_eval, $b._p = (TMP_14 = function(){var self = TMP_14._s || this;
if (self.inner_html == null) self.inner_html = nil;
return self.inner_html}, TMP_14._s = self, TMP_14), $b).call($c)) !== nil && (!$a._isBoolean || $a == true))) {
return f.$print(inner)
} else {
return ($a = ($b = item).$each, $a._p = (TMP_15 = function(child){var self = TMP_15._s || this, $a, $b, TMP_16, $case = nil;
if (child == null) child = nil;
return (function() {$case = child;if ($scope.String['$===']($case)) {return f.$print(f.$escape(child))}else if ($scope.CSS['$===']($case)) {f.$print("<style>");
($a = ($b = f).$indent, $a._p = (TMP_16 = function(){var self = TMP_16._s || this;
return f.$format(child)}, TMP_16._s = self, TMP_16), $a).call($b);
return f.$print("</style>");}else {return f.$format(child)}})()}, TMP_15._s = self, TMP_15), $a).call($b)
}}, TMP_13._s = self, TMP_13), $a).call($d);
return f.$print("</" + (name) + ">");}, TMP_10._s = self, TMP_10), $a).call($c, ($scope.HTML)._scope.Element);
return ($a = ($d = $scope.Formatter).$for, $a._p = (TMP_17 = function(f, item){var self = TMP_17._s || this, $a, $b, TMP_18;
if (f == null) f = nil;if (item == null) item = nil;
return ($a = ($b = item.$rules().$reverse()).$each, $a._p = (TMP_18 = function(rule){var self = TMP_18._s || this, $a, $b, TMP_19;
if (rule == null) rule = nil;
if ((($a = rule.$definition()['$empty?']()) !== nil && (!$a._isBoolean || $a == true))) {
return nil;};
f.$print("" + (rule.$selector()) + " {");
($a = ($b = f).$indent, $a._p = (TMP_19 = function(){var self = TMP_19._s || this, $a, $b, TMP_20;
return ($a = ($b = rule.$definition()).$each, $a._p = (TMP_20 = function(style){var self = TMP_20._s || this, $a;
if (style == null) style = nil;
return f.$print("" + (style.$name()) + ": " + (style.$value()) + ((function() {if ((($a = style.$important()) !== nil && (!$a._isBoolean || $a == true))) {
return " !important"
} else {
return nil
}; return nil; })()) + ";")}, TMP_20._s = self, TMP_20), $a).call($b)}, TMP_19._s = self, TMP_19), $a).call($b);
return f.$print("}");}, TMP_18._s = self, TMP_18), $a).call($b)}, TMP_17._s = self, TMP_17), $a).call($d, $scope.CSS);
})(self, null);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$options', '$to_proc', '$to_s', '$format', '$new', '$tap', '$each']);
;
;
;
;
return (function($base, $super) {
function $Paggio(){};
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio);
var def = self._proto, $scope = self._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5;
$opal.defs(self, '$options', TMP_1 = function(options) {
var $a, $b, self = this, $iter = TMP_1._p, block = $iter || nil;
TMP_1._p = null;
return ($a = ($b = $scope.Formatter).$options, $a._p = block.$to_proc(), $a).call($b, options);
});
$opal.defs(self, '$indent', TMP_2 = function(options) {
var $a, $b, self = this, $iter = TMP_2._p, block = $iter || nil;
TMP_2._p = null;
return ($a = ($b = self).$options, $a._p = block.$to_proc(), $a).call($b, $hash2(["indent"], {"indent": options}));
});
$opal.defs(self, '$css', TMP_3 = function(args) {
var $a, $b, self = this, $iter = TMP_3._p, block = $iter || nil;
args = $slice.call(arguments, 0);
TMP_3._p = null;
return $scope.Formatter.$new().$format(($a = ($b = $scope.CSS).$new, $a._p = block.$to_proc(), $a).apply($b, [].concat(args))).$to_s();
});
$opal.defs(self, '$html', TMP_4 = function(args) {
var $a, $b, self = this, $iter = TMP_4._p, block = $iter || nil;
args = $slice.call(arguments, 0);
TMP_4._p = null;
return $scope.Formatter.$new().$format(($a = ($b = $scope.HTML).$new, $a._p = block.$to_proc(), $a).apply($b, [].concat(args))).$to_s();
});
return ($opal.defs(self, '$html!', TMP_5 = function() {
var $a, $b, TMP_6, self = this, $iter = TMP_5._p, block = $iter || nil;
TMP_5._p = null;
return ($a = ($b = $scope.Formatter.$new()).$tap, $a._p = (TMP_6 = function(f){var self = TMP_6._s || this, $a, $b, TMP_7, $c, $d;
if (f == null) f = nil;
return ($a = ($b = ($c = ($d = $scope.HTML).$new, $c._p = block.$to_proc(), $c).call($d)).$each, $a._p = (TMP_7 = function(root){var self = TMP_7._s || this;
if (root == null) root = nil;
return f.$format(root)}, TMP_7._s = self, TMP_7), $a).call($b)}, TMP_6._s = self, TMP_6), $a).call($b).$to_s();
}), nil) && 'html!';
})(self, null);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module;
$opal.add_stubs([]);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
$opal.cdecl($scope, 'VERSION', "0.2.0.beta1")
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$new', '$encode_uri', '$to_s', '$encode_uri_component', '$[]', '$map', '$split', '$decode_uri_component', '$join']);
(function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
$opal.cdecl($scope, 'Size', $scope.Struct.$new("width", "height"));
$opal.cdecl($scope, 'Position', $scope.Struct.$new("x", "y"));
})(self);
(function($base, $super) {
function $Object(){};
var self = $Object = $klass($base, $super, 'Object', $Object);
var def = self._proto, $scope = self._scope;
$opal.defn(self, '$encode_uri', function() {
var self = this;
return self.$to_s().$encode_uri();
});
return ($opal.defn(self, '$encode_uri_component', function() {
var self = this;
return self.$to_s().$encode_uri_component();
}), nil) && 'encode_uri_component';
})(self, null);
(function($base, $super) {
function $String(){};
var self = $String = $klass($base, $super, 'String', $String);
var def = self._proto, $scope = self._scope;
def.$encode_uri_component = function() {
var self = this;
return encodeURIComponent(self);
};
def.$encode_uri = function() {
var self = this;
return encodeURI(self);
};
def.$decode_uri_component = function() {
var self = this;
return decodeURIComponent(self);
};
return (def.$decode_uri = function() {
var self = this;
return decodeURI(self);
}, nil) && 'decode_uri';
})(self, null);
return (function($base, $super) {
function $Hash(){};
var self = $Hash = $klass($base, $super, 'Hash', $Hash);
var def = self._proto, $scope = self._scope;
$opal.defs(self, '$decode_uri', function(string) {
var $a, $b, TMP_1, self = this;
return self['$[]'](($a = ($b = string.$split("&")).$map, $a._p = (TMP_1 = function(part){var self = TMP_1._s || this, $a, name = nil, value = nil;
if (part == null) part = nil;
$a = $opal.to_ary(part.$split("=")), name = ($a[0] == null ? nil : $a[0]), value = ($a[1] == null ? nil : $a[1]);
return [name.$decode_uri_component(), value.$decode_uri_component()];}, TMP_1._s = self, TMP_1), $a).call($b));
});
return (def.$encode_uri = function() {
var $a, $b, TMP_2, self = this;
return ($a = ($b = self).$map, $a._p = (TMP_2 = function(name, value){var self = TMP_2._s || this;
if (name == null) name = nil;if (value == null) value = nil;
return "" + (name.$to_s().$encode_uri_component()) + "=" + (value.$to_s().$encode_uri_component())}, TMP_2._s = self, TMP_2), $a).call($b).$join("&");
}, nil) && 'encode_uri';
})(self, null);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module;
$opal.add_stubs(['$downcase', '$===', '$!']);
$opal.cdecl($scope, 'BROWSER_ENGINE', (function() {try {return (/MSIE|WebKit|Presto|Gecko/.exec(navigator.userAgent)[0]).$downcase() } catch ($err) { return "unknown" }})());
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
self.support = {};
$opal.defs(self, '$supports?', function(feature) {
var $a, $b, self = this, support = nil, $case = nil;
if (self.support == null) self.support = nil;
if ((($a = (typeof(self.support[feature]) !== "undefined")) !== nil && (!$a._isBoolean || $a == true))) {
return self.support[feature]};
support = (function() {$case = feature;if ("MutationObserver"['$===']($case)) {return (typeof(window.MutationObserver) !== "undefined")}else if ("WebSocket"['$===']($case)) {return (typeof(window.WebSocket) !== "undefined")}else if ("EventSource"['$===']($case)) {return (typeof(window.EventSource) !== "undefined")}else if ("XHR"['$===']($case)) {return (typeof(window.XMLHttpRequest) !== "undefined")}else if ("ActiveX"['$===']($case)) {return (typeof(window.ActiveXObject) !== "undefined")}else if ("Query.css"['$===']($case)) {return (typeof(Element.prototype.querySelectorAll) !== "undefined")}else if ("Query.xpath"['$===']($case)) {return (typeof(document.evaluate) !== "undefined")}else if ("Storage.local"['$===']($case)) {return (typeof(window.localStorage) !== "undefined")}else if ("Storage.global"['$===']($case)) {return (typeof(window.globalStorage) !== "undefined")}else if ("Storage.session"['$===']($case)) {return (typeof(window.sessionStorage) !== "undefined")}else if ("Immediate"['$===']($case)) {return (typeof(window.setImmediate) !== "undefined")}else if ("Immediate (Internet Explorer)"['$===']($case)) {return (typeof(window.msSetImmediate) !== "undefined")}else if ("Immediate (Firefox)"['$===']($case)) {return (typeof(window.mozSetImmediate) !== "undefined")}else if ("Immediate (Opera)"['$===']($case)) {return (typeof(window.oSetImmediate) !== "undefined")}else if ("Immediate (Chrome)"['$===']($case) || "setImmediate (Safari)"['$===']($case)) {return (typeof(window.webkitSetImmediate) !== "undefined")}else if ("CSS.computed"['$===']($case)) {return (typeof(window.getComputedStyle) !== "undefined")}else if ("CSS.current"['$===']($case)) {return (typeof(document.documentElement.currentStyle) !== "undefined")}else if ("Window.send"['$===']($case)) {if ((($a = ($b = (typeof(window.postMessage) !== "undefined"), $b !== false && $b !== nil ?(typeof(window.importScripts) !== "undefined")['$!']() : $b)) !== nil && (!$a._isBoolean || $a == true))) {
var ok = true,
old = window.onmessage;
window.onmessage = function() { ok = false; };
window.postMessage("", "*")
window.onmessage = old;
return ok;
} else {
return nil
}}else if ("Window.innerSize"['$===']($case)) {return (typeof(window.innerHeight) !== "undefined")}else if ("Window.outerSize"['$===']($case)) {return (typeof(window.outerHeight) !== "undefined")}else if ("Window.scroll"['$===']($case)) {return (typeof(document.documentElement.scrollLeft) !== "undefined")}else if ("Window.pageOffset"['$===']($case)) {return (typeof(window.pageXOffset) !== "undefined")}else if ("Element.addBehavior"['$===']($case)) {return (typeof(document.body.addBehavior) !== "undefined")}else if ("Element.clientSize"['$===']($case)) {return (typeof(document.documentElement.clientHeight) !== "undefined")}else if ("Element.scroll"['$===']($case)) {return (typeof(document.documentElement.scrollLeft) !== "undefined")}else if ("Element.textContent"['$===']($case)) {return (typeof(document.documentElement.textContent) !== "undefined")}else if ("Element.innerText"['$===']($case)) {return (typeof(document.documentElement.innerText) !== "undefined")}else if ("Element.matches"['$===']($case)) {return (typeof(document.documentElement.matches) !== "undefined")}else if ("Element.matches (Internet Explorer)"['$===']($case)) {return (typeof(document.documentElement.msMatchesSelector) !== "undefined")}else if ("Element.matches (Firefox)"['$===']($case)) {return (typeof(document.documentElement.mozMatchesSelector) !== "undefined")}else if ("Element.matches (Opera)"['$===']($case)) {return (typeof(document.documentElement.oMatchesSelector) !== "undefined")}else if ("Element.matches (Chrome)"['$===']($case) || "Element.matches (Safari)"['$===']($case)) {return (typeof(document.documentElement.webkitMatchesSelector) !== "undefined")}else if ("Element.getBoundingClientRect"['$===']($case)) {return (typeof(document.documentElement.getBoundingClientRect) !== "undefined")}else if ("Event.readystatechange"['$===']($case)) {return "onreadystatechange" in window.document.createElement("script");}else if ("Event.constructor"['$===']($case)) {try {
new MouseEvent("click");
return true;
} catch ($err) {if (true) {
return false
}else { throw $err; }
}}else if ("Event.create"['$===']($case)) {return (typeof(document.createEvent) !== "undefined")}else if ("Event.createObject"['$===']($case)) {return (typeof(document.createEventObject) !== "undefined")}else if ("Event.addListener"['$===']($case)) {return (typeof(document.addEventListener) !== "undefined")}else if ("Event.attach"['$===']($case)) {return (typeof(document.attachEvent) !== "undefined")}else if ("Event.removeListener"['$===']($case)) {return (typeof(document.removeEventListener) !== "undefined")}else if ("Event.detach"['$===']($case)) {return (typeof(document.detachEvent) !== "undefined")}else if ("Event.dispatch"['$===']($case)) {return (typeof(document.dispatchEvent) !== "undefined")}else if ("Event.fire"['$===']($case)) {return (typeof(document.fireEvent) !== "undefined")}else if (/^Event\.([A-Z].*?)$/['$===']($case)) {return (nil + "Event") in window;}else if ("Document.view"['$===']($case)) {return (typeof(document.defaultView) !== "undefined")}else if ("Document.window"['$===']($case)) {return (typeof(document.parentWindow) !== "undefined")}else if ("History"['$===']($case)) {return (typeof(window.history.pushState) !== "undefined")}else if ("History.state"['$===']($case)) {return (typeof(window.history.state) !== "undefined")}else if ("Animation.request"['$===']($case)) {return (typeof(window.requestAnimationFrame) !== "undefined")}else if ("Animation.request (Internet Explorer)"['$===']($case)) {return (typeof(window.msRequestAnimationFrame) !== "undefined")}else if ("Animation.request (Firefox)"['$===']($case)) {return (typeof(window.mozRequestAnimationFrame) !== "undefined")}else if ("Animation.request (Opera)"['$===']($case)) {return (typeof(window.oRequestAnimationFrame) !== "undefined")}else if ("Animation.request (Chrome)"['$===']($case) || "Animation.request (Safari)"['$===']($case)) {return (typeof(window.webkitRequestAnimationFrame) !== "undefined")}else if ("Animation.cancel"['$===']($case)) {return (typeof(window.cancelAnimationFrame) !== "undefined")}else if ("Animation.cancel (Internet Explorer)"['$===']($case)) {return (typeof(window.msCancelAnimationFrame) !== "undefined")}else if ("Animation.cancel (Firefox)"['$===']($case)) {return (typeof(window.mozCancelAnimationFrame) !== "undefined")}else if ("Animation.cancel (Opera)"['$===']($case)) {return (typeof(window.oCancelAnimationFrame) !== "undefined")}else if ("Animation.cancel (Chrome)"['$===']($case) || "Animation.cancel (Safari)"['$===']($case)) {return (typeof(window.webkitCancelAnimationFrame) !== "undefined")}else if ("Animation.cancelRequest"['$===']($case)) {return (typeof(window.cancelRequestAnimationFrame) !== "undefined")}else if ("Animation.cancelRequest (Internet Explorer)"['$===']($case)) {return (typeof(window.msCancelRequestAnimationFrame) !== "undefined")}else if ("Animation.cancelRequest (Firefox)"['$===']($case)) {return (typeof(window.mozCancelRequestAnimationFrame) !== "undefined")}else if ("Animation.cancelRequest (Opera)"['$===']($case)) {return (typeof(window.oCancelRequestAnimationFrame) !== "undefined")}else if ("Animation.cancelRequest (Chrome)"['$===']($case) || "Animation.cancelRequest (Safari)"['$===']($case)) {return (typeof(window.webkitCancelRequestAnimationFrame) !== "undefined")}else { return nil }})();
return self.support[feature] = support;
});
$opal.defs(self, '$loaded?', function(name) {
var self = this, $case = nil;
return (function() {$case = name;if ("Sizzle"['$===']($case)) {return (typeof(window.Sizzle) !== "undefined")}else if ("wicked-good-xpath"['$===']($case)) {return (typeof(window.wgxpath) !== "undefined")}else { return nil }})();
});
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $gvars = $opal.gvars;
$opal.add_stubs(['$attr_reader', '$convert', '$start', '$aborted?', '$raise', '$stopped?', '$to_n', '$new', '$to_proc', '$every']);
(function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Interval(){};
var self = $Interval = $klass($base, $super, 'Interval', $Interval);
var def = self._proto, $scope = self._scope, TMP_1;
def.stopped = def.aborted = def.window = def.id = def.block = def.every = nil;
self.$attr_reader("every");
def.$initialize = TMP_1 = function(window, time) {
var self = this, $iter = TMP_1._p, block = $iter || nil;
TMP_1._p = null;
self.window = $scope.Native.$convert(window);
self.every = time;
self.block = block;
self.aborted = false;
self.stopped = true;
return self.$start();
};
def['$stopped?'] = function() {
var self = this;
return self.stopped;
};
def['$aborted?'] = function() {
var self = this;
return self.aborted;
};
def.$abort = function() {
var self = this;
self.window.clearInterval(self.id);
self.aborted = true;
return self.id = nil;
};
def.$stop = function() {
var self = this;
self.window.clearInterval(self.id);
self.stopped = true;
return self.id = nil;
};
return (def.$start = function() {
var $a, self = this;
if ((($a = self['$aborted?']()) !== nil && (!$a._isBoolean || $a == true))) {
self.$raise("the interval has been aborted")};
if ((($a = self['$stopped?']()) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return nil
};
return self.id = self.window.setInterval(self.block.$to_n(), self.every * 1000);
}, nil) && 'start';
})(self, null);
(function($base, $super) {
function $Window(){};
var self = $Window = $klass($base, $super, 'Window', $Window);
var def = self._proto, $scope = self._scope, TMP_2;
def["native"] = nil;
return (def.$every = TMP_2 = function(time) {
var $a, $b, self = this, $iter = TMP_2._p, block = $iter || nil;
TMP_2._p = null;
return ($a = ($b = $scope.Interval).$new, $a._p = block.$to_proc(), $a).call($b, self["native"], time);
}, nil) && 'every'
})(self, null);
})(self);
(function($base, $super) {
function $Proc(){};
var self = $Proc = $klass($base, $super, 'Proc', $Proc);
var def = self._proto, $scope = self._scope;
return (def.$every = function(time) {
var $a, $b, self = this;
if ($gvars.window == null) $gvars.window = nil;
return ($a = ($b = $gvars.window).$every, $a._p = self.$to_proc(), $a).call($b, time);
}, nil) && 'every'
})(self, null);
return (function($base) {
var self = $module($base, 'Kernel');
var def = self._proto, $scope = self._scope, TMP_3;
def.$every = TMP_3 = function(time) {
var $a, $b, self = this, $iter = TMP_3._p, block = $iter || nil;
if ($gvars.window == null) $gvars.window = nil;
TMP_3._p = null;
return ($a = ($b = $gvars.window).$every, $a._p = block.$to_proc(), $a).call($b, time);
}
;$opal.donate(self, ["$every"]);
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $gvars = $opal.gvars;
$opal.add_stubs(['$attr_reader', '$convert', '$start', '$to_n', '$new', '$to_proc', '$after']);
(function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Delay(){};
var self = $Delay = $klass($base, $super, 'Delay', $Delay);
var def = self._proto, $scope = self._scope, TMP_1;
def.window = def.id = def.block = def.after = nil;
self.$attr_reader("after");
def.$initialize = TMP_1 = function(window, time) {
var self = this, $iter = TMP_1._p, block = $iter || nil;
TMP_1._p = null;
self.window = $scope.Native.$convert(window);
self.after = time;
self.block = block;
return self.$start();
};
def.$abort = function() {
var self = this;
return self.window.clearTimeout(self.id);
};
return (def.$start = function() {
var self = this;
return self.id = self.window.setTimeout(self.block.$to_n(), self.after * 1000);
}, nil) && 'start';
})(self, null);
(function($base, $super) {
function $Window(){};
var self = $Window = $klass($base, $super, 'Window', $Window);
var def = self._proto, $scope = self._scope, TMP_2;
def["native"] = nil;
return (def.$after = TMP_2 = function(time) {
var $a, $b, self = this, $iter = TMP_2._p, block = $iter || nil;
TMP_2._p = null;
return ($a = ($b = $scope.Delay).$new, $a._p = block.$to_proc(), $a).call($b, self["native"], time);
}, nil) && 'after'
})(self, null);
})(self);
(function($base, $super) {
function $Proc(){};
var self = $Proc = $klass($base, $super, 'Proc', $Proc);
var def = self._proto, $scope = self._scope;
return (def.$after = function(time) {
var $a, $b, self = this;
if ($gvars.window == null) $gvars.window = nil;
return ($a = ($b = $gvars.window).$after, $a._p = self.$to_proc(), $a).call($b, time);
}, nil) && 'after'
})(self, null);
return (function($base) {
var self = $module($base, 'Kernel');
var def = self._proto, $scope = self._scope, TMP_3;
def.$after = TMP_3 = function(time) {
var $a, $b, self = this, $iter = TMP_3._p, block = $iter || nil;
if ($gvars.window == null) $gvars.window = nil;
TMP_3._p = null;
return ($a = ($b = $gvars.window).$after, $a._p = block.$to_proc(), $a).call($b, time);
}
;$opal.donate(self, ["$after"]);
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$to_n', '$supports?', '$raise']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Window(){};
var self = $Window = $klass($base, $super, 'Window', $Window);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $View(){};
var self = $View = $klass($base, $super, 'View', $View);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
def.$initialize = function(window) {
var self = this;
self.window = window;
return self["native"] = window.$to_n();
};
if ((($a = $scope.Browser['$supports?']("Window.innerSize")) !== nil && (!$a._isBoolean || $a == true))) {
def.$width = function() {
var self = this;
return self["native"].innerWidth;
};
return (def.$height = function() {
var self = this;
return self["native"].innerHeight;
}, nil) && 'height';
} else if ((($a = $scope.Browser['$supports?']("Element.clientSize")) !== nil && (!$a._isBoolean || $a == true))) {
def.$height = function() {
var self = this;
return self["native"].document.documentElement.clientHeight;
};
return (def.$width = function() {
var self = this;
return self["native"].document.documentElement.clientWidth;
}, nil) && 'width';
} else {
def.$width = function() {
var self = this;
return self.$raise($scope.NotImplementedError, "window size unsupported");
};
return (def.$height = function() {
var self = this;
return self.$raise($scope.NotImplementedError, "window size unsupported");
}, nil) && 'height';
};
})(self, null)
})(self, null)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$to_n', '$[]', '$width', '$height', '$supports?', '$raise', '$set']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Window(){};
var self = $Window = $klass($base, $super, 'Window', $Window);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Size(){};
var self = $Size = $klass($base, $super, 'Size', $Size);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
def.$initialize = function(window) {
var self = this;
self.window = window;
return self["native"] = window.$to_n();
};
def.$set = function(what) {
var $a, self = this, width = nil, height = nil;
width = ((($a = what['$[]']("width")) !== false && $a !== nil) ? $a : self.$width());
height = ((($a = what['$[]']("height")) !== false && $a !== nil) ? $a : self.$height());
self["native"].resizeTo(width, height);
return self;
};
if ((($a = $scope.Browser['$supports?']("Window.outerSize")) !== nil && (!$a._isBoolean || $a == true))) {
def.$width = function() {
var self = this;
return self["native"].outerWidth;
};
def.$height = function() {
var self = this;
return self["native"].outerHeight;
};
} else {
def.$width = function() {
var self = this;
return self.$raise($scope.NotImplementedError, "window outer size not supported");
};
def.$height = function() {
var self = this;
return self.$raise($scope.NotImplementedError, "window outer size not supported");
};
};
def['$width='] = function(value) {
var self = this;
return self.$set($hash2(["width"], {"width": value}));
};
return (def['$height='] = function(value) {
var self = this;
return self.$set($hash2(["height"], {"height": value}));
}, nil) && 'height=';
})(self, null)
})(self, null)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$to_n', '$supports?', '$new', '$raise', '$x', '$position', '$y', '$[]']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Window(){};
var self = $Window = $klass($base, $super, 'Window', $Window);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Scroll(){};
var self = $Scroll = $klass($base, $super, 'Scroll', $Scroll);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
def.$initialize = function(window) {
var self = this;
self.window = window;
return self["native"] = window.$to_n();
};
if ((($a = $scope.Browser['$supports?']("Window.scroll")) !== nil && (!$a._isBoolean || $a == true))) {
def.$position = function() {
var self = this;
var doc = self["native"].document,
root = doc.documentElement,
body = doc.body;
var x = root.scrollLeft || body.scrollLeft,
y = root.scrollTop || body.scrollTop;
;
return $scope.Position.$new(x, y);
}
} else if ((($a = $scope.Browser['$supports?']("Window.pageOffset")) !== nil && (!$a._isBoolean || $a == true))) {
def.$position = function() {
var self = this;
return $scope.Position.$new(self["native"].pageXOffset, self["native"].pageYOffset);
}
} else {
def.$position = function() {
var self = this;
return self.$raise($scope.NotImplementedError, "window scroll unsupported");
}
};
def.$x = function() {
var self = this;
return self.$position().$x();
};
def.$y = function() {
var self = this;
return self.$position().$y();
};
def.$to = function(what) {
var $a, self = this, x = nil, y = nil;
x = ((($a = what['$[]']("x")) !== false && $a !== nil) ? $a : self.$x());
y = ((($a = what['$[]']("y")) !== false && $a !== nil) ? $a : self.$y());
self["native"].scrollTo(x, y);
return self;
};
return (def.$by = function(what) {
var $a, self = this, x = nil, y = nil;
x = ((($a = what['$[]']("x")) !== false && $a !== nil) ? $a : 0);
y = ((($a = what['$[]']("y")) !== false && $a !== nil) ? $a : 0);
self["native"].scrollBy(x, y);
return self;
}, nil) && 'by';
})(self, null)
})(self, null)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2, $gvars = $opal.gvars;
$opal.add_stubs(['$delete', '$join', '$map', '$===', '$new', '$include', '$[]', '$alert', '$prompt', '$confirm']);
;
;
;
;
;
(function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Window(){};
var self = $Window = $klass($base, $super, 'Window', $Window);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
$opal.defs(self, '$open', function(url, options) {
var $a, $b, TMP_1, self = this, name = nil, features = nil;
name = options.$delete("name");
features = ($a = ($b = options).$map, $a._p = (TMP_1 = function(key, value){var self = TMP_1._s || this, $case = nil;
if (key == null) key = nil;if (value == null) value = nil;
value = (function() {$case = value;if (true['$===']($case)) {return "yes"}else if (false['$===']($case)) {return "no"}else {return value}})();
return "" + (key) + "=" + (value);}, TMP_1._s = self, TMP_1), $a).call($b).$join(",");
var win = window.open(url, name, features);
if (win == null) {
return nil;
}
return self.$new(win);
;
});
self.$include($scope.Native);
def.$alert = function(value) {
var self = this;
self["native"].alert(value);
return value;
};
def.$prompt = function(value) {
var self = this;
return self["native"].prompt(value) || nil;
};
def.$confirm = function(value) {
var self = this;
return self["native"].confirm(value) || false;
};
def.$view = function() {
var self = this;
return $scope.View.$new(self);
};
def.$size = function() {
var self = this;
return $scope.Size.$new(self);
};
def.$scroll = function() {
var self = this;
return $scope.Scroll.$new(self);
};
def['$send!'] = function(message, options) {
var $a, self = this;
if (options == null) {
options = $hash2([], {})
}
return self["native"].postMessage(message, ((($a = options['$[]']("to")) !== false && $a !== nil) ? $a : "*"));
};
return (def.$close = function() {
var self = this;
return (window.open('', '_self', '') && window.close()) ||
(window.opener = null && window.close()) ||
(window.opener = '' && window.close());
}, nil) && 'close';
})(self, null)
})(self);
$gvars.window = ($scope.Browser)._scope.Window.$new(window);
return (function($base) {
var self = $module($base, 'Kernel');
var def = self._proto, $scope = self._scope;
def.$alert = function(value) {
var self = this;
if ($gvars.window == null) $gvars.window = nil;
return $gvars.window.$alert(value);
};
def.$prompt = function(value) {
var self = this;
if ($gvars.window == null) $gvars.window = nil;
return $gvars.window.$prompt(value);
};
def.$confirm = function(value) {
var self = this;
if ($gvars.window == null) $gvars.window = nil;
return $gvars.window.$confirm(value);
};
;$opal.donate(self, ["$alert", "$prompt", "$confirm"]);
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$include', '$call', '$to_n', '$<<', '$converters', '$native?', '$each', '$instance_eval', '$register', '$to_proc', '$attr_reader', '$lambda', '$new', '$stopped?', '$arguments', '$!', '$prevented?', '$class_for', '$off', '$target', '$[]', '$delegated', '$delete', '$last', '$empty?', '$first', '$raise', '$name_for', '$handlers', '$[]=', '$include?', '$callback=', '$on!', '$delegate', '$on', '$handlers=', '$push', '$callbacks', '$attach', '$attach!', '$supports?', '$name', '$==', '$event', '$===', '$warn', '$detach', '$gsub', '$delete_if', '$=~', '$clear', '$none?', '$is_a?', '$create', '$dispatch', '$trigger', '$bubbles=', '$private', '$nil?', '$matches?', '$dup', '$on=', '$parent']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
self.$include($scope.Native);
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope, TMP_1;
def["native"] = nil;
self.$include($scope.Native);
$opal.defs(self, '$new', TMP_1 = function() {
var self = this, $iter = TMP_1._p, block = $iter || nil, data = nil;
TMP_1._p = null;
data = $opal.find_super_dispatcher(self, 'new', TMP_1, null, $Definition).apply(self, [{ bubbles: true, cancelable: true }]);
if (block !== false && block !== nil) {
block.$call(data)};
return data.$to_n();
});
def['$bubbles='] = function(value) {
var self = this;
return self["native"].bubbles = value;
};
return (def['$cancelable='] = function(value) {
var self = this;
return self["native"].cancelable = value;
}, nil) && 'cancelable=';
})(self, null);
return (function($base) {
var self = $module($base, 'Target');
var def = self._proto, $scope = self._scope, TMP_2, TMP_8, TMP_11, $a, TMP_16, TMP_17;
$opal.defs(self, '$converters', function() {
var $a, self = this;
if (self.converters == null) self.converters = nil;
return ((($a = self.converters) !== false && $a !== nil) ? $a : self.converters = []);
});
$opal.defs(self, '$register', TMP_2 = function() {
var self = this, $iter = TMP_2._p, block = $iter || nil;
TMP_2._p = null;
return self.$converters()['$<<'](block);
});
$opal.defs(self, '$convert', function(value) {try {
var $a, $b, TMP_3, self = this;
if ((($a = self['$native?'](value)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return value
};
($a = ($b = self.$converters()).$each, $a._p = (TMP_3 = function(block){var self = TMP_3._s || this, $a, result = nil;
if (block == null) block = nil;
if ((($a = result = block.$call(value)) !== nil && (!$a._isBoolean || $a == true))) {
$opal.$return(result)
} else {
return nil
}}, TMP_3._s = self, TMP_3), $a).call($b);
return nil;
} catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; }
});
$opal.defs(self, '$included', function(klass) {
var $a, $b, TMP_4, self = this;
return ($a = ($b = klass).$instance_eval, $a._p = (TMP_4 = function(){var self = TMP_4._s || this, TMP_5;
return ($opal.defs(self, '$target', TMP_5 = function() {
var $a, $b, self = this, $iter = TMP_5._p, block = $iter || nil;
TMP_5._p = null;
return ($a = ($b = (($scope.DOM)._scope.Event)._scope.Target).$register, $a._p = block.$to_proc(), $a).call($b);
}), nil) && 'target'}, TMP_4._s = self, TMP_4), $a).call($b);
});
(function($base, $super) {
function $Callback(){};
var self = $Callback = $klass($base, $super, 'Callback', $Callback);
var def = self._proto, $scope = self._scope, TMP_6;
def.proc = def.name = nil;
self.$attr_reader("target", "name", "selector");
def.$initialize = TMP_6 = function(target, name, selector) {
var self = this, $iter = TMP_6._p, block = $iter || nil;
if (selector == null) {
selector = nil
}
TMP_6._p = null;
self.target = target;
self.name = name;
self.selector = selector;
return self.block = block;
};
def.$call = function(e) {
var self = this;
return self.$to_proc().$call(e);
};
def.$to_proc = function() {
var $a, $b, $c, TMP_7, self = this;
return ((($a = self.proc) !== false && $a !== nil) ? $a : self.proc = ($b = ($c = self).$lambda, $b._p = (TMP_7 = function(event){var self = TMP_7._s || this, $a;
if (self.block == null) self.block = nil;
if (event == null) event = nil;
if (!event.currentTarget) {
event.currentTarget = self.target.native;
}
event = $scope.Event.$new(event, self);
if ((($a = event['$stopped?']()) !== nil && (!$a._isBoolean || $a == true))) {
} else {
($a = self.block).$call.apply($a, [event].concat(event.$arguments()))
};
return event['$prevented?']()['$!']();}, TMP_7._s = self, TMP_7), $b).call($c));
};
def.$event = function() {
var self = this;
return $scope.Event.$class_for(self.name);
};
return (def.$off = function() {
var self = this;
return self.$target().$off(self);
}, nil) && 'off';
})(self, null);
(function($base, $super) {
function $Delegate(){};
var self = $Delegate = $klass($base, $super, 'Delegate', $Delegate);
var def = self._proto, $scope = self._scope;
def.target = def.name = def.pair = nil;
def.$initialize = function(target, name, pair) {
var self = this;
self.target = target;
self.name = name;
return self.pair = pair;
};
return (def.$off = function() {
var $a, self = this, delegate = nil;
delegate = self.target.$delegated()['$[]'](self.name);
delegate.$last().$delete(self.pair);
if ((($a = delegate.$last()['$empty?']()) !== nil && (!$a._isBoolean || $a == true))) {
delegate.$first().$off();
return delegate.$delete(self.name);
} else {
return nil
};
}, nil) && 'off';
})(self, null);
$opal.cdecl($scope, 'Delegates', $scope.Struct.$new("callback", "handlers"));
def.$on = TMP_8 = function(name, selector) {
var $a, $b, TMP_9, $c, TMP_10, $d, self = this, $iter = TMP_8._p, block = $iter || nil, delegate = nil, pair = nil, callback = nil;
if (selector == null) {
selector = nil
}
TMP_8._p = null;
if (block !== false && block !== nil) {
} else {
self.$raise($scope.ArgumentError, "no block has been given")
};
name = $scope.Event.$name_for(name);
if (selector !== false && selector !== nil) {
if ((($a = delegate = self.$delegated()['$[]'](name)) !== nil && (!$a._isBoolean || $a == true))) {
pair = [selector, block];
delegate.$handlers()['$<<'](pair);
return $scope.Delegate.$new(self, name, pair);
} else {
delegate = self.$delegated()['$[]='](name, $scope.Delegates.$new());
if ((($a = ["blur", "focus"]['$include?'](name)) !== nil && (!$a._isBoolean || $a == true))) {
delegate['$callback='](($a = ($b = self)['$on!'], $a._p = (TMP_9 = function(e){var self = TMP_9._s || this;
if (e == null) e = nil;
return self.$delegate(delegate, e)}, TMP_9._s = self, TMP_9), $a).call($b, name))
} else {
delegate['$callback='](($a = ($c = self).$on, $a._p = (TMP_10 = function(e){var self = TMP_10._s || this;
if (e == null) e = nil;
return self.$delegate(delegate, e)}, TMP_10._s = self, TMP_10), $a).call($c, name))
};
pair = [selector, block];
delegate['$handlers=']([pair]);
return $scope.Delegate.$new(self, name, pair);
}
} else {
callback = ($a = ($d = $scope.Callback).$new, $a._p = block.$to_proc(), $a).call($d, self, name, selector);
self.$callbacks().$push(callback);
return self.$attach(callback);
};
};
def['$on!'] = TMP_11 = function(name) {
var $a, $b, self = this, $iter = TMP_11._p, block = $iter || nil, callback = nil;
TMP_11._p = null;
if (block !== false && block !== nil) {
} else {
self.$raise($scope.ArgumentError, "no block has been given")
};
name = $scope.Event.$name_for(name);
callback = ($a = ($b = $scope.Callback).$new, $a._p = block.$to_proc(), $a).call($b, self, name);
self.$callbacks().$push(callback);
return self['$attach!'](callback);
};
if ((($a = $scope.Browser['$supports?']("Event.addListener")) !== nil && (!$a._isBoolean || $a == true))) {
def.$attach = function(callback) {
var self = this;
if (self["native"] == null) self["native"] = nil;
self["native"].addEventListener(callback.$name(), callback.$to_proc());
return callback;
};
def['$attach!'] = function(callback) {
var self = this;
if (self["native"] == null) self["native"] = nil;
self["native"].addEventListener(callback.$name(), callback.$to_proc(), true);
return callback;
};
} else if ((($a = $scope.Browser['$supports?']("Event.attach")) !== nil && (!$a._isBoolean || $a == true))) {
def.$attach = function(callback) {
var self = this;
if (self["native"] == null) self["native"] = nil;
if (callback.$event()['$==']($scope.Custom)) {
if (!self["native"].$custom) {
self["native"].$custom = function(event) {
for (var i = 0, length = self["native"].$callbacks.length; i < length; i++) {
var callback = self["native"].$callbacks[i];
if ((callback).$event()['$==']($scope.Custom)) {
event.type = callback.name;
(callback).$call(event);
}
}
};
self["native"].attachEvent("ondataavailable", self["native"].$custom);
}
;
} else {
self["native"].attachEvent("on" + callback.$name(), callback.$to_proc());
};
return callback;
};
def['$attach!'] = function(callback) {
var self = this, $case = nil;
if (self["native"] == null) self["native"] = nil;
$case = callback.$name();if ("blur"['$===']($case)) {self["native"].attachEvent("onfocusout", callback.$to_proc());}else if ("focus"['$===']($case)) {self["native"].attachEvent("onfocusin", callback.$to_proc());}else {self.$warn("attach: capture doesn't work on this browser");
self.$attach(callback);};
return callback;
};
} else {
def.$attach = function() {
var self = this;
return self.$raise($scope.NotImplementedError);
};
def['$attach!'] = function() {
var self = this;
return self.$raise($scope.NotImplementedError);
};
};
def.$off = function(what) {
var $a, $b, TMP_12, $c, TMP_13, $d, TMP_14, self = this, $case = nil;
if (what == null) {
what = nil
}
return (function() {$case = what;if ($scope.Callback['$===']($case)) {self.$callbacks().$delete(what);
return self.$detach(what);}else if ($scope.String['$===']($case)) {if ((($a = ((($b = what['$include?']("*")) !== false && $b !== nil) ? $b : what['$include?']("?"))) !== nil && (!$a._isBoolean || $a == true))) {
return self.$off($scope.Regexp.$new(what.$gsub(/\*/, ".*?").$gsub(/\?/, ".")))
} else {
what = $scope.Event.$name_for(what);
return ($a = ($b = self.$callbacks()).$delete_if, $a._p = (TMP_12 = function(callback){var self = TMP_12._s || this;
if (callback == null) callback = nil;
if (callback.$name()['$=='](what)) {
self.$detach(callback);
return true;
} else {
return nil
}}, TMP_12._s = self, TMP_12), $a).call($b);
}}else if ($scope.Regexp['$===']($case)) {return ($a = ($c = self.$callbacks()).$delete_if, $a._p = (TMP_13 = function(callback){var self = TMP_13._s || this, $a;
if (callback == null) callback = nil;
if ((($a = callback.$name()['$=~'](what)) !== nil && (!$a._isBoolean || $a == true))) {
self.$detach(callback);
return true;
} else {
return nil
}}, TMP_13._s = self, TMP_13), $a).call($c)}else {($a = ($d = self.$callbacks()).$each, $a._p = (TMP_14 = function(callback){var self = TMP_14._s || this;
if (callback == null) callback = nil;
return self.$detach(callback)}, TMP_14._s = self, TMP_14), $a).call($d);
return self.$callbacks().$clear();}})();
};
if ((($a = $scope.Browser['$supports?']("Event.removeListener")) !== nil && (!$a._isBoolean || $a == true))) {
def.$detach = function(callback) {
var self = this;
if (self["native"] == null) self["native"] = nil;
return self["native"].removeEventListener(callback.$name(), callback.$to_proc(), false);
}
} else if ((($a = $scope.Browser['$supports?']("Event.detach")) !== nil && (!$a._isBoolean || $a == true))) {
def.$detach = function(callback) {
var $a, $b, $c, TMP_15, self = this;
if (self["native"] == null) self["native"] = nil;
if (callback.$event()['$==']($scope.Custom)) {
if ((($a = ($b = ($c = self.$callbacks())['$none?'], $b._p = (TMP_15 = function(c){var self = TMP_15._s || this;
if (c == null) c = nil;
return c.$event()['$==']($scope.Custom)}, TMP_15._s = self, TMP_15), $b).call($c)) !== nil && (!$a._isBoolean || $a == true))) {
self["native"].detachEvent("ondataavailable", self["native"].$custom);
delete self["native"].$custom;
;
} else {
return nil
}
} else {
return self["native"].detachEvent("on" + callback.$name(), callback.$to_proc());
};
}
} else {
def.$detach = function(callback) {
var self = this;
return self.$raise($scope.NotImplementedError);
}
};
def.$trigger = TMP_16 = function(event, args) {
var $a, $b, self = this, $iter = TMP_16._p, block = $iter || nil;
args = $slice.call(arguments, 1);
TMP_16._p = null;
if ((($a = event['$is_a?']($scope.String)) !== nil && (!$a._isBoolean || $a == true))) {
event = ($a = ($b = $scope.Event).$create, $a._p = block.$to_proc(), $a).apply($b, [event].concat(args))};
return self.$dispatch(event);
};
def['$trigger!'] = TMP_17 = function(event, args) {
var $a, $b, TMP_18, self = this, $iter = TMP_17._p, block = $iter || nil;
args = $slice.call(arguments, 1);
TMP_17._p = null;
return ($a = ($b = self).$trigger, $a._p = (TMP_18 = function(e){var self = TMP_18._s || this;
if (e == null) e = nil;
if (block !== false && block !== nil) {
block.$call(e)};
return e['$bubbles='](false);}, TMP_18._s = self, TMP_18), $a).apply($b, [event].concat(args));
};
if ((($a = $scope.Browser['$supports?']("Event.dispatch")) !== nil && (!$a._isBoolean || $a == true))) {
def.$dispatch = function(event) {
var self = this;
if (self["native"] == null) self["native"] = nil;
return self["native"].dispatchEvent(event.$to_n());
}
} else if ((($a = $scope.Browser['$supports?']("Event.fire")) !== nil && (!$a._isBoolean || $a == true))) {
def.$dispatch = function(event) {
var $a, self = this;
if (self["native"] == null) self["native"] = nil;
if ((($a = $scope.Custom['$==='](event)) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"].fireEvent("ondataavailable", event.$to_n());
} else {
return self["native"].fireEvent("on" + event.$name(), event.$to_n());
};
}
} else {
def.$dispatch = function() {
var self = this;
return self.$raise($scope.NotImplementedError);
}
};
self.$private();
def.$callbacks = function() {
var self = this;
if (self["native"] == null) self["native"] = nil;
if (!self["native"].$callbacks) {
self["native"].$callbacks = [];
}
return self["native"].$callbacks;
;
};
def.$delegated = function() {
var self = this;
if (self["native"] == null) self["native"] = nil;
if (!self["native"].$delegated) {
self["native"].$delegated = $hash2([], {});
}
return self["native"].$delegated;
;
};
def.$delegate = function(delegates, event, element) {
var $a, $b, TMP_19, self = this;
if (element == null) {
element = event.$target()
}
if ((($a = ((($b = element['$nil?']()) !== false && $b !== nil) ? $b : element['$=='](event.$on()))) !== nil && (!$a._isBoolean || $a == true))) {
return nil};
($a = ($b = delegates.$handlers()).$each, $a._p = (TMP_19 = function(selector, block){var self = TMP_19._s || this, $a, new$ = nil;
if (selector == null) selector = nil;if (block == null) block = nil;
if ((($a = element['$matches?'](selector)) !== nil && (!$a._isBoolean || $a == true))) {
new$ = event.$dup();
new$['$on='](element);
return ($a = block).$call.apply($a, [new$].concat(new$.$arguments()));
} else {
return nil
}}, TMP_19._s = self, TMP_19), $a).call($b);
return self.$delegate(delegates, event, element.$parent());
};
;$opal.donate(self, ["$on", "$on!", "$attach", "$attach!", "$attach", "$attach!", "$attach", "$attach!", "$off", "$detach", "$detach", "$detach", "$trigger", "$trigger!", "$dispatch", "$dispatch", "$dispatch", "$callbacks", "$delegated", "$delegate"]);
})(self);
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $UI(){};
var self = $UI = $klass($base, $super, 'UI', $UI);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.UI");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$detail='] = function(value) {
var self = this;
return self["native"].detail = value;
};
return (def['$view='] = function(value) {
var self = this;
return self["native"].view = value;
}, nil) && 'view=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new UIEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("UIEvent");
event.initUIEvent(name, desc.bubbles, desc.cancelable,
desc.view || window, desc.detail || 0);
return event;
})}};
self.$alias_native("detail");
return self.$alias_native("view");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $gvars = $opal.gvars;
$opal.add_stubs(['$!', '$nil?', '$[]', '$include', '$new', '$try_convert', '$supported?', '$supports?', '$alias_native', '$x', '$screen', '$y', '$DOM', '$==', '$downcase', '$name']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Mouse(){};
var self = $Mouse = $klass($base, $super, 'Mouse', $Mouse);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
$opal.defs(self, '$supported?', function() {
var self = this;
if ($gvars.$ == null) $gvars.$ = nil;
return $gvars.$['$[]']("MouseEvent")['$nil?']()['$!']();
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
(function($base, $super) {
function $Client(){};
var self = $Client = $klass($base, $super, 'Client', $Client);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def['$x='] = function(value) {
var self = this;
return self["native"].clientX = value;
};
return (def['$y='] = function(value) {
var self = this;
return self["native"].clientY = value;
}, nil) && 'y=';
})(self, null);
(function($base, $super) {
function $Layer(){};
var self = $Layer = $klass($base, $super, 'Layer', $Layer);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def['$x='] = function(value) {
var self = this;
return self["native"].layerX = value;
};
return (def['$y='] = function(value) {
var self = this;
return self["native"].layerY = value;
}, nil) && 'y=';
})(self, null);
(function($base, $super) {
function $Offset(){};
var self = $Offset = $klass($base, $super, 'Offset', $Offset);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def['$x='] = function(value) {
var self = this;
return self["native"].offsetX = value;
};
return (def['$y='] = function(value) {
var self = this;
return self["native"].offsetY= value;
}, nil) && 'y=';
})(self, null);
(function($base, $super) {
function $Page(){};
var self = $Page = $klass($base, $super, 'Page', $Page);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def['$x='] = function(value) {
var self = this;
return self["native"].pageX = value;
};
return (def['$y='] = function(value) {
var self = this;
return self["native"].pageY = value;
}, nil) && 'y=';
})(self, null);
(function($base, $super) {
function $Screen(){};
var self = $Screen = $klass($base, $super, 'Screen', $Screen);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def['$x='] = function(value) {
var self = this;
return self["native"].screenX = value;
};
return (def['$y='] = function(value) {
var self = this;
return self["native"].screenY = value;
}, nil) && 'y=';
})(self, null);
(function($base, $super) {
function $Ancestor(){};
var self = $Ancestor = $klass($base, $super, 'Ancestor', $Ancestor);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def['$x='] = function(value) {
var self = this;
return self["native"].x = value;
};
return (def['$y='] = function(value) {
var self = this;
return self["native"].y = value;
}, nil) && 'y=';
})(self, null);
def['$x='] = function(value) {
var self = this;
return self["native"].screenX = value;
};
def['$y='] = function(value) {
var self = this;
return self["native"].screenY = value;
};
def['$alt!'] = function() {
var self = this;
return self["native"].altKey = true;
};
def['$ctrl!'] = function() {
var self = this;
return self["native"].ctrlKey = true;
};
def['$meta!'] = function() {
var self = this;
return self["native"].metaKey = true;
};
def['$button='] = function(value) {
var self = this;
return self["native"].button = value;
};
def.$client = function() {
var self = this;
return $scope.Client.$new(self["native"]);
};
def.$layer = function() {
var self = this;
return $scope.Layer.$new(self["native"]);
};
def.$offset = function() {
var self = this;
return $scope.Offset.$new(self["native"]);
};
def.$page = function() {
var self = this;
return $scope.Page.$new(self["native"]);
};
def.$screen = function() {
var self = this;
return $scope.Screen.$new(self["native"]);
};
def.$ancestor = function() {
var self = this;
return $scope.Ancestor.$new(self["native"]);
};
def['$related='] = function(elem) {
var self = this;
return self["native"].relatedTarget = $scope.Native.$try_convert(elem);
};
def['$from='] = function(elem) {
var self = this;
return self["native"].fromElement = $scope.Native.$try_convert(elem);
};
return (def['$to='] = function(elem) {
var self = this;
return self["native"].toElement = $scope.Native.$try_convert(elem);
}, nil) && 'to=';
})(self, ($scope.UI)._scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new MouseEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("MouseEvent");
event.initMouseEvent(name, desc.bubbles, desc.cancelable,
desc.view || window, desc.detail || 0,
desc.screenX || 0, desc.screenY || 0,
desc.clientX || 0, desc.clientY || 0,
desc.ctrlKey || false, desc.altKey || false,
desc.shiftKey || false, desc.metaKey || false,
desc.button || 0, desc.relatedTarget || null);
return event;
})}};
self.$alias_native("alt?", "altKey");
self.$alias_native("ctrl?", "ctrlKey");
self.$alias_native("meta?", "metaKey");
self.$alias_native("shift?", "shiftKey");
self.$alias_native("button");
def.$client = function() {
var self = this;
return $scope.Position.$new(self["native"].clientX, self["native"].clientY);
};
def.$layer = function() {
var $a, self = this;
if ((($a = self["native"].layerX == null) !== nil && (!$a._isBoolean || $a == true))) {
return nil
} else {
return $scope.Position.$new(self["native"].layerX, self["native"].layerY)
};
};
def.$offset = function() {
var $a, self = this;
if ((($a = self["native"].offsetX == null) !== nil && (!$a._isBoolean || $a == true))) {
return nil
} else {
return $scope.Position.$new(self["native"].offsetX, self["native"].offsetY)
};
};
def.$page = function() {
var $a, self = this;
if ((($a = self["native"].pageX == null) !== nil && (!$a._isBoolean || $a == true))) {
return nil
} else {
return $scope.Position.$new(self["native"].pageX, self["native"].pageY)
};
};
def.$screen = function() {
var $a, self = this;
if ((($a = self["native"].screenX == null) !== nil && (!$a._isBoolean || $a == true))) {
return nil
} else {
return $scope.Position.$new(self["native"].screenX, self["native"].screenY)
};
};
def.$ancestor = function() {
var $a, self = this;
if ((($a = self["native"].x == null) !== nil && (!$a._isBoolean || $a == true))) {
return nil
} else {
return $scope.Position.$new(self["native"].x, self["native"].y)
};
};
def.$x = function() {
var self = this;
return self.$screen().$x();
};
def.$y = function() {
var self = this;
return self.$screen().$y();
};
def.$related = function() {
var $a, self = this;
if ((($a = self["native"].relatedTarget == null) !== nil && (!$a._isBoolean || $a == true))) {
return nil
} else {
return self.$DOM(self["native"].relatedTarget)
};
};
def.$from = function() {
var $a, self = this;
if ((($a = self["native"].fromElement == null) !== nil && (!$a._isBoolean || $a == true))) {
return nil
} else {
return self.$DOM(self["native"].fromElement)
};
};
def.$to = function() {
var $a, self = this;
if ((($a = self["native"].toElement == null) !== nil && (!$a._isBoolean || $a == true))) {
return nil
} else {
return self.$DOM(self["native"].toElement)
};
};
def['$click?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("click");
};
def['$double_click?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("dblclick");
};
def['$down?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("mousedown");
};
def['$enter?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("mouseenter");
};
def['$leave?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("mouseleave");
};
def['$move?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("mousemove");
};
def['$out?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("mouseout");
};
def['$over?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("mouseover");
};
def['$up?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("mouseup");
};
return (def['$show?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("show");
}, nil) && 'show?';
})(self, $scope.UI)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native', '$code', '$chr', '$==', '$downcase', '$name']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Keyboard(){};
var self = $Keyboard = $klass($base, $super, 'Keyboard', $Keyboard);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Keyboard");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$alt!'] = function() {
var self = this;
return self["native"].altKey = true;
};
def['$ctrl!'] = function() {
var self = this;
return self["native"].ctrlKey = true;
};
def['$meta!'] = function() {
var self = this;
return self["native"].metaKey = true;
};
def['$shift!'] = function() {
var self = this;
return self["native"].shiftKey = true;
};
def['$code='] = function(code) {
var self = this;
return self["native"].keyCode = self["native"].which = code;
};
def['$key='] = function(key) {
var self = this;
return self["native"].key = key;
};
def['$char='] = function(char$) {
var self = this;
return self["native"].char = self["native"].charCode = char$;
};
def['$repeat!'] = function() {
var self = this;
return self["native"].repeat = true;
};
return (def['$locale='] = function(value) {
var self = this;
return self["native"].locale = value;
}, nil) && 'locale=';
})(self, ($scope.UI)._scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new KeyboardEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var modifiers = "";
if (desc.altKey) {
modifiers += "Alt ";
}
if (desc.ctrlKey) {
modifiers += "Ctrl ";
}
if (desc.shiftKey) {
modifiers += "Shift" ;
}
if (desc.metaKey) {
modifiers += "Meta ";
}
var event = document.createEvent("KeyboardEvent");
event.initKeyboardEvent(name, desc.bubbles, desc.cancelable,
desc.view || window, desc.which, 0,
modifiers, desc.repeat, desc.locale);
return event;
})}};
self.$alias_native("alt?", "altKey");
self.$alias_native("ctrl?", "ctrlKey");
self.$alias_native("meta?", "metaKey");
self.$alias_native("shift?", "shiftKey");
self.$alias_native("locale");
self.$alias_native("repeat?", "repeat");
def.$key = function() {
var self = this;
return self["native"].key || self["native"].keyIdentifier || nil;
};
def.$code = function() {
var self = this;
return self["native"].keyCode || self["native"].which || nil;
};
def.$char = function() {
var $a, self = this;
return self["native"].char || self["native"].charCode || (function() {if ((($a = self.$code()) !== nil && (!$a._isBoolean || $a == true))) {
return self.$code().$chr()
} else {
return nil
}; return nil; })();
};
$opal.defn(self, '$to_i', def.$key);
def['$down?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("keydown");
};
def['$press?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("keypress");
};
return (def['$up?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("keyup");
}, nil) && 'up?';
})(self, $scope.UI)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$convert', '$supported?', '$DOM']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Focus(){};
var self = $Focus = $klass($base, $super, 'Focus', $Focus);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Focus");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$view='] = function(value) {
var self = this;
return self["native"].view = $scope.Native.$convert(value);
};
return (def['$related='] = function(elem) {
var self = this;
return self["native"].relatedTarget = $scope.Native.$convert(elem);
}, nil) && 'related=';
})(self, ($scope.UI)._scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new FocusEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("FocusEvent");
event.initFocusEvent(name, desc.bubbles, desc.cancelable,
desc.view || window, 0, desc.relatedTarget);
return event;
})}};
return (def.$related = function() {
var self = this;
return self.$DOM(self["native"].relatedTarget);
}, nil) && 'related';
})(self, $scope.UI)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $gvars = $opal.gvars;
$opal.add_stubs(['$!', '$nil?', '$[]', '$===', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Wheel(){};
var self = $Wheel = $klass($base, $super, 'Wheel', $Wheel);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
$opal.defs(self, '$supported?', function() {
var self = this;
if ($gvars.$ == null) $gvars.$ = nil;
return $gvars.$['$[]']("WheelEvent")['$nil?']()['$!']();
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$x='] = function(value) {
var self = this;
return self["native"].deltaX = value;
};
def['$y='] = function(value) {
var self = this;
return self["native"].deltaY = value;
};
def['$z='] = function(value) {
var self = this;
return self["native"].deltaZ = value;
};
return (def['$mode='] = function(value) {
var self = this, $case = nil;
value = (function() {$case = value;if ("pixel"['$===']($case)) {return WheelEvent.DOM_DELTA_PIXEL;}else if ("line"['$===']($case)) {return WheelEvent.DOM_DELTA_LINE;}else if ("page"['$===']($case)) {return WheelEvent.DOM_DELTA_PAGE;}else { return nil }})();
return self["native"].deltaMode = value;
}, nil) && 'mode=';
})(self, $scope.Definition);
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new WheelEvent(name, desc);
});
self.$alias_native("x", "deltaX");
self.$alias_native("y", "deltaY");
self.$alias_native("z", "deltaZ");
return (def.$mode = function() {
var self = this, $case = nil;
return (function() {$case = self["native"].deltaMode;if ((WheelEvent.DOM_DELTA_PIXEL)['$===']($case)) {return "pixel"}else if ((WheelEvent.DOM_DELTA_LINE)['$===']($case)) {return "line"}else if ((WheelEvent.DOM_DELTA_PAGE)['$===']($case)) {return "page"}else { return nil }})();
}, nil) && 'mode';
})(self, $scope.UI)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native', '$==', '$downcase', '$name']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Composition(){};
var self = $Composition = $klass($base, $super, 'Composition', $Composition);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Composition");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$data='] = function(value) {
var self = this;
return self["native"].data = value;
};
return (def['$locale='] = function(value) {
var self = this;
return self["native"].locale = value;
}, nil) && 'locale=';
})(self, ($scope.UI)._scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new CompositionEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("CompositionEvent");
event.initCompositionEvent(name, desc.bubbles, desc.cancelable,
desc.view || window, desc.data, desc.locale);
return event;
})}};
self.$alias_native("data");
self.$alias_native("locale");
def['$start?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("compositionstart");
};
def['$update?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("compositionupdate");
};
return (def['$end?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("compositionend");
}, nil) && 'end?';
})(self, $scope.UI)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Animation(){};
var self = $Animation = $klass($base, $super, 'Animation', $Animation);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Animation");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$animation='] = function(value) {
var self = this;
return self["native"].animationName = value;
};
return (def['$elapsed='] = function(value) {
var self = this;
return self["native"].elapsedTime = value;
}, nil) && 'elapsed=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new AnimationEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("AnimationEvent");
event.initAnimationEvent(name, desc.bubbles, desc.cancelable,
desc.animationName, desc.elapsedTime);
return event;
})}};
self.$alias_native("name", "animationName");
return self.$alias_native("elapsed", "elapsedTime");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $AudioProcessing(){};
var self = $AudioProcessing = $klass($base, $super, 'AudioProcessing', $AudioProcessing);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.AudioProcessing");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$time='] = function(value) {
var self = this;
return self["native"].playbackTime = value;
};
def['$input='] = function(value) {
var self = this;
return self["native"].inputBuffer = value;
};
return (def['$output='] = function(value) {
var self = this;
return self["native"].outputBuffer = value;
}, nil) && 'output=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new AudioProcessingEvent(name, desc);
})}};
self.$alias_native("time", "playbackTime");
self.$alias_native("input", "inputBuffer");
return self.$alias_native("output", "outputBuffer");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $BeforeUnload(){};
var self = $BeforeUnload = $klass($base, $super, 'BeforeUnload', $BeforeUnload);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.BeforeUnload");
});
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
return ($opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new BeforeUnloadEvent(name, desc);
}), nil) && 'construct'
} else {
return nil
}
} else {
return nil
};
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Clipboard(){};
var self = $Clipboard = $klass($base, $super, 'Clipboard', $Clipboard);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Clipboard");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$data='] = function(value) {
var self = this;
return self["native"].data = value;
};
return (def['$type='] = function(value) {
var self = this;
return self["native"].dataType = value;
}, nil) && 'type=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new ClipboardEvent(name, desc);
})}};
self.$alias_native("data");
return self.$alias_native("type", "dataType");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $DeviceLight(){};
var self = $DeviceLight = $klass($base, $super, 'DeviceLight', $DeviceLight);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.DeviceLight");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
return (def['$value='] = function(value) {
var self = this;
return self["native"].value = value;
}, nil) && 'value='
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new DeviceLightEvent(name, desc);
})}};
return self.$alias_native("value");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$new', '$to_n', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $DeviceMotion(){};
var self = $DeviceMotion = $klass($base, $super, 'DeviceMotion', $DeviceMotion);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.DeviceMotion");
});
$opal.cdecl($scope, 'Acceleration', $scope.Struct.$new("x", "y", "z"));
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$acceleration='] = function(value) {
var self = this;
return self["native"].acceleration = value.$to_n();
};
def['$acceleration_with_gravity='] = function(value) {
var self = this;
return self["native"].accelerationIncludingGravity = value.$to_n();
};
def['$rotation='] = function(value) {
var self = this;
return self["native"].rotationRate = value;
};
return (def['$interval='] = function(value) {
var self = this;
return self["native"].interval = value;
}, nil) && 'interval=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new DeviceMotionEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("DeviceMotionEvent");
event.initDeviceMotionEvent(name, desc.bubbles, desc.cancelable,
desc.acceleration, desc.accelerationIncludingGravity,
desc.rotationRate, desc.interval);
return event;
})}};
self.$alias_native("acceleration");
self.$alias_native("acceleration_with_gravity", "accelerationIncludingGravity");
self.$alias_native("rotation", "rotationRate");
return self.$alias_native("interval");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $DeviceOrientation(){};
var self = $DeviceOrientation = $klass($base, $super, 'DeviceOrientation', $DeviceOrientation);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.DeviceOrientation");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$absolute='] = function(value) {
var self = this;
return self["native"].absolute = value;
};
def['$alpha='] = function(value) {
var self = this;
return self["native"].alpha = value;
};
def['$beta='] = function(value) {
var self = this;
return self["native"].beta = value;
};
return (def['$gamma='] = function(value) {
var self = this;
return self["native"].gamma = value;
}, nil) && 'gamma=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new DeviceOrientationEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("DeviceOrientationEvent");
event.initDeviceOrientationEvent(name, desc.bubbles, desc.cancelable,
desc.alpha, desc.beta, desc.gamma, desc.absolute);
return event;
})}};
self.$alias_native("absolute");
self.$alias_native("alpha");
self.$alias_native("beta");
return self.$alias_native("gamma");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $DeviceProximity(){};
var self = $DeviceProximity = $klass($base, $super, 'DeviceProximity', $DeviceProximity);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.DeviceProximity");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$value='] = function(value) {
var self = this;
return self["native"].value = value;
};
def['$min='] = function(value) {
var self = this;
return self["native"].min = value;
};
return (def['$max='] = function(value) {
var self = this;
return self["native"].max = value;
}, nil) && 'max=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new DeviceProximityEvent(name, desc);
})}};
self.$alias_native("value");
self.$alias_native("min");
return self.$alias_native("max");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$include', '$new', '$convert', '$elem', '$supported?', '$alias_native', '$x', '$screen', '$y', '$DOM', '$raise']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Drag(){};
var self = $Drag = $klass($base, $super, 'Drag', $Drag);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Drag");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
(function($base, $super) {
function $Client(){};
var self = $Client = $klass($base, $super, 'Client', $Client);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def['$x='] = function(value) {
var self = this;
return self["native"].clientX = value;
};
return (def['$y='] = function(value) {
var self = this;
return self["native"].clientY = value;
}, nil) && 'y=';
})(self, null);
(function($base, $super) {
function $Screen(){};
var self = $Screen = $klass($base, $super, 'Screen', $Screen);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def['$x='] = function(value) {
var self = this;
return self["native"].screenX = value;
};
return (def['$y='] = function(value) {
var self = this;
return self["native"].screenY = value;
}, nil) && 'y=';
})(self, null);
def['$alt!'] = function() {
var self = this;
return self["native"].altKey = true;
};
def['$ctrl!'] = function() {
var self = this;
return self["native"].ctrlKey = true;
};
def['$meta!'] = function() {
var self = this;
return self["native"].metaKey = true;
};
def['$button='] = function(value) {
var self = this;
return self["native"].button = value;
};
def.$client = function() {
var self = this;
return $scope.Client.$new(self["native"]);
};
def.$screen = function() {
var self = this;
return $scope.Screen.$new(self["native"]);
};
def['$related='] = function(elem) {
var self = this;
return self["native"].relatedTarget = $scope.Native.$convert(elem);
};
return (def['$transfer='] = function(value) {
var self = this;
return self["native"].dataTransfer = $scope.Native.$convert(self.$elem());
}, nil) && 'transfer=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new DragEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("DragEvent");
event.initDragEvent(name, desc.bubbles, desc.cancelable,
desc.view || window, 0,
desc.screenX || 0, desc.screenY || 0,
desc.clientX || 0, desc.clientY || 0,
desc.ctrlKey, desc.altKey, desc.shiftKey, desc.metaKey,
desc.button || 0, desc.relatedTarget, desc.dataTransfer);
return event;
})}};
self.$alias_native("alt?", "altKey");
self.$alias_native("ctrl?", "ctrlKey");
self.$alias_native("meta?", "metaKey");
self.$alias_native("shift?", "shiftKey");
self.$alias_native("button");
def.$client = function() {
var self = this;
return $scope.Position.$new(self["native"].clientX, self["native"].clientY);
};
def.$screen = function() {
var $a, self = this;
if ((($a = (typeof(self["native"].screenX) !== "undefined")) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Position.$new(self["native"].screenX, self["native"].screenY)
} else {
return nil
};
};
def.$x = function() {
var self = this;
return self.$screen().$x();
};
def.$y = function() {
var self = this;
return self.$screen().$y();
};
def.$related = function() {
var self = this;
return self.$DOM(self["native"].relatedTarget);
};
return (def.$transfer = function() {
var self = this;
return self.$raise($scope.NotImplementedError);
}, nil) && 'transfer';
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Gamepad(){};
var self = $Gamepad = $klass($base, $super, 'Gamepad', $Gamepad);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Gamepad");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$id='] = function(value) {
var self = this;
return self["native"].id = value;
};
def['$index='] = function(value) {
var self = this;
return self["native"].index = value;
};
def['$at='] = function(value) {
var self = this;
return self["native"].timestamp = value;
};
def['$axes='] = function(value) {
var self = this;
return self["native"].axes = value;
};
return (def['$buttons='] = function(value) {
var self = this;
return self["native"].buttons = value;
}, nil) && 'buttons=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new GamepadEvent(name, {
bubbles: desc.bubbles,
cancelable: desc.cancelable,
gamepad: desc });
})}};
def.$id = function() {
var self = this;
return self["native"].gamepad.id;
};
def.$index = function() {
var self = this;
return self["native"].gamepad.index;
};
def.$at = function() {
var self = this;
return self["native"].gamepad.timestamp;
};
def.$axes = function() {
var self = this;
return self["native"].gamepad.axes;
};
return (def.$buttons = function() {
var self = this;
return self["native"].gamepad.buttons;
}, nil) && 'buttons';
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $HashChange(){};
var self = $HashChange = $klass($base, $super, 'HashChange', $HashChange);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.HashChange");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$old='] = function(value) {
var self = this;
return self["native"].oldURL = value;
};
return (def['$new='] = function(value) {
var self = this;
return self["native"].newURL = value;
}, nil) && 'new=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new HashChangeEvent(name, desc);
})}};
self.$alias_native("old", "oldURL");
return self.$alias_native("new", "newURL");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Progress(){};
var self = $Progress = $klass($base, $super, 'Progress', $Progress);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Progress");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$computable='] = function(value) {
var self = this;
return self["native"].computableLength = value;
};
def['$loaded='] = function(value) {
var self = this;
return self["native"].loaded = value;
};
return (def['$total='] = function(value) {
var self = this;
return self["native"].total = value;
}, nil) && 'total=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new ProgressEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("ProgressEvent");
event.initProgressEvent(name, desc.bubbles, desc.cancelable,
desc.computable, desc.loaded, desc.total);
return event;
})}};
self.$alias_native("computable?", "computableLength");
self.$alias_native("loaded");
return self.$alias_native("total");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $PageTransition(){};
var self = $PageTransition = $klass($base, $super, 'PageTransition', $PageTransition);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.PageTransition");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
return (def['$persisted='] = function(value) {
var self = this;
return self["native"].persisted = value;
}, nil) && 'persisted='
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.PageTransition")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new PageTransitionEvent(name, desc);
})}};
return self.$alias_native("persisted?", "persisted");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $PopState(){};
var self = $PopState = $klass($base, $super, 'PopState', $PopState);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.PopState");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
return (def['$state='] = function(value) {
var self = this;
return self["native"].state = value;
}, nil) && 'state='
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new PopStateEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent('PopStateEvent');
event.initPopStateEvent(name, desc.bubbles, desc.cancelable,
desc.state);
return event;
})}};
return self.$alias_native("state");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Storage(){};
var self = $Storage = $klass($base, $super, 'Storage', $Storage);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Storage");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$key='] = function(value) {
var self = this;
return self["native"].key = value;
};
def['$new='] = function(value) {
var self = this;
return self["native"].newValue = value;
};
def['$old='] = function(value) {
var self = this;
return self["native"].oldValue = value;
};
def['$area='] = function(value) {
var self = this;
return self["native"].storageArea = value;
};
return (def['$url='] = function(value) {
var self = this;
return self["native"].url = value;
}, nil) && 'url=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new StorageEvent(name, desc);
})}};
self.$alias_native("key");
self.$alias_native("new", "newValue");
self.$alias_native("old", "oldValue");
self.$alias_native("area", "storageArea");
return self.$alias_native("url");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native', '$==', '$downcase', '$name']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Touch(){};
var self = $Touch = $klass($base, $super, 'Touch', $Touch);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Touch");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$alt!'] = function() {
var self = this;
return self["native"].altKey = true;
};
def['$ctrl!'] = function() {
var self = this;
return self["native"].ctrlKey = true;
};
def['$meta!'] = function() {
var self = this;
return self["native"].metaKey = true;
};
return (def['$shift!'] = function() {
var self = this;
return self["native"].shiftKey = true;
}, nil) && 'shift!';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new TouchEvent(name, desc);
})}};
self.$alias_native("alt?", "altKey");
self.$alias_native("ctrl?", "ctrlKey");
self.$alias_native("meta?", "metaKey");
self.$alias_native("shift?", "shiftKey");
def['$cancel?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("touchcancel");
};
def['$end?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("touchend");
};
def['$leave?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("touchleave");
};
def['$move?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("touchmove");
};
return (def['$start?'] = function() {
var self = this;
return self.$name().$downcase()['$==']("touchstart");
}, nil) && 'start?';
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Sensor(){};
var self = $Sensor = $klass($base, $super, 'Sensor', $Sensor);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Sensor");
});
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
return ($opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new SensorEvent(name, desc);
}), nil) && 'construct'
} else {
return nil
}
} else {
return nil
};
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $hash2 = $opal.hash2, $range = $opal.range;
$opal.add_stubs(['$each_pair', '$[]=', '$to_sym', '$[]', '$end_with?', '$enum_for', '$is_a?', '$==', '$instance_variable_get', '$===', '$eql?', '$dup', '$to_n', '$hash', '$class', '$join', '$map', '$inspect']);
return (function($base, $super) {
function $OpenStruct(){};
var self = $OpenStruct = $klass($base, $super, 'OpenStruct', $OpenStruct);
var def = self._proto, $scope = self._scope, TMP_2;
def.table = nil;
def.$initialize = function(hash) {
var $a, $b, TMP_1, self = this;
if (hash == null) {
hash = nil
}
self.table = $hash2([], {});
if (hash !== false && hash !== nil) {
return ($a = ($b = hash).$each_pair, $a._p = (TMP_1 = function(key, value){var self = TMP_1._s || this;
if (self.table == null) self.table = nil;
if (key == null) key = nil;if (value == null) value = nil;
return self.table['$[]='](key.$to_sym(), value)}, TMP_1._s = self, TMP_1), $a).call($b)
} else {
return nil
};
};
def['$[]'] = function(name) {
var self = this;
return self.table['$[]'](name.$to_sym());
};
def['$[]='] = function(name, value) {
var self = this;
return self.table['$[]='](name.$to_sym(), value);
};
def.$method_missing = function(name, args) {
var $a, self = this;
args = $slice.call(arguments, 1);
if ((($a = name['$end_with?']("=")) !== nil && (!$a._isBoolean || $a == true))) {
return self.table['$[]='](name['$[]']($range(0, -2, false)).$to_sym(), args['$[]'](0))
} else {
return self.table['$[]'](name.$to_sym())
};
};
def.$each_pair = TMP_2 = function() {
var $a, $b, TMP_3, self = this, $iter = TMP_2._p, $yield = $iter || nil;
TMP_2._p = null;
if (($yield !== nil)) {
} else {
return self.$enum_for("each_pair")
};
return ($a = ($b = self.table).$each_pair, $a._p = (TMP_3 = function(pair){var self = TMP_3._s || this, $a;
if (pair == null) pair = nil;
return $a = $opal.$yield1($yield, pair), $a === $breaker ? $a : $a}, TMP_3._s = self, TMP_3), $a).call($b);
};
def['$=='] = function(other) {
var $a, self = this;
if ((($a = other['$is_a?']($scope.OpenStruct)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return false
};
return self.table['$=='](other.$instance_variable_get("@table"));
};
def['$==='] = function(other) {
var $a, self = this;
if ((($a = other['$is_a?']($scope.OpenStruct)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return false
};
return self.table['$==='](other.$instance_variable_get("@table"));
};
def['$eql?'] = function(other) {
var $a, self = this;
if ((($a = other['$is_a?']($scope.OpenStruct)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return false
};
return self.table['$eql?'](other.$instance_variable_get("@table"));
};
def.$to_h = function() {
var self = this;
return self.table.$dup();
};
def.$to_n = function() {
var self = this;
return self.table.$to_n();
};
def.$hash = function() {
var self = this;
return self.table.$hash();
};
return (def.$inspect = function() {
var $a, $b, TMP_4, self = this;
return "#<" + (self.$class()) + ": " + (($a = ($b = self.$each_pair()).$map, $a._p = (TMP_4 = function(name, value){var self = TMP_4._s || this;
if (name == null) name = nil;if (value == null) value = nil;
return "" + (name) + "=" + (self['$[]'](name).$inspect())}, TMP_4._s = self, TMP_4), $a).call($b).$join(" ")) + ">";
}, nil) && 'inspect';
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $range = $opal.range;
$opal.add_stubs(['$supports?', '$end_with?', '$[]', '$to_n', '$merge!', '$Native', '$new', '$has_key?']);
;
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Custom(){};
var self = $Custom = $klass($base, $super, 'Custom', $Custom);
var def = self._proto, $scope = self._scope, $a, TMP_1, TMP_2;
def.detail = nil;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Custom");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
return (def.$method_missing = function(name, value) {
var $a, self = this;
if ((($a = name['$end_with?']("=")) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"][name['$[]']($range(0, -2, false))] = value;
} else {
return nil
};
}, nil) && 'method_missing'
})(self, $scope.Definition);
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new CustomEvent(name, {
bubbles: desc.bubbles,
cancelable: desc.cancelable,
detail: desc });
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("CustomEvent");
event.initCustomEvent(name, desc.bubbles, desc.cancelable, desc);
return event;
})
} else if ((($a = $scope.Browser['$supports?']("Event.createObject")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return self.$Native(document.createEventObject())['$merge!']({
type: name,
bubbles: desc.bubbles,
cancelable: desc.cancelable,
detail: desc }).$to_n();
})
} else {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return self.$Native(desc)['$merge!']({
type: name,
bubbles: desc.bubbles,
cancelable: desc.cancelable,
detail: desc }).$to_n();
})
};
def.$initialize = TMP_1 = function(event, callback) {
var self = this, $iter = TMP_1._p, $yield = $iter || nil;
if (callback == null) {
callback = nil
}
TMP_1._p = null;
$opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [event, callback]);
return self.detail = $scope.Hash.$new(event.detail);
};
return (def.$method_missing = TMP_2 = function(id) {var $zuper = $slice.call(arguments, 0);
var $a, self = this, $iter = TMP_2._p, $yield = $iter || nil;
TMP_2._p = null;
if ((($a = self.detail['$has_key?'](id)) !== nil && (!$a._isBoolean || $a == true))) {
return self.detail['$[]'](id)};
return $opal.find_super_dispatcher(self, 'method_missing', TMP_2, $iter).apply(self, $zuper);
}, nil) && 'method_missing';
})(self, $scope.Event)
})(self, null)
})(self)
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $gvars = $opal.gvars;
$opal.add_stubs(['$[]', '$name_for', '$include', '$attr_reader', '$==', '$for', '$to_n', '$enum_for']);
return (function($base, $super) {
function $Buffer(){};
var self = $Buffer = $klass($base, $super, 'Buffer', $Buffer);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Array(){};
var self = $Array = $klass($base, $super, 'Array', $Array);
var def = self._proto, $scope = self._scope, TMP_1, TMP_2;
def["native"] = nil;
$opal.defs(self, '$for', function(bits, type) {
var self = this;
if ($gvars.$ == null) $gvars.$ = nil;
return $gvars.$['$[]']("" + ($scope.Buffer.$name_for(bits, type)) + "Array");
});
self.$include($scope.Enumerable);
self.$attr_reader("buffer", "type");
def.$initialize = TMP_1 = function(buffer, bits, type) {
var self = this, $iter = TMP_1._p, $yield = $iter || nil;
if (bits == null) {
bits = nil
}
if (type == null) {
type = nil
}
TMP_1._p = null;
if ($scope.Native['$=='](buffer)) {
$opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [buffer])
} else {
var klass = $scope.Array.$for(bits, type);
$opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [new klass(buffer.$to_n())])
;
};
self.buffer = buffer;
return self.type = type;
};
def.$bits = function() {
var self = this;
return self["native"].BYTES_PER_ELEMENT * 8;
};
def['$[]'] = function(index, offset) {
var self = this;
if (offset == null) {
offset = nil
}
if (offset !== false && offset !== nil) {
return self["native"].subarray(index, offset);
} else {
return self["native"][index];
};
};
def['$[]='] = function(index, value) {
var self = this;
return self["native"][index] = value;
};
def.$bytesize = function() {
var self = this;
return self["native"].byteLength;
};
def.$each = TMP_2 = function() {
var $a, self = this, $iter = TMP_2._p, $yield = $iter || nil;
TMP_2._p = null;
if (($yield !== nil)) {
} else {
return self.$enum_for("each")
};
for (var i = 0, length = self["native"].length; i < length; i++) {
((($a = $opal.$yield1($yield, self["native"][i])) === $breaker) ? $breaker.$v : $a)
}
;
return self;
};
def.$length = function() {
var self = this;
return self["native"].length;
};
def['$merge!'] = function(other, offset) {
var self = this;
return self["native"].set(other.$to_n(), offset);
};
return $opal.defn(self, '$size', def.$length);
})(self, $scope.Native)
})(self, $scope.Native)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $gvars = $opal.gvars;
$opal.add_stubs(['$include', '$!', '$nil?', '$[]', '$attr_reader', '$native?', '$to_n', '$name_for']);
return (function($base, $super) {
function $Buffer(){};
var self = $Buffer = $klass($base, $super, 'Buffer', $Buffer);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $View(){};
var self = $View = $klass($base, $super, 'View', $View);
var def = self._proto, $scope = self._scope, TMP_1;
def["native"] = nil;
self.$include($scope.Native);
$opal.defs(self, '$supported?', function() {
var self = this;
if ($gvars.$ == null) $gvars.$ = nil;
return $gvars.$['$[]']("DataView")['$nil?']()['$!']();
});
self.$attr_reader("buffer", "offset");
def.$initialize = TMP_1 = function(buffer, offset, length) {
var $a, $b, self = this, $iter = TMP_1._p, $yield = $iter || nil;
if (offset == null) {
offset = nil
}
if (length == null) {
length = nil
}
TMP_1._p = null;
if ((($a = self['$native?'](buffer)) !== nil && (!$a._isBoolean || $a == true))) {
$opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [buffer])
} else if ((($a = (($b = offset !== false && offset !== nil) ? length : $b)) !== nil && (!$a._isBoolean || $a == true))) {
$opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [new DataView(buffer.$to_n(), offset.$to_n(), length.$to_n())])
} else if (offset !== false && offset !== nil) {
$opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [new DataView(buffer.$to_n(), offset.$to_n())])
} else {
$opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [new DataView(buffer.$to_n())])
};
self.buffer = buffer;
return self.offset = offset;
};
def.$length = function() {
var self = this;
return self["native"].byteLength;
};
$opal.defn(self, '$size', def.$length);
def.$get = function(offset, bits, type, little) {
var self = this;
if (bits == null) {
bits = 8
}
if (type == null) {
type = "unsigned"
}
if (little == null) {
little = false
}
return self["native"]["get" + $scope.Buffer.$name_for(bits, type)](offset, little);
};
$opal.defn(self, '$[]', def.$get);
def.$set = function(offset, value, bits, type, little) {
var self = this;
if (bits == null) {
bits = 8
}
if (type == null) {
type = "unsigned"
}
if (little == null) {
little = false
}
return self["native"]["set" + $scope.Buffer.$name_for(bits, type)](offset, value, little);
};
$opal.defn(self, '$[]=', def.$set);
def.$get_int8 = function(offset, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].getInt8(offset, little);
};
def.$set_int8 = function(offset, value, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].setInt8(offset, value, little);
};
def.$get_uint8 = function(offset, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].getUint8(offset, little);
};
def.$set_uint8 = function(offset, value, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].setUint8(offset, value, little);
};
def.$get_int16 = function(offset, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].getInt16(offset, little);
};
def.$set_int16 = function(offset, value, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].setInt16(offset, value, little);
};
def.$get_uint16 = function(offset, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].getUint16(offset, little);
};
def.$set_uint16 = function(offset, value, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].setUint16(offset, value, little);
};
def.$get_int32 = function(offset, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].getInt32(offset, little);
};
def.$set_int32 = function(offset, value, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].setInt32(offset, value, little);
};
def.$get_uint32 = function(offset, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].getUint32(offset, little);
};
def.$set_uint32 = function(offset, value, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].setUint32(offset, value, little);
};
def.$get_float32 = function(offset, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].getFloat32(offset, little);
};
def.$set_float32 = function(offset, value, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].setFloat32(offset, value, little);
};
def.$get_float64 = function(offset, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].getFloat64(offset, little);
};
return (def.$set_float64 = function(offset, value, little) {
var self = this;
if (little == null) {
little = false
}
return self["native"].setFloat64(offset, value, little);
}, nil) && 'set_float64';
})(self, null)
})(self, null)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $klass = $opal.klass, $gvars = $opal.gvars;
$opal.add_stubs(['$include', '$!', '$nil?', '$[]', '$===', '$native?', '$new']);
;
;
return (function($base, $super) {
function $Buffer(){};
var self = $Buffer = $klass($base, $super, 'Buffer', $Buffer);
var def = self._proto, $scope = self._scope, TMP_1;
def["native"] = nil;
self.$include($scope.Native);
$opal.defs(self, '$supported?', function() {
var self = this;
if ($gvars.$ == null) $gvars.$ = nil;
return $gvars.$['$[]']("ArrayBuffer")['$nil?']()['$!']();
});
$opal.defs(self, '$name_for', function(bits, type) {
var self = this, $case = nil;
return "" + ((function() {$case = type;if ("unsigned"['$===']($case)) {return "Uint"}else if ("signed"['$===']($case)) {return "Int"}else if ("float"['$===']($case)) {return "Float"}else { return nil }})()) + (bits);
});
def.$initialize = TMP_1 = function(size, bits) {
var $a, self = this, $iter = TMP_1._p, $yield = $iter || nil;
if (bits == null) {
bits = 8
}
TMP_1._p = null;
if ((($a = self['$native?'](size)) !== nil && (!$a._isBoolean || $a == true))) {
return $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [size])
} else {
return $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [new ArrayBuffer(size * (bits / 8))])
};
};
def.$length = function() {
var self = this;
return self["native"].byteLength;
};
$opal.defn(self, '$size', def.$length);
def.$to_a = function(bits, type) {
var self = this;
if (bits == null) {
bits = 8
}
if (type == null) {
type = "unsigned"
}
return $scope.Array.$new(self, bits, type);
};
return (def.$view = function(offset, length) {
var self = this;
if (offset == null) {
offset = nil
}
if (length == null) {
length = nil
}
return $scope.View.$new(self, offset, length);
}, nil) && 'view';
})(self, null);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$convert', '$supported?', '$new', '$alias_native']);
;
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Message(){};
var self = $Message = $klass($base, $super, 'Message', $Message);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Message");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$data='] = function(value) {
var self = this;
return self["native"].data = value;
};
def['$origin='] = function(value) {
var self = this;
return self["native"].origin = value;
};
return (def['$source='] = function(value) {
var self = this;
return self["native"].source = $scope.Native.$convert(value);
}, nil) && 'source=';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new MessageEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("MessageEvent");
event.initMessageEvent(name, desc.bubbles, desc.cancelable,
desc.data, desc.origin, "", desc.source || window);
return event;
})}};
def.$data = function() {
var self = this;
if (window.ArrayBuffer && self["native"].data instanceof ArrayBuffer) {
return $scope.Buffer.$new(self["native"].data);
}
else if (window.Blob && self["native"].data instanceof Blob) {
return $scope.Blob.$new(self["native"].data);
}
else {
return self["native"].data;
}
;
};
self.$alias_native("origin");
return (def.$source = function() {
var self = this;
var source = self["native"].source;
if (window.Window && source instanceof window.Window) {
return $scope.Window.$new(source);
}
else {
return nil;
}
;
}, nil) && 'source';
})(self, $scope.Event)
})(self, null)
})(self)
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$supports?', '$supported?', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Close(){};
var self = $Close = $klass($base, $super, 'Close', $Close);
var def = self._proto, $scope = self._scope, $a;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("Event.Close");
});
(function($base, $super) {
function $Definition(){};
var self = $Definition = $klass($base, $super, 'Definition', $Definition);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$code='] = function(value) {
var self = this;
return self["native"].code = value;
};
def['$reason='] = function(value) {
var self = this;
return self["native"].reason = value;
};
def['$clean!'] = function(value) {
var self = this;
return self["native"].wasClean = true;
};
return (def['$not_clean!'] = function(value) {
var self = this;
return self["native"].wasClean = false;
}, nil) && 'not_clean!';
})(self, $scope.Definition);
if ((($a = self['$supported?']()) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new CloseEvent(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
var event = document.createEvent("CloseEvent");
event.initCloseEvent(name, desc.bubbles, desc.cancelable,
desc.wasClean, desc.code, desc.reason);
return event;
})}};
self.$alias_native("code");
self.$alias_native("reason");
return self.$alias_native("clean?", "wasClean");
})(self, $scope.Event)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$gsub', '$[]', '$aliases', '$name_for', '$===', '$class_for', '$new', '$construct', '$to_proc', '$const_get', '$arguments=', '$supports?', '$merge!', '$Native', '$to_n', '$==', '$name', '$attr_reader', '$attr_writer', '$convert', '$alias_native', '$off', '$prevent', '$stop']);
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Event(){};
var self = $Event = $klass($base, $super, 'Event', $Event);
var def = self._proto, $scope = self._scope, TMP_1, $a, TMP_2, TMP_3;
def["native"] = def.on = def.callback = nil;
$opal.defs(self, '$aliases', function() {
var $a, self = this;
if (self.aliases == null) self.aliases = nil;
return ((($a = self.aliases) !== false && $a !== nil) ? $a : self.aliases = $hash2(["dom:load", "hover"], {"dom:load": "DOMContentLoaded", "hover": "mouse:over"}));
});
$opal.defs(self, '$name_for', function(name) {
var $a, self = this;
return (((($a = self.$aliases()['$[]'](name)) !== false && $a !== nil) ? $a : name)).$gsub(":", "");
});
$opal.defs(self, '$class_for', function(name) {
var self = this, type = nil, $case = nil;
return type = (function() {$case = self.$name_for(name);if ("animationend"['$===']($case) || "animationiteration"['$===']($case) || "animationstart"['$===']($case)) {return $scope.Animation}else if ("audioprocess"['$===']($case)) {return $scope.AudioProcessing}else if ("beforeunload"['$===']($case)) {return $scope.BeforeUnload}else if ("compositionend"['$===']($case) || "compositionstart"['$===']($case) || "compositionupdate"['$===']($case)) {return $scope.Composition}else if ("copy"['$===']($case) || "cut"['$===']($case)) {return $scope.Clipboard}else if ("devicelight"['$===']($case)) {return $scope.DeviceLight}else if ("devicemotion"['$===']($case)) {return $scope.DeviceMotion}else if ("deviceorientation"['$===']($case)) {return $scope.DeviceOrientation}else if ("deviceproximity"['$===']($case)) {return $scope.DeviceProximity}else if ("drag"['$===']($case) || "dragend"['$===']($case) || "dragleave"['$===']($case) || "dragover"['$===']($case) || "dragstart"['$===']($case) || "drop"['$===']($case)) {return $scope.Drag}else if ("gamepadconnected"['$===']($case) || "gamepaddisconnected"['$===']($case)) {return $scope.Gamepad}else if ("hashchange"['$===']($case)) {return $scope.HashChange}else if ("load"['$===']($case) || "loadend"['$===']($case) || "loadstart"['$===']($case)) {return $scope.Progress}else if ("pagehide"['$===']($case) || "pageshow"['$===']($case)) {return $scope.PageTransition}else if ("popstate"['$===']($case)) {return $scope.PopState}else if ("storage"['$===']($case)) {return $scope.Storage}else if ("touchcancel"['$===']($case) || "touchend"['$===']($case) || "touchleave"['$===']($case) || "touchmove"['$===']($case) || "touchstart"['$===']($case)) {return $scope.Touch}else if ("compassneedscalibration"['$===']($case) || "userproximity"['$===']($case)) {return $scope.Sensor}else if ("message"['$===']($case)) {return $scope.Message}else if ("close"['$===']($case)) {return $scope.Close}else if ("click"['$===']($case) || "contextmenu"['$===']($case) || "dblclick"['$===']($case) || "mousedown"['$===']($case) || "mouseenter"['$===']($case) || "mouseleave"['$===']($case) || "mousemove"['$===']($case) || "mouseout"['$===']($case) || "mouseover"['$===']($case) || "mouseup"['$===']($case) || "show"['$===']($case)) {return $scope.Mouse}else if ("keydown"['$===']($case) || "keypress"['$===']($case) || "keyup"['$===']($case)) {return $scope.Keyboard}else if ("blur"['$===']($case) || "focus"['$===']($case) || "focusin"['$===']($case) || "focusout"['$===']($case)) {return $scope.Focus}else if ("wheel"['$===']($case)) {return $scope.Wheel}else if ("abort"['$===']($case) || "afterprint"['$===']($case) || "beforeprint"['$===']($case) || "cached"['$===']($case) || "canplay"['$===']($case) || "canplaythrough"['$===']($case) || "change"['$===']($case) || "chargingchange"['$===']($case) || "chargingtimechange"['$===']($case) || "checking"['$===']($case) || "close"['$===']($case) || "dischargingtimechange"['$===']($case) || "DOMContentLoaded"['$===']($case) || "downloading"['$===']($case) || "durationchange"['$===']($case) || "emptied"['$===']($case) || "ended"['$===']($case) || "error"['$===']($case) || "fullscreenchange"['$===']($case) || "fullscreenerror"['$===']($case) || "input"['$===']($case) || "invalid"['$===']($case) || "levelchange"['$===']($case) || "loadeddata"['$===']($case) || "loadedmetadata"['$===']($case) || "noupdate"['$===']($case) || "obsolete"['$===']($case) || "offline"['$===']($case) || "online"['$===']($case) || "open"['$===']($case) || "orientationchange"['$===']($case) || "pause"['$===']($case) || "pointerlockchange"['$===']($case) || "pointerlockerror"['$===']($case) || "play"['$===']($case) || "playing"['$===']($case) || "ratechange"['$===']($case) || "readystatechange"['$===']($case) || "reset"['$===']($case) || "seeked"['$===']($case) || "seeking"['$===']($case) || "stalled"['$===']($case) || "submit"['$===']($case) || "success"['$===']($case) || "suspend"['$===']($case) || "timeupdate"['$===']($case) || "updateready"['$===']($case) || "visibilitychange"['$===']($case) || "volumechange"['$===']($case) || "waiting"['$===']($case)) {return $scope.Event}else {return $scope.Custom}})();
});
$opal.defs(self, '$supported?', function() {
var self = this;
return true;
});
$opal.defs(self, '$create', TMP_1 = function(name, args) {
var $a, $b, self = this, $iter = TMP_1._p, block = $iter || nil, klass = nil, event = nil;
args = $slice.call(arguments, 1);
TMP_1._p = null;
name = self.$name_for(name);
klass = self.$class_for(name);
event = klass.$new(klass.$construct(name, ($a = ($b = klass.$const_get("Definition")).$new, $a._p = block.$to_proc(), $a).call($b)));
event['$arguments='](args);
return event;
});
if ((($a = $scope.Browser['$supports?']("Event.constructor")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return new Event(name, desc);
})
} else if ((($a = $scope.Browser['$supports?']("Event.create")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {try {
var self = this;
var event = document.createEvent("HTMLEvents");
event.initEvent(name, desc.bubbles, desc.cancelable);
$opal.$return(self.$Native(event)['$merge!'](desc));
} catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; }
})
} else if ((($a = $scope.Browser['$supports?']("Event.createObject")) !== nil && (!$a._isBoolean || $a == true))) {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return self.$Native(document.createEventObject())['$merge!'](desc)['$merge!']({ type: name }).$to_n();
})
} else {
$opal.defs(self, '$construct', function(name, desc) {
var self = this;
return self.$Native(desc)['$merge!']({ type: name }).$to_n();
})
};
$opal.defs(self, '$new', TMP_2 = function(value, callback) {var $zuper = $slice.call(arguments, 0);
var self = this, $iter = TMP_2._p, $yield = $iter || nil, klass = nil;
if (callback == null) {
callback = nil
}
TMP_2._p = null;
if (self['$==']($scope.Event)) {
} else {
return $opal.find_super_dispatcher(self, 'new', TMP_2, $iter, $Event).apply(self, $zuper)
};
klass = self.$class_for((function() {if (callback !== false && callback !== nil) {
return callback.$name()
} else {
return value.type;
}; return nil; })());
if (klass['$==']($scope.Event)) {
return $opal.find_super_dispatcher(self, 'new', TMP_2, $iter, $Event).apply(self, $zuper)
} else {
return klass.$new(value, callback)
};
});
self.$attr_reader("callback");
self.$attr_writer("on");
def.$initialize = TMP_3 = function(event, callback) {
var self = this, $iter = TMP_3._p, $yield = $iter || nil;
if (callback == null) {
callback = nil
}
TMP_3._p = null;
$opal.find_super_dispatcher(self, 'initialize', TMP_3, null).apply(self, [event]);
return self.callback = callback;
};
def.$name = function() {
var self = this;
return self["native"].type;
};
def.$on = function() {
var $a, self = this;
return ((($a = self.on) !== false && $a !== nil) ? $a : $scope.Target.$convert(self["native"].currentTarget));
};
def.$target = function() {
var self = this;
return $scope.Target.$convert(self["native"].srcElement || self["native"].target);
};
def.$arguments = function() {
var self = this;
return self["native"].arguments || [];
};
def['$arguments='] = function(args) {
var self = this;
return self["native"].arguments = args;
};
self.$alias_native("bubbles?", "bubbles");
self.$alias_native("cancelable?", "cancelable");
self.$alias_native("data");
self.$alias_native("phase", "eventPhase");
self.$alias_native("at", "timeStamp");
def.$off = function() {
var $a, self = this;
if ((($a = self.callback) !== nil && (!$a._isBoolean || $a == true))) {
return self.callback.$off()
} else {
return nil
};
};
def['$stopped?'] = function() {
var self = this;
return !!self["native"].stopped;
};
def.$stop = function() {
var $a, self = this;
if ((($a = (typeof(self["native"].stopPropagation) !== "undefined")) !== nil && (!$a._isBoolean || $a == true))) {
self["native"].stopPropagation();};
return self["native"].stopped = true;
};
def.$prevent = function() {
var $a, self = this;
if ((($a = (typeof(self["native"].preventDefault) !== "undefined")) !== nil && (!$a._isBoolean || $a == true))) {
self["native"].preventDefault();};
return self["native"].prevented = true;
};
def['$prevented?'] = function() {
var self = this;
return !!self["native"].prevented;
};
return (def['$stop!'] = function() {
var self = this;
self.$prevent();
return self.$stop();
}, nil) && 'stop!';
})(self, null)
})(self)
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $range = $opal.range;
$opal.add_stubs(['$attr_reader', '$each', '$===', '$concat', '$to_a', '$push', '$DOM', '$convert', '$respond_to?', '$__send__', '$to_proc', '$new', '$document', '$dup', '$to_ary', '$select', '$matches?', '$after', '$last', '$raise', '$before', '$first', '$children', '$uniq', '$flatten', '$map', '$search', '$[]', '$inspect']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $NodeSet(){};
var self = $NodeSet = $klass($base, $super, 'NodeSet', $NodeSet);
var def = self._proto, $scope = self._scope, TMP_2;
def.literal = def.document = nil;
self.$attr_reader("document");
def.$initialize = function(document, list) {
var $a, $b, TMP_1, self = this;
if (list == null) {
list = []
}
self.document = document;
self.literal = [];
return ($a = ($b = list).$each, $a._p = (TMP_1 = function(el){var self = TMP_1._s || this, $a;
if (self.literal == null) self.literal = nil;
if (el == null) el = nil;
if ((($a = $scope.NodeSet['$==='](el)) !== nil && (!$a._isBoolean || $a == true))) {
return self.literal.$concat(el.$to_a())
} else {
return self.literal.$push(self.$DOM($scope.Native.$convert(el)))
}}, TMP_1._s = self, TMP_1), $a).call($b);
};
def['$respond_to_missing?'] = function(name) {
var self = this;
return self.literal['$respond_to?'](name);
};
def.$method_missing = TMP_2 = function(name, args) {
var $a, $b, TMP_3, $c, self = this, $iter = TMP_2._p, block = $iter || nil, result = nil;
args = $slice.call(arguments, 1);
TMP_2._p = null;
if ((($a = self.literal['$respond_to?'](name)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
($a = ($b = self).$each, $a._p = (TMP_3 = function(el){var self = TMP_3._s || this, $a, $b;
if (el == null) el = nil;
return ($a = ($b = el).$__send__, $a._p = block.$to_proc(), $a).apply($b, [name].concat(args))}, TMP_3._s = self, TMP_3), $a).call($b);
return self;
};
result = ($a = ($c = self.literal).$__send__, $a._p = block.$to_proc(), $a).apply($c, [name].concat(args));
if ((($a = result === self.literal) !== nil && (!$a._isBoolean || $a == true))) {
return self
} else if ((($a = $scope.Array['$==='](result)) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.NodeSet.$new(self.document, result)
} else {
return result
};
};
def.$dup = function() {
var self = this;
return $scope.NodeSet.$new(self.$document(), self.$to_ary().$dup());
};
def.$filter = function(expression) {
var $a, $b, TMP_4, self = this;
return $scope.NodeSet.$new(self.$document(), ($a = ($b = self.literal).$select, $a._p = (TMP_4 = function(node){var self = TMP_4._s || this;
if (node == null) node = nil;
return node['$matches?'](expression)}, TMP_4._s = self, TMP_4), $a).call($b));
};
def.$after = function(node) {
var self = this;
return self.$last().$after(node);
};
def.$at = function(path) {
var self = this;
return self.$raise($scope.NotImplementedError);
};
def.$at_css = function(rules) {
var self = this;
rules = $slice.call(arguments, 0);
return self.$raise($scope.NotImplementedError);
};
def.$at_xpath = function(paths) {
var self = this;
paths = $slice.call(arguments, 0);
return self.$raise($scope.NotImplementedError);
};
def.$before = function() {
var self = this;
return self.$first().$before();
};
def.$children = function() {
var $a, $b, TMP_5, self = this, result = nil;
result = $scope.NodeSet.$new(self.$document());
($a = ($b = self).$each, $a._p = (TMP_5 = function(n){var self = TMP_5._s || this;
if (n == null) n = nil;
return result.$concat(n.$children())}, TMP_5._s = self, TMP_5), $a).call($b);
return result;
};
def.$css = function(paths) {
var self = this;
paths = $slice.call(arguments, 0);
return self.$raise($scope.NotImplementedError);
};
def.$search = function(what) {
var $a, $b, TMP_6, self = this;
what = $slice.call(arguments, 0);
return ($a = ($b = self).$map, $a._p = (TMP_6 = function(n){var self = TMP_6._s || this, $a;
if (n == null) n = nil;
return ($a = n).$search.apply($a, [].concat(what))}, TMP_6._s = self, TMP_6), $a).call($b).$flatten().$uniq();
};
return (def.$inspect = function() {
var self = this;
return "#<DOM::NodeSet: " + (self.literal.$inspect()['$[]']($range(1, -2, false)));
}, nil) && 'inspect';
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$include', '$==', '$[]', '$new', '$raise', '$try_convert', '$downcase', '$name', '$native?', '$respond_to?', '$each', '$add_child', '$===', '$convert', '$parent', '$document', '$last', '$<<', '$pop', '$select!', '$matches?', '$remove_child', '$to_proc', '$children', '$supports?', '$node_type', '$first', '$DOM', '$select', '$element_children', '$to_s', '$next', '$!', '$element?', '$previous']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Node(){};
var self = $Node = $klass($base, $super, 'Node', $Node);
var def = self._proto, $scope = self._scope, TMP_1, $a, TMP_4;
def["native"] = nil;
self.$include($scope.Native);
$opal.cdecl($scope, 'ELEMENT_NODE', 1);
$opal.cdecl($scope, 'ATTRIBUTE_NODE', 2);
$opal.cdecl($scope, 'TEXT_NODE', 3);
$opal.cdecl($scope, 'CDATA_SECTION_NODE', 4);
$opal.cdecl($scope, 'ENTITY_REFERENCE_NOCE', 5);
$opal.cdecl($scope, 'ENTITY_NODE', 6);
$opal.cdecl($scope, 'PROCESSING_INSTRUCTION_NODE', 7);
$opal.cdecl($scope, 'COMMENT_NODE', 8);
$opal.cdecl($scope, 'DOCUMENT_NODE', 9);
$opal.cdecl($scope, 'DOCUMENT_TYPE_NODE', 10);
$opal.cdecl($scope, 'DOCUMENT_FRAGMENT_NODE', 11);
$opal.cdecl($scope, 'NOTATION_NODE', 12);
$opal.defs(self, '$new', TMP_1 = function(value) {var $zuper = $slice.call(arguments, 0);
var $a, self = this, $iter = TMP_1._p, $yield = $iter || nil, klass = nil;
if (self.classes == null) self.classes = nil;
TMP_1._p = null;
if (self['$==']($scope.Node)) {
((($a = self.classes) !== false && $a !== nil) ? $a : self.classes = [nil, $scope.Element, $scope.Attribute, $scope.Text, $scope.CDATA, nil, nil, nil, $scope.Comment, $scope.Document, nil, $scope.DocumentFragment]);
if ((($a = klass = self.classes['$[]'](value.nodeType)) !== nil && (!$a._isBoolean || $a == true))) {
return klass.$new(value)
} else {
return self.$raise($scope.ArgumentError, "cannot instantiate a non derived Node object")
};
} else {
return $opal.find_super_dispatcher(self, 'new', TMP_1, $iter, $Node).apply(self, $zuper)
};
});
def['$=='] = function(other) {
var self = this;
return self["native"] === $scope.Native.$try_convert(other);
};
def['$=~'] = function(name) {
var self = this;
return self.$name().$downcase()['$=='](name.$downcase());
};
def['$<<'] = function(node) {
var $a, $b, TMP_2, self = this;
if ((($a = self['$native?'](node)) !== nil && (!$a._isBoolean || $a == true))) {
self["native"].appendChild(node);
} else if ((($a = node['$respond_to?']("each")) !== nil && (!$a._isBoolean || $a == true))) {
($a = ($b = node).$each, $a._p = (TMP_2 = function(n){var self = TMP_2._s || this;
if (n == null) n = nil;
return self.$add_child(n)}, TMP_2._s = self, TMP_2), $a).call($b)
} else if ((($a = $scope.String['$==='](node)) !== nil && (!$a._isBoolean || $a == true))) {
self["native"].appendChild(self["native"].ownerDocument.createTextNode(node));
} else {
self["native"].appendChild($scope.Native.$convert(node));
};
return self;
};
$opal.defn(self, '$add_child', def['$<<']);
def.$add_next_sibling = function(node) {
var $a, self = this;
if ((($a = self['$native?'](node)) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"].parentNode.insertBefore(node, self["native"].nextSibling);
} else if ((($a = $scope.String['$==='](node)) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"].parentNode.insertBefore(
self["native"].ownerDocument.createTextNode(node), self["native"].nextSibling);
} else {
return self["native"].parentNode.insertBefore($scope.Native.$convert(node),
self["native"].nextSibling);
};
};
def.$add_previous_sibling = function(node) {
var $a, self = this;
if ((($a = self['$native?'](node)) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"].parentNode.insertBefore(node, self["native"]);
} else if ((($a = $scope.String['$==='](node)) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"].parentNode.insertBefore(
self["native"].ownerDocument.createTextNode(node), self["native"]);
} else {
return self["native"].parentNode.insertBefore($scope.Native.$convert(node), self["native"]);
};
};
$opal.defn(self, '$after', def.$add_next_sibling);
def.$append_to = function(node) {
var self = this;
return node.$add_child(self);
};
def.$ancestors = function(expression) {
var $a, $b, TMP_3, self = this, parents = nil, parent = nil;
if (expression == null) {
expression = nil
}
if ((($a = self.$parent()) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return $scope.NodeSet.$new(self.$document())
};
parents = [self.$parent()];
while ((($b = parent = parents.$last().$parent()) !== nil && (!$b._isBoolean || $b == true))) {
parents['$<<'](parent)};
if ((($a = $scope.Document['$==='](parents.$last())) !== nil && (!$a._isBoolean || $a == true))) {
parents.$pop()};
if (expression !== false && expression !== nil) {
($a = ($b = parents)['$select!'], $a._p = (TMP_3 = function(p){var self = TMP_3._s || this;
if (p == null) p = nil;
return p['$matches?'](expression)}, TMP_3._s = self, TMP_3), $a).call($b)};
return $scope.NodeSet.$new(self.$document(), parents);
};
$opal.defn(self, '$before', def.$add_previous_sibling);
def.$remove = function() {
var $a, self = this;
if ((($a = self.$parent()) !== nil && (!$a._isBoolean || $a == true))) {
return self.$parent().$remove_child(self)
} else {
return nil
};
};
def.$clear = function() {
var $a, $b, self = this;
return ($a = ($b = self.$children()).$each, $a._p = "remove".$to_proc(), $a).call($b);
};
if ((($a = $scope.Browser['$supports?']("Element.textContent")) !== nil && (!$a._isBoolean || $a == true))) {
def.$content = function() {
var self = this;
return self["native"].textContent;
};
def['$content='] = function(value) {
var self = this;
return self["native"].textContent = value;
};
} else if ((($a = $scope.Browser['$supports?']("Element.innerText")) !== nil && (!$a._isBoolean || $a == true))) {
def.$content = function() {
var self = this;
return self["native"].innerText;
};
def['$content='] = function(value) {
var self = this;
return self["native"].innerText = value;
};
} else {
def.$content = function() {
var self = this;
return self.$raise($scope.NotImplementedError, "node text content unsupported");
};
def['$content='] = function(value) {
var self = this;
return self.$raise($scope.NotImplementedError, "node text content unsupported");
};
};
def['$blank?'] = function() {
var self = this;
return self.$raise($scope.NotImplementedError);
};
def['$cdata?'] = function() {
var self = this;
return self.$node_type()['$==']($scope.CDATA_SECTION_NODE);
};
def.$child = function() {
var self = this;
return self.$children().$first();
};
def.$children = function() {
var self = this;
return $scope.NodeSet.$new(self.$document(), ($scope.Native)._scope.Array.$new(self["native"].childNodes));
};
def['$children='] = function(node) {
var self = this;
return self.$raise($scope.NotImplementedError);
};
def['$comment?'] = function() {
var self = this;
return self.$node_type()['$==']($scope.COMMENT_NODE);
};
def.$document = function() {
var $a, self = this;
if ((($a = (typeof(self["native"].ownerDocument) !== "undefined")) !== nil && (!$a._isBoolean || $a == true))) {
return self.$DOM(self["native"].ownerDocument)
} else {
return nil
};
};
def['$document?'] = function() {
var self = this;
return self.$node_type()['$==']($scope.DOCUMENT_NODE);
};
def['$elem?'] = function() {
var self = this;
return self.$node_type()['$==']($scope.ELEMENT_NODE);
};
$opal.defn(self, '$element?', def['$elem?']);
def.$element_children = function() {
var $a, $b, self = this;
return ($a = ($b = self.$children()).$select, $a._p = "element?".$to_proc(), $a).call($b);
};
$opal.defn(self, '$elements', def.$element_children);
def.$first_element_child = function() {
var self = this;
return self.$element_children().$first();
};
def['$fragment?'] = function() {
var self = this;
return self.$node_type()['$==']($scope.DOCUMENT_FRAGMENT_NODE);
};
def.$inner_html = function() {
var self = this;
return self["native"].innerHTML;
};
def['$inner_html='] = function(value) {
var self = this;
return self["native"].innerHTML = value;
};
$opal.defn(self, '$inner_text', def.$content);
$opal.defn(self, '$inner_text=', def['$content=']);
def.$last_element_child = function() {
var self = this;
return self.$element_children().$last();
};
def['$matches?'] = function(expression) {
var self = this;
return false;
};
def.$name = function() {
var self = this;
return self["native"].nodeName || nil;
};
def['$name='] = function(value) {
var self = this;
return self["native"].nodeName = value.$to_s();
};
def.$namespace = function() {
var self = this;
return self["native"].namespaceURI || nil;
};
def.$next = function() {
var $a, self = this;
if ((($a = self["native"].nextSibling != null) !== nil && (!$a._isBoolean || $a == true))) {
return self.$DOM(self["native"].nextSibling)
} else {
return nil
};
};
$opal.defn(self, '$next=', def.$add_next_sibling);
def.$next_element = function() {
var $a, $b, $c, self = this, current = nil;
current = self.$next();
while ((($b = (($c = current !== false && current !== nil) ? current['$element?']()['$!']() : $c)) !== nil && (!$b._isBoolean || $b == true))) {
current = current.$next()};
return current;
};
$opal.defn(self, '$next_sibling', def.$next);
$opal.defn(self, '$node_name', def.$name);
$opal.defn(self, '$node_name=', def['$name=']);
def.$node_type = function() {
var self = this;
return self["native"].nodeType;
};
def.$parent = function() {
var $a, self = this;
if ((($a = self["native"].parentNode != null) !== nil && (!$a._isBoolean || $a == true))) {
return self.$DOM(self["native"].parentNode)
} else {
return nil
};
};
def['$parent='] = function(node) {
var self = this;
return self["native"].parentNode = $scope.Native.$try_convert(node);
};
def.$parse = function(text, options) {
var self = this;
if (options == null) {
options = $hash2([], {})
}
return self.$raise($scope.NotImplementedError);
};
def.$path = function() {
var self = this;
return self.$raise($scope.NotImplementedError);
};
def.$previous = function() {
var $a, self = this;
if ((($a = self["native"].previousSibling != null) !== nil && (!$a._isBoolean || $a == true))) {
return self.$DOM(self["native"].previousSibling)
} else {
return nil
};
};
$opal.defn(self, '$previous=', def.$add_previous_sibling);
def.$previous_element = function() {
var $a, $b, $c, self = this, current = nil;
current = self.$previous();
while ((($b = (($c = current !== false && current !== nil) ? current['$element?']()['$!']() : $c)) !== nil && (!$b._isBoolean || $b == true))) {
current = current.$previous()};
return current;
};
$opal.defn(self, '$previous_sibling', def.$previous);
def.$remove_child = function(node) {
var self = this;
return self["native"].removeChild($scope.Native.$try_convert(node));
};
def.$replace = function(node) {
var self = this;
self["native"].parentNode.replaceChild(self["native"], $scope.Native.$try_convert(node));
return node;
};
$opal.defn(self, '$text', def.$content);
$opal.defn(self, '$text=', def['$content=']);
def['$text?'] = function() {
var self = this;
return self.$node_type()['$==']($scope.TEXT_NODE);
};
def.$traverse = TMP_4 = function() {
var self = this, $iter = TMP_4._p, block = $iter || nil;
TMP_4._p = null;
return self.$raise($scope.NotImplementedError);
};
$opal.defn(self, '$type', def.$node_type);
def.$value = function() {
var self = this;
return self["native"].nodeValue || nil;
};
def['$value='] = function(value) {
var self = this;
return self["native"].nodeValue = value;
};
return (def.$inspect = function() {
var self = this;
return "#<DOM::Node: " + (self.$name()) + ">";
}, nil) && 'inspect';
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$include']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Attribute(){};
var self = $Attribute = $klass($base, $super, 'Attribute', $Attribute);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def['$id?'] = function() {
var self = this;
return self["native"].isId;
};
def.$name = function() {
var self = this;
return self["native"].name;
};
return (def.$value = function() {
var self = this;
return self["native"].value;
}, nil) && 'value';
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $CharacterData(){};
var self = $CharacterData = $klass($base, $super, 'CharacterData', $CharacterData);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def.$append = function(string) {
var self = this;
self["native"].appendData(string);
return self;
};
def.$data = function() {
var self = this;
return self["native"].data;
};
def.$delete = function(count, offset) {
var self = this;
if (offset == null) {
offset = 0
}
self["native"].deleteData(offset, count);
return self;
};
def.$insert = function(string, offset) {
var self = this;
if (offset == null) {
offset = 0
}
self["native"].insertData(offset, string);
return self;
};
self.$alias_native("length");
def.$replace = function(string, offset, count) {
var self = this;
if (offset == null) {
offset = 0
}
if (count == null) {
count = self["native"].length
}
self["native"].replaceData(offset, count, string);
return self;
};
return (def.$substring = function(count, offset) {
var self = this;
if (offset == null) {
offset = 0
}
return self["native"].substringData(offset, count);
}, nil) && 'substring';
})(self, $scope.Node)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $gvars = $opal.gvars;
$opal.add_stubs(['$create_text', '$DOM', '$data']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Text(){};
var self = $Text = $klass($base, $super, 'Text', $Text);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
$opal.defs(self, '$create', function(args) {
var $a, self = this;
if ($gvars.document == null) $gvars.document = nil;
args = $slice.call(arguments, 0);
return ($a = $gvars.document).$create_text.apply($a, [].concat(args));
});
def.$whole = function() {
var self = this;
return self["native"].wholeText;
};
def.$split = function(offset) {
var self = this;
return self.$DOM(self["native"].splitText(offset));
};
return (def.$inspect = function() {
var self = this;
return "#<DOM::Text: " + (self.$data()) + ">";
}, nil) && 'inspect';
})(self, $scope.CharacterData)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$value']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $CDATA(){};
var self = $CDATA = $klass($base, $super, 'CDATA', $CDATA);
var def = self._proto, $scope = self._scope;
return (def.$inspect = function() {
var self = this;
return "#<DOM::CDATA: " + (self.$value()) + ">";
}, nil) && 'inspect'
})(self, $scope.Text)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$value']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Comment(){};
var self = $Comment = $klass($base, $super, 'Comment', $Comment);
var def = self._proto, $scope = self._scope;
return (def.$inspect = function() {
var self = this;
return "#<DOM::Comment: " + (self.$value()) + ">";
}, nil) && 'inspect'
})(self, $scope.CharacterData)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$to_n', '$offset', '$get', '$parent', '$new', '$==', '$[]', '$style', '$=~', '$x=', '$+', '$x', '$to_i', '$y=', '$y', '$-']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Position(){};
var self = $Position = $klass($base, $super, 'Position', $Position);
var def = self._proto, $scope = self._scope;
def.element = nil;
def.$initialize = function(element) {
var self = this;
self.element = element;
return self["native"] = element.$to_n();
};
def.$get = function() {
var $a, self = this, offset = nil, position = nil, parent = nil, parent_offset = nil;
offset = self.element.$offset();
position = offset.$get();
parent = offset.$parent();
parent_offset = ($scope.Browser)._scope.Position.$new(0, 0);
if (self.element.$style()['$[]']("position")['$==']("fixed")) {
if ((($a = parent['$=~']("html")) !== nil && (!$a._isBoolean || $a == true))) {
} else {
parent_offset = parent.$offset()
};
($a = parent_offset, $a['$x=']($a.$x()['$+'](parent.$style()['$[]']("border-top-width").$to_i())));
($a = parent_offset, $a['$y=']($a.$y()['$+'](parent.$style()['$[]']("border-left-width").$to_i())));};
return ($scope.Browser)._scope.Position.$new(position.$x()['$-'](parent_offset.$x())['$-'](self.element.$style()['$[]']("margin-left").$to_i()), position.$y()['$-'](parent_offset.$y())['$-'](self.element.$style()['$[]']("margin-top").$to_i()));
};
def.$x = function() {
var self = this;
return self.$get().$x();
};
return (def.$y = function() {
var self = this;
return self.$get().$y();
}, nil) && 'y';
})(self, null)
})(self, $scope.Node)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$attr_reader', '$to_n', '$DOM', '$root', '$document', '$x', '$get', '$set', '$y', '$supports?', '$window', '$new', '$[]', '$style!', '$==', '$[]=', '$style', '$to_u', '$===', '$first', '$+', '$-', '$px']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Offset(){};
var self = $Offset = $klass($base, $super, 'Offset', $Offset);
var def = self._proto, $scope = self._scope, $a;
def["native"] = def.element = nil;
self.$attr_reader("element");
def.$initialize = function(element) {
var self = this;
self.element = element;
return self["native"] = element.$to_n();
};
def.$parent = function() {
var self = this;
return self.$DOM(self["native"].offsetParent || self.element.$document().$root().$to_n());
};
def.$x = function() {
var self = this;
return self.$get().$x();
};
def['$x='] = function(value) {
var self = this;
return self.$set(value, nil);
};
def.$y = function() {
var self = this;
return self.$get().$y();
};
def['$y='] = function(value) {
var self = this;
return self.$set(nil, value);
};
if ((($a = $scope.Browser['$supports?']("Element.getBoundingClientRect")) !== nil && (!$a._isBoolean || $a == true))) {
def.$get = function() {
var self = this, doc = nil, root = nil, win = nil;
doc = self.element.$document();
root = doc.$root().$to_n();
win = doc.$window().$to_n();
var box = self["native"].getBoundingClientRect(),
y = box.top + (win.pageYOffset || root.scrollTop) - (root.clientTop || 0),
x = box.left + (win.pageXOffset || root.scrollLeft) - (root.clientLeft || 0);
;
return ($scope.Browser)._scope.Position.$new(x, y);
}
} else {
def.$get = function() {
var self = this, doc = nil, root = nil, win = nil;
doc = self.$document();
root = doc.$root().$to_n();
win = doc.$window().$to_n();
var y = (win.pageYOffset || root.scrollTop) - (root.clientTop || 0),
x = (win.pageXOffset || root.scrollLeft) - (root.clientLeft || 0);
;
return ($scope.Browser)._scope.Position.$new(x, y);
}
};
return (def.$set = function(value) {
var $a, self = this, position = nil, offset = nil, top = nil, left = nil, x = nil, y = nil;
value = $slice.call(arguments, 0);
position = self.element['$style!']()['$[]']("position");
if (position['$==']("static")) {
self.element.$style()['$[]=']("position", "relative")};
offset = self.$get();
top = self.element['$style!']()['$[]']("top").$to_u();
left = self.element['$style!']()['$[]']("left").$to_u();
if ((($a = ($scope.Browser)._scope.Position['$==='](value.$first())) !== nil && (!$a._isBoolean || $a == true))) {
$a = [value.$first().$x(), value.$first().$y()], x = $a[0], y = $a[1]
} else if ((($a = $scope.Hash['$==='](value.$first())) !== nil && (!$a._isBoolean || $a == true))) {
$a = [value.$first()['$[]']("x"), value.$first()['$[]']("y")], x = $a[0], y = $a[1]
} else {
$a = $opal.to_ary(value), x = ($a[0] == null ? nil : $a[0]), y = ($a[1] == null ? nil : $a[1])
};
if (x !== false && x !== nil) {
self.element.$style()['$[]=']("left", (x.$px()['$-'](offset.$x()))['$+'](left))};
if (y !== false && y !== nil) {
return self.element.$style()['$[]=']("top", (y.$px()['$-'](offset.$y()))['$+'](top))
} else {
return nil
};
}, nil) && 'set';
})(self, null)
})(self, $scope.Node)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$to_n', '$supports?', '$[]', '$x', '$y', '$new', '$raise', '$position']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Scroll(){};
var self = $Scroll = $klass($base, $super, 'Scroll', $Scroll);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
def.$initialize = function(element) {
var self = this;
self.element = element;
return self["native"] = element.$to_n();
};
if ((($a = $scope.Browser['$supports?']("Element.scroll")) !== nil && (!$a._isBoolean || $a == true))) {
def.$to = function(what) {
var $a, self = this, x = nil, y = nil;
x = ((($a = what['$[]']("x")) !== false && $a !== nil) ? $a : self.$x());
y = ((($a = what['$[]']("y")) !== false && $a !== nil) ? $a : self.$y());
self["native"].scrollTop = y;
return self["native"].scrollLeft = x;
};
def.$position = function() {
var self = this;
return ($scope.Browser)._scope.Position.$new(self["native"].scrollLeft, self["native"].scrollTop);
};
} else if ((($a = $scope.Browser['$supports?']("Element.pageOffset")) !== nil && (!$a._isBoolean || $a == true))) {
def.$to = function(what) {
var $a, self = this, x = nil, y = nil;
x = ((($a = what['$[]']("x")) !== false && $a !== nil) ? $a : self.$x());
y = ((($a = what['$[]']("y")) !== false && $a !== nil) ? $a : self.$y());
self["native"].pageYOffset = y;
return self["native"].pageXOffset = x;
};
def.$position = function() {
var self = this;
return $scope.Position.$new(self["native"].pageXOffset, self["native"].pageYOffset);
};
} else {
def.$to = function(what) {
var self = this;
return self.$raise($scope.NotImplementedError, "scroll on element unsupported");
};
def.$position = function() {
var self = this;
return self.$raise($scope.NotImplementedError, "scroll on element unsupported");
};
};
def.$x = function() {
var self = this;
return self.$position().$x();
};
def.$y = function() {
var self = this;
return self.$position().$y();
};
def.$height = function() {
var self = this;
return self["native"].scrollHeight;
};
def.$width = function() {
var self = this;
return self["native"].scrollWidth;
};
return (def.$by = function(what) {
var $a, self = this, x = nil, y = nil;
x = ((($a = what['$[]']("x")) !== false && $a !== nil) ? $a : 0);
y = ((($a = what['$[]']("y")) !== false && $a !== nil) ? $a : 0);
self["native"].scrollBy(x, y);
return self;
}, nil) && 'by';
})(self, null)
})(self, $scope.Node)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$attr_reader', '$to_n', '$[]=', '$style']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Size(){};
var self = $Size = $klass($base, $super, 'Size', $Size);
var def = self._proto, $scope = self._scope;
def["native"] = def.element = nil;
self.$attr_reader("element");
def.$initialize = function(element, inc) {
var self = this;
inc = $slice.call(arguments, 1);
self.element = element;
self["native"] = element.$to_n();
return self.include = inc;
};
def.$width = function() {
var self = this;
return self["native"].offsetWidth;
};
def['$width='] = function(value) {
var self = this;
return self.element.$style()['$[]=']("width", value);
};
def.$height = function() {
var self = this;
return self["native"].offsetHeight;
};
return (def['$height='] = function(value) {
var self = this;
return self.element.$style()['$[]=']("height", value);
}, nil) && 'height=';
})(self, null)
})(self, $scope.Node)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs([]);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Input(){};
var self = $Input = $klass($base, $super, 'Input', $Input);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def.$value = function() {
var self = this;
return self["native"].value;
};
def['$value='] = function(value) {
var self = this;
return self["native"].value = value;
};
return (def.$clear = function() {
var self = this;
return self["native"].value = '';
}, nil) && 'clear';
})(self, $scope.Element)
})(self, $scope.Node)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs([]);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Image(){};
var self = $Image = $klass($base, $super, 'Image', $Image);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
def['$complete?'] = function() {
var self = this;
return self["native"].complete;
};
def['$cross?'] = function() {
var self = this;
return self["native"].crossOrigin;
};
def.$height = function() {
var self = this;
return self["native"].naturalHeight;
};
return (def.$width = function() {
var self = this;
return self["native"].naturalWidth;
}, nil) && 'width';
})(self, $scope.Element);
return $opal.cdecl($scope, 'Img', $scope.Image);
})(self, $scope.Node)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $gvars = $opal.gvars, $hash2 = $opal.hash2;
$opal.add_stubs(['$create_element', '$==', '$capitalize', '$const_defined?', '$new', '$const_get', '$include', '$target', '$DOM', '$alias_native', '$+', '$class_names', '$empty?', '$join', '$uniq', '$-', '$reject', '$to_proc', '$split', '$[]', '$to_s', '$!', '$attributes_nodesmap', '$map', '$attribute_nodes', '$height', '$size', '$height=', '$width', '$width=', '$set', '$offset', '$document', '$clear', '$<<', '$flatten', '$xpath', '$first', '$css', '$each', '$concat', '$to_a', '$supports?', '$loaded?', '$raise', '$is_a?', '$replace', '$assign', '$apply', '$to_n', '$window', '$===', '$name', '$attr_reader', '$enum_for', '$value', '$get_attribute', '$set_attribute', '$[]=']);
;
;
;
;
;
;
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope, TMP_1, $a, $b, TMP_2, TMP_4, $c, TMP_9;
def["native"] = nil;
$opal.defs(self, '$create', function(args) {
var $a, self = this;
if ($gvars.document == null) $gvars.document = nil;
args = $slice.call(arguments, 0);
return ($a = $gvars.document).$create_element.apply($a, [].concat(args));
});
$opal.defs(self, '$new', TMP_1 = function(node) {var $zuper = $slice.call(arguments, 0);
var $a, self = this, $iter = TMP_1._p, $yield = $iter || nil, name = nil;
TMP_1._p = null;
if (self['$==']($scope.Element)) {
name = (node.nodeName).$capitalize();
if ((($a = $scope.Element['$const_defined?'](name)) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Element.$const_get(name).$new(node)
} else {
return $opal.find_super_dispatcher(self, 'new', TMP_1, $iter, $Element).apply(self, $zuper)
};
} else {
return $opal.find_super_dispatcher(self, 'new', TMP_1, $iter, $Element).apply(self, $zuper)
};
});
self.$include(($scope.Event)._scope.Target);
($a = ($b = self).$target, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this;
if (value == null) value = nil;
try {return self.$DOM(value) } catch ($err) { return nil }}, TMP_2._s = self, TMP_2), $a).call($b);
self.$alias_native("id");
def.$add_class = function(names) {
var $a, self = this, classes = nil;
names = $slice.call(arguments, 0);
classes = self.$class_names()['$+'](names);
if ((($a = classes['$empty?']()) !== nil && (!$a._isBoolean || $a == true))) {
} else {
self["native"].className = classes.$uniq().$join(" ");
};
return self;
};
def.$remove_class = function(names) {
var $a, self = this, classes = nil;
names = $slice.call(arguments, 0);
classes = self.$class_names()['$-'](names);
if ((($a = classes['$empty?']()) !== nil && (!$a._isBoolean || $a == true))) {
self["native"].removeAttribute('class');
} else {
self["native"].className = classes.$join(" ");
};
return self;
};
self.$alias_native("class_name", "className");
def.$class_names = function() {
var $a, $b, self = this;
return ($a = ($b = (self["native"].className).$split(/\s+/)).$reject, $a._p = "empty?".$to_proc(), $a).call($b);
};
$opal.defn(self, '$attribute', def.$attr);
def.$attribute_nodes = function() {
var $a, $b, TMP_3, self = this;
return ($a = ($b = ($scope.Native)._scope.Array).$new, $a._p = (TMP_3 = function(e){var self = TMP_3._s || this;
if (e == null) e = nil;
return self.$DOM(e)}, TMP_3._s = self, TMP_3), $a).call($b, self["native"].attributes, $hash2(["get"], {"get": "item"}));
};
def.$attributes = function(options) {
var self = this;
if (options == null) {
options = $hash2([], {})
}
return $scope.Attributes.$new(self, options);
};
def.$get = function(name, options) {
var $a, self = this, namespace = nil;
if (options == null) {
options = $hash2([], {})
}
if ((($a = namespace = options['$[]']("namespace")) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"].getAttributeNS(namespace.$to_s(), name.$to_s()) || nil;
} else {
return self["native"].getAttribute(name.$to_s()) || nil;
};
};
def.$set = function(name, value, options) {
var $a, self = this, namespace = nil;
if (options == null) {
options = $hash2([], {})
}
if ((($a = namespace = options['$[]']("namespace")) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"].setAttributeNS(namespace.$to_s(), name.$to_s(), value);
} else {
return self["native"].setAttribute(name.$to_s(), value.$to_s());
};
};
$opal.defn(self, '$[]', def.$get);
$opal.defn(self, '$[]=', def.$set);
$opal.defn(self, '$attr', def.$get);
$opal.defn(self, '$attribute', def.$get);
$opal.defn(self, '$get_attribute', def.$get);
$opal.defn(self, '$set_attribute', def.$set);
def['$key?'] = function(name) {
var self = this;
return self['$[]'](name)['$!']()['$!']();
};
def.$keys = function() {
var $a, $b, self = this;
return ($a = ($b = self).$attributes_nodesmap, $a._p = "name".$to_proc(), $a).call($b);
};
def.$values = function() {
var $a, $b, self = this;
return ($a = ($b = self.$attribute_nodes()).$map, $a._p = "value".$to_proc(), $a).call($b);
};
def.$remove_attribute = function(name) {
var self = this;
return self["native"].removeAttribute(name);
};
def.$size = function(inc) {
var $a, self = this;
inc = $slice.call(arguments, 0);
return ($a = $scope.Size).$new.apply($a, [self].concat(inc));
};
def.$height = function() {
var self = this;
return self.$size().$height();
};
def['$height='] = function(value) {
var self = this;
return self.$size()['$height='](value);
};
def.$width = function() {
var self = this;
return self.$size().$width();
};
def['$width='] = function(value) {
var self = this;
return self.$size()['$width='](value);
};
def.$position = function() {
var self = this;
return $scope.Position.$new(self);
};
def.$offset = function(values) {
var $a, self = this, off = nil;
values = $slice.call(arguments, 0);
off = $scope.Offset.$new(self);
if ((($a = values['$empty?']()) !== nil && (!$a._isBoolean || $a == true))) {
} else {
($a = off).$set.apply($a, [].concat(values))
};
return off;
};
def['$offset='] = function(value) {
var $a, self = this;
return ($a = self.$offset()).$set.apply($a, [].concat(value));
};
def.$scroll = function() {
var self = this;
return $scope.Scroll.$new(self);
};
def.$inner_dom = TMP_4 = function() {
var $a, $b, self = this, $iter = TMP_4._p, block = $iter || nil, doc = nil;
TMP_4._p = null;
doc = self.$document();
self.$clear();
($a = ($b = $scope.Builder).$new, $a._p = block.$to_proc(), $a).call($b, doc, self);
return self;
};
def['$inner_dom='] = function(node) {
var self = this;
self.$clear();
return self['$<<'](node);
};
def['$/'] = function(paths) {
var $a, $b, TMP_5, self = this;
paths = $slice.call(arguments, 0);
return ($a = ($b = paths).$map, $a._p = (TMP_5 = function(path){var self = TMP_5._s || this;
if (path == null) path = nil;
return self.$xpath(path)}, TMP_5._s = self, TMP_5), $a).call($b).$flatten().$uniq();
};
def.$at = function(path) {
var $a, self = this;
return ((($a = self.$xpath(path).$first()) !== false && $a !== nil) ? $a : self.$css(path).$first());
};
def.$at_css = function(rules) {try {
var $a, $b, TMP_6, self = this;
rules = $slice.call(arguments, 0);
($a = ($b = rules).$each, $a._p = (TMP_6 = function(rule){var self = TMP_6._s || this, found = nil;
if (rule == null) rule = nil;
found = self.$css(rule).$first();
if (found !== false && found !== nil) {
$opal.$return(found)
} else {
return nil
};}, TMP_6._s = self, TMP_6), $a).call($b);
return nil;
} catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; }
};
def.$at_xpath = function(paths) {try {
var $a, $b, TMP_7, self = this;
paths = $slice.call(arguments, 0);
($a = ($b = paths).$each, $a._p = (TMP_7 = function(path){var self = TMP_7._s || this, found = nil;
if (path == null) path = nil;
found = self.$xpath(path).$first();
if (found !== false && found !== nil) {
$opal.$return(found)
} else {
return nil
};}, TMP_7._s = self, TMP_7), $a).call($b);
return nil;
} catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; }
};
def.$search = function(selectors) {
var $a, $b, TMP_8, self = this;
selectors = $slice.call(arguments, 0);
return $scope.NodeSet.$new(self.$document(), ($a = ($b = selectors).$map, $a._p = (TMP_8 = function(selector){var self = TMP_8._s || this;
if (selector == null) selector = nil;
return self.$xpath(selector).$to_a().$concat(self.$css(selector).$to_a())}, TMP_8._s = self, TMP_8), $a).call($b).$flatten().$uniq());
};
if ((($a = $scope.Browser['$supports?']("Query.css")) !== nil && (!$a._isBoolean || $a == true))) {
def.$css = function(path) {
var self = this;
try {
var result = self["native"].querySelectorAll(path);
return $scope.NodeSet.$new(self.$document(), ($scope.Native)._scope.Array.$new(result));
}
catch(e) {
return $scope.NodeSet.$new(self.$document());
}
;
}
} else if ((($a = $scope.Browser['$loaded?']("Sizzle")) !== nil && (!$a._isBoolean || $a == true))) {
def.$css = function(path) {
var self = this;
return $scope.NodeSet.$new(self.$document(), Sizzle(path, self["native"]));
}
} else {
def.$css = function(selector) {
var self = this;
return self.$raise($scope.NotImplementedError, "query by CSS selector unsupported");
}
};
if ((($a = ((($c = $scope.Browser['$supports?']("Query.xpath")) !== false && $c !== nil) ? $c : $scope.Browser['$loaded?']("wicked-good-xpath"))) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = $scope.Browser['$loaded?']("wicked-good-xpath")) !== nil && (!$a._isBoolean || $a == true))) {
wgxpath.install();};
def.$xpath = function(path) {
var self = this;
try {
var result = (self["native"].ownerDocument || self["native"]).evaluate(path,
self["native"], null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
return $scope.NodeSet.$new(self.$document(), ($scope.Native)._scope.Array.$new(result, $hash2(["get", "length"], {"get": "snapshotItem", "length": "snapshotLength"})));
}
catch (e) {
return $scope.NodeSet.$new(self.$document());
}
;
};
} else {
def.$xpath = function(path) {
var self = this;
return self.$raise($scope.NotImplementedError, "query by XPath unsupported");
}
};
def.$style = TMP_9 = function(data) {
var $a, $b, self = this, $iter = TMP_9._p, block = $iter || nil, style = nil;
if (data == null) {
data = nil
}
TMP_9._p = null;
style = ($scope.CSS)._scope.Declaration.$new(self["native"].style);
if ((($a = ((($b = data) !== false && $b !== nil) ? $b : block)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return style
};
if ((($a = data['$is_a?']($scope.String)) !== nil && (!$a._isBoolean || $a == true))) {
style.$replace(data)
} else if ((($a = data['$is_a?']($scope.Enumerable)) !== nil && (!$a._isBoolean || $a == true))) {
style.$assign(data)
} else if (block !== false && block !== nil) {
($a = ($b = style).$apply, $a._p = block.$to_proc(), $a).call($b)};
return self;
};
if ((($a = $scope.Browser['$supports?']("CSS.computed")) !== nil && (!$a._isBoolean || $a == true))) {
def['$style!'] = function() {
var self = this;
return ($scope.CSS)._scope.Declaration.$new(self.$window().$to_n().getComputedStyle(self["native"], null));
}
} else if ((($a = $scope.Browser['$supports?']("CSS.current")) !== nil && (!$a._isBoolean || $a == true))) {
def['$style!'] = function() {
var self = this;
return ($scope.CSS)._scope.Declaration.$new(self["native"].currentStyle);
}
} else {
def['$style!'] = function() {
var self = this;
return self.$raise($scope.NotImplementedError, "computed style unsupported");
}
};
def.$data = function(what) {
var $a, $b, TMP_10, self = this;
if ((($a = $scope.Hash['$==='](what)) !== nil && (!$a._isBoolean || $a == true))) {
if ((($a = (typeof(self["native"].$data) !== "undefined")) !== nil && (!$a._isBoolean || $a == true))) {
} else {
self["native"].$data = {};
};
return ($a = ($b = what).$each, $a._p = (TMP_10 = function(name, value){var self = TMP_10._s || this;
if (self["native"] == null) self["native"] = nil;
if (name == null) name = nil;if (value == null) value = nil;
return self["native"].$data[name] = value;}, TMP_10._s = self, TMP_10), $a).call($b);
} else {
if ((($a = self['$[]']("data-" + (what))) !== nil && (!$a._isBoolean || $a == true))) {
return self['$[]']("data-" + (what))};
if ((($a = (typeof(self["native"].$data) !== "undefined")) !== nil && (!$a._isBoolean || $a == true))) {
} else {
return nil
};
var value = self["native"].$data[what];
if (value === undefined) {
return nil;
}
else {
return value;
}
;
};
};
if ((($a = $scope.Browser['$supports?']("Element.matches")) !== nil && (!$a._isBoolean || $a == true))) {
def['$matches?'] = function(selector) {
var self = this;
return self["native"].matches(selector);
}
} else if ((($a = $scope.Browser['$supports?']("Element.matches (Opera)")) !== nil && (!$a._isBoolean || $a == true))) {
def['$matches?'] = function(selector) {
var self = this;
return self["native"].oMatchesSelector(selector);
}
} else if ((($a = $scope.Browser['$supports?']("Element.matches (Internet Explorer)")) !== nil && (!$a._isBoolean || $a == true))) {
def['$matches?'] = function(selector) {
var self = this;
return self["native"].msMatchesSelector(selector);
}
} else if ((($a = $scope.Browser['$supports?']("Element.matches (Firefox)")) !== nil && (!$a._isBoolean || $a == true))) {
def['$matches?'] = function(selector) {
var self = this;
return self["native"].mozMatchesSelector(selector);
}
} else if ((($a = $scope.Browser['$supports?']("Element.matches (Chrome)")) !== nil && (!$a._isBoolean || $a == true))) {
def['$matches?'] = function(selector) {
var self = this;
return self["native"].webkitMatchesSelector(selector);
}
} else if ((($a = $scope.Browser['$loaded?']("Sizzle")) !== nil && (!$a._isBoolean || $a == true))) {
def['$matches?'] = function(selector) {
var self = this;
return Sizzle.matchesSelector(self["native"], selector);
}
} else {
def['$matches?'] = function(selector) {
var self = this;
return self.$raise($scope.NotImplementedError, "selector matching unsupported");
}
};
def.$window = function() {
var self = this;
return self.$document().$window();
};
def.$inspect = function() {
var self = this;
return "#<DOM::Element: " + (self.$name()) + ">";
};
return (function($base, $super) {
function $Attributes(){};
var self = $Attributes = $klass($base, $super, 'Attributes', $Attributes);
var def = self._proto, $scope = self._scope, TMP_11;
def.element = def.namespace = nil;
self.$include($scope.Enumerable);
self.$attr_reader("namespace");
def.$initialize = function(element, options) {
var self = this;
self.element = element;
return self.namespace = options['$[]']("namespace");
};
def.$each = TMP_11 = function() {
var $a, $b, TMP_12, self = this, $iter = TMP_11._p, block = $iter || nil;
TMP_11._p = null;
if ((block !== nil)) {
} else {
return self.$enum_for("each")
};
($a = ($b = self.element.$attribute_nodes()).$each, $a._p = (TMP_12 = function(attr){var self = TMP_12._s || this, $a;
if (attr == null) attr = nil;
return $a = $opal.$yieldX(block, [attr.$name(), attr.$value()]), $a === $breaker ? $a : $a}, TMP_12._s = self, TMP_12), $a).call($b);
return self;
};
def['$[]'] = function(name) {
var self = this;
return self.element.$get_attribute(name, $hash2(["namespace"], {"namespace": self.namespace}));
};
def['$[]='] = function(name, value) {
var self = this;
return self.element.$set_attribute(name, value, $hash2(["namespace"], {"namespace": self.namespace}));
};
return (def['$merge!'] = function(hash) {
var $a, $b, TMP_13, self = this;
($a = ($b = hash).$each, $a._p = (TMP_13 = function(name, value){var self = TMP_13._s || this;
if (name == null) name = nil;if (value == null) value = nil;
return self['$[]='](name, value)}, TMP_13._s = self, TMP_13), $a).call($b);
return self;
}, nil) && 'merge!';
})(self, null);
})(self, $scope.Node)
})(self)
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$include', '$to_s', '$alias_native', '$new']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Location(){};
var self = $Location = $klass($base, $super, 'Location', $Location);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def.$assign = function(url) {
var self = this;
return self["native"].assign(url.$to_s());
};
def.$replace = function(url) {
var self = this;
return self["native"].replace(url.$to_s());
};
def.$reload = function(force) {
var self = this;
if (force == null) {
force = false
}
return self["native"].reload(force);
};
def.$to_s = function() {
var self = this;
return self["native"].toString();
};
self.$alias_native("fragment", "hash");
self.$alias_native("fragment=", "hash=");
self.$alias_native("host");
self.$alias_native("host=");
self.$alias_native("uri", "href");
self.$alias_native("uri=", "href=");
self.$alias_native("path", "pathname");
self.$alias_native("path=", "pathname=");
self.$alias_native("port");
self.$alias_native("port=");
self.$alias_native("scheme", "protocol");
self.$alias_native("scheme=", "protocol=");
self.$alias_native("query", "search");
return self.$alias_native("query=", "search=");
})(self, null);
(function($base, $super) {
function $Window(){};
var self = $Window = $klass($base, $super, 'Window', $Window);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
return (def.$location = function() {
var $a, self = this;
if ((($a = self["native"].location) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Location.$new(self["native"].location)
} else {
return nil
};
}, nil) && 'location'
})(self, null);
(function($base, $super) {
function $Document(){};
var self = $Document = $klass($base, $super, 'Document', $Document);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
return (def.$location = function() {
var $a, self = this;
if ((($a = self["native"].location) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Location.$new(self["native"].location)
} else {
return nil
};
}, nil) && 'location'
})($scope.DOM, ($scope.DOM)._scope.Element);
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$[]', '$DOM', '$supports?', '$new', '$raise', '$first', '$css', '$xpath', '$inspect', '$children', '$convert']);
;
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Document(){};
var self = $Document = $klass($base, $super, 'Document', $Document);
var def = self._proto, $scope = self._scope, $a;
def["native"] = nil;
def.$create_element = function(name, options) {
var $a, self = this, ns = nil;
if (options == null) {
options = $hash2([], {})
}
if ((($a = ns = options['$[]']("namespace")) !== nil && (!$a._isBoolean || $a == true))) {
return self.$DOM(self["native"].createElementNS(ns, name))
} else {
return self.$DOM(self["native"].createElement(name))
};
};
if ((($a = $scope.Browser['$supports?']("Document.view")) !== nil && (!$a._isBoolean || $a == true))) {
def.$window = function() {
var self = this;
return $scope.Window.$new(self["native"].defaultView);
}
} else if ((($a = $scope.Browser['$supports?']("Document.window")) !== nil && (!$a._isBoolean || $a == true))) {
def.$window = function() {
var self = this;
return $scope.Window.$new(self["native"].parentWindow);
}
} else {
def.$window = function() {
var self = this;
return self.$raise($scope.NotImplementedError, "window from document unsupported");
}
};
def.$create_text = function(content) {
var self = this;
return self.$DOM(self["native"].createTextNode(content));
};
def['$[]'] = function(what) {
var $a, self = this;
var result = self["native"].getElementById(what);
if (result) {
return self.$DOM(result);
}
;
return ((($a = self.$css(what).$first()) !== false && $a !== nil) ? $a : self.$xpath(what).$first());
};
$opal.defn(self, '$at', def['$[]']);
def.$document = function() {
var self = this;
return self;
};
def.$inspect = function() {
var self = this;
return "#<DOM::Document: " + (self.$children().$inspect()) + ">";
};
def.$title = function() {
var self = this;
return self["native"].title;
};
def['$title='] = function(value) {
var self = this;
return self["native"].title = value;
};
def.$root = function() {
var self = this;
return self.$DOM(self["native"].documentElement);
};
def.$head = function() {
var self = this;
return self.$DOM(self["native"].getElementsByTagName("head")[0]);
};
def.$body = function() {
var self = this;
return self.$DOM(self["native"].body);
};
def.$style_sheets = function() {
var $a, $b, TMP_1, self = this;
return ($a = ($b = ($scope.Native)._scope.Array).$new, $a._p = (TMP_1 = function(e){var self = TMP_1._s || this;
if (e == null) e = nil;
return ($scope.CSS)._scope.StyleSheet.$new(e)}, TMP_1._s = self, TMP_1), $a).call($b, self["native"].styleSheets);
};
return (def['$root='] = function(element) {
var self = this;
return self["native"].documentElement = $scope.Native.$convert(element);
}, nil) && 'root=';
})(self, $scope.Element)
})(self)
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs([]);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $DocumentFragment(){};
var self = $DocumentFragment = $klass($base, $super, 'DocumentFragment', $DocumentFragment);
var def = self._proto, $scope = self._scope;
return nil;
})(self, $scope.Element)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2;
$opal.add_stubs(['$<<', '$[]=', '$to_h', '$[]', '$each', '$===', '$call', '$attr_reader', '$new', '$to_proc', '$map', '$build', '$for', '$create_text', '$document', '$create_element', '$merge!', '$attributes', '$add_class', '$on', '$inner_html=']);
(function($base) {
var self = $module($base, 'Utils');
var def = self._proto, $scope = self._scope;
$opal.defs(self, '$heredoc', function(string) {
var self = this;
return string;
})
})($scope.Paggio);
(function($base, $super) {
function $Element(){};
var self = $Element = $klass($base, $super, 'Element', $Element);
var def = self._proto, $scope = self._scope, TMP_1;
def.on = nil;
return (def.$on = TMP_1 = function(args) {
var $a, self = this, $iter = TMP_1._p, block = $iter || nil;
args = $slice.call(arguments, 0);
TMP_1._p = null;
return (((($a = self.on) !== false && $a !== nil) ? $a : self.on = []))['$<<']([args, block]);
}, nil) && 'on'
})(($scope.Paggio)._scope.HTML, $scope.BasicObject);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope, $a, $b, TMP_7, $c, TMP_8, $d, TMP_12;
(function($base, $super) {
function $Builder(){};
var self = $Builder = $klass($base, $super, 'Builder', $Builder);
var def = self._proto, $scope = self._scope, TMP_2, TMP_4;
def.builder = def.element = def.roots = nil;
$opal.defs(self, '$to_h', function() {
var $a, self = this;
if (self.builders == null) self.builders = nil;
return ((($a = self.builders) !== false && $a !== nil) ? $a : self.builders = $hash2([], {}));
});
$opal.defs(self, '$for', TMP_2 = function(klass) {
var self = this, $iter = TMP_2._p, block = $iter || nil;
TMP_2._p = null;
if (block !== false && block !== nil) {
return self.$to_h()['$[]='](klass, block)
} else {
return self.$to_h()['$[]'](klass)
};
});
$opal.defs(self, '$build', function(builder, item) {
var $a, $b, TMP_3, self = this;
return ($a = ($b = self.$to_h()).$each, $a._p = (TMP_3 = function(klass, block){var self = TMP_3._s || this, $a;
if (klass == null) klass = nil;if (block == null) block = nil;
if ((($a = klass['$==='](item)) !== nil && (!$a._isBoolean || $a == true))) {
return ($breaker.$v = block.$call(builder, item), $breaker)
} else {
return nil
}}, TMP_3._s = self, TMP_3), $a).call($b);
});
self.$attr_reader("document", "element");
def.$initialize = TMP_4 = function(document, element) {
var $a, $b, $c, TMP_5, $d, TMP_6, self = this, $iter = TMP_4._p, block = $iter || nil;
if (element == null) {
element = nil
}
TMP_4._p = null;
self.document = document;
self.element = element;
self.builder = ($a = ($b = ($scope.Paggio)._scope.HTML).$new, $a._p = block.$to_proc(), $a).call($b);
self.roots = ($a = ($c = self.builder.$each()).$map, $a._p = (TMP_5 = function(e){var self = TMP_5._s || this;
if (e == null) e = nil;
return $scope.Builder.$build(self, e)}, TMP_5._s = self, TMP_5), $a).call($c);
if ((($a = self.element) !== nil && (!$a._isBoolean || $a == true))) {
return ($a = ($d = self.roots).$each, $a._p = (TMP_6 = function(root){var self = TMP_6._s || this;
if (self.element == null) self.element = nil;
if (root == null) root = nil;
return self.element['$<<'](root)}, TMP_6._s = self, TMP_6), $a).call($d)
} else {
return nil
};
};
return (def.$to_a = function() {
var self = this;
return self.roots;
}, nil) && 'to_a';
})(self, null);
($a = ($b = $scope.Builder).$for, $a._p = (TMP_7 = function(b, item){var self = TMP_7._s || this;
if (b == null) b = nil;if (item == null) item = nil;
return b.$document().$create_text(item)}, TMP_7._s = self, TMP_7), $a).call($b, $scope.String);
($a = ($c = $scope.Builder).$for, $a._p = (TMP_8 = function(b, item){var self = TMP_8._s || this, $a, $b, TMP_9, $c, TMP_10, $d, TMP_11, dom = nil, on = nil, inner = nil;
if (b == null) b = nil;if (item == null) item = nil;
dom = b.$document().$create_element(item.name);
if ((($a = $scope.Hash['$==='](item.attributes)) !== nil && (!$a._isBoolean || $a == true))) {
dom.$attributes()['$merge!'](item.attributes)};
($a = ($b = (item.class_names)).$each, $a._p = (TMP_9 = function(value){var self = TMP_9._s || this;
if (value == null) value = nil;
return dom.$add_class(value)}, TMP_9._s = self, TMP_9), $a).call($b);
if ((($a = on = item.on || nil) !== nil && (!$a._isBoolean || $a == true))) {
($a = ($c = on).$each, $a._p = (TMP_10 = function(args, block){var self = TMP_10._s || this, $a, $b;
if (args == null) args = nil;if (block == null) block = nil;
return ($a = ($b = dom).$on, $a._p = block.$to_proc(), $a).apply($b, [].concat(args))}, TMP_10._s = self, TMP_10), $a).call($c)};
if ((($a = inner = item.inner_html || nil) !== nil && (!$a._isBoolean || $a == true))) {
dom['$inner_html='](inner)
} else {
($a = ($d = item).$each, $a._p = (TMP_11 = function(child){var self = TMP_11._s || this;
if (child == null) child = nil;
return dom['$<<']($scope.Builder.$build(b, child))}, TMP_11._s = self, TMP_11), $a).call($d)
};
return dom;}, TMP_8._s = self, TMP_8), $a).call($c, (($scope.Paggio)._scope.HTML)._scope.Element);
($a = ($d = $scope.Builder).$for, $a._p = (TMP_12 = function(b, item){var self = TMP_12._s || this;
if (b == null) b = nil;if (item == null) item = nil;
return item}, TMP_12._s = self, TMP_12), $a).call($d, ($scope.DOM)._scope.Node);
})(self)
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $gvars = $opal.gvars, $hash2 = $opal.hash2;
$opal.add_stubs(['$supports?', '$include', '$===', '$==', '$type', '$new', '$DOM', '$alias_native', '$call', '$map', '$convert', '$private', '$Native', '$[]', '$[]=', '$to_n']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'DOM');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $MutationObserver(){};
var self = $MutationObserver = $klass($base, $super, 'MutationObserver', $MutationObserver);
var def = self._proto, $scope = self._scope, TMP_1;
def["native"] = nil;
$opal.defs(self, '$supported?', function() {
var self = this;
return $scope.Browser['$supports?']("MutationObserver");
});
self.$include($scope.Native);
(function($base, $super) {
function $Record(){};
var self = $Record = $klass($base, $super, 'Record', $Record);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$include($scope.Native);
def.$type = function() {
var self = this, $case = nil;
return (function() {$case = self["native"].type;if ("attributes"['$===']($case)) {return "attribute"}else if ("childList"['$===']($case)) {return "tree"}else if ("characterData"['$===']($case)) {return "cdata"}else { return nil }})();
};
def['$attribute?'] = function() {
var self = this;
return self.$type()['$==']("attribute");
};
def['$tree?'] = function() {
var self = this;
return self.$type()['$==']("tree");
};
def['$cdata?'] = function() {
var self = this;
return self.$type()['$==']("cdata");
};
def.$added = function() {
var $a, self = this, array = nil;
if ($gvars.document == null) $gvars.document = nil;
array = (function() {if ((($a = self["native"].addedNodes != null) !== nil && (!$a._isBoolean || $a == true))) {
return ($scope.Native)._scope.Array.$new(self["native"].addedNodes)
} else {
return []
}; return nil; })();
return $scope.NodeSet.$new($gvars.document, array);
};
def.$removed = function() {
var $a, self = this, array = nil;
if ($gvars.document == null) $gvars.document = nil;
array = (function() {if ((($a = self["native"].removedNodes != null) !== nil && (!$a._isBoolean || $a == true))) {
return ($scope.Native)._scope.Array.$new(self["native"].removedNodes)
} else {
return []
}; return nil; })();
return $scope.NodeSet.$new($gvars.document, array);
};
def.$target = function() {
var self = this;
return self.$DOM(self["native"].target);
};
self.$alias_native("old", "oldValue");
self.$alias_native("name", "attributeName");
return self.$alias_native("namespace", "attributeNamespace");
})(self, null);
def.$initialize = TMP_1 = function() {
var $a, $b, TMP_2, self = this, $iter = TMP_1._p, block = $iter || nil;
TMP_1._p = null;
var func = function(records) {
return block.$call(($a = ($b = (records)).$map, $a._p = (TMP_2 = function(r){var self = TMP_2._s || this;
if (r == null) r = nil;
return ((($scope.Browser)._scope.DOM)._scope.MutationObserver)._scope.Record.$new(r)}, TMP_2._s = self, TMP_2), $a).call($b));
}
;
return $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [new window.MutationObserver(func)]);
};
def.$observe = function(target, options) {
var self = this;
if (options == null) {
options = nil
}
if (options !== false && options !== nil) {
} else {
options = $hash2(["children", "tree", "attributes", "cdata"], {"children": true, "tree": true, "attributes": "old", "cdata": "old"})
};
self["native"].observe($scope.Native.$convert(target), self.$convert(options));
return self;
};
def.$take = function() {
var $a, $b, TMP_3, self = this;
return ($a = ($b = (self["native"].takeRecords())).$map, $a._p = (TMP_3 = function(r){var self = TMP_3._s || this;
if (r == null) r = nil;
return $scope.Record.$new(r)}, TMP_3._s = self, TMP_3), $a).call($b);
};
def.$disconnect = function() {
var self = this;
return self["native"].disconnect();
};
self.$private();
return (def.$convert = function(hash) {
var $a, self = this, options = nil, attrs = nil, filter = nil, cdata = nil;
options = self.$Native({});
if ((($a = hash['$[]']("children")) !== nil && (!$a._isBoolean || $a == true))) {
options['$[]=']("childList", true)};
if ((($a = hash['$[]']("tree")) !== nil && (!$a._isBoolean || $a == true))) {
options['$[]=']("subtree", true)};
if ((($a = attrs = hash['$[]']("attributes")) !== nil && (!$a._isBoolean || $a == true))) {
options['$[]=']("attributes", true);
if (attrs['$==']("old")) {
options['$[]=']("attributeOldValue", true)};};
if ((($a = filter = hash['$[]']("filter")) !== nil && (!$a._isBoolean || $a == true))) {
options['$[]=']("attributeFilter", filter)};
if ((($a = cdata = hash['$[]']("cdata")) !== nil && (!$a._isBoolean || $a == true))) {
options['$[]=']("characterData", true);
if (cdata['$==']("old")) {
options['$[]=']("characterDataOldValue", true)};};
return options.$to_n();
}, nil) && 'convert';
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $gvars = $opal.gvars, $klass = $opal.klass;
if ($gvars.window == null) $gvars.window = nil;
$opal.add_stubs(['$DOM', '$shift', '$to_a', '$new', '$to_proc', '$==', '$length', '$first', '$native?', '$===', '$try_convert', '$raise', '$include', '$target', '$document']);
;
;
;
;
;
;
;
;
;
;
;
;
;
(function($base) {
var self = $module($base, 'Kernel');
var def = self._proto, $scope = self._scope, TMP_1;
def.$XML = function(what) {
var self = this;
var doc;
if (window.DOMParser) {
doc = new DOMParser().parseFromString(what, 'text/xml');
}
else {
doc = new ActiveXObject('Microsoft.XMLDOM');
doc.async = 'false';
doc.loadXML(what);
}
return self.$DOM(doc);
};
def.$DOM = TMP_1 = function(args) {
var $a, $b, self = this, $iter = TMP_1._p, block = $iter || nil, document = nil, element = nil, roots = nil, what = nil;
if ($gvars.document == null) $gvars.document = nil;
args = $slice.call(arguments, 0);
TMP_1._p = null;
if (block !== false && block !== nil) {
document = ((($a = args.$shift()) !== false && $a !== nil) ? $a : $gvars.document);
element = args.$shift();
roots = ($a = ($b = (($scope.Browser)._scope.DOM)._scope.Builder).$new, $a._p = block.$to_proc(), $a).call($b, document, element).$to_a();
if (roots.$length()['$=='](1)) {
return roots.$first()
} else {
return (($scope.Browser)._scope.DOM)._scope.NodeSet.$new(document, roots)
};
} else {
what = args.$shift();
document = ((($a = args.$shift()) !== false && $a !== nil) ? $a : $gvars.document);
if ((($a = self['$native?'](what)) !== nil && (!$a._isBoolean || $a == true))) {
return (($scope.Browser)._scope.DOM)._scope.Node.$new(what)
} else if ((($a = (($scope.Browser)._scope.DOM)._scope.Node['$==='](what)) !== nil && (!$a._isBoolean || $a == true))) {
return what
} else if ((($a = $scope.String['$==='](what)) !== nil && (!$a._isBoolean || $a == true))) {
var doc = $scope.Native.$try_convert(document).createElement('div');
doc.innerHTML = what;
return self.$DOM(doc.childNodes.length == 1 ? doc.childNodes[0] : doc);
;
} else {
return self.$raise($scope.ArgumentError, "argument not DOM convertible")
};
};
};
;$opal.donate(self, ["$XML", "$DOM"]);
})(self);
(function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Window(){};
var self = $Window = $klass($base, $super, 'Window', $Window);
var def = self._proto, $scope = self._scope, $a, $b, TMP_2;
def["native"] = nil;
self.$include((($scope.DOM)._scope.Event)._scope.Target);
($a = ($b = self).$target, $a._p = (TMP_2 = function(value){var self = TMP_2._s || this, $a;
if ($gvars.window == null) $gvars.window = nil;
if (value == null) value = nil;
if ((($a = value == window) !== nil && (!$a._isBoolean || $a == true))) {
return $gvars.window
} else {
return nil
}}, TMP_2._s = self, TMP_2), $a).call($b);
return (def.$document = function() {
var self = this;
return self.$DOM(self["native"].document);
}, nil) && 'document';
})(self, null)
})(self);
return $gvars.document = $gvars.window.$document();
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $range = $opal.range;
$opal.add_stubs(['$include', '$new', '$each', '$[]=', '$important', '$name', '$value', '$to_proc', '$to_s', '$enum_for', '$[]', '$alias_native', '$end_with?']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'CSS');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Declaration(){};
var self = $Declaration = $klass($base, $super, 'Declaration', $Declaration);
var def = self._proto, $scope = self._scope, TMP_2, TMP_4;
def["native"] = nil;
self.$include($scope.Native);
self.$include($scope.Enumerable);
def.$rule = function() {
var $a, self = this;
if ((($a = (typeof(self["native"].parentRule) !== "undefined")) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Rule.$new(self["native"].parentRule)
} else {
return nil
};
};
def.$assign = function(data) {
var $a, $b, TMP_1, self = this;
($a = ($b = data).$each, $a._p = (TMP_1 = function(name, value){var self = TMP_1._s || this;
if (name == null) name = nil;if (value == null) value = nil;
return self['$[]='](name, value)}, TMP_1._s = self, TMP_1), $a).call($b);
return self;
};
def.$replace = function(string) {
var self = this;
return self["native"].cssText = string;
};
def.$apply = TMP_2 = function() {
var $a, $b, TMP_3, $c, $d, self = this, $iter = TMP_2._p, block = $iter || nil;
TMP_2._p = null;
return ($a = ($b = ($c = ($d = (($scope.Paggio)._scope.CSS)._scope.Definition).$new, $c._p = block.$to_proc(), $c).call($d)).$each, $a._p = (TMP_3 = function(style){var self = TMP_3._s || this, $a;
if (self["native"] == null) self["native"] = nil;
if (style == null) style = nil;
if ((($a = style.$important()) !== nil && (!$a._isBoolean || $a == true))) {
return self["native"].setProperty(style.$name(), style.$value(), "important");
} else {
return self["native"].setProperty(style.$name(), style.$value(), "");
}}, TMP_3._s = self, TMP_3), $a).call($b);
};
def.$delete = function(name) {
var self = this;
return self["native"].removeProperty(name);
};
def['$[]'] = function(name) {
var self = this;
var result = self["native"].getPropertyValue(name);
if (result == null || result === "") {
return nil;
}
return result;
;
};
def['$[]='] = function(name, value) {
var self = this;
return self["native"].setProperty(name, value.$to_s(), "");
};
def['$important?'] = function(name) {
var self = this;
return self["native"].getPropertyPriority(name) == "important";
};
def.$each = TMP_4 = function() {
var $a, self = this, $iter = TMP_4._p, block = $iter || nil;
TMP_4._p = null;
if ((block !== nil)) {
} else {
return self.$enum_for("each")
};
for (var i = 0, length = self["native"].length; i < length; i++) {
var name = self["native"].item(i);
((($a = $opal.$yieldX(block, [name, self['$[]'](name)])) === $breaker) ? $breaker.$v : $a)
}
;
return self;
};
self.$alias_native("length");
self.$alias_native("to_s", "cssText");
return (def.$method_missing = function(name, value) {
var $a, self = this;
if (value == null) {
value = nil
}
if ((($a = name['$end_with?']("=")) !== nil && (!$a._isBoolean || $a == true))) {
return self['$[]='](name['$[]']($range(0, -2, false)), value)
} else {
return self['$[]'](name)
};
}, nil) && 'method_missing';
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$include', '$is_a?', '$to_n', '$alias_native', '$new', '$DOM', '$===', '$join', '$map', '$insert', '$length', '$find', '$log', '$==', '$id', '$rules', '$__send__', '$to_proc']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'CSS');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $StyleSheet(){};
var self = $StyleSheet = $klass($base, $super, 'StyleSheet', $StyleSheet);
var def = self._proto, $scope = self._scope, TMP_1, TMP_5;
def["native"] = nil;
self.$include($scope.Native);
def.$initialize = TMP_1 = function(what) {
var $a, self = this, $iter = TMP_1._p, $yield = $iter || nil;
TMP_1._p = null;
if ((($a = what['$is_a?'](($scope.DOM)._scope.Element)) !== nil && (!$a._isBoolean || $a == true))) {
return $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [what.$to_n().sheet])
} else {
return $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [what])
};
};
self.$alias_native("disabled?", "disabled");
self.$alias_native("href");
self.$alias_native("title");
self.$alias_native("type");
def.$media = function() {
var $a, self = this;
if ((($a = self["native"].media != null) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Media.$new(self["native"].media)
} else {
return nil
};
};
def.$owner = function() {
var self = this;
return self.$DOM(self["native"].ownerNode);
};
def.$parent = function() {
var $a, self = this;
if ((($a = self["native"].parentStyleSheet != null) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Sheet.$new(self["native"].parentStyleSheet)
} else {
return nil
};
};
def.$rules = function() {
var $a, $b, TMP_2, self = this;
return ($a = ($b = ($scope.Native)._scope.Array).$new, $a._p = (TMP_2 = function(e){var self = TMP_2._s || this;
if (e == null) e = nil;
return $scope.Rule.$new(e)}, TMP_2._s = self, TMP_2), $a).call($b, self["native"].cssRules);
};
def.$delete = function(index) {
var self = this;
return self["native"].deleteRule(index);
};
def.$insert = function(index, rule) {
var self = this;
return self["native"].insertRule(rule, index);
};
def.$rule = function(selector, body) {
var $a, $b, TMP_3, self = this;
if ((($a = $scope.String['$==='](selector)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
selector = selector.$join(", ")
};
if ((($a = $scope.String['$==='](body)) !== nil && (!$a._isBoolean || $a == true))) {
} else {
body = ($a = ($b = body).$map, $a._p = (TMP_3 = function(name, value){var self = TMP_3._s || this;
if (name == null) name = nil;if (value == null) value = nil;
return "" + (name) + ": " + (value) + ";"}, TMP_3._s = self, TMP_3), $a).call($b).$join("\n")
};
return self.$insert(self.$length(), "" + (selector) + " { " + (body) + " }");
};
def['$[]'] = function(id) {
var $a, $b, TMP_4, self = this;
return ($a = ($b = self.$rules()).$find, $a._p = (TMP_4 = function(r){var self = TMP_4._s || this;
if (r == null) r = nil;
self.$log(r);
return r.$id()['$=='](id);}, TMP_4._s = self, TMP_4), $a).call($b);
};
def.$method_missing = TMP_5 = function(args) {
var $a, $b, self = this, $iter = TMP_5._p, block = $iter || nil;
args = $slice.call(arguments, 0);
TMP_5._p = null;
return ($a = ($b = self.$rules()).$__send__, $a._p = block.$to_proc(), $a).apply($b, [].concat(args));
};
return (function($base, $super) {
function $Media(){};
var self = $Media = $klass($base, $super, 'Media', $Media);
var def = self._proto, $scope = self._scope;
def["native"] = nil;
self.$alias_native("text", "mediaText");
self.$alias_native("to_s", "mediaText");
def.$push = function(medium) {
var self = this;
self["native"].appendMedium(medium);
return self;
};
return (def.$delete = function(medium) {
var self = this;
return self["native"].deleteMedium(medium);
}, nil) && 'delete';
})(self, ($scope.Native)._scope.Array);
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$include', '$==', '$[]', '$new', '$raise', '$alias_native']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'CSS');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Rule(){};
var self = $Rule = $klass($base, $super, 'Rule', $Rule);
var def = self._proto, $scope = self._scope, TMP_1;
def["native"] = nil;
self.$include($scope.Native);
$opal.cdecl($scope, 'STYLE_RULE', 1);
$opal.cdecl($scope, 'CHARSET_RULE', 2);
$opal.cdecl($scope, 'IMPORT_RULE', 3);
$opal.cdecl($scope, 'MEDIA_RULE', 4);
$opal.cdecl($scope, 'FONT_FACE_RULE', 5);
$opal.cdecl($scope, 'PAGE_RULE', 6);
$opal.cdecl($scope, 'KEYFRAMES_RULE', 7);
$opal.cdecl($scope, 'KEYFRAME_RULE', 8);
$opal.cdecl($scope, 'NAMESPACE_RULE', 10);
$opal.cdecl($scope, 'COUNTER_STYLE_RULE', 11);
$opal.cdecl($scope, 'SUPPORTS_RULE', 12);
$opal.cdecl($scope, 'DOCUMENT_RULE', 13);
$opal.cdecl($scope, 'FONT_FEATURE_VALUES_RULE', 14);
$opal.cdecl($scope, 'VIEWPORT_RULE', 15);
$opal.cdecl($scope, 'REGION_STYLE_RULE', 16);
$opal.defs(self, '$new', TMP_1 = function(rule) {
var $a, self = this, $iter = TMP_1._p, $yield = $iter || nil, klass = nil;
if (self.classes == null) self.classes = nil;
TMP_1._p = null;
if (self['$==']($scope.Rule)) {
((($a = self.classes) !== false && $a !== nil) ? $a : self.classes = [nil, $scope.Style]);
if ((($a = klass = self.classes['$[]'](rule.type)) !== nil && (!$a._isBoolean || $a == true))) {
return klass.$new(rule)
} else {
return self.$raise($scope.ArgumentError, "cannot instantiate a non derived Rule object")
};
} else {
return $opal.find_super_dispatcher(self, 'new', TMP_1, null, $Rule).apply(self, [rule])
};
});
self.$alias_native("text", "cssText");
self.$alias_native("to_s", "cssText");
def.$parent = function() {
var $a, self = this;
if ((($a = self["native"].parentRule != null) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.Rule.$new(self["native"].parentRule)
} else {
return nil
};
};
return (def.$style_sheet = function() {
var $a, self = this;
if ((($a = self["native"].parentStyleSheet != null) !== nil && (!$a._isBoolean || $a == true))) {
return $scope.StyleSheet.$new(self["native"].parentStyleSheet)
} else {
return nil
};
}, nil) && 'style_sheet';
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$alias_native', '$new', '$__send__', '$to_proc', '$declaration']);
return (function($base) {
var self = $module($base, 'Browser');
var def = self._proto, $scope = self._scope;
(function($base) {
var self = $module($base, 'CSS');
var def = self._proto, $scope = self._scope;
(function($base, $super) {
function $Rule(){};
var self = $Rule = $klass($base, $super, 'Rule', $Rule);
var def = self._proto, $scope = self._scope;
return (function($base, $super) {
function $Style(){};
var self = $Style = $klass($base, $super, 'Style', $Style);
var def = self._proto, $scope = self._scope, TMP_1;
def["native"] = nil;
self.$alias_native("selector", "selectorText");
self.$alias_native("id", "selectorText");
def.$declaration = function() {
var self = this;
return $scope.Declaration.$new(self["native"].style);
};
return (def.$method_missing = TMP_1 = function(args) {
var $a, $b, self = this, $iter = TMP_1._p, block = $iter || nil;
args = $slice.call(arguments, 0);
TMP_1._p = null;
return ($a = ($b = self.$declaration()).$__send__, $a._p = block.$to_proc(), $a).apply($b, [].concat(args));
}, nil) && 'method_missing';
})(self, $scope.Rule)
})(self, null)
})(self)
})(self)
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $gvars = $opal.gvars;
$opal.add_stubs(['$create_element', '$[]=', '$inner_text=', '$css', '$to_proc']);
;
;
;
;
return (function($base) {
var self = $module($base, 'Kernel');
var def = self._proto, $scope = self._scope, TMP_1;
def.$CSS = TMP_1 = function(text) {
var $a, $b, self = this, $iter = TMP_1._p, block = $iter || nil, style = nil;
if ($gvars.document == null) $gvars.document = nil;
if (text == null) {
text = nil
}
TMP_1._p = null;
style = $gvars.document.$create_element("style");
style['$[]=']("type", "text/css");
if (block !== false && block !== nil) {
style['$inner_text='](($a = ($b = $scope.Paggio).$css, $a._p = block.$to_proc(), $a).call($b))
} else {
style['$inner_text='](text)
};
return style;
}
;$opal.donate(self, ["$CSS"]);
})(self);
})(Opal);
/* Generated by Opal 0.6.2 */
(function($opal) {
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice;
$opal.add_stubs([]);
;
;
;
;
;
;
;
return true;
})(Opal);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment