https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112226

Revision: 112226
Author:   ialex
Date:     2012-02-23 19:11:34 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
svn:eol-style native

Modified Paths:
--------------
    trunk/extensions/ArticleFeedbackv5/bin/find_needed_i18n_keys.php
    trunk/extensions/VisualEditor/playground/index.html
    trunk/extensions/VisualEditor/playground/playground.js

Property Changed:
----------------
    trunk/extensions/ArticleFeedbackv5/bin/find_needed_i18n_keys.php
    trunk/extensions/EducationProgram/actions/DeleteCourseAction.php
    trunk/extensions/EducationProgram/actions/DeleteOrgAction.php
    trunk/extensions/EducationProgram/actions/EPAddArticleAction.php
    trunk/extensions/EducationProgram/actions/EPAddReviewerAction.php
    trunk/extensions/EducationProgram/actions/EPDeleteAction.php
    trunk/extensions/EducationProgram/actions/EPRemoveArticleAction.php
    trunk/extensions/EducationProgram/actions/EPRemoveReviewerAction.php
    trunk/extensions/EducationProgram/actions/EPRemoveStudentAction.php
    trunk/extensions/EducationProgram/maintenance/data.csv
    trunk/extensions/MobileFrontend/tests/js/fixtures.js
    trunk/extensions/MobileFrontend/tests/js/test_application.js
    trunk/extensions/MobileFrontend/tests/js/test_beta_opensearch.js
    trunk/extensions/MobileFrontend/tests/js/test_opensearch.js
    trunk/extensions/OpenID/php-openid-mw-extension-openid.tar.gz.sha1
    trunk/extensions/VisualEditor/playground/index.html
    trunk/extensions/VisualEditor/playground/playground.js
    trunk/extensions/VisualEditor/tests/parser/Makefile
    trunk/extensions/VisualEditor/tests/parser/__patched-html5-parser.coffee
    trunk/extensions/VisualEditor/tests/parser/__patched-html5-parser.js
    trunk/extensions/examples/HelloWorld/INSTALL

Modified: trunk/extensions/ArticleFeedbackv5/bin/find_needed_i18n_keys.php
===================================================================
--- trunk/extensions/ArticleFeedbackv5/bin/find_needed_i18n_keys.php    
2012-02-23 18:06:23 UTC (rev 112225)
+++ trunk/extensions/ArticleFeedbackv5/bin/find_needed_i18n_keys.php    
2012-02-23 19:11:34 UTC (rev 112226)
@@ -1,18 +1,18 @@
-<?php
-/**
- * Stupidly simple helper script will read in all en entries
- * from i18n file and array diff it against the entries in qqq
- *
- * Then it will take those key names and echo them to stdout 1 by 1
- */
-
-include dirname(__FILE__) . '/../ArticleFeedbackv5.i18n.php';
-
-$en_keys = array_keys($messages['en']);
-$qqq_keys = array_keys($messages['qqq']);
-
-$needed_keys = array_diff($en_keys, $qqq_keys);
-
-foreach($needed_keys as $name) {
-    echo "$name\n";
+<?php
+/**
+ * Stupidly simple helper script will read in all en entries
+ * from i18n file and array diff it against the entries in qqq
+ *
+ * Then it will take those key names and echo them to stdout 1 by 1
+ */
+
+include dirname(__FILE__) . '/../ArticleFeedbackv5.i18n.php';
+
+$en_keys = array_keys($messages['en']);
+$qqq_keys = array_keys($messages['qqq']);
+
+$needed_keys = array_diff($en_keys, $qqq_keys);
+
+foreach($needed_keys as $name) {
+    echo "$name\n";
 }
\ No newline at end of file


Property changes on: 
trunk/extensions/ArticleFeedbackv5/bin/find_needed_i18n_keys.php
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/EducationProgram/actions/DeleteCourseAction.php
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/EducationProgram/actions/DeleteOrgAction.php
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/EducationProgram/actions/EPAddArticleAction.php
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/EducationProgram/actions/EPAddReviewerAction.php
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/EducationProgram/actions/EPDeleteAction.php
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/EducationProgram/actions/EPRemoveArticleAction.php
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/EducationProgram/actions/EPRemoveReviewerAction.php
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/EducationProgram/actions/EPRemoveStudentAction.php
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: trunk/extensions/EducationProgram/maintenance/data.csv
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: trunk/extensions/MobileFrontend/tests/js/fixtures.js
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/MobileFrontend/tests/js/test_application.js
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/MobileFrontend/tests/js/test_beta_opensearch.js
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: trunk/extensions/MobileFrontend/tests/js/test_opensearch.js
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/OpenID/php-openid-mw-extension-openid.tar.gz.sha1
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/extensions/VisualEditor/playground/index.html
===================================================================
--- trunk/extensions/VisualEditor/playground/index.html 2012-02-23 18:06:23 UTC 
(rev 112225)
+++ trunk/extensions/VisualEditor/playground/index.html 2012-02-23 19:11:34 UTC 
(rev 112226)
@@ -1,21 +1,21 @@
-<!DOCTYPE html>
-
-<html>
-    <head>
-        <title>Playground</title>
-        <style>
-        #editor {
-            width: 300px;
-            height: 300px;
-            border: solid 1px;
-        }
-        </style>
-        <script src="../modules/jquery/jquery.js"></script>
-        <script src="../modules/rangy/rangy-core.js"></script>
-        <script src="playground.js"></script>
-    </head>
-    <body>
-        <div contenteditable="true" id="editor">
-        </div>
-    </body>
-</html>
+<!DOCTYPE html>
+
+<html>
+    <head>
+        <title>Playground</title>
+        <style>
+        #editor {
+            width: 300px;
+            height: 300px;
+            border: solid 1px;
+        }
+        </style>
+        <script src="../modules/jquery/jquery.js"></script>
+        <script src="../modules/rangy/rangy-core.js"></script>
+        <script src="playground.js"></script>
+    </head>
+    <body>
+        <div contenteditable="true" id="editor">
+        </div>
+    </body>
+</html>


Property changes on: trunk/extensions/VisualEditor/playground/index.html
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/extensions/VisualEditor/playground/playground.js
===================================================================
--- trunk/extensions/VisualEditor/playground/playground.js      2012-02-23 
18:06:23 UTC (rev 112225)
+++ trunk/extensions/VisualEditor/playground/playground.js      2012-02-23 
19:11:34 UTC (rev 112226)
@@ -1,200 +1,200 @@
-app = function () {
-       var     _this = this,
-               $document = $( document );
-
-       this.$editor = $('#editor');
-
-       this.$editor.bind( {
-               'focus': function( e ) {
-                       $document.unbind( '.surfaceView' );
-                       $document.bind( {
-                               'keydown.surfaceView': function( e ) {
-                                       return _this.onKeyDown( e );
-                               },
-                               'keyup.surfaceView': function( e ) {
-                                       return _this.onKeyUp( e );
-                               },
-                               'keypress.surfaceView': function( e ) {
-                                       return _this.onKeyPress( e );
-                               }
-                       } );
-               },
-               'blur': function( e ) {
-                       $document.unbind( '.surfaceView' );
-               }
-       } );
-
-       this.$editor.mousedown( function(e) {
-               return _this.onMouseDown( e );
-       } );
-
-       // Set initial content for the "editor"
-       this.$editor.html("<b>Lorem Ipsum is simply dummy text</b> of the 
printing and typesetting industry. <b>Lorem Ipsum has been the 
<i>industry's</i> standard</b> dummy text ever since the 1500s, when an unknown 
printer took a galley of type and scrambled it <u>to <b>make <i>a type</i> 
specimen</b> book.</u>");
-       this.$editor.addClass('leafNode');
-
-       this.keypress = false;
-       this.keyup = false;
-       this.keydown = false;
-       this.mousedown = false;
-       this.inime = false;
-       this.prevText = app.getDOMText(this.$editor[0]);
-       
-       setInterval(function() {
-               _this.loopFunc();
-       }, 100);
-};
-
-app.prototype.onKeyPress = function() {
-       //console.log("onKeyPress");
-       this.keypress = true;
-       if ( e.which === 229 ) {
-               this.inime = true;
-       }       
-};
-
-app.prototype.onKeyUp = function() {
-       //console.log("onKeyUp");
-       this.keyup = true;
-       if ( this.inime ) {
-               this.inime = false;
-       }
-};
-
-app.prototype.onKeyDown = function( e ) {
-       //console.log("onKeyDown");
-       this.keydown = true;
-       if ( e.which === 229 ) {
-               this.inime = true;
-       }
-};
-
-app.prototype.onMouseDown = function() {
-       this.mousedown = true;
-
-       if ( this.inime ) {
-               this.inime = false;
-       }
-};
-
-app.prototype.loopFunc = function() {
-       var text = app.getDOMText(this.$editor[0]);
-
-       if(text != this.prevText) {
-
-               var selection = rangy.getSelection();
-
-
-
-               // keyup in IE
-               // keypress and keydown in FF and Chrome
-               if ( (($.browser.msie && !this.keyup) || (!$.browser.msie && 
!this.keypress && !this.mousedown)) && !this.inime ) {
-                       console.log(this.inime);
-                       console.log('SPELLCHECK');
-                       this.prevText = text;
-                       this.keypress = false;
-                       this.keyup = false;
-                       this.mousedown = false;
-                       return;
-               }
-
-               console.log("keyboard");
-               // we are going to need a cursor position
-               var offset = this.getOffset( selection.anchorNode, 
selection.anchorOffset );
-               var diffLength = text.length - this.prevText.length;
-               //console.log("diffLength: " + diffLength);
-               
-               if ( diffLength > 0 ) {
-                       //console.log( text.substring(offset - diffLength, 
offset) );   
-               } else if ( diffLength === 0 ) {
-                       //console.log( text.substring(offset - 1, offset) );
-               }
-
-               
-               this.prevText = text;
-       }
-       this.keypress = false;
-       this.keyup = false;
-       this.keydown = false;
-       this.mousedown = false;
-};
-
-app.getDOMText = function( elem ) {
-    var nodeType = elem.nodeType,
-        ret = '';
-
-    if ( nodeType === 1 || nodeType === 9 ) {
-        // Use textContent || innerText for elements
-        if ( typeof elem.textContent === 'string' ) {
-            return elem.textContent;
-        } else if ( typeof elem.innerText === 'string' ) {
-            // Replace IE's carriage returns
-            return elem.innerText.replace( /\r\n/g, '' );
-        } else {
-            // Traverse it's children
-            for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
-                ret += app.getDOMText( elem );
-            }
-        }
-    } else if ( nodeType === 3 || nodeType === 4 ) {
-        return elem.nodeValue;
-    }
-
-    return ret; 
-};
-
-app.prototype.getOffset = function( localNode, localOffset ) {
-       var $node = $( localNode );
-
-       if ( $node.hasClass( 'leafNode' ) ) {
-               return localOffset;
-       }
-       
-       while( !$node.hasClass( 'leafNode' ) ) {
-               $node = $node.parent();
-       }
-       
-       var current = [$node.contents(), 0];
-       var stack = [current];
-       
-       var offset = 0;
-       
-       while ( stack.length > 0 ) {
-               if ( current[1] >= current[0].length ) {
-                       stack.pop();
-                       current = stack[ stack.length - 1 ];
-                       continue;
-               }
-               var item = current[0][current[1]];
-               var $item = current[0].eq( current[1] );
-               
-               if ( item.nodeType === 3 ) {
-                       if ( item === localNode ) {
-                               offset += localOffset;
-                               break;
-                       } else {
-                               offset += item.textContent.length;
-                       }
-               } else if ( item.nodeType === 1 ) {
-                       if ( $( item ).attr('contentEditable') === "false" ) {
-                               offset += 1;
-                       } else {
-                               if ( item === localNode ) {
-                                       offset += localOffset;
-                                       break;
-                               }
-                       
-                               stack.push( [$item.contents(), 0] );
-                               current[1]++;
-                               current = stack[stack.length-1];
-                               continue;
-                       }
-               }
-               current[1]++;
-       }
-
-       return offset;
-};
-
-$(function() {
-       new app();
+app = function () {
+       var     _this = this,
+               $document = $( document );
+
+       this.$editor = $('#editor');
+
+       this.$editor.bind( {
+               'focus': function( e ) {
+                       $document.unbind( '.surfaceView' );
+                       $document.bind( {
+                               'keydown.surfaceView': function( e ) {
+                                       return _this.onKeyDown( e );
+                               },
+                               'keyup.surfaceView': function( e ) {
+                                       return _this.onKeyUp( e );
+                               },
+                               'keypress.surfaceView': function( e ) {
+                                       return _this.onKeyPress( e );
+                               }
+                       } );
+               },
+               'blur': function( e ) {
+                       $document.unbind( '.surfaceView' );
+               }
+       } );
+
+       this.$editor.mousedown( function(e) {
+               return _this.onMouseDown( e );
+       } );
+
+       // Set initial content for the "editor"
+       this.$editor.html("<b>Lorem Ipsum is simply dummy text</b> of the 
printing and typesetting industry. <b>Lorem Ipsum has been the 
<i>industry's</i> standard</b> dummy text ever since the 1500s, when an unknown 
printer took a galley of type and scrambled it <u>to <b>make <i>a type</i> 
specimen</b> book.</u>");
+       this.$editor.addClass('leafNode');
+
+       this.keypress = false;
+       this.keyup = false;
+       this.keydown = false;
+       this.mousedown = false;
+       this.inime = false;
+       this.prevText = app.getDOMText(this.$editor[0]);
+       
+       setInterval(function() {
+               _this.loopFunc();
+       }, 100);
+};
+
+app.prototype.onKeyPress = function() {
+       //console.log("onKeyPress");
+       this.keypress = true;
+       if ( e.which === 229 ) {
+               this.inime = true;
+       }       
+};
+
+app.prototype.onKeyUp = function() {
+       //console.log("onKeyUp");
+       this.keyup = true;
+       if ( this.inime ) {
+               this.inime = false;
+       }
+};
+
+app.prototype.onKeyDown = function( e ) {
+       //console.log("onKeyDown");
+       this.keydown = true;
+       if ( e.which === 229 ) {
+               this.inime = true;
+       }
+};
+
+app.prototype.onMouseDown = function() {
+       this.mousedown = true;
+
+       if ( this.inime ) {
+               this.inime = false;
+       }
+};
+
+app.prototype.loopFunc = function() {
+       var text = app.getDOMText(this.$editor[0]);
+
+       if(text != this.prevText) {
+
+               var selection = rangy.getSelection();
+
+
+
+               // keyup in IE
+               // keypress and keydown in FF and Chrome
+               if ( (($.browser.msie && !this.keyup) || (!$.browser.msie && 
!this.keypress && !this.mousedown)) && !this.inime ) {
+                       console.log(this.inime);
+                       console.log('SPELLCHECK');
+                       this.prevText = text;
+                       this.keypress = false;
+                       this.keyup = false;
+                       this.mousedown = false;
+                       return;
+               }
+
+               console.log("keyboard");
+               // we are going to need a cursor position
+               var offset = this.getOffset( selection.anchorNode, 
selection.anchorOffset );
+               var diffLength = text.length - this.prevText.length;
+               //console.log("diffLength: " + diffLength);
+               
+               if ( diffLength > 0 ) {
+                       //console.log( text.substring(offset - diffLength, 
offset) );   
+               } else if ( diffLength === 0 ) {
+                       //console.log( text.substring(offset - 1, offset) );
+               }
+
+               
+               this.prevText = text;
+       }
+       this.keypress = false;
+       this.keyup = false;
+       this.keydown = false;
+       this.mousedown = false;
+};
+
+app.getDOMText = function( elem ) {
+    var nodeType = elem.nodeType,
+        ret = '';
+
+    if ( nodeType === 1 || nodeType === 9 ) {
+        // Use textContent || innerText for elements
+        if ( typeof elem.textContent === 'string' ) {
+            return elem.textContent;
+        } else if ( typeof elem.innerText === 'string' ) {
+            // Replace IE's carriage returns
+            return elem.innerText.replace( /\r\n/g, '' );
+        } else {
+            // Traverse it's children
+            for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
+                ret += app.getDOMText( elem );
+            }
+        }
+    } else if ( nodeType === 3 || nodeType === 4 ) {
+        return elem.nodeValue;
+    }
+
+    return ret; 
+};
+
+app.prototype.getOffset = function( localNode, localOffset ) {
+       var $node = $( localNode );
+
+       if ( $node.hasClass( 'leafNode' ) ) {
+               return localOffset;
+       }
+       
+       while( !$node.hasClass( 'leafNode' ) ) {
+               $node = $node.parent();
+       }
+       
+       var current = [$node.contents(), 0];
+       var stack = [current];
+       
+       var offset = 0;
+       
+       while ( stack.length > 0 ) {
+               if ( current[1] >= current[0].length ) {
+                       stack.pop();
+                       current = stack[ stack.length - 1 ];
+                       continue;
+               }
+               var item = current[0][current[1]];
+               var $item = current[0].eq( current[1] );
+               
+               if ( item.nodeType === 3 ) {
+                       if ( item === localNode ) {
+                               offset += localOffset;
+                               break;
+                       } else {
+                               offset += item.textContent.length;
+                       }
+               } else if ( item.nodeType === 1 ) {
+                       if ( $( item ).attr('contentEditable') === "false" ) {
+                               offset += 1;
+                       } else {
+                               if ( item === localNode ) {
+                                       offset += localOffset;
+                                       break;
+                               }
+                       
+                               stack.push( [$item.contents(), 0] );
+                               current[1]++;
+                               current = stack[stack.length-1];
+                               continue;
+                       }
+               }
+               current[1]++;
+       }
+
+       return offset;
+};
+
+$(function() {
+       new app();
 });
\ No newline at end of file


Property changes on: trunk/extensions/VisualEditor/playground/playground.js
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: trunk/extensions/VisualEditor/tests/parser/Makefile
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/VisualEditor/tests/parser/__patched-html5-parser.coffee
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: 
trunk/extensions/VisualEditor/tests/parser/__patched-html5-parser.js
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: trunk/extensions/examples/HelloWorld/INSTALL
___________________________________________________________________
Added: svn:eol-style
   + native


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to