source: trip-planner-front/node_modules/less/lib/less-browser/bootstrap.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.0 KB
Line 
1"use strict";
2/**
3 * Kicks off less and compiles any stylesheets
4 * used in the browser distributed version of less
5 * to kick-start less using the browser api
6 */
7/* global window, document */
8Object.defineProperty(exports, "__esModule", { value: true });
9var tslib_1 = require("tslib");
10var default_options_1 = tslib_1.__importDefault(require("../less/default-options"));
11var add_default_options_1 = tslib_1.__importDefault(require("./add-default-options"));
12var index_1 = tslib_1.__importDefault(require("./index"));
13var options = default_options_1.default();
14if (window.less) {
15 for (var key in window.less) {
16 if (window.less.hasOwnProperty(key)) {
17 options[key] = window.less[key];
18 }
19 }
20}
21add_default_options_1.default(window, options);
22options.plugins = options.plugins || [];
23if (window.LESS_PLUGINS) {
24 options.plugins = options.plugins.concat(window.LESS_PLUGINS);
25}
26var less = index_1.default(window, options);
27exports.default = less;
28window.less = less;
29var css;
30var head;
31var style;
32// Always restore page visibility
33function resolveOrReject(data) {
34 if (data.filename) {
35 console.warn(data);
36 }
37 if (!options.async) {
38 head.removeChild(style);
39 }
40}
41if (options.onReady) {
42 if (/!watch/.test(window.location.hash)) {
43 less.watch();
44 }
45 // Simulate synchronous stylesheet loading by hiding page rendering
46 if (!options.async) {
47 css = 'body { display: none !important }';
48 head = document.head || document.getElementsByTagName('head')[0];
49 style = document.createElement('style');
50 style.type = 'text/css';
51 if (style.styleSheet) {
52 style.styleSheet.cssText = css;
53 }
54 else {
55 style.appendChild(document.createTextNode(css));
56 }
57 head.appendChild(style);
58 }
59 less.registerStylesheetsImmediately();
60 less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);
61}
62//# sourceMappingURL=bootstrap.js.map
Note: See TracBrowser for help on using the repository browser.