Re-namespace Gollum Dialogs

This commit is contained in:
Eston Bond
2010-11-12 13:38:32 -08:00
parent 00a934b85d
commit 62c5de1414
@@ -12,10 +12,10 @@
markupCreated: false,
attachEvents: function( evtOK ) {
$('#gollum-editor-action-ok').click(function( e ) {
$('#gollum-dialog-action-ok').click(function( e ) {
Dialog.eventOK( e, evtOK );
});
$('#gollum-editor-action-cancel').click( Dialog.eventCancel );
$('#gollum-dialog-action-cancel').click( Dialog.eventCancel );
},
createFieldMarkup: function( fieldArray ) {
@@ -59,7 +59,7 @@
if ( fieldAttributes.type == 'code' ) {
html+= ' class="code"';
}
html += ' id="gollum-editor-dialog-generated-field-' +
html += ' id="gollum-dialog-dialog-generated-field-' +
fieldAttributes.id + '">';
}
@@ -68,16 +68,16 @@
createMarkup: function( title, body ) {
Dialog.markupCreated = true;
return '<div id="gollum-editor-dialog">' +
'<div id="gollum-editor-dialog-inner">' +
'<div id="gollum-editor-dialog-bg">' +
'<div id="gollum-editor-dialog-title"><h4>' +
return '<div id="gollum-dialog-dialog">' +
'<div id="gollum-dialog-dialog-inner">' +
'<div id="gollum-dialog-dialog-bg">' +
'<div id="gollum-dialog-dialog-title"><h4>' +
title +'</h4></div>' +
'<div id="gollum-editor-dialog-body">' + body + '</div>' +
'<div id="gollum-editor-dialog-buttons">' +
'<a href="#" title="Cancel" id="gollum-editor-action-cancel" ' +
'<div id="gollum-dialog-dialog-body">' + body + '</div>' +
'<div id="gollum-dialog-dialog-buttons">' +
'<a href="#" title="Cancel" id="gollum-dialog-action-cancel" ' +
'class="minibutton">Cancel</a>' +
'<a href="#" title="OK" id="gollum-editor-action-ok" '+
'<a href="#" title="OK" id="gollum-dialog-action-ok" '+
'class="minibutton">OK</a>' +
'</div>' +
'</div>' +
@@ -95,7 +95,7 @@
var results = [];
// get the results from each field and build them into the object
$('#gollum-editor-dialog-body input').each(function() {
$('#gollum-dialog-dialog-body input').each(function() {
results[$(this).attr('name')] = $(this).val();
});
@@ -108,10 +108,10 @@
},
hide: function() {
$('#gollum-editor-dialog').animate({ opacity: 0 }, {
$('#gollum-dialog-dialog').animate({ opacity: 0 }, {
duration: 200,
complete: function() {
$('#gollum-editor-dialog').removeClass('active');
$('#gollum-dialog-dialog').removeClass('active');
}
});
},
@@ -137,7 +137,7 @@
}
if ( Dialog.markupCreated ) {
$('#gollum-editor-dialog').remove();
$('#gollum-dialog-dialog').remove();
}
var $dialog = $( Dialog.createMarkup( title, body ) );
$('body').append( $dialog );
@@ -153,12 +153,12 @@
debug('Dialog: No markup to show. Please use init first.')
} else {
debug('Showing dialog');
$('#gollum-editor-dialog').animate({ opacity: 0 }, {
$('#gollum-dialog-dialog').animate({ opacity: 0 }, {
duration: 1,
complete: function() {
$('#gollum-editor-dialog').addClass('active');
$('#gollum-dialog-dialog').addClass('active');
Dialog.position(); // position this thing
$('#gollum-editor-dialog').animate({ opacity: 1 }, {
$('#gollum-dialog-dialog').animate({ opacity: 1 }, {
duration: 500
});
}
@@ -167,9 +167,9 @@
},
position: function() {
var dialogHeight = $('#gollum-editor-dialog-inner').height();
var dialogHeight = $('#gollum-dialog-dialog-inner').height();
debug(dialogHeight);
$('#gollum-editor-dialog-inner')
$('#gollum-dialog-dialog-inner')
.css('height', dialogHeight + 'px')
.css('margin-top', -1 * parseInt( dialogHeight / 2 ));
}