You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(7) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(197) |
Feb
(426) |
Mar
(457) |
Apr
(266) |
May
(277) |
Jun
(114) |
Jul
(16) |
Aug
(59) |
Sep
(143) |
Oct
(47) |
Nov
(12) |
Dec
(48) |
| 2007 |
Jan
(18) |
Feb
(28) |
Mar
(4) |
Apr
(10) |
May
(72) |
Jun
(44) |
Jul
(32) |
Aug
(14) |
Sep
(47) |
Oct
(5) |
Nov
(29) |
Dec
(24) |
| 2008 |
Jan
(27) |
Feb
(18) |
Mar
|
Apr
(6) |
May
(1) |
Jun
(11) |
Jul
(5) |
Aug
|
Sep
|
Oct
(13) |
Nov
(4) |
Dec
(2) |
| 2009 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(3) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(4) |
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
|
From: <an...@us...> - 2010-10-30 18:43:00
|
Revision: 808
http://tacos.svn.sourceforge.net/tacos/?rev=808&view=rev
Author: andyhot
Date: 2010-10-30 18:42:54 +0000 (Sat, 30 Oct 2010)
Log Message:
-----------
implement refresh and cancel style submits
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
Modified: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2010-10-30 03:35:11 UTC (rev 807)
+++ tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2010-10-30 18:42:54 UTC (rev 808)
@@ -369,7 +369,6 @@
* submission. Also can contain json or url override.
*/
submit:function(form, submitName, parms){
- //tapestry.log("t.f.submit", arguments);
form=tapestry.byId(form);
if (!form) {
tapestry.log("t.f.submit: Form not found with id " + form, arguments);
@@ -402,11 +401,51 @@
},
/** Same as submit, but forces cancel submission */
- cancel: function(formId, submitName, parms) {tapestry.log('t.f.submit', arguments);},
+ cancel: function(form, submitName, parms) {
+ form=tapestry.byId(form);
+ if (!form) {
+ tapestry.log("t.f.cancel: Form not found with id " + form, arguments);
+ return;
+ }
+ var formName = form.getAttribute("id");
+ var validateState=tapestry.form.forms[formName].validateForm;
+ tapestry.form.setFormValidating(formName, false);
+ var previous = form.submitmode.value;
+ form.submitmode.value="cancel";
+
+ if (parms && parms["async"] && parms.async) {
+ tapestry.form.submitAsync(form, null, submitName, parms);
+ form.submitmode.value = previous;
+ tapestry.form.setFormValidating(formName, validateState);
+ } else {
+ tapestry.form.submit(form, submitName, parms);
+ }
+ },
+
/** Same as submit, but forces refresh submission */
- refresh: function(formId, submitName, parms) {tapestry.log('t.f.submit', arguments);},
+ refresh: function(form, submitName, parms) {
+ form=tapestry.byId(form);
+ if (!form) {
+ tapestry.log("t.f.refresh: Form not found with id " + form, arguments);
+ return;
+ }
+ var formName = form.getAttribute("id");
+ var validateState=tapestry.form.forms[formName].validateForm;
+ tapestry.form.setFormValidating(formName, false);
+ var previous = form.submitmode.value;
+ form.submitmode.value="refresh";
+
+ if (parms && parms["async"] && parms.async) {
+ tapestry.form.submitAsync(form, null, submitName, parms);
+ form.submitmode.value = previous;
+ tapestry.form.setFormValidating(formName, validateState);
+ } else {
+ tapestry.form.submit(form, submitName, parms);
+ }
+ },
+
/**
* Registers a form and allows definition of its properties.
* Implementation should keep track of such properties and
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2010-10-30 03:35:17
|
Revision: 807
http://tacos.svn.sourceforge.net/tacos/?rev=807&view=rev
Author: andyhot
Date: 2010-10-30 03:35:11 +0000 (Sat, 30 Oct 2010)
Log Message:
-----------
async submit url wasn't allowing overrides
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
Modified: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2010-10-29 02:26:17 UTC (rev 806)
+++ tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2010-10-30 03:35:11 UTC (rev 807)
@@ -366,7 +366,7 @@
* Implementations will typically just set form.submitname to this value.
* parms - (Optional) Extra set of parameters. Implementations can just look for
* the async key and if that's set to true, they should perform an async
- * submission.
+ * submission. Also can contain json or url override.
*/
submit:function(form, submitName, parms){
//tapestry.log("t.f.submit", arguments);
@@ -548,7 +548,7 @@
}
var kwArgs={
- form:form,
+ url:form.action,
content:content,
useCache:true,
preventCache:true,
@@ -572,10 +572,10 @@
}
var postData = jQuery.param(jQuery(form).serializeArray()) + "&dojo-ajax-request=true";
if (content) postData += "&" + jQuery.param(content);
-
+ //
var ajaxData={
type: "POST",
- url: form.action,
+ url: kwArgs.url,
data: postData,
success: kwArgs.load,
dataType: kwArgs.handleAs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2010-10-29 02:26:23
|
Revision: 806
http://tacos.svn.sourceforge.net/tacos/?rev=806&view=rev
Author: andyhot
Date: 2010-10-29 02:26:17 +0000 (Fri, 29 Oct 2010)
Log Message:
-----------
implement synchronizeWidgetState for jquery
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
Modified: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2010-10-28 21:21:20 UTC (rev 805)
+++ tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2010-10-29 02:26:17 UTC (rev 806)
@@ -1308,7 +1308,22 @@
};
tapestry.widget = {
- synchronizeWidgetState: function() {tapestry.log('t.w.synchronizeWidgetState', arguments);}
+ synchronizeWidgetState: function(id, type, options, flag) {
+ if (type) {
+ var names = type.split(":");
+ var current = jQuery;
+ var i = 0;
+ while(current && i<names.length) {
+ current = current[names[i]];
+ i++;
+ }
+ if (current) {
+ current.synchronize(id, options, flag);
+ return;
+ }
+ }
+ tapestry.log('t.w.synchronizeWidgetState', arguments);
+ }
};
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2010-10-28 21:21:26
|
Revision: 805
http://tacos.svn.sourceforge.net/tacos/?rev=805&view=rev
Author: andyhot
Date: 2010-10-28 21:21:20 +0000 (Thu, 28 Oct 2010)
Log Message:
-----------
switch to facebox fork that namespaces its resources
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox.css
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox.js
Added Paths:
-----------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox-close.gif
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox-loading.gif
Removed Paths:
-------------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/b.png
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/bl.png
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/br.png
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/closelabel.gif
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/loading.gif
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/tl.png
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/tr.png
Deleted: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/b.png
===================================================================
(Binary files differ)
Deleted: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/bl.png
===================================================================
(Binary files differ)
Deleted: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/br.png
===================================================================
(Binary files differ)
Deleted: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/closelabel.gif
===================================================================
(Binary files differ)
Added: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox-close.gif
===================================================================
(Binary files differ)
Property changes on: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox-close.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox-loading.gif
===================================================================
(Binary files differ)
Property changes on: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox-loading.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox.css
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox.css 2010-10-20 17:24:04 UTC (rev 804)
+++ tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox.css 2010-10-28 21:21:20 UTC (rev 805)
@@ -1,23 +1,3 @@
-#facebox .b {
- background:url(b.png);
-}
-
-#facebox .tl {
- background:url(tl.png);
-}
-
-#facebox .tr {
- background:url(tr.png);
-}
-
-#facebox .bl {
- background:url(bl.png);
-}
-
-#facebox .br {
- background:url(br.png);
-}
-
#facebox {
position: absolute;
top: 0;
@@ -26,30 +6,30 @@
text-align: left;
}
-#facebox .popup {
+#facebox .facebox-popup {
position: relative;
}
-#facebox table {
- border-collapse: collapse;
+#facebox .facebox-content {
+ overflow: auto;
}
-#facebox td {
- border-bottom: 0;
- padding: 0;
-}
-
-#facebox .body {
+#facebox .facebox-body {
padding: 10px;
background: #fff;
width: 370px;
+ border: 10px solid rgb(120, 120, 120);
+ border-color: rgba(90, 90, 90, 0.7);
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
}
-#facebox .loading {
+#facebox .facebox-loading {
text-align: center;
}
-#facebox .image {
+#facebox .facebox-image {
text-align: center;
}
@@ -58,21 +38,18 @@
margin: 0;
}
-#facebox .footer {
+#facebox .facebox-footer {
border-top: 1px solid #DDDDDD;
padding-top: 5px;
margin-top: 10px;
text-align: right;
}
-#facebox .tl, #facebox .tr, #facebox .bl, #facebox .br {
- height: 10px;
- width: 10px;
- overflow: hidden;
- padding: 0;
+#facebox .facebox-footer img {
+ vertical-align: middle;
}
-#facebox_overlay {
+#facebox-overlay {
position: fixed;
top: 0px;
left: 0px;
@@ -80,16 +57,16 @@
width:100%;
}
-.facebox_hide {
+.facebox-hide {
z-index:-100;
}
-.facebox_overlayBG {
+.facebox-overlayBG {
background-color: #000;
z-index: 99;
}
-* html #facebox_overlay { /* ie6 hack */
+.ie6 #facebox-overlay {
position: absolute;
- height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
+ height: expression("document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");
}
Modified: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox.js
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox.js 2010-10-20 17:24:04 UTC (rev 804)
+++ tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/facebox.js 2010-10-28 21:21:20 UTC (rev 805)
@@ -11,9 +11,9 @@
* Copyright 2007, 2008 Chris Wanstrath [ ch...@oz... ]
*
* Usage:
- *
+ *
* jQuery(document).ready(function() {
- * jQuery('a[rel*=facebox]').facebox()
+ * jQuery('a[rel*=facebox]').facebox()
* })
*
* <a href="#terms" rel="facebox">Terms</a>
@@ -27,22 +27,27 @@
*
*
* You can also use it programmatically:
- *
+ *
* jQuery.facebox('some html')
+ * jQuery.facebox('some html', 'my-groovy-style')
*
* The above will open a facebox with "some html" as the content.
- *
- * jQuery.facebox(function($) {
+ *
+ * jQuery.facebox(function($) {
* $.get('blah.html', function(data) { $.facebox(data) })
* })
*
* The above will show a loading screen before the passed function is called,
* allowing for a better ajaxy experience.
*
- * The facebox function can also display an ajax page or image:
- *
+ * The facebox function can also display an ajax page, an image, or the contents of a div:
+ *
* jQuery.facebox({ ajax: 'remote.html' })
- * jQuery.facebox({ image: 'dude.jpg' })
+ * jQuery.facebox({ ajax: 'remote.html' }, 'my-groovy-style')
+ * jQuery.facebox({ image: 'stairs.jpg' })
+ * jQuery.facebox({ image: 'stairs.jpg' }, 'my-groovy-style')
+ * jQuery.facebox({ div: '#box' })
+ * jQuery.facebox({ div: '#box' }, 'my-groovy-style')
*
* Want to close the facebox? Trigger the 'close.facebox' document event:
*
@@ -54,6 +59,7 @@
* beforeReveal.facebox
* reveal.facebox (aliased as 'afterReveal.facebox')
* init.facebox
+ * afterClose.facebox
*
* Simply bind a function to any of these hooks:
*
@@ -61,115 +67,105 @@
*
*/
(function($) {
- $.facebox = function(data, klass) {
- $.facebox.loading()
+ $.facebox = function(data, klass, settings) {
+ if (settings) $.extend($.facebox.settings, settings);
- if (data.ajax) fillFaceboxFromAjax(data.ajax)
- else if (data.image) fillFaceboxFromImage(data.image)
- else if (data.div) fillFaceboxFromHref(data.div)
- else if ($.isFunction(data)) data.call($)
- else $.facebox.reveal(data, klass)
- }
+ $.facebox.loading();
- /*
- * Public, $.facebox methods
- */
+ if (data.ajax) fillFaceboxFromAjax(data.ajax, klass);
+ else if (data.image) fillFaceboxFromImage(data.image, klass);
+ else if (data.div) fillFaceboxFromHref(data.div, klass);
+ else if ($.isFunction(data)) data.call($);
+ else $.facebox.reveal(data, klass);
+ };
- $.extend($.facebox, {
- settings: {
+ $.facebox.defaultSettings = {
opacity : 0,
overlay : true,
- loadingImage : '/assets/static/tacos-jquery-js/facebox/loading.gif',
- closeImage : '/assets/static/tacos-jquery-js/facebox/closelabel.gif',
+ loadingImage : '/assets/static/tacos-jquery-js/facebox/facebox-loading.gif',
+ closeImage : '/assets/static/tacos-jquery-js/facebox/facebox-close.gif',
imageTypes : [ 'png', 'jpg', 'jpeg', 'gif' ],
faceboxHtml : '\
<div id="facebox" style="display:none;"> \
- <div class="popup"> \
- <table> \
- <tbody> \
- <tr> \
- <td class="tl"/><td class="b"/><td class="tr"/> \
- </tr> \
- <tr> \
- <td class="b"/> \
- <td class="body"> \
- <div class="content"> \
- </div> \
- <div class="footer"> \
- <a href="#" class="close"> \
- <img src="/facebox/closelabel.gif" title="close" class="close_image" /> \
- </a> \
- </div> \
- </td> \
- <td class="b"/> \
- </tr> \
- <tr> \
- <td class="bl"/><td class="b"/><td class="br"/> \
- </tr> \
- </tbody> \
- </table> \
+ <div class="facebox-popup"> \
+ <div class="facebox-body"> \
+ <div class="facebox-content"> \
+ </div> \
+ <div class="facebox-footer"> \
+ <a href="#" class="facebox-close"> \
+ <img src="/assets/static/tacos-jquery-js/facebox/facebox-close.gif" title="close" class="facebox-close-image" /> \
+ </a> \
+ </div> \
+ </div> \
</div> \
</div>'
- },
+ };
+ /*
+ * Public, $.facebox methods
+ */
+ $.extend($.facebox, {
+ settings: $.facebox.defaultSettings,
loading: function() {
- init()
- if ($('#facebox .loading').length == 1) return true
- showOverlay()
+ init();
+ if ($('#facebox .facebox-loading').length == 1) return true;
+ showOverlay();
- $('#facebox .content').empty()
- $('#facebox .body').children().hide().end().
- append('<div class="loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>')
+ $('#facebox .facebox-content').empty();
+ $('#facebox .facebox-body').children().hide().end().
+ append('<div class="facebox-loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>');
$('#facebox').css({
top: getPageScroll()[1] + (getPageHeight() / 10),
- left: 385.5
- }).show()
+ left: $(window).width() / 2 - 205
+ }).show();
$(document).bind('keydown.facebox', function(e) {
- if (e.keyCode == 27) $.facebox.close()
- return true
- })
- $(document).trigger('loading.facebox')
+ if (e.keyCode == 27) $.facebox.close();
+ return true;
+ });
+ $(document).trigger('loading.facebox');
},
reveal: function(data, klass) {
- $(document).trigger('beforeReveal.facebox')
- if (klass) $('#facebox .content').addClass(klass)
- $('#facebox .content').append(data)
- $('#facebox .loading').remove()
- $('#facebox .body').children().fadeIn('normal')
- $('#facebox').css('left', $(window).width() / 2 - ($('#facebox table').width() / 2))
- $(document).trigger('reveal.facebox').trigger('afterReveal.facebox')
+ $(document).trigger('beforeReveal.facebox');
+ if (klass) $('#facebox .facebox-content').addClass(klass);
+ $('#facebox .facebox-content').append(data);
+ $('#facebox .facebox-loading').remove();
+ $('#facebox .facebox-body').children().fadeIn('normal');
+ $('#facebox').css('left', $(window).width() / 2 - ($('#facebox .facebox-body').width() / 2));
+ $(document).trigger('reveal.facebox').trigger('afterReveal.facebox');
},
close: function() {
- $(document).trigger('close.facebox')
- return false
+ $(document).trigger('close.facebox');
+ return false;
}
- })
+ });
/*
* Public, $.fn methods
*/
$.fn.facebox = function(settings) {
- init(settings)
+ if ($(this).length == 0) return;
+ init(settings);
+
function clickHandler() {
- $.facebox.loading(true)
+ $.facebox.loading(true);
// support for rel="facebox.inline_popup" syntax, to add a class
// also supports deprecated "facebox[.inline_popup]" syntax
- var klass = this.rel.match(/facebox\[?\.(\w+)\]?/)
- if (klass) klass = klass[1]
+ var klass = this.rel.match(/facebox\[?\.(\w+)\]?/);
+ if (klass) klass = klass[1];
- fillFaceboxFromHref(this.href, klass)
- return false
+ fillFaceboxFromHref(this.href, klass);
+ return false;
}
- return this.click(clickHandler)
- }
+ return this.bind('click.facebox', clickHandler);
+ };
/*
* Private methods
@@ -177,31 +173,26 @@
// called one time to setup facebox on this page
function init(settings) {
- if ($.facebox.settings.inited) return true
- else $.facebox.settings.inited = true
+ if ($.facebox.settings.inited) return true;
+ else $.facebox.settings.inited = true;
- $(document).trigger('init.facebox')
- makeCompatible()
+ $(document).trigger('init.facebox');
+ makeCompatible();
- var imageTypes = $.facebox.settings.imageTypes.join('|')
- $.facebox.settings.imageTypesRegexp = new RegExp('\.' + imageTypes + '$', 'i')
+ var imageTypes = $.facebox.settings.imageTypes.join('|');
+ $.facebox.settings.imageTypesRegexp = new RegExp('\\.(' + imageTypes + ')(\\?.*)?$', 'i');
- if (settings) $.extend($.facebox.settings, settings)
- $('body').append($.facebox.settings.faceboxHtml)
+ if (settings) $.extend($.facebox.settings, settings);
+ $('body').append($.facebox.settings.faceboxHtml);
- var preload = [ new Image(), new Image() ]
- preload[0].src = $.facebox.settings.closeImage
- preload[1].src = $.facebox.settings.loadingImage
+ var preload = [ new Image(), new Image() ];
+ preload[0].src = $.facebox.settings.closeImage;
+ preload[1].src = $.facebox.settings.loadingImage;
- $('#facebox').find('.b:first, .bl, .br, .tl, .tr').each(function() {
- preload.push(new Image())
- preload.slice(-1).src = $(this).css('background-image').replace(/url\((.+)\)/, '$1')
- })
-
- $('#facebox .close').click($.facebox.close)
- $('#facebox .close_image').attr('src', $.facebox.settings.closeImage)
+ $('#facebox .facebox-close').click($.facebox.close);
+ $('#facebox .facebox-close-image').attr('src', $.facebox.settings.closeImage);
}
-
+
// getPageScroll() by quirksmode.com
function getPageScroll() {
var xScroll, yScroll;
@@ -213,32 +204,32 @@
xScroll = document.documentElement.scrollLeft;
} else if (document.body) {// all other Explorers
yScroll = document.body.scrollTop;
- xScroll = document.body.scrollLeft;
+ xScroll = document.body.scrollLeft;
}
- return new Array(xScroll,yScroll)
+ return new Array(xScroll,yScroll);
}
// Adapted from getPageSize() by quirksmode.com
function getPageHeight() {
- var windowHeight
+ var windowHeight;
if (self.innerHeight) { // all except Explorer
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowHeight = document.body.clientHeight;
- }
- return windowHeight
+ }
+ return windowHeight;
}
// Backwards compatibility
function makeCompatible() {
- var $s = $.facebox.settings
+ var $s = $.facebox.settings;
- $s.loadingImage = $s.loading_image || $s.loadingImage
- $s.closeImage = $s.close_image || $s.closeImage
- $s.imageTypes = $s.image_types || $s.imageTypes
- $s.faceboxHtml = $s.facebox_html || $s.faceboxHtml
+ $s.loadingImage = $s.loading_image || $s.loadingImage;
+ $s.closeImage = $s.close_image || $s.closeImage;
+ $s.imageTypes = $s.image_types || $s.imageTypes;
+ $s.faceboxHtml = $s.facebox_html || $s.faceboxHtml;
}
// Figures out what you want to display and displays it
@@ -249,58 +240,59 @@
function fillFaceboxFromHref(href, klass) {
// div
if (href.match(/#/)) {
- var url = window.location.href.split('#')[0]
- var target = href.replace(url,'')
- $.facebox.reveal($(target).clone().show(), klass)
+ var url = window.location.href.split('#')[0];
+ var target = href.replace(url,'');
+ if (target == '#') return;
+ $.facebox.reveal($(target).html(), klass);
// image
} else if (href.match($.facebox.settings.imageTypesRegexp)) {
- fillFaceboxFromImage(href, klass)
+ fillFaceboxFromImage(href, klass);
// ajax
} else {
- fillFaceboxFromAjax(href, klass)
+ fillFaceboxFromAjax(href, klass);
}
}
function fillFaceboxFromImage(href, klass) {
- var image = new Image()
+ var image = new Image();
image.onload = function() {
- $.facebox.reveal('<div class="image"><img src="' + image.src + '" /></div>', klass)
- }
- image.src = href
+ $.facebox.reveal('<div class="facebox-image"><img src="' + image.src + '" /></div>', klass);
+ };
+ image.src = href;
}
function fillFaceboxFromAjax(href, klass) {
- $.get(href, function(data) { $.facebox.reveal(data, klass) })
+ $.get(href, function(data) { $.facebox.reveal(data, klass) });
}
function skipOverlay() {
- return $.facebox.settings.overlay == false || $.facebox.settings.opacity === null
+ return $.facebox.settings.overlay == false || $.facebox.settings.opacity === null;
}
function showOverlay() {
- if (skipOverlay()) return
+ if (skipOverlay()) return;
- if ($('facebox_overlay').length == 0)
- $("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')
+ if ($('#facebox-overlay').length == 0)
+ $("body").append('<div id="facebox-overlay" class="facebox-hide"></div>');
- $('#facebox_overlay').hide().addClass("facebox_overlayBG")
+ $('#facebox-overlay').hide().addClass("facebox-overlayBG")
.css('opacity', $.facebox.settings.opacity)
.click(function() { $(document).trigger('close.facebox') })
- .fadeIn(200)
- return false
+ .fadeIn(200);
+ return false;
}
function hideOverlay() {
- if (skipOverlay()) return
+ if (skipOverlay()) return;
- $('#facebox_overlay').fadeOut(200, function(){
- $("#facebox_overlay").removeClass("facebox_overlayBG")
- $("#facebox_overlay").addClass("facebox_hide")
- $("#facebox_overlay").remove()
- })
-
- return false
+ $('#facebox-overlay').fadeOut(200, function(){
+ $("#facebox-overlay").removeClass("facebox-overlayBG");
+ $("#facebox-overlay").addClass("facebox-hide");
+ $("#facebox-overlay").remove();
+ });
+
+ return false;
}
/*
@@ -308,12 +300,13 @@
*/
$(document).bind('close.facebox', function() {
- $(document).unbind('keydown.facebox')
+ $(document).unbind('keydown.facebox');
$('#facebox').fadeOut(function() {
- $('#facebox .content').removeClass().addClass('content')
- hideOverlay()
- $('#facebox .loading').remove()
- })
- })
+ $('#facebox .facebox-content').removeClass().addClass('facebox-content');
+ hideOverlay();
+ $('#facebox .facebox-loading').remove();
+ $(document).trigger('afterClose.facebox');
+ });
+ });
})(jQuery);
Deleted: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/loading.gif
===================================================================
(Binary files differ)
Deleted: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/tl.png
===================================================================
(Binary files differ)
Deleted: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/facebox/tr.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2010-10-20 17:24:10
|
Revision: 804
http://tacos.svn.sourceforge.net/tacos/?rev=804&view=rev
Author: andyhot
Date: 2010-10-20 17:24:04 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
try/catch while logging
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
Property Changed:
----------------
tacos-4.1/trunk/tacos-jquery/
Property changes on: tacos-4.1/trunk/tacos-jquery
___________________________________________________________________
Modified: svn:ignore
- target
+ target
.settings
.classpath
.project
Modified: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2010-10-19 23:12:44 UTC (rev 803)
+++ tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2010-10-20 17:24:04 UTC (rev 804)
@@ -21,7 +21,10 @@
isIE: jQuery.browser.msie,
// setup firebug logging - useful for finding unimplemented methods
log: function() {
- if (window.console) console.log.apply(this, arguments);
+ if (window.console) {
+ try { console.log.apply(this, arguments); }
+ catch(ex){}
+ }
},
/**
* Executes the passed function when the document has done loading
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2010-10-19 23:12:51
|
Revision: 803
http://tacos.svn.sourceforge.net/tacos/?rev=803&view=rev
Author: andyhot
Date: 2010-10-19 23:12:44 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
some more notes on overriding
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/src/site/apt/index.apt
Modified: tacos-4.1/trunk/tacos-jquery/src/site/apt/index.apt
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/site/apt/index.apt 2009-11-08 10:55:23 UTC (rev 802)
+++ tacos-4.1/trunk/tacos-jquery/src/site/apt/index.apt 2010-10-19 23:12:44 UTC (rev 803)
@@ -1,14 +1,14 @@
------
- jQuery 1.2.6 and Tapestry
+ jQuery 1.3.2 and Tapestry
------
Andreas Andreou
------
27 Dec 2007
------
-jQuery 1.2.6 and Tapestry
+jQuery 1.3.2 and Tapestry
- This module allows you to use jQuery 1.2.6 in Tapestry 4 applications. It requires
+ This module allows you to use jQuery 1.3.2 in Tapestry 4 applications. It requires
Tapestry version 4.1.6 and on, and completely replaces the dojo version
(0.4.3) that's bundled by default.
@@ -21,11 +21,11 @@
<dependency>
<groupId>net.sf.tacos</groupId>
<artifactId>tacos-jquery</artifactId>
- <version>0.1.126-SNAPSHOT</version>
+ <version>0.1.132-SNAPSHOT</version>
</dependency>
+--
- Notice that the last number in the version (126) represents the currently supported
+ Notice that the last number in the version (132) represents the currently supported
{{{http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6.min.js}jquery version}}.
If maven has troubles downloading the module, then you'll probably have to
@@ -53,5 +53,24 @@
More details
- The uncompressed version of jQuery 1.2.6 is included in this module, but you'll
-soon be able to override this.
+ The uncompressed version of jQuery 1.3.2 is included in this module. The exact
+files included are described in the following contribution:
+
++--
+ <contribution configuration-id="hivemind.FactoryDefaults">
+ <default symbol="tacos.jquery.files" value="classpath:/tacos-jquery-js/jquery-1.3.2.js,classpath:/tacos-jquery-js/facebox/facebox.js,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.js"/>
+ <default symbol="tacos.jquery.tapestryFile" value="classpath:/tacos-jquery-js/tap-jquery1.2.1.js"/>
+ <default symbol="tacos.jquery.tapestryFolder" value="classpath:/tacos-jquery-js/"/>
+ <default symbol="tacos.jquery.cssFiles" value="classpath:/tacos-jquery-js/facebox/facebox.css,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.css"/>
+ </contribution>
++--
+
+ So, if you want to use jquery from google's CDN (http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js)
+you can just do:
+
++--
+ <contribution configuration-id="hivemind.ApplicationDefaults">
+ <default symbol="tacos.jquery.files" value="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js,classpath:/tacos-jquery-js/facebox/facebox.js,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.js"/>
+ </contribution>
++--
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-11-08 10:55:45
|
Revision: 802
http://tacos.svn.sourceforge.net/tacos/?rev=802&view=rev
Author: andyhot
Date: 2009-11-08 10:55:23 +0000 (Sun, 08 Nov 2009)
Log Message:
-----------
update to java.net m2 repo
Modified Paths:
--------------
tacos-4.1/trunk/beanform/pom.xml
Modified: tacos-4.1/trunk/beanform/pom.xml
===================================================================
--- tacos-4.1/trunk/beanform/pom.xml 2009-11-06 17:30:33 UTC (rev 801)
+++ tacos-4.1/trunk/beanform/pom.xml 2009-11-08 10:55:23 UTC (rev 802)
@@ -156,8 +156,7 @@
<repository>
<id>java-net</id>
<name>java.net repository</name>
- <url>https://maven-repository.dev.java.net/nonav/repository</url>
- <layout>legacy</layout>
+ <url>http://download.java.net/maven/2/</url>
</repository>
<!-- required for the tapestry-prop dependency -->
<repository>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-11-06 17:30:46
|
Revision: 801
http://tacos.svn.sourceforge.net/tacos/?rev=801&view=rev
Author: andyhot
Date: 2009-11-06 17:30:33 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
bring back junit for beanform + version update
Modified Paths:
--------------
tacos-4.1/trunk/beanform/beanform-core/pom.xml
tacos-4.1/trunk/beanform/beanform-examples/pom.xml
tacos-4.1/trunk/beanform/pom.xml
Modified: tacos-4.1/trunk/beanform/beanform-core/pom.xml
===================================================================
--- tacos-4.1/trunk/beanform/beanform-core/pom.xml 2009-11-06 01:14:44 UTC (rev 800)
+++ tacos-4.1/trunk/beanform/beanform-core/pom.xml 2009-11-06 17:30:33 UTC (rev 801)
@@ -20,7 +20,7 @@
<parent>
<groupId>net.sf.tacos</groupId>
<artifactId>beanform</artifactId>
- <version>0.9</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>beanform-core</artifactId>
Modified: tacos-4.1/trunk/beanform/beanform-examples/pom.xml
===================================================================
--- tacos-4.1/trunk/beanform/beanform-examples/pom.xml 2009-11-06 01:14:44 UTC (rev 800)
+++ tacos-4.1/trunk/beanform/beanform-examples/pom.xml 2009-11-06 17:30:33 UTC (rev 801)
@@ -20,7 +20,7 @@
<parent>
<groupId>net.sf.tacos</groupId>
<artifactId>beanform</artifactId>
- <version>0.9</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>beanform-examples</artifactId>
Modified: tacos-4.1/trunk/beanform/pom.xml
===================================================================
--- tacos-4.1/trunk/beanform/pom.xml 2009-11-06 01:14:44 UTC (rev 800)
+++ tacos-4.1/trunk/beanform/pom.xml 2009-11-06 17:30:33 UTC (rev 801)
@@ -47,7 +47,7 @@
<groupId>net.sf.tacos</groupId>
<artifactId>beanform</artifactId>
<name>BeanForm</name>
- <version>0.9</version>
+ <version>1.0-SNAPSHOT</version>
<description>Tapestry component for single-line pojo edits.</description>
<url>http://beanform.sourceforge.net/</url>
<inceptionYear>2006</inceptionYear>
@@ -55,7 +55,7 @@
<parent>
<groupId>net.sf.tacos</groupId>
<artifactId>tacos-project</artifactId>
- <version>4.1.1</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<modules>
<module>beanform-core</module>
@@ -119,6 +119,11 @@
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-framework</artifactId>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ </dependency>
</dependencies>
<reporting>
<outputDirectory>../target/site/beanform</outputDirectory>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-11-06 01:15:09
|
Revision: 800
http://tacos.svn.sourceforge.net/tacos/?rev=800&view=rev
Author: andyhot
Date: 2009-11-06 01:14:44 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
some more version update
Modified Paths:
--------------
tacos-4.1/trunk/pom.xml
tacos-4.1/trunk/tacos-core/pom.xml
tacos-4.1/trunk/tacos-dojo/pom.xml
tacos-4.1/trunk/tacos-jquery/pom.xml
Modified: tacos-4.1/trunk/pom.xml
===================================================================
--- tacos-4.1/trunk/pom.xml 2009-11-05 21:35:18 UTC (rev 799)
+++ tacos-4.1/trunk/pom.xml 2009-11-06 01:14:44 UTC (rev 800)
@@ -90,6 +90,10 @@
<!--module>tacos-seam</module-->
</modules>
+ <properties>
+ <testng-version>5.7</testng-version>
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
@@ -157,7 +161,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>5.7</version>
+ <version>${testng-version}</version>
<classifier>jdk15</classifier>
<scope>test</scope>
<exclusions>
@@ -458,16 +462,6 @@
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
- <id>tapestry.javaforge</id>
- <url>http://howardlewisship.com/repository</url>
- </repository>
- <repository>
- <id>snapshots.codehaus.org</id>
- <url>http://snapshots.repository.codehaus.org</url>
- <releases><enabled>false</enabled></releases>
- <snapshots><enabled>true</enabled></snapshots>
- </repository>
- <repository>
<id>codehaus.org</id>
<url>http://repository.codehaus.org</url>
</repository>
@@ -479,14 +473,6 @@
<url>http://repository.apache.org/snapshots</url>
</pluginRepository>
<pluginRepository>
- <id>tapestry.javaforge</id>
- <url>http://howardlewisship.com/repository</url>
- </pluginRepository>
- <pluginRepository>
- <id>snapshots.codehaus.org</id>
- <url>http://snapshots.repository.codehaus.org</url>
- </pluginRepository>
- <pluginRepository>
<id>tacos.snapshot</id>
<url>http://tacos.sourceforge.net/nightly</url>
</pluginRepository>
Modified: tacos-4.1/trunk/tacos-core/pom.xml
===================================================================
--- tacos-4.1/trunk/tacos-core/pom.xml 2009-11-05 21:35:18 UTC (rev 799)
+++ tacos-4.1/trunk/tacos-core/pom.xml 2009-11-06 01:14:44 UTC (rev 800)
@@ -135,8 +135,9 @@
<outputDirectory>../target/site/tacos-core</outputDirectory>
<plugins>
<plugin>
- <groupId>com.erinors.tapestry</groupId>
+ <groupId>net.sf.tacos</groupId>
<artifactId>tapdoc-maven-plugin</artifactId>
+ <version>0.7.0</version>
<configuration>
<libraries>
<param>/net/sf/tacos/Tacos.library</param>
Modified: tacos-4.1/trunk/tacos-dojo/pom.xml
===================================================================
--- tacos-4.1/trunk/tacos-dojo/pom.xml 2009-11-05 21:35:18 UTC (rev 799)
+++ tacos-4.1/trunk/tacos-dojo/pom.xml 2009-11-06 01:14:44 UTC (rev 800)
@@ -6,7 +6,7 @@
<groupId>net.sf.tacos</groupId>
<artifactId>tacos-dojo</artifactId>
<!-- includes dojo version -->
- <version>0.1.102-SNAPSHOT</version>
+ <version>0.1.123-SNAPSHOT</version>
<name>Tacos Dojo</name>
<inceptionYear>2007</inceptionYear>
@@ -29,7 +29,6 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>5.5</version>
<classifier>jdk15</classifier>
<scope>test</scope>
<exclusions>
@@ -94,7 +93,7 @@
</goals>
</execution>
</executions>
- </plugin>
+ </plugin>
</plugins>
</build>
<reporting>
Modified: tacos-4.1/trunk/tacos-jquery/pom.xml
===================================================================
--- tacos-4.1/trunk/tacos-jquery/pom.xml 2009-11-05 21:35:18 UTC (rev 799)
+++ tacos-4.1/trunk/tacos-jquery/pom.xml 2009-11-06 01:14:44 UTC (rev 800)
@@ -29,7 +29,6 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>5.5</version>
<classifier>jdk15</classifier>
<scope>test</scope>
<exclusions>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-11-05 21:35:30
|
Revision: 799
http://tacos.svn.sourceforge.net/tacos/?rev=799&view=rev
Author: andyhot
Date: 2009-11-05 21:35:18 +0000 (Thu, 05 Nov 2009)
Log Message:
-----------
update plugin version + define all versions
Modified Paths:
--------------
tacos-4.1/trunk/pom.xml
Modified: tacos-4.1/trunk/pom.xml
===================================================================
--- tacos-4.1/trunk/pom.xml 2009-09-24 16:11:37 UTC (rev 798)
+++ tacos-4.1/trunk/pom.xml 2009-11-05 21:35:18 UTC (rev 799)
@@ -95,23 +95,23 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
- <version>[2.3,3)</version>
+ <version>2.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-framework</artifactId>
- <version>[4.1.6,5)</version>
+ <version>4.1.6</version>
</dependency>
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-annotations</artifactId>
- <version>[4.1.6,5)</version>
+ <version>4.1.6</version>
</dependency>
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-contrib</artifactId>
- <version>[4.1.6,5)</version>
+ <version>4.1.6</version>
<exclusions>
<exclusion>
<groupId>jboss</groupId>
@@ -157,7 +157,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>5.5</version>
+ <version>5.7</version>
<classifier>jdk15</classifier>
<scope>test</scope>
<exclusions>
@@ -193,7 +193,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-idea-plugin</artifactId>
- <version>2.0</version>
+ <version>2.2</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
@@ -202,7 +202,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
- <version>2.4</version>
+ <version>2.7</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
@@ -211,7 +211,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
- <version>2.0</version>
+ <version>2.3</version>
<inherited>true</inherited>
<executions>
<execution>
@@ -267,13 +267,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
- <version>2.0</version>
+ <version>2.1</version>
<inherited>true</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>2.0.4</version>
+ <version>2.1.1</version>
<inherited>true</inherited>
</plugin>
<plugin>
@@ -285,7 +285,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.3</version>
+ <version>2.4.1</version>
<inherited>true</inherited>
<configuration>
<encoding>UTF-8</encoding>
@@ -294,7 +294,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
- <version>2.2</version>
+ <version>2.3</version>
<inherited>true</inherited>
</plugin>
<plugin>
@@ -306,13 +306,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-7</version>
+ <version>2.0.1</version>
<inherited>true</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
- <version>2.0-beta-7</version>
+ <version>2.0-beta-9</version>
<configuration>
<tagBase>https://tacos.svn.sourceforge.net/svnroot/tacos/tacos-4.1/tags/</tagBase>
</configuration>
@@ -320,13 +320,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-repository-plugin</artifactId>
- <version>2.1</version>
+ <version>2.3</version>
<inherited>true</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-2</version>
+ <version>2.2-beta-4</version>
<inherited>true</inherited>
<configuration>
<descriptors>
@@ -339,7 +339,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
- <version>2.2</version>
+ <version>2.3</version>
<inherited>true</inherited>
</plugin>
</plugins>
@@ -350,12 +350,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.4</version>
+ <version>2.4.3</version>
<inherited>true</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
@@ -364,11 +365,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.3</version>
+ <version>2.6.1</version>
<configuration>
<linksource>true</linksource>
<aggregate>true</aggregate>
@@ -397,23 +399,27 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
+ <version>2.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.3</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javancss-maven-plugin</artifactId>
- <version>2.0-beta-2</version>
+ <version>2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
+ <version>2.4</version>
<configuration>
<linkXref>true</linkXref>
<sourceEncoding>utf-8</sourceEncoding>
@@ -447,7 +453,7 @@
<repositories>
<repository>
<id>apache.snapshots</id>
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <url>http://repository.apache.org/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
@@ -470,7 +476,7 @@
<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <url>http://repository.apache.org/snapshots</url>
</pluginRepository>
<pluginRepository>
<id>tapestry.javaforge</id>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-09-24 16:11:51
|
Revision: 798
http://tacos.svn.sourceforge.net/tacos/?rev=798&view=rev
Author: andyhot
Date: 2009-09-24 16:11:37 +0000 (Thu, 24 Sep 2009)
Log Message:
-----------
easier to configer AjaxShellDelegate for old dojo versions
Added Paths:
-----------
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/javascript/
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/javascript/DojoZeroDelegateFactory.java
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/javascript/DojoZeroShellDelegate.java
tacos-4.1/trunk/tacos-core/src/test/net/sf/tacos/javascript/
tacos-4.1/trunk/tacos-core/src/test/net/sf/tacos/javascript/TestDojoZeroShellDelegate.java
Added: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/javascript/DojoZeroDelegateFactory.java
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/javascript/DojoZeroDelegateFactory.java (rev 0)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/javascript/DojoZeroDelegateFactory.java 2009-09-24 16:11:37 UTC (rev 798)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2009 Tacos.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * under the License.
+ */
+package net.sf.tacos.javascript;
+
+import org.apache.hivemind.ServiceImplementationFactory;
+import org.apache.hivemind.ServiceImplementationFactoryParameters;
+import org.apache.tapestry.javascript.JavascriptManager;
+
+/**
+ *
+ * @author Andreas Andreou
+ */
+public class DojoZeroDelegateFactory implements ServiceImplementationFactory {
+ private JavascriptManager javascriptManager;
+ private boolean debug;
+ private String debugContainerId;
+ private boolean parseWidgets;
+
+ public void setJavascriptManager(JavascriptManager javascriptManager) {
+ this.javascriptManager = javascriptManager;
+ }
+
+ public Object createCoreServiceImplementation(ServiceImplementationFactoryParameters factoryParameters) {
+ return new DojoZeroShellDelegate(javascriptManager, debug, debugContainerId, parseWidgets);
+ }
+
+ public void setDebug(boolean debug) {
+ this.debug = debug;
+ }
+
+ public void setDebugContainerId(String debugContainerId) {
+ this.debugContainerId = debugContainerId;
+ }
+
+ public void setParseWidgets(boolean parseWidgets) {
+ this.parseWidgets = parseWidgets;
+ }
+}
Added: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/javascript/DojoZeroShellDelegate.java
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/javascript/DojoZeroShellDelegate.java (rev 0)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/javascript/DojoZeroShellDelegate.java 2009-09-24 16:11:37 UTC (rev 798)
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2009 Tacos.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * under the License.
+ */
+package net.sf.tacos.javascript;
+
+import org.apache.tapestry.dojo.AjaxShellDelegate;
+import org.apache.tapestry.javascript.JavascriptManager;
+import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.IPage;
+import org.apache.tapestry.IAsset;
+import org.apache.tapestry.json.JSONObject;
+
+import java.util.Locale;
+
+/**
+ * A simpler {@link AjaxShellDelegate} implementation that uses data
+ * defined with {@link JavascriptManager}.
+ *
+ * @author Andreas Andreou
+ */
+public class DojoZeroShellDelegate extends AjaxShellDelegate {
+
+ private JavascriptManager javascriptManager;
+ private boolean debug;
+ private String debugContainerId;
+ private boolean parseWidgets;
+
+ public DojoZeroShellDelegate(JavascriptManager javascriptManager) {
+ this.javascriptManager = javascriptManager;
+ }
+
+ public DojoZeroShellDelegate(JavascriptManager javascriptManager, boolean debug, String debugContainerId, boolean parseWidgets) {
+ this.javascriptManager = javascriptManager;
+ this.debug = debug;
+ this.debugContainerId = debugContainerId;
+ this.parseWidgets = parseWidgets;
+ }
+
+ public void render(IMarkupWriter writer, IRequestCycle cycle)
+ {
+ JSONObject dojoConfig = new JSONObject();
+
+ if (debug)
+ {
+ dojoConfig.put("isDebug", true);
+ }
+
+ if (debugContainerId != null)
+ dojoConfig.put("debugContainerId", debugContainerId);
+
+ IPage page = cycle.getPage();
+
+ IAsset dojoPath = javascriptManager.getPath();
+ IAsset dojoSource = javascriptManager.getFirstAsset();
+ IAsset dojoFormSource = javascriptManager.getFirstFormAsset();
+ IAsset dojoWidgetSource = javascriptManager.getFirstWidgetAsset();
+ IAsset tapestryPath = javascriptManager.getTapestryPath();
+ IAsset tapestrySource = javascriptManager.getTapestryAsset();
+
+ if (dojoPath != null) {
+ String dojoPathUrl = dojoPath.buildURL();
+ dojoConfig.put("baseScriptUri", dojoPathUrl);
+ //dojoConfig.put("baseRelativePath", dojoPathUrl);
+ }
+
+ if (page.hasFormComponents()) {
+ dojoConfig.put("preventBackButtonFix", true);
+ }
+
+ dojoConfig.put("parseWidgets", parseWidgets);
+
+ // Supports setting up locale in dojo environment to match the requested page locale.
+ // (for things that use these settings, like DropdownDatePicker / date parsing / etc..
+
+ Locale locale = cycle.getPage().getLocale();
+
+ String localeStr = locale.getLanguage().toLowerCase()
+ + ((locale.getCountry() != null && locale.getCountry().trim().length() > 0)
+ ? "-" + locale.getCountry().toLowerCase()
+ : "");
+
+ if (isLocaleSupported(localeStr)) {
+ dojoConfig.put("locale", localeStr);
+ }
+
+ // Write the required script includes and dojo.requires
+ writer.begin("script");
+ writer.attribute("type", "text/javascript");
+ writer.printRaw("djConfig = ");
+ writer.printRaw(dojoConfig.toString());
+ writer.printRaw(" ");
+ writer.end();
+ writer.println();
+ writer.println();
+
+ // include the core dojo.js package
+
+ if (dojoSource!=null) {
+ writer.begin("script");
+ writer.attribute("type", "text/javascript");
+ writer.attribute("src", dojoSource.buildURL());
+ writer.end();
+ }
+
+ if (page.hasFormComponents() && dojoFormSource!=null) {
+ writer.begin("script");
+ writer.attribute("type", "text/javascript");
+ writer.attribute("src", dojoFormSource.buildURL());
+ writer.end();
+ }
+
+ if (page.hasWidgets() && dojoWidgetSource!=null) {
+ writer.begin("script");
+ writer.attribute("type", "text/javascript");
+ writer.attribute("src", dojoWidgetSource.buildURL());
+ writer.end();
+ }
+
+ // module path registration to tapestry javascript sources
+
+ if (tapestryPath!=null) {
+ String tapestryUrl = tapestryPath.buildURL();
+ if (tapestryUrl.endsWith("/")) {
+ tapestryUrl = tapestryUrl.substring(0, tapestryUrl.length() - 1);
+ }
+
+ writer.println();
+ writer.begin("script");
+ writer.attribute("type", "text/javascript");
+ writer.println();
+ writer.printRaw("dojo.registerModulePath(\"tapestry\", \"");
+ writer.printRaw(tapestryUrl);
+ writer.printRaw("\");");
+ writer.println();
+ writer.end();
+ writer.println();
+ }
+
+ // include core tapestry.js package
+
+ if (tapestrySource!=null) {
+ writer.begin("script");
+ writer.attribute("type", "text/javascript");
+ writer.attribute("src", tapestrySource.buildURL());
+ writer.end();
+ }
+
+ // namespace registration
+
+ writer.println();
+ writer.begin("script");
+ writer.attribute("type", "text/javascript");
+ writer.println();
+ writer.printRaw("dojo.require(\"tapestry.namespace\");");
+ writer.println();
+ writer.printRaw("tapestry.requestEncoding='");
+ writer.printRaw(cycle.getEngine().getOutputEncoding());
+ writer.printRaw("';");
+ writer.println();
+ writer.end();
+
+ writer.println();
+ }
+
+ public void setDebug(boolean debug) {
+ this.debug = debug;
+ }
+
+ public void setDebugContainerId(String debugContainerId) {
+ this.debugContainerId = debugContainerId;
+ }
+
+ public void setParseWidgets(boolean parseWidgets) {
+ this.parseWidgets = parseWidgets;
+ }
+}
Added: tacos-4.1/trunk/tacos-core/src/test/net/sf/tacos/javascript/TestDojoZeroShellDelegate.java
===================================================================
--- tacos-4.1/trunk/tacos-core/src/test/net/sf/tacos/javascript/TestDojoZeroShellDelegate.java (rev 0)
+++ tacos-4.1/trunk/tacos-core/src/test/net/sf/tacos/javascript/TestDojoZeroShellDelegate.java 2009-09-24 16:11:37 UTC (rev 798)
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2009 Tacos.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * under the License.
+ */
+package net.sf.tacos.javascript;
+
+import org.apache.tapestry.BaseComponentTestCase;
+import org.apache.tapestry.IAsset;
+import org.apache.tapestry.IEngine;
+import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.IPage;
+import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.javascript.JavascriptManager;
+import org.apache.tapestry.engine.IEngineService;
+import org.apache.tapestry.engine.ILink;
+import org.apache.hivemind.Resource;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.checkOrder;
+import org.testng.annotations.Test;
+
+import java.util.Locale;
+
+/**
+ * Tests {@link DojoZeroShellDelegate}.
+ *
+ * @author Andreas Andreou
+ */
+@Test
+public class TestDojoZeroShellDelegate extends BaseComponentTestCase {
+ private static final String SYSTEM_NEWLINE = (String) java.security.AccessController.doPrivileged(
+ new sun.security.action.GetPropertyAction("line.separator"));
+
+ public void test_Default_Render() {
+ IAsset dojoSource = newAsset();
+ IAsset dojoPath = newAsset();
+ IAsset tSource = newAsset();
+ IAsset tPath = newAsset();
+ IPage page = newMock(IPage.class);
+ checkOrder(page, false);
+ IEngine engine = newMock(IEngine.class);
+
+ IRequestCycle cycle = newCycle();
+ IMarkupWriter writer = newBufferWriter();
+
+ expect(cycle.getEngine()).andReturn(engine);
+ expect(engine.getOutputEncoding()).andReturn("utf-foo");
+ expect(cycle.getPage()).andReturn(page);
+ expect(dojoPath.buildURL()).andReturn("http:///dojo/path");
+
+ expect(page.hasFormComponents()).andReturn(false).anyTimes();
+ expect(page.hasWidgets()).andReturn(false).anyTimes();
+
+ trainPageLocale(cycle, Locale.US);
+
+ expect(dojoSource.buildURL()).andReturn("http:///dojo/path/dojo.js");
+ expect(tPath.buildURL()).andReturn("/tapestry");
+ expect(tSource.buildURL()).andReturn("/tapestry/tapestry.js");
+
+ JavascriptManager jsManager = newMock(JavascriptManager.class);
+ expect(jsManager.getPath()).andReturn(dojoPath);
+ expect(jsManager.getFirstAsset()).andReturn(dojoSource);
+ expect(jsManager.getFirstFormAsset()).andReturn(null);
+ expect(jsManager.getFirstWidgetAsset()).andReturn(null);
+ expect(jsManager.getTapestryPath()).andReturn(tPath);
+ expect(jsManager.getTapestryAsset()).andReturn(tSource);
+
+ DojoZeroShellDelegate d = new DojoZeroShellDelegate(jsManager);
+
+ replay();
+
+ d.render(writer, cycle);
+
+ verify();
+
+ assertBuffer("<script type=\"text/javascript\">djConfig = {"
+ + "\"baseScriptUri\":\"http:///dojo/path\","
+ + "\"parseWidgets\":false,\"locale\":\"en-us\"} </script>" + SYSTEM_NEWLINE +
+ SYSTEM_NEWLINE +
+ "<script type=\"text/javascript\" src=\"http:///dojo/path/dojo.js\"></script>" + SYSTEM_NEWLINE
+ + "<script type=\"text/javascript\">" + SYSTEM_NEWLINE +
+ "dojo.registerModulePath(\"tapestry\", \"/tapestry\");" + SYSTEM_NEWLINE +
+ "</script>" + SYSTEM_NEWLINE +
+ "<script type=\"text/javascript\" src=\"/tapestry/tapestry.js\"></script>" + SYSTEM_NEWLINE +
+ "<script type=\"text/javascript\">" + SYSTEM_NEWLINE +
+ "dojo.require(\"tapestry.namespace\");" + SYSTEM_NEWLINE +
+ "tapestry.requestEncoding='utf-foo';" + SYSTEM_NEWLINE +
+ "</script>" + SYSTEM_NEWLINE);
+ }
+
+ void trainStaticPath(IEngineService engine, IAsset asset, String path) {
+ Resource res = newMock(Resource.class);
+
+ expect(asset.getResourceLocation()).andReturn(res);
+ expect(res.getPath()).andReturn(path);
+
+ ILink link = newLink();
+
+ expect(engine.getLink(Boolean.TRUE, path)).andReturn(link);
+ expect(link.getURL()).andReturn("http://" + path);
+ }
+
+ void trainPageLocale(IRequestCycle cycle, Locale locale) {
+ IPage page = newMock(IPage.class);
+
+ expect(cycle.getPage()).andReturn(page);
+ expect(page.getLocale()).andReturn(locale);
+ }
+
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-06-16 11:55:15
|
Revision: 797
http://tacos.svn.sourceforge.net/tacos/?rev=797&view=rev
Author: andyhot
Date: 2009-06-16 11:54:23 +0000 (Tue, 16 Jun 2009)
Log Message:
-----------
update to 1.3.2
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/pom.xml
tacos-4.1/trunk/tacos-jquery/src/descriptor/tacos.jquery.xml
Added Paths:
-----------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/jquery-1.3.2.js
Removed Paths:
-------------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/jquery-1.2.1.js
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/jquery-1.2.3.js
Modified: tacos-4.1/trunk/tacos-jquery/pom.xml
===================================================================
--- tacos-4.1/trunk/tacos-jquery/pom.xml 2009-06-16 11:52:07 UTC (rev 796)
+++ tacos-4.1/trunk/tacos-jquery/pom.xml 2009-06-16 11:54:23 UTC (rev 797)
@@ -6,7 +6,7 @@
<groupId>net.sf.tacos</groupId>
<artifactId>tacos-jquery</artifactId>
<!-- includes jquery version -->
- <version>0.1.126-SNAPSHOT</version>
+ <version>0.1.132-SNAPSHOT</version>
<name>Tacos jQuery</name>
<inceptionYear>2007</inceptionYear>
Modified: tacos-4.1/trunk/tacos-jquery/src/descriptor/tacos.jquery.xml
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/descriptor/tacos.jquery.xml 2009-06-16 11:52:07 UTC (rev 796)
+++ tacos-4.1/trunk/tacos-jquery/src/descriptor/tacos.jquery.xml 2009-06-16 11:54:23 UTC (rev 797)
@@ -7,24 +7,31 @@
<unprotected-resource contains="^/tacos-jquery-js/" />
</contribution>
+ <!--
+ Jquery javascript can also be found at:
+ - http://jqueryjs.googlecode.com/files/jquery-1.2.6.js
+ - http://jqueryjs.googlecode.com/files/jquery-1.2.6.pack.js
+ - http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
+ -->
+
+ <contribution configuration-id="hivemind.FactoryDefaults">
+ <default symbol="tacos.jquery.files" value="classpath:/tacos-jquery-js/jquery-1.3.2.js,classpath:/tacos-jquery-js/facebox/facebox.js,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.js"/>
+ <default symbol="tacos.jquery.tapestryFile" value="classpath:/tacos-jquery-js/tap-jquery1.2.1.js"/>
+ <default symbol="tacos.jquery.tapestryFolder" value="classpath:/tacos-jquery-js/"/>
+ <default symbol="tacos.jquery.cssFiles" value="classpath:/tacos-jquery-js/facebox/facebox.css,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.css"/>
+ </contribution>
+
<service-point id="JavascriptManager" interface="org.apache.tapestry.javascript.JavascriptManager">
<invoke-factory>
<construct class="net.sf.tacos.javascript.jquery.JqueryJavascriptManagerImpl">
<set-service property="assetSource" service-id="tapestry.asset.AssetSource"/>
- <!--
- This is for serving the jquery file directly from googlecode
- <set property="files" value="http://jqueryjs.googlecode.com/files/jquery-1.2.6.js"/>
- or for the packed version, you can use
- <set property="files" value="http://jqueryjs.googlecode.com/files/jquery-1.2.6.pack.js"/>
- -->
- <set property="files" value="classpath:/tacos-jquery-js/jquery-1.2.6.js,classpath:/tacos-jquery-js/facebox/facebox.js,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.js"/>
+ <set property="files" value="${tacos.jquery.files}"/>
<set property="formFiles" value=""/>
<set property="widgetFiles" value=""/>
<set property="folder" value=""/>
- <set property="tapestryFile" value="classpath:/tacos-jquery-js/tap-jquery1.2.1.js"/>
- <set property="tapestryFolder" value="classpath:/tacos-jquery-js/"/>
-
- <set property="cssFiles" value="classpath:/tacos-jquery-js/facebox/facebox.css,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.css"/>
+ <set property="tapestryFile" value="${tacos.jquery.tapestryFile}"/>
+ <set property="tapestryFolder" value="${tacos.jquery.tapestryFolder}"/>
+ <set property="cssFiles" value="${tacos.jquery.cssFiles}"/>
</construct>
</invoke-factory>
</service-point>
Deleted: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/jquery-1.2.1.js
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/jquery-1.2.1.js 2009-06-16 11:52:07 UTC (rev 796)
+++ tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/jquery-1.2.1.js 2009-06-16 11:54:23 UTC (rev 797)
@@ -1,2992 +0,0 @@
-(function(){
-/*
- * jQuery 1.2.1 - New Wave Javascript
- *
- * Copyright (c) 2007 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
- * $Rev: 3353 $
- */
-
-// Map over jQuery in case of overwrite
-if ( typeof jQuery != "undefined" )
- var _jQuery = jQuery;
-
-var jQuery = window.jQuery = function(selector, context) {
- // If the context is a namespace object, return a new object
- return this instanceof jQuery ?
- this.init(selector, context) :
- new jQuery(selector, context);
-};
-
-// Map over the $ in case of overwrite
-if ( typeof $ != "undefined" )
- var _$ = $;
-
-// Map the jQuery namespace to the '$' one
-window.$ = jQuery;
-
-var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
-
-jQuery.fn = jQuery.prototype = {
- init: function(selector, context) {
- // Make sure that a selection was provided
- selector = selector || document;
-
- // Handle HTML strings
- if ( typeof selector == "string" ) {
- var m = quickExpr.exec(selector);
- if ( m && (m[1] || !context) ) {
- // HANDLE: $(html) -> $(array)
- if ( m[1] )
- selector = jQuery.clean( [ m[1] ], context );
-
- // HANDLE: $("#id")
- else {
- var tmp = document.getElementById( m[3] );
- if ( tmp )
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( tmp.id != m[3] )
- return jQuery().find( selector );
- else {
- this[0] = tmp;
- this.length = 1;
- return this;
- }
- else
- selector = [];
- }
-
- // HANDLE: $(expr)
- } else
- return new jQuery( context ).find( selector );
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction(selector) )
- return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector );
-
- return this.setArray(
- // HANDLE: $(array)
- selector.constructor == Array && selector ||
-
- // HANDLE: $(arraylike)
- // Watch for when an array-like object is passed as the selector
- (selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
-
- // HANDLE: $(*)
- [ selector ] );
- },
-
- jquery: "1.2.1",
-
- size: function() {
- return this.length;
- },
-
- length: 0,
-
- get: function( num ) {
- return num == undefined ?
-
- // Return a 'clean' array
- jQuery.makeArray( this ) :
-
- // Return just the object
- this[num];
- },
-
- pushStack: function( a ) {
- var ret = jQuery(a);
- ret.prevObject = this;
- return ret;
- },
-
- setArray: function( a ) {
- this.length = 0;
- Array.prototype.push.apply( this, a );
- return this;
- },
-
- each: function( fn, args ) {
- return jQuery.each( this, fn, args );
- },
-
- index: function( obj ) {
- var pos = -1;
- this.each(function(i){
- if ( this == obj ) pos = i;
- });
- return pos;
- },
-
- attr: function( key, value, type ) {
- var obj = key;
-
- // Look for the case where we're accessing a style value
- if ( key.constructor == String )
- if ( value == undefined )
- return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
- else {
- obj = {};
- obj[ key ] = value;
- }
-
- // Check to see if we're setting style values
- return this.each(function(index){
- // Set all the styles
- for ( var prop in obj )
- jQuery.attr(
- type ? this.style : this,
- prop, jQuery.prop(this, obj[prop], type, index, prop)
- );
- });
- },
-
- css: function( key, value ) {
- return this.attr( key, value, "curCSS" );
- },
-
- text: function(e) {
- if ( typeof e != "object" && e != null )
- return this.empty().append( document.createTextNode( e ) );
-
- var t = "";
- jQuery.each( e || this, function(){
- jQuery.each( this.childNodes, function(){
- if ( this.nodeType != 8 )
- t += this.nodeType != 1 ?
- this.nodeValue : jQuery.fn.text([ this ]);
- });
- });
- return t;
- },
-
- wrapAll: function(html) {
- if ( this[0] )
- // The elements to wrap the target around
- jQuery(html, this[0].ownerDocument)
- .clone()
- .insertBefore(this[0])
- .map(function(){
- var elem = this;
- while ( elem.firstChild )
- elem = elem.firstChild;
- return elem;
- })
- .append(this);
-
- return this;
- },
-
- wrapInner: function(html) {
- return this.each(function(){
- jQuery(this).contents().wrapAll(html);
- });
- },
-
- wrap: function(html) {
- return this.each(function(){
- jQuery(this).wrapAll(html);
- });
- },
-
- append: function() {
- return this.domManip(arguments, true, 1, function(a){
- this.appendChild( a );
- });
- },
-
- prepend: function() {
- return this.domManip(arguments, true, -1, function(a){
- this.insertBefore( a, this.firstChild );
- });
- },
-
- before: function() {
- return this.domManip(arguments, false, 1, function(a){
- this.parentNode.insertBefore( a, this );
- });
- },
-
- after: function() {
- return this.domManip(arguments, false, -1, function(a){
- this.parentNode.insertBefore( a, this.nextSibling );
- });
- },
-
- end: function() {
- return this.prevObject || jQuery([]);
- },
-
- find: function(t) {
- var data = jQuery.map(this, function(a){ return jQuery.find(t,a); });
- return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ?
- jQuery.unique( data ) : data );
- },
-
- clone: function(events) {
- // Do the clone
- var ret = this.map(function(){
- return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true);
- });
-
- // Need to set the expando to null on the cloned set if it exists
- // removeData doesn't work here, IE removes it from the original as well
- // this is primarily for IE but the data expando shouldn't be copied over in any browser
- var clone = ret.find("*").andSelf().each(function(){
- if ( this[ expando ] != undefined )
- this[ expando ] = null;
- });
-
- // Copy the events from the original to the clone
- if (events === true)
- this.find("*").andSelf().each(function(i) {
- var events = jQuery.data(this, "events");
- for ( var type in events )
- for ( var handler in events[type] )
- jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data);
- });
-
- // Return the cloned set
- return ret;
- },
-
- filter: function(t) {
- return this.pushStack(
- jQuery.isFunction( t ) &&
- jQuery.grep(this, function(el, index){
- return t.apply(el, [index]);
- }) ||
-
- jQuery.multiFilter(t,this) );
- },
-
- not: function(t) {
- return this.pushStack(
- t.constructor == String &&
- jQuery.multiFilter(t, this, true) ||
-
- jQuery.grep(this, function(a) {
- return ( t.constructor == Array || t.jquery )
- ? jQuery.inArray( a, t ) < 0
- : a != t;
- })
- );
- },
-
- add: function(t) {
- return this.pushStack( jQuery.merge(
- this.get(),
- t.constructor == String ?
- jQuery(t).get() :
- t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ?
- t : [t] )
- );
- },
-
- is: function(expr) {
- return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
- },
-
- hasClass: function(expr) {
- return this.is("." + expr);
- },
-
- val: function( val ) {
- if ( val == undefined ) {
- if ( this.length ) {
- var elem = this[0];
-
- // We need to handle select boxes special
- if ( jQuery.nodeName(elem, "select") ) {
- var index = elem.selectedIndex,
- a = [],
- options = elem.options,
- one = elem.type == "select-one";
-
- // Nothing was selected
- if ( index < 0 )
- return null;
-
- // Loop through all the selected options
- for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
- var option = options[i];
- if ( option.selected ) {
- // Get the specifc value for the option
- var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value;
-
- // We don't need an array for one selects
- if ( one )
- return val;
-
- // Multi-Selects return an array
- a.push(val);
- }
- }
-
- return a;
-
- // Everything else, we just grab the value
- } else
- return this[0].value.replace(/\r/g, "");
- }
- } else
- return this.each(function(){
- if ( val.constructor == Array && /radio|checkbox/.test(this.type) )
- this.checked = (jQuery.inArray(this.value, val) >= 0 ||
- jQuery.inArray(this.name, val) >= 0);
- else if ( jQuery.nodeName(this, "select") ) {
- var tmp = val.constructor == Array ? val : [val];
-
- jQuery("option", this).each(function(){
- this.selected = (jQuery.inArray(this.value, tmp) >= 0 ||
- jQuery.inArray(this.text, tmp) >= 0);
- });
-
- if ( !tmp.length )
- this.selectedIndex = -1;
- } else
- this.value = val;
- });
- },
-
- html: function( val ) {
- return val == undefined ?
- ( this.length ? this[0].innerHTML : null ) :
- this.empty().append( val );
- },
-
- replaceWith: function( val ) {
- return this.after( val ).remove();
- },
-
- eq: function(i){
- return this.slice(i, i+1);
- },
-
- slice: function() {
- return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
- },
-
- map: function(fn) {
- return this.pushStack(jQuery.map( this, function(elem,i){
- return fn.call( elem, i, elem );
- }));
- },
-
- andSelf: function() {
- return this.add( this.prevObject );
- },
-
- domManip: function(args, table, dir, fn) {
- var clone = this.length > 1, a;
-
- return this.each(function(){
- if ( !a ) {
- a = jQuery.clean(args, this.ownerDocument);
- if ( dir < 0 )
- a.reverse();
- }
-
- var obj = this;
-
- if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") )
- obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody"));
-
- jQuery.each( a, function(){
- var elem = clone ? this.cloneNode(true) : this;
- if ( !evalScript(0, elem) )
- fn.call( obj, elem );
- });
- });
- }
-};
-
-function evalScript(i, elem){
- var script = jQuery.nodeName(elem, "script");
-
- if ( script ) {
- if ( elem.src )
- jQuery.ajax({ url: elem.src, async: false, dataType: "script" });
- else
- jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-
- if ( elem.parentNode )
- elem.parentNode.removeChild(elem);
-
- } else if ( elem.nodeType == 1 )
- jQuery("script", elem).each(evalScript);
-
- return script;
-}
-
-jQuery.extend = jQuery.fn.extend = function() {
- // copy reference to target object
- var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false;
-
- // Handle a deep copy situation
- if ( target.constructor == Boolean ) {
- deep = target;
- target = arguments[1] || {};
- }
-
- // extend jQuery itself if only one argument is passed
- if ( al == 1 ) {
- target = this;
- a = 0;
- }
-
- var prop;
-
- for ( ; a < al; a++ )
- // Only deal with non-null/undefined values
- if ( (prop = arguments[a]) != null )
- // Extend the base object
- for ( var i in prop ) {
- // Prevent never-ending loop
- if ( target == prop[i] )
- continue;
-
- // Recurse if we're merging object values
- if ( deep && typeof prop[i] == 'object' && target[i] )
- jQuery.extend( target[i], prop[i] );
-
- // Don't bring in undefined values
- else if ( prop[i] != undefined )
- target[i] = prop[i];
- }
-
- // Return the modified object
- return target;
-};
-
-var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
-
-jQuery.extend({
- noConflict: function(deep) {
- window.$ = _$;
- if ( deep )
- window.jQuery = _jQuery;
- return jQuery;
- },
-
- // This may seem like some crazy code, but trust me when I say that this
- // is the only cross-browser way to do this. --John
- isFunction: function( fn ) {
- return !!fn && typeof fn != "string" && !fn.nodeName &&
- fn.constructor != Array && /function/i.test( fn + "" );
- },
-
- // check if an element is in a XML document
- isXMLDoc: function(elem) {
- return elem.documentElement && !elem.body ||
- elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
- },
-
- // Evalulates a script in a global context
- // Evaluates Async. in Safari 2 :-(
- globalEval: function( data ) {
- data = jQuery.trim( data );
- if ( data ) {
- if ( window.execScript )
- window.execScript( data );
- else if ( jQuery.browser.safari )
- // safari doesn't provide a synchronous global eval
- window.setTimeout( data, 0 );
- else
- eval.call( window, data );
- }
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
- },
-
- cache: {},
-
- data: function( elem, name, data ) {
- elem = elem == window ? win : elem;
-
- var id = elem[ expando ];
-
- // Compute a unique ID for the element
- if ( !id )
- id = elem[ expando ] = ++uuid;
-
- // Only generate the data cache if we're
- // trying to access or manipulate it
- if ( name && !jQuery.cache[ id ] )
- jQuery.cache[ id ] = {};
-
- // Prevent overriding the named cache with undefined values
- if ( data != undefined )
- jQuery.cache[ id ][ name ] = data;
-
- // Return the named cache data, or the ID for the element
- return name ? jQuery.cache[ id ][ name ] : id;
- },
-
- removeData: function( elem, name ) {
- elem = elem == window ? win : elem;
-
- var id = elem[ expando ];
-
- // If we want to remove a specific section of the element's data
- if ( name ) {
- if ( jQuery.cache[ id ] ) {
- // Remove the section of cache data
- delete jQuery.cache[ id ][ name ];
-
- // If we've removed all the data, remove the element's cache
- name = "";
- for ( name in jQuery.cache[ id ] ) break;
- if ( !name )
- jQuery.removeData( elem );
- }
-
- // Otherwise, we want to remove all of the element's data
- } else {
- // Clean up the element expando
- try {
- delete elem[ expando ];
- } catch(e){
- // IE has trouble directly removing the expando
- // but it's ok with using removeAttribute
- if ( elem.removeAttribute )
- elem.removeAttribute( expando );
- }
-
- // Completely remove the data cache
- delete jQuery.cache[ id ];
- }
- },
-
- // args is for internal usage only
- each: function( obj, fn, args ) {
- if ( args ) {
- if ( obj.length == undefined )
- for ( var i in obj )
- fn.apply( obj[i], args );
- else
- for ( var i = 0, ol = obj.length; i < ol; i++ )
- if ( fn.apply( obj[i], args ) === false ) break;
-
- // A special, fast, case for the most common use of each
- } else {
- if ( obj.length == undefined )
- for ( var i in obj )
- fn.call( obj[i], i, obj[i] );
- else
- for ( var i = 0, ol = obj.length, val = obj[0];
- i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){}
- }
-
- return obj;
- },
-
- prop: function(elem, value, type, index, prop){
- // Handle executable functions
- if ( jQuery.isFunction( value ) )
- value = value.call( elem, [index] );
-
- // exclude the following css properties to add px
- var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
-
- // Handle passing in a number to a CSS property
- return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
- value + "px" :
- value;
- },
-
- className: {
- // internal only, use addClass("class")
- add: function( elem, c ){
- jQuery.each( (c || "").split(/\s+/), function(i, cur){
- if ( !jQuery.className.has( elem.className, cur ) )
- elem.className += ( elem.className ? " " : "" ) + cur;
- });
- },
-
- // internal only, use removeClass("class")
- remove: function( elem, c ){
- elem.className = c != undefined ?
- jQuery.grep( elem.className.split(/\s+/), function(cur){
- return !jQuery.className.has( c, cur );
- }).join(" ") : "";
- },
-
- // internal only, use is(".class")
- has: function( t, c ) {
- return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1;
- }
- },
-
- swap: function(e,o,f) {
- for ( var i in o ) {
- e.style["old"+i] = e.style[i];
- e.style[i] = o[i];
- }
- f.apply( e, [] );
- for ( var i in o )
- e.style[i] = e.style["old"+i];
- },
-
- css: function(e,p) {
- if ( p == "height" || p == "width" ) {
- var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
-
- jQuery.each( d, function(){
- old["padding" + this] = 0;
- old["border" + this + "Width"] = 0;
- });
-
- jQuery.swap( e, old, function() {
- if ( jQuery(e).is(':visible') ) {
- oHeight = e.offsetHeight;
- oWidth = e.offsetWidth;
- } else {
- e = jQuery(e.cloneNode(true))
- .find(":radio").removeAttr("checked").end()
- .css({
- visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
- }).appendTo(e.parentNode)[0];
-
- var parPos = jQuery.css(e.parentNode,"position") || "static";
- if ( parPos == "static" )
- e.parentNode.style.position = "relative";
-
- oHeight = e.clientHeight;
- oWidth = e.clientWidth;
-
- if ( parPos == "static" )
- e.parentNode.style.position = "static";
-
- e.parentNode.removeChild(e);
- }
- });
-
- return p == "height" ? oHeight : oWidth;
- }
-
- return jQuery.curCSS( e, p );
- },
-
- curCSS: function(elem, prop, force) {
- var ret, stack = [], swap = [];
-
- // A helper method for determining if an element's values are broken
- function color(a){
- if ( !jQuery.browser.safari )
- return false;
-
- var ret = document.defaultView.getComputedStyle(a,null);
- return !ret || ret.getPropertyValue("color") == "";
- }
-
- if (prop == "opacity" && jQuery.browser.msie) {
- ret = jQuery.attr(elem.style, "opacity");
- return ret == "" ? "1" : ret;
- }
-
- if (prop.match(/float/i))
- prop = styleFloat;
-
- if (!force && elem.style[prop])
- ret = elem.style[prop];
-
- else if (document.defaultView && document.defaultView.getComputedStyle) {
-
- if (prop.match(/float/i))
- prop = "float";
-
- prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
- var cur = document.defaultView.getComputedStyle(elem, null);
-
- if ( cur && !color(elem) )
- ret = cur.getPropertyValue(prop);
-
- // If the element isn't reporting its values properly in Safari
- // then some display: none elements are involved
- else {
- // Locate all of the parent display: none elements
- for ( var a = elem; a && color(a); a = a.parentNode )
- stack.unshift(a);
-
- // Go through and make them visible, but in reverse
- // (It would be better if we knew the exact display type that they had)
- for ( a = 0; a < stack.length; a++ )
- if ( color(stack[a]) ) {
- swap[a] = stack[a].style.display;
- stack[a].style.display = "block";
- }
-
- // Since we flip the display style, we have to handle that
- // one special, otherwise get the value
- ret = prop == "display" && swap[stack.length-1] != null ?
- "none" :
- document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || "";
-
- // Finally, revert the display styles back
- for ( a = 0; a < swap.length; a++ )
- if ( swap[a] != null )
- stack[a].style.display = swap[a];
- }
-
- if ( prop == "opacity" && ret == "" )
- ret = "1";
-
- } else if (elem.currentStyle) {
- var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
- ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) {
- var style = elem.style.left;
- var runtimeStyle = elem.runtimeStyle.left;
- elem.runtimeStyle.left = elem.currentStyle.left;
- elem.style.left = ret || 0;
- ret = elem.style.pixelLeft + "px";
- elem.style.left = style;
- elem.runtimeStyle.left = runtimeStyle;
- }
- }
-
- return ret;
- },
-
- clean: function(a, doc) {
- var r = [];
- doc = doc || document;
-
- jQuery.each( a, function(i,arg){
- if ( !arg ) return;
-
- if ( arg.constructor == Number )
- arg = arg.toString();
-
- // Convert html string into DOM nodes
- if ( typeof arg == "string" ) {
- // Fix "XHTML"-style tags in all browsers
- arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){
- return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">";
- });
-
- // Trim whitespace, otherwise indexOf won't work as expected
- var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
-
- var wrap =
- // option or optgroup
- !s.indexOf("<opt") &&
- [1, "<select>", "</select>"] ||
-
- !s.indexOf("<leg") &&
- [1, "<fieldset>", "</fieldset>"] ||
-
- s.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
- [1, "<table>", "</table>"] ||
-
- !s.indexOf("<tr") &&
- [2, "<table><tbody>", "</tbody></table>"] ||
-
- // <thead> matched above
- (!s.indexOf("<td") || !s.indexOf("<th")) &&
- [3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
-
- !s.indexOf("<col") &&
- [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] ||
-
- // IE can't serialize <link> and <script> tags normally
- jQuery.browser.msie &&
- [1, "div<div>", "</div>"] ||
-
- [0,"",""];
-
- // Go to html and back, then peel off extra wrappers
- div.innerHTML = wrap[1] + arg + wrap[2];
-
- // Move to the right depth
- while ( wrap[0]-- )
- div = div.lastChild;
-
- // Remove IE's autoinserted <tbody> from table fragments
- if ( jQuery.browser.msie ) {
-
- // String was a <table>, *may* have spurious <tbody>
- if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 )
- tb = div.firstChild && div.firstChild.childNodes;
-
- // String was a bare <thead> or <tfoot>
- else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 )
- tb = div.childNodes;
-
- for ( var n = tb.length-1; n >= 0 ; --n )
- if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
- tb[n].parentNode.removeChild(tb[n]);
-
- // IE completely kills leading whitespace when innerHTML is used
- if ( /^\s/.test(arg) )
- div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );
-
- }
-
- arg = jQuery.makeArray( div.childNodes );
- }
-
- if ( 0 === arg.length && (!jQuery.nodeName(arg, "form") && !jQuery.nodeName(arg, "select")) )
- return;
-
- if ( arg[0] == undefined || jQuery.nodeName(arg, "form") || arg.options )
- r.push( arg );
- else
- r = jQuery.merge( r, arg );
-
- });
-
- return r;
- },
-
- attr: function(elem, name, value){
- var fix = jQuery.isXMLDoc(elem) ? {} : jQuery.props;
-
- // Safari mis-reports the default selected property of a hidden option
- // Accessing the parent's selectedIndex property fixes it
- if ( name == "selected" && jQuery.browser.safari )
- elem.parentNode.selectedIndex;
-
- // Certain attributes only work when accessed via the old DOM 0 way
- if ( fix[name] ) {
- if ( value != undefined ) elem[fix[name]] = value;
- return elem[fix[name]];
- } else if ( jQuery.browser.msie && name == "style" )
- return jQuery.attr( elem.style, "cssText", value );
-
- else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
- return elem.getAttributeNode(name).nodeValue;
-
- // IE elem.getAttribute passes even for style
- else if ( elem.tagName ) {
-
- if ( value != undefined ) {
- if ( name == "type" && jQuery.nodeName(elem,"input") && elem.parentNode )
- throw "type property can't be changed";
- elem.setAttribute( name, value );
- }
-
- if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) )
- return elem.getAttribute( name, 2 );
-
- return elem.getAttribute( name );
-
- // elem is actually elem.style ... set the style
- } else {
- // IE actually uses filters for opacity
- if ( name == "opacity" && jQuery.browser.msie ) {
- if ( value != undefined ) {
- // IE has trouble with opacity if it does not have layout
- // Force it by setting the zoom level
- elem.zoom = 1;
-
- // Set the alpha filter to set the opacity
- elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") +
- (parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
- }
-
- return elem.filter ?
- (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : "";
- }
- name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
- if ( value != undefined ) elem[name] = value;
- return elem[name];
- }
- },
-
- trim: function(t){
- return (t||"").replace(/^\s+|\s+$/g, "");
- },
-
- makeArray: function( a ) {
- var r = [];
-
- // Need to use typeof to fight Safari childNodes crashes
- if ( typeof a != "array" )
- for ( var i = 0, al = a.length; i < al; i++ )
- r.push( a[i] );
- else
- r = a.slice( 0 );
-
- return r;
- },
-
- inArray: function( b, a ) {
- for ( var i = 0, al = a.length; i < al; i++ )
- if ( a[i] == b )
- return i;
- return -1;
- },
-
- merge: function(first, second) {
- // We have to loop this way because IE & Opera overwrite the length
- // expando of getElementsByTagName
-
- // Also, we need to make sure that the correct elements are being returned
- // (IE returns comment nodes in a '*' query)
- if ( jQuery.browser.msie ) {
- for ( var i = 0; second[i]; i++ )
- if ( second[i].nodeType != 8 )
- first.push(second[i]);
- } else
- for ( var i = 0; second[i]; i++ )
- first.push(second[i]);
-
- return first;
- },
-
- unique: function(first) {
- var r = [], done = {};
-
- try {
- for ( var i = 0, fl = first.length; i < fl; i++ ) {
- var id = jQuery.data(first[i]);
- if ( !done[id] ) {
- done[id] = true;
- r.push(first[i]);
- }
- }
- } catch(e) {
- r = first;
- }
-
- return r;
- },
-
- grep: function(elems, fn, inv) {
- // If a string is passed in for the function, make a function
- // for it (a handy shortcut)
- if ( typeof fn == "string" )
- fn = eval("false||function(a,i){return " + fn + "}");
-
- var result = [];
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( var i = 0, el = elems.length; i < el; i++ )
- if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
- result.push( elems[i] );
-
- return result;
- },
-
- map: function(elems, fn) {
- // If a string is passed in for the function, make a function
- // for it (a handy shortcut)
- if ( typeof fn == "string" )
- fn = eval("false||function(a){return " + fn + "}");
-
- var result = [];
-
- // Go through the array, translating each of the items to their
- // new value (or values).
- for ( var i = 0, el = elems.length; i < el; i++ ) {
- var val = fn(elems[i],i);
-
- if ( val !== null && val != undefined ) {
- if ( val.constructor != Array ) val = [val];
- result = result.concat( val );
- }
- }
-
- return result;
- }
-});
-
-var userAgent = navigator.userAgent.toLowerCase();
-
-// Figure out what browser is being used
-jQuery.browser = {
- version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
- safari: /webkit/.test(userAgent),
- opera: /opera/.test(userAgent),
- msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
- mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
-};
-
-var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";
-
-jQuery.extend({
- // Check to see if the W3C box model is being used
- boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
-
- styleFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",
-
- props: {
- "for": "htmlFor",
- "class": "className",
- "float": styleFloat,
- cssFloat: styleFloat,
- styleFloat: styleFloat,
- innerHTML: "innerHTML",
- className: "className",
- value: "value",
- disabled: "disabled",
- checked: "checked",
- readonly: "readOnly",
- selected: "selected",
- maxlength: "maxLength"
- }
-});
-
-jQuery.each({
- parent: "a.parentNode",
- parents: "jQuery.dir(a,'parentNode')",
- next: "jQuery.nth(a,2,'nextSibling')",
- prev: "jQuery.nth(a,2,'previousSibling')",
- nextAll: "jQuery.dir(a,'nextSibling')",
- prevAll: "jQuery.dir(a,'previousSibling')",
- siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
- children: "jQuery.sibling(a.firstChild)",
- contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
-}, function(i,n){
- jQuery.fn[ i ] = function(a) {
- var ret = jQuery.map(this,n);
- if ( a && typeof a == "string" )
- ret = jQuery.multiFilter(a,ret);
- return this.pushStack( jQuery.unique(ret) );
- };
-});
-
-jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
-}, function(i,n){
- jQuery.fn[ i ] = function(){
- var a = arguments;
- return this.each(function(){
- for ( var j = 0, al = a.length; j < al; j++ )
- jQuery(a[j])[n]( this );
- });
- };
-});
-
-jQuery.each( {
- removeAttr: function( key ) {
- jQuery.attr( this, key, "" );
- this.removeAttribute( key );
- },
- addClass: function(c){
- jQuery.className.add(this,c);
- },
- removeClass: function(c){
- jQuery.className.remove(this,c);
- },
- toggleClass: function( c ){
- jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
- },
- remove: function(a){
- if ( !a || jQuery.filter( a, [this] ).r.length ) {
- jQuery.removeData( this );
- this.parentNode.removeChild( this );
- }
- },
- empty: function() {
- // Clean up the cache
- jQuery("*", this).each(function(){ jQuery.removeData(this); });
-
- while ( this.firstChild )
- this.removeChild( this.firstChild );
- }
-}, function(i,n){
- jQuery.fn[ i ] = function() {
- return this.each( n, arguments );
- };
-});
-
-jQuery.each( [ "Height", "Width" ], function(i,name){
- var n = name.toLowerCase();
-
- jQuery.fn[ n ] = function(h) {
- return this[0] == window ?
- jQuery.browser.safari && self["inner" + name] ||
- jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) ||
- document.body["client" + name] :
-
- this[0] == document ?
- Math.max( document.body["scroll" + name], document.body["offset" + name] ) :
-
- h == undefined ?
- ( this.length ? jQuery.css( this[0], n ) : null ) :
- this.css( n, h.constructor == String ? h : h + "px" );
- };
-});
-
-var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
- "(?:[\\w*_-]|\\\\.)" :
- "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
- quickChild = new RegExp("^>\\s*(" + chars + "+)"),
- quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
- quickClass = new RegExp("^([#.]?)(" + chars + "*)");
-
-jQuery.extend({
- expr: {
- "": "m[2]=='*'||jQuery.nodeName(a,m[2])",
- "#": "a.getAttribute('id')==m[2]",
- ":": {
- // Position Checks
- lt: "i<m[3]-0",
- gt: "i>m[3]-0",
- nth: "m[3]-0==i",
- eq: "m[3]-0==i",
- first: "i==0",
- last: "i==r.length-1",
- even: "i%2==0",
- odd: "i%2",
-
- // Child Checks
- "first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
- "last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
- "only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
-
- // Parent Checks
- parent: "a.firstChild",
- empty: "!a.firstChild",
-
- // Text Check
- contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",
-
- // Visibility
- visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
- hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
-
- // Form attributes
- enabled: "!a.disabled",
- disabled: "a.disabled",
- checked: "a.checked",
- selected: "a.selected||jQuery.attr(a,'selected')",
-
- // Form elements
- text: "'text'==a.type",
- radio: "'radio'==a.type",
- checkbox: "'checkbox'==a.type",
- file: "'file'==a.type",
- password: "'password'==a.type",
- submit: "'submit'==a.type",
- image: "'image'==a.type",
- reset: "'reset'==a.type",
- button: '"button"==a.type||jQuery.nodeName(a,"button")',
- input: "/input|select|textarea|button/i.test(a.nodeName)",
-
- // :has()
- has: "jQuery.find(m[3],a).length",
-
- // :header
- header: "/h\\d/i.test(a.nodeName)",
-
- // :animated
- animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
- }
- },
-
- // The regular expressions that power the parsing engine
- parse: [
- // Match: [@value='test'], [@foo]
- /^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
-
- // Match: :contains('foo')
- /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
-
- // Match: :even, :last-chlid, #id, .class
- new RegExp("^([:.#]*)(" + chars + "+)")
- ],
-
- multiFilter: function( expr, elems, not ) {
- var old, cur = [];
-
- while ( expr && expr != old ) {
- old = expr;
- var f = jQuery.filter( expr, elems, not );
- expr = f.t.replace(/^\s*,\s*/, "" );
- cur = not ? elems = f.r : jQuery.merge( cur, f.r );
- }
-
- return cur;
- },
-
- find: function( t, context ) {
- // Quickly handle non-string expressions
- if ( typeof t != "string" )
- return [ t ];
-
- // Make sure that the context is a DOM Element
- if ( context && !context.nodeType )
- context = null;
-
- // Set the correct context (if none is provided)
- context = context || document;
-
- // Initialize the search
- var ret = [context], done = [], last;
-
- // Continue while a selector expression exists, and while
- // we're no longer looping upon ourselves
- while ( t && last != t ) {
- var r = [];
- last = t;
-
- t = jQuery.trim(t);
-
- var foundToken = false;
-
- // An attempt at speeding up child selectors that
- // point to a specific element tag
- var re = quickChild;
- var m = re.exec(t);
-
- if ( m ) {
- var nodeName = m[1].toUpperCase();
-
- // Perform our own iteration and filter
- for ( var i = 0; ret[i]; i++ )
- for ( var c = ret[i].firstChild; c; c = c.nextSibling )
- if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) )
- r.push( c );
-
- ret = r;
- t = t.replace( re, "" );
- if ( t.indexOf(" ") == 0 ) continue;
- foundToken = true;
- } else {
- re = /^([>+~])\s*(\w*)/i;
-
- if ( (m = re.exec(t)) != null ) {
- r = [];
-
- var nodeName = m[2], merge = {};
- m = m[1];
-
- for ( var j = 0, rl = ret.length; j < rl; j++ ) {
- var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
- for ( ; n; n = n.nextSibling )
- if ( n.nodeType == 1 ) {
- var id = jQuery.data(n);
-
- if ( m == "~" && merge[id] ) break;
-
- if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) {
- if ( m == "~" ) merge[id] = true;
- r.push( n );
- }
-
- if ( m == "+" ) break;
- }
- }
-
- ret = r;
-
- // And remove the token
- t = jQuery.trim( t.replace( re, "" ) );
- foundToken = true;
- }
- }
-
- // See if there's still an expression, and that we haven't already
- // matched a token
- if ( t && !foundToken ) {
- // Handle multiple expressions
- if ( !t.indexOf(",") ) {
- // Clean the result set
- if ( context == ret[0] ) ret.shift();
-
- // Merge the result sets
- done = jQuery.merge( done, ret );
-
- // Reset the context
- r = ret = [context];
-
- // Touch up the selector string
- t = " " + t.substr(1,t.length);
-
- } else {
- // Optimize for the case nodeName#idName
- var re2 = quickID;
- var m = re2.exec(t);
-
- // Re-organize the results, so that they're consistent
- if ( m ) {
- m = [ 0, m[2], m[3], m[1] ];
-
- } else {
- // Otherwise, do a traditional filter check for
- // ID, class, and element selectors
- re2 = quickClass;
- m = re2.exec(t);
- }
-
- m[2] = m[2].replace(/\\/g, "");
-
- var elem = ret[ret.length-1];
-
- // Try to do a global search by ID, where we can
- if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
- // Optimization for HTML document case
- var oid = elem.getElementById(m[2]);
-
- // Do a quick check for the existence of the actual ID attribute
- // to avoid selecting by the name attribute in IE
- // also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
- if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
- oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
-
- // Do a quick check for node name (where applicable) so
- // that div#foo searches will be really fast
- ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
- } else {
- // We need to find all descendant elements
- for ( var i = 0; ret[i]; i++ ) {
- // Grab the tag name being searched for
- var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
-
- // Handle IE7 being really dumb about <object>s
- if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
- tag = "param";
-
- r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
- }
-
- // It's faster to filter by class and be done with it
- if ( m[1] == "." )
- r = jQuery.classFilter( r, m[2] );
-
- // Same with ID filtering
- if ( m[1] == "#" ) {
- var tmp = [];
-
- // Try to find the element with the ID
- for ( var i = 0; r[i]; i++ )
- if ( r[i].getAttribute("id") == m[2] ) {
- tmp = [ r[i] ];
- break;
- }
-
- r = tmp;
- }
-
- ret = r;
- }
-
- t = t.replace( re2, "" );
- }
-
- }
-
- // If a selector string still exists
- if ( t ) {
- // Attempt to filter it
- var val = jQuery.filter(t,r);
- ret = r = val.r;
- t = jQuery.trim(val.t);
- }
- }
-
- // An error occurred with the selector;
- // just return an empty set instead
- if ( t )
- ret = [];
-
- // Remove the root context
- if ( ret && context == ret[0] )
- ret.shift();
-
- // And combine the results
- done = jQuery.merge( done, ret );
-
- return done;
- },
-
- classFilter: function(r,m,not){
- m = " " + m + " ";
- var tmp = [];
- for ( var i = 0; r[i]; i++ ) {
- var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
- if ( !not && pass || not && !pass )
- tmp.push( r[i] );
- }
- return tmp;
- },
-
- filter: function(t,r,not) {
- var last;
-
- // Look for common filter expressions
- while ( t && t != last ) {
- last = t;
-
- var p = jQuery.parse, m;
-
- for ( var i = 0; p[i]; i++ ) {
- m = p[i].exec( t );
-
- if ( m ) {
- // Remove what we just matched
- t = t.substring( m[0].length );
-
- m[2] = m[2].replace(/\\/g, "");
- break;
- }
- }
-
- if ( !m )
- break;
-
- // :not() is a special case that can be optimized by
- // keeping it out of the expression list
- if ( m[1] == ":" && m[2] == "not" )
- r = jQuery.filter(m[3], r, true).r;
-
- // We can get a big speed boost by filtering by class here
- else if ( m[1] == "." )
- r = jQuery.classFilter(r, m[2], not);
-
- else if ( m[1] == "[" ) {
- var tmp = [], type = m[3];
-
- for ( var i = 0, rl = r.length; i < rl; i++ ) {
- var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
-
- if ( z == null || /href|src|selected/.test(m[2]) )
- z = jQuery.attr(a,m[2]) || '';
-
- if ( (type == "" && !!z ||
- type == "=" && z == m[5] ||
- type == "!=" && z != m[5] ||
- type == "^=" && z && !z.indexOf(m[5]) ||
- type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
- (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
- tmp.push( a );
- }
-
- r = tmp;
-
- // We can get a speed boost by handling nth-child here
- } else if ( m[1] == ":" && m[2] == "nth-child" ) {
- var merge = {}, tmp = [],
- test = /(\d*)n\+?(\d*)/.exec(
- m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
- !/\D/.test(m[3]) && "n+" + m[3] || m[3]),
- first = (test[1] || 1) - 0, last = test[2] - 0;
-
- for ( var i = 0, rl = r.length; i < rl; i++ ) {
- var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
-
- if ( !merge[id] ) {
- var c = 1;
-
- for ( var n = parentNode.firstChild; n; n = n.nextSibling )
- if ( n.nodeType == 1 )
- n.nodeIndex = c++;
-
- merge[id] = true;
- }
-
- var add = false;
-
- if ( first == 1 ) {
- if ( last == 0 || node.nodeIndex == last )
- add = true;
- } else if ( (node.nodeIndex + last) % first == 0 )
- add = true;
-
- if ( add ^ not )
- tmp.push( node );
- }
-
- r = tmp;
-
- // Otherwise, find the expression to execute
- } else {
- var f = jQuery.expr[m[1]];
- if ( typeof f != "string" )
- f = jQuery.expr[m[1]][m[2]];
-
- // Build a custom macro to enclose it
- f = eval("false||function(a,i){return " + f + "}");
-
- // Execute it against the current filter
- r = jQuery.grep( r, f, not );
- }
- }
-
- // Return an array of filtered elements (r)
- // and the modified expression string (t)
- return { r: r, t: t };
- },
-
- dir: function( elem, dir ){
- var matched = [];
- var cur = elem[dir];
- while ( cur && cur != document ) {
- if ( cur.nodeType == 1 )
- matched.push( cur );
- cur = cur[dir];
- }
- return matched;
- },
-
- nth: function(cur,result,dir,elem){
- result = result || 1;
- var num = 0;
-
- for ( ; cur; cur = cur[dir] )
- if ( cur.nodeType == 1 && ++num == result )
- break;
-
- return cur;
- },
-
- sibling: function( n, elem ) {
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType == 1 && (!elem || n != elem) )
- r.push( n );
- }
-
- return r;
- }
-});
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code orignated from
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
- // Bind an event to an element
- // Original by Dean Edwards
- add: function(element, type, handler, data) {
- // For whatever reason, IE has trouble passing the window object
- // around, causing it to be cloned in the process
- if ( jQuery.browser.msie && element.setInterval != undefined )
- element = window;
-
- // Make sure that the function being executed has a unique ID
- if ( !handler.guid )
- handler.guid = this.guid++;
-
- // if data is passed, bind to handler
- if( data != undefined ) {
- // Create temporary function pointer to original handler
- var fn = handler;
-
- // Create unique handler function, wrapped around original handler
- handler = function() {
- // Pass arguments and context to original handler
- return fn.apply(this, arguments);
- };
-
- // Store data in unique handler
- handler.data = data;
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- handler.guid = fn.guid;
- }
-
- // Namespaced event handlers
- var parts = type.split(".");
- type = parts[0];
- handler.type = parts[1];
-
- // Init the element's event structure
- var events = jQuery.data(element, "events") || jQuery.data(element, "events", {});
-
- var handle = jQuery.data(element, "handle", function(){
- // returned undefined or false
- var val;
-
- // Handle the second event of a trigger and when
- // an event is called after a page has unloaded
- if ( typeof jQuery == "undefined" || jQuery.event.triggered )
- return val;
-
- val = jQuery.event.handle.apply(element, arguments);
-
- return val;
- });
-
- // Get the current list of functions bound to this event
- var handlers = events[type];
-
- // Init the event handler queue
- if (!handlers) {
- handlers = events[type] = {};
-
- // And bind the global event handler to the element
- if (element.addEventListener)
- element.addEventListener(type, handle, false);
- else
- element.attachEvent("on" + type, handle);
- }
-
- // Add the function to the element's handler list
- handlers[handler.guid] = handler;
-
- // Keep track of which events have been used, for global triggering
- this.global[type] = true;
- },
-
- guid: 1,
- global: {},
-
- // Detach an event or set of events from an element
- remove: function(element, type, handler) {
- var events = jQuery.data(element, "events"), ret, index;
-
- // Namespaced event handlers
- if ( typeof type == "string" ) {
- var parts = type.split(".");
- type = parts[0];
- }
-
- if ( events ) {
- // type is actually an event object here
- if ( type && type.type ) {
- handler = type.handler;
- type = type.type;
- }
-
- if ( !type ) {
- for ( type in events )
- this.remove( element, type );
-
- } else if ( events[type] ) {
- // remove the given handler for the given type
- if ( handler )
- delete events[type][handler.guid];
-
- // remove all handlers for the given type
- else
- for ( handler in events[type] )
- // Handle the removal of namespaced events
- if ( !parts[1] || events[type][handler].type == parts[1] )
- delete events[type][handler];
-
- // remove generic event handler if no more handlers exist
- for ( ret in events[type] ) break;
- if ( !ret ) {
- if (element.removeEventListener)
- element.removeEventListener(type, jQuery.data(element, "handle"), false);
- else
- element.detachEvent("on" + type, jQuery.data(element, "handle"));
- ret = null;
- delete events[type];
- }
- }
-
- // Remove the expando if it's no longer used
- for ( ret in events ) break;
- if ( !ret ) {
- jQuery.removeData( element, "events" );
- jQuery.removeData( element, "handle" );
- }
- }
- },
-
- trigger: function(type, data, element, donative, extra) {
- // Clone the incoming data, if any
- data = jQuery.makeArray(data || []);
-
- // Handle a global trigger
- if ( !element ) {
- // Only trigger if we've ever bound an event for it
- if ( this.global[type] )
- jQuery("*").add([window, document]).trigger(type, data);
-
- // Handle triggering a single element
- } else {
- var val, ret, fn = jQuery.isFunction( element[ type ] || null ),
- // Check to see if we need to provide a fake event, or not
- evt = !data[0] || !data[0].preventDefault;
-
- // Pass along a fake event
- if ( evt )
- data.unshift( this.fix({ type: type, target: element }) );
-
- // Enforce the right trigger type
- data[0].type = type;
-
- // Trigger the event
- if ( jQuery.isFunction( jQuery.data(element, "handle") ) )
- val = jQuery.data(element, "handle").apply( element, data );
-
- // Handle triggering native .onfoo handlers
- if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false )
- val = false;
-
- // Extra functions don't get the custom event object
- if ( evt )
- data.shift();
-
- // Handle triggering of extra function
- if ( extra && extra.apply( element, data ) === false )
- val = false;
-
- // Trigger the native events (except for clicks on links)
- if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) {
- this.triggered = true;
- element[ type ]();
- }
-
- this.triggered = false;
- }
-
- return val;
- },
-
- handle: function(event) {
- // returned undefined or false
- var val;
-
- // Empty object is for triggered events with no data
- event = jQuery.event.fix( event || window.event || {} );
-
- // Namespaced event handlers
- var parts = event.type.split(".");
- event.type = parts[0];
-
- var c = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 );
- args.unshift( event );
-
- for ( var j in c ) {
- // Pass in a reference to the handler function itself
- // So that we can later remove it
- args[0].handler = c[j];
- args[0].data = c[j].data;
-
- // Filter the functions by class
- if ( !parts[1] || c[j].type == parts[1] ) {
- var tmp = c[j].apply( this, args );
-
- if ( val !== false )
- val = tmp;
-
- if ( tmp === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
-
- // Clean up added properties in IE to prevent memory leak
- if (jQuery.browser.msie)
- event.target = event.preventDefault = event.stopPropagation =
- event.handler = event.data = null;
-
- return val;
- },
-
- fix: function(event) {
- // store a copy of the original event object
- // and clone to set read-only properties
- var originalEvent = event;
- event = jQuery.extend({}, originalEvent);
-
- // add preventDefault and stopPropagation since
- // they will not work on the clone
- event.preventDefault = function() {
- // if preventDefault exists run it on the original event
- if (originalEvent.preventDefault)
- originalEvent.preventDefault();
- // otherwise set the returnValue property of the original event to false (IE)
- originalEvent.returnValue = false;
- };
- event.stopPropagation = function() {
- // if stopPropagation exists run it on the original event
- if (originalEvent.stopPropagation)
- originalEvent.stopPropagation();
- // otherwise set the cancelBubble property of the original event to true (IE)
- originalEvent.cancelBubble = true;
- };
-
- // Fix target property, if necessary
- if ( !event.target && event.srcElement )
- event.target = event.srcElement;
-
- // check if target is a textnode (safari)
- if (jQuery.browser.safari && event.target.nodeType == 3)
- event.target = originalEvent.target.parentNode;
-
- // Add relatedTarget, if necessary
- if ( !event.relatedTarget && event.fromElement )
- event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
-
- // Calculate pageX/Y if missing and clientX/Y available
- if ( event.pageX == null && event.clientX != null ) {
- var e = document.documentElement, b = document.body;
- event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft || 0);
- event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop || 0);
- }
-
- // Add which for key events
- if ( !event.which && (event.charCode || event.keyCode) )
- event.which = event.charCode || event.keyCode;
-
- // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
- if ( !event.metaKey && event.ctrlKey )
- event.metaKey = event.ctrlKey;
-
- // Add which for click: 1 == left; 2 == middle; 3 == right
- // Note: button is not normalized, so don't use it
- if ( !event.which && event.button )
- event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-
- return event;
- }
-};
-
-jQuery.fn.extend({
- bind: function( type, data, fn ) {
- return type == "unload" ? this.one(type, data, fn) : this.each(function(){
- jQuery.event.add( this, type, fn || data, fn && data );
- });
- },
-
- one: function( type, data, fn ) {
- return this.each(function(){
- jQuery.event.add( this, type, function(event) {
- jQuery(this).unbind(event);
- return (fn || data).apply( this, arguments);
- }, fn && data);
- });
- },
-
- unbind: function( type, fn ) {
- return this.each(function(){
- jQuery.event.remove( this, type, fn );
- });
- },
-
- trigger: function( type, data, fn ) {
- return this.each(function(){
- jQuery.event.trigger( type, data, this, true, fn );
- });
- },
-
- triggerHandler: function( type, data, fn ) {
- if ( this[0] )
- return jQuery.event.trigger( type, data, this[0], false, fn );
- },
-
- toggle: function() {
- // Save reference to arguments for access in closure
- var a = arguments;
-
- return this.click(function(e) {
- // Figure out which function to execute
- this.lastToggle = 0 == this.lastToggle ? 1 : 0;
-
- // Make sure that clicks stop
- e.preventDefault();
-
- // and execute the function
- return a[this.lastToggle].apply( this, [e] ) || false;
- });
- },
-
- hover: function(f,g) {
-
- // A private function for handling mouse 'hovering'
- function handleHover(e) {
- // Check if mouse(over|out) are still within the same parent element
- var p = e.relatedTarget;
-
- // Traverse up the tree
- while ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };
-
- // If we actually just moused on to a sub-element, ignore it
- if ( p == this ) return false;
-
- // Execute the right function
- return (e.type == "mouseover" ? f : g).apply(this, [e]);
- }
-
- // Bind the function to the two event listeners
- return this.mouseover(handleHover).mouseout(handleHover);
- },
-
- ready: function(f) {
- // Attach the listeners
- bindReady();
-
- // If the DOM is already ready
- if ( jQuery.isReady )
- // Execute the function immediately
- f.apply( document, [jQuery] );
-
- // Otherwise, remember the function for later
- else
- // Add the function to the wait list
- jQuery.readyList.push( function() { return f.apply(this, [jQuery]); } );
-
- return this;
- }
-});
-
-jQuery.extend({
- /*
- * All the code that makes DOM Ready work nicely.
- */
- isReady: false,
- readyList: [],
-
- // Handle when the DOM is ready
- ready: function() {
- // Make sure that the DOM is not already loaded
- if ( !jQuery.isReady ) {
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If there are functions bound, to execute
- if ( jQuery.readyList ) {
- // Execute all of them
- jQuery.each( jQuery.readyList, function(){
- this.apply( document );
- });
-
- // Reset the list of functions
- jQuery.readyList = null;
- }
- // Remove event listener to avoid memory leak
- if ( jQuery.browser.mozilla || jQuery.browser.opera )
- document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
-
- // Remove script element used by IE hack
- if( !window.frames.length ) // don't remove if frames are present (#1187)
- jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
- }
- }
-});
-
-jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
- "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +
- "submit,keydown,keypress,keyup,error").split(","), function(i,o){
-
- // Handle event binding
- jQuery.fn[o] = function(f){
- return f ? this.bind(o, f) : this.trigger(o);
- };
-});
-
-var readyBound = false;
-
-function bindReady(){
- if ( readyBound ) return;
- readyBound = true;
-
- // If Mozilla is used
- if ( jQuery.browser.mozilla || jQuery.browser.opera )
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
-
- // If IE is used, use the excellent hack by Matthias Miller
- // http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
- else if ( jQuery.browser.msie ) {
-
- // Only works if you document.write() it
- document.write("<scr" + "ipt id=__ie_init defer=...
[truncated message content] |
|
From: <an...@us...> - 2009-06-16 11:52:28
|
Revision: 796
http://tacos.svn.sourceforge.net/tacos/?rev=796&view=rev
Author: andyhot
Date: 2009-06-16 11:52:07 +0000 (Tue, 16 Jun 2009)
Log Message:
-----------
Rename library file + fix param
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/components/JqueryAutocompleter.java
Added Paths:
-----------
tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/Jquery.library
Removed Paths:
-------------
tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/jquery.library
Copied: tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/Jquery.library (from rev 789, tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/jquery.library)
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/Jquery.library (rev 0)
+++ tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/Jquery.library 2009-06-16 11:52:07 UTC (rev 796)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library-specification PUBLIC
+ "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+
+<library-specification>
+ <description>jQuery Library</description>
+
+ <component-type type="Autocompleter" specification-path="components/Autocompleter.jwc"/>
+ <component-type type="Dialog" specification-path="components/Dialog.jwc"/>
+
+</library-specification>
Property changes on: tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/Jquery.library
___________________________________________________________________
Added: svn:mergeinfo
+
Modified: tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/components/JqueryAutocompleter.java
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/components/JqueryAutocompleter.java 2009-05-24 01:59:48 UTC (rev 795)
+++ tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/components/JqueryAutocompleter.java 2009-06-16 11:52:07 UTC (rev 796)
@@ -74,7 +74,6 @@
if (!isLocal())
{
ILink link = getDirectService().getLink(true, new DirectServiceParameter(this));
- json.put("dataUrl", link.getURL() + "&filter=%{searchString}");
parms.put("url", link.getURL());
}
Deleted: tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/jquery.library
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/jquery.library 2009-05-24 01:59:48 UTC (rev 795)
+++ tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/jquery.library 2009-06-16 11:52:07 UTC (rev 796)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE library-specification PUBLIC
- "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
- "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
-
-<library-specification>
- <description>jQuery Library</description>
-
- <component-type type="Autocompleter" specification-path="components/Autocompleter.jwc"/>
- <component-type type="Dialog" specification-path="components/Dialog.jwc"/>
-
-</library-specification>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-05-24 02:02:08
|
Revision: 795
http://tacos.svn.sourceforge.net/tacos/?rev=795&view=rev
Author: andyhot
Date: 2009-05-24 01:59:48 +0000 (Sun, 24 May 2009)
Log Message:
-----------
Allow dynamic control of whether the htmlares is rendered (since it behaves strangely in Opera&Safari)
Modified Paths:
--------------
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.java
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.jwc
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.java
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.java 2009-05-21 15:47:29 UTC (rev 794)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.java 2009-05-24 01:59:48 UTC (rev 795)
@@ -84,6 +84,7 @@
parms.put("props", json.toString());
parms.put("widget", this);
+ parms.put("jsCondition", getJsCondition());
parms.put("domPostFilter", getDomPostFilter());
parms.put("domPreFilter", getDomPreFilter());
parms.put("postFilter", getPostFilter());
@@ -114,6 +115,8 @@
}
}
+ public abstract String getJsCondition();
+
public abstract String getToolbarTemplatePath();
public abstract String getDomPostFilter();
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.jwc
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.jwc 2009-05-21 15:47:29 UTC (rev 794)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.jwc 2009-05-24 01:59:48 UTC (rev 795)
@@ -37,6 +37,15 @@
HtmlArea will not update its value parameter when the form is submitted.
</description>
</parameter>
+
+ <parameter name="jsCondition">
+ <description>
+ A javascript expression. It is evaluated before creating the Editor
+ widget and if false, no widget is constructed.
+ By default, the widget is always created. Useful values for this can be:
+ (dojo.render.html.mozilla||dojo.render.html.ie)
+ </description>
+ </parameter>
<parameter name="displayName">
<description>
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script 2009-05-21 15:47:29 UTC (rev 794)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script 2009-05-24 01:59:48 UTC (rev 795)
@@ -6,6 +6,7 @@
<input-symbol key="id" required="yes" />
<input-symbol key="props" required="yes" />
<input-symbol key="widget" required="yes" />
+<input-symbol key="jsCondition"/>
<input-symbol key="domPostFilter"/>
<input-symbol key="domPreFilter"/>
<input-symbol key="postFilter"/>
@@ -17,7 +18,7 @@
document.htmlUpdate = function(w) {w.textarea.value=w.getEditorContent();};
</unique>
</body>
- <initialization>
+ <initialization><if expression="jsCondition">if (${jsCondition}){</if>
tapestry.widget.synchronizeWidgetState("${id}", "Editor2", ${props}, ${widget.destroy});
(function(){
var editor=dojo.widget.byId("${id}");
@@ -27,5 +28,5 @@
expression="domPreFilter">if (${domPreFilter}!=editor.contentDomPreFilters[editor.contentDomPreFilters.length]) editor.contentDomPreFilters.push(${domPreFilter});</if><if
expression="postFilter">if (${postFilter}!=editor.contentPostFilters[editor.contentPostFilters.length]) editor.contentPostFilters.push(${postFilter});</if><if
expression="preFilter">if (${preFilter}!=editor.contentPreFilters[editor.contentPreFilters.length]) editor.contentPreFilters.push(${preFilter});</if> })();
- </initialization>
+ <if expression="jsCondition"> }</if></initialization>
</script>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-05-21 15:47:44
|
Revision: 794
http://tacos.svn.sourceforge.net/tacos/?rev=794&view=rev
Author: andyhot
Date: 2009-05-21 15:47:29 +0000 (Thu, 21 May 2009)
Log Message:
-----------
write rule only when we have a content type
Modified Paths:
--------------
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.java
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.java
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.java 2009-05-21 07:47:09 UTC (rev 793)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.java 2009-05-21 15:47:29 UTC (rev 794)
@@ -31,40 +31,35 @@
if (href==null)
throw new ApplicationRuntimeException("href parameter of IeStyle is null!", this.getLocation(), null);
- String url;
- if (href instanceof String)
+ final String cType = writer.getContentType();
+ if (cType!=null)
{
- url = (String) href;
- }
- else
- {
- url = ((IAsset)href).buildURL();
- }
+ String url = (href instanceof String) ? (String) href : ((IAsset)href).buildURL();
- StringWriter sWriter = new StringWriter();
- final String cType = writer.getContentType();
- final ContentType contentType = cType==null ? new ContentType() : new ContentType(cType);
- IMarkupWriter nested = getMarkupWriterSource().newMarkupWriter(new PrintWriter(sWriter), contentType);
+ StringWriter sWriter = new StringWriter();
+ final ContentType contentType = new ContentType(cType);
+ IMarkupWriter nested = getMarkupWriterSource().newMarkupWriter(new PrintWriter(sWriter), contentType);
- nested.printRaw("<!--[if ");
- nested.printRaw(getVersions());
- nested.printRaw("]>\n");
+ nested.printRaw("<!--[if ");
+ nested.printRaw(getVersions());
+ nested.printRaw("]>\n");
- nested.beginEmpty("link");
+ nested.beginEmpty("link");
- writeAttributeIfNotNull(nested, "rel", getRel());
- writeAttributeIfNotNull(nested, "type", getType());
- writeAttributeIfNotNull(nested, "media", getMedia());
- writeAttributeIfNotNull(nested, "title", getTitle());
- writeAttributeIfNotNull(nested, "href", url);
+ writeAttributeIfNotNull(nested, "rel", getRel());
+ writeAttributeIfNotNull(nested, "type", getType());
+ writeAttributeIfNotNull(nested, "media", getMedia());
+ writeAttributeIfNotNull(nested, "title", getTitle());
+ writeAttributeIfNotNull(nested, "href", url);
- nested.println();
+ nested.println();
- nested.printRaw("<![endif]-->\n");
+ nested.printRaw("<![endif]-->\n");
- nested.close();
+ nested.close();
- shell.includeAdditionalContent(sWriter.toString());
+ shell.includeAdditionalContent(sWriter.toString());
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-05-21 07:47:39
|
Revision: 793
http://tacos.svn.sourceforge.net/tacos/?rev=793&view=rev
Author: andyhot
Date: 2009-05-21 07:47:09 +0000 (Thu, 21 May 2009)
Log Message:
-----------
IeStyle component
Modified Paths:
--------------
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/Tacos.library
Added Paths:
-----------
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.java
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.jwc
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/Tacos.library
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/Tacos.library 2009-04-29 02:50:17 UTC (rev 792)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/Tacos.library 2009-05-21 07:47:09 UTC (rev 793)
@@ -27,8 +27,9 @@
<component-type type="Glider" specification-path="components/scriptaculous/Glider.jwc"/>
<!-- New misc components -->
+ <component-type type="IeStyle" specification-path="components/IeStyle.jwc"/>
<component-type type="Timeline" specification-path="components/timeline/Timeline.jwc"/>
- <component-type type="Firebug" specification-path="components/Firebug.jwc"/>
+ <component-type type="Firebug" specification-path="components/Firebug.jwc"/>
<component-type type="ClientLink" specification-path="components/ClientLink.jwc"/>
<!-- private components -->
Added: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.java
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.java (rev 0)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.java 2009-05-21 07:47:09 UTC (rev 793)
@@ -0,0 +1,91 @@
+package net.sf.tacos.components;
+
+import org.apache.tapestry.AbstractComponent;
+import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.IAsset;
+import org.apache.tapestry.util.ContentType;
+import org.apache.tapestry.html.Shell;
+import org.apache.tapestry.markup.MarkupWriterSource;
+import org.apache.hivemind.ApplicationRuntimeException;
+
+import java.io.StringWriter;
+import java.io.PrintWriter;
+
+/**
+ * @author Andreas Andreou
+ */
+public abstract class IeStyle extends AbstractComponent {
+
+ protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
+ {
+ if (!cycle.isRewinding())
+ {
+ Shell shell = Shell.get(cycle);
+
+ if (shell == null)
+ throw new ApplicationRuntimeException("Shell component not found!", this.getLocation(), null);
+
+ Object href = getHref();
+
+ if (href==null)
+ throw new ApplicationRuntimeException("href parameter of IeStyle is null!", this.getLocation(), null);
+
+ String url;
+ if (href instanceof String)
+ {
+ url = (String) href;
+ }
+ else
+ {
+ url = ((IAsset)href).buildURL();
+ }
+
+ StringWriter sWriter = new StringWriter();
+ final String cType = writer.getContentType();
+ final ContentType contentType = cType==null ? new ContentType() : new ContentType(cType);
+ IMarkupWriter nested = getMarkupWriterSource().newMarkupWriter(new PrintWriter(sWriter), contentType);
+
+ nested.printRaw("<!--[if ");
+ nested.printRaw(getVersions());
+ nested.printRaw("]>\n");
+
+ nested.beginEmpty("link");
+
+ writeAttributeIfNotNull(nested, "rel", getRel());
+ writeAttributeIfNotNull(nested, "type", getType());
+ writeAttributeIfNotNull(nested, "media", getMedia());
+ writeAttributeIfNotNull(nested, "title", getTitle());
+ writeAttributeIfNotNull(nested, "href", url);
+
+ nested.println();
+
+ nested.printRaw("<![endif]-->\n");
+
+ nested.close();
+
+ shell.includeAdditionalContent(sWriter.toString());
+ }
+ }
+
+ private void writeAttributeIfNotNull(IMarkupWriter writer, String name, String value)
+ {
+ if (value != null)
+ writer.attribute(name, value);
+ }
+
+ public abstract Object getHref();
+
+ public abstract String getVersions();
+
+ public abstract String getRel();
+
+ public abstract String getType();
+
+ public abstract String getTitle();
+
+ public abstract String getMedia();
+
+ /* injected */
+ public abstract MarkupWriterSource getMarkupWriterSource();
+}
Added: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.jwc
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.jwc (rev 0)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/IeStyle.jwc 2009-05-21 07:47:09 UTC (rev 793)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE component-specification
+ PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+
+<component-specification class="net.sf.tacos.components.IeStyle">
+ <description>
+ Declares a stylesheet for IE to be included in the current page.
+ </description>
+
+ <parameter name="versions" default-value="literal:IE">
+ <description>
+ The string that defines the IE versions to target, i.e. 'lte IE 6', 'lt IE 6', e.t.c.
+ </description>
+ </parameter>
+
+ <parameter name="href" required="true">
+ <description>
+ The target URL of the stylesheet. Can either be a String or an IAsset.
+ </description>
+ </parameter>
+
+ <parameter name="rel" default-value="literal:stylesheet">
+ <description>
+ By default this is 'stylesheet' but you can also use 'alternate stylesheet'.
+ </description>
+ </parameter>
+
+ <parameter name="title">
+ <description>
+ Title of the stylesheet.
+ </description>
+ </parameter>
+
+ <parameter name="media">
+ <description>
+ Specifies on which device this stylesheet will apply.
+ </description>
+ </parameter>
+
+ <property name="type" initial-value="literal:text/css"/>
+
+ <inject property="markupWriterSource" object="service:tapestry.markup.MarkupWriterSource"/>
+</component-specification>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-04-29 02:50:33
|
Revision: 792
http://tacos.svn.sourceforge.net/tacos/?rev=792&view=rev
Author: andyhot
Date: 2009-04-29 02:50:17 +0000 (Wed, 29 Apr 2009)
Log Message:
-----------
use class if exists
Modified Paths:
--------------
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/DojoWidget.java
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/DojoWidget.jwc
Property Changed:
----------------
tacos-4.1/trunk/tacos-core/
Property changes on: tacos-4.1/trunk/tacos-core
___________________________________________________________________
Modified: svn:ignore
- target
+ target
.project
.settings
.classpath
.externalToolBuilders
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/DojoWidget.java
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/DojoWidget.java 2009-03-29 17:33:31 UTC (rev 791)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/DojoWidget.java 2009-04-29 02:50:17 UTC (rev 792)
@@ -126,6 +126,10 @@
String style = getStyle();
if (style!=null)
writer.attribute("style", style);
+
+ String className = getClassName();
+ if (className!=null)
+ writer.attribute("class", className);
if(isContainer){
cycle.setAttribute(CONTAINER_ATTRIBUTE, this);
@@ -319,6 +323,9 @@
/** Returns the style. */
public abstract String getStyle();
+
+ /** The html class to use. */
+ public abstract String getClassName();
/** Returns the type of the dojo widget */
public abstract String getDojoType();
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/DojoWidget.jwc
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/DojoWidget.jwc 2009-03-29 17:33:31 UTC (rev 791)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/DojoWidget.jwc 2009-04-29 02:50:17 UTC (rev 792)
@@ -64,6 +64,8 @@
<parameter name="style"/>
+ <parameter name="class" property="className"/>
+
<parameter name="noAsync">
<description>
Names of the widget events no to create an async request for as a comma separated
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-03-29 17:33:35
|
Revision: 791
http://tacos.svn.sourceforge.net/tacos/?rev=791&view=rev
Author: andyhot
Date: 2009-03-29 17:33:31 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
comments+docs
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
Modified: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2009-03-29 17:32:26 UTC (rev 790)
+++ tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2009-03-29 17:33:31 UTC (rev 791)
@@ -72,7 +72,6 @@
* Parameters: target, event, funcName
*/
cleanConnect: function(target, event, funcName) {
- //tapestry.log('t.cleanConnect', arguments);
if (event.indexOf('on')==0) event=event.substring(2);
jQuery(tapestry.byId(target)).unbind(event, tapestry[funcName]);
},
@@ -283,14 +282,13 @@
},
loadScriptContent: function(element, async){
- if (typeof async == "undefined") { async = true; }
+ if (typeof async == "undefined") { async = true; }
async = this.isIE;
if (tapestry.scriptInFlight) {
- tapestry.log("loadScriptContent(): scriptInFlight is true, sleeping");
- setTimeout(function() { tapestry.loadScriptContent(element, async);}, 5);
- return;
- }
+ setTimeout(function() { tapestry.loadScriptContent(element, async);}, 5);
+ return;
+ }
var text = tapestry.html.getContentAsString(element);
text.replace(this.GlobalScriptFragment, '');
@@ -314,11 +312,10 @@
var scr = scripts[i].match(this.ScriptFragment)[1];
if(!scr || scr.length <= 0){continue;}
try {
- //tapestry.log("evaluating script:", scr);
- eval(scr);
+ eval(scr);
} catch (e) {
- tapestry.scriptInFlight = false;
- tapestry.log("Error evaluating script: " + scr, e, false);
+ tapestry.scriptInFlight = false;
+ tapestry.log("Error evaluating script: " + scr, e, false);
}
}
@@ -326,7 +323,6 @@
},
loadScriptFromUrl: function(url){
- tapestry.log('loadScriptFromUrl', arguments);
jQuery.getScript(url);
},
@@ -336,7 +332,7 @@
*
* @param url
* @param id
- * @param json
+ * @param isJson
* @param eventName
*/
linkOnClick: function(url, id, isJson, eventName) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-03-29 17:32:38
|
Revision: 790
http://tacos.svn.sourceforge.net/tacos/?rev=790&view=rev
Author: andyhot
Date: 2009-03-29 17:32:26 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
tacos contrib with captcha service+component
Modified Paths:
--------------
tacos-4.1/trunk/pom.xml
Added Paths:
-----------
tacos-4.1/trunk/tacos-contrib/
tacos-4.1/trunk/tacos-contrib/pom.xml
tacos-4.1/trunk/tacos-contrib/src/
tacos-4.1/trunk/tacos-contrib/src/descriptor/
tacos-4.1/trunk/tacos-contrib/src/descriptor/hivemodule.xml
tacos-4.1/trunk/tacos-contrib/src/java/
tacos-4.1/trunk/tacos-contrib/src/java/net/
tacos-4.1/trunk/tacos-contrib/src/java/net/sf/
tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/
tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/
tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/Contrib.library
tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/
tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaService.java
tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaServiceImpl.java
tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaTapestryService.java
tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaValidator.java
tacos-4.1/trunk/tacos-contrib/src/test/
Modified: tacos-4.1/trunk/pom.xml
===================================================================
--- tacos-4.1/trunk/pom.xml 2009-01-15 05:05:31 UTC (rev 789)
+++ tacos-4.1/trunk/pom.xml 2009-03-29 17:32:26 UTC (rev 790)
@@ -80,6 +80,7 @@
<!--module>tacos-maven-skin</module-->
<module>tacos-core</module>
<module>tacos-annotations</module>
+ <module>tacos-contrib</module>
<!--module>tacos-cometd</module-->
<module>tacos-demo</module>
<!--module>beanform</module-->
Added: tacos-4.1/trunk/tacos-contrib/pom.xml
===================================================================
--- tacos-4.1/trunk/tacos-contrib/pom.xml (rev 0)
+++ tacos-4.1/trunk/tacos-contrib/pom.xml 2009-03-29 17:32:26 UTC (rev 790)
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>net.sf.tacos</groupId>
+ <artifactId>tacos-contrib</artifactId>
+ <version>4.1.2-SNAPSHOT</version>
+
+ <name>Tacos contrib library</name>
+ <inceptionYear>2009</inceptionYear>
+
+ <parent>
+ <groupId>net.sf.tacos</groupId>
+ <artifactId>tacos-project</artifactId>
+ <version>4.1.2-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-framework</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.octo.captcha</groupId>
+ <artifactId>jcaptcha</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ </dependency>
+ </dependencies>
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/descriptor/</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <targetPath>META-INF</targetPath>
+ </resource>
+ <resource>
+ <directory>src/java</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <testSourceDirectory>src/test</testSourceDirectory>
+ <testResources>
+ <testResource>
+ <directory>src/test</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <outputDirectory>../target/site/tacos-contrib</outputDirectory>
+ <plugins>
+ <plugin>
+ <groupId>com.erinors.tapestry</groupId>
+ <artifactId>tapdoc-maven-plugin</artifactId>
+ <configuration>
+ <libraries>
+ <param>/net/sf/tacos/contrib/Contrib.library</param>
+ </libraries>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
+
Added: tacos-4.1/trunk/tacos-contrib/src/descriptor/hivemodule.xml
===================================================================
--- tacos-4.1/trunk/tacos-contrib/src/descriptor/hivemodule.xml (rev 0)
+++ tacos-4.1/trunk/tacos-contrib/src/descriptor/hivemodule.xml 2009-03-29 17:32:26 UTC (rev 790)
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2009 tacos
+-->
+
+<module id="tacos.contrib" version="1.0.0" package="net.sf.tacos.contrib">
+
+ <service-point id="jcaptcha" interface="captcha.CaptchaService">
+ <invoke-factory>
+ <construct class="captcha.CaptchaServiceImpl">
+ </construct>
+ </invoke-factory>
+ </service-point>
+
+ <service-point id="jcaptchaWeb" interface="org.apache.tapestry.engine.IEngineService">
+ <invoke-factory>
+ <construct class="captcha.CaptchaTapestryService">
+ <set-service property="captchaService" service-id="jcaptcha"/>
+ <set property="name" value="${jcaptcha-service-name}"/>
+ </construct>
+ </invoke-factory>
+ </service-point>
+
+ <service-point id="jcaptchaValidator" interface="org.apache.tapestry.form.validator.Validator">
+ <invoke-factory>
+ <construct class="captcha.CaptchaValidator">
+ <set-service property="captchaService" service-id="jcaptcha"/>
+ <set property="message" value="Error in CAPTCHA"/>
+ </construct>
+ </invoke-factory>
+ </service-point>
+
+ <contribution configuration-id="tapestry.services.ApplicationServices">
+ <service name="${jcaptcha-service-name}" object="service:jcaptchaWeb"/>
+ </contribution>
+
+ <contribution configuration-id="hivemind.FactoryDefaults">
+ <default symbol="jcaptcha-service-name" value="jcaptcha"/>
+ </contribution>
+
+</module>
\ No newline at end of file
Added: tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/Contrib.library
===================================================================
--- tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/Contrib.library (rev 0)
+++ tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/Contrib.library 2009-03-29 17:32:26 UTC (rev 790)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library-specification PUBLIC
+ "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+
+<library-specification>
+ <description>Tacos Contrib Library</description>
+
+</library-specification>
Added: tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaService.java
===================================================================
--- tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaService.java (rev 0)
+++ tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaService.java 2009-03-29 17:32:26 UTC (rev 790)
@@ -0,0 +1,28 @@
+/*
+ */
+
+package net.sf.tacos.contrib.captcha;
+
+import java.awt.image.BufferedImage;
+import java.util.Locale;
+
+/**
+ *
+ * @author andyhot
+ */
+public interface CaptchaService {
+ /**
+ * Generates and returns the Captcha image.
+ *
+ * @param id usually the session id
+ * @param locale the locale associated with the request
+ */
+ BufferedImage getImage(String id, Locale locale);
+
+ /**
+ * Checks if the response to the Captcha is correct.
+ *
+ * @param word
+ */
+ boolean validate(String word);
+}
Added: tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaServiceImpl.java
===================================================================
--- tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaServiceImpl.java (rev 0)
+++ tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaServiceImpl.java 2009-03-29 17:32:26 UTC (rev 790)
@@ -0,0 +1,59 @@
+/*
+ */
+
+package net.sf.tacos.contrib.captcha;
+
+import com.octo.captcha.service.CaptchaServiceException;
+import com.octo.captcha.service.image.DefaultManageableImageCaptchaService;
+import com.octo.captcha.service.image.ImageCaptchaService;
+import java.awt.image.BufferedImage;
+import java.util.Locale;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * A {@link CaptchaService} implelemtation using jcaptcha.
+ *
+ * @see http://forge.octo.com/jcaptcha/confluence/display/general/Home
+ * @author andyhot
+ */
+public class CaptchaServiceImpl implements CaptchaService {
+
+ private ImageCaptchaService jcaptcha;
+ private HttpServletRequest servletRequest;
+
+ public HttpServletRequest getServletRequest() {
+ return servletRequest;
+ }
+
+ public void setServletRequest(HttpServletRequest servletRequest) {
+ this.servletRequest = servletRequest;
+ }
+
+ public void initializeService() {
+ jcaptcha = new DefaultManageableImageCaptchaService();
+ }
+
+ public ImageCaptchaService getService() {
+ return jcaptcha;
+ }
+
+ public BufferedImage getImage(String id, Locale locale) {
+ return jcaptcha.getImageChallengeForID(id, locale);
+ }
+
+ public boolean validate(String parameter) {
+ Boolean isResponseCorrect = Boolean.FALSE;
+ //remenber that we need an id to validate!
+ String captchaId = getServletRequest().getSession().getId();
+ //retrieve the response
+ String word = parameter;
+ // Call the Service method
+ try {
+ isResponseCorrect = jcaptcha.validateResponseForID(captchaId, word);
+ } catch (CaptchaServiceException e) {
+ //should not happen, may be thrown if the id is not valid
+ }
+ return isResponseCorrect!=null && isResponseCorrect.booleanValue();
+ }
+
+}
Added: tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaTapestryService.java
===================================================================
--- tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaTapestryService.java (rev 0)
+++ tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaTapestryService.java 2009-03-29 17:32:26 UTC (rev 790)
@@ -0,0 +1,136 @@
+/*
+ */
+
+package net.sf.tacos.contrib.captcha;
+
+import com.octo.captcha.service.CaptchaServiceException;
+import com.sun.image.codec.jpeg.JPEGCodec;
+import com.sun.image.codec.jpeg.JPEGImageEncoder;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.engine.IEngineService;
+import org.apache.tapestry.engine.ILink;
+import org.apache.tapestry.services.LinkFactory;
+
+/**
+ * Tapestry {@link IEngineService service} that presents a Captcha.
+ *
+ * @author andyhot
+ */
+public class CaptchaTapestryService implements IEngineService {
+
+ private CaptchaService captchaService;
+ private HttpServletRequest servletRequest;
+ private HttpServletResponse servletResponse;
+ private LinkFactory linkFactory;
+ private String name;
+
+
+ public ILink getLink(boolean post, Object parameter) {
+ if (parameter==null) {
+ parameter = new HashMap();
+ }
+ Map p = (Map)parameter;
+ p.put("t", "" + Math.random());
+ return getLinkFactory().constructLink(this, post, p, false);
+ }
+
+ public void service(IRequestCycle cycle) throws IOException {
+ try {
+ doGet(getServletRequest(), getServletResponse());
+ } catch (ServletException ex) {
+ throw new IOException(ex);
+ }
+ }
+
+ /**
+ * Code copied from
+ * http://forge.octo.com/jcaptcha/confluence/display/general/5+minutes+application+integration+tutorial
+ */
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+
+ byte[] captchaChallengeAsJpeg = null;
+ // the output stream to render the captcha image as jpeg into
+ ByteArrayOutputStream jpegOutputStream = new ByteArrayOutputStream();
+ try {
+ // get the session id that will identify the generated captcha.
+ //the same id must be used to validate the response, the session id is a good candidate!
+ String captchaId = request.getSession().getId();
+ // call the ImageCaptchaService getChallenge method
+ BufferedImage challenge = getCaptchaService().getImage(captchaId,
+ request.getLocale());
+
+ // a jpeg encoder
+ JPEGImageEncoder jpegEncoder =
+ JPEGCodec.createJPEGEncoder(jpegOutputStream);
+ jpegEncoder.encode(challenge);
+ } catch (IllegalArgumentException e) {
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ } catch (CaptchaServiceException e) {
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ return;
+ }
+
+ captchaChallengeAsJpeg = jpegOutputStream.toByteArray();
+
+ // flush it in the response
+ response.setHeader("Cache-Control", "no-store");
+ response.setHeader("Pragma", "no-cache");
+ response.setDateHeader("Expires", 0);
+ response.setContentType("image/jpeg");
+ ServletOutputStream responseOutputStream = response.getOutputStream();
+ responseOutputStream.write(captchaChallengeAsJpeg);
+ responseOutputStream.flush();
+ responseOutputStream.close();
+ }
+
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public LinkFactory getLinkFactory() {
+ return linkFactory;
+ }
+
+ public void setLinkFactory(LinkFactory linkFactory) {
+ this.linkFactory = linkFactory;
+ }
+
+ public CaptchaService getCaptchaService() {
+ return captchaService;
+ }
+
+ public void setCaptchaService(CaptchaService captchaService) {
+ this.captchaService = captchaService;
+ }
+
+ public HttpServletRequest getServletRequest() {
+ return servletRequest;
+ }
+
+ public void setServletRequest(HttpServletRequest servletRequest) {
+ this.servletRequest = servletRequest;
+ }
+
+ public HttpServletResponse getServletResponse() {
+ return servletResponse;
+ }
+
+ public void setServletResponse(HttpServletResponse servletResponse) {
+ this.servletResponse = servletResponse;
+ }
+}
Added: tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaValidator.java
===================================================================
--- tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaValidator.java (rev 0)
+++ tacos-4.1/trunk/tacos-contrib/src/java/net/sf/tacos/contrib/captcha/CaptchaValidator.java 2009-03-29 17:32:26 UTC (rev 790)
@@ -0,0 +1,42 @@
+/*
+ */
+
+package net.sf.tacos.contrib.captcha;
+
+import org.apache.tapestry.form.IFormComponent;
+import org.apache.tapestry.form.ValidationMessages;
+import org.apache.tapestry.form.validator.BaseValidator;
+import org.apache.tapestry.valid.ValidatorException;
+
+/**
+ * A Tapestry validator for Captcha.
+ * @author andyhot
+ */
+public class CaptchaValidator extends BaseValidator {
+
+ private CaptchaService captchaService;
+
+ public void validate(IFormComponent field, ValidationMessages messages, Object object) throws ValidatorException {
+ String word = (String) object;
+ boolean result = getCaptchaService().validate(word);
+ if (!result) {
+ throw new ValidatorException(getMessage());
+ }
+ }
+
+ public boolean isRequired() {
+ return true;
+ }
+
+ public boolean getAcceptsNull() {
+ return true;
+ }
+
+ public CaptchaService getCaptchaService() {
+ return captchaService;
+ }
+
+ public void setCaptchaService(CaptchaService captchaService) {
+ this.captchaService = captchaService;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2009-01-15 05:05:48
|
Revision: 789
http://tacos.svn.sourceforge.net/tacos/?rev=789&view=rev
Author: andyhot
Date: 2009-01-15 05:05:31 +0000 (Thu, 15 Jan 2009)
Log Message:
-----------
support filters as parameters in editor + fix minor focus bug
Modified Paths:
--------------
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.java
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.jwc
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.java
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.java 2008-12-27 05:16:11 UTC (rev 788)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.java 2009-01-15 05:05:31 UTC (rev 789)
@@ -84,7 +84,11 @@
parms.put("props", json.toString());
parms.put("widget", this);
-
+ parms.put("domPostFilter", getDomPostFilter());
+ parms.put("domPreFilter", getDomPreFilter());
+ parms.put("postFilter", getPostFilter());
+ parms.put("preFilter", getPreFilter());
+
PageRenderSupport prs = TapestryUtils.getPageRenderSupport(cycle, this);
getScript().execute(this, cycle, prs, parms);
}
@@ -111,7 +115,14 @@
}
public abstract String getToolbarTemplatePath();
-
+
+ public abstract String getDomPostFilter();
+ public abstract String getPostFilter();
+
+ public abstract String getDomPreFilter();
+ public abstract String getPreFilter();
+
+
/** @since 2.2 * */
public abstract Object getValue();
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.jwc
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.jwc 2008-12-27 05:16:11 UTC (rev 788)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.jwc 2009-01-15 05:05:31 UTC (rev 789)
@@ -48,8 +48,32 @@
<description>
A path containing the template of the toolbar.
</description>
- </parameter>
+ </parameter>
+ <parameter name="domPostFilter">
+ <description>
+ A js function to add as dom post filter to the editor.
+ </description>
+ </parameter>
+
+ <parameter name="postFilter">
+ <description>
+ A js function to add as post filter to the editor.
+ </description>
+ </parameter>
+
+ <parameter name="domPreFilter">
+ <description>
+ A js function to add as dom pre filter to the editor.
+ </description>
+ </parameter>
+
+ <parameter name="preFilter">
+ <description>
+ A js function to add as pre filter to the editor.
+ </description>
+ </parameter>
+
<parameter name="translator" default-value="translator:string"/>
<parameter name="validators"/>
<parameter name="id" property="idParameter" default-value="id"/>
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script 2008-12-27 05:16:11 UTC (rev 788)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script 2009-01-15 05:05:31 UTC (rev 789)
@@ -6,6 +6,10 @@
<input-symbol key="id" required="yes" />
<input-symbol key="props" required="yes" />
<input-symbol key="widget" required="yes" />
+<input-symbol key="domPostFilter"/>
+<input-symbol key="domPreFilter"/>
+<input-symbol key="postFilter"/>
+<input-symbol key="preFilter"/>
<body>
<unique>
dojo.require("dojo.widget.Editor2");
@@ -17,8 +21,11 @@
tapestry.widget.synchronizeWidgetState("${id}", "Editor2", ${props}, ${widget.destroy});
(function(){
var editor=dojo.widget.byId("${id}");
- dojo.event.connectOnce(editor, "onDisplayChanged", function(){document.htmlUpdate(editor);});
- dojo.event.connectOnce(editor.domNode, "onclick", function(){editor.focus();});
- })();
+ dojo.event.connectOnce(editor, "onDisplayChanged", function(){document.htmlUpdate(editor);});
+ dojo.event.connectOnce(editor.domNode, "onclick", function(e){if (e.target.tagName.toLowerCase()=='div') editor.focus();});
+<if expression="domPostFilter">if (${domPostFilter}!=editor.contentDomPostFilters[editor.contentDomPostFilters.length]) editor.contentDomPostFilters.push(${domPostFilter});</if><if
+ expression="domPreFilter">if (${domPreFilter}!=editor.contentDomPreFilters[editor.contentDomPreFilters.length]) editor.contentDomPreFilters.push(${domPreFilter});</if><if
+ expression="postFilter">if (${postFilter}!=editor.contentPostFilters[editor.contentPostFilters.length]) editor.contentPostFilters.push(${postFilter});</if><if
+ expression="preFilter">if (${preFilter}!=editor.contentPreFilters[editor.contentPreFilters.length]) editor.contentPreFilters.push(${preFilter});</if> })();
</initialization>
</script>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2008-12-27 05:16:16
|
Revision: 788
http://tacos.svn.sourceforge.net/tacos/?rev=788&view=rev
Author: andyhot
Date: 2008-12-27 05:16:11 +0000 (Sat, 27 Dec 2008)
Log Message:
-----------
missing stub functions
Modified Paths:
--------------
tacos-4.1/trunk/tacos-dojo/src/js/tacos-dojo-js/tap-dojo1.0.2.js
Modified: tacos-4.1/trunk/tacos-dojo/src/js/tacos-dojo-js/tap-dojo1.0.2.js
===================================================================
--- tacos-4.1/trunk/tacos-dojo/src/js/tacos-dojo-js/tap-dojo1.0.2.js 2008-12-27 05:12:36 UTC (rev 787)
+++ tacos-4.1/trunk/tacos-dojo/src/js/tacos-dojo-js/tap-dojo1.0.2.js 2008-12-27 05:16:11 UTC (rev 788)
@@ -53,6 +53,10 @@
cleanConnect: function(target, event, funcName) {
dojo.disconnect(tapestry['h_'+funcName]);
},
+
+ connectWidget: function() {tapestry.log('t.connectWidget', arguments);},
+
+ cleanConnectWidget: function() {tapestry.log('t.cleanConnectWidget', arguments);},
/**
* Perform an XHR.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2008-12-27 05:12:45
|
Revision: 787
http://tacos.svn.sourceforge.net/tacos/?rev=787&view=rev
Author: andyhot
Date: 2008-12-27 05:12:36 +0000 (Sat, 27 Dec 2008)
Log Message:
-----------
missing jquery autocomplete js+css
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/src/descriptor/tacos.jquery.xml
tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/components/Dialog.jwc
Modified: tacos-4.1/trunk/tacos-jquery/src/descriptor/tacos.jquery.xml
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/descriptor/tacos.jquery.xml 2008-11-25 05:18:44 UTC (rev 786)
+++ tacos-4.1/trunk/tacos-jquery/src/descriptor/tacos.jquery.xml 2008-12-27 05:12:36 UTC (rev 787)
@@ -13,18 +13,18 @@
<set-service property="assetSource" service-id="tapestry.asset.AssetSource"/>
<!--
This is for serving the jquery file directly from googlecode
- <set property="files" value="http://jqueryjs.googlecode.com/files/jquery-1.2.6.js"/>
- or for the packed version, you can use
+ <set property="files" value="http://jqueryjs.googlecode.com/files/jquery-1.2.6.js"/>
+ or for the packed version, you can use
<set property="files" value="http://jqueryjs.googlecode.com/files/jquery-1.2.6.pack.js"/>
-->
- <set property="files" value="classpath:/tacos-jquery-js/jquery-1.2.6.js,classpath:/tacos-jquery-js/facebox/facebox.js"/>
+ <set property="files" value="classpath:/tacos-jquery-js/jquery-1.2.6.js,classpath:/tacos-jquery-js/facebox/facebox.js,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.js"/>
<set property="formFiles" value=""/>
<set property="widgetFiles" value=""/>
<set property="folder" value=""/>
<set property="tapestryFile" value="classpath:/tacos-jquery-js/tap-jquery1.2.1.js"/>
- <set property="tapestryFolder" value="classpath:/tacos-jquery-js/"/>
-
- <set property="cssFiles" value="classpath:/tacos-jquery-js/facebox/facebox.css"/>
+ <set property="tapestryFolder" value="classpath:/tacos-jquery-js/"/>
+
+ <set property="cssFiles" value="classpath:/tacos-jquery-js/facebox/facebox.css,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.css"/>
</construct>
</invoke-factory>
</service-point>
Modified: tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/components/Dialog.jwc
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/components/Dialog.jwc 2008-11-25 05:18:44 UTC (rev 786)
+++ tacos-4.1/trunk/tacos-jquery/src/java/net/sf/tacos/javascript/jquery/components/Dialog.jwc 2008-12-27 05:12:36 UTC (rev 787)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2004, 2005, 2006 The Apache Software Foundation
+ Copyright 2008 Tacos
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2008-11-25 05:18:48
|
Revision: 786
http://tacos.svn.sourceforge.net/tacos/?rev=786&view=rev
Author: andyhot
Date: 2008-11-25 05:18:44 +0000 (Tue, 25 Nov 2008)
Log Message:
-----------
jquery update
Modified Paths:
--------------
tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
tacos-4.1/trunk/tacos-jquery/src/site/apt/index.apt
Modified: tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2008-11-25 05:17:38 UTC (rev 785)
+++ tacos-4.1/trunk/tacos-jquery/src/js/tacos-jquery-js/tap-jquery1.2.1.js 2008-11-25 05:18:44 UTC (rev 786)
@@ -5,9 +5,10 @@
if (tap_undef("dojo", this)) {
var dojo={
+ byId: function(id) {return jQuery(id);},
require:function(){},
registerModulePath: function() {},
- widget: { byId: function(id) {return jQuery(id);} }
+ widget: { byId: function(id) {return jQuery(id);}, getWidgetById: function(id) {return jQuery(id);} }
};
}
Modified: tacos-4.1/trunk/tacos-jquery/src/site/apt/index.apt
===================================================================
--- tacos-4.1/trunk/tacos-jquery/src/site/apt/index.apt 2008-11-25 05:17:38 UTC (rev 785)
+++ tacos-4.1/trunk/tacos-jquery/src/site/apt/index.apt 2008-11-25 05:18:44 UTC (rev 786)
@@ -1,12 +1,12 @@
------
- Dojo 1.0 and Tapestry
+ jQuery 1.2.6 and Tapestry
------
Andreas Andreou
------
27 Dec 2007
------
-jQuery 1.2.1 and Tapestry
+jQuery 1.2.6 and Tapestry
This module allows you to use jQuery 1.2.6 in Tapestry 4 applications. It requires
Tapestry version 4.1.6 and on, and completely replaces the dojo version
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2008-11-25 05:17:45
|
Revision: 785
http://tacos.svn.sourceforge.net/tacos/?rev=785&view=rev
Author: andyhot
Date: 2008-11-25 05:17:38 +0000 (Tue, 25 Nov 2008)
Log Message:
-----------
define used deps (even though we were getting them as transitive)
Modified Paths:
--------------
tacos-4.1/trunk/pom.xml
tacos-4.1/trunk/tacos-annotations/pom.xml
tacos-4.1/trunk/tacos-core/pom.xml
tacos-4.1/trunk/tacos-dojo/pom.xml
tacos-4.1/trunk/tacos-jquery/pom.xml
Modified: tacos-4.1/trunk/pom.xml
===================================================================
--- tacos-4.1/trunk/pom.xml 2008-11-07 01:18:16 UTC (rev 784)
+++ tacos-4.1/trunk/pom.xml 2008-11-25 05:17:38 UTC (rev 785)
@@ -91,9 +91,9 @@
<dependencyManagement>
<dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
<version>[2.3,3)</version>
<scope>provided</scope>
</dependency>
@@ -118,7 +118,27 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
+ <dependency>
+ <groupId>hivemind</groupId>
+ <artifactId>hivemind</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.7.0</version>
+ </dependency>
+ <dependency>
<groupId>net.sf.scannotation</groupId>
<artifactId>scannotation</artifactId>
<version>1.0.2</version>
@@ -152,6 +172,12 @@
<version>2.3</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ <version>2.3</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-test</artifactId>
@@ -409,11 +435,11 @@
</site>
<repository>
<id>tacos-repo</id>
- <url>scpexe://web.sourceforge.net/home/groups/t/ta/tacos/htdocs/repository</url>
+ <url>scp://web.sourceforge.net/home/groups/t/ta/tacos/htdocs/repository</url>
</repository>
<snapshotRepository>
<id>tacos-snapshot-repo</id>
- <url>scpexe://web.sourceforge.net/home/groups/t/ta/tacos/htdocs/nightly</url>
+ <url>scp://web.sourceforge.net/home/groups/t/ta/tacos/htdocs/nightly</url>
</snapshotRepository>
</distributionManagement>
Modified: tacos-4.1/trunk/tacos-annotations/pom.xml
===================================================================
--- tacos-4.1/trunk/tacos-annotations/pom.xml 2008-11-07 01:18:16 UTC (rev 784)
+++ tacos-4.1/trunk/tacos-annotations/pom.xml 2008-11-25 05:17:38 UTC (rev 785)
@@ -25,11 +25,23 @@
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-framework</artifactId>
- </dependency>
- <dependency>
+ </dependency>
+ <dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-annotations</artifactId>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>hivemind</groupId>
+ <artifactId>hivemind</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
<dependency>
<groupId>net.sf.scannotation</groupId>
<artifactId>scannotation</artifactId>
Modified: tacos-4.1/trunk/tacos-core/pom.xml
===================================================================
--- tacos-4.1/trunk/tacos-core/pom.xml 2008-11-07 01:18:16 UTC (rev 784)
+++ tacos-4.1/trunk/tacos-core/pom.xml 2008-11-25 05:17:38 UTC (rev 785)
@@ -26,12 +26,28 @@
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-contrib</artifactId>
</dependency>
- <dependency>
+ <dependency>
+ <groupId>hivemind</groupId>
+ <artifactId>hivemind</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </dependency>
+ <dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.1</version>
@@ -52,6 +68,14 @@
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-test</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ </dependency>
</dependencies>
<build>
<sourceDirectory>src/java</sourceDirectory>
Modified: tacos-4.1/trunk/tacos-dojo/pom.xml
===================================================================
--- tacos-4.1/trunk/tacos-dojo/pom.xml 2008-11-07 01:18:16 UTC (rev 784)
+++ tacos-4.1/trunk/tacos-dojo/pom.xml 2008-11-25 05:17:38 UTC (rev 785)
@@ -22,6 +22,10 @@
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-framework</artifactId>
</dependency>
+ <dependency>
+ <groupId>hivemind</groupId>
+ <artifactId>hivemind</artifactId>
+ </dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
Modified: tacos-4.1/trunk/tacos-jquery/pom.xml
===================================================================
--- tacos-4.1/trunk/tacos-jquery/pom.xml 2008-11-07 01:18:16 UTC (rev 784)
+++ tacos-4.1/trunk/tacos-jquery/pom.xml 2008-11-25 05:17:38 UTC (rev 785)
@@ -22,6 +22,10 @@
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-framework</artifactId>
</dependency>
+ <dependency>
+ <groupId>hivemind</groupId>
+ <artifactId>hivemind</artifactId>
+ </dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <an...@us...> - 2008-11-07 01:18:26
|
Revision: 784
http://tacos.svn.sourceforge.net/tacos/?rev=784&view=rev
Author: andyhot
Date: 2008-11-07 01:18:16 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
remove cruft
Modified Paths:
--------------
tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script
Modified: tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script
===================================================================
--- tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script 2008-11-07 00:47:19 UTC (rev 783)
+++ tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/HtmlArea.script 2008-11-07 01:18:16 UTC (rev 784)
@@ -19,11 +19,6 @@
var editor=dojo.widget.byId("${id}");
dojo.event.connectOnce(editor, "onDisplayChanged", function(){document.htmlUpdate(editor);});
dojo.event.connectOnce(editor.domNode, "onclick", function(){editor.focus();});
- dojo.event.connectOnce(editor, "editorOnLoad", function() { try{
- var rr = editor.domNode.getElementsByTagName('div')[1];
- dojo.html.setStyle(rr, "min-height", parseInt(dojo.html.getStyle(rr.parentNode, "height")) + "px");
- } catch(e){}
- } )
})();
</initialization>
</script>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|