Clean up code formatting, add .jsbeautifyrc
Change-Id: Iafcc8084d87d8f2323d97bb4446e031951820d41
This commit is contained in:
17
.jsbeautifyrc
Normal file
17
.jsbeautifyrc
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"preserve_newlines": true,
|
||||
"jslint_happy": true,
|
||||
"keep_array_indentation": true,
|
||||
"space_before_conditional": true,
|
||||
"max_preserve_newlines": 10,
|
||||
"brace_style": "collapse",
|
||||
"keep_function_indentation": false,
|
||||
"break_chained_methods": false,
|
||||
"eval_code": false,
|
||||
"unescape_strings": false,
|
||||
"wrap_line_length": 0,
|
||||
"space_in_paren": true,
|
||||
"space_in_square_bracket": true,
|
||||
"git_happy": true,
|
||||
"indent_with_tabs": true
|
||||
}
|
||||
@@ -196,7 +196,9 @@
|
||||
searchAPI: function ( query ) {
|
||||
var languageFilter = this;
|
||||
|
||||
$.get( languageFilter.options.searchAPI, { search: query }, function( result ) {
|
||||
$.get( languageFilter.options.searchAPI, {
|
||||
search: query
|
||||
}, function ( result ) {
|
||||
$.each( result.languagesearch, function ( code, name ) {
|
||||
if ( languageFilter.resultCount === 0 ) {
|
||||
// Autofill the first result.
|
||||
@@ -229,6 +231,8 @@
|
||||
},
|
||||
|
||||
autofill: function ( langCode, languageName ) {
|
||||
var autonym, userInput, suggestion;
|
||||
|
||||
if ( !this.$suggestion.length ) {
|
||||
return;
|
||||
}
|
||||
@@ -245,8 +249,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var autonym,
|
||||
userInput = this.$element.val(),
|
||||
userInput = this.$element.val();
|
||||
suggestion = userInput + languageName.substring( userInput.length, languageName.length );
|
||||
|
||||
if ( suggestion.toLowerCase() !== languageName.toLowerCase() ) {
|
||||
@@ -340,8 +343,9 @@
|
||||
|
||||
/**
|
||||
* Check if a prefix is visually prefix of a string
|
||||
* @param prefix string
|
||||
* @param string string
|
||||
*
|
||||
* @param {string} prefix
|
||||
* @param {string} string
|
||||
*/
|
||||
function isVisualPrefix( prefix, string ) {
|
||||
// Pre-base vowel signs of Indic languages. A vowel sign is called pre-base if
|
||||
|
||||
Reference in New Issue
Block a user