How to use the bootstrap.loadSystemSnippets function in bootstrap

To help you get started, we’ve selected a few bootstrap 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 emmetio / emmet / plugins / komodo / content / js / controller.js View on Github external
var channel = ioService.newChannel(aURL, null, null);
		var input = channel.open();
		scriptableStream.init(input);
		var str = scriptableStream.read(input.available());
		scriptableStream.close();
		input.close();
		return str;
	}
	
//	window.openDialog('chrome://global/content/console.xul', '_blank');
	
	try {
		// Load snippets
		var snippets = getContents('chrome://emmet/content/js/snippets.json') || '{}';
		require('bootstrap').loadSystemSnippets(snippets);
		
		// Load extensions
		var extPath = require('file').createPath(DirIO.get('Home').path, 'emmet', function(extPath) {
			var rootDir = FileIO.open(extPath);
			
			if (rootDir.exists() && rootDir.isDirectory()) {
				var extFiles = _.reject(DirIO.read(rootDir, true), function(f) {
					return f.isDirectory();
				});
				
				extFiles = _.map(extFiles, function(f) {
					return FileIO.path(f);
				});
				
				require('bootstrap').loadExtensions(extFiles);
			}
github emmetio / emmet / plugins / npp / bootstrap.js View on Github external
emmet.exec(function(require, _) {
	var file = require('file');
	var coreDir = file.createPath(Editor.nppDir, 'plugins\\jN\\includes');
	
	// path to Emmet extensions and user's custom snippets 
	var extensionsDir = file.createPath(Editor.nppDir, 'plugins\\emmet-extensions');
	
	var bootstrap = require('bootstrap');
	
	// load snippets
	bootstrap.loadSystemSnippets(file.read(file.createPath(coreDir, 'snippets.json')));
	
	// get keymap
	var keymap = bootstrap.parseJSON(file.read(file.createPath(coreDir, 'keymap.json')));
	
	// load extensions
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	if (fso.FolderExists(extensionsDir)) {
		var fileList = [];
		var extensionFiles = fso.GetFolder(extensionsDir).Files;
		
		var fileEnum = new Enumerator(extensionFiles);
		for (; !fileEnum.atEnd(); fileEnum.moveNext()) {
			fileList.push(fileEnum.item().Path);
		}
		
		bootstrap.loadExtensions(fileList);
github JackyDing / Jacky.Emmet / src / Jacky.Emmet / Assets / startup.js View on Github external
require('actions\\wrapWithAbbreviation');
    require('actions\\matchPair');
    require('actions\\editPoints');
    require('actions\\selectItem');
    require('actions\\selectLine');
    require('actions\\lineBreak');
    require('actions\\mergeLines');
    require('actions\\toggleComment');
    require('actions\\splitJoinTag');
    require('actions\\removeTag');
    require('actions\\evaluateMath');
    require('actions\\increment_decrement');
    require('actions\\base64');
    require('actions\\reflectCSSValue');
    require('actions\\updateImageSize');
    require('bootstrap').loadSystemSnippets(require('file').read(context.Root + '\\Assets\\snippets.json'));
    context.startup(JSON.stringify(require('actions').getMenu()));
});
github emmetio / Emmet.sugar / Contents / Resources / objc-zeneditor-wrap.js View on Github external
function objcLoadSystemSnippets(data) {
	require('bootstrap').loadSystemSnippets(objcToString(data));
}