[Pages] Move page plugin into platform
Move Page plugin from prototype location into platform, WTD-1145.
This commit is contained in:
33
platform/features/pages/bundle.json
Normal file
33
platform/features/pages/bundle.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"extensions": {
|
||||
"types": [
|
||||
{
|
||||
"key": "example.page",
|
||||
"name": "Page",
|
||||
"features": [ "creation" ],
|
||||
"properties": [
|
||||
{
|
||||
"key": "url",
|
||||
"name": "URL",
|
||||
"control": "textfield"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"views": [
|
||||
{
|
||||
"templateUrl": "iframe.html",
|
||||
"name": "Page",
|
||||
"type": "example.page",
|
||||
"key": "example.page"
|
||||
}
|
||||
],
|
||||
"controllers": [
|
||||
{
|
||||
"key": "IFrameController",
|
||||
"implementation": "IFrameController.js",
|
||||
"depends": ["$sce"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
4
platform/features/pages/res/iframe.html
Normal file
4
platform/features/pages/res/iframe.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<iframe ng-controller="IFrameController as ctl"
|
||||
style="width: 100%; height: 100%;"
|
||||
ng-src="{{ctl.trust(model.url)}}">
|
||||
</iframe>
|
||||
19
platform/features/pages/src/IFrameController.js
Normal file
19
platform/features/pages/src/IFrameController.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
function Controller($sce) {
|
||||
return {
|
||||
trust: function (url) {
|
||||
return $sce.trustAsResourceUrl(url);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return Controller;
|
||||
}
|
||||
|
||||
);
|
||||
Reference in New Issue
Block a user