Commit 54aa7f25 authored by Alain Takoudjou's avatar Alain Takoudjou

Update popup box to display more than one msg at a time

parent b86715f7
...@@ -679,22 +679,25 @@ a.lshare img{ ...@@ -679,22 +679,25 @@ a.lshare img{
#error{ #error{
padding: 0px; padding: 0px;
position: absolute; position: absolute;
top: -2px; top: 0px;
left:0; left:0;
right: 0; right: 70px;
} }
#error > div{ #error div{
background: none repeat scroll 0 0 #afcee4; background: none repeat scroll 0 0 #FFC8F4;
border: 1px solid #FFF; border: 1px solid #A70073;
width:500px; padding: 5px;
margin: 0 auto; margin: 5px 0;
border-top:none; min-width: 300px;
border-radius: 0 0 4px 4px; max-width: 500px;
float: right;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
text-align: center; text-align: left;
position: relative; position: relative;
z-index: 170; z-index: 170;
clear: both;
} }
#error table{ #error table{
...@@ -719,7 +722,7 @@ a.lshare img{ ...@@ -719,7 +722,7 @@ a.lshare img{
width: 30px; width: 30px;
height:22px; height:22px;
} }
#error p{white-space: pre-wrap; word-wrap: break-word; width: 430px; padding-bottom: 5px;} #error p{white-space: pre-wrap; word-wrap: break-word; width: 95%; padding-bottom: 5px;}
.noscroll { .noscroll {
overflow: hidden; overflow: hidden;
} }
...@@ -731,13 +734,15 @@ a.lshare img{ ...@@ -731,13 +734,15 @@ a.lshare img{
.list{display: block;padding: 5px;background: #E7E7E7; margin-bottom:7px;} .list{display: block;padding: 5px;background: #E7E7E7; margin-bottom:7px;}
div.sep{display:block; height:7px;} div.sep{display:block; height:7px;}
.slidebox{padding:10px; } .slidebox{padding:10px; }
.alert_message{ background: url(../images/alert.png) center no-repeat; height: 26px;} .alert_message{ background: url(../images/alert.png) center no-repeat; height: 26px;}
.error_message{ background: url(../images/exit.png) center no-repeat; height: 26px;} .error_message{ background: url(../images/exit.png) center no-repeat; height: 26px;}
.confirm_message{ background: url(../images/confirm.png) center no-repeat; height: 26px;} .confirm_message{ background: url(../images/confirm.png) center no-repeat; height: 26px;}
.info_message{ background: url(../images/info.png) center no-repeat; height: 26px;} .info_message{ background: url(../images/info.png) center no-repeat; height: 26px;}
#error p{ font-size: 13px; color: #4A131F;} #error p{ font-size: 13px; color: #4A131F;}
#pClose, .close{background:url(../images/close.png) no-repeat 0px 0px; display:block; width:22px; height:22px; cursor:pointer} .pClose, .close{background:url(../images/close.png) no-repeat 0px 0px; display:block; width:22px; height:22px; cursor:pointer}
#pClose:hover, .close:hover{background:url(../images/close_hover.png) no-repeat 0px 0px;} .pClose:hover, .close:hover{background:url(../images/close_hover.png) no-repeat 0px 0px;}
.md5sum {margin:10px; font-size:15px;} .md5sum {margin:10px; font-size:15px;}
.title{background: #e4e4e4; width: 100%; height: 26px; padding-top:2px; text-indent: 5px; color: #737373; text-shadow: 0px 1px #FFF;} .title{background: #e4e4e4; width: 100%; height: 26px; padding-top:2px; text-indent: 5px; color: #737373; text-shadow: 0px 1px #FFF;}
.menu-box-left{float:left; width: 135px; font-size:14px; background: #e4e4e4; padding:5px 0 5px 5px; margin-top:10px; .menu-box-left{float:left; width: 135px; font-size:14px; background: #e4e4e4; padding:5px 0 5px 5px; margin-top:10px;
......
/*jslint undef: true */
/*global $, window, document */
/* vim: set et sts=4: */
// jQuery Message Popup // jQuery Message Popup
// Display a message on the top of page, with floating // Display a message on the top of page, with floating
// //
(function ($, document, window) { (function ($, document, window) {
var isShow = null; var isShow = null,
var showDelayTimer = null; top = 0,
boxCount = 0,
showDelayTimer = null;
$.extend($.fn, { $.extend($.fn, {
Popup: function(msg, option) { Popup: function(msg, option) {
var h; var h,
$box = $(this),
currentBox = 'bcontent' + boxCount;
if (option.type === undefined) option.type = "info"; if (option.type === undefined) option.type = "info";
if (option.closebtn === undefined) option.closebtn = false; if (option.closebtn === undefined) option.closebtn = false;
if (option.duration === undefined) option.duration = 0; if (option.duration === undefined) option.duration = 0;
if (option.load === undefined) option.load = false; if (option.load === undefined) option.load = false;
var $box = $(this);
if(showDelayTimer){clearTimeout(showDelayTimer);}
if(isShow){
$box.fadeOut('normal', function() {
setupBox(); setupBox();
});
}
else{setupBox();}
function setupBox(){ function setupBox(){
if (msg === undefined){ if (msg === undefined){
msg = "Cannot execute your request. Please make sure you are logged in!!"; msg = "Cannot execute your request. Please make sure you are logged in!!";
option.type = "error"; option.type = "error";
} }
$box.empty();
$box.css('top','-1000px');
$box.show(); $box.show();
$box.append('<div><table id="bcontent"><tr>' + $box.css('top', + ($(window).scrollTop()) +'px');
$box.append('<div id="' + currentBox + '" style="display:none"><table><tr>' +
'<td valign="middle" class="logo ' + option.type + '_message"></td>' + '<td valign="middle" class="logo ' + option.type + '_message"></td>' +
'<td valign="middle"><p>' + msg + '</p></td>' + '<td valign="middle"><p>' + msg + '</p></td>' +
'<td valign="middle" class="b_close"><span id="pClose"></span></td></tr></table></div>'); '<td valign="middle" class="b_close"><span id="pClose'+boxCount+'" class="pClose"></span></td></tr></table></div>');
$("#pClose"+boxCount).bind("click", function() {
close($("#"+currentBox));
});
$("#"+currentBox).fadeIn();
boxCount++;
$(window).scroll(function(){ $(window).scroll(function(){
$box.animate({top:$(window).scrollTop()+"px" },{queue: false, duration: 350}); $box.animate({top:$(window).scrollTop()+"px" },{queue: false, duration: 350});
}); });
h = $("#bcontent").height()+5;
$("#pClose").bind("click", function() {
close();
});
showBox();
if(option.duration !== 0){ if(option.duration !== 0){
showDelayTimer = setTimeout(function(){ showDelayTimer = setTimeout(function(){
showDelayTimer = null; showDelayTimer = null;
close(); close($("#"+currentBox));
}, option.duration); }, option.duration);
} }
}
function showBox(){
if(option.load){ if(option.load){
$(window).load(function(){ $(window).load(function(){
$box.css('top', + ($(window).scrollTop() - h) +'px');
$box.animate({ top:"+=" + h + "px" }, "slow");
isShow = true;
}); });
} }
else{
$box.css('top', + ($(window).scrollTop() - h) +'px');
$box.animate({ top:"+=" + h + "px" }, "slow");
isShow = true;
} }
} function close($elt){
function close(){ $elt.unbind('click');
$box.animate({ top:"-=" + h + "px" }, "slow", function(){ $elt.fadeOut();
$box.fadeOut("normal", function() { $elt.remove();
isShow = false;
});
});
} }
} }
}); });
......
...@@ -55,9 +55,9 @@ $(document).ready(function () { ...@@ -55,9 +55,9 @@ $(document).ready(function () {
if (data.code === 1) { if (data.code === 1) {
$("#edit_info").empty(); $("#edit_info").empty();
name = file.split('/'); name = file.split('/');
if (file.length > 80) { if (file.length > 75) {
//substring title. //substring title.
start = file.length - 80; start = file.length - 75;
path = "..." + file.substring(file.indexOf("/", (start + 1))); path = "..." + file.substring(file.indexOf("/", (start + 1)));
} }
$("#edit_info").append(" " + path); $("#edit_info").append(" " + path);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<script src="{{ url_for('static', filename='js/jquery/jquery-1.10.2.min.js') }}" type="text/javascript" charset="utf-8"></script> <script src="{{ url_for('static', filename='js/jquery/jquery-1.10.2.min.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ url_for('static', filename='js/jquery/jquery-ui-1.10.3.custom.min.js') }}" type="text/javascript" charset="utf-8"></script> <script src="{{ url_for('static', filename='js/jquery/jquery-ui-1.10.3.custom.min.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ url_for('static', filename='js/jquery/jquery.form.js') }}" type="text/javascript" charset="utf-8"></script> <script src="{{ url_for('static', filename='js/jquery/jquery.form.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ url_for('static', filename='js/jquery/popup.js') }}" type="text/javascript" charset="utf-8"></script> <script src="{{ url_for('static', filename='js/jquery/popupBox.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ url_for('static', filename='js/jquery/jqueryToolTip.js') }}" type="text/javascript" charset="utf-8"></script> <script src="{{ url_for('static', filename='js/jquery/jqueryToolTip.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ url_for('static', filename='js/jquery/superfish.min.js') }}" type="text/javascript" charset="utf-8"></script> <script src="{{ url_for('static', filename='js/jquery/superfish.min.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ url_for('static', filename='js/jquery/hoverIntent.js') }}" type="text/javascript" charset="utf-8"></script> <script src="{{ url_for('static', filename='js/jquery/hoverIntent.js') }}" type="text/javascript" charset="utf-8"></script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment