<commit_before>/*============================================================================*\

	JavaScript for Clever Video
	-----------------------------------------------------------------------
	© 2015 by Carroket, Inc.
	http://www.carroket.com/
	-----------------------------------------------------------------------
	Made by <NAME>.
	http://www.briansexton.com/

 \*============================================================================*/


(function(document, angular, options) {

	var cleverVideo = new CleverVideo();

	function CleverVideo() {

		// TO DO: Consider whether any options should be addressed here.
	}

	// Let's keep our HTML5 valid. OR DIE TRYING.

	if (document.registerElement) {

		document.registerElement("clever-video");
	}

	// Create an AngularJS module.

	angular.module("cleverVideoModule", [])

		// Now let's paint a happy little directive.

		.directive("cleverVideo", function() {

			return {

				restrict: "EA",

				scope: {

					service: "@service",
					videoId: "@videoId",
					width: "@width",
					height: "@height",
					border: "@border",
					allowFullScreen: "@allowFullScreen"
				},

				// Note: templateUrl seems to be relative to the element
				// context. Yuck.

				// Also Note: The following path does not currently exist
				// anywhere in the library project.

				// TO DO: Try to make this more flexible without resorting to an absolute path, which could be problematic for non-root site deployment.
				templateUrl: "_assets/modules/clever-video/video.html",

				replace: true,

				controller: function() {

					console.log("Hello from the clever-video directive controller!");
				},

				compile: function(element, attrs) {

					if (!attrs.width) { attrs.width = 640; }

					if (!attrs.height) { attrs.height = 360; }

					if (!attrs.border) { attrs.border = 0; }<commit_msg>Add a template and a controller and add ngSanitize as a dependency.<commit_after>/*============================================================================*\

	JavaScript for Clever Video
	-----------------------------------------------------------------------
	© 2015 by Carroket, Inc.
	http://www.carroket.com/
	-----------------------------------------------------------------------
	Made by <NAME>.
	http://www.briansexton.com/

 \*============================================================================*/


(function(document, angular, options) {

	var cleverVideo = new CleverVideo();

	function CleverVideo() {

		// TO DO: Consider whether any options should be addressed here.
	}

	// Let's keep our HTML5 valid. OR DIE TRYING.

	if (document.registerElement) {

		document.registerElement("clever-video");
	}

	// Create an AngularJS module.

	angular.module("cleverVideoModule", ["ngSanitize"])

		// Now let's paint a happy little directive.

		.directive("cleverVideo", function() {

			return {

				restrict: "EA",

				scope: {

					service: "@service",
					videoId: "@videoId",
					width: "@width",
					height: "@height",
					border: "@border",
					allowFullScreen: "@allowFullScreen"
				},

				// Note: templateUrl seems to be relative to the element
				// context. Yuck.

				// Also Note: The following path does not currently exist
				// anywhere in the library project.

				// TO DO: Try to make this more flexible without resorting to an absolute path, which could be problematic for non-root site deployment.
				//templateUrl: "_assets/modules/clever-video/video.html",

				template: '<iframe width="{{width}}" height="{{height}}" src="{{srcUrl}}" frameborder="0" allowfullscreen></iframe>',

				replace: true,

				controller: function($scope, $sce) {

					console.log("Hello from the clever-video directive controller!");

					$scope.srcUrl = "";

					if ($scope.service == "YouTube") {

						$scope.srcUrl = $sce.trustAsResourceUrl("https://www.youtube.com/embed/" + $scope.videoId);

						console.log("srcUrl: " + $scope.srcUrl);
					}
				},

				compile: function(element, attrs) {

					if (!attrs.width) { attrs.width = 640; }

					if (!attrs.height) { attrs.height = 360; }

					if (!attrs.border) { attrs.border = 0; }
{'fraction_non_alphanumeric': 0.26001931434089814, 'fraction_numerical': 0.006035731530661516, 'mean_word_length': 2.513994910941476, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4462395', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1071, 'n_words': 327}