-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get angularjs ui extensions fully working
- Loading branch information
Showing
11 changed files
with
179 additions
and
35 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use strict"; | ||
|
||
(function() { | ||
angular | ||
.module("firebotApp") | ||
.controller("extensionPageController", function($scope, $routeParams, uiExtensionsService) { | ||
$scope.page = uiExtensionsService.getPage($routeParams.extensionId, $routeParams.pageId); | ||
}); | ||
}()); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"use strict"; | ||
(function() { | ||
angular | ||
.module("firebotApp") | ||
.directive("extensionPageContent", function($compile) { | ||
return { | ||
restrict: "E", | ||
scope: { | ||
page: "=" | ||
}, | ||
replace: true, | ||
template: `<div></div>`, | ||
compile: function() { | ||
return { | ||
pre: function($scope, element) { | ||
const page = $scope.page; | ||
|
||
if (page == null) { | ||
return; | ||
} | ||
|
||
const templateString = page.template || ""; | ||
const el = angular.element(templateString); | ||
|
||
const compiledTemplate = $compile(el)($scope); | ||
|
||
element.replaceWith(compiledTemplate); | ||
} | ||
}; | ||
}, | ||
controller: ($scope, $injector) => { | ||
if ($scope.page?.controller) { | ||
$injector.invoke($scope.page.controller, {}, { $scope: $scope }); | ||
} | ||
} | ||
}; | ||
}); | ||
}()); |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<extension-page-content ng-if="page && page.type === 'angularjs'" page="page"></extension-page-content> | ||
|
||
<!-- Below line is just an example, actual iframe implementation TBD --> | ||
<!-- <iframe ng-if="page && page.type === 'iframe'" ng-src="{{page.url}}" frameborder="0" width="100%" height="100%"></iframe> --> |