Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -58,13 +58,14 @@ _notes.prototype.imagenotes = Class.create({
|
||||
this.initImage.bind( this ).delay( .2 );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var imageDims = $( this.id ).getDimensions();
|
||||
|
||||
// Wrap the image
|
||||
this.imageWrap = new Element( 'div', { id: this.id + '_wrap' } );
|
||||
$( this.id ).wrap( this.imageWrap );
|
||||
this.imageWrap.setStyle( { width: imageDims['width'] + 'px', height: imageDims['height'] + 'px' } ).addClassName('image_view_wrap');
|
||||
this.imageWrap.setStyle( { background: "url(data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)" } );
|
||||
|
||||
// Build current notes
|
||||
this.buildNotes();
|
||||
@@ -83,8 +84,16 @@ _notes.prototype.imagenotes = Class.create({
|
||||
$( this.options.add_note ).observe('click', this.addNote.bindAsEventListener( this ));
|
||||
}
|
||||
|
||||
if ( $('notes_trigger') )
|
||||
{
|
||||
$('notes_trigger').setStyle( { cursor: 'pointer' } );
|
||||
$('notes_trigger').observe( 'mouseover', this.imageHover.bindAsEventListener( this ) );
|
||||
$('notes_trigger').observe( 'mouseout' , this.imageHoverOff.bindAsEventListener( this ) );
|
||||
}
|
||||
|
||||
// Set up body events
|
||||
Event.observe( document.body, 'click', this.bodyClick.bindAsEventListener( this ) );
|
||||
|
||||
},
|
||||
|
||||
/*------------------------------*/
|
||||
@@ -96,8 +105,13 @@ _notes.prototype.imagenotes = Class.create({
|
||||
return;
|
||||
}
|
||||
|
||||
ipb.menus.closeAll(e);
|
||||
|
||||
this.i++;
|
||||
|
||||
/* Cancel lightbox */
|
||||
this._cancelLightbox();
|
||||
|
||||
var wrapDims = $( this.imageWrap ).getDimensions();
|
||||
|
||||
this.buildNote( this.id + '_new_' + this.i, { content: '',
|
||||
@@ -107,10 +121,7 @@ _notes.prototype.imagenotes = Class.create({
|
||||
|
||||
// Show notes even if not mousing over
|
||||
this.imageHover( e, function(){
|
||||
this.noteSelect( null, this.id + '_new_' + this.i );
|
||||
/*new Effect.Pulsate( $( 'note_' + this.id + '_new_' + this.i ), { pulses: 2, duration: 0.5, afterFinish: function(){
|
||||
this.noteSelect( null, this.id + '_new_' + this.i );
|
||||
}.bind(this) } )*/
|
||||
this.noteSelect( e, this.id + '_new_' + this.i );
|
||||
}.bind(this) );
|
||||
|
||||
},
|
||||
@@ -273,7 +284,12 @@ _notes.prototype.imagenotes = Class.create({
|
||||
/*------------------------------*/
|
||||
/* Note select */
|
||||
noteSelect: function( e, id )
|
||||
{
|
||||
{
|
||||
Event.stop( e );
|
||||
|
||||
/* Cancel it */
|
||||
this._cancelLightbox();
|
||||
|
||||
if( this.dragging ){ return; }
|
||||
|
||||
$( 'note_' + id ).addClassName('selected');
|
||||
@@ -351,7 +367,7 @@ _notes.prototype.imagenotes = Class.create({
|
||||
'left': containerPos['left'],
|
||||
'width': boxSize['width'],
|
||||
'height': boxSize['height'],
|
||||
'note': content,
|
||||
'note': content.encodeParam(),
|
||||
'noteId': noteId
|
||||
},
|
||||
onSuccess: function(t)
|
||||
@@ -466,7 +482,7 @@ _notes.prototype.imagenotes = Class.create({
|
||||
alert( ipb.lang['required_data_missing'] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}.bind( this )
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -488,6 +504,9 @@ _notes.prototype.imagenotes = Class.create({
|
||||
$( 'note_form_' + id ).remove();
|
||||
$( 'note_' + id ).writeAttribute('editing', 'no').removeClassName('selected');
|
||||
this.currentEdit = null;
|
||||
|
||||
/* Restore lightbox */
|
||||
this._restoreLightbox();
|
||||
},
|
||||
|
||||
/*------------------------------*/
|
||||
@@ -531,6 +550,29 @@ _notes.prototype.imagenotes = Class.create({
|
||||
}
|
||||
});
|
||||
}
|
||||
,
|
||||
|
||||
/**
|
||||
* Cancel lightbox
|
||||
*/
|
||||
_cancelLightbox: function()
|
||||
{
|
||||
if ( $('ips_lightbox') )
|
||||
{
|
||||
$('ips_lightbox').writeAttribute('available', 'false');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Restore lightbox
|
||||
*/
|
||||
_restoreLightbox: function()
|
||||
{
|
||||
if ( $('ips_lightbox') )
|
||||
{
|
||||
$('ips_lightbox').writeAttribute('available', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user