http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96822

Revision: 96822
Author:   jeroendedauw
Date:     2011-09-12 00:12:10 +0000 (Mon, 12 Sep 2011)
Log Message:
-----------
split up js file

Modified Paths:
--------------
    trunk/extensions/Survey/Survey.php
    trunk/extensions/Survey/resources/ext.survey.special.survey.js

Added Paths:
-----------
    trunk/extensions/Survey/resources/ext.survey.answerSelector.js

Modified: trunk/extensions/Survey/Survey.php
===================================================================
--- trunk/extensions/Survey/Survey.php  2011-09-12 00:09:48 UTC (rev 96821)
+++ trunk/extensions/Survey/Survey.php  2011-09-12 00:12:10 UTC (rev 96822)
@@ -133,6 +133,7 @@
 
 $wgResourceModules['ext.survey.special.survey'] = $moduleTemplate + array(
        'scripts' => array(
+               'ext.survey.answerSelector.js',
                'ext.survey.special.survey.js'
        ),
        'styles' => array(

Added: trunk/extensions/Survey/resources/ext.survey.answerSelector.js
===================================================================
--- trunk/extensions/Survey/resources/ext.survey.answerSelector.js              
                (rev 0)
+++ trunk/extensions/Survey/resources/ext.survey.answerSelector.js      
2011-09-12 00:12:10 UTC (rev 96822)
@@ -0,0 +1,55 @@
+/**
+ * JavasSript for the Survey MediaWiki extension.
+ * @see https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Extension:Survey
+ * 
+ * @licence GNU GPL v3 or later
+ * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
+ */
+
+(function( $, mw, survey ) {
+       
+       survey.answerSelector = function( options ) {
+               var _this = this;
+               
+               var defaults = {
+                       'visible': true,
+                       'answers': []
+               };
+               
+               options = $.extend( defaults, options );
+               
+               this.$div = $( '<div />' ).html( '' );
+               
+               this.$div.append( $( '<p />' ).text( mw.msg( 
'survey-special-label-answers' ) ) );
+
+               this.$div.append( $( '<textarea />' ).attr( options.attr ).val( 
options.answers.join( '\n' ) ) );
+               
+               this.setVisible( options.visible );
+       };
+
+       survey.answerSelector.prototype = {
+               
+               getHtml: function() {
+                       return this.$div;
+               },
+                       
+               show: function() {
+                       this.$div.show();
+               },
+               
+               hide: function() {
+                       this.$div.hide();
+               },
+               
+               setVisible: function( visible ) {
+                       if ( visible ) {
+                               this.show();
+                       }
+                       else {
+                               this.hide();
+                       }
+               }
+                       
+       };
+       
+} )( jQuery, window.mediaWiki, window.survey );


Property changes on: 
trunk/extensions/Survey/resources/ext.survey.answerSelector.js
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/extensions/Survey/resources/ext.survey.special.survey.js
===================================================================
--- trunk/extensions/Survey/resources/ext.survey.special.survey.js      
2011-09-12 00:09:48 UTC (rev 96821)
+++ trunk/extensions/Survey/resources/ext.survey.special.survey.js      
2011-09-12 00:12:10 UTC (rev 96822)
@@ -6,54 +6,6 @@
  * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
  */
 
-(function( $, mw, survey ) {
-       
-       survey.answerSelector = function( options ) {
-               var _this = this;
-               
-               var defaults = {
-                       'visible': true,
-                       'answers': []
-               };
-               
-               options = $.extend( defaults, options );
-               
-               this.$div = $( '<div />' ).html( '' );
-               
-               this.$div.append( $( '<p />' ).text( mw.msg( 
'survey-special-label-answers' ) ) );
-
-               this.$div.append( $( '<textarea />' ).attr( options.attr ).val( 
options.answers.join( '\n' ) ) );
-               
-               this.setVisible( options.visible );
-       };
-
-       survey.answerSelector.prototype = {
-               
-               getHtml: function() {
-                       return this.$div;
-               },
-                       
-               show: function() {
-                       this.$div.show();
-               },
-               
-               hide: function() {
-                       this.$div.hide();
-               },
-               
-               setVisible: function( visible ) {
-                       if ( visible ) {
-                               this.show();
-                       }
-                       else {
-                               this.hide();
-                       }
-               }
-                       
-       };
-       
-} )( jQuery, window.mediaWiki, window.survey );
-
 (function( $, mw, survey ) { $( document ).ready( function() {
 
        var _this = this;


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

Reply via email to