How to use the bobril.asset function in bobril

To help you get started, we’ve selected a few bobril examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keeema / bobrilstrap / index.ts View on Github external
export function init(): b.IBobrilNode {
  b.asset("node_modules/jquery/dist/jquery.min.js");
  b.asset("node_modules/bootstrap/dist/js/bootstrap.min.js");
  b.asset("node_modules/bootstrap-3-typeahead/bootstrap3-typeahead.min.js");
  moveDefaultCssToBeginning();
  return {};
}
github keeema / bobrilstrap / components / core / index.ts View on Github external
export function init(): void {
    b.asset('bootstrap/css/bootstrap.css');
}
github keeema / bobrilstrap / index.ts View on Github external
export function init(): b.IBobrilNode {
  b.asset("node_modules/jquery/dist/jquery.min.js");
  b.asset("node_modules/bootstrap/dist/js/bootstrap.min.js");
  b.asset("node_modules/bootstrap-3-typeahead/bootstrap3-typeahead.min.js");
  moveDefaultCssToBeginning();
  return {};
}
github keeema / bobrilstrap / index.ts View on Github external
export function init(): b.IBobrilNode {
  b.asset("node_modules/jquery/dist/jquery.min.js");
  b.asset("node_modules/bootstrap/dist/js/bootstrap.min.js");
  b.asset("node_modules/bootstrap-3-typeahead/bootstrap3-typeahead.min.js");
  moveDefaultCssToBeginning();
  return {};
}
github keeema / bobrilstrap / index.ts View on Github external
export * from "./components/tbody";
export * from "./components/td";
export * from "./components/textarea";
export * from "./components/th";
export * from "./components/thead";
export * from "./components/tooltip";
export * from "./components/tr";
export * from "./components/typography";
export * from "./components/ul";
export * from "./components/underlined";
export * from "./components/validations";
export * from "./components/variable";
export * from "./components/video";
export * from "./components/well";

const defaultCss = b.asset("node_modules/bootstrap/dist/css/bootstrap.min.css");

export function init(): b.IBobrilNode {
  b.asset("node_modules/jquery/dist/jquery.min.js");
  b.asset("node_modules/bootstrap/dist/js/bootstrap.min.js");
  b.asset("node_modules/bootstrap-3-typeahead/bootstrap3-typeahead.min.js");
  moveDefaultCssToBeginning();
  return {};
}

function moveDefaultCssToBeginning(): void {
  const links = document.head.getElementsByTagName("link");
  for (let i = 0; i < links.length; i++) {
    const link = links[i];
    if (link.href.endsWith(defaultCss)) {
      if (i > 0) {
        document.head.removeChild(link);
github keeema / bobrilstrap / example / prettify / pre.ts View on Github external
import * as b from "bobril";
import { Pre as basePre, IBaseData } from "../../index";

b.asset("./prettify.css");
b.asset("./atelier-dune-light.css");

const prettyPrint = b.styleDef("prettyprint");

export const pre = b.createDerivedComponent(basePre, {
  id: "bobrilstrap-prettify-pre",
  render(_ctx: b.IBobrilCtx, me: b.IBobrilNode) {
    b.style(me, prettyPrint);
  }
});

export const langJs = b.styleDef("lang-js");
github bobril / bobril-m / src / fonts.ts View on Github external
import * as b from "bobril";

b.asset("node_modules/webfontloader/webfontloader.js");

declare var WebFont: any;

export function initRobotoFonts(subsets = 'latin') {
    WebFont.load({ google: { families: ['Roboto:400,500:' + subsets] },
        active() { b.invalidate(); },
        inactive() { b.invalidate(); },
        classes: false
    });
}