diff options
author | Einar Egilsson <einar@einaregilsson.com> | 2015-09-02 12:14:24 +0000 |
---|---|---|
committer | Einar Egilsson <einar@einaregilsson.com> | 2015-09-02 12:14:24 +0000 |
commit | a7506a34544f4df3ba65a854c81fadcca2eb303f (patch) | |
tree | 7421ff72bcfabfac94bb5ddd48e33c73af75a7e2 /redirector.html | |
parent | 4d9993f230c59f8a97767599b1d81eeeac3d35ec (diff) |
CRUD stuff almost ready
Diffstat (limited to 'redirector.html')
-rw-r--r-- | redirector.html | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/redirector.html b/redirector.html new file mode 100644 index 0000000..aa0ccbc --- /dev/null +++ b/redirector.html @@ -0,0 +1,148 @@ +<!DOCTYPE html> +<html> + <head> + <title>Redirector</title> + <link rel="stylesheet" href="css/redirector.css" /> + <meta charset="UTF-8"> + <script src="js/angular.min.js"></script> + <script src="js/redirect.js"></script> + <script src="js/app.js"></script> + </head> + <body ng-app="redirectorApp" ng-controller="redirectorController"> + <div id="cover" ng-show="showModal"> + </div> + <div id="delete-redirect-form" ng-show="deleting"> + <h3>Are you sure you want to delete this redirect?</h3> + <div> + <label>Description:</label> + <span>{{deleting.description}}</span> + </div> + <div> + <label>Example URL:</label> + <span>{{deleting.exampleUrl}}</span> + </div> + <div> + <label>Include pattern:</label> + <span>{{deleting.includePattern}} + </div> + <div> + <label>Redirect to:</label> + <span>{{deleting.redirectUrl}}</span> + </div> + <div> + <label>Pattern type:</label> + <span>{{deleting.patternType == 'W' ? 'Wildcard' : 'Regular Expression'}}</span> + </div> + <div class="button-container"> + <a class="btn red large" ng-click="deleteRedirect()">Yes, delete it</a> + <a class="btn grey large" ng-click="cancelDelete()">No, don't delete it</a> + </div> + </div> + <div id="edit-redirect-form" ng-show="activeRedirect"> + <h3>{{editIndex >= 0 ? 'Edit' : 'Create'}} Redirect</h3> + <div> + <label>Description:</label> + <input type="text" ng-model="activeRedirect.description" placeholder="Enter a description for your redirect rule" /> + </div> + <div> + <label>Example URL:</label> + <input type="text" ng-model="activeRedirect.exampleUrl" placeholder="http://example.com/some/path?a=1" /> + </div> + <div> + <label>Include pattern:</label> + <input type="text" ng-model="activeRedirect.includePattern" placeholder="Pattern that matches the urls you want to redirect" /> + </div> + <div> + <label>Redirect to:</label> + <input type="text" ng-model="activeRedirect.redirectUrl" placeholder="The url you want to redirect requests to" /> + </div> + <div> + <label>Pattern type:</label> + <label id="wildcardtype"><input type="radio" ng-model="activeRedirect.patternType" name="patterntype" value="W">Wildcard</label> + <label><input type="radio" ng-model="activeRedirect.patternType" name="patterntype" value="R">Regular Expression</label> + </div> + <div> + <label>Example result:</label> + </div> + <div id="advanced-toggle"> + <a ng-click="showAdvanced=true" ng-show="!showAdvanced">Show advanced options...</a> + <a ng-click="showAdvanced=false" ng-show="showAdvanced">Hide advanced options...</a> + </div> + <div id="advanced" ng-show="showAdvanced"> + <div> + <label>Exclude pattern:</label> + <input type="text" ng-model="activeRedirect.excludePattern" placeholder="Pattern to exclude certain urls from the redirection"/> + </div> + <div> + <label for="unescape-matches">Unescape matches:</label> + <input id="unescape-matches" ng-model="activeRedirect.unescapeMatches" type="checkbox"> + </div> + <div> + <label for="escape-matches">Escape matches:</label> + <input id="escape-matches" ng-model="activeRedirect.escapeMatches" type="checkbox"> + </div> + <div> + <label>Apply to:</label> + + <label ng-repeat="(key,value) in requestTypes " ng-class="{'second-column' : !$first}"><input type="checkbox" ng-checked="appliesTo(key)" ng-click="toggleApplies(key)">{{value}}</label> + + </div> + </div> + <div class="button-container"> + <a class="btn green medium" ng-click="saveRedirect()">Save</a> + <a class="btn red medium" ng-click="cancelEdit()">Cancel</a> + </div> + </div> + + + <div id="blur-wrapper" ng-class="{blur: showModal}"> + <h1>Redirector</h1> + <!--<h3>DISABLED</h3>--> + <h5>Go where <em>YOU</em> want!</h5> + + + <div id="menu"> + <input type="file" id="import-file" fileselected="importRedirects($file)" accept=".rjson,.json,.txt,text/*" /> + <a class="btn blue large" ng-click="createNew()">Create new redirect</a> + <label for="import-file" class="btn blue large">Import</label> + <a class="btn blue large" ng-href="{{redirectDownload}}" download="Redirector.rjson">Export</a> + <a class="btn blue large" href="help.html" target="_blank">Help</a> + </div> + + <div id="message-box" ng-class="{visible : message, error : messageType == 'error', success : messageType == 'success'}"> + {{message}} + <a ng-click="message=null">✖</a> + </div> + <div class="redirect-table"> + <div class="redirect-row" ng-class="{disabled: r.disabled}" ng-repeat="r in redirects"> + <h4><span class="disabled-marker" ng-show="r.disabled">[Disabled] </span><span>{{r.description}}</span></h4> + <div> + <label>Redirect:</label> <span>{{r.includePattern}}</span> + </div> + <div> + <label>to:</label> <span>foo.is</span> + </div> + <div ng-show="r.excludePattern"> + <label>excluding:</label> <span>asdfasdf</span> + </div> + <div> + <label>Example:</label> <span></span> + </div> + <div> + <label>Applies to:</label> <span>{{r.appliesTo|requestTypeDisplay}}</span> + </div> + <div> + <a class="btn blue" ng-click="toggleDisabled(r)">{{r.disabled ? "Enable" : "Disable"}}</a> + <a class="btn green" ng-click="editRedirect($index)">Edit</a> + <a class="btn red" ng-click="confirmDelete($index)">Delete</a> + <a class="btn grey move-up-btn" ng-class="{disabled:$first}" ng-click="moveUp($index)">▲</a> + <a class="btn grey move-down-btn" ng-class="{disabled:$last}" ng-click="moveDown($index)">▼</a> + </div> + </div> + </div> + <footer> + <small>Redirector is created by <a target="_blank" href="http://einaregilsson.com">Einar Egilsson</a></small> + </footer> + </div> + </body> +</html> |