Mailing List Archive

svn commit: r1351211 - in /perl/embperl/trunk: ./ Embperl/Form/ Embperl/Form/Control/ eg/forms/css/ eg/forms/js/ eg/forms/wizard/ test/conf/
Author: richter
Date: Mon Jun 18 06:12:05 2012
New Revision: 1351211

URL: http://svn.apache.org/viewvc?rev=1351211&view=rev
Log:
-

Modified:
perl/embperl/trunk/Changes.pod
perl/embperl/trunk/Embperl.pm
perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm
perl/embperl/trunk/Embperl/Form/DataSource.pm
perl/embperl/trunk/eg/forms/css/EmbperlForm.css
perl/embperl/trunk/eg/forms/js/EmbperlForm.js
perl/embperl/trunk/eg/forms/wizard/base.epl
perl/embperl/trunk/epinit.c
perl/embperl/trunk/mod_embperl.c
perl/embperl/trunk/test/conf/httpd.conf.src
perl/embperl/trunk/test/conf/startup.pl

Modified: perl/embperl/trunk/Changes.pod
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Changes.pod?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/Changes.pod (original)
+++ perl/embperl/trunk/Changes.pod Mon Jun 18 06:12:05 2012
@@ -1,5 +1,6 @@
=pod

+
=head 2.4.1

- Fix problem with error output on stderr for Windows 64Bit

Modified: perl/embperl/trunk/Embperl.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl.pm?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl.pm (original)
+++ perl/embperl/trunk/Embperl.pm Mon Jun 18 06:12:05 2012
@@ -49,7 +49,7 @@ use vars qw(

@ISA = qw(Exporter DynaLoader);

-$VERSION = '2.4.0' ;
+$VERSION = '2.5.0_1' ;


if ($modperl = $ENV{MOD_PERL})
@@ -501,6 +501,7 @@ sub export
use strict ;
}

+
#######################################################################################

package Apache::Embperl;

Modified: perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm Mon Jun 18 06:12:05 2012
@@ -148,8 +148,7 @@ control_link_setup($( "#_inp_[.+ $self ->
}
$target = '' ;
$target = "parent.frames.$self->{link_target}." if ($self -> {link_target}) ;
- $self -> {showurl} ||= 'ldapTreeData.epl?-id=' ;
- $self -> {datasrcurl} ||= '/epfctrl/datasrc.exml' ;
+ $self -> {datasrcurl} ||= '/epfctrl/datasrc.json?datasrc=%datasrc%' ;
my $class = $self -> {class} ;
$]
<div class="ui-widget">

Modified: perl/embperl/trunk/Embperl/Form/DataSource.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/DataSource.pm?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/DataSource.pm (original)
+++ perl/embperl/trunk/Embperl/Form/DataSource.pm Mon Jun 18 06:12:05 2012
@@ -95,6 +95,19 @@ sub get_option_from_value

# ---------------------------------------------------------------------------
#
+# get_id_from_value - returns id for a given value
+#
+
+sub get_id_from_value
+
+ {
+ my ($self, $value) = @_ ;
+
+ return $value ;
+ }
+
+# ---------------------------------------------------------------------------
+#
# get_datasource_controls - returns additional controls provided by the
# datasource object e.g. a browse button
#
@@ -136,7 +149,13 @@ that could be overwritten to customize t
=head2 get_values

returns the values and options. Must be overwritten.
-
+
+=head3 get_id_from_value
+
+returns an id for a given value. This allow to have an id form an value/option
+pair which is not excat the same as the value. This is used in json requests
+for example for selectdyn control.
+
=head3 get_datasource_controls

returns additional controls provided by the

Modified: perl/embperl/trunk/eg/forms/css/EmbperlForm.css
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/eg/forms/css/EmbperlForm.css?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/eg/forms/css/EmbperlForm.css (original)
+++ perl/embperl/trunk/eg/forms/css/EmbperlForm.css Mon Jun 18 06:12:05 2012
@@ -39,6 +39,7 @@ table {


/* --- Embperl::Form --- */
+#topdiv { width: 850px ; margin-left: auto; margin-right: auto }

.cBase {font-family: Geneva,Arial,Helvetica; font-size: 11px; }
.cTableDiv {background: #ffffff; border: black 1px solid;

Modified: perl/embperl/trunk/eg/forms/js/EmbperlForm.js
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/eg/forms/js/EmbperlForm.js?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/eg/forms/js/EmbperlForm.js (original)
+++ perl/embperl/trunk/eg/forms/js/EmbperlForm.js Mon Jun 18 06:12:05 2012
@@ -289,166 +289,642 @@ function addremoveRemoveOption (doc, src

// -----------------------------------------------------------------------------

-
-
-var Grid = Class.create() ;
-
-Grid.prototype = {
-
-initialize: function (tableelement, rowelement, maxelement)
- {
- this.rowelement = rowelement ;
- this.maxelement = maxelement ;
- this.tableelement = tableelement ;
- Event.observe(this.tableelement, "click", this.onClick.bindAsEventListener(this));
- Event.observe(this.tableelement, "focus", this.onClick.bindAsEventListener(this));
- Event.observe(this.tableelement, "keyup", this.onClick.bindAsEventListener(this));
-
- rows = this.tableelement.getElementsByTagName('tr');
- lastrow = rows[rows.length - 1] ;
- newid = this.tableelement.id ;
- newid = newid + '-row-' ;
- lastid = lastrow.id ;
- idlength = newid.length ;
- this.lastnum = parseInt (lastid.substr(idlength)) ;
- if (isNaN(this.lastnum))
- this.lastnum = -1 ;
- },
-
-
-addRow: function ()
+function autocomplete_req ( request, response)
{
- var rows = this.tableelement.getElementsByTagName('tr');
- var lastrow = rows[rows.length - 1] ;
+ var term = request.term;

- this.lastnum = this.lastnum + 1 ;
- var inserttext = this.rowelement.innerHTML ;
- var newtext = inserttext.replace (/%row%/gi, this.lastnum) ;
- newtext = newtext.replace (/<tbody>/gi, '') ;
- newtext = newtext.replace (/<\/tbody>/gi, '') ;
- newtext = newtext.replace (/<x-script/gi, '<script') ;
- newtext = newtext.replace (/<\/x-script/gi, '</script') ;
- new Insertion.After (lastrow, newtext) ;
- this.maxelement.value = this.lastnum + 1 ;
- },
+ var url=this.options.url;
+ var terms = term.split (' ', 1) ;
+ var i = encodeURIComponent(terms[0]);
+ url=url.replace(/%term%/g, i);
+ url=url.replace(/%datasrc%/g, this.options.datasrc);
+
+ $.getJSON( url, request,
+ function( data, status, xhr )
+ {
+ response( data )
+ }
+ );
+ } ;

-focusRow: function ()
+function autocomplete_setup (elem, opts)
{
- var next = this.currRow ;
- if (next && next.className == 'cGridRow')
+ function autocomplete_select (event, ui)
{
- next.className='cGridRowSelected' ;
- while (next && (next.tagName != 'INPUT' || next.tagName != 'SELECT'))
+ id = this.id ;
+ ctlname = id.replace (/_inp_/, '') ;
+ ctlid = id.replace (/_inp_/, '_id_') ;
+
+ document.getElementById(ctlname).value = ui.item.post ;
+ document.getElementById(ctlid).value = ui.item.id ;
+
+ if (opts.show_on_select)
{
- next = next.firstChild ;
+ i = encodeURIComponent(ui.item.id);
+ if (opts.use_ajax)
+ {
+ $('#' + opts.use_ajax).doload (opts.showurl.replace(/%id%/g, i)) ;
+ document.getElementById(ctlname).value = '' ;
+ document.getElementById(ctlid).value = '' ;
+ document.getElementById(id).value = '' ;
+ return false ;
+ }
+ else
+ location.href=opts.showurl.replace(/%id%/g, i);
}
- if (next)
- next.focus() ;
+
+ return true ;
+ } ;
+
+
+
+
+ elem.autocomplete(
+ {
+ source: autocomplete_req,
+ select: autocomplete_select,
+ minLength: 3,
+ delay: 400,
+ url: opts.datasrcurl,
+ datasrc: opts.datasrc
+ }) ;
+
+ var id = elem[0].id ;
+ var ctlid = id.replace (/_inp_/, '_id_') ;
+
+ elem.qtip(
+ {
+ content: {
+ text: '<img style="text-align: center" src="/_appserv/css/images/ui-anim_basic_16x16.gif" alt="Loading..." />',
+ ajax: {
+ url: '#', // URL to the local file
+ type: 'GET', // POST or GET
+ once: false,
+ xcache: false,
+ idsrc: document.getElementById (ctlid),
+ urlsrc: opts.popupurl,
+ urlfunc: function (opts)
+ {
+ i = encodeURIComponent(opts.idsrc.value);
+ if (i)
+ {
+ opts.url=opts.urlsrc.replace(/%id%/g, i);
+ return true ;
+ }
+ return false ;
+ }
+ }
+ },
+ position: {
+ at: 'bottom center', // Position the tooltip above the link
+ my: 'top center',
+ adjust: { screen: true } // Keep the tooltip on-screen at all times
+ },
+ show: {
+ event: 'mouseenter',
+ solo: true, // Only show one tooltip at a time
+ delay: 1000
+ },
+ hide: {
+ event: 'mouseleave click',
+ fixed: true,
+ delay: 300
+ },
+ style: {
+ classes: 'ui-tooltip-blue ui-tooltip-shadow',
+ xwidget: true
}
- },
+ });

-delRow: function (row)
+ elem.dblclick (
+ function (event)
+ {
+ i = encodeURIComponent(document.getElementById(ctlid).value);
+ if (opts.use_ajax)
+ {
+ $('#' + opts.use_ajax).doload (opts.showurl.replace(/%id%/g, i)) ;
+ }
+ else
+ location.href=opts.showurl.replace(/%id%/g, i);
+ }
+ ) ;
+ }
+
+
+
+// -----------------------------------------------------------------------------
+
+
+function control_link_setup (elem, opts)
{
- if (row != undefined)
- this.currRow = row ;
- if (this.currRow)
- {
- var next = this.currRow.nextSibling ;
- var p = this.currRow.parentNode ;
- p.removeChild(this.currRow) ;
- this.currRow = next ;
- this.focusRow () ;
+
+ var id = elem[0].id ;
+ var ctlid = id.replace (/_inp_/, '') ;
+
+ elem.qtip(
+ {
+ content: {
+ text: '<img style="text-align: center" src="/_appserv/css/images/ui-anim_basic_16x16.gif" alt="Loading..." />',
+ ajax: {
+ url: '#', // URL to the local file
+ type: 'GET', // POST or GET
+ once: false,
+ xcache: false,
+ idsrc: document.getElementById (ctlid),
+ urlsrc: opts.popupurl,
+ urlfunc: function (opts)
+ {
+ var id = opts.idsrc.value ;
+ id = id.replace(/^.+@#/, '');
+ i = encodeURIComponent(id);
+ if (i)
+ {
+ opts.url=opts.urlsrc.replace(/%id%/g, i);
+ return true ;
+ }
+ return false ;
+ }
+ }
+ },
+ position: {
+ at: 'bottom center', // Position the tooltip above the link
+ my: 'top center',
+ adjust: { screen: true } // Keep the tooltip on-screen at all times
+ },
+ show: {
+ event: 'mouseenter',
+ solo: true, // Only show one tooltip at a time
+ delay: 1000
+ },
+ hide: {
+ event: 'mouseleave click',
+ fixed: true,
+ delay: 300
+ },
+ style: {
+ classes: 'ui-tooltip-blue ui-tooltip-shadow',
+ xwidget: true
}
- },
+ });

-upRow: function (row)
- {
- if (row != undefined)
- this.currRow = row ;
- if (this.currRow)
- {
- var prev = $(this.currRow).previous () ;
- if (prev && prev.className == 'cGridRow')
- {
- var currorder = this.currRow.getElementsByTagName('input');
- var prevorder = prev.getElementsByTagName('input');
- var n = currorder[0].value ;
- currorder[0].value = prevorder[0].value ;
- prevorder[0].value = n ;
+ elem.click (
+ function (event)
+ {
+ var id = document.getElementById(ctlid).value ;
+ id = id.replace(/^.+@#/, '');
+ i = encodeURIComponent(id);
+ if (opts.use_ajax)
+ {
+ $('#' + opts.use_ajax).doload (opts.showurl.replace(/%id%/g, i)) ;
+ }
+ else
+ location.href=opts.showurl.replace(/%id%/g, i);
+ }
+ ) ;
+ }

- var p = this.currRow.parentNode ;
- var currdata = p.removeChild(this.currRow) ;
- this.currRow = p.insertBefore(currdata, prev) ;

- this.focusRow () ;
- }
+
+// -----------------------------------------------------------------------------
+
+function add_qtip (elem, url)
+ {
+
+ elem.qtip(
+ {
+ content: {
+ text: '<img style="text-align: center" src="/_appserv/css/images/ui-anim_basic_16x16.gif" alt="Loading..." />',
+ ajax: {
+ url: '#', // URL to the local file
+ type: 'GET', // POST or GET
+ once: false,
+ url: url
+ }
+ },
+ position: {
+ at: 'bottom center', // Position the tooltip above the link
+ my: 'top left',
+ adjust: { screen: true } // Keep the tooltip on-screen at all times
+ },
+ show: {
+ event: 'mouseenter',
+ solo: true, // Only show one tooltip at a time
+ delay: 1000
+ },
+ hide: {
+ event: 'mouseleave click',
+ fixed: true,
+ delay: 300
+ },
+ style: {
+ classes: 'ui-tooltip-blue ui-tooltip-shadow',
+ xwidget: true
}
- },
+ });
+
+ }
+

-downRow: function (row)
+
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+
+function eplGrid (tableelement, rowelement, maxelement, addelement, delelement,
+ upelement, downelement, onchange)
{
- if (row != undefined)
- this.currRow = row ;
- if (this.currRow)
+ var self = this ;
+
+
+ $.extend(self, {
+ initialize: function (tableelement, rowelement, maxelement, addelement,
+ delelement, upelement, downelement,
+ onchange)
{
- var next = $(this.currRow).next () ;
+ this.rowelement = rowelement ;
+ this.maxelement = maxelement ;
+ this.tableelement = tableelement ;
+ this.onchangehandler = onchange ;
+
+ tableelement.click (function(e) {self.onClick (e)});
+ tableelement.focus (function(e) {self.onClick (e)});
+ tableelement.keyup (function(e) {self.onClick (e)});
+ if (addelement)
+ addelement.click (function(e) {self.addRow ()});
+ if (delelement)
+ delelement.click (function(e) {self.delRow ()});
+ if (upelement)
+ upelement.click (function(e) {self.upRow ()});
+ if (downelement)
+ downelement.click (function(e) {self.downRow ()});
+
+ //rows = this.tableelement.getElementsByTagName('tr');
+ var rows = tableelement.find('tr') ;
+ var lastrow = rows.last() ;
+ var newid = this.tableelement[0].id ;
+ newid = newid + '-row-' ;
+ var lastid = lastrow[0].id ;
+ var idlength = newid.length ;
+ this.lastnum = parseInt (lastid.substr(idlength)) ;
+ if (isNaN(this.lastnum))
+ this.lastnum = -1 ;
+ },
+
+
+ addRow: function ()
+ {
+ var rows = this.tableelement.find('tr');
+ var lastrow = rows.last() ;
+
+ this.lastnum = this.lastnum + 1 ;
+ var inserttext = this.rowelement.html() ;
+ var newtext = inserttext.replace (/%row%/gi, this.lastnum) ;
+ newtext = newtext.replace (/<tbody>/gi, '') ;
+ newtext = newtext.replace (/<\/tbody>/gi, '') ;
+ newtext = newtext.replace (/<x-script/gi, '<script') ;
+ newtext = newtext.replace (/<\/x-script/gi, '</script') ;
+ lastrow.after (newtext) ;
+ this.maxelement[0].value = this.lastnum + 1 ;
+ if (this.onchangehandler)
+ this.onchangehandler (this.tableelement) ;
+ },
+
+ focusRow: function ()
+ {
+ var next = this.currRow ;
if (next && next.className == 'cGridRow')
{
- var currorder = this.currRow.getElementsByTagName('input');
- var nextorder = next.getElementsByTagName('input');
- var n = currorder[0].value ;
- currorder[0].value = nextorder[0].value ;
- nextorder[0].value = n ;
+ next.className='cGridRowSelected' ;
+ while (next && (next.tagName != 'INPUT' || next.tagName != 'SELECT'))
+ {
+ next = next.firstChild ;
+ }
+ if (next)
+ next.focus() ;
+ }
+ },

- var next2 = next.next () ;
+ delRow: function (row)
+ {
+ if (row != undefined)
+ this.currRow = row ;
+ if (this.currRow)
+ {
+ var next = $(this.currRow).next('tr') ;
var p = this.currRow.parentNode ;
- var currdata = p.removeChild(this.currRow) ;
- this.currRow = p.insertBefore(currdata, next2) ;
-
+ p.removeChild(this.currRow) ;
+ this.currRow = next[0] ;
this.focusRow () ;
+ if (this.onchangehandler)
+ this.onchangehandler (this.tableelement) ;
}
- }
- },
+ },

+
+ upRow: function (row) //TODO
+ {
+ if (row != undefined)
+ this.currRow = row ;
+ if (this.currRow)
+ {
+ var prev = $(this.currRow).prev ()[0] ;
+ if (prev && prev.className == 'cGridRow')
+ {
+ var currorder = this.currRow.getElementsByTagName('input');
+ var prevorder = prev.getElementsByTagName('input');
+ var n = currorder[0].value ;
+ currorder[0].value = prevorder[0].value ;
+ prevorder[0].value = n ;
+
+ var p = this.currRow.parentNode ;
+ var currdata = p.removeChild(this.currRow) ;
+ this.currRow = p.insertBefore(currdata, prev) ;
+
+ this.focusRow () ;
+ if (this.onchangehandler)
+ this.onchangehandler (this.tableelement) ;
+ }
+ }
+ },

-onClick: function (e)
- {
- var elem = e.target?e.target:e.srcElement ;
- if (e.type == 'keyup' && ((e.which && e.which == e.DOM_VK_ADD) || e.keyCode == 107) && e.altKey)
+ downRow: function (row) //TODO
{
- this.addRow () ;
- e.cancelBubble = true ;
- return false ;
- }
+ if (row != undefined)
+ this.currRow = row ;
+ if (this.currRow)
+ {
+ var next = $(this.currRow).next ()[0] ;
+ if (next && next.className == 'cGridRow')
+ {
+ var currorder = this.currRow.getElementsByTagName('input');
+ var nextorder = next.getElementsByTagName('input');
+ var n = currorder[0].value ;
+ currorder[0].value = nextorder[0].value ;
+ nextorder[0].value = n ;
+
+ var next2 = $(next).next ()[0] ;
+ var p = this.currRow.parentNode ;
+ var currdata = p.removeChild(this.currRow) ;
+ this.currRow = p.insertBefore(currdata, next2) ;
+
+ this.focusRow () ;
+ if (this.onchangehandler)
+ this.onchangehandler (this.tableelement) ;
+ }
+ }
+ },
+

- var p = elem ;
- while (p && p.tagName != 'TR')
+ onClick: function (e)
{
- p = p.parentNode ;
+ var elem = e.target ;
+ if (e.type == 'keyup' && ((e.which && e.which == e.DOM_VK_ADD) || e.keyCode == 107) && e.altKey)
+ {
+ this.addRow () ;
+ e.cancelBubble = true ;
+ return false ;
+ }
+
+ var p = elem ;
+ while (p && p.tagName != 'TR')
+ {
+ p = p.parentNode ;
+ }
+ if (p)
+ {
+ if (this.currRow)
+ this.currRow.className='cGridRow' ;
+
+ if (p.className == 'cGridRow')
+ {
+ p.className='cGridRowSelected' ;
+ this.currRow=p ;
+ }
+ else
+ {
+ this.currRow=null ;
+ }
+ if (this.currRow && e.type == 'keyup' && ((e.which && e.which == e.DOM_VK_SUBTRACT) || e.keyCode == 109) && e.altKey)
+ {
+ this.delRow (this.currRow) ;
+ e.cancelBubble = true ;
+ return false ;
+ }
+ }
+ //alert ('t='+elem.tagName +' p='+ p.id+' c='+p.className) ;
}
- if (p)
- {
- if (this.currRow)
- this.currRow.className='cGridRow' ;
+ }) ;
+
+ self.initialize(tableelement, rowelement, maxelement, addelement, delelement,
+ upelement, downelement, onchange) ;
+
+ return self ;
+ } ;
+
+
+$.fn.eplgrid = function(options)
+ {
+ var id = this[0].id ;
+ var newrowid = '__' + id + '_newrow' ;
+ var maxid = '__' + id + '_max' ;
+
+ grid = new eplGrid (this, $('#' + newrowid), $('#' + maxid), $('#' + id + '-add'),
+ $('#' + id + '-del'), $('#' + id + '-up'), $('#' + id + '-down'),
+ options?options.onchange:null) ;

- if (p.className == 'cGridRow')
+ }
+
+// -----------------------------------------------------------------------------
+
+function jsonErr2Html (json)
+ {
+ var html ;
+ var data ;
+ try
+ {
+ data = jQuery.parseJSON (json) ;
+
+ if (data.error)
{
- p.className='cGridRowSelected' ;
- this.currRow=p ;
+ var reason = data.reason.replace (/(\{\[|<<|>>|\]\}|\r)/g, '').replace(/\n|\\n/g, '<br>') ;
+
+ html = '<p>Fehler: ' + data.error + '</p><p>' + reason + '</p>' ;
+ if (data.func)
+ html = html + '<p>Funktion: ' + data.func + '</p>' ;
+
}
else
{
- this.currRow=null ;
+
+ html = json ;
+ }
+ }
+ catch (e)
+ {
+ html = json ;
+ }
+ return html ;
+ }
+
+// -----------------------------------------------------------------------------
+
+$.fn.doload = function(url, params)
+ {
+ var type = params?'POST':'GET' ;
+ var self = this ;
+
+ self.css ('cursor','wait') ;
+ $(self).find(':input').css ('cursor','wait') ;
+
+
+ jQuery.ajax(
+ {
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ // Complete callback (responseText is used internally)
+ complete: function( jqXHR, status, responseText )
+ {
+ // Store the response as specified by the jqXHR object
+ var responseText = jqXHR.responseText;
+ // If successful, inject the HTML into all the matched elements
+ /*
+ if ( jqXHR.isResolved() )
+ {
+ // #4825: Get the actual response in case
+ // a dataFilter is present in ajaxSettings
+ jqXHR.done(function( r )
+ {
+ responseText = r;
+ });
+ }
+ */
+ self.css ('cursor','auto') ;
+ $(self).find(':input').css ('cursor','auto') ;
+
+ if (status == "error" || responseText.substr (0, 1) == '{')
+ {
+ var dlgwidth = 300 ;
+ var dlgheight = 'auto' ;
+ var err = jsonErr2Html(responseText) ;
+ $( "#dialogmsg").html (err) ;
+ $( "#dialogbox").attr ('title', jqXHR.status + " " + jqXHR.statusText) ;
+ if (err.length > 300)
+ {
+ dlgwidth = 800 ;
+ dlgheight = 600 ;
+ }
+
+ $( "#dialogbox" ).dialog(
+ {
+ modal: true,
+ width: dlgwidth,
+ height: dlgheight,
+ buttons:
+ {
+ Ok: function() {
+ $( this ).dialog( "close" );
+ }
+ }
+ });
+ }
+ else
+ {
+ try
+ {
+ data = jQuery.parseJSON (responseText) ;
+ if (data.redirect)
+ {
+ self.doload (data.redirect) ;
+ return ;
+ }
+ }
+ catch (e)
+ {
+
+ }
+ self.html(responseText );
+ }
}
- if (this.currRow && e.type == 'keyup' && ((e.which && e.which == e.DOM_VK_SUBTRACT) || e.keyCode == 109) && e.altKey)
+ });
+ }
+
+// -----------------------------------------------------------------------------
+
+
+function treeLoadKeyPath (path, silent, title)
+ {
+ var tree = $("#tree").dynatree("getTree") ;
+ if (tree)
+ {
+ var root_doc = tree.options.root_doc ;
+ var newtitle = title ;
+
+ if (root_doc)
+ path = path.replace ('/' + root_doc, '') ;
+ path = path.replace (/\/$/, "") ;
+
+ var segList = path.split(tree.options.keyPathSeparator);
+ var final_key = segList[segList.length-1] ;
+ var active_node = tree.getActiveNode () ;
+ var active_key ;
+ if (active_node)
+ active_key = active_node.data.key ;
+ if (active_key != final_key)
{
- this.delRow (this.currRow) ;
- e.cancelBubble = true ;
- return false ;
+ tree.loadKeyPath(path, function(node, status)
+ {
+ if(status == "loaded")
+ {
+ // 'node' is a parent that was just traversed.
+ // If we call expand() here, then all nodes will be expanded
+ // as we go
+ node.expand();
+ }
+ else if(status == "ok")
+ {
+ // 'node' is the end node of our path.
+ // If we call activate() or makeVisible() here, then the
+ // whole branch will be exoanded now
+ if (newtitle && node.data.title != newtitle)
+ node.setTitle(newtitle) ;
+
+ if (silent)
+ node.activateSilently();
+ else
+ node.activate();
+ }
+ });
}
+ else if (active_node && newtitle && active_node.data.title != newtitle)
+ active_node.setTitle(newtitle) ;
+
}
- //alert ('t='+elem.tagName +' p='+ p.id+' c='+p.className) ;
}
-
- }
+
+// -----------------------------------------------------------------------------
+
+function form_changehandler ()
+ {
+ $('#_apply').removeAttr ('disabled') ;
+ }

+function form_changehandler_add (element)
+ {
+ $('#_apply').removeAttr ('disabled') ;
+ if (element)
+ {
+ $(element).find(':input').change (form_changehandler) ;
+ $(element).find(':input').keypress (form_changehandler) ;
+ }
+ }
+
+// -----------------------------------------------------------------------------
+
+function add_history (id, text)
+ {
+ $('#__history').prepend ('<option value="' + id + '">' + text + '</option>') ;
+ $('#__history')[0].selectedIndex = 1 ;
+ }
\ No newline at end of file

Modified: perl/embperl/trunk/eg/forms/wizard/base.epl
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/eg/forms/wizard/base.epl?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/eg/forms/wizard/base.epl (original)
+++ perl/embperl/trunk/eg/forms/wizard/base.epl Mon Jun 18 06:12:05 2012
@@ -18,9 +18,26 @@ $r = shift ;
<head>
<title>[+ $r -> title +]</title>

+
+<link type="text/css" href="/form/css/jquery-ui-1.8.7.custom.css" rel="stylesheet" />
+<link type="text/css" href="/form/css/jquery.qtip.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="/forms/css/EmbperlForm.css">
-<script language="JavaScript" type="text/javascript" src="/forms/js/prototype.js"></script>
-<script language="JavaScript" type="text/javascript" src="/forms/js/EmbperlForm.js"></script>
+
+<script type="text/javascript" src="/forms/js/calendar.js"></script>
+<script type="text/javascript" src="/forms/js/calendar-de.js"></script>
+<script type="text/javascript" src="/forms/js/calendar-setup.js"></script>
+
+<script type="text/javascript" src="/forms/js/jquery-1.4.4.min.js"></script>
+<script type="text/javascript" src="/forms/js/jquery-ui-1.8.7.custom.min.js"></script>
+<script type="text/javascript" src="/forms/js/jquery.cookie.js"></script>
+<script type="text/javascript" src="/forms/js/jquery.qtip.js"></script>
+<script type="text/javascript" src="/forms/js/jquery.dynatree.js"></script>
+<script type="text/javascript" src="/forms/js/jquery.layout-latest.js"></script>
+
+<script type="text/javascript" src="/forms/js/EmbperlForm.js"></script>
+
+
+

</head>
<body class="cBody">

Modified: perl/embperl/trunk/epinit.c
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/epinit.c?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/epinit.c (original)
+++ perl/embperl/trunk/epinit.c Mon Jun 18 06:12:05 2012
@@ -345,11 +345,12 @@ int embperl_EndPass1 (void)
{
tThreadData * pThread ;
dTHX ;
-
+fprintf (stderr, "embperl_EndPass1\n") ;
pThread = embperl_GetThread (aTHX) ;

hv_clear (pThread -> pApplications) ;

+fprintf (stderr, "embperl_EndPass1 done\n") ;
return ok ;
}

@@ -1591,6 +1592,8 @@ int embperl_CleanupOutput (/*in*/ t
epTHX_
tComponentOutput * pOutput = c -> pOutput ;

+fprintf (stderr, "embperl_CleanupOutput\n") ;
+
if (!pOutput || (c -> pPrev && c -> pPrev -> pOutput == pOutput))
{ /* this component uses the main output object */
return ok ;
@@ -1608,6 +1611,7 @@ int embperl_CleanupOutput (/*in*/ t
SvREFCNT_dec (pOutput -> _perlsv) ;
ep_destroy_pool (pOutput -> pPool) ;

+fprintf (stderr, "embperl_CleanupOutput done\n") ;
return ok ;
}

@@ -1637,6 +1641,7 @@ int embperl_CleanupComponent (/*in*/
epTHX_
SV * pHV ;
MAGIC * mg;
+fprintf (stderr, "embperl_CleanupComponent\n") ;

if (c -> Param.sISA && c -> sCurrPackage)
{
@@ -1722,6 +1727,7 @@ int embperl_CleanupComponent (/*in*/
{
c -> _perlsv = NULL ;
}
+fprintf (stderr, "embperl_CleanupComponent done\n") ;

return ok ;
}
@@ -1754,6 +1760,7 @@ int embperl_CleanupRequest (/*in*/ tR
MAGIC * mg;
dSP ;

+fprintf (stderr, "embperl_CleanupRequest\n") ;

hv_iterinit (r -> pCleanupPackagesHV) ;
while ((pEntry = hv_iternext (r -> pCleanupPackagesHV)))
@@ -1875,6 +1882,7 @@ int embperl_CleanupRequest (/*in*/ tR
if (r -> pPrevReq)
sv_setsv(r -> pThread -> pReqRV, r -> pPrevReq -> _perlsv) ;

+fprintf (stderr, "embperl_CleanupRequest done\n") ;

return ok ;
}
@@ -2247,7 +2255,7 @@ int embperl_InitRequest (/*in*/ pTHX
tApacheDirConfig * pApacheCfg = NULL ;


-
+fprintf (stderr, "embperl_InitRequest\n") ;

/* get our thread & Application object */


Modified: perl/embperl/trunk/mod_embperl.c
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/mod_embperl.c?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/mod_embperl.c (original)
+++ perl/embperl/trunk/mod_embperl.c Mon Jun 18 06:12:05 2012
@@ -248,8 +248,13 @@ static int embperl_ApacheInitUnload (apr

{
#ifdef APACHE2
- /* apr_pool_sub_make(&subpool, p, NULL); */
- /* apr_pool_cleanup_register(subpool, NULL, embperl_ApacheInitCleanup, embperl_ApacheInitCleanup); */
+ if (!unload_subpool && p)
+ {
+ apr_pool_create_ex(&unload_subpool, p, NULL, NULL);
+ apr_pool_cleanup_register(unload_subpool, NULL, embperl_ApacheInitCleanup, embperl_ApacheInitCleanup);
+ if (bApDebug)
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, APLOG_STATUSCODE NULL, "EmbperlDebug: ApacheInitUnload [%d/%d]\n", getpid(), gettid()) ;
+ }
#else
if (!unload_subpool && p)
{
@@ -407,6 +412,11 @@ static void embperl_ApacheInitCleanup (v
#endif

{
+#ifdef APACHE2
+ if (bApDebug)
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, APLOG_STATUSCODE NULL, "EmbperlDebug: embperl_ApacheInitCleanup [%d/%d]\n", getpid(), gettid()) ;
+ return OK ;
+#else
module * m ;
/* make sure embperl module is removed before mod_perl in case mod_perl is loaded dynamicly*/
if ((m = ap_find_linked_module("mod_perl.c")))
@@ -432,8 +442,6 @@ static void embperl_ApacheInitCleanup (v
embperl_EndPass1 () ;
}

-#ifdef APACHE2
- return OK ;
#endif
}


Modified: perl/embperl/trunk/test/conf/httpd.conf.src
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/test/conf/httpd.conf.src?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/test/conf/httpd.conf.src (original)
+++ perl/embperl/trunk/test/conf/httpd.conf.src Mon Jun 18 06:12:05 2012
@@ -39,7 +39,6 @@ print OFH "Listen ", $EPPORT + 5, "\n" ;
if ($EPMODPERL && ($EPMODPERL !~ /perl_module/) && !$MP2)
{
print OFH <<EOD ;
-
PerlSetEnv EMBPERL_SRC \"$EPPATH\"
SetEnv EMBPERL_SRC \"$EPPATH\"
PerlSetEnv DMALLOC_OPTIONS \"log=$EPPATH/test/tmp/httpd.dmalloc.log,debug=0x3f03\"
@@ -63,6 +62,7 @@ print OFH "PerlPassEnv TEST_PRELOAD\n" ;
print OFH <<EOD ;

DirectoryIndex index.htm
+#PerlSwitches -DmvDR


$EPSTRONGHOLDKEY
@@ -763,6 +763,8 @@ Alias /ckwiki $EPPATH/eg/kwiki

SetEnv PERL5LIB \"$EPPATH/eg/forms\"

+Alias /epfctrl \"$EPPATH/eg/forms/epfctrl\"
+
AddType text/html .epl

<Location /eg/forms/pages>
@@ -773,6 +775,15 @@ AddType text/html .epl
#EMBPERL_OPTIONS 262288
</Location>

+<Location /epfctrl>
+ SetHandler perl-script
+ PerlHandler Embperl
+ Options ExecCGI
+ #EMBPERL_INPUT_ESCMODE 7
+ #EMBPERL_OPTIONS 262288
+ EMBPERL_ALLOW (\\.json\$)
+
+</Location>

<Location /eg/forms/wizard>
SetHandler perl-script

Modified: perl/embperl/trunk/test/conf/startup.pl
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/test/conf/startup.pl?rev=1351211&r1=1351210&r2=1351211&view=diff
==============================================================================
--- perl/embperl/trunk/test/conf/startup.pl (original)
+++ perl/embperl/trunk/test/conf/startup.pl Mon Jun 18 06:12:05 2012
@@ -37,7 +37,7 @@ BEGIN {
else
{
eval 'use Apache2' ;
- require ModPerl::Registry ;
+# require ModPerl::Registry ;
}

} ;



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org