Skip to content

Commit bdd80bc

Browse files
authored
Merge pull request #531 from keymanapp/chore/merge-master-staging-a18s20
chore: Merge master to staging for Sprint A18S20
2 parents 79813a8 + b0c94c7 commit bdd80bc

File tree

13 files changed

+165
-133
lines changed

13 files changed

+165
-133
lines changed

.htaccess

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ RewriteRule "^keyboards/(?!index\.php|install|keyboard|session|share)([^/]+)$" "
108108
# RewriteRule "^keyboards$" "/keyboards/index.php" [L]
109109

110110
# /keyboards/languages to /keyboards/index.php
111-
RewriteRule "^keyboards/languages/(.*)" "/keyboards/index.php?q=l:id:$1" [END]
111+
RewriteRule "^keyboards/languages/(.*)" "/keyboards/index.php?q=l:id:$1" [END,QSA]
112112

113113
# /keyboards/download to /keyboards/download.php
114114
RewriteRule "^keyboards/download(.php)?" "/keyboards/download.php" [END,QSA]

_includes/2020/templates/Menu.php

+2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ private static function render_top_menu(object $fields): void {
106106
<img id="header-bottom" src="<?php echo Util::cdn("img/headerbar.png"); ?>" alt='Header bottom' />
107107
<div id="help">
108108

109+
<span id='free'>Keyman is <a href='/free'>free and open source</a></span>
110+
109111
<form action="/search/" method="get" role="search">
110112
<div class="search-wrap">
111113
<label for="main-q" class="offscreen">Search</label>

_includes/includes/ui/keyboard-details.php

+56-37
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class KeyboardDetails
5555

5656
/**
5757
* render_keyboard_details - display keyboard download boxes and details
58-
* @param $id - keyboard ID
58+
* @param $id - keyboard package ID
5959
* @param string $tier - ['stable', 'alpha', or 'beta']
6060
* @param bool $landingPage - when true, details won't display keyboard search box or title
6161
* @param string $bcp47 - BCP 47 tag to pass as a hint to download links for apps to make connection
@@ -125,41 +125,48 @@ protected static function download_box($platform) {
125125
protected static function WriteWebBoxes($useDescription) {
126126
global $embed_target;
127127
global $KeymanHosts;
128-
if (isset(self::$keyboard->platformSupport->desktopWeb) && self::$keyboard->platformSupport->desktopWeb != 'none' && empty(self::$deprecatedBy)) {
129-
if(empty(self::$bcp47)) {
130-
if (isset(self::$keyboard->languages)) {
131-
if (is_array(self::$keyboard->languages)) {
132-
if (count(self::$keyboard->languages) > 0) {
133-
$lang = self::$keyboard->languages[0];
134-
}
135-
} else {
136-
$langs = array_keys(get_object_vars(self::$keyboard->languages));
137-
if (count($langs) > 0) {
138-
$lang = $langs[0];
139-
}
128+
129+
// only show if the jsFilename property is present in the .keyboard_info
130+
if(empty(self::$keyboard->jsFilename)) {
131+
return FALSE;
132+
}
133+
134+
if (!isset(self::$keyboard->platformSupport->desktopWeb) || self::$keyboard->platformSupport->desktopWeb == 'none' || !empty(self::$deprecatedBy)) {
135+
return FALSE;
136+
}
137+
138+
if(empty(self::$bcp47)) {
139+
if (isset(self::$keyboard->languages)) {
140+
if (is_array(self::$keyboard->languages)) {
141+
if (count(self::$keyboard->languages) > 0) {
142+
$lang = self::$keyboard->languages[0];
143+
}
144+
} else {
145+
$langs = array_keys(get_object_vars(self::$keyboard->languages));
146+
if (count($langs) > 0) {
147+
$lang = $langs[0];
140148
}
141149
}
142-
} else {
143-
$lang = self::$bcp47;
144-
}
145-
if (!isset($lang)) $lang = 'en';
146-
$url = "{$KeymanHosts->keymanweb_com}/#$lang,Keyboard_" . self::$keyboard->id;
147-
if($useDescription) {
148-
$description = htmlentities(self::$keyboard->name);
149-
$description = "<div class=\"download-description\">Use $description in your web browser. No need to install anything.</div>";
150-
$linktext = 'Use keyboard online';
151-
} else {
152-
$description = '';
153-
$linktext = 'Full online editor';
154150
}
155-
return <<<END
156-
<div class="download download-web">
157-
<a class="download-link" $embed_target href='$url'>$linktext</a>
158-
$description
159-
</div>
160-
END;
151+
} else {
152+
$lang = self::$bcp47;
153+
}
154+
if (!isset($lang)) $lang = 'en';
155+
$url = "{$KeymanHosts->keymanweb_com}/#$lang,Keyboard_" . self::GetWebKeyboardId();
156+
if($useDescription) {
157+
$description = htmlentities(self::$keyboard->name);
158+
$description = "<div class=\"download-description\">Use $description in your web browser. No need to install anything.</div>";
159+
$linktext = 'Use keyboard online';
160+
} else {
161+
$description = '';
162+
$linktext = 'Full online editor';
161163
}
162-
return FALSE;
164+
return <<<END
165+
<div class="download download-web">
166+
<a class="download-link" $embed_target href='$url'>$linktext</a>
167+
$description
168+
</div>
169+
END;
163170
}
164171

165172
protected static function LoadData() {
@@ -170,7 +177,7 @@ protected static function LoadData() {
170177
if ($s === FALSE) {
171178
// Will fail later in the script
172179
self::$error .= error_get_last()['message'] . "\n";
173-
self::$title = 'Failed to load keyboard ' . self::$id;
180+
self::$title = 'Failed to load keyboard package ' . self::$id;
174181
header('HTTP/1.0 404 Keyboard not found');
175182
} else {
176183
$s = json_decode($s);
@@ -184,7 +191,7 @@ protected static function LoadData() {
184191
self::$license = self::map_license(isset(self::$keyboard->license) ? self::$keyboard->license : 'Unknown');
185192
} else {
186193
self::$error .= "Error returned from {$KeymanHosts->api_keyman_com}: $s\n";
187-
self::$title = 'Failed to load keyboard ' . self::$id;
194+
self::$title = 'Failed to load keyboard package ' . self::$id;
188195
header('HTTP/1.0 500 Internal Server Error');
189196
}
190197
}
@@ -300,7 +307,7 @@ protected static function WriteTitle() {
300307
// If parameters are missing ...
301308
?>
302309
<h1 class='red underline'><?= self::$id ?></h1>
303-
<p>Keyboard <?= self::$id ?> not found.</p>
310+
<p>Keyboard package <?= self::$id ?> not found.</p>
304311
<?php
305312
// DEBUG: Only display errors on local sites
306313
global $KeymanHosts;
@@ -340,7 +347,6 @@ protected static function WriteTitle() {
340347

341348
if(!empty(self::$deprecatedBy)) {
342349
$dep = self::$deprecatedBy;
343-
$id = self::$id;
344350
echo "
345351
<div>
346352
<a href='/keyboards/$dep$session_query_q' class='deprecated'><span>Important note:</span>
@@ -393,6 +399,13 @@ protected static function WriteDownloadBoxes() {
393399
}
394400
}
395401

402+
private static function GetWebKeyboardId() {
403+
if(empty(self::$keyboard->jsFilename)) {
404+
return "";
405+
}
406+
return preg_replace("/\.js$/", "", self::$keyboard->jsFilename);
407+
}
408+
396409
protected static function GetWebDeviceFromPageDevice() {
397410
global $pageDevice;
398411
switch($pageDevice) {
@@ -418,12 +431,18 @@ protected static function WriteKeymanWebBox() {
418431
return;
419432
}
420433

434+
// only show if the jsFilename property is present in the .keyboard_info
435+
if(empty(self::$keyboard->jsFilename)) {
436+
return;
437+
}
438+
421439
// only inject on desktop platforms
422440
$webDevice = self::GetWebDeviceFromPageDevice();
423441
if(!$webDevice) {
424442
return;
425443
}
426444

445+
$keymanWebId = self::GetWebKeyboardId();
427446
$webtext = self::WriteWebBoxes(false);
428447
$cdnUrlBase = KeymanWebHost::getKeymanWebUrlBase();
429448
?>
@@ -452,7 +471,7 @@ function() {
452471
document.getElementById('osk-host').appendChild(newOSK.element);
453472
}
454473
);
455-
keyman.addKeyboards('<?= self::$id ?>');
474+
keyman.addKeyboards('<?= $keymanWebId ?>');
456475
})();
457476
</script>
458477
<?php

about/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Keyboard layouts are defined with a clear and easy to understand keyboard gramma
1010
means keyboard layouts can be intelligent and make it simple to type even the most complex languages.
1111
Keyboard layouts are distributed through an open catalog to all major desktop and mobile platforms.
1212

13+
Keyman is [free and open source!](/free)
1314

1415
## About SIL Global
1516

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## START STANDARD SITE BUILD SCRIPT INCLUDE
33
readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
44
readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh"
5-
readonly BOOTSTRAP_VERSION=v0.11
5+
readonly BOOTSTRAP_VERSION=v0.15
66
[ -f "$BOOTSTRAP" ] && source "$BOOTSTRAP" || source <(curl -fs https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh)
77
## END STANDARD SITE BUILD SCRIPT INCLUDE
88

cdn/dev/css/template.css

+13-7
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ html {
328328

329329
.button a {
330330
color: inherit;
331-
text-decoration: none;
331+
text-decoration: none;
332332
align-items: center;
333333
}
334334

@@ -368,17 +368,17 @@ span.button.disabled{
368368
.version-type {
369369
margin-bottom: 10px;
370370
height: 300px;
371-
width: 30%;
371+
width: 30%;
372372
max-width: 300px;
373373
padding: 10px;
374-
box-sizing: border-box;
374+
box-sizing: border-box;
375375
box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
376376
border-radius: 5px;
377-
overflow-y: auto;
377+
overflow-y: auto;
378378
}
379379

380380
.version-type h5 {
381-
opacity: 0.6;
381+
opacity: 0.6;
382382
}
383383

384384
.version-item {
@@ -388,7 +388,7 @@ span.button.disabled{
388388
.version-item a {
389389
text-decoration: none;
390390
color: #B92034;
391-
display: block;
391+
display: block;
392392
width: 100%;
393393
}
394394

@@ -530,14 +530,20 @@ span.button.disabled{
530530
text-decoration: none;
531531
}
532532

533+
#help #free {
534+
float: left;
535+
margin-right: 1em;
536+
padding-top: 7px;
537+
}
538+
533539
#help form {
534540
float: left;
535541
}
536542

537543
#help #donate {
538544
padding-top: 5px;
539545
margin-right: 1em;
540-
margin-left: 1em;
546+
margin-left: 0em;
541547
}
542548

543549
#help #donate a {

developer/authoring-services.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: Keyboard authoring service directory
3+
---
4+
5+
If you wish to create a keyboard layout but do not have the technical expertise or time to create it yourself, the people and companies listed on this page
6+
may be able to assist you.
7+
8+
---
9+
10+
### Enabling Languages
11+
12+
Advise on layout requirements; developing new keyboard layouts; creating word frequency lists from a corpus; assisting in publishing a completed keyboard to keyboard repository on github; introductory training on using git and github to enable self-publishing.
13+
14+
15+
16+
---
17+
18+
### Katelem Edeh
19+
20+
Creating new keyboards and lexical models.
21+
22+
23+
24+
---
25+
26+
## Request addition to this directory
27+
28+
If you would like to be added to this directory, please complete the following form:
29+
30+
* [Keyboard authoring service signup](https://forms.gle/i7S1Yb5ck4nUr8mn6)
31+
32+
## Disclaimer
33+
34+
The information within Keyboard authoring service directory is provided as a
35+
public service to our community. The information is supplied by independent
36+
third parties.
37+
38+
While SIL Global makes every effort to ensure the accuracy of all the
39+
information, it makes no warranty as to the accuracy or reliability of any such
40+
information, content or other material contained on, distributed through, or
41+
linked, downloaded or accessed through this directory. Any reliance upon any
42+
information, content, materials, products, services included on or found through
43+
this directory shall be at the user’s sole risk.
44+
45+
Listing in this directory does not imply endorsement by SIL Global. Nor does SIL
46+
Global endorse products or services that such listings may offer. SIL Global
47+
disclaims all representations or warranties of any kind, express or implied,
48+
with respect to this directory or the information, content, materials or
49+
products included including, without limitation, warranties of quality.
50+
51+
The directory may include link to external websites. When users click on such
52+
links, they are leaving the Keyman website and are subject to the privacy and
53+
security policies of the owners/sponsors of the external site. SIL Global cannot
54+
authorize the use of copyrighted materials published on linked, external
55+
websites. Users must request authorization from the owners of those websites.

developer/index.php

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<li><a href="features.php">See the features.</a></li>
2727
<li><a href='download.php'>Keyman Developer Downloads</a></li>
2828
<li><a href='<?= KeymanHosts::Instance()->help_keyman_com ?>/developer/<?php echo $stable_version; ?>/'>Keyman Developer Support</a></li>
29+
<li><a href='authoring-services'>Keyboard authoring service providers</a></li>
2930
</ul>
3031

3132
<?php

free/index.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Keyman is free and open source
3+
---
4+
5+
Keyman is completely free to use on all devices! SIL Global does not charge
6+
any license fees for using Keyman.
7+
8+
* This change took place in August 2017 after SIL Global acquired Keyman from
9+
Tavultesoft Pty Ltd.
10+
11+
# Open Source
12+
13+
Keyman is licensed under the [MIT License](https://github.com/keymanapp/keyman/blob/master/LICENSE.md).
14+
The MIT License is a short, permissive software license. Basically, you can
15+
do whatever you want as long as you include the original copyright and license
16+
notice in any copy of the software/source.
17+
18+
SIL Global have chosen the MIT License in order to provide you, the users of
19+
Keyman with the greatest possible freedom to work in your language.
20+
21+
All 'release' quality Keyman keyboards in the [Keyman keyboard repository](https://github.com/keymanapp/keyboards)
22+
are licensed under the MIT License. All lexical models in the
23+
[Keyman lexical model repository](https://github.com/keymanapp/lexical-models)
24+
are also licensed under the MIT License. Copyright for these keyboards and
25+
lexical models belongs to many different authors.
26+
27+
* [About SIL Global](https://www.sil.org/about)
28+
* [About Keyman](/about)

0 commit comments

Comments
 (0)