Assign a variable to the tpl with the HTML code to load the JS and CSS files.
187252
protected function assignMedia()
	{

		// On development create all the packed files on the fly:
		if ( \Sifo\Domains::getInstance()->getDevMode() )
		{
			$packer = new \Sifo\JsPacker();
			$packer->packMedia();
			$packer = new \Sifo\CssPacker();
			$packer->packMedia();
		}

		$this->assign( 'media', \Sifo\Config::getInstance()->getConfig( 'css' ) );
		$this->assign( 'css_groups', $this->css_groups );
		$this->assign( 'js_groups', $this->js_groups );

		$this->assign( 'static_rev', $this->getStaticRevision() );
		$this->assign( 'media_module', $this->fetch( 'shared/media_packer.tpl' ) );

	}
444892
function htmlLoaderOptions(options) {
  return {
    loader: 'html-loader',
    options: Object.assign({}, options, {
      minimize: options.env === 'development' ? false : true
    })
  }
}
727434
def load_if_not_loaded(widget, filenames, verbose=False, delay=0.1, force=False, local=True, evaluator=None):
    
    if evaluator is None:
        evaluator = EVALUATOR  # default if not specified.
    for filename in filenames:
        loaded = False
        if force or not filename in LOADED_JAVASCRIPT:
            js_text = get_text_from_file_name(filename, local)
            if verbose:
                print("loading javascript file", filename, "with", evaluator)
            evaluator(widget, js_text)
            LOADED_JAVASCRIPT.add(filename)
            loaded = True
        else:
            if verbose:
                print ("not reloading javascript file", filename)
        if loaded and delay > 0:
            if verbose:
                print ("delaying to allow JS interpreter to sync.")
            time.sleep(delay)
892255
function (data, option, callback) {
    var html = '';
    var self = this;
    var fn = self.fn;
    var config = self.config;
    if (typeof option === 'function') {
      callback = option;
      option = null;
    }
    option = option || {};
    callback = callback || function (error, ret) {
      if (error) {
        if (!(error instanceof Error)) {
          error = new Error(error);
        }
        throw error;
      }
      html = ret;
    };
    var name = self.config.name;
    if (!name && fn && fn.TPL_NAME) {
      name = fn.TPL_NAME;
    }
    var scope;
    if (data instanceof Scope) {
      scope = data;
    } else {
      scope = new Scope(data);
    }
    var buffer = new XTemplateRuntime.LinkedBuffer(callback, config).head;
    var tpl = new TplWrap(name, {
      commands: option.commands
    }, self, scope, buffer, name, fn);
    buffer.tpl = tpl;
    if (!fn) {
      config.loader.load(tpl, function (err, fn) {
        if (fn) {
          tpl.fn = self.fn = fn;
          renderTpl(tpl);
        } else if (err) {
          buffer.error(err);
        }
      });
      return html;
    }
    renderTpl(tpl);
    return html;
  }
614232
def load(css_url=None, js_url=None, serve_local=False):
        
        if serve_local or current_app.config['SHARE_SERVE_LOCAL']:
            css_url = url_for('share.static', filename='css/share.min.css')
            js_url = url_for('share.static', filename='js/social-share.min.js')

        if css_url is None:
            css_url = 'https://cdn.bootcss.com/social-share.js/1.0.16/css/share.min.css'
        if js_url is None:
            js_url = 'https://cdn.bootcss.com/social-share.js/1.0.16/js/social-share.min.js'
        return Markup('''<link rel="stylesheet" href="%s" type="text/css">\n
            <script src="%s"></script>''' % (css_url, js_url))
986563
function() {
  gulp.task('tpl-precompile', function() {
    return gulp.src([paths.src.partials])
    .pipe($.htmlmin({
      removeComments: true,
      collapseWhitespace: plugins.tpls.ext === '.jade' ? false : true
    }))
    .pipe(plugins.tpls.cmd(plugins.tpls.config))
    .on('error', handleError)
    .pipe($.defineModule('plain'))
    .pipe($.declare({
      namespace: 'R.templates',
      processName: function(file) {
        var dir = config.paths.src.partials || config.paths.src.templates;
        return file.slice(file.indexOf(dir) + dir.length).replace('.js', '');
      }
    }))
    .pipe($.concat('templates.js'))
    .pipe(gulp.dest(paths.out.js));
  });

  /* Template livereloading  */
  gulp.task('tpl-reload', ['tpl-precompile'], function() {
    return gulp.src([paths.src.views])
    .pipe($.livereload(lrport));
  });
}
1171561
function (tplCtxt) {
            this.$assert(133, tplCtxt.$TemplateCtxt);

            var toLoad = tplCtxt.getCSSDependencies();
            var tplClasspath = tplCtxt.tplClasspath;
            var loadResult = this.loadClassPathDependencies(tplClasspath, toLoad, {
                isTemplate : true
            });

            if (loadResult.changes) {
                this.$raiseEvent({
                    name : "styleChange",
                    templateClasspath : tplClasspath
                });
            }

            this.$raiseEvent({
                name : "dependenciesLoaded",
                templateClasspath : tplClasspath
            });

            return loadResult.classes;
        }
882521
function inlineOptimze(source) {
    var blocks = [];
    var sections = source.split(INLINE_START_REG);
    sections.forEach(function(s) {
      if (s.match(INLINE_END_REG) && !s.match(JSFILE_REG)) {
        // s[0] css rules or js code
        // s[1] </style> or </script>
        // s[2] other html code after </style> </script>
        s = s.split(INLINE_END_REG);
        switch (s[1]) {
          case '</style>':
            s[0] = optimizeCss(s[0]);
            break;
          case '</script>':
            s[0] = optimizeJs(s[0]);
            break;
        }
        blocks.push(s.join(''));
      } else {
        blocks.push(s);
      }
    });
    return blocks.join('');
  }
890285
function () {
            var tplDiv = this._subTplDiv; // may be null at this time
            if (tplDiv) {
                tplDiv.className = "xTplContent"; // remove the loading indicator
                ariaUtilsDom.replaceHTML(tplDiv, "#ERROR WHILE LOADING TEMPLATE#");
            }
            this._deleteTplcfg();
            this.$callback(this.tplLoadCallback, {
                success : false
            });
        }
965751
function (tplDiv) {
            if (tplDiv) {
                tplDiv.__data = null;
                tplDiv.__moduleCtrl = null;
                tplDiv.__template = null;
            }
        }
1170048
def load(self, name, code):
        """"""

        source = "\n".join(code)
        self._objects[name] = source
563216
function buildElementTag( def, code, varName ) {
    const attribs = extractAttribs( def );

    try {
        const arr = Object.keys( attribs.standard );
        code.requires[ "Tag" ] = "require('tfw.view').Tag";
        code.section.elements.define.push(
            "const " + varName + " = new Tag('" + def[ 0 ] + "'" +
            ( arr.length > 0 ? ', ' + JSON.stringify( arr ) : '' ) +
            ");" );

        const initAttribs = buildElementTagAttribsStandard( attribs.standard, code, varName );
        buildInitAttribsForTag( initAttribs, code, varName );
        buildElementEvents( attribs.special, code, varName );
        buildElementTagClassSwitcher( attribs.special, code, varName );
        buildElementTagAttribSwitcher( attribs.special, code, varName );
        buildElementTagStyle( attribs.special, code, varName );
        buildElementTagChildren( attribs.special, code, varName );
        buildElementTagOn( attribs.special, code, varName );
    } catch ( ex ) {
        throw ex + "\n...in tag \"" + varName + "\": " + limitJson( def );
    }
}
1013922
function(variables) {
        var animation = false,
        animationstring = 'animation',
        keyframeprefix = '',
        domPrefixes = ["Webkit", "Moz", "O", "ms", "Khtml"],
        pfx = '',
        elm = document.querySelector("body");

        if( elm.style.animationName !== undefined ) { animation = true; }
        if( animation === false ) {
            for( var i = 0; i < domPrefixes.length; i++ ) {
                if( elm.style[ domPrefixes[i] + 'AnimationName' ] !== undefined ) {
                    pfx = domPrefixes[ i ];
                    animationstring = pfx + 'Animation';
                    keyframeprefix = '-' + pfx.toLowerCase() + '-';
                    animation = true;
                    break;
                }
            }
        }
        variables.keyframesPrefix = keyframeprefix;
        variables.animationString = animationstring;
        variables.aliases = {
            transform: keyframeprefix + "transform"
        };
        variables.count = 1;
    }
495588
function (data, callback) {
            var html = '';
            var self = this;
            var fn = self.fn;
            callback = callback || function (error, ret) {
                html = ret;
            };
            var name = self.config.name;
            if (!name && fn.TPL_NAME) {
                name = fn.TPL_NAME;
            }
            var scope = new Scope(data), buffer = new LinkedBuffer(callback).head;
            renderTpl({
                name: name,
                fn: fn,
                session: {},
                root: self
            }, scope, buffer);
            return html;
        }
160429
protected function _blockLoad($tpl, array $vars = array()) {
        $vars && \extract($vars);
        include "{$this->_template_dir}/{$tpl}.phtml";

        $this->_display_html .= \ob_get_contents();
        \ob_clean();
    }
514511
public function _loadConfigVars(Smarty_Internal_Template $tpl, $_config_vars)
    {
        $this->_assignConfigVars($tpl->parent, $tpl, $_config_vars);
        $scope = $tpl->source->scope;
        if (!$scope && !$tpl->scope) {
            return;
        }
        foreach (array($scope, $tpl->scope) as $s) {
            $s = ($bubble_up = $s >= Smarty::SCOPE_BUBBLE_UP) ? $s - Smarty::SCOPE_BUBBLE_UP : $s;
            if ($bubble_up && $s) {
                $ptr = $tpl->parent->parent;
                if (isset($ptr)) {
                    $this->_assignConfigVars($ptr, $tpl, $_config_vars);
                    $ptr = $ptr->parent;
                }
                if ($s == Smarty::SCOPE_PARENT) {
                    continue;
                }
                while (isset($ptr) && $ptr->_objType == 2) {
                    $this->_assignConfigVars($ptr, $tpl, $_config_vars);
                    $ptr = $ptr->parent;
                }
                if ($s == Smarty::SCOPE_TPL_ROOT) {
                    continue;
                } elseif ($s == Smarty::SCOPE_SMARTY) {
                    $this->_assignConfigVars($tpl->smarty, $tpl, $_config_vars);
                } elseif ($s == Smarty::SCOPE_GLOBAL) {
                    $this->_assignConfigVars($tpl->smarty, $tpl, $_config_vars);
                } elseif ($s == Smarty::SCOPE_ROOT) {
                    while (isset($ptr->parent)) {
                        $ptr = $ptr->parent;
                    }
                    $this->_assignConfigVars($ptr, $tpl, $_config_vars);
                }
            }
        }
    }
1104512
function loadJS(src, callback, attrs, timeout, fail, complete) {
    if ($.isObject(src)) {
        callback = src.callback;
        attrs = src.attrs;
        timeout = src.timeout;
        fail = src.fail;
        complete = src.complete;
        src = src.src;
        return loadJS(src, callback, attrs, timeout, fail, complete);
    }
    var script = document.createElement('script');
    var done = false;
    if ($.isObject(attrs)) {
        for (var i in attrs) {
            script.setAttribute(i, attrs[i]);
        }
    }
    var urls = getPath(src);
    src = script.src = urls[0];
    script.async = true;
    script.type = 'text/javascript';
    script.charset = defaultConfig.charset;
    complete = $.isFunction(complete) ? complete : emptyFn;
    script.onload = script.onreadystatechange = function(e) {
        e = e || cleanObj
        if (!done && (e.type === 'load' || /loaded|complete|undefined/.test(script.readyState))) {
            done = true;
            removeNode(script);
            mapLoaded[src] = 'loaded';
            $.isFunction(callback) && callback();
            complete('load');
        }
    };
    script.onerror = function() {
        done = true;
        mapLoaded[src] = 'error';
        $.isFunction(fail) && fail();
        complete('error');
    };
    timeout = $.isNumber(timeout) ? timeout : defaultConfig.timeout;
    if (timeout) {
        setTimeout(function() {
            if (!done) {
                done = true;
                mapLoaded[src] = 'timeout';
                complete('timeout');
            }
        }, timeout);
    }
    mapLoaded[src] = 'pending';
    head.insertBefore(script, base);
    return _;
}