summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/prado
diff options
context:
space:
mode:
authorwei <>2006-02-01 07:08:55 +0000
committerwei <>2006-02-01 07:08:55 +0000
commit6f692501612bd24212f625c94427dfc5dcf17af8 (patch)
tree81c8cc22c63028a4d342ee37be19362c438d7522 /framework/Web/Javascripts/prado
parent5682cc56a4c703408dd927bda629ab36824dae09 (diff)
Update js library.
Diffstat (limited to 'framework/Web/Javascripts/prado')
-rw-r--r--framework/Web/Javascripts/prado/controls.js46
-rw-r--r--framework/Web/Javascripts/prado/effects.js22
-rw-r--r--framework/Web/Javascripts/prado/validators.js3
3 files changed, 45 insertions, 26 deletions
diff --git a/framework/Web/Javascripts/prado/controls.js b/framework/Web/Javascripts/prado/controls.js
index becff686..370741d4 100644
--- a/framework/Web/Javascripts/prado/controls.js
+++ b/framework/Web/Javascripts/prado/controls.js
@@ -103,4 +103,48 @@ Object.extend(Prado.WebUI.DefaultButton.prototype,
}
}
}
-}); \ No newline at end of file
+});
+
+Prado.WebUI.TTextHighlighter=Class.create();
+Prado.WebUI.TTextHighlighter.prototype={initialize:function(id)
+{
+ if(!window.clipboardData) return;
+ var options =
+ {
+ href : 'javascript:;//copy code to clipboard',
+ onclick : 'Prado.WebUI.TTextHighlighter.copy(this)',
+ onmouseover : 'Prado.WebUI.TTextHighlighter.hover(this)',
+ onmouseout : 'Prado.WebUI.TTextHighlighter.out(this)'
+ }
+ var div = DIV({className:'copycode'}, A(options, 'Copy Code'));
+ document.write(DIV(null,div).innerHTML);
+}};
+
+Object.extend(Prado.WebUI.TTextHighlighter,
+{
+ copy : function(obj)
+ {
+ var parent = obj.parentNode.parentNode.parentNode;
+ var text = '';
+ for(var i = 0; i < parent.childNodes.length; i++)
+ {
+ var node = parent.childNodes[i];
+ if(node.innerText)
+ text += node.innerText == 'Copy Code' ? '' : node.innerText;
+ else
+ text += node.nodeValue;
+ }
+ if(text.length > 0)
+ window.clipboardData.setData("Text", text);
+ },
+
+ hover : function(obj)
+ {
+ obj.parentNode.className = "copycode copycode_hover";
+ },
+
+ out : function(obj)
+ {
+ obj.parentNode.className = "copycode";
+ }
+});
diff --git a/framework/Web/Javascripts/prado/effects.js b/framework/Web/Javascripts/prado/effects.js
deleted file mode 100644
index cc31d00e..00000000
--- a/framework/Web/Javascripts/prado/effects.js
+++ /dev/null
@@ -1,22 +0,0 @@
-Prado.Effect =
-{
- Highlight : function(element, duration)
- {
- new Effect.Highlight(element, {'duration':duration});
- },
-
- Scale : function(element, percent)
- {
- new Effect.Scale(element, percent);
- },
-
- MoveBy : function(element, toTop, toLeft)
- {
- new Effect.MoveBy(element, toTop, toLeft);
- },
-
- ScrollTo : function(element, duration)
- {
- new Effect.ScrollTo(element, {'duration':duration});
- }
-} \ No newline at end of file
diff --git a/framework/Web/Javascripts/prado/validators.js b/framework/Web/Javascripts/prado/validators.js
index e1860563..d1c45f32 100644
--- a/framework/Web/Javascripts/prado/validators.js
+++ b/framework/Web/Javascripts/prado/validators.js
@@ -132,9 +132,6 @@ Prado.Validation.TRequiredListValidator = function()
var elements = document.getElementsByName(this.attr.selector);
if(elements.length <= 0)
- elements = document.getElementsBySelector(this.attr.selector);
-
- if(elements.length <= 0)
return true;
var required = new Array();