Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ module.exports = function(grunt) {
host: 'mms-ts-uat.jpl.nasa.gov',//'localhost',//'100.64.243.161',
port: 8080
},
{
context: '/xlrapi',
https: serverHttps,
host: servers[key],
port: serverPort
},
{
context: '/alfresco', // '/api'
host: servers[key],
Expand Down
92 changes: 92 additions & 0 deletions app/js/mms/directives/runXlr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
'use strict';

angular.module('mmsApp')
.directive('runXlr', ['$http', '$uibModal', '$window', 'growl', 'ApplicationService', runXlr]);

function runXlr($http, $uibModal, $window, growl, ApplicationService) {
return {
template: '<button class="btn btn-primary" ng-click="runXLR()">{{xlrTaskName}}</button>',
scope: {
templateId: '@',
xlrTaskName: '@'
},
controller: ['$scope', runXlrCtrl],
link: runXlrLink
};
function runXlrLink(scope, element, attrs, ctrls) {}

function runXlrCtrl($scope) {
var modalOpen = false;
$scope.xlrTaskName = $scope.xlrTaskName ? $scope.xlrTaskName : 'Sync FN to JPL Network';
$scope.runXLR = runXLR;
function runXLR() {

modalOpen = true;
$uibModal.open({
template: '<div class="modal-header"><h4>Please login to {{xlrTaskName}}.</h4></div><div class="modal-body"><form name="loginForm" ng-submit="login(credentials)">' +
'<input type="text" class="form-control" ng-model="credentials.username" placeholder="Username" style="margin-bottom: 1.5em;" autofocus>' +
'<input type="password" class="form-control" ng-model="credentials.password" placeholder="Password" style="margin-bottom: 1.5em;">' +
'<button class="btn btn-block btn-primary" type="submit">LOG IN <span ng-if="spin" ><i class="fa fa-spin fa-spinner"></i>' +
'</span></button></form></div>',
scope: $scope,
backdrop: 'static',
controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {
$scope.credentials = {
username: '',
password: ''
};
$scope.spin = false;

function make_base_auth(user, password) {
var tok = user + ':' + password;
var hash = $window.btoa(tok);
return "Basic " + hash;
}
$scope.login = function (credentials) {
$scope.spin = true;
var baseAuth = make_base_auth(credentials.username, credentials.password);
var email = credentials.username + '@jpl.nasa.gov';
var postBody = {
"releaseTitle": "CAE Portal Sync",
"releaseVariables": {
"contentEditor": credentials.username,
"editorEmail": email
},
"autoStart": true
};

var link = "/xlrapi/v1/templates/Applications/" + $scope.templateId + "/create";
var config = {
method: 'POST',
url: link,
headers: {
'Authorization': baseAuth,
"Content-Type": "application/json",
"cache-control": "no-cache",
},
"data": postBody,
"withCredentials": true,
"async": true,
"crossDomain": true,
"processData": false
};
$http(config).then(function() {
growl.success($scope.xlrTaskName + ' is running. You will receive a completion email');
}, function(error){
growl.error($scope.xlrTaskName + ' has failed.');
}).finally(function() {
$scope.spin = false;
modalOpen = false;
$uibModalInstance.dismiss();
});
};
}],
size: 'md'
}).result.finally(function(){
modalOpen = false;
});

}

}
}
2 changes: 1 addition & 1 deletion src/lib/ckeditor/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CKEDITOR.editorConfig = function( config ) {
config.autoGrow_onStartup = true;
config.startupFocus = 'end';
config.mathJaxLib = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
config.allowedContent = true;
config.allowedContent = true;
config.specialChars = ['&euro;', '&lsquo;', '&rsquo;', '&ldquo;', '&rdquo;', '&ndash;', '&mdash;', '&iexcl;', '&cent;', '&pound;', '&curren;', '&yen;', '&brvbar;', '&sect;', '&uml;', '&copy;', '&ordf;', '&laquo;', '&not;', '&reg;', '&macr;', '&deg;', '&sup2;', '&sup3;', '&acute;', '&micro;', '&para;', '&middot;', '&cedil;', '&sup1;', '&ordm;', '&raquo;', '&frac14;', '&frac12;', '&frac34;', '&iquest;', '&Agrave;', '&Aacute;', '&Acirc;', '&Atilde;', '&Auml;', '&Aring;', '&AElig;', '&Ccedil;', '&Egrave;', '&Eacute;', '&Ecirc;', '&Euml;', '&Igrave;', '&Iacute;', '&Icirc;', '&Iuml;', '&ETH;', '&Ntilde;', '&Ograve;', '&Oacute;', '&Ocirc;', '&Otilde;', '&Ouml;', '&times;', '&Oslash;', '&Ugrave;', '&Uacute;', '&Ucirc;', '&Uuml;', '&Yacute;', '&THORN;', '&szlig;', '&agrave;', '&aacute;', '&acirc;', '&atilde;', '&auml;', '&aring;', '&aelig;', '&ccedil;', '&egrave;', '&eacute;', '&ecirc;', '&euml;', '&igrave;', '&iacute;', '&icirc;', '&iuml;', '&eth;', '&ntilde;', '&ograve;', '&oacute;', '&ocirc;', '&otilde;', '&ouml;', '&divide;', '&oslash;', '&ugrave;', '&uacute;', '&ucirc;', '&uuml;', '&yacute;', '&thorn;', '&yuml;', '&OElig;', '&oelig;', '&#372;', '&#374', '&#373', '&#375;', '&sbquo;', '&#8219;', '&bdquo;', '&hellip;', '&trade;', '&#9658;', '&bull;', '&rarr;', '&rArr;', '&hArr;', '&diams;', '&asymp;','&alpha;','&beta;','&gamma;','&delta;','&epsilon;','&zeta;','&eta;','&theta;','&iota;','&kappa;','&lambda;','&mu;','&nu;','&xi;','&omicron;','&pi;','&rho;','&sigma;','&tau;','&upsilon;','&phi;','&chi;','&psi;','&omega;','&Alpha;','&Beta;','&Gamma;','&Delta;','&Epsilon;','&Zeta;','&Eta;','&Theta;','&Iota;','&Kappa;','&Lambda;','&Mu;','&Nu;','&Xi;','&Omicron;','&Pi;','&Rho;','&Sigma;','&Tau;','&Upsilon;','&Phi;','&Chi;','&Psi;','&Omega;'];
//config.protectedSource.push( /<i[^>]*><\/i>/g );

Expand Down