Author: pyaschenko
Date: 2010-07-06 06:01:07 -0400 (Tue, 06 Jul 2010)
New Revision: 17732
Added:
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-selection.js
Removed:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/script/richfaces-selection.js
Modified:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/script/1.html
Log:
move richfaces-selection.js to impl
Copied: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-selection.js
(from rev 17731,
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/script/richfaces-selection.js)
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-selection.js
(rev 0)
+++
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-selection.js 2010-07-06
10:01:07 UTC (rev 17732)
@@ -0,0 +1,45 @@
+(function (richfaces) {
+
+ richfaces.Selection = richfaces.Selection || {};
+
+ richfaces.Selection.set = function (field, start, end) {
+ if(field.setSelectionRange) {
+ field.focus();
+ field.setSelectionRange(start, end);
+ } else if (field.createTextRange){
+ var range = field.createTextRange();
+ range.collapse(true);
+ range.moveEnd('character', end);
+ range.moveStart('character', start);
+ range.select();
+ }
+ }
+
+ richfaces.Selection.getStart = function(field)
+ {
+ if (field.setSelectionRange) {
+ return field.selectionStart;
+ } else if (document.selection && document.selection.createRange) {
+ var r = document.selection.createRange().duplicate();
+ r.moveEnd('character', field.value.length);
+ if (r.text == '') return field.value.length;
+ return field.value.lastIndexOf(r.text);
+ }
+ }
+
+ richfaces.Selection.getEnd = function(field)
+ {
+ if (field.setSelectionRange) {
+ return field.selectionEnd;
+ } else if (document.selection && document.selection.createRange) {
+ var r = document.selection.createRange().duplicate();
+ r.moveStart('character', -field.value.length);
+ return r.text.length;
+ }
+ }
+
+ richfaces.Selection.setCaretTo = function (field, pos)
+ {
+ richfaces.Selection.set(field, pos, pos);
+ }
+})(window.RichFaces || (window.RichFaces={}));
\ No newline at end of file
Modified:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/script/1.html
===================================================================
---
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/script/1.html 2010-07-06
05:25:33 UTC (rev 17731)
+++
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/script/1.html 2010-07-06
10:01:07 UTC (rev 17732)
@@ -9,7 +9,7 @@
<script type="text/javascript"
src="..\..\..\..\..\..\..\..\..\..\core\trunk\impl\src\main\resources\META-INF\resources\richfaces.js
"></script>
<script type="text/javascript"
src="..\..\..\..\..\..\..\..\..\..\core\trunk\impl\src\main\resources\META-INF\resources\richfaces-event.js
"></script>
<script type="text/javascript"
src="..\..\..\..\..\..\..\..\..\..\core\trunk\impl\src\main\resources\META-INF\resources\richfaces-base-component.js
"></script>
- <script type="text/javascript"
src="richfaces-selection.js"></script>
+ <script type="text/javascript"
src="..\..\..\..\..\..\..\..\..\..\core\trunk\impl\src\main\resources\META-INF\resources\richfaces-selection.js"></script>
<script type="text/javascript"
src="SelectBase.js"></script>
<script type="text/javascript"
src="ComboBox.js"></script>
<style>
Deleted:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/script/richfaces-selection.js
===================================================================
---
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/script/richfaces-selection.js 2010-07-06
05:25:33 UTC (rev 17731)
+++
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/script/richfaces-selection.js 2010-07-06
10:01:07 UTC (rev 17732)
@@ -1,45 +0,0 @@
-(function (richfaces) {
-
- richfaces.Selection = richfaces.Selection || {};
-
- richfaces.Selection.set = function (field, start, end) {
- if(field.setSelectionRange) {
- field.focus();
- field.setSelectionRange(start, end);
- } else if (field.createTextRange){
- var range = field.createTextRange();
- range.collapse(true);
- range.moveEnd('character', end);
- range.moveStart('character', start);
- range.select();
- }
- }
-
- richfaces.Selection.getStart = function(field)
- {
- if (field.setSelectionRange) {
- return field.selectionStart;
- } else if (document.selection && document.selection.createRange) {
- var r = document.selection.createRange().duplicate();
- r.moveEnd('character', field.value.length);
- if (r.text == '') return field.value.length;
- return field.value.lastIndexOf(r.text);
- }
- }
-
- richfaces.Selection.getEnd = function(field)
- {
- if (field.setSelectionRange) {
- return field.selectionEnd;
- } else if (document.selection && document.selection.createRange) {
- var r = document.selection.createRange().duplicate();
- r.moveStart('character', -field.value.length);
- return r.text.length;
- }
- }
-
- richfaces.Selection.setCaretTo = function (field, pos)
- {
- richfaces.Selection.set(field, pos, pos);
- }
-})(window.RichFaces || (window.RichFaces={}));
\ No newline at end of file