1
0
Fork 0
mirror of https://github.com/mmumshad/ansible-playable.git synced 2025-03-09 23:38:54 +00:00

Initial Commit

This commit is contained in:
Mumshad Mannambeth 2017-06-07 13:36:44 -04:00
commit c92f737237
273 changed files with 16964 additions and 0 deletions

View file

@ -0,0 +1,48 @@
'use strict';
const angular = require('angular');
/*@ngInject*/
export function editorService() {
// Service logic
// ...
var ui_ace_doctype_map = {
'': 'ini',
'txt': 'text',
'text': 'text',
'yml': 'yaml',
'yaml': 'yaml',
'json': 'json',
'md': 'markdown',
'html': 'html',
'py': 'python',
'j2': 'ini'
};
var setContentAndType = function (data, file, selectedFile) {
if (typeof data == 'object') {
selectedFile.content = JSON.stringify(data, null, '\t');
} else {
selectedFile.content = data;
}
selectedFile.docType = ui_ace_doctype_map[file.extension.replace('.', '')];
selectedFile.showSource = true;
if (selectedFile.docType == 'markdown') {
selectedFile.markdownContent = selectedFile.content;
selectedFile.showSource = false;
}
};
// Public API here
return {
ui_ace_doctype_map: ui_ace_doctype_map,
setContentAndType: setContentAndType
};
}
export default angular.module('webAppApp.editor', [])
.factory('editor', editorService)
.name;

View file

@ -0,0 +1,16 @@
'use strict';
describe('Service: editor', function() {
// load the service's module
beforeEach(module('webAppApp.editor'));
// instantiate service
var editor;
beforeEach(inject(function(_editor_) {
editor = _editor_;
}));
it('should do something', function() {
expect(!!editor).to.be.true;
});
});