(att, par, replaceElemIdStr, callbackFn)
| 343 | - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 |
| 344 | */ |
| 345 | function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { |
| 346 | isExpressInstallActive = true; |
| 347 | storedCallbackFn = callbackFn || null; |
| 348 | storedCallbackObj = {success:false, id:replaceElemIdStr}; |
| 349 | var obj = getElementById(replaceElemIdStr); |
| 350 | if (obj) { |
| 351 | if (obj.nodeName == "OBJECT") { // static publishing |
| 352 | storedAltContent = abstractAltContent(obj); |
| 353 | storedAltContentId = null; |
| 354 | } |
| 355 | else { // dynamic publishing |
| 356 | storedAltContent = obj; |
| 357 | storedAltContentId = replaceElemIdStr; |
| 358 | } |
| 359 | att.id = EXPRESS_INSTALL_ID; |
| 360 | if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } |
| 361 | if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } |
| 362 | doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; |
| 363 | var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", |
| 364 | fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; |
| 365 | if (typeof par.flashvars != UNDEF) { |
| 366 | par.flashvars += "&" + fv; |
| 367 | } |
| 368 | else { |
| 369 | par.flashvars = fv; |
| 370 | } |
| 371 | // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, |
| 372 | // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work |
| 373 | if (ua.ie && ua.win && obj.readyState != 4) { |
| 374 | var newObj = createElement("div"); |
| 375 | replaceElemIdStr += "SWFObjectNew"; |
| 376 | newObj.setAttribute("id", replaceElemIdStr); |
| 377 | obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf |
| 378 | obj.style.display = "none"; |
| 379 | (function(){ |
| 380 | if (obj.readyState == 4) { |
| 381 | obj.parentNode.removeChild(obj); |
| 382 | } |
| 383 | else { |
| 384 | setTimeout(arguments.callee, 10); |
| 385 | } |
| 386 | })(); |
| 387 | } |
| 388 | createSWF(att, par, replaceElemIdStr); |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | /* Functions to abstract and display alternative content |
| 393 | */ |
no test coverage detected