BVB Source Codes

isso Show jade.js Source code

Return Download isso: download jade.js Source code - Download isso Source code - Type:.js
  1. define(function() {
  2.     "use strict";
  3.  
  4.     var jade = null,
  5.         builds = {};
  6.  
  7.     var fetchText = function() {
  8.         throw new Error("Environment not supported.");
  9.     };
  10.  
  11.     if (typeof process !== "undefined") {
  12.         var fs = require.nodeRequire("fs");
  13.         jade = require.nodeRequire("jade");
  14.         fetchText = function(path, callback) {
  15.             callback(fs.readFileSync(path, "utf-8"));
  16.         };
  17.     } else if ((typeof window !== "undefined" && window.navigator && window.document) || typeof importScripts !== "undefined") {
  18.         fetchText = function (url, callback) {
  19.             var xhr = new XMLHttpRequest();
  20.             xhr.open('GET', url, true);
  21.             xhr.onreadystatechange = function() {
  22.                 if (xhr.readyState === 4) {
  23.                     callback(xhr.responseText);
  24.                 }
  25.             };
  26.             xhr.send(null);
  27.         };
  28.     }
  29.  
  30.     return {
  31.  
  32.         fetchText: fetchText,
  33.  
  34.         load: function(name, req, onload, config) {
  35.             var path = req.toUrl(name + ".jade");
  36.             fetchText(path, function(text) {
  37.                 if (jade === null) {
  38.                     req(["libjs-jade"], function(jade) {
  39.                         onload(jade.compileClient(text));
  40.                         onload(text);
  41.                     });
  42.                 } else {
  43.                     builds[name] = jade.compileClient(text);
  44.                     onload(builds[name]);
  45.                 }
  46.             });
  47.  
  48.         },
  49.         write: function(plugin, name, write) {
  50.             if (builds.hasOwnProperty(name)) {
  51.                 write("define('" + plugin + "!" + name  +"', function () {" +
  52.                       "  var fn = " + builds[name] + ";" +
  53.                       "  return fn;" +
  54.                       "});\n");
  55.             }
  56.         }
  57.     };
  58. });
  59.  
downloadjade.js Source code - Download isso Source code
Related Source Codes/Software:
hologram - A markdown based documentation system for style gu... 2017-05-12
www.html5rocks.com - ....a top-notch resource for web developer 2017-05-12
MTStatusBarOverlay - A custom iOS status bar overlay seen in Apps like ... 2017-05-12
blueprint - Reverse engineer server configuration ... 2017-05-12
PullToRefresh - A simple iPhone TableViewController for adding the... 2017-05-12
python3-cookbook - "The Python Cookbook" 3 rd Edition Translatio 2017-05-12
TSA-Travel-Sentry-master-keys - 3D reproduction of TSA Master key 2017-05-12
fatfree - A powerful yet easy-to-use PHP micro-framework des... 2017-05-13
rolify - Role management library with the resource scoping 2017-05-13
jquery-mockjax - The jQuery Mockjax Plugin provides a simple and ex... 2017-05-13
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top