Пример #1
0
 /**
  * @param mixed $generatorOrValue
  *
  * @return mixed
  */
 public static function await($generatorOrValue)
 {
     switch (true) {
         case $generatorOrValue instanceof \generator:
             $generatorOrValue->current();
             while ($generatorOrValue->valid() === true) {
                 $generatorOrValue->next();
             }
             return self::await($generatorOrValue->getReturn());
         case is_callable($generatorOrValue):
             return self::await($generatorOrValue());
         case $generatorOrValue instanceof wrapper:
             return wrapper::unwrap($generatorOrValue);
         case is_array($generatorOrValue) === true:
             return array_map(function ($generator) {
                 return self::await($generator);
             }, $generatorOrValue);
         default:
             return $generatorOrValue;
     }
 }
Пример #2
0
				var crossevt=(window.event) ? event : loadevt;
				var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement;
				if (iframeroot) {
					resizeIframe(iframeroot.id);
					scrollToPosition(iframeroot.id);
				}
			}

			function resizeCaller() {
				resizeIframe(iframeid);
				var tempobj = document.getElementById(iframeid);
				tempobj.style.display = "block";
			}

			if (window.addEventListener){
				window.addEventListener("load", resizeCaller, false);
			} else if (window.attachEvent) {
				window.attachEvent("onload", resizeCaller);
			} else {
				window.onload=resizeCaller;
			}

			var aktiv = window.setInterval(resizeCaller, 1000*2); //2 Sekunden
		';
        $this->tpl->add_js($out, 'docready');
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_wrapper', wrapper::__shortcuts());
}
registry::register('wrapper');