Skip to content

Commit

Permalink
Revert "Merge pull request canjs#964 from bitovi/domless-compilation"
Browse files Browse the repository at this point in the history
This reverts commit d4e0931, reversing
changes made to 2a82b64.
  • Loading branch information
Curtis Cummings committed May 5, 2014
1 parent d4e0931 commit b8ee2ed
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 164 deletions.
5 changes: 0 additions & 5 deletions builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,6 @@
"type": "core",
"isDefault": true,
"hidden": true
},
"can/util/domless": {
"name": "can.util.domless",
"type": "plugin",
"hidden": true
}
},
"types": {
Expand Down
2 changes: 1 addition & 1 deletion util/array/makeArray.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
steal('./each.js', function (can) {
steal('./each.js', function () {
can.makeArray = function (arr) {
var ret = [];
can.each(arr, function (a, i) {
Expand Down
24 changes: 10 additions & 14 deletions util/attr/attr.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ steal("can/util/can.js", function (can) {

// Acts as a polyfill for setImmediate which only works in IE 10+. Needed to make
// the triggering of `attributes` event async.
var setImmediate = (typeof window !== "undefined" && window.setImmediate) || function (cb) {
var setImmediate = window.setImmediate || function (cb) {
return setTimeout(cb, 0);
},
attr = {
// This property lets us know if the browser supports mutation observers.
// If they are supported then that will be setup in can/util/jquery and those native events will be used to inform observers of attribute changes.
// Otherwise this module handles triggering an `attributes` event on the element.
MutationObserver: typeof window !== "undefined" && (window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver),
MutationObserver: window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver,

/**
* @property {Object.<String,(String|Boolean|function)>} can.view.attr.map
Expand Down Expand Up @@ -161,19 +161,15 @@ steal("can/util/can.js", function (can) {
// Checks if an element contains an attribute.
// For browsers that support `hasAttribute`, creates a function that calls hasAttribute, otherwise creates a function that uses `getAttribute` to check that the attribute is not null.
has: (function () {
if(typeof document !== "undefined") {
var el = document.createElement('div');
if (el.hasAttribute) {
return function (el, name) {
return el.hasAttribute(name);
};
} else {
return function (el, name) {
return el.getAttribute(name) !== null;
};
}
var el = document.createElement('div');
if (el.hasAttribute) {
return function (el, name) {
return el.hasAttribute(name);
};
} else {
return function() {};
return function (el, name) {
return el.getAttribute(name) !== null;
};
}
})()
};
Expand Down
11 changes: 3 additions & 8 deletions util/can.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
steal(function () {
/* global GLOBALCAN */
var can;
if (typeof window !== 'undefined') {
can = window.can || {};
if(typeof GLOBALCAN === 'undefined' || GLOBALCAN !== false) {
window.can = can;
}
} else {
can = {};
var can = window.can || {};
if (typeof GLOBALCAN === 'undefined' || GLOBALCAN !== false) {
window.can = can;
}

// An empty function useful for where you need a dummy callback.
Expand Down
126 changes: 0 additions & 126 deletions util/domless/domless.js

This file was deleted.

2 changes: 1 addition & 1 deletion view/callbacks/callbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ steal("can/util", "can/view",function(can){
var tag = can.view.tag = function (tagName, tagHandler) {
if(tagHandler) {
// if we have html5shive ... re-generate
if (typeof window !== "undefined" && window.html5) {
if (window.html5) {
window.html5.elements += " " + tagName;
window.html5.shivDocument();
}
Expand Down
2 changes: 1 addition & 1 deletion view/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ steal('can/util', "can/view",function (can) {
*/
var elements = {
tagToContentPropMap: {
option: ( typeof document !=="undefined" && "textContent" in document.createElement("option") ) ? "textContent" : "innerText",
option: 'textContent' in document.createElement('option') ? 'textContent' : 'innerText',
textarea: 'value'
},
/**
Expand Down
5 changes: 1 addition & 4 deletions view/mustache/mustache.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@ steal('can/util',
* @add can.Mustache
*/
// Put Mustache on the `can` object.
can.Mustache = Mustache;
if(typeof window !== "undefined") {
window.Mustache = Mustache;
}
can.Mustache = window.Mustache = Mustache;

/**
* @prototype
Expand Down
2 changes: 1 addition & 1 deletion view/parser/parser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* jshint maxdepth:7*/
steal("can/view", function(can){
steal("can/view", function(){


function makeMap(str){
Expand Down
6 changes: 3 additions & 3 deletions view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ steal('can/util', function (can) {
// You should only be using `//` if you are using an AMD loader like `steal` or `require` (not almond).
if (url.match(/^\/\//)) {
url = url.substr(2);
url = ( typeof window === "undefined" || ! window.steal ) ?
url = !window.steal ?
url :
steal.config()
.root.mapJoin("" + steal.id(url));
Expand Down Expand Up @@ -382,7 +382,7 @@ steal('can/util', function (can) {
// _removed if not used as a steal module_

//!steal-remove-start
if ( typeof window !== "undefined" && window.steal ) {
if (window.steal) {
steal.type(info.suffix + " view js", function (options, success, error) {
var type = $view.types["." + options.type],
id = $view.toId(options.id + '');
Expand Down Expand Up @@ -711,7 +711,7 @@ steal('can/util', function (can) {
// _removed if not used as a steal module_

//!steal-remove-start
if ( typeof window !== "undefined" && window.steal ) {
if (window.steal) {
//when being used as a steal module, add a new type for 'view' that runs
// `can.view.preloadStringRenderer` with the loaded string/text for the dependency.
steal.type("view js", function (options, success, error) {
Expand Down

0 comments on commit b8ee2ed

Please sign in to comment.