Fixes for the Autonym test
Change-Id: Ic8d8eca516cfefc523fca0257ae1f14ea9b64d1b
This commit is contained in:
@@ -3,12 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Autonym font Example</title>
|
<title>Autonym font Example</title>
|
||||||
<meta name="description" content="" />
|
<meta name="description" content="A test page for the Autonym font" />
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
|
||||||
<script src="../lib/jquery.uls/src/jquery.uls.data.js"></script>
|
<script src="../lib/jquery.uls/src/jquery.uls.data.js"></script>
|
||||||
<script src="../lib/jquery.uls/src/jquery.uls.data.utils.js"></script>
|
<script src="../lib/jquery.uls/src/jquery.uls.data.utils.js"></script>
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Autonym';
|
font-family: 'Autonym';
|
||||||
src: url('../data/fontrepo/fonts/Autonym/Autonym.eot');
|
src: url('../data/fontrepo/fonts/Autonym/Autonym.eot');
|
||||||
@@ -24,28 +23,27 @@ table, th, td {
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
td.lang, td.index {
|
td.lang,
|
||||||
|
td.index {
|
||||||
background-color: #ccc;
|
background-color: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Autonym Font</h1>
|
<h1>Autonym Font</h1>
|
||||||
<p>Following content in this page uses <a href="https://github.com/santhoshtr/AutonymFont">Autonym</a>
|
<p>The following table in this page uses the <a href="https://github.com/santhoshtr/AutonymFont">Autonym</a>
|
||||||
font for displaying language names without font issues.</p>
|
font for displaying language names without font issues.</p>
|
||||||
|
|
||||||
<p>Version: 20131118</p>
|
<p>Version: 20131118</p>
|
||||||
<hr/>
|
<hr/>
|
||||||
<div>
|
<div>
|
||||||
<select id="ff">
|
<label for="font-selector">Select a font:</label>
|
||||||
<option value="Autonym">Select Font</option>
|
<select id="font-selector">
|
||||||
<option value="Autonym">Autonym</option>
|
<option value="Autonym">Autonym</option>
|
||||||
<option value="sans-serif">sans-serif</option>
|
<option value="sans-serif">sans-serif</option>
|
||||||
<option value="Autonym, sans-serif">Autonym, sans-serif</option>
|
<option value="Autonym, sans-serif">Autonym, sans-serif</option>
|
||||||
<option value="sans-serif, Autonym">sans-serif, Autonym</option>
|
<option value="sans-serif, Autonym">sans-serif, Autonym</option>
|
||||||
</select>
|
</select>
|
||||||
<select id="fs">
|
<select id="size-selector">
|
||||||
<option value="8">Select size (px)</option>
|
<option value="8">Select size (px)</option>
|
||||||
<option value="8">8</option>
|
<option value="8">8</option>
|
||||||
<option value="9">9</option>
|
<option value="9">9</option>
|
||||||
@@ -67,37 +65,52 @@ td.lang, td.index {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
var index = 0;
|
var index = 1,
|
||||||
|
$autonym = $( '.autonym' ),
|
||||||
|
$fontSelector = $( '#font-selector' ),
|
||||||
|
$sizeSelector = $( '#size-selector' );
|
||||||
|
|
||||||
$( '#ff' ).change( function () {
|
$fontSelector.change( function () {
|
||||||
$( '.autonym').css('font-family',$(this).val() );
|
$autonym.css( 'font-family', $( this ).val() );
|
||||||
});
|
});
|
||||||
$( '#fs' ).change( function () {
|
$sizeSelector.change( function () {
|
||||||
$( '.autonym').css('font-size', $(this).val() + 'px' );
|
$autonym.css( 'font-size', $( this ).val() + 'px' );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$.each( $.uls.data.languages, function( langCode ) {
|
$.each( $.uls.data.languages, function( langCode ) {
|
||||||
var autonym = $.uls.data.getAutonym( langCode );
|
var autonym = $.uls.data.getAutonym( langCode ),
|
||||||
|
dir = $.uls.data.getDir( langCode );
|
||||||
|
|
||||||
$( '.dropdown' ).append(
|
$( '.dropdown' ).append(
|
||||||
$( '<option>')
|
$( '<option>')
|
||||||
.attr( 'lang', langCode )
|
.attr( {
|
||||||
|
lang: langCode,
|
||||||
|
dir: dir
|
||||||
|
} )
|
||||||
.text( autonym )
|
.text( autonym )
|
||||||
|
);
|
||||||
|
|
||||||
)
|
|
||||||
$( 'table' ).append(
|
$( 'table' ).append(
|
||||||
$( '<tr>' ).append(
|
$( '<tr>' ).append(
|
||||||
$( '<td class=index>')
|
$( '<td>' )
|
||||||
.text( index+1 ),
|
.addClass( 'index' )
|
||||||
$( '<td class=lang>')
|
.text( index++ ),
|
||||||
|
$( '<td>' )
|
||||||
|
.addClass( 'lang' )
|
||||||
.text( langCode ),
|
.text( langCode ),
|
||||||
$( '<td class=name>')
|
$( '<td>' )
|
||||||
.attr( 'lang', langCode )
|
.addClass( 'name' )
|
||||||
|
.attr( {
|
||||||
|
lang: langCode,
|
||||||
|
dir: dir
|
||||||
|
} )
|
||||||
.text( autonym )
|
.text( autonym )
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
index++;
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// Apply the initial font
|
||||||
|
$autonym.css( 'font-family', $fontSelector.val() );
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user