当前位置: 首页>>代码示例>>PHP>>正文


PHP OutputPage::addInlineScript方法代码示例

本文整理汇总了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;
 }
开发者ID:hfroese,项目名称:mediawiki-extensions-BlueSpiceExtensions,代码行数:16,代码来源:HideTitle.class.php

示例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;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:48,代码来源:ElmEasyRef.php

示例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" );
				} );');
        }
    }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:11,代码来源:InlineEditor.class.php


注:本文中的OutputPage::addInlineScript方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。