Removed legacy modal-system

This commit is contained in:
Tobias Reich 2015-01-30 00:21:20 +01:00
parent 42b4d60b13
commit 168d0ed2ce
3 changed files with 3 additions and 247 deletions

View File

@ -154,11 +154,6 @@ $(document).ready(function() {
.on('click', '.album', function() { lychee.goto($(this).attr('data-id')) })
.on('click', '.photo', function() { lychee.goto(album.getID() + '/' + $(this).attr('data-id')) })
/* Modal */
.on(eventName, '.message .close', modal.close)
.on(eventName, '.message .button:first', function() { if (modal.fns!==null) modal.fns[0](); if (!visible.signin()) modal.close() })
.on(eventName, '.message .button:last', function() { if (modal.fns!==null) modal.fns[1](); if (!visible.signin()) modal.close() })
/* Context Menu */
.on('contextmenu', '.photo', function(e) { contextMenu.photo(photo.getID(), e) })
.on('contextmenu', '.album', function(e) { contextMenu.album(album.getID(), e) })
@ -167,7 +162,7 @@ $(document).ready(function() {
.on(eventName, '#infobox_overlay', view.infobox.hide)
/* Upload */
.on('change', '#upload_files', function() { modal.close(); upload.start.local(this.files) })
.on('change', '#upload_files', function() { basicModal.close(); upload.start.local(this.files) })
.on(eventName, '.upload_message a.close', upload.close)
.on('dragover', function(e) { e.preventDefault(); }, false)
.on('drop', function(e) {

View File

@ -1,34 +0,0 @@
/**
* @description Build, show and hide a modal.
* @copyright 2014 by Tobias Reich
*/
modal = {
fns: null
}
modal.show = function(title, text, buttons, marginTop, closeButton) {
if (!buttons) {
buttons = [
['', function() {}],
['', function() {}]
];
}
modal.fns = [buttons[0][1], buttons[1][1]];
$('body').append(build.modal(title, text, buttons, marginTop, closeButton));
$('.message input:first-child').focus().select();
}
modal.close = function() {
modal.fns = null;
$('.message_overlay').removeClass('fadeIn').css('opacity', 0);
setTimeout(function() { $('.message_overlay').remove() }, 300);
}

View File

@ -34,8 +34,6 @@
border-bottom: 1px dashed #888;
}
&.less { padding-bottom: 30px; }
&:first-of-type { padding-top: 42px; }
&:last-of-type { padding-bottom: 40px; }
@ -43,6 +41,8 @@
&.signIn:first-of-type { padding-top: 30px; }
&.signIn:last-of-type { padding-bottom: 30px; }
&.less { padding-bottom: 30px; }
}
/* Buttons ------------------------------------------------*/
@ -180,208 +180,3 @@
}
}
.message_overlay {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: black(.85);
z-index: 1000;
}
.message {
position: absolute;
display: inline-block;
width: 500px;
margin-left: -250px;
margin-top: -95px;
background-image: linear-gradient(to bottom, rgb(75, 75, 75), rgb(45, 45, 45));
border-radius: 5px;
box-shadow: 0 0 5px black(1), inset 0 1px 0 white(.08);
/* Animation */
animation-name: moveUp;
animation-duration: .3s;
animation-timing-function: $timingBounce;
/* Header ------------------------------------------------*/
h1 {
float: left;
width: 100%;
padding: 12px 0;
color: #fff;
font-size: 16px;
font-weight: bold;
text-shadow: 0 -1px 0 black(.3);
text-align: center;
}
.close {
position: absolute;
top: 0;
right: 0;
padding: 12px 14px 6px 7px;
color: #aaa;
font-size: 20px;
text-shadow: 0 -1px 0 black(.3);
cursor: pointer;
&:hover { color: white(1); }
}
/* Text ------------------------------------------------*/
p {
float: left;
width: 90%;
margin-top: 1px;
padding: 12px 5% 15px 5%;
color: #eee;
font-size: 14px;
text-shadow: 0 -1px 0 black(.3);
line-height: 20px;
b {
font-weight: bold;
color: white(1);
}
a {
color: #eee;
text-decoration: none;
border-bottom: 1px dashed #888;
}
}
/* Button ------------------------------------------------*/
.button {
float: right;
margin: 15px 15px 15px 0;
padding: 7px 10px 8px 10px;
color: #ccc;
font-size: 14px;
font-weight: bold;
text-align: center;
text-shadow: 0 -1px 0 black(.3);
border-radius: 5px;
border: 1px solid black(.4);
box-shadow: inset 0 1px 0 white(.08), 0 1px 0 white(.05);
cursor: pointer;
&:first-of-type { margin: 15px 5% 18px 0; }
&.active {
color: #fff;
box-shadow: inset 0 1px 0 white(.08), 0 1px 0 white(.1), 0 0 4px #005ecc;
}
&:hover { background-image: linear-gradient(to bottom, rgb(60, 60, 60), rgb(57, 57, 57)); }
&:active,
&.pressed { background-image: linear-gradient(to bottom, rgb(57, 57, 57), rgb(60, 60, 60)); }
}
/* Input ------------------------------------------------*/
input.text {
float: left;
width: calc(100% - 10px);
padding: 17px 5px 9px 5px;
margin-top: 10px;
background-color: transparent;
color: #fff;
text-shadow: $shadow;
border: none;
box-shadow: 0 1px 0 white(.1);
border-bottom: 1px solid #222;
border-radius: 0px;
outline: none;
}
input.less { margin-bottom: -10px; }
input.more { margin-bottom: 30px; }
.copylink { margin-bottom: 20px; }
/* Radio Buttons ------------------------------------------------*/
.choice {
float: left;
margin: 12px 5%;
width: 90%;
color: #fff;
input { float: left; }
h2 {
float: left;
margin: 1px 0 0 8px;
color: #fff;
font-size: 14px;
font-weight: 700;
text-shadow: 0 -1px 0 black(.3);
}
p {
margin-top: 2px;
padding: 0 5% 0 25px;
color: #aaa;
font-size: 13px;
}
p input {
width: 100%;
padding: 10px 1px 9px;
margin-top: 10px;
}
}
/* Version ------------------------------------------------*/
#version {
display: inline-block;
margin-top: 23px;
margin-left: 5%;
color: #888;
text-shadow: 0 -1px 0 black(.3);
span { display: none; }
span a { color: #888; }
}
}
/* Sign in ------------------------------------------------*/
.sign_in {
float: left;
width: 100%;
margin-top: 1px;
padding: 5px 0;
color: #eee;
font-size: 14px;
text-shadow: 0 -1px 0 black(.3);
line-height: 20px;
/* Input ------------------------------------------------*/
input {
float: left;
width: 88%;
padding: 7px 1% 9px 1%;
margin: 0 5%;
background-color: transparent;
color: #fff;
text-shadow: 0 -1px 0 #222;
border: none;
border-bottom: 1px solid #222;
box-shadow: 0 1px 0 white(.1);
border-radius: 0;
outline: none;
&:first-of-type { margin-bottom: 10px; }
&.error:focus { box-shadow: 0 1px 0 rgba(204, 0, 7, .6); }
}
}