GUI -- Starting migration of topology view to the updated framework. WIP.

This commit is contained in:
Simon Hunt 2014-11-04 20:13:09 -08:00
parent af92d1277e
commit 142d003abf
5 changed files with 1298 additions and 1115 deletions

View File

@ -70,6 +70,7 @@
<script type="text/javascript"> <script type="text/javascript">
var ONOS = $.onos({ var ONOS = $.onos({
comment: "configuration options", comment: "configuration options",
startVid: 'topo',
trace: false trace: false
}); });
</script> </script>
@ -77,12 +78,15 @@
<!-- Framework module files included here --> <!-- Framework module files included here -->
<script src="mast2.js"></script> <script src="mast2.js"></script>
<!-- Contributed (application) views injected here --> <!-- Sample views; can be dispensed with eventually -->
<!-- TODO: replace with template marker and inject refs server-side -->
<script src="sample2.js"></script> <script src="sample2.js"></script>
<script src="sampleAlt2.js"></script> <script src="sampleAlt2.js"></script>
<script src="sampleRadio.js"></script> <script src="sampleRadio.js"></script>
<!-- Contributed (application) views injected here -->
<!-- TODO: replace with template marker and inject refs server-side -->
<script src="topo2.js"></script>
<!-- finally, build the UI--> <!-- finally, build the UI-->
<script type="text/javascript"> <script type="text/javascript">
$(ONOS.buildUi); $(ONOS.buildUi);

View File

@ -25,7 +25,7 @@
var tsI = new Date().getTime(), // initialize time stamp var tsI = new Date().getTime(), // initialize time stamp
tsB, // build time stamp tsB, // build time stamp
mastHeight = 36, // see mast2.css mastHeight = 36, // see mast2.css
defaultHash = 'sample'; defaultVid = 'sample';
// attach our main function to the jQuery object // attach our main function to the jQuery object
@ -35,7 +35,8 @@
navApi; navApi;
var defaultOptions = { var defaultOptions = {
trace: false trace: false,
startVid: defaultVid
}; };
// compute runtime settings // compute runtime settings
@ -91,7 +92,7 @@
traceFn('hash', hash); traceFn('hash', hash);
if (!hash) { if (!hash) {
hash = defaultHash; hash = settings.startVid;
redo = true; redo = true;
} }
@ -336,10 +337,6 @@
} }
var viewInstanceMethods = { var viewInstanceMethods = {
toString: function () {
return '[View: id="' + this.vid + '"]';
},
token: function () { token: function () {
return { return {
// attributes // attributes
@ -350,6 +347,7 @@
// functions // functions
width: this.width, width: this.width,
height: this.height, height: this.height,
uid: this.uid,
setRadio: this.setRadio setRadio: this.setRadio
} }
}, },
@ -433,6 +431,10 @@
setRadio: function (btnSet, cb) { setRadio: function (btnSet, cb) {
setRadioButtons(this.vid, btnSet, cb); setRadioButtons(this.vid, btnSet, cb);
},
uid: function (id) {
return uid(this, id);
} }
// TODO: consider schedule, clearTimer, etc. // TODO: consider schedule, clearTimer, etc.

File diff suppressed because it is too large Load Diff

View File

@ -20,3 +20,7 @@
@author Simon Hunt @author Simon Hunt
*/ */
svg #topo-bg {
opacity: 0.5;
}

File diff suppressed because it is too large Load Diff