2968 |
21 Nov 14 |
nicklas |
1 |
|
2968 |
21 Nov 14 |
nicklas |
var ServerId = function() |
2968 |
21 Nov 14 |
nicklas |
3 |
{ |
2968 |
21 Nov 14 |
nicklas |
4 |
|
2968 |
21 Nov 14 |
nicklas |
var skin = {}; |
2968 |
21 Nov 14 |
nicklas |
6 |
|
2968 |
21 Nov 14 |
nicklas |
7 |
/** |
2968 |
21 Nov 14 |
nicklas |
Create a <span id="server-id"> and add some text to it. |
2968 |
21 Nov 14 |
nicklas |
Add it as a child to the document body. |
2968 |
21 Nov 14 |
nicklas |
10 |
*/ |
2968 |
21 Nov 14 |
nicklas |
skin.initSkin = function() |
2968 |
21 Nov 14 |
nicklas |
12 |
{ |
2978 |
25 Nov 14 |
nicklas |
var text = Data.get('net.sf.basedb.skincollection.server-id', 'text'); |
2978 |
25 Nov 14 |
nicklas |
if (!text) |
2978 |
25 Nov 14 |
nicklas |
15 |
{ |
2978 |
25 Nov 14 |
nicklas |
var host = location.host; |
2978 |
25 Nov 14 |
nicklas |
var context = App.getRoot().substr(0, App.getRoot().length-1); |
2978 |
25 Nov 14 |
nicklas |
text = '<span class="server-host">'+host+'</span><span class="app-root">'+context+'</span>'; |
2978 |
25 Nov 14 |
nicklas |
19 |
} |
2968 |
21 Nov 14 |
nicklas |
var span = document.createElement('div'); |
2968 |
21 Nov 14 |
nicklas |
span.id = 'server-id'; |
2978 |
25 Nov 14 |
nicklas |
span.innerHTML = text; |
2968 |
21 Nov 14 |
nicklas |
document.body.appendChild(span); |
2968 |
21 Nov 14 |
nicklas |
24 |
} |
2968 |
21 Nov 14 |
nicklas |
25 |
|
2968 |
21 Nov 14 |
nicklas |
return skin; |
2968 |
21 Nov 14 |
nicklas |
27 |
|
2968 |
21 Nov 14 |
nicklas |
28 |
}(); |
2968 |
21 Nov 14 |
nicklas |
29 |
|
2968 |
21 Nov 14 |
nicklas |
Doc.addFinalizer(ServerId.initSkin); |
2968 |
21 Nov 14 |
nicklas |
31 |
|