GUI -- Start of implementation of Panel Service.
Change-Id: I2729acc88c7130172587856f1af80ca0d66e4c5b
Showing
5 changed files
with
137 additions
and
0 deletions
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | + | ||
| 17 | +/* | ||
| 18 | + ONOS GUI -- Layers Module | ||
| 19 | + */ | ||
| 20 | +(function () { | ||
| 21 | + 'use strict'; | ||
| 22 | + | ||
| 23 | + angular.module('onosLayer', ['onosUtil']); | ||
| 24 | + | ||
| 25 | +}()); |
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | + | ||
| 17 | +/* | ||
| 18 | + ONOS GUI -- Layer -- Panel Service | ||
| 19 | + */ | ||
| 20 | +(function () { | ||
| 21 | + 'use strict'; | ||
| 22 | + | ||
| 23 | + var $log; | ||
| 24 | + | ||
| 25 | + var defaultSettings = { | ||
| 26 | + position: 'TR', | ||
| 27 | + side: 'right', | ||
| 28 | + width: 200 | ||
| 29 | + }; | ||
| 30 | + | ||
| 31 | + angular.module('onosLayer') | ||
| 32 | + .factory('PanelService', ['$log', function (_$log_) { | ||
| 33 | + $log = _$log_; | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + function createPanel(opts) { | ||
| 37 | + var settings = angular.extend({}, defaultSettings, opts); | ||
| 38 | + | ||
| 39 | + function renderPanel() { | ||
| 40 | + | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + function showPanel() { | ||
| 44 | + | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + function hidePanel() { | ||
| 48 | + | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + var api = { | ||
| 52 | + render: renderPanel, | ||
| 53 | + show: showPanel, | ||
| 54 | + hide: hidePanel | ||
| 55 | + }; | ||
| 56 | + | ||
| 57 | + $log.debug('creating panel with settings: ', settings); | ||
| 58 | + return api; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + return { | ||
| 62 | + createPanel: createPanel | ||
| 63 | + }; | ||
| 64 | + }]); | ||
| 65 | + | ||
| 66 | +}()); |
| ... | @@ -57,6 +57,9 @@ | ... | @@ -57,6 +57,9 @@ |
| 57 | <script src="fw/widget/widget.js"></script> | 57 | <script src="fw/widget/widget.js"></script> |
| 58 | <script src="fw/widget/table.js"></script> | 58 | <script src="fw/widget/table.js"></script> |
| 59 | 59 | ||
| 60 | + <script src="fw/layer/layer.js"></script> | ||
| 61 | + <script src="fw/layer/panel.js"></script> | ||
| 62 | + | ||
| 60 | <!-- Framework and library stylesheets included here --> | 63 | <!-- Framework and library stylesheets included here --> |
| 61 | <!-- TODO: use a single catenated-minified file here --> | 64 | <!-- TODO: use a single catenated-minified file here --> |
| 62 | <link rel="stylesheet" href="onos.css"> | 65 | <link rel="stylesheet" href="onos.css"> | ... | ... |
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | + | ||
| 17 | +/* | ||
| 18 | + ONOS GUI -- Layer -- Panel Service - Unit Tests | ||
| 19 | + */ | ||
| 20 | +describe('factory: fw/layer/panel.js', function () { | ||
| 21 | + var $log, fs, ps; | ||
| 22 | + | ||
| 23 | + beforeEach(module('onosLayer')); | ||
| 24 | + | ||
| 25 | + beforeEach(inject(function (_$log_, FnService, PanelService) { | ||
| 26 | + $log = _$log_; | ||
| 27 | + fs = FnService; | ||
| 28 | + ps = PanelService; | ||
| 29 | + })); | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + it('should define PanelService', function () { | ||
| 33 | + expect(ps).toBeDefined(); | ||
| 34 | + }); | ||
| 35 | + | ||
| 36 | + it('should define api functions', function () { | ||
| 37 | + expect(fs.areFunctions(ps, [ | ||
| 38 | + 'createPanel' | ||
| 39 | + ])).toBeTruthy(); | ||
| 40 | + }); | ||
| 41 | + | ||
| 42 | +}); |
| ... | @@ -30,6 +30,7 @@ module.exports = function(config) { | ... | @@ -30,6 +30,7 @@ module.exports = function(config) { |
| 30 | '../app/fw/svg/svg.js', | 30 | '../app/fw/svg/svg.js', |
| 31 | '../app/fw/remote/remote.js', | 31 | '../app/fw/remote/remote.js', |
| 32 | '../app/fw/widget/widget.js', | 32 | '../app/fw/widget/widget.js', |
| 33 | + '../app/fw/layer/layer.js', | ||
| 33 | // now load services etc. that augment the modules | 34 | // now load services etc. that augment the modules |
| 34 | '../app/**/*.js', | 35 | '../app/**/*.js', |
| 35 | 36 | ... | ... |
-
Please register or login to post a comment