Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Sep 21, 2013
1 parent bc72b10 commit bda2e13
Show file tree
Hide file tree
Showing 8 changed files with 506 additions and 543 deletions.
561 changes: 280 additions & 281 deletions build/kissy-min.js

Large diffs are not rendered by default.

131 changes: 66 additions & 65 deletions build/kissy-nodejs-min.js

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions build/kissy-nodejs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Copyright 2013, KISSY UI Library v1.32
MIT Licensed
build time: Sep 21 17:58
build time: Sep 21 22:06
*/
/**
* @ignore
Expand Down Expand Up @@ -39,11 +39,11 @@ var KISSY = (function (undefined) {

/**
* The build time of the library.
* NOTICE: '20130921175821' will replace with current timestamp when compressing.
* NOTICE: '20130921220640' will replace with current timestamp when compressing.
* @private
* @type {String}
*/
__BUILD_TIME: '20130921175821',
__BUILD_TIME: '20130921220640',
/**
* KISSY Environment.
* @private
Expand Down Expand Up @@ -4333,8 +4333,8 @@ var KISSY = (function (undefined) {
var CSS_POLL_INTERVAL = 30,
UA = S.UA,
logger = {
debug: function (str) {
S.log(str, 'info', 's/loader/getScript')
debug:function(str){
S.log(str,undefined,'s/loader/getScript');
}
},
Utils = S.Loader.Utils,
Expand All @@ -4346,6 +4346,7 @@ var KISSY = (function (undefined) {

function startCssTimer() {
if (!timer) {
logger.debug('start css poll timer');
cssPoll();
}
}
Expand All @@ -4355,24 +4356,24 @@ var KISSY = (function (undefined) {
if (UA.webkit) {
// http://www.w3.org/TR/Dom-Level-2-Style/stylesheets.html
if (node['sheet']) {
logger.debug('webkit loaded: ' + url);
logger.debug('webkit css poll loaded: ' + url);
loaded = 1;
}
} else if (node['sheet']) {
try {
var cssRules = node['sheet'].cssRules;
if (cssRules) {
logger.debug('same domain loaded: ' + url);
logger.debug('same domain css poll loaded: ' + url);
loaded = 1;
}
} catch (ex) {
var exName = ex.name;
logger.debug('css exception: ' + exName + ' ' + ex.code + ' ' + url);
logger.debug('css poll exception: ' + exName + ' ' + ex.code + ' ' + url);
// http://www.w3.org/TR/dom/#dom-domexception-code
if (// exName == 'SecurityError' ||
// for old firefox
exName == 'NS_ERROR_DOM_SECURITY_ERR') {
logger.debug('css exception: ' + exName + 'loaded : ' + url);
logger.debug('css poll exception: ' + exName + 'loaded : ' + url);
loaded = 1;
}
}
Expand All @@ -4391,13 +4392,12 @@ var KISSY = (function (undefined) {
}
delete monitors[url];
}

}

if (S.isEmptyObject(monitors)) {
logger.debug('clear css poll timer');
timer = 0;
} else {
//noinspection JSUnresolvedFunction
timer = setTimeout(cssPoll, CSS_POLL_INTERVAL);
}
}
Expand Down Expand Up @@ -5551,7 +5551,7 @@ var KISSY = (function (undefined) {
// file limit number for a single combo url
comboMaxFileNum: 40,
charset: 'utf-8',
tag: '20130921175821'
tag: '20130921220640'
}, getBaseInfo()));
}

Expand Down
56 changes: 22 additions & 34 deletions build/kissy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Copyright 2013, KISSY UI Library v1.32
MIT Licensed
build time: Sep 21 17:58
build time: Sep 21 22:06
*/
/**
* @ignore
Expand Down Expand Up @@ -39,11 +39,11 @@ var KISSY = (function (undefined) {

/**
* The build time of the library.
* NOTICE: '20130921175821' will replace with current timestamp when compressing.
* NOTICE: '20130921220640' will replace with current timestamp when compressing.
* @private
* @type {String}
*/
__BUILD_TIME: '20130921175821',
__BUILD_TIME: '20130921220640',
/**
* KISSY Environment.
* @private
Expand Down Expand Up @@ -4333,8 +4333,8 @@ var KISSY = (function (undefined) {
var CSS_POLL_INTERVAL = 30,
UA = S.UA,
logger = {
debug: function (str) {
S.log(str, 'info', 's/loader/getScript')
debug:function(str){
S.log(str,undefined,'s/loader/getScript');
}
},
Utils = S.Loader.Utils,
Expand All @@ -4346,6 +4346,7 @@ var KISSY = (function (undefined) {

function startCssTimer() {
if (!timer) {
logger.debug('start css poll timer');
cssPoll();
}
}
Expand All @@ -4355,24 +4356,24 @@ var KISSY = (function (undefined) {
if (UA.webkit) {
// http://www.w3.org/TR/Dom-Level-2-Style/stylesheets.html
if (node['sheet']) {
logger.debug('webkit loaded: ' + url);
logger.debug('webkit css poll loaded: ' + url);
loaded = 1;
}
} else if (node['sheet']) {
try {
var cssRules = node['sheet'].cssRules;
if (cssRules) {
logger.debug('same domain loaded: ' + url);
logger.debug('same domain css poll loaded: ' + url);
loaded = 1;
}
} catch (ex) {
var exName = ex.name;
logger.debug('css exception: ' + exName + ' ' + ex.code + ' ' + url);
logger.debug('css poll exception: ' + exName + ' ' + ex.code + ' ' + url);
// http://www.w3.org/TR/dom/#dom-domexception-code
if (// exName == 'SecurityError' ||
// for old firefox
exName == 'NS_ERROR_DOM_SECURITY_ERR') {
logger.debug('css exception: ' + exName + 'loaded : ' + url);
logger.debug('css poll exception: ' + exName + 'loaded : ' + url);
loaded = 1;
}
}
Expand All @@ -4391,13 +4392,12 @@ var KISSY = (function (undefined) {
}
delete monitors[url];
}

}

if (S.isEmptyObject(monitors)) {
logger.debug('clear css poll timer');
timer = 0;
} else {
//noinspection JSUnresolvedFunction
timer = setTimeout(cssPoll, CSS_POLL_INTERVAL);
}
}
Expand Down Expand Up @@ -4441,22 +4441,11 @@ var KISSY = (function (undefined) {
(function (S) {
var MILLISECONDS_OF_SECOND = 1000,
doc = S.Env.host.document,
logger = {
debug: function (str) {
S.log(str, 'info', 's/loader/getScript')
}
},
Utils = S.Loader.Utils,
Path = S.Path,
jsCssCallbacks = {},
headNode,
UA = S.UA,
// onload for webkit 535.23 Firefox 9.0
// https://bugs.webkit.org/show_activity.cgi?id=38995
// https://bugzilla.mozilla.org/show_bug.cgi?id=185236
// https://developer.mozilla.org/en/HTML/Element/link#Stylesheet_load_events
// phantomjs 1.7 == webkit 534.34
isOldWebkit = UA.webkit && UA.webkit < 536;
UA = S.UA;

/**
* Load a javascript/css file from the server using a GET HTTP request,
Expand All @@ -4483,7 +4472,7 @@ var KISSY = (function (undefined) {
* @param {Number} [success.timeout] timeout (s)
* @param {String} [success.charset] charset of current resource
* @param {String} [charset] charset of current resource
* @return {Element} script/style node
* @return {HTMLElement} script/style node
* @member KISSY
*/
S.getScript = function (url, success, charset) {
Expand Down Expand Up @@ -4558,8 +4547,14 @@ var KISSY = (function (undefined) {
};

var useNative = 'onload' in node;

if (css && isOldWebkit && useNative) {
// onload for webkit 535.23 Firefox 9.0
// https://bugs.webkit.org/show_activity.cgi?id=38995
// https://bugzilla.mozilla.org/show_bug.cgi?id=185236
// https://developer.mozilla.org/en/HTML/Element/link#Stylesheet_load_events
// phantomjs 1.7 == webkit 534.34
var forceCssPoll = S.Config['forceCssPoll'] || (UA.webkit && UA.webkit < 536);

if (css && forceCssPoll && useNative) {
useNative = false;
}

Expand Down Expand Up @@ -4606,13 +4601,6 @@ var KISSY = (function (undefined) {
// can use js in head
headNode.insertBefore(node, headNode.firstChild);
}
// first check to avoid cache?
// https://github.com/kissyteam/kissy/issues/481
if (css && Utils.isCssLoaded(node, url)) {
logger.debug('load css after insert immediately from cache: ' + url);
end(0);
return node;
}
return node;
};
})(KISSY);
Expand Down Expand Up @@ -5695,7 +5683,7 @@ var KISSY = (function (undefined) {
// file limit number for a single combo url
comboMaxFileNum: 40,
charset: 'utf-8',
tag: '20130921175821'
tag: '20130921220640'
}, getBaseInfo()));
}

Expand Down

0 comments on commit bda2e13

Please sign in to comment.