This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/* | |
Usage: <wysiwyg textarea-id="question" textarea-class="form-control" textarea-height="80px" textarea-name="textareaQuestion" textarea-required ng-model="question.question" enable-bootstrap-title="true"></wysiwyg> | |
options | |
textarea-id The id to assign to the editable div | |
textarea-class The class(es) to assign to the the editable div | |
textarea-height If not specified in a text-area class then the hight of the editable div (default: 80px) | |
textarea-name The name attribute of the editable div | |
textarea-required HTML/AngularJS required validation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div> | |
<i id="spinner" class="fa fa-2x fa-spin fa-smile-o"></i> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function heartbeatInit(properties) { | |
console.log('HeartbeatService.init.heartbeatInit: Sending initial heartbeat to ALF server @ ' + properties.alfServer + ':' + properties.alfServerPort + properties.PATH_TO_ALF_HEARTBEAT_SERVICE + ' for host "' + hostName + '"...'); | |
// Setup the data that's going to be sent to the ALF server on agent init | |
var initData = { | |
agentName: properties.agentName, | |
hostName: hostName, | |
port: properties.port, | |
services: properties.services |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var base = __dirname; | |
http.createServer (function(req, res){ | |
pathname = base + req.url; | |
console.log(pathname); | |
path.exists(pathname, function(exists){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.post(new RegExp(routePatterns.post), function(request, response) { | |
var service = request.params[0]; | |
console.log('ServicesController: Received request to create new ' + service + ' instance /w request=' + request + '...'); | |
// Validate the request | |
if (!validate(request)){ | |
return errorResponse(response, 'Missing or invalid query parameters'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routePatterns: function(){ | |
var services = alfAgent.properties.services; | |
var s = []; | |
for(var i=0; i < services.length; i++){ | |
s.push(services[i].name.toLowerCase()); | |
} | |
return routePatterns = { | |
post: "^\/(" + s.join("|") + ")$", | |
delete: "^\/(" + s.join("|") + ")\/(.+)$" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var executeCommand = function(obj){ | |
exec(obj.cmd, function(err, stdout, stderr){ | |
var data = { | |
error: err, | |
stdout:stdout, | |
stderr: stderr | |
} | |
if (!writeToLog(obj.projectName, obj.service, data)){ | |
errorResponse(response, 'Unable to write to log directory, check permissions') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var writeToLog = function(project, service, data){ | |
var date = new Date(); | |
var directory = properties.baseDir + '/logs'; | |
fs.exists(directory, function (exists) { | |
if (!exists){ | |
fs.mkdirSync(directory); | |
} | |
for (var key in data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('azure-mobile-service.module', []) | |
.service('Azureservice', function Azureservice() { | |
return { | |
}; | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.aspnetcdn.com/ajax/mobileservices/MobileServices.Web-1.1.3.min.js"></script> |