mirror of
https://github.com/fergalmoran/shortio.git
synced 2026-02-15 20:44:11 +00:00
Added zeptojs and enter directive
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
db.sqlite3
|
||||
.idea
|
||||
*.pyc
|
||||
shortio/localsettings.py
|
||||
shortio/localsettings.py
|
||||
CACHE
|
||||
|
||||
1739
static/css/font-awesome.css
vendored
Normal file
1739
static/css/font-awesome.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
24
static/css/site.css
Normal file
24
static/css/site.css
Normal file
@@ -0,0 +1,24 @@
|
||||
body {
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.navbar-wrapper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.navbar-wrapper {
|
||||
margin-top: 20px;
|
||||
margin-bottom: -90px; /* Negative margin to pull up carousel. 90px is roughly margins and height of navbar. */
|
||||
}
|
||||
|
||||
/* The navbar becomes detached from the top, so we round the corners */
|
||||
.navbar-wrapper .navbar {
|
||||
border-radius: 4px;
|
||||
}
|
||||
@@ -20,4 +20,5 @@ angular.module('shortioApp')
|
||||
$scope.error = "Not a valid url";
|
||||
}
|
||||
};
|
||||
$('#url').focus();
|
||||
});
|
||||
|
||||
13
static/js/app/directives/enter.js
Normal file
13
static/js/app/directives/enter.js
Normal file
@@ -0,0 +1,13 @@
|
||||
angular.module('shortioApp')
|
||||
.directive('ngEnter', function () {
|
||||
return function (scope, element, attrs) {
|
||||
element.bind("keydown keypress", function (event) {
|
||||
if (event.which === 13) {
|
||||
scope.$apply(function () {
|
||||
scope.$eval(attrs.ngEnter);
|
||||
});
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -1,5 +1,6 @@
|
||||
<div ng-controller="UrlCtrl" class="login-popup">
|
||||
<input type="text" class="form-control text-center text" id="" placeholder="URL to shorten" ng-model="url">
|
||||
<input type="text" class="form-control text-center text" id="url" placeholder="URL to shorten"
|
||||
ng-enter="shortenUrl()" ng-model="url">
|
||||
<button type="submit" class="btn btn-default submit" ng-click="shortenUrl()">Do It</button>
|
||||
<div class="alert alert-success" ng-show="shortened_url.length">
|
||||
<a ng-href="{{shortened_url}}" ng-bind="shortened_url"></a>
|
||||
|
||||
1664
static/js/zepto.js
Normal file
1664
static/js/zepto.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -54,9 +54,11 @@
|
||||
<script src="{% static "js/underscore/underscore.js" %}"></script>
|
||||
<script src="{% static "js/angular/angular.min.js" %}"></script>
|
||||
<script src="{% static "js/angular/angular-resource.min.js" %}"></script>
|
||||
<script src="{% static "js/zepto.js" %}"></script>
|
||||
<script src="{% static "js/script.js" %}"></script>
|
||||
|
||||
<script src="{% static "js/app/app.js" %}"></script>
|
||||
<script src="{% static "js/app/directives/enter.js" %}"></script>
|
||||
<script src="{% static "js/app/controllers/url.js" %}"></script>
|
||||
<script src="{% static "js/app/services/url.js" %}"></script>
|
||||
{% endcompress %}
|
||||
|
||||
Reference in New Issue
Block a user