123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
-
- Namespace.register("U.UF.DL");
- U.UF.DL.asynLoadJs = function (obj, fun) {
- var _head = U.selectEl("head");
-
- var _script = $$("script", obj);
-
- U.UF.DL.fileElementLoaded(_script, fun);
-
- _head.append(_script, 0, _head[0].firstChild);
- return _script;
- }
- U.UF.DL.asynLoadCss = function (obj, fun) {
- var _head = U.selectEl("head");
-
- var _link = $$("link", obj);
-
- U.UF.DL.fileElementLoaded(_link, fun);
-
- _head.append(_link, 0, _head[0].firstChild);
- return _link;
- }
- U.UF.DL.iframeLoad = function (obj, fun) {
- U.UF.DL.fileElementLoaded(obj, fun);
- }
- U.UF.DL.fileElementLoaded = function (obj, fun) {
-
- if (obj.onreadystatechange !== undefined) {
-
- obj.onreadystatechange = function () {
-
- if (obj.readyState == "complete") {
-
- obj.onreadystatechange = null;
-
- if (U.UF.C.isFunction(fun)) {
-
- fun.call(obj)
- }
- }
- }
- }
-
- else {
-
- obj.onload = function () {
-
- obj.onload = null;
-
- if (U.UF.C.isFunction(fun)) {
-
- fun.call(obj)
- }
- }
- }
- }
- U.UF.DL.loadStyle = function (csstext) {
-
- var _head = U.selectEl("head")[0];
- var _style = $$("style", {});
-
- if (_style.styleSheet) {
- _style.styleSheet.cssText = csstext;
- }
- else {
-
- _style.appendChild(document.createTextNode(csstext));
- }
- _head.appendChild(_style);
- document.body.offsetHeight;
- return _style;
- }
- U.UF.DL.loading = function (el) {
-
- if (el) {
-
-
-
-
-
-
-
-
-
- if (el.loadingel) {
- el.loadingel["P"]++;
- }
- else {
- if (U.UF.EL.offsetParent(el, true) != el) {
- el.postion = el.style.position;
- el.style.position = "relative";
- }
- var _lodingel = el.loadingel = $$("div", {
- "P": 0,
- "style": {
- "width": "100%",
- "height": "100%",
- "left": 0,
- "top": 0,
- "position": "absolute",
- "background-color": "#fff"
- }
- });
- var _loginimg = $$("div", {
- "style": {
- "display": "block",
- "z-index": "1000",
- "width": "37px",
- "height": "17px",
- "position": "absolute"
- }
- }, _lodingel);
- var _img = $$("img", { "src": "/img/Loading.gif" }, _loginimg);
- el.appendChild(_lodingel);
- _loginimg.style.left = ($(el)[0].offsetWidth - _loginimg.offsetWidth) / 2 + 'px';
- _loginimg.style.top = ($(el)[0].offsetHeight - _loginimg.offsetHeight) / 2 + 'px';
-
- }
- return _lodingel;
-
- }
- }
- U.UF.DL.uploading = function (el) {
- if (el && el.loadingel && el.loadingel["P"]-- == 0) {
-
- U.selectEl(el.loadingel).remove();
- el.style.position = el.postion;
- el.loadingel = null;
- }
- }
|