This file contains 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
myApp.directive("jplayer", ['$window', 'PlayerService', function ($window, PlayerService) { | |
return { | |
restrict: "E", | |
// Have our own scope - we only want to watch the service and not conflict with other scopes | |
scope: {}, | |
// Serve up some html with our player | |
templateUrl: "/jplayer-template.html", | |
link: function (scope, element, attrs) { | |
// An element on the page to attach the jPlayer to. Could also use "element" from linkFN ^ | |
var jPlayer = angular.element("#jquery_jplayer_1").jPlayer(); |
This file contains 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
<div id="jquery_jplayer_1" class="jp-jplayer"></div> | |
<div id="jp_container_1" class="jp-audio" role="application" aria-label="media player"> | |
<div class="jp-type-single"> | |
<div class="jp-gui jp-interface"> | |
<div class="jp-volume-controls"> | |
<button class="jp-mute" role="button" tabindex="0">mute</button> | |
<button class="jp-volume-max" role="button" tabindex="0">max volume</button> | |
<div class="jp-volume-bar"> | |
<div class="jp-volume-bar-value"></div> | |
</div> |
This file contains 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
myApp.service("PlayerService", [function () { | |
this.IsPaused = false; | |
this.CurrentTrack = null; | |
this.Play = function (track) { | |
this.CurrentTrack = track; | |
this.IsPaused = false; | |
}; | |
this.Pause = function () { | |
this.IsPaused = !this.IsPaused; |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<!--<link rel="icon" href="../../favicon.ico">--> |
This file contains 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
// JavaScript source code | |
var uploaderApp = angular.module('uploaderApp', ['ngFileUpload']); | |
uploaderApp.run(); | |
uploaderApp.controller('UploadController', ['$scope', 'Upload', 'S3UploadService', function ($scope, Upload, S3UploadService) { | |
$scope.uploadFiles = function (files) { | |
$scope.Files = files; | |
if (files && files.length > 0) { |
This file contains 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
uploaderApp.service('S3UploadService', ['$q', function ($q) { | |
// Us standard region | |
AWS.config.region = 'us-east-1'; | |
AWS.config.update({ accessKeyId: '**myAccessKeyId**', secretAccessKey: '**mySecretAccessKey**' }); | |
var bucket = new AWS.S3({ params: { Bucket: 'myTempBucket', maxRetries: 10 }, httpOptions: { timeout: 360000 } }); | |
this.Progress = 0; | |
this.Upload = function (file) { | |
var deferred = $q.defer(); |
This file contains 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('Errors', ['jqueryDialog']) | |
.service('ErrorService', ['$templateRequest', 'dialogService', function ($templateRequest, dialogService) { | |
// The template (which references the controller) | |
var templateUrl = "../error-template.html"; | |
// Request the template and do nothing - so it's in the cache in case we lose internet connection later | |
$templateRequest(templateUrl); | |
// Now show the template in a dialog box | |
this.ShowError = function (info) { |
This file contains 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
<div ng-controller="ErrorController"> | |
<div> | |
<span>{{::model.Message}}</span> | |
</div> | |
<div> | |
<div> | |
<input ng-click="Ok()" value="OK" type="button" ok /> | |
</div> | |
</div> | |
</div> |
This file contains 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
// Build the chart with our options | |
var chart = Highcharts.Chart(options); | |
var svg = chart.getSVGForExport(); | |
// Post the svg to our server (using jQuery) | |
$.post("http://myserver.com/api/savesvg", svg, function(result){ | |
}); |
This file contains 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
using Svg; | |
using System.Drawing; | |
using System.Drawing.Imaging; | |
using System.IO; | |
namespace SvgRenderer | |
{ | |
public class Renderer | |
{ | |
public void Render(string svg) |
OlderNewer