Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Kick off a completion handler for fabric, need to track down a list o…
…f possible/typical URL handlers
  • Loading branch information
gashcrumb committed Jul 31, 2013
1 parent 355e873 commit f8c3b34
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion hawtio-web/src/main/webapp/app/fabric/html/profile.html
Expand Up @@ -136,7 +136,7 @@ <h2 style="display: inline;">/ <a ng-href="#/fabric/view?cv={{versionId}}&sp={{r
</div>


<div hawtio-confirm-dialog="deleteThingDialog" ok-button-text="delete" on-ok="doDeleteThing()">
<div hawtio-confirm-dialog="deleteThingDialog" ok-button-text="Delete" on-ok="doDeleteThing()">
<div class="dialog-body">
<p>Delete {{currentThingItem}}?</p>
</div>
Expand Down
15 changes: 14 additions & 1 deletion hawtio-web/src/main/webapp/app/fabric/html/test.html
Expand Up @@ -2,12 +2,25 @@

<div class="row-fluid">
<div class="span3">
<p>Maven completion</p>
<p>Model: {{someUri}}</p>
<p>uriParts</p>
<ol>
<li ng-repeat="part in uriParts">{{part}}</li>
</ol>
<input class="input-xlarge" type="text" ng-model="someUri" typeahead="name for name in doCompletion($viewValue) | filter:$viewValue" typeahead-min-length="3" typeahead-on-select="onSelectCallback($item, $model, $label)">
<input class="input-xlarge" type="text" ng-model="someUri" typeahead="name for name in doCompletionMaven($viewValue) | filter:$viewValue" typeahead-wait-ms="200">
</div>
<div class="span1">

</div>
<div class="span3">
<p>Fabric completion</p>
<p>Model: {{someUri2}}</p>
<p>uriParts</p>
<ol>
<li ng-repeat="part in uriParts2">{{part}}</li>
</ol>
<input class="input-xlarge" type="text" ng-model="someUri2" typeahead="name for name in doCompletionFabric($viewValue) | filter:$viewValue" typeahead-wait-ms="200">
</div>
</div>

Expand Down
6 changes: 6 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/js/helpers.ts
Expand Up @@ -57,6 +57,12 @@ module Fabric {
});
}

export var urlResolvers = ['http:', 'ftp:', 'mvn:'];

export function completeUri ($q, $scope, workspace, jolokia, something) {


}

export function applyPatches(jolokia, files, targetVersion, newVersionName, proxyUser, proxyPass, success, error) {
doAction('applyPatches(java.util.List,java.lang.String,java.lang.String,java.lang.String,java.lang.String)', jolokia, [files, targetVersion, newVersionName, proxyUser, proxyPass], success, error);
Expand Down
14 changes: 5 additions & 9 deletions hawtio-web/src/main/webapp/app/fabric/js/test.ts
@@ -1,5 +1,6 @@
module Fabric {


export function TestController($scope, jolokia, $q, workspace) {

$scope.mavenMBean = Maven.getMavenIndexerMBean(workspace);
Expand Down Expand Up @@ -41,9 +42,6 @@ module Fabric {

$scope.$watch('uriParts', (newValue, oldValue) => {
if (newValue !== oldValue) {
console.log("oldValue: ", oldValue);
console.log("newValue: ", newValue);

if (newValue.length === 1 && newValue.length < oldValue.length) {
if (oldValue.last() !== '' && newValue.first().has(oldValue.last())) {
var merged = oldValue.first(oldValue.length - 1).include(newValue.first());
Expand All @@ -53,14 +51,12 @@ module Fabric {
}
}, true);

$scope.onSelectCallback = ($item, $model, $label) => {
//$scope.uriParts.push($model);
//$scope.someUri = $scope.uriParts.join("/");
//console.log('item=', $item, 'model=', $model, 'label=', $label);
$scope.doCompletionMaven = (something) => {
return Maven.completeMavenUri($q, $scope, workspace, jolokia, something);
}

$scope.doCompletion = (something) => {
return Maven.completeMavenUri($q, $scope, workspace, jolokia, something);
$scope.doCompletionFabric = (something) => {
return Fabric.completeUri($q, $scope, workspace, jolokia, something);
}


Expand Down

0 comments on commit f8c3b34

Please sign in to comment.