@@ -71,4 +71,4 @@
|
|||||||
border-bottom: 4px solid transparent;
|
border-bottom: 4px solid transparent;
|
||||||
content: "";
|
content: "";
|
||||||
margin: 0 6px 0 0;
|
margin: 0 6px 0 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,10 +111,8 @@ div.uls-region {
|
|||||||
/*Cross-browser background transparency*/
|
/*Cross-browser background transparency*/
|
||||||
background: #3366bb;
|
background: #3366bb;
|
||||||
background: rgba(51, 102, 187, 0.1);
|
background: rgba(51, 102, 187, 0.1);
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#253366bb,
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#253366bb, endColorstr=#253366bb );
|
||||||
endColorstr=#253366bb );
|
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#253366bb, endColorstr=#253366bb)";
|
||||||
-ms-filter:
|
|
||||||
"progid:DXImageTransform.Microsoft.gradient(startColorstr=#253366bb, endColorstr=#253366bb)";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.map-block .active {
|
.map-block .active {
|
||||||
|
|||||||
@@ -20,12 +20,13 @@
|
|||||||
|
|
||||||
include __DIR__ . '/spyc.php';
|
include __DIR__ . '/spyc.php';
|
||||||
|
|
||||||
print( "Reading langdb.yaml...\n" );
|
print "Reading langdb.yaml...\n";
|
||||||
$yamlLangdb = file_get_contents( 'langdb.yaml' );
|
$yamlLangdb = file_get_contents( 'langdb.yaml' );
|
||||||
$parsedLangdb = spyc_load( $yamlLangdb );
|
$parsedLangdb = spyc_load( $yamlLangdb );
|
||||||
|
|
||||||
$supplementalDataFilename = 'supplementalData.xml';
|
$supplementalDataFilename = 'supplementalData.xml';
|
||||||
$supplementalDataUrl = "http://unicode.org/repos/cldr/trunk/common/supplemental/$supplementalDataFilename";
|
$supplementalDataUrl =
|
||||||
|
"http://unicode.org/repos/cldr/trunk/common/supplemental/$supplementalDataFilename";
|
||||||
|
|
||||||
$curl = curl_init( $supplementalDataUrl );
|
$curl = curl_init( $supplementalDataUrl );
|
||||||
$supplementalDataFile = fopen( $supplementalDataFilename, 'w' );
|
$supplementalDataFile = fopen( $supplementalDataFilename, 'w' );
|
||||||
@@ -33,7 +34,7 @@ $supplementalDataFile = fopen( $supplementalDataFilename, 'w' );
|
|||||||
curl_setopt( $curl, CURLOPT_FILE, $supplementalDataFile );
|
curl_setopt( $curl, CURLOPT_FILE, $supplementalDataFile );
|
||||||
curl_setopt( $curl, CURLOPT_HEADER, 0 );
|
curl_setopt( $curl, CURLOPT_HEADER, 0 );
|
||||||
|
|
||||||
print( "Trying to download $supplementalDataUrl...\n" );
|
print "Trying to download $supplementalDataUrl...\n";
|
||||||
$curlSuccess = curl_exec( $curl );
|
$curlSuccess = curl_exec( $curl );
|
||||||
curl_close( $curl );
|
curl_close( $curl );
|
||||||
fclose( $supplementalDataFile );
|
fclose( $supplementalDataFile );
|
||||||
@@ -41,7 +42,7 @@ fclose( $supplementalDataFile );
|
|||||||
if ( !$curlSuccess ) {
|
if ( !$curlSuccess ) {
|
||||||
die( "Failed to download CLDR data from $supplementalDataUrl.\n" );
|
die( "Failed to download CLDR data from $supplementalDataUrl.\n" );
|
||||||
}
|
}
|
||||||
print( "Downloaded $supplementalDataFilename, trying to parse...\n" );
|
print "Downloaded $supplementalDataFilename, trying to parse...\n";
|
||||||
|
|
||||||
$supplementalData = simplexml_load_file( $supplementalDataFilename );
|
$supplementalData = simplexml_load_file( $supplementalDataFilename );
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ if ( !( $supplementalData instanceof SimpleXMLElement ) ) {
|
|||||||
die( "Attempt to load CLDR data from $supplementalDataFilename failed.\n" );
|
die( "Attempt to load CLDR data from $supplementalDataFilename failed.\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
print( "CLDR supplemental data parsed successfully, reading territories info...\n" );
|
print "CLDR supplemental data parsed successfully, reading territories info...\n";
|
||||||
$parsedLangdb['territories'] = array();
|
$parsedLangdb['territories'] = array();
|
||||||
|
|
||||||
foreach ( $supplementalData->territoryInfo->territory as $territoryRecord ) {
|
foreach ( $supplementalData->territoryInfo->territory as $territoryRecord ) {
|
||||||
@@ -64,10 +65,11 @@ foreach ( $supplementalData->territoryInfo->territory as $territoryRecord ) {
|
|||||||
// Lower case is a convention for language codes in ULS.
|
// Lower case is a convention for language codes in ULS.
|
||||||
// '_' is used in CLDR for compound codes and it's replaced with '-' here.
|
// '_' is used in CLDR for compound codes and it's replaced with '-' here.
|
||||||
$parsedLangdb['territories'][$territoryCode][] =
|
$parsedLangdb['territories'][$territoryCode][] =
|
||||||
strtr( strtolower( (string) $languageCodeAttr[0] ), '_', '-' ); }
|
strtr( strtolower( (string) $languageCodeAttr[0] ), '_', '-' );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print( "Writing JSON langdb...\n" );
|
print "Writing JSON langdb...\n";
|
||||||
$json = json_encode( $parsedLangdb );
|
$json = json_encode( $parsedLangdb );
|
||||||
$js = <<<JAVASCRIPT
|
$js = <<<JAVASCRIPT
|
||||||
// Please do not edit. This file is generated from data/langdb.yaml by ulsdata2json.php
|
// Please do not edit. This file is generated from data/langdb.yaml by ulsdata2json.php
|
||||||
@@ -80,4 +82,4 @@ $js = <<<JAVASCRIPT
|
|||||||
JAVASCRIPT;
|
JAVASCRIPT;
|
||||||
file_put_contents( '../src/jquery.uls.data.js', $js );
|
file_put_contents( '../src/jquery.uls.data.js', $js );
|
||||||
|
|
||||||
print( "Done.\n" );
|
print "Done.\n";
|
||||||
|
|||||||
@@ -15,4 +15,4 @@ span.uls-trigger {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,6 @@
|
|||||||
return allRegions;
|
return allRegions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all languages written in script.
|
* Returns all languages written in script.
|
||||||
* @param script string
|
* @param script string
|
||||||
@@ -364,7 +363,6 @@
|
|||||||
return regionsInGroup;
|
return regionsInGroup;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the script group of a script or 'Other' if it doesn't
|
* Returns the script group of a script or 'Other' if it doesn't
|
||||||
* belong to any group.
|
* belong to any group.
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
this.$element.addClass( 'languagefilter' );
|
this.$element.addClass( 'languagefilter' );
|
||||||
this.resultCount = 0;
|
this.resultCount = 0;
|
||||||
this.$suggestion = this.$element.parents().find( '#' + this.$element.data( 'suggestion' ) );
|
this.$suggestion = this.$element.parents().find( '#' + this.$element.data( 'suggestion' ) );
|
||||||
this.$clear = this.$element.parents().find( '#'+ this.$element.data( 'clear' ) );
|
this.$clear = this.$element.parents().find( '#' + this.$element.data( 'clear' ) );
|
||||||
this.selectedLanguage = null;
|
this.selectedLanguage = null;
|
||||||
|
|
||||||
this.listen();
|
this.listen();
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
this.options = $.extend( {}, $.fn.regionselector.defaults, options );
|
this.options = $.extend( {}, $.fn.regionselector.defaults, options );
|
||||||
this.$element.addClass( 'regionselector' );
|
this.$element.addClass( 'regionselector' );
|
||||||
this.regions = [];
|
this.regions = [];
|
||||||
this.cache= null;
|
this.cache = null;
|
||||||
this.regionGroup = this.$element.data( 'regiongroup' );
|
this.regionGroup = this.$element.data( 'regiongroup' );
|
||||||
this.init();
|
this.init();
|
||||||
this.listen();
|
this.listen();
|
||||||
@@ -188,5 +188,4 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
$.fn.regionselector.Constructor = RegionSelector;
|
$.fn.regionselector.Constructor = RegionSelector;
|
||||||
|
|
||||||
} ( jQuery ) );
|
} ( jQuery ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user