Skip to content

Instantly share code, notes, and snippets.

@manuelkiessling
Created March 17, 2011 13:05
Show Gist options
  • Save manuelkiessling/874280 to your computer and use it in GitHub Desktop.
Save manuelkiessling/874280 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<link href="css/default.css"
rel="stylesheet"
type="text/css"
media="screen, projection" />
<script src="js/angular-0.9.12.min.js" ng:autobind></script>
<script>
ChangesetsController.$inject = ['$resource'];
function ChangesetsController($resource) {
this.ChangesetsResource = $resource(
'/changesets.json',
{ callback: 'JSON_CALLBACK', limit: '20' },
{ get: { method: 'JSON' } }
);
}
ChangesetsController.prototype = {
fetchWithMessageContaining: function() {
document.getElementById('spinningwheel').style.visibility = 'visible';
this.result = this.ChangesetsResource.get({ with_message_containing: this.messagePart });
document.getElementById('spinningwheel').style.visibility = 'hidden';
},
fetchWithPathEndingOn: function() {
this.result = this.ChangesetsResource.get({ with_path_ending_on: this.pathEnd });
}
};
</script>
</head>
<body>
<div ng:controller="ChangesetsController">
<div class="searchform">
<div class="message">
Show changesets with message containing:
<input name="messagePart" value="css-bugs"/>
<button ng:click="fetchWithMessageContaining()">Find</button>
</div>
<div class="path">
Show changesets with at least one path ending on:
<input name="pathEnd" value="index.php"/>
<button ng:click="fetchWithPathEndingOn()">Find</button>
</div>
</div>
<div id="spinningwheel">
<img src="images/spinningwheel.gif" width="18" height="18" />
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment