At last, composing messages with attachments is possible!!

It is a really simple implementation but I think it will be enough for a begining. Users can add multiple attachments with a message, each attachment must not be larger than a customizable limit.

see #38
This commit is contained in:
Antoine Nguyen
2011-09-08 09:13:13 +02:00
parent b33e6c0b25
commit 9ddb27573f
21 changed files with 710 additions and 163 deletions
+11 -2
View File
@@ -88,7 +88,9 @@ var SqueezeBox = {
}
}
this.content = new Element('div', {id: 'sbox-content'}).inject(this.win);
this.closeBtn = new Element('a', {id: 'sbox-btn-close', href: '#'}).inject(this.win);
if (this.options.closeBtn) {
this.closeBtn = new Element('a', {id: 'sbox-btn-close', href: '#'}).inject(this.win);
}
this.fx = {
overlay: new Fx.Tween(this.overlay, Object.merge({
property: 'opacity',
@@ -155,6 +157,11 @@ var SqueezeBox = {
this.overlay.set('class', this.options.classOverlay);
this.win.set('class', this.options.classWindow);
if (Browser.ie) this.win.addClass('sbox-window-ie6');
if (!this.options.closeBtn) {
this.closeBtn.dispose();
} else {
this.closeBtn.inject(this.win);
}
},
close: function(e) {
@@ -239,7 +246,9 @@ var SqueezeBox = {
toggleListeners: function(state) {
var fn = (state) ? 'addEvent' : 'removeEvent';
this.closeBtn[fn]('click', this.bound.close);
if (this.options.closeBtn) {
this.closeBtn[fn]('click', this.bound.close);
}
this.overlay[fn]('click', this.bound.close);
this.doc[fn]('keydown', this.bound.key)[fn]('mousewheel', this.bound.scroll);
this.doc.getWindow()[fn]('resize', this.bound.window)[fn]('scroll', this.bound.window);
+16 -3
View File
@@ -20,6 +20,7 @@ var AnchorNavigation = new Class({
this.params = $H();
this.base = '';
this.serialized = null;
this.updatenext = true;
this.reset_loading_infos();
if (this.options.defcallback) {
this.register_callback("default", this.options.defcallback);
@@ -83,11 +84,19 @@ var AnchorNavigation = new Class({
return res;
},
update: function(force) {
update: function(force, noupdate) {
window.fireEvent("pageRefresh");
location.hash = this.serialize();
if ($defined(force)) {
this.force = force;
if (!$defined(noupdate)) {
noupdate = false;
}
if (!noupdate) {
if ($defined(force)) {
this.force = force;
}
} else {
this.updatenext = false;
}
},
@@ -183,6 +192,10 @@ var AnchorNavigation = new Class({
location.hash = this.deflocation;
return;
}
if (!this.updatenext) {
this.updatenext = true;
return;
}
var query = this.serialized.substring(1);
+22
View File
@@ -26,6 +26,28 @@ function static_url(value) {
return media_url + value;
}
/*
* Easy way to deactivate a link (ie. clicking on it does nothing)
*/
function disable_link(link) {
link.removeEvents("click")
.addEvent("click", function(evt) {
evt.stop();
});
}
/*
* Easy way to re-activate a link that was previously disabled. An
* extra argument can be passed to specify a new "click" event
* callback.
*/
function enable_link(link, callback) {
link.removeEvents("click");
if ($defined(callback)) {
link.addEvent("click", callback);
}
}
function parse_menubar(id) {
if ($(id)) {
$(id).getElements('li.dropdown').each(function(elem){
Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B