2014-03-12 14:52:47 +01:00
/ *
Jappix - An open social platform
These are the tooltip JS scripts for Jappix
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
License : AGPL
Author : Valérian Saliou
* /
// Bundle
var Tooltip = ( function ( ) {
/ * *
* Alias of this
* @ private
* /
var self = { } ;
2014-04-08 20:14:28 +02:00
/ * *
2014-03-12 14:52:47 +01:00
* Creates a tooltip code
* @ public
* @ param { string } xid
* @ param { string } hash
* @ param { string } type
* @ return { boolean }
* /
self . create = function ( xid , hash , type ) {
try {
// Path to the element
var path = '#' + hash ;
var path _tooltip = path + ' .chat-tools-' + type ;
var path _bubble = path _tooltip + ' .bubble-' + type ;
// Yet exists?
2014-11-25 20:12:58 +01:00
if ( Common . exists ( path _bubble ) ) {
2014-03-12 14:52:47 +01:00
return false ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
// Generates special tooltip HTML code
var title = '' ;
var content = '' ;
switch ( type ) {
// Smileys
case 'smileys' :
title = Common . _e ( "Smiley insertion" ) ;
content = Smileys . links ( hash ) ;
break ;
// Style
case 'style' :
title = Common . _e ( "Change style" ) ;
// Generate fonts list
var fonts = {
'arial' : 'Arial, Helvetica, sans-serif' ,
'arial-black' : '\'Arial Black\', Gadget, sans-serif' ,
'bookman-old-style' : '\'Bookman Old Style\', serif' ,
'comic-sans-ms' : '\'Comic Sans MS\', cursive' ,
'courier' : 'Courier, monospace' ,
'courier-new' : '\'Courier New\', Courier, monospace' ,
'garamond' : 'Garamond, serif' ,
'georgia' : 'Georgia, serif' ,
'impact' : 'Impact, Charcoal, sans-serif' ,
'lucida-console' : '\'Lucida Console\', Monaco, monospace' ,
'lucida-sans-unicode' : '\'Lucida Sans Unicode\', \'Lucida Grande\', sans-serif' ,
'ms-sans-serif' : '\'MS Sans Serif\', Geneva, sans-serif' ,
'ms-serif' : '\'MS Serif\', \'New York\', sans-serif' ,
'palatino-linotype' : '\'Palatino Linotype\', \'Book Antiqua\', Palatino, serif' ,
'symbol' : 'Symbol, sans-serif' ,
'tahoma' : 'Tahoma, Geneva, sans-serif' ,
'times-new-roman' : '\'Times New Roman\', Times, serif' ,
'trebuchet-ms' : '\'Trebuchet MS\', Helvetica, sans-serif' ,
'verdana' : 'Verdana, Geneva, sans-serif' ,
'webdings' : 'Webdings, sans-serif' ,
'wingdings' : 'Wingdings, \'Zapf Dingbats\', sans-serif'
} ;
var fonts _html = '<div class="font-list">' ;
// No fonts
fonts _html += '<a href="#">' + Common . _e ( "None" ) + '</a>' ;
// Available fonts
$ . each ( fonts , function ( id _name , full _name ) {
// Generate short name
var short _name = full _name ;
if ( short _name . match ( /,/ ) ) {
var name _split = short _name . split ( ',' ) ;
short _name = $ . trim ( name _split [ 0 ] ) ;
}
short _name = short _name . replace ( /([^a-z0-9\s]+)/gi , '' ) ;
// Add this to the HTML
fonts _html += '<a href="#" data-value="' + Common . encodeQuotes ( id _name ) + '" data-font="' + Common . encodeQuotes ( full _name ) + '" style="font-family: ' + Common . encodeQuotes ( full _name ) + ';">' + short _name . htmlEnc ( ) + '</a>' ;
} ) ;
fonts _html += '</div>' ;
content =
'<label class="font">' +
'<div class="font-icon talk-images"></div>' +
'<div class="fontsize-change">' +
'<a class="fontsize-current" href="#">12</a>' +
'<div class="fontsize-list">' +
'<a href="#" class="reset talk-images"></a>' +
'<a href="#" data-value="10" style="font-size: 10px;">10</a>' +
'<a href="#" data-value="12" style="font-size: 12px;">12</a>' +
'<a href="#" data-value="14" style="font-size: 14px;">14</a>' +
'<a href="#" data-value="16" style="font-size: 16px;">16</a>' +
'<a href="#" data-value="18" style="font-size: 18px;">18</a>' +
'</div>' +
'</div>' +
'<div class="font-change">' +
'<a class="font-current" href="#">' + Common . _e ( "None" ) + '</a>' +
fonts _html +
'</div>' +
'</label>' +
'<label class="bold"><input type="checkbox" class="bold" />' + Common . _e ( "Text in bold" ) + '</label>' +
'<label class="italic"><input type="checkbox" class="italic" />' + Common . _e ( "Text in italic" ) + '</label>' +
'<label class="underline"><input type="checkbox" class="underline" />' + Common . _e ( "Underlined text" ) + '</label>' +
'<a href="#" class="color" style="background-color: #b10808; clear: both;" data-color="b10808"></a>' +
'<a href="#" class="color" style="background-color: #e5860c;" data-color="e5860c"></a>' +
'<a href="#" class="color" style="background-color: #f0f30e;" data-color="f0f30e"></a>' +
'<a href="#" class="color" style="background-color: #009a04;" data-color="009a04"></a>' +
'<a href="#" class="color" style="background-color: #0ba9a0;" data-color="0ba9a0"></a>' +
'<a href="#" class="color" style="background-color: #04228f;" data-color="04228f"></a>' +
'<a href="#" class="color" style="background-color: #9d0ab7;" data-color="9d0ab7"></a>' +
'<div class="color-picker">' +
'<a href="#" class="color-more talk-images"></a>' +
'<div class="color-hex">' +
'<span class="hex-begin">#</span>' +
'<input class="hex-value" type="text" maxlength="6" placeholder="e1e1e1" />' +
'</div>' +
'</div>' ;
break ;
// File send
case 'file' :
title = Common . _e ( "Send a file" ) ;
content = '<p style="margin-bottom: 8px;">' + Common . _e ( "Once uploaded, your friend will be prompted to download the file you sent." ) + '</p>' ;
content += '<form id="oob-upload" action="./server/send.php" method="post" enctype="multipart/form-data">' + Interface . generateFileShare ( ) + '</form>' ;
break ;
// Chat log
case 'save' :
title = Common . _e ( "Save chat" ) ;
content = '<p style="margin-bottom: 8px;">' + Common . _e ( "Click on the following link to get the chat log, and wait. Then click again to get the file." ) + '</p>' ;
// Possible to generate any log?
if ( $ ( path + ' .one-line' ) . size ( ) )
content += '<a href="#" class="tooltip-actionlog">' + Common . _e ( "Generate file!" ) + '</a>' ;
else
content += '<span class="tooltip-nolog">' + Common . _e ( "This chat is empty!" ) + '</span>' ;
break ;
}
// Generates general tooltip HTML code
var html =
'<div class="tooltip bubble-' + type + '">' +
'<div class="tooltip-subitem">' +
'<p class="tooltip-top">' + title + '</p>' +
content +
'</div>' +
'<div class="tooltip-subarrow talk-images"></div>' +
'</div>' ;
// Append the HTML code
$ ( path _tooltip ) . append ( html ) ;
// Special events
switch ( type ) {
// Smileys
case 'smileys' :
// Apply click event on smiley links
$ ( path _tooltip + ' a.emoticon' ) . click ( function ( ) {
return Interface . insertSmiley ( $ ( this ) . attr ( 'data-smiley' ) , hash ) ;
} ) ;
break ;
// Style
case 'style' :
// Paths to items
var message _area = path + ' .message-area' ;
var bubble _style = path _tooltip + ' .bubble-style' ;
var style = bubble _style + ' input:checkbox' ;
var colors = bubble _style + ' a.color' ;
var font _current = bubble _style + ' a.font-current' ;
var font _list = bubble _style + ' div.font-list' ;
var font _select = font _list + ' a' ;
var fontsize _current = bubble _style + ' a.fontsize-current' ;
var fontsize _list = bubble _style + ' div.fontsize-list' ;
var fontsize _select = fontsize _list + ' a' ;
var color = bubble _style + ' div.color-picker' ;
var color _more = color + ' a.color-more' ;
var color _hex = color + ' div.color-hex' ;
// Click event on style bubble
$ ( bubble _style ) . click ( function ( ) {
// Hide font selector if opened
2014-11-25 20:12:58 +01:00
if ( $ ( font _list ) . is ( ':visible' ) ) {
2014-03-12 14:52:47 +01:00
$ ( font _current ) . click ( ) ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
// Hide font-size selector if opened
2014-11-25 20:12:58 +01:00
if ( $ ( fontsize _list ) . is ( ':visible' ) ) {
2014-03-12 14:52:47 +01:00
$ ( fontsize _current ) . click ( ) ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
// Hide color selector if opened
2014-11-25 20:12:58 +01:00
if ( $ ( color _hex ) . is ( ':visible' ) ) {
2014-03-12 14:52:47 +01:00
$ ( color _more ) . click ( ) ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
} ) ;
// Click event on font picker
$ ( font _current ) . click ( function ( ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
2014-03-12 14:52:47 +01:00
// The clicked color is yet selected
2014-11-25 20:12:58 +01:00
if ( $ ( font _list ) . is ( ':visible' ) ) {
this _sel . parent ( ) . removeClass ( 'listed' ) ;
} else {
this _sel . parent ( ) . addClass ( 'listed' ) ;
}
2014-03-12 14:52:47 +01:00
return false ;
} ) ;
// Click event on a new font in the picker
$ ( font _select ) . click ( function ( ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
2014-03-12 14:52:47 +01:00
// No font selected
2014-11-25 20:12:58 +01:00
if ( ! this _sel . attr ( 'data-value' ) ) {
2014-03-12 14:52:47 +01:00
$ ( font _current ) . removeAttr ( 'data-font' )
. removeAttr ( 'data-value' )
. text ( Common . _e ( "None" ) ) ;
$ ( message _area ) . removeAttr ( 'data-font' ) ;
2014-11-25 20:12:58 +01:00
} else {
$ ( font _current ) . attr ( 'data-font' , this _sel . attr ( 'data-font' ) )
. attr ( 'data-value' , this _sel . attr ( 'data-value' ) )
. text ( $ ( font _list ) . find ( 'a[data-value="' + this _sel . attr ( 'data-value' ) + '"]' ) . text ( ) ) ;
2014-03-12 14:52:47 +01:00
2014-11-25 20:12:58 +01:00
$ ( message _area ) . attr ( 'data-font' , this _sel . attr ( 'data-value' ) ) ;
2014-03-12 14:52:47 +01:00
}
return false ;
} ) ;
// Click event on font-size picker
$ ( fontsize _current ) . click ( function ( ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
2014-03-12 14:52:47 +01:00
// The clicked color is yet selected
2014-11-25 20:12:58 +01:00
if ( $ ( fontsize _list ) . is ( ':visible' ) ) {
this _sel . parent ( ) . removeClass ( 'listed' ) ;
} else {
this _sel . parent ( ) . addClass ( 'listed' ) ;
}
2014-03-12 14:52:47 +01:00
return false ;
} ) ;
// Click event on a new font-size in the picker
$ ( fontsize _select ) . click ( function ( ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
2014-03-12 14:52:47 +01:00
// No font-size selected
2014-11-25 20:12:58 +01:00
if ( ! this _sel . attr ( 'data-value' ) ) {
2014-03-12 14:52:47 +01:00
$ ( fontsize _current ) . removeAttr ( 'data-value' ) . text ( Common . _e ( "16" ) ) ;
$ ( message _area ) . removeAttr ( 'data-fontsize' ) ;
}
// A font-size is defined
else {
2014-11-25 20:12:58 +01:00
$ ( fontsize _current ) . attr ( 'data-value' , this _sel . attr ( 'data-value' ) )
. text ( this _sel . attr ( 'data-value' ) ) ;
$ ( message _area ) . attr ( 'data-fontsize' , this _sel . attr ( 'data-value' ) ) ;
2014-03-12 14:52:47 +01:00
}
return false ;
} ) ;
// Click event on color picker
$ ( colors ) . click ( function ( ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
2014-03-12 14:52:47 +01:00
// Reset the manual picker
$ ( color _hex ) . find ( 'input' ) . val ( '' ) ;
// The clicked color is yet selected
2014-11-25 20:12:58 +01:00
if ( this _sel . hasClass ( 'selected' ) ) {
2014-03-12 14:52:47 +01:00
$ ( message _area ) . removeAttr ( 'data-color' ) ;
2014-11-25 20:12:58 +01:00
this _sel . removeClass ( 'selected' ) ;
2014-03-12 14:52:47 +01:00
}
else {
2014-11-25 20:12:58 +01:00
$ ( message _area ) . attr ( 'data-color' , this _sel . attr ( 'data-color' ) ) ;
2014-03-12 14:52:47 +01:00
$ ( colors ) . removeClass ( 'selected' ) ;
2014-11-25 20:12:58 +01:00
this _sel . addClass ( 'selected' ) ;
2014-03-12 14:52:47 +01:00
}
return false ;
} ) ;
// Click event on color picker
$ ( color _more ) . click ( function ( ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
2014-03-12 14:52:47 +01:00
// The clicked color is yet selected
2014-11-25 20:12:58 +01:00
if ( $ ( color _hex ) . is ( ':visible' ) ) {
this _sel . parent ( ) . removeClass ( 'opened' ) ;
} else {
this _sel . parent ( ) . addClass ( 'opened' ) ;
2014-03-12 14:52:47 +01:00
// Focus
$ ( document ) . oneTime ( 10 , function ( ) {
$ ( color _hex ) . find ( 'input' ) . focus ( ) ;
} ) ;
}
return false ;
} ) ;
// Click event on color hex
$ ( color _hex ) . click ( function ( ) {
return false ;
} ) ;
// Keyup event on color picker
$ ( color _hex ) . find ( 'input' ) . keyup ( function ( e ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
2014-03-12 14:52:47 +01:00
// Submit
if ( e . keyCode == 13 ) {
if ( $ ( color _hex ) . is ( ':visible' ) ) {
$ ( color _more ) . click ( ) ;
// Focus again on the message textarea
$ ( document ) . oneTime ( 10 , function ( ) {
$ ( message _area ) . focus ( ) ;
} ) ;
}
return false ;
}
// Reset current color
$ ( message _area ) . removeAttr ( 'data-color' ) ;
$ ( colors ) . removeClass ( 'selected' ) ;
// Change value
2014-11-25 20:12:58 +01:00
var new _value = this _sel . val ( ) . replace ( /([^a-z0-9]+)/gi , '' ) ;
this _sel . val ( new _value ) ;
2014-03-12 14:52:47 +01:00
2014-11-25 20:12:58 +01:00
if ( new _value ) {
2014-03-12 14:52:47 +01:00
$ ( message _area ) . attr ( 'data-color' , new _value ) ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
// Regenerate style
var style = Message . generateStyle ( hash ) ;
// Any style to apply?
2014-11-25 20:12:58 +01:00
if ( style ) {
2014-03-12 14:52:47 +01:00
$ ( message _area ) . attr ( 'style' , style ) ;
2014-11-25 20:12:58 +01:00
} else {
2014-03-12 14:52:47 +01:00
$ ( message _area ) . removeAttr ( 'style' ) ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
} ) . placeholder ( ) ;
// Change event on text style checkboxes
$ ( style ) . change ( function ( ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
2014-03-12 14:52:47 +01:00
// Get current type
2014-11-25 20:12:58 +01:00
var style _data = 'data-' + this _sel . attr ( 'class' ) ;
2014-03-12 14:52:47 +01:00
// Checked checkbox?
2014-11-25 20:12:58 +01:00
if ( this _sel . filter ( ':checked' ) . size ( ) ) {
2014-03-12 14:52:47 +01:00
$ ( message _area ) . attr ( style _data , true ) ;
2014-11-25 20:12:58 +01:00
} else {
2014-03-12 14:52:47 +01:00
$ ( message _area ) . removeAttr ( style _data ) ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
} ) ;
// Update the textarea style when it is changed
$ ( style + ', ' + colors + ', ' + font _select + ', ' + fontsize _select ) . click ( function ( ) {
var style = Message . generateStyle ( hash ) ;
// Any style to apply?
2014-11-25 20:12:58 +01:00
if ( style ) {
2014-03-12 14:52:47 +01:00
$ ( message _area ) . attr ( 'style' , style ) ;
2014-11-25 20:12:58 +01:00
} else {
2014-03-12 14:52:47 +01:00
$ ( message _area ) . removeAttr ( 'style' ) ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
// Focus again on the message textarea
$ ( document ) . oneTime ( 10 , function ( ) {
$ ( message _area ) . focus ( ) ;
} ) ;
} ) ;
// Load current style
self . loadStyleSelector ( hash ) ;
break ;
// File send
case 'file' :
// File upload vars
var oob _upload _options = {
dataType : 'xml' ,
beforeSubmit : OOB . waitUpload ,
success : OOB . handleUpload
} ;
// Upload form submit event
$ ( path _tooltip + ' #oob-upload' ) . submit ( function ( ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
if ( $ ( path _tooltip + ' #oob-upload input[type="file"]' ) . val ( ) ) {
this _sel . ajaxSubmit ( oob _upload _options ) ;
}
2014-03-12 14:52:47 +01:00
return false ;
} ) ;
// Upload input change event
$ ( path _tooltip + ' #oob-upload input[type="file"]' ) . change ( function ( ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
if ( this _sel . val ( ) ) {
2014-03-12 14:52:47 +01:00
$ ( path _tooltip + ' #oob-upload' ) . ajaxSubmit ( oob _upload _options ) ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
return false ;
} ) ;
// Input click event
$ ( path _tooltip + ' #oob-upload input[type="file"], ' + path _tooltip + ' #oob-upload input[type="submit"]' ) . click ( function ( ) {
2014-11-25 20:12:58 +01:00
if ( Common . exists ( path _tooltip + ' #oob-upload input[type="reset"]' ) ) {
2014-03-12 14:52:47 +01:00
return ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
// Lock the bubble
$ ( path _bubble ) . addClass ( 'locked' ) ;
// Add a cancel button
$ ( this ) . after ( '<input type="reset" value="' + Common . _e ( "Cancel" ) + '" />' ) ;
// Cancel button click event
$ ( path _tooltip + ' #oob-upload input[type="reset"]' ) . click ( function ( ) {
// Remove the bubble
$ ( path _bubble ) . removeClass ( 'locked' ) ;
self . destroy ( hash , 'file' ) ;
} ) ;
} ) ;
break ;
// Chat log
case 'save' :
// Chat log generation click event
$ ( path _tooltip + ' .tooltip-actionlog' ) . click ( function ( ) {
// Replace it with a waiting notice
$ ( this ) . replaceWith ( '<span class="tooltip-waitlog">' + Common . _e ( "Please wait..." ) + '</span>' ) ;
Interface . generateChatLog ( xid , hash ) ;
return false ;
} ) ;
break ;
}
return true ;
} catch ( e ) {
Console . error ( 'Tooltip.create' , e ) ;
}
} ;
/ * *
* Destroys a tooltip code
* @ public
* @ param { string } hash
* @ param { string } type
* @ return { undefined }
* /
self . destroy = function ( hash , type ) {
try {
$ ( '#' + hash + ' .chat-tools-content:not(.mini) .bubble-' + type + ':not(.locked)' ) . remove ( ) ;
} catch ( e ) {
Console . error ( 'Tooltip.destroy' , e ) ;
}
} ;
/ * *
* Applies the page - engine tooltips hover event
* @ public
* @ param { string } xid
* @ param { string } hash
* @ param { string } type
* @ return { undefined }
* /
self . hover = function ( xid , hash , type ) {
try {
$ ( '#' + hash + ' .chat-tools-' + type ) . hover ( function ( ) {
self . create ( xid , hash , type ) ;
} , function ( ) {
self . destroy ( hash , type ) ;
} ) ;
} catch ( e ) {
Console . error ( 'Tooltip.hover' , e ) ;
}
} ;
/ * *
* Applies the hover function to the needed things
* @ public
* @ param { string } xid
* @ param { string } hash
* @ return { undefined }
* /
self . icons = function ( xid , hash ) {
try {
// Hover events
self . hover ( xid , hash , 'smileys' ) ;
self . hover ( xid , hash , 'style' ) ;
self . hover ( xid , hash , 'file' ) ;
self . hover ( xid , hash , 'save' ) ;
// Click events
$ ( '#' + hash + ' a.chat-tools-content, #' + hash + ' .chat-tools-content a' ) . click ( function ( ) {
return false ;
} ) ;
} catch ( e ) {
Console . error ( 'Tooltip.icons' , e ) ;
}
} ;
/ * *
* Loads the style selector options
* @ public
* @ param { string } hash
* @ return { undefined }
* /
self . loadStyleSelector = function ( hash ) {
try {
// Define the vars
var path = '#' + hash ;
var message _area = $ ( path + ' .message-area' ) ;
var bubble _style = path + ' .bubble-style' ;
var font = message _area . attr ( 'data-font' ) ;
var font _select = $ ( bubble _style + ' div.font-list' ) . find ( 'a[data-value="' + font + '"]' ) ;
var fontsize = message _area . attr ( 'data-fontsize' ) ;
var color = message _area . attr ( 'data-color' ) ;
// Apply message font
if ( font ) {
$ ( bubble _style + ' a.font-current' ) . attr ( 'data-value' , font )
. attr ( 'data-font' , font _select . attr ( 'data-font' ) )
. text ( font _select . text ( ) ) ;
}
// Apply message font-size
if ( fontsize ) {
$ ( bubble _style + ' a.fontsize-current' ) . attr ( 'data-value' , fontsize )
. text ( fontsize ) ;
}
// Apply the options to the style selector
$ ( bubble _style + ' input[type="checkbox"]' ) . each ( function ( ) {
2014-11-25 20:12:58 +01:00
var this _sel = $ ( this ) ;
2014-03-12 14:52:47 +01:00
// Current input enabled?
2014-11-25 20:12:58 +01:00
if ( message _area . attr ( 'data-' + this _sel . attr ( 'class' ) ) ) {
this _sel . attr ( 'checked' , true ) ;
}
2014-03-12 14:52:47 +01:00
} ) ;
// Apply message color
if ( color ) {
2014-11-25 20:12:58 +01:00
if ( $ ( bubble _style + ' a.color[data-color="' + color + '"]' ) . size ( ) ) {
2014-03-12 14:52:47 +01:00
$ ( bubble _style + ' a.color[data-color="' + color + '"]' ) . addClass ( 'selected' ) ;
2014-11-25 20:12:58 +01:00
} else {
2014-03-12 14:52:47 +01:00
$ ( bubble _style + ' div.color-hex input.hex-value' ) . val ( color ) ;
2014-11-25 20:12:58 +01:00
}
2014-03-12 14:52:47 +01:00
}
} catch ( e ) {
Console . error ( 'Tooltip.loadStyleSelector' , e ) ;
}
} ;
/ * *
* Return class scope
* /
return self ;
} ) ( ) ;