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


PHP Assets::removeJS方法代码示例

本文整理汇总了PHP中Assets::removeJS方法的典型用法代码示例。如果您正苦于以下问题:PHP Assets::removeJS方法的具体用法?PHP Assets::removeJS怎么用?PHP Assets::removeJS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assets的用法示例。


在下文中一共展示了Assets::removeJS方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: page

 public function page($p)
 {
     /**
      * Clean up Assets
      */
     \Assets::removeCSS(array("theme.hine-/src/dashboard/css/scrollbar.css", "theme.hine-/src/dashboard/css/jquery.contextmenu.css", "theme.hine-/src/dashboard/css/dashboard.css", "theme.hine-/src/main/lib/jquery-ui/jquery-ui.css"));
     \Assets::js("jqueryui", "");
     \Assets::removeJS(array("theme.hine-/src/dashboard/js/scrollbar.js", "theme.hine-/src/dashboard/js/jquery.contextmenu.js", "theme.hine-/src/dashboard/js/dashboard.js", "app"));
     /**
      * Mobile
      */
     Hooks::addAction("head.end", function () {
         echo '<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" async="async" defer="defer">';
         echo '<meta name="viewport" content="width=device-width, initial-scale=1">';
         if (\Lobby::getHostname() != "server.lo" . "bby.sim") {
             echo '<script>if (window.location.protocol != "https:") window.location.href = "https:" + window.location.href.substring(window.location.protocol.length);</script>';
         }
     });
     /**
      * 
      */
     Hooks::addAction("panel.end", function () {
         echo '<a href="#" data-activates="lobby-nav" id="lobby-nav-btn"><i class="material-icons">menu</i></a>';
         echo '<ul class="side-nav" id="lobby-nav">
     <li><a href="/">Lobby</a></li>
     <li><a href="/apps">Apps</a></li>
     <li><a href="/download">Download</a></li>
     <li><a href="/web-readme">Demo</a></li>
     <li><a href="/docs">Documentation</a></li>
   </ul>';
         echo '<script>lobby.load(function(){$("#lobby-nav-btn").sideNav({menuWidth: 200});});</script>';
     });
     /**
      * Add notifications
      */
     \Lobby\UI\Panel::addNotifyItem("lobby-0-6-released", array("contents" => "Lobby " . $this->lobby_version . " Released", "href" => $this->lobby_annoucement, "icon" => "update"));
     \Lobby\UI\Panel::addNotifyItem("z-new-game", array("contents" => "New Site Compressor!", "href" => "https://lobby.subinsb.com/apps/site-compressor", "icon" => "new"));
     $path = explode("/", $p);
     if ($path[1] === "docs") {
         $doc = isset($path[2]) ? str_replace("/", ".", substr_replace($p, "", 0, 6)) : "index";
         $this->menu_items();
         \Assets::removeJS("theme.hine-/src/main/js/init.js");
         return $this->inc("/src/page/docs.php", array("doc" => $doc));
     } elseif ($path[1] === "mods") {
         $mod = isset($path[2]) ? str_replace("/", ".", substr_replace($p, "", 0, 6)) : "index";
         $this->menu_items();
         \Assets::removeJS("theme.hine-/src/main/js/init.js");
         return $this->inc("/src/page/mods.php", array("doc" => $mod));
     } else {
         if ($path[1] == "api") {
             $node = isset($path[2]) ? $path[2] : "index";
             return $this->inc("/src/page/api.php", array("node" => $node, "path" => $path));
         } else {
             if ($path[1] == "me") {
                 $this->menu_items();
                 $node = isset($path[2]) ? $path[2] : "index";
                 return $this->inc("/src/page/me.php", array("node" => $node, "path" => $path));
             } else {
                 if ($path[1] == "apps") {
                     $this->menu_items();
                     $node = isset($path[2]) ? $path[2] : "index";
                     return $this->inc("/src/page/apps.php", array("node" => $node));
                 } else {
                     if ($path[1] == "u") {
                         $this->menu_items();
                         $node = isset($path[2]) ? $path[2] : "index";
                         return $this->inc("/src/page/u.php", array("user" => $node));
                     } else {
                         $this->menu_items();
                         return "auto";
                     }
                 }
             }
         }
     }
 }
开发者ID:LobbyOS,项目名称:server,代码行数:76,代码来源:App.php

示例2: head

 /**
  * Print the <head> tag
  */
 public static function head($title = "")
 {
     header('Content-type: text/html; charset=utf-8');
     if ($title != "") {
         self::setTitle($title);
     }
     if (Assets::issetJS('jquery')) {
         /**
          * Load jQuery, jQuery UI, Lobby Main, App separately without async
          */
         $url = L_URL . "/includes/serve-assets.php?type=js&assets=" . implode(",", array(Assets::getJS('jquery'), Assets::getJS('jqueryui'), Assets::getJS('main'), Assets::issetJS('app') ? Assets::getJS('app') : ""));
         echo "<script src='{$url}'></script>";
         Assets::removeJS("jquery");
         Assets::removeJS("jqueryui");
         Assets::removeJS("main");
     }
     $jsURLParams = array("THEME_URL" => Themes::getThemeURL());
     if (Apps::isAppRunning()) {
         $jsURLParams["APP_URL"] = urlencode(Apps::getInfo("url"));
         $jsURLParams["APP_SRC"] = urlencode(Apps::getInfo("srcURL"));
     }
     $jsURL = Assets::getServeURL("js", $jsURLParams);
     echo "<script>lobby.load_script_url = '" . $jsURL . "';</script>";
     $cssServeParams = array("THEME_URL" => THEME_URL);
     /**
      * CSS Files
      */
     if (Apps::isAppRunning()) {
         $cssServeParams["APP_URL"] = urlencode(Apps::getInfo("url"));
         $cssServeParams["APP_SRC"] = urlencode(Apps::getInfo("srcURL"));
     }
     echo Assets::getServeLinkTag($cssServeParams);
     echo "<link href='" . L_URL . "/favicon.ico' sizes='16x16 32x32 64x64' rel='shortcut icon' />";
     /* Title */
     echo "<title>" . self::$title . "</title>";
 }
开发者ID:LobbyOS,项目名称:server,代码行数:39,代码来源:Response.php


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