public function initStatic() { $staticUrl = $this->plugin->getStaticUrl(); OW::getDocument()->addStyleSheet($staticUrl . 'style.min.css'); OW::getDocument()->addScript($staticUrl . 'script.min.js'); $utils = array(); $utils['queryRsp'] = OW::getRouter()->urlFor('HINT_CTRL_Hint', 'query'); $js = UTIL_JsGenerator::newInstance()->callFunction(array('HINT.UTILS', 'init'), array($utils)); $hint = array(); $hint['rsp'] = OW::getRouter()->urlFor('HINT_CTRL_Hint', 'rsp'); $js->callFunction(array('HINT.Launcher', 'init'), array($hint, $this->getMaskList(), $this->getIgnoreSelectorsList())); OW::getDocument()->addOnloadScript($js); }
public function includeStaticFile($file) { $document = OW::getDocument(); $staticUrl = $this->plugin->getStaticUrl(); $ext = UTIL_File::getExtension($file); $file .= "?" . $this->plugin->getDto()->build; switch ($ext) { case "css": $document->addStyleSheet($staticUrl . $file); break; case "js": $document->addScript($staticUrl . $file); break; } }