本文整理汇总了PHP中OutputPage::addInlineScript方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputPage::addInlineScript方法的具体用法?PHP OutputPage::addInlineScript怎么用?PHP OutputPage::addInlineScript使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPage
的用法示例。
在下文中一共展示了OutputPage::addInlineScript方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onBeforePageDisplay
/**
*
* @param OutputPage $oOutputPage
* @param SkinTemplate $oSkinTemplate
* @return boolean
*/
public function onBeforePageDisplay($oOutputPage, $oSkinTemplate)
{
$oTitle = $oOutputPage->getTitle();
$sHideTitlePageProp = BsArticleHelper::getInstance($oTitle)->getPageProp('bs_hidetitle');
if ($sHideTitlePageProp === '') {
$oOutputPage->mPagetitle = '';
$oOutputPage->addInlineScript("\$('.firstHeading').remove()");
}
return true;
}
示例2: elmEasyRefOutput
function elmEasyRefOutput(OutputPage $outputPage, $skin)
{
global $wgScriptPath;
// Options
global $wgElmEasyRefAddCSS, $wgElmEasyRefDebugMode, $wgElmEasyRefBodyContentId, $wgElmEasyRefAnimation, $wgElmEasyRefMetrics, $wgElmEasyRefNum_rp, $wgElmEasyRefNum_mt;
// Register css for popup field
$outputPage->addLink(array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => $wgScriptPath . '/extensions/ElmEasyRef/css/referencefield.css'));
// Additonal css if setted
if ($wgElmEasyRefAddCSS) {
$outputPage->addLink(array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => $wgElmEasyRefAddCSS));
}
// Register js-script file
$src = '/extensions/ElmEasyRef/js/elmEasyRef';
if (!$wgElmEasyRefDebugMode) {
$src .= '-min';
}
$outputPage->addScript(Html::linkedScript($wgScriptPath . $src . '.js'));
// Settings
$settings = '';
if ($wgElmEasyRefDebugMode) {
$settings .= 'elmEasyRef.debug = true;';
}
if ($wgElmEasyRefBodyContentId) {
$settings .= 'elmEasyRef.bodyContentId = ' . Xml::encodeJsVar($wgElmEasyRefBodyContentId) . ';';
}
if ($wgElmEasyRefNum_rp) {
$settings .= 'elmEasyRef.regRefNum_rp = /' . $wgElmEasyRefNum_rp . '/;';
}
if ($wgElmEasyRefNum_mt) {
$settings .= 'elmEasyRef.regRefNum_mt = /' . $wgElmEasyRefNum_mt . '/;';
}
if ($wgElmEasyRefAnimation) {
foreach ($wgElmEasyRefAnimation as $prop => $val) {
$settings .= 'elmEasyRef.animation.' . $prop . ' = ' . Xml::encodeJsVar($val) . ';';
}
}
if ($wgElmEasyRefMetrics) {
foreach ($wgElmEasyRefMetrics as $prop => $val) {
$settings .= 'elmEasyRef.fieldm.' . $prop . ' = ' . Xml::encodeJsVar($val) . ';';
}
}
$msg = wfMsgExt('elm-easyref-ref', 'parseinline');
$settings .= 'elmEasyRef.messages.elm_easyref_ref = ' . Xml::encodeJsVar($msg) . ';';
$msg = wfMsgExt('elm-easyref-close', 'parseinline');
$settings .= 'elmEasyRef.messages.elm_easyref_close = ' . Xml::encodeJsVar($msg) . ';';
$outputPage->addInlineScript('addOnloadHook( function() {' . $settings . 'elmEasyRef.prepare();' . '} );');
return true;
}
示例3: renderOpenFullEditor
/**
* On new pages, open the editor right away.
*/
private function renderOpenFullEditor(OutputPage $output)
{
if (!$this->article->exists()) {
$output->addInlineScript('jQuery( document ).ready( function() {
jQuery.inlineEditor.show( "inline-editor-root" );
} );');
}
}