4854: Upgrade infusion library to 1.4
[acontent.git] / docs / include / jscripts / infusion / framework / enhancement / js / ProgressiveEnhancement.js
1 var fluid_1_4=fluid_1_4||{};(function($,fluid){fluid.registerNamespace("fluid.browser");fluid.browser.binaryXHR=function(){var canSendBinary=window.FormData||(window.XMLHttpRequest&&window.XMLHttpRequest.prototype&&window.XMLHttpRequest.prototype.sendAsBinary);return canSendBinary?fluid.typeTag("fluid.browser.supportsBinaryXHR"):undefined};fluid.browser.formData=function(){return window.FormData?fluid.typeTag("fluid.browser.supportsFormData"):undefined};fluid.browser.flash=function(){var hasModernFlash=(typeof (swfobject)!=="undefined")&&(swfobject.getFlashPlayerVersion().major>8);return hasModernFlash?fluid.typeTag("fluid.browser.supportsFlash"):undefined};fluid.progressiveChecker=function(options){var that=fluid.initLittleComponent("fluid.progressiveChecker",options);return fluid.typeTag(fluid.find(that.options.checks,function(check){if(check.feature){return check.contextName}},that.options.defaultContextName))};fluid.defaults("fluid.progressiveChecker",{gradeNames:"fluid.typeFount",checks:[],defaultContextName:undefined});fluid.progressiveCheckerForComponent=function(options){var that=fluid.initLittleComponent("fluid.progressiveCheckerForComponent",options);var defaults=fluid.defaults(that.options.componentName);return fluid.progressiveChecker(fluid.expandOptions(defaults.progressiveCheckerOptions,that))};fluid.defaults("fluid.progressiveCheckerForComponent",{gradeNames:"fluid.typeFount"});$("head").append("<style type='text/css'>.fl-progEnhance-basic, .fl-ProgEnhance-basic { display: none; } .fl-progEnhance-enhanced, .fl-ProgEnhance-enhanced { display: block; }</style>");var features={supportsBinaryXHR:fluid.browser.binaryXHR(),supportsFormData:fluid.browser.formData(),supportsFlash:fluid.browser.flash()};fluid.merge(null,fluid.staticEnvironment,features)})(jQuery,fluid_1_4);