2205 |
29 Jan 14 |
nicklas |
1 |
/* |
2205 |
29 Jan 14 |
nicklas |
Copyright (C) 2014 Nicklas Nordborg |
2205 |
29 Jan 14 |
nicklas |
3 |
|
2205 |
29 Jan 14 |
nicklas |
This file is part of the Example Code Package for BASE. |
2205 |
29 Jan 14 |
nicklas |
Available at http://baseplugins.thep.lu.se/ |
2205 |
29 Jan 14 |
nicklas |
BASE main site: http://base.thep.lu.se/ |
2205 |
29 Jan 14 |
nicklas |
7 |
|
2205 |
29 Jan 14 |
nicklas |
This is free software; you can redistribute it and/or |
2205 |
29 Jan 14 |
nicklas |
modify it under the terms of the GNU General Public License |
2205 |
29 Jan 14 |
nicklas |
as published by the Free Software Foundation; either version 3 |
2205 |
29 Jan 14 |
nicklas |
of the License, or (at your option) any later version. |
2205 |
29 Jan 14 |
nicklas |
12 |
|
2205 |
29 Jan 14 |
nicklas |
The software is distributed in the hope that it will be useful, |
2205 |
29 Jan 14 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
2205 |
29 Jan 14 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2205 |
29 Jan 14 |
nicklas |
GNU General Public License for more details. |
2205 |
29 Jan 14 |
nicklas |
17 |
|
2205 |
29 Jan 14 |
nicklas |
You should have received a copy of the GNU General Public License |
2205 |
29 Jan 14 |
nicklas |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
2205 |
29 Jan 14 |
nicklas |
20 |
*/ |
2205 |
29 Jan 14 |
nicklas |
var Examples = function() |
2205 |
29 Jan 14 |
nicklas |
22 |
{ |
2205 |
29 Jan 14 |
nicklas |
var examples = {}; |
2205 |
29 Jan 14 |
nicklas |
24 |
|
2205 |
29 Jan 14 |
nicklas |
examples.initPage = function() |
2205 |
29 Jan 14 |
nicklas |
26 |
{ |
2205 |
29 Jan 14 |
nicklas |
var pageId = Doc.getPageId(); |
2205 |
29 Jan 14 |
nicklas |
28 |
|
2205 |
29 Jan 14 |
nicklas |
if (pageId == 'hello-world' || pageId == 'hello-xjsp-world') |
2205 |
29 Jan 14 |
nicklas |
30 |
{ |
2205 |
29 Jan 14 |
nicklas |
Buttons.addClickHandler('close', App.closeWindow); |
2205 |
29 Jan 14 |
nicklas |
32 |
} |
2205 |
29 Jan 14 |
nicklas |
else if (pageId == 'item-info') |
2205 |
29 Jan 14 |
nicklas |
34 |
{ |
2205 |
29 Jan 14 |
nicklas |
Buttons.addClickHandler('close', App.closeWindow); |
2205 |
29 Jan 14 |
nicklas |
36 |
} |
2205 |
29 Jan 14 |
nicklas |
else if (pageId == 'annotation-filter') |
2205 |
29 Jan 14 |
nicklas |
38 |
{ |
2205 |
29 Jan 14 |
nicklas |
Buttons.addClickHandler('close', App.closeWindow); |
2205 |
29 Jan 14 |
nicklas |
Buttons.addClickHandler('btnOk', examples.applyAnnotationFilter); |
2205 |
29 Jan 14 |
nicklas |
41 |
} |
2205 |
29 Jan 14 |
nicklas |
42 |
|
2205 |
29 Jan 14 |
nicklas |
43 |
} |
2205 |
29 Jan 14 |
nicklas |
44 |
|
2205 |
29 Jan 14 |
nicklas |
examples.applyAnnotationFilter = function() |
2205 |
29 Jan 14 |
nicklas |
46 |
{ |
2205 |
29 Jan 14 |
nicklas |
var frm = document.forms['filter']; |
2205 |
29 Jan 14 |
nicklas |
var selected = Forms.getCheckedRadio(frm.what); |
2205 |
29 Jan 14 |
nicklas |
var filterString = selected ? selected.value : ''; |
2205 |
29 Jan 14 |
nicklas |
var filterFrm = window.opener.document.forms[0]; |
2205 |
29 Jan 14 |
nicklas |
window.opener.Forms.addHidden(filterFrm, 'filter:INT:annotationSet', filterString); |
2205 |
29 Jan 14 |
nicklas |
filterFrm.submit(); |
2205 |
29 Jan 14 |
nicklas |
window.close(); |
2205 |
29 Jan 14 |
nicklas |
54 |
} |
2205 |
29 Jan 14 |
nicklas |
55 |
|
2205 |
29 Jan 14 |
nicklas |
return examples; |
2205 |
29 Jan 14 |
nicklas |
57 |
}(); |
2205 |
29 Jan 14 |
nicklas |
58 |
|
2205 |
29 Jan 14 |
nicklas |
Doc.onLoad(Examples.initPage); |