Skip to content

Commit

Permalink
fixed an issue with the protected users page and re-added cfx firefox…
Browse files Browse the repository at this point in the history
… addon creation since jpm is not until FF38.
  • Loading branch information
ceceradio committed Apr 16, 2015
1 parent a68df08 commit 6efaf68
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
17 changes: 15 additions & 2 deletions Gruntfile.js
Expand Up @@ -14,7 +14,16 @@ module.exports = function(grunt) {
jpm: {
options: {
src: "./firefox/",
xpi: "./tmp/"
xpi: "./tmp/gte38/"
}
},
"mozilla-cfx-xpi": {
'stable': {
options: {
"mozilla-addon-sdk": "latest",
extension_dir: "firefox",
dist_dir: "tmp/lte37/"
}
}
},
copy: {
Expand All @@ -23,6 +32,7 @@ module.exports = function(grunt) {
// includes files within path
{expand: true, src: ['js/*'], dest: 'firefox/data/', filter: 'isFile'},
{expand: true, src: ['css/*'], dest: 'firefox/data/', filter: 'isFile'},
{expand: true, src: ['bower_components/bootstrap/dist/fonts/*'], dest: 'firefox/data/', filter: 'isFile'},
{src: 'options.html', dest: 'firefox/data/options.html'},
{src: 'package.json', dest: 'firefox/package.json'},
{expand: true, src: ['partial_*.html'], dest: 'firefox/data/', filter: 'isFile'},
Expand Down Expand Up @@ -71,17 +81,20 @@ module.exports = function(grunt) {
},
curl: {
'firefox/data/bower_components/jquery/dist/jquery.min.js': 'http://code.jquery.com/jquery-2.1.3.min.js',
'firefox/data/bower_components/angular/angular.min.js': 'https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js',
'firefox/data/bower_components/angular-route/angular-route.min.js': 'https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-route.min.js',
}
});

grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-jpm');
grunt.loadNpmTasks('grunt-mozilla-addon-sdk');
grunt.loadNpmTasks('grunt-curl');

// Default task(s).
grunt.registerTask('default', ['compress']);
grunt.registerTask('test-firefox', ['copy','jpm:run']);
grunt.registerTask('build-firefox', ['copy','curl','jpm:xpi']);
grunt.registerTask('build-firefox', ['copy','curl','jpm:xpi','mozilla-cfx-xpi:stable']);
grunt.registerTask('build-chrome', ['compress:main']);
};
7 changes: 3 additions & 4 deletions js/options.js
Expand Up @@ -43,13 +43,12 @@ optionsApp.controller('ProtectedController', ['StorageService', '$scope', functi
$scope.should.refreshTable = false;

StorageService.getSync("protectedUsers",function(items) {
var dataset=[];
$scope.protectedUsers=[];
for(var username in items.protectedUsers) {
var receipt = items.protectedUsers[username];
dataset.push( receipt );
$scope.protectedUsers.push(items.protectedUsers[username]);
}
$scope.protectedUsers = dataset;
$scope.should.refreshTable = true;
$scope.$apply();
});
$scope.deleteProtection = function(user) {
var response = confirm("Are you sure you want to remove "+user.username+" from the protected users list?");
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -15,6 +15,7 @@
"grunt-contrib-compress": "^0.13.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-jpm": "^0.1.0",
"grunt-curl": "~2.2.0"
"grunt-curl": "~2.2.0",
"grunt-mozilla-addon-sdk": "^0.4.0"
}
}
2 changes: 1 addition & 1 deletion partial_protects.html
Expand Up @@ -8,7 +8,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="user in protectedUsers">
<tr ng-repeat="user in ::protectedUsers">
<td>{{ user.username }}</td>
<td>{{ user.on | date:'medium' }}</td>
<td><a ng-click="deleteProtection(user)"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Delete</a></td>
Expand Down

0 comments on commit 6efaf68

Please sign in to comment.