Commit fb21d874 authored by Xavier Guimard's avatar Xavier Guimard

More elegant menu

parent 7dcc6408
......@@ -18,7 +18,7 @@ Form files must contain only HTML that will be included in the manager DOM
*(in `#form` div)*. It **must** consist of two blocks:
* a `<div class="panel panel-default">` div that contains the form,
* a `<script type="text/javascript">` script that defines which item to display
* a `<script type="text/menu">` script that defines which item to display
in context menu.
Basic example:
......@@ -34,10 +34,10 @@ Basic example:
</div>
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "cancel"
}];
}]
</script>
## 2. Form main div
......@@ -86,14 +86,14 @@ of the file:
Empty context menu:
<script type="text/javascript">
buttons=[];
<script type="text/menu">
[]
</script>
Else:
<script type="text/javascript">
buttons=[
<script type="text/menu">
[
{<menu item1>},
{<menu item2>},
{<menu item3>}
......@@ -106,8 +106,8 @@ Else:
Menu item is a javascript object with at least the key `title`.
<script type="text/javascript">
buttons=[
<script type="text/menu">
[
{ "title": "cancel" }
]
</script>
......@@ -122,8 +122,8 @@ access to controller properties and methods.
You can have sub items simply using `buttons` key which must then be an array
of menu items.
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "textToTranslate",
"buttons": [
{ "title": "cancel" },
......@@ -134,8 +134,8 @@ of menu items.
#### 3.1.3. Specify function to use
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addVirtualHost",
"action": "addVhost"
}]
......@@ -145,8 +145,8 @@ Same as below except that it will launch `$scope.addVhost()`.
#### 3.1.4. Custom function
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addVirtualHost",
"action": function(currentNode,currentScope){
doSomethingWith(currentNode);
......@@ -168,8 +168,8 @@ You can access to the parent using this:
#### 3.1.5 Icons
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addVirtualHost",
"action": "addVhost",
"icon": "plus-sign",
......
......@@ -31,8 +31,8 @@
</div>
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "newRSAKey",
"icon": "plus-sign"
},{
......@@ -41,5 +41,5 @@ buttons=[{
"action": function(cs,scope) {
scope.saveAs(cs.data[0].data+"\n"+cs.data[2].data,'application/x-pem-file',cs.title+'.pem');
}
}];
}]
</script>
......@@ -27,8 +27,8 @@
</div>
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "newRSAKey",
"action": "newRSAKeyNoPassword",
"icon": "plus-sign"
......@@ -38,5 +38,5 @@ buttons=[{
"action": function(cs,scope) {
scope.saveAs(cs.data[0].data+"\n"+cs.data[2].data,'application/x-pem-file',cs.title+'.pem');
}
}];
}]
</script>
......@@ -27,13 +27,13 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'action': 'newAuthChoice',
'title': 'newChain',
'icon': 'plus-sign'
},{
'title': 'deleteEntry',
'icon': 'minus-sign'
}];
}]
</script>
......@@ -29,10 +29,10 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'action': 'newAuthChoice',
'title': 'newChain',
'icon': 'plus-sign'
}];
}]
</script>
......@@ -15,7 +15,6 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[
];
<script type="text/menu">
[]
</script>
......@@ -9,9 +9,9 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "cancel",
"icon": "remove"
}];
}]
</script>
......@@ -12,7 +12,7 @@
</tr>
</tbody>
</table>
<script type="text/javascript">
buttons=[
];
<script type="text/menu">
[
]
</script>
......@@ -19,7 +19,6 @@
<input id="bwlist" class="form-control" ng-model="currentNode.data[1]"/>
</div>
</div>
<script type="text/javascript">
buttons=[
];
<script type="text/menu">
[]
</script>
......@@ -15,9 +15,9 @@
</div>
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "cancel",
"icon": "remove"
}];
}]
</script>
......@@ -22,9 +22,9 @@
<textarea id="bopeValue" class="form-control" rows="2" ng-model="currentNode.data"/>
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "cancel",
"icon": "remove"
}];
}]
</script>
......@@ -12,9 +12,9 @@
</ul>
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "newCat",
"icon": "plus-sign"
}];
}]
</script>
......@@ -20,8 +20,8 @@
</div>
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "cancel",
"icon": "remove"
},{
......@@ -30,5 +30,5 @@ buttons=[{
"action": function(cs,scope) {
scope.saveAs(cs.data,'text/plain',cs.title+'.txt');
}
}];
}]
</script>
......@@ -18,12 +18,12 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'title': 'newGrantRule',
'icon': 'plus-sign'
},{
'title': 'deleteEntry',
'icon': 'minus-sign'
}];
}]
</script>
......@@ -30,9 +30,9 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'title': 'newGrantRule',
'icon': 'plus-sign'
}];
}]
</script>
......@@ -30,13 +30,13 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "downloadIt",
"action": function(c,$scope){window.open($scope.confPrefix+$scope.currentCfg.cfgNum+'?full');},
"icon": "export"
},{
"title": "restore",
"icon": "import"
}];
}]
</script>
......@@ -9,9 +9,9 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "cancel",
"icon": "remove"
}];
}]
</script>
......@@ -13,13 +13,13 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'title': 'newEntry',
'action': 'newHashEntry',
'icon': 'plus-sign'
},{
'title': 'deleteEntry',
'icon': 'minus-sign'
}];
}]
</script>
......@@ -22,10 +22,10 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'title': 'newEntry',
'action': 'newHashEntry',
'icon': 'plus-sign'
}];
}]
</script>
......@@ -9,9 +9,9 @@
</div>
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "cancel",
"icon": "remove"
}];
}]
</script>
......@@ -86,8 +86,8 @@
<button class="btn btn-danger" ng-click="cancel()"><i class="glyphicon glyphicon-remove"></i> <span trspan="cancel"></span></button>
</div>
</script>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "up",
"icon": "arrow-up"
},{
......@@ -99,5 +99,5 @@ buttons=[{
},{
"title": "newApp",
"icon": "plus-sign"
}];
}]
</script>
......@@ -21,8 +21,8 @@
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "up",
"icon": "arrow-up"
},{
......@@ -37,5 +37,5 @@ buttons=[{
},{
"title": "newApp",
"icon": "plus-sign"
}];
}]
</script>
......@@ -3,7 +3,6 @@
<h3 class="panel-title">{{translateTitle(currentNode)}}</h3>
</div>
</div>
<script type="text/javascript">
buttons=[
];
<script type="text/menu">
[]
</script>
......@@ -10,12 +10,12 @@
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addOidcOp",
"icon": "plus-sign"
},{
"title": "deleteEntry",
"icon": "minus-sign"
}];
}]
</script>
......@@ -17,9 +17,9 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addOidcOp",
"icon": "plus-sign"
}];
}]
</script>
......@@ -10,12 +10,12 @@
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addOidcRp",
"icon": "plus-sign"
},{
"title": "deleteEntry",
"icon": "minus-sign"
}];
}]
</script>
......@@ -17,9 +17,9 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addOidcRp",
"icon": "plus-sign"
}];
}]
</script>
......@@ -14,9 +14,9 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "cancel",
"icon": "remove"
}];
}]
</script>
......@@ -57,9 +57,9 @@
<button class="btn btn-danger" ng-click="cancel()"><i class="glyphicon glyphicon-remove"></i> <span trspan="cancel"></span></button>
</div>
</script>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "cancel",
"icon": "remove"
}];
}]
</script>
......@@ -11,9 +11,9 @@
</div>
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "cancel",
"icon": "remove"
}];
}]
</script>
......@@ -32,8 +32,8 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'title': 'newPost',
'icon': 'plus-sign'
},{
......@@ -42,5 +42,5 @@ buttons=[{
},{
'title': 'deleteEntry',
'icon': 'minus-sign'
}];
}]
</script>
......@@ -37,10 +37,10 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'title': 'newPost',
'icon': 'plus-sign'
}];
}]
</script>
......@@ -11,7 +11,6 @@
<tr>
</table>
</div>
<script type="text/javascript">
buttons=[
];
<script type="text/menu">
[]
</script>
......@@ -19,12 +19,12 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'title': 'newRule',
'icon': 'plus-sign'
},{
'title': 'deleteEntry',
'icon': 'minus-sign'
}];
}]
</script>
......@@ -36,9 +36,9 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'title': 'newRule',
'icon': 'plus-sign'
}];
}]
</script>
......@@ -42,7 +42,6 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[
];
<script type="text/menu">
[]
</script>
......@@ -48,12 +48,12 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'title': 'deleteEntry',
'icon': 'minus-sign'
},{
'title': 'addSamlAttribute',
'icon': 'plus-sign'
}];
}]
</script>
......@@ -49,9 +49,9 @@
</div>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
'title': 'addSamlAttribute',
'icon': 'plus-sign'
}];
}]
</script>
......@@ -9,13 +9,13 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addIDPSamlPartner",
"action": "addSamlIDP",
"icon": "plus-sign"
}, {
"title": "deleteEntry",
"icon": "plus-sign"
}];
}]
</script>
......@@ -17,10 +17,10 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addIDPSamlPartner",
"action": "addSamlIDP",
"icon": "plus-sign"
}];
}]
</script>
......@@ -9,13 +9,13 @@
</tr>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addSPSamlPartner",
"action": "addSamlSP",
"icon": "plus-sign"
},{
"title": "deleteEntry",
"icon": "minus-sign"
}];
}]
</script>
......@@ -17,10 +17,10 @@
</tbody>
</table>
</div>
<script type="text/javascript">
buttons=[{
<script type="text/menu">
[{
"title": "addSPSamlPartner",
"action": "addSamlSP",
"icon": "plus-sign"
}];
}]
</script>