Skip to content

Commit 25323c9

Browse files
committed
including urls on the template
1 parent d1d34ce commit 25323c9

File tree

5 files changed

+28
-6
lines changed

5 files changed

+28
-6
lines changed

myimgat/apps/wall/static/wall/css/crop-popin.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
margin-bottom: 16px;
2929
}
3030

31-
.crop-popin .crop .share-crop {
31+
.crop-popin .crop .share-button {
3232
display: block;
3333
font-size: 26px;
3434
border-top: 2px solid #ab17a4;
@@ -48,11 +48,11 @@
4848
background: linear-gradient(top, #8f1c93 0%,#541051 100%);
4949
}
5050

51-
.crop-popin .crop .share-crop:hover {
51+
.crop-popin .crop .share-button:hover {
5252
background: #8f1c93;
5353
}
5454

55-
.crop-popin .crop .share-crop:active {
55+
.crop-popin .crop .share-button:active {
5656
border-top: 2px solid #481c46;
5757
border-bottom: 2px solid #ab17a4;
5858
}

myimgat/apps/wall/static/wall/js/crop-popin.js

+18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33
var CropPopin = global.CropPopin = new Class({
44
Extends: Popin,
55

6+
initialize: function(){
7+
this.parent.apply(this, arguments);
8+
this.bindEvents();
9+
},
10+
11+
bindEvents: function() {
12+
this.shareButton = this.element.getElement('.share-button');
13+
this.shareButton.addEvent('click', this.share.bind(this));
14+
},
15+
16+
share: function(e) {
17+
e.preventDefault();
18+
new Request.JSON({
19+
url: settings.urls.shorten
20+
});
21+
//this.shareButton.
22+
},
23+
624
show: function(tab) {
725
this.fireEvent('show');
826
if (tab) {

myimgat/apps/wall/static/wall/js/init.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
username = global.settings.defaultUsername;
5252
}
5353
var request = new Request.JSON({
54-
url: '/api/'+ username +'.json'
54+
url: settings.urls.userAlbums.substitute({username: username})
5555
});
5656
}
5757

myimgat/apps/wall/templates/wall/base.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ <h1>myimg.at</h1>
4646
{% block js %}
4747
<script>
4848
settings = this.settings || {};
49-
settings.defaultUsername = "{{ username }}";
49+
settings.defaultUsername = '{{ username }}';
50+
settings.urls = {
51+
shorten: '{% url wall.views.save_cropped_photo %}',
52+
userAlbums: '/api/{username}.json'
53+
};
5054
</script>
5155
<script src="{{ STATIC_URL }}wall/js/mootools-core-1.3.2-compat.js"></script>
5256
<script src="{{ STATIC_URL }}wall/js/mootools-more-1.3.2.1.js"></script>

myimgat/apps/wall/templates/wall/popin.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="crop">
1414
<h2>image title</h2>
1515
<div class="photo"></div>
16-
<a class="share-crop" href="#">share photo</a>
16+
<a class="share-button" href="#">share photo</a>
1717
</div>
1818
<div class="share">
1919
</div>

0 commit comments

Comments
 (0)