I'm a little confused on what the correct structure is for extensions.
Specifically, I have an extension that was mostly just adding a theme, but
now I was like to add an additional button to the side menu.
I have the following guac-manifest.json
{
"guacamoleVersion" : "0.9.12-incubating",
"name" : "New Menu",
"namespace" : "new-menu-extension",
"translations" : [
"translations/en.json"
],
"html" : [ "resources/templates/button.html" ]
}
I can add successfully add button by including a new html file, called
button.html, with this contents:
<meta name="after" content=".menu-body">
<button ng-click="postSomething()">
Click to POST
</button>
The postSomething() function is contained in newButtonController.js file as
follows:
angular.module('guacNewButton',
["ngResource"]).controller('guacnewButtonController',['$scope', '$resource',
function($scope, $resource)
{
$scope.postSomething = function() {
console.log("got here");
$http.post("/url/here", data).success(function(data, status) {
})
}
}]);
I have also added the module as in a newButtonModule.js file as follows:
angular.module('guacNewButton', []);
angular.module('index').requires.push('guacNewButton');
My current file structure is:
- project folder
|___ guac-manifest.json
|___ newButtonModule.js
|___Resources
|___ controllers
|___ guacnewButtonController.js
|___ templates
|___ button.html
Currently the button does not do anything at all. What is the correct way to
include functionality like this? I looked at the extensions on github, but I
don't quite understand how to tell guac to register the new angular module.
--
View this message in context:
http://apache-guacamole-incubating-users.2363388.n4.nabble.com/Writing-extensions-tp1332.html
Sent from the Apache Guacamole (incubating) - Users mailing list archive at
Nabble.com.