Editor dialog style complete
This commit is contained in:
+102
-2
@@ -123,7 +123,9 @@
|
||||
height: 20em;
|
||||
}
|
||||
|
||||
#gollum-editor input#gollum-editor-submit {
|
||||
#gollum-editor input#gollum-editor-submit,
|
||||
#gollum-editor-dialog a.minibutton,
|
||||
#gollum-editor-dialog a.minibutton:visited {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #d4d4d4;
|
||||
color: #333;
|
||||
@@ -146,7 +148,8 @@
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
#gollum-editor input#gollum-editor-submit:hover {
|
||||
#gollum-editor input#gollum-editor-submit:hover,
|
||||
#gollum-editor-dialog a.minibutton:hover {
|
||||
background: #3072b3;
|
||||
border-color: #518cc6 #518cc6 #2a65a0;
|
||||
color: #fff;
|
||||
@@ -162,3 +165,100 @@
|
||||
|
||||
/* @control dialog */
|
||||
|
||||
#gollum-editor-dialog {
|
||||
display: none;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog-inner {
|
||||
background: transparent;
|
||||
margin: 0 0 0 -225px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 450px;
|
||||
|
||||
border: 7px solid rgba(0, 0, 0, 0.3);
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog-bg {
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
padding: 1em;
|
||||
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f7f7f7', endColorstr='#ffffff');
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f7f7f7), to(#ffffff));
|
||||
background: -moz-linear-gradient(top, #f7f7f7, #ffffff);
|
||||
}
|
||||
|
||||
#gollum-editor-dialog-inner h4 {
|
||||
border-bottom: 1px solid #ddd;
|
||||
color: #000;
|
||||
font-size: 1.8em;
|
||||
line-height: normal;
|
||||
font-weight: bold;
|
||||
margin: 0 0 0.75em 0;
|
||||
padding: 0 0 0.3em 0;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog-body fieldset {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog-body fieldset .field {
|
||||
margin: 0 0 1.5em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog-body fieldset .field label {
|
||||
color: #000;
|
||||
display: block;
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
line-height: 1.6em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog-body fieldset .field input[type="text"] {
|
||||
border: 1px solid #ddd;
|
||||
display: block;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-size: 1.2em;
|
||||
line-height: 1.6em;
|
||||
margin: 0.3em 0 0 0;
|
||||
padding: 0.3em 0.5em;
|
||||
width: 96.5%;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog-body fieldset .field input.code {
|
||||
font-family: 'Monaco', 'Courier New', Courier, monospace;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog-body fieldset .field:last-child {
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog-buttons {
|
||||
border-top: 1px solid #ddd;
|
||||
overflow: hidden;
|
||||
margin: 1.5em 0 0 0;
|
||||
padding: 1em 0 0 0;
|
||||
}
|
||||
|
||||
#gollum-editor-dialog a.minibutton {
|
||||
float: right;
|
||||
margin-right: 0.5em;
|
||||
width: auto;
|
||||
}
|
||||
@@ -436,6 +436,7 @@
|
||||
|
||||
// only text is supported for now
|
||||
case 'text':
|
||||
case 'code':
|
||||
default:
|
||||
fieldMarkup += Dialog.createFieldText( fieldArray[i] );
|
||||
break;
|
||||
@@ -464,6 +465,9 @@
|
||||
|
||||
if ( fieldAttributes.id ) {
|
||||
html += ' name="' + fieldAttributes.id + '"'
|
||||
if ( fieldAttributes.type == 'code' ) {
|
||||
html+= ' class="code"';
|
||||
}
|
||||
html += ' id="gollum-editor-dialog-generated-field-' +
|
||||
fieldAttributes.id + '">';
|
||||
}
|
||||
@@ -474,13 +478,18 @@
|
||||
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>' +
|
||||
title +'</h4></div>' +
|
||||
'<div id="gollum-editor-dialog-body">' + body + '</div>' +
|
||||
'<div id="gollum-editor-dialog-buttons">' +
|
||||
'<a href="#" title="OK" id="gollum-editor-action-ok">OK</a>' +
|
||||
'<a href="#" title="Cancel" id="gollum-editor-action-cancel">' +
|
||||
'Cancel</a>' +
|
||||
'<a href="#" title="Cancel" id="gollum-editor-action-cancel" ' +
|
||||
'class="minibutton">Cancel</a>' +
|
||||
'<a href="#" title="OK" id="gollum-editor-action-ok" '+
|
||||
'class="minibutton">OK</a>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
},
|
||||
|
||||
@@ -509,7 +518,7 @@
|
||||
|
||||
hide: function() {
|
||||
$('#gollum-editor-dialog').animate({ opacity: 0 }, {
|
||||
duration: 300,
|
||||
duration: 200,
|
||||
complete: function() {
|
||||
$('#gollum-editor-dialog').removeClass('active');
|
||||
}
|
||||
@@ -545,19 +554,20 @@
|
||||
typeof argObject.OK == 'function' ) {
|
||||
Dialog.attachEvents( argObject.OK );
|
||||
}
|
||||
Dialog.show();
|
||||
},
|
||||
|
||||
show: function() {
|
||||
if ( !Dialog.markupCreated ) {
|
||||
debug('Dialog: No markup to show. Please use init first.')
|
||||
} else {
|
||||
Dialog.position(); // position this thing
|
||||
$('#gollum-editor-dialog').animate({ opacity: 0 }, {
|
||||
duration: 1,
|
||||
complete: function() {
|
||||
$('#gollum-editor-dialog').addClass('active');
|
||||
$('#gollum-editor-dialog').animate({ opacity: 100 }, {
|
||||
duration: 700
|
||||
Dialog.position(); // position this thing
|
||||
$('#gollum-editor-dialog').animate({ opacity: 1 }, {
|
||||
duration: 500
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -565,7 +575,11 @@
|
||||
},
|
||||
|
||||
position: function() {
|
||||
|
||||
var dialogHeight = $('#gollum-editor-dialog-inner').height();
|
||||
debug(dialogHeight);
|
||||
$('#gollum-editor-dialog-inner')
|
||||
.css('height', dialogHeight + 'px')
|
||||
.css('margin-top', -1 * parseInt( dialogHeight / 2 ));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -111,7 +111,7 @@ var MarkDown = {
|
||||
{
|
||||
id: 'url',
|
||||
name: 'Image URL',
|
||||
type: 'text'
|
||||
type: 'code'
|
||||
},
|
||||
{
|
||||
id: 'alt',
|
||||
|
||||
Reference in New Issue
Block a user