Permalink
Browse files

Merge branch 'master' of github.com:timehome/djangodash2011

  • Loading branch information...
2 parents 3a7981c + 17430ff commit 44f973d69fdd13cae7695fddf3ff7453381b6ad0 @rafaelcaricio rafaelcaricio committed Jul 30, 2011
View
9 myimgat/apps/wall/static/wall/css/overlay.css
@@ -0,0 +1,9 @@
+.overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.6);
+ z-index: 99;
+}
View
20 myimgat/apps/wall/static/wall/css/popin.css
@@ -1,12 +1,7 @@
.popin {
position: absolute;
z-index: 100;
- left: 50%;
- width: 400px;
- margin: 0 0 0 -200px;
- top: 80px;
- bottom: 40px;
- background: white;
+ background: #fff;
border-radius: 4px;
box-shadow: 0 0 0 10px rgba(120, 120, 120, 0.6);
visibility: hidden;
@@ -20,12 +15,9 @@
display: block;
}
-.overlay {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.6);
- z-index: 99;
+.simple-popin {
+ top: 100px;
+ left: 50%;
+ width: 400px;
+ margin: 0 0 0 -200px;
}
View
11 myimgat/apps/wall/static/wall/js/init.js
@@ -75,9 +75,16 @@
request.get();
+ overlay: {
+ var overlay = new Overlay();
+ }
+
popin: {
- var popin = new Popin('popin');
- popin.show('welcome');
+ if (!settings.authUsername) {
+ var popin = new Popin('simple-popin');
+ overlay.block().show();
+ popin.show('login');
+ }
}
}(this, document.id));
View
47 myimgat/apps/wall/static/wall/js/overlay.js
@@ -0,0 +1,47 @@
+(function(global, $){
+
+ var Overlay = global.Overlay = new Class({
+ Implements: [Events, Options],
+
+ initialize: function(element, options) {
+ this.setOptions(options);
+ this.create();
+ },
+
+ create: function() {
+ this.element = new Element('div', {
+ 'class': 'overlay',
+ events: {
+ click: this.onClose.bind(this)
+ }
+ }).fade('hide');
+ $$('body').grab(this.element);
+ },
+
+ show: function() {
+ return this.element.fade('in');
+ },
+
+ hide: function() {
+ return this.element.fade('out');
+ },
+
+ block: function() {
+ this.block = true;
+ return this;
+ },
+
+ unblock: function() {
+ this.block = false;
+ return this;
+ },
+
+ onClose: function() {
+ if (this.block) return;
+ this.hide();
+ return this.fireEvent('close');
+ }
+ });
+
+}(this, document.id));
+
View
15 myimgat/apps/wall/static/wall/js/popin.js
@@ -7,31 +7,17 @@
this.element = $(element);
this.element.fade('hide');
this.tabs = this.element.getChildren();
- this.createOverlay();
- },
-
- createOverlay: function() {
- this.overlay = new Element('div', {
- 'class': 'overlay',
- events: {
- click: this.hide.bind(this)
- }
- });
- this.overlay.fade('hide');
- $$('body').grab(this.overlay);
},
show: function(tab) {
if (tab) {
this.showTab(tab);
}
this.element.fade('in');
- this.overlay.fade('in');
},
hide: function() {
this.element.fade('out');
- this.overlay.fade('out');
},
hideTabs: function() {
@@ -42,7 +28,6 @@
this.hideTabs();
this.element.getElement('> .'+ tab).addClass('show');
}
-
});
}(this, document.id));
View
2 myimgat/apps/wall/templates/wall/base.html
@@ -4,6 +4,7 @@
{% block css %}
<link href="{{ STATIC_URL }}wall/css/reset.css" rel="stylesheet" type="text/css" />
<link href="{{ STATIC_URL }}wall/css/header.css" rel="stylesheet" type="text/css" />
+ <link href="{{ STATIC_URL }}wall/css/overlay.css" rel="stylesheet" type="text/css" />
<link href="{{ STATIC_URL }}wall/css/popin.css" rel="stylesheet" type="text/css" />
<link href="{{ STATIC_URL }}wall/css/wall.css" rel="stylesheet" type="text/css" />
{% endblock %}
@@ -39,6 +40,7 @@
<script src="{{ STATIC_URL }}wall/js/wall.js"></script>
<script src="{{ STATIC_URL }}wall/js/pubsub.js"></script>
<script src="{{ STATIC_URL }}wall/js/header.js"></script>
+ <script src="{{ STATIC_URL }}wall/js/overlay.js"></script>
<script src="{{ STATIC_URL }}wall/js/popin.js"></script>
<script src="{{ STATIC_URL }}wall/js/init.js"></script>
{% endblock %}
View
17 myimgat/apps/wall/templates/wall/popin.html
@@ -1,8 +1,13 @@
-<div id="popin" class="popin">
- <div class="welcome">
- welcome
- </div>
- <div class="somethingelese">
- sure
+<div id="simple-popin" class="simple-popin popin">
+ <div class="login">
+ <p>Show, see, crop and share your photos easily!</p>
+ <p>Choose your log-in option:</p>
+ <ul>
+ <li><a href="#">facebook</a></li>
+ <li><a href="#">google</a></li>
+ </ul>
</div>
</div>
+
+<div id="crop-popin" class="crop-popin popin">
+</div>

0 comments on commit 44f973d

Please sign in to comment.