* update zui files.

This commit is contained in:
Catouse
2018-05-08 10:58:19 +08:00
parent dda5c7977f
commit eee114b4d6
4 changed files with 2 additions and 399 deletions
-54
View File
@@ -1,55 +1 @@
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
<?php
$clientLang = $this->app->getClientLang();
if($config->debug)
{
css::import($jsRoot . 'jquery/datetimepicker/min.css');
js::import($jsRoot . 'jquery/datetimepicker/min.js');
}
?>
<script language='javascript'>
$(function()
{
$.fn.fixedDate = function()
{
return $(this).each(function()
{
var $this = $(this);
if(!$this.data('pickerPosition') && $this.offset().top + 200 > $(document.body).height())
{
$this.attr('data-picker-position', 'top-right');
}
if($this.val() == '0000-00-00')
{
$this.focus(function(){if($this.val() == '0000-00-00') $this.val('').datetimepicker('update');}).blur(function(){if($this.val() == '') $this.val('0000-00-00')});
}
});
};
var options =
{
language: '<?php echo $clientLang; ?>',
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
forceParse: 0,
showMeridian: 1,
format: 'yyyy-mm-dd hh:ii',
startDate: '1970-1-1'
}
$('.form-datetime').fixedDate().datetimepicker(options);
$('.form-date').fixedDate().datetimepicker($.extend(options, {minView: 2, format: 'yyyy-mm-dd'}));
$('.form-time').fixedDate().datetimepicker($.extend(options, {startView: 1, minView: 0, maxView: 1, format: 'hh:ii'}));
$('.datepicker-wrapper').click(function()
{
$(this).find('.form-date, .form-datetime, .form-time').datetimepicker('show').focus();
});
window.datepickerOptions = options;
});
</script>
-289
View File
@@ -911,294 +911,6 @@ function isNum(s)
return false;
}
/**
* Set modal load content with ajax or iframe
*
* @access public
* @return void
*/
function setModal()
{
jQuery.fn.modalTrigger = function(setting)
{
return $(this).each(function()
{
var $this = $(this);
$this.off('click.modalTrigger.zui');
$this.on('click.modalTrigger.zui', function(event)
{
var $e = $(this);
if($e.closest('.body-modal').length) return;
if($e.hasClass('disabled')) return false;
var url = (setting ? setting.url : false) || $e.attr('href') || $e.data('url');
var type = (setting ? setting.type : false) || ($e.hasClass('iframe') ? 'iframe' : ($e.data('type') || 'ajax'));
if(type == 'iframe')
{
var options = $.extend(
{
url: url,
title: $e.attr('title') || $e.text(),
cssClass: $e.data('class'),
icon: '?',
center: true
}, setting, $e.data());
if(options.icon == '?')
{
var i = $e.find("[class^='icon-']");
options.icon = i.length ? i.attr('class').substring(5) : 'file-text';
}
showIframeModal(options);
}
else
{
initModalFrame();
$.get(url, function(data)
{
var options = $.extend(
{
width: 800,
title: $e.attr('title') || $e.text(),
icon: '?',
backdrop: 'static',
show: true
}, setting, $e.data());
var ajaxModal = $('#ajaxModal');
if(data.indexOf('modal-dialog') < 0)
{
data = "<div class='modal-dialog modal-ajax' style='width: {width};'><div class='modal-content'><div class='modal-header'><button class='close' data-dismiss='modal'>×</button><h4 class='modal-title'><i class='icon-{icon}'></i> {title}</h4></div><div class='modal-body' style='height:{height}'>{content}</div></div></div>".format($.extend({content: data}, options));
}
ajaxModal.html(data);
/* Set the width of modal dialog. */
if(options.width)
{
var modalWidth = parseInt(options.width);
$ajaxModal.data('width', modalWidth).find('.modal-dialog').css('width', modalWidth);
ajustModalPosition();
}
ajaxModal.modal(options);
});
}
/* Save the href to rel attribute thus we can save it. */
$('#ajaxModal').attr('rel', url);
event.preventDefault();
return false;
});
});
}
function showIframeModal(settings)
{
var options =
{
width: 800,
height: 'auto',
icon: '?',
title: '',
name: 'modalIframe',
cssClass: '',
headerless: false,
waittime: 0,
center: true,
backdrop: 'static',
show: true
};
if(typeof(settings) == 'string')
{
options.url = settings;
}
else
{
options = $.extend(options, settings);
}
initModalFrame(options);
if(isNum(options.height.toString())) options.height += 'px';
if(isNum(options.width.toString())) options.width += 'px';
if(options.size == 'fullscreen')
{
var $w = $(window);
options.width = $w.width();
options.height = $w.height();
options.cssClass += ' fullscreen';
}
if(options.headerless)
{
options.cssClass += ' hide-header';
}
if(typeof(options.url) == 'undefined' || !options.url) return false;
var modal = $('#ajaxModal').addClass('modal-loading').data('first', true);
modal.html("<div class='icon-spinner icon-spin loader'></div><div class='modal-dialog modal-iframe' style='width: {width};'><div class='modal-content'><div class='modal-header'><button class='close' data-dismiss='modal'>×</button><h4 class='modal-title'><i class='icon-{icon}'></i> {title}</h4></div><div class='modal-body' style='height:{height}'><iframe id='{name}' name='{name}' src='{url}' frameborder='no' allowtransparency='true' scrolling='auto' hidefocus='' style='width: 100%; height: 100%; left: 0px;'></iframe></div></div></div>".format(options));
var modalBody = modal.find('.modal-body'), dialog = modal.find('.modal-dialog');
if(options.cssClass)
{
dialog.addClass(options.cssClass);
}
if(options.waittime > 0)
{
options.waitingFuc = setTimeout(function(){showModal(options, modal, modalBody, dialog);}, options.waittime );
}
var frame = document.getElementById(options.name);
frame.onload = frame.onreadystatechange = function()
{
if(this.readyState && this.readyState != 'complete') return;
if(modal.data('first') && (!modal.hasClass('modal-loading'))) return;
if(!modal.data('first')) modal.addClass('modal-loading');
if(options.waittime > 0)
{
clearTimeout(options.waitingFuc);
}
showModal(options, modal, modalBody, dialog);
}
modal.modal(options);
}
function showModal(options, modal, modalBody, dialog)
{
modalBody.css('height', options.height - modal.find('.modal-header').outerHeight());
try
{
var frame$ = window.frames[options.name].$;
frame$(function()
{
if(frame$('#titlebar').length || frame$('.main-header').length || frame$('.modal-header').length || frame$('#mainMenu').length)
{
modal.addClass('with-titlebar');
if(options.size == 'fullscreen')
{
modalBody.css('height', options.height);
}
}
if(options.height == 'auto')
{
var $framebody = frame$('body');
setTimeout(function()
{
modal.removeClass('fade');
var fbH = $framebody.addClass('body-modal').outerHeight();
frame$('#titlebar > .heading a').each(function()
{
var $a = frame$(this);
$a.replaceWith("<strong class='heading-title'>" + $a.text() + "</strong>");
});
if(typeof fbH == 'object') fbH = $framebody.height();
modalBody.css('height', fbH);
ajustModalPosition();
if(modal.data('first')) modal.data('first', false);
modal.removeClass('modal-loading').addClass('fade');
}, 100);
$framebody.resize(function()
{
var fbH = $framebody.outerHeight();
if(typeof fbH == 'object') fbH = $framebody.height();
modalBody.css('height', fbH);
ajustModalPosition();
});
}
else
{
modal.removeClass('modal-loading');
}
})
if(frame$)
{
frame$.extend({'closeModal': $.closeModal});
}
}
catch(e)
{
modal.removeClass('modal-loading');
}
}
function initModalFrame(setting)
{
if($('#ajaxModal').length)
{
/* unbind all events */
$('#ajaxModal').attr('class', 'modal fade').off('show.zui.modal shown.zui.modal hide.zui.modal hidden.zui.modal');
}
else
{
/* Addpend modal div. */
$('<div id="ajaxModal" class="modal fade"></div>').appendTo('body');
}
$ajaxModal = $('#ajaxModal');
$ajaxModal.data('cancel-reload', false);
$.extend({'closeModal':function(callback, location)
{
$ajaxModal.on('hidden.zui.modal', function()
{
if(location && (!$ajaxModal.data('cancel-reload')))
{
if(location == 'this') window.location.reload();
else window.location = location;
}
if(callback && $.isFunction(callback)) callback();
});
$ajaxModal.modal('hide');
}, 'cancelReloadCloseModal': function(){$ajaxModal.data('cancel-reload', true);}});
/* rebind events */
if(!setting) return;
if(setting.afterShow && $.isFunction(setting.afterShow)) $ajaxModal.on('show.zui.modal', setting.afterShow);
if(setting.afterShown && $.isFunction(setting.afterShown)) $ajaxModal.on('shown.zui.modal', setting.afterShown);
if(setting.afterHide && $.isFunction(setting.afterHide)) $ajaxModal.on('hide.zui.modal', setting.afterHide);
if(setting.afterHidden && $.isFunction(setting.afterHidden)) $ajaxModal.on('hidden.zui.modal', setting.afterHidden);
}
function ajustModalPosition(position, dialog)
{
position = position || 'fit';
if(!dialog) dialog = $('#ajaxModal .modal-dialog');
if(position)
{
var half = Math.max(0, ($(window).height() - dialog.outerHeight())/2);
var pos = position == 'fit' ? (half*2/3) : (position == 'center' ? half : position);
dialog.css('margin-top', pos);
}
}
$.extend({ajustModalPosition: ajustModalPosition, modalTrigger: showIframeModal, colorbox: function(setting)
{
if((typeof setting == 'object') && setting.iframe)
{
$.modalTrigger({type: 'iframe', width: setting['width'], afterHide: setting['onCleanup'], url: setting['href']});
}
}});
$('[data-toggle=modal], a.iframe').modalTrigger();
jQuery.fn.colorbox = function(setting)
{
if((typeof setting == 'object') && setting.iframe)
{
$(this).modalTrigger({type: 'iframe', width: setting['width'], afterHide: setting['onCleanup'], url: setting['href']});
}
}
}
/**
* Set modal for list page.
*
@@ -1962,7 +1674,6 @@ $(document).ready(function()
if(typeof(config.onlybody) != 'undefined' && config.onlybody == 'yes') checkOnlybodyPage();
$('body').addClass('m-{currentModule}-{currentMethod}'.format(config));
setModal();
setTableBehavior();
setForm();
saveWindowSize();
+2 -2
View File
File diff suppressed because one or more lines are too long
-54
View File
@@ -8,57 +8,3 @@
* @version $Id: style.css 1454 2009-10-23 01:45:26Z wwccss $
* @link http://www.zentao.net
*/
/* === CSS HELPERS === */
/* Width definitions */
.w-p5 {width: 5%} .w-p10 {width: 10%} .w-p15 {width: 15%} .w-p20 {width: 20%} .w-p25 {width: 25%} .w-p30 {width: 30%} .w-p35 {width: 35%} .w-p40 {width: 40%} .w-p45 {width: 45%} .w-p50 {width: 50%} .w-p55 {width: 55%} .w-p60 {width: 60%} .w-p65 {width: 65%} .w-p70 {width: 70%} .w-p75 {width: 75%} .w-p80 {width: 80%} .w-p85 {width: 85%} .w-p90 {width: 90%} .w-p94 {width: 94%} .w-p95 {width: 95%} .w-p98 {width: 98%} .w-p99 {width: 99%} .w-p100{width: 100%}
.w-auto {width: auto} .w-10px {width:10px} .w-20px {width:20px} .w-30px {width:30px} .w-35px {width:35px} .w-40px {width:40px} .w-45px {width:45px} .w-50px {width:50px} .w-60px {width:60px} .w-70px {width:70px} .w-80px {width:80px} .w-90px {width:90px} .w-100px {width:100px} .w-110px {width:110px} .w-120px {width:120px} .w-130px {width:130px} .w-140px {width:140px} .w-150px {width:150px} .w-160px {width:160px} .w-180px {width:180px} .w-200px {width:200px} .w-230px {width:230px} .w-250px {width:250px} .w-300px {width:300px} .w-400px {width:400px} .w-500px {width:500px} .w-600px {width:600px} .w-700px {width:700px} .w-800px {width:800px} .w-900px {width:900px}
.mw-200px {max-width:200px!important} .mw-300px {max-width:300px!important} .mw-400px {max-width:400px!important} .mw-500px {max-width:500px!important} .mw-600px {max-width:600px!important} .mw-700px {max-width:700px!important} .mw-800px {max-width:800px!important} .mw-900px {max-width:900px!important} .mw-1400px {max-width:1400px!important}
.w-id {width:70px;} .w-pri {width:40px;} .w-severity {width:50px;} .w-hour {width:57px;} .w-date {width:90px;} .w-user {width:80px;} .w-status {width:60px} .w-type {width:80px} .w-resolution {width:70px}
.w-p15-f {width: 15% !important; min-width: 120px} .w-p25-f {width: 25% !important; min-width: 200px} .w-p35-f {width: 35% !important; min-width: 300px} .w-p45-f {width: 45% !important; min-width: 400px}
/* Height definitions */
.h-5px {height:5px} .h-10px {height:10px} .h-20px {height:20px} .h-30px {height:30px} .h-35px {height:35px} .h-40px {height:40px} .h-45px {height:45px} .h-50px {height:50px} .h-60px {height:60px} .h-70px {height:70px} .h-80px {height:80px} .h-100px {height:100px} .h-120px {height:120px} .h-130px {height:130px} .h-140px {height:140px} .h-150px {height:150px} .h-200px {height:200px}
/* paddings and margins */
.pd-0 {padding: 0 !important}
.mg-0 {margin: 0 !important}
.mgb-20 {margin-bottom: 20px !important}
.mgb-10 {margin-bottom: 10px !important}
.pdb-20 {padding-bottom: 20px !important}
.pdt-20 {padding-top: 20px !important}
/* borders */
.br-0 {border-radius: 0!important}
.bd-0, .borderless, .bd-none {border: none !important;}
/* backgrounds */
.bg-none {background: none!important}
/* Style of text */
.text-latin {font-family: Arial;}
.text-strong {font-weight: bold;}
.text-middle,.text-middle td {vertical-align: middle !important;}
tr.text-center > td, tr.text-center > th {text-align: center;}
tr.text-center > td.text-left, tr.text-center > th.text-left {text-align: left;}
tr.text-center > td.text-right, tr.text-center > th.text-right {text-align: right;}
.text-top, tr.text-top td, tr.text-top th {vertical-align: top!important;}
/* === Components === */
/* remove outline of links */
a,a:focus,a:active {text-decoration: none; outline:none;}
.modal-content {background-color:#fff;}
body.body-modal{padding-bottom:0px;}
body.body-modal .container{padding:0px;}
body.body-modal #mainMenu{margin-top:5px;}
.modal-iframe .modal-body {padding: 0;}
.modal.with-titlebar .modal-header, .modal-dialog.hide-header .modal-header{position: relative; height: 0; padding: 0; border: none; z-index: 999; min-height: 0}
.modal.with-titlebar .modal-header .modal-body, .modal-dialog.hide-header .modal-header .modal-body {z-index: 990}
.modal.with-titlebar .modal-header .modal-title, .modal-dialog.hide-header .modal-header .modal-title {display: none}
.modal.with-titlebar .modal-header .close, .modal-dialog.hide-header .modal-header .close {position: absolute; right: 0px; top: 15px}
.search-list .list-group {max-height: 214px; height:auto !important;}