From a4d38233df45f80fb98c503108b40294d212653a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 18 Apr 2013 13:42:43 +0200 Subject: [PATCH] =?utf8?q?Verkn=C3=BCpfte=20Belege:=20JS-Code=20und=20CSS?= =?utf8?q?=20f=C3=BCr=20jqModal=20verallgemeinert?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 2 +- bin/mozilla/do.pl | 2 -- bin/mozilla/ir.pl | 1 - bin/mozilla/is.pl | 1 - bin/mozilla/oe.pl | 2 -- .../record_list.css => kivitendo/jqModal.css} | 8 +++--- js/common.js | 24 ++++++++++++++++++ js/jqModal/jqModal.js | 1 + .../presenter/record/grouped_record_list.html | 25 ++++++------------- .../webpages/record_links/add_filter.html | 7 +----- 10 files changed, 38 insertions(+), 35 deletions(-) rename css/{presenter/record/record_list.css => kivitendo/jqModal.css} (77%) diff --git a/SL/Form.pm b/SL/Form.pm index 044d45f53..8859cae40 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -471,7 +471,7 @@ sub header { main menu list_accounts jquery.autocomplete jquery.multiselect2side frame_header/header ui-lightness/jquery-ui - jquery-ui.custom + jquery-ui.custom jqModal ); $layout->use_javascript("$_.js") for (qw( diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 248bbb1f8..576564fe7 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -313,8 +313,6 @@ sub form_header { $form->{follow_up_trans_info} = $form->{donumber} .'('. $follow_up_vc .')'; - $::request->layout->use_stylesheet('presenter/record/record_list.css'); - $form->header(); # Fix für Bug 1082 Erwartet wird: 'abteilungsNAME--abteilungsID' # und Erweiterung für Bug 1760: diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 3f67961ac..143696311 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -358,7 +358,6 @@ sub form_header { map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts}]; $form->{jsscript} = 1; - $::request->layout->use_stylesheet('presenter/record/record_list.css'); $form->header(); print $form->parse_html_template("ir/form_header", \%TMPL_VAR); diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index d7e99b76d..cbddde60d 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -382,7 +382,6 @@ sub form_header { map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts}]; $form->{jsscript} = 1; - $::request->layout->use_stylesheet('presenter/record/record_list.css'); $form->header(); print $form->parse_html_template("is/form_header", \%TMPL_VAR); diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 298d3326f..3dbb113d1 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -436,8 +436,6 @@ sub form_header { $form->{javascript} .= qq||; $form->{javascript} .= qq||; - $::request->layout->use_stylesheet('presenter/record/record_list.css'); - $form->header; $TMPL_VAR{HIDDENS} = [ map { name => $_, value => $form->{$_} }, diff --git a/css/presenter/record/record_list.css b/css/kivitendo/jqModal.css similarity index 77% rename from css/presenter/record/record_list.css rename to css/kivitendo/jqModal.css index 59ab17772..7c8c92fd2 100644 --- a/css/presenter/record/record_list.css +++ b/css/kivitendo/jqModal.css @@ -1,5 +1,5 @@ /* the overlayed element */ -.record_list_overlay { +.jqModal_overlay { position: fixed; top: 50%; margin-top: -250px; @@ -20,14 +20,14 @@ padding: 10px; } -.record_list_overlay .overlay_content { +.jqModal_overlay .overlay_content { width: 790px; height: 490px; overflow: auto; } -.record_list_overlay .close { - background-image: url(../../../image/dialog-close.png); +.jqModal_overlay .close { + background-image: url(../../image/dialog-close.png); position: absolute; right: -16px; top: -16px; diff --git a/js/common.js b/js/common.js index e40b9abfe..d2594a277 100644 --- a/js/common.js +++ b/js/common.js @@ -160,6 +160,30 @@ function focus_by_name(name){ return false; } +function open_jqm_window(params) { + params = params || { }; + var url = params.url; + var id = params.id ? params.id : 'jqm_popup_dialog'; + + if (params.data) { + var data = typeof params.data === "string" ? params.data : $.param(params.data); + url += (/\?/.exec(url) ? "&" : "?") + data; + } + + $('#' + id).remove(); + var div = $('
').hide().appendTo('body'); + var close = $('
').appendTo(div); + var content = $('
').appendTo(div); + div.jqm({ modal: true }); + div.jqmShow(); + $.ajax({ url: url, success: function(new_html) { $(content).html(new_html); } }); + $(close).click(function() { + div.jqmClose(); + }); + + return true; +} + $(document).ready(function () { // initialize all jQuery UI tab elements: $(".tabwidget").each(function(idx, element) { $(element).tabs(); }); diff --git a/js/jqModal/jqModal.js b/js/jqModal/jqModal.js index db318ffb8..db1dd9e7c 100644 --- a/js/jqModal/jqModal.js +++ b/js/jqModal/jqModal.js @@ -34,6 +34,7 @@ $.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');}; $.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');}; $.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});}; $.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});}; +$.fn.jqmClose=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t);this.remove();});}; $.jqm = { hash:{}, diff --git a/templates/webpages/presenter/record/grouped_record_list.html b/templates/webpages/presenter/record/grouped_record_list.html index 82c16f35c..9602388cf 100644 --- a/templates/webpages/presenter/record/grouped_record_list.html +++ b/templates/webpages/presenter/record/grouped_record_list.html @@ -17,25 +17,14 @@