-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
0.4.0
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
*.xpi | ||
install.rdf | ||
node_modules | ||
bootstrap.js |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4.1.2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- "4.1" | ||
before_script: | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
'use strict'; | ||
|
||
angular.module('RestedApp') | ||
.controller('OptionsCtl', function($scope, $rootScope, Import, Modal, Collection, UrlVariables) { | ||
$scope.activeTab = 'templateVariablesForm'; | ||
$scope.importMethod = 'HAR'; | ||
|
||
var doImport = function() { | ||
var requests; | ||
|
||
try { | ||
var importObj = JSON.parse($scope.importText); | ||
requests = Import['from' + $scope.importMethod](importObj); | ||
} catch(e) { | ||
console.error(e); | ||
return $scope.importFeedback = 'Error while parsing. Is your text formatted correctly?'; | ||
} | ||
|
||
Modal.set({ | ||
title: 'Successfy parsed imports', | ||
body: 'Would you like to add the following to your collection or replace your existing collection?', | ||
actions: [{ | ||
text: 'Add', | ||
click: function() { | ||
requests.forEach(function(request) { | ||
Collection.addRequestToCollection(request); | ||
Modal.remove(); | ||
}); | ||
} | ||
}, { | ||
text: 'Replace', | ||
click: function() { | ||
Collection.clearCollection(function callback() { | ||
requests.forEach(Collection.addRequestToCollection); | ||
}); | ||
} | ||
}] | ||
}); | ||
}; | ||
|
||
var actions = { | ||
templateVariablesForm: [{ | ||
text: 'Save', | ||
click: UrlVariables.setVariables | ||
}], | ||
optionsForm: [{ | ||
text: 'Save' | ||
}], | ||
importForm: [{ | ||
text: 'Import', | ||
click: doImport | ||
}] | ||
}; | ||
|
||
$scope.setTab = function(tabName) { | ||
$scope.activeTab = tabName; | ||
$rootScope.modalOptions.actions = actions[tabName]; | ||
}; | ||
|
||
$scope.removeParam = function(param) { | ||
$rootScope.urlVariables = $rootScope.urlVariables.filter(function(item) { | ||
return item !== param; | ||
}); | ||
}; | ||
}); |