Merge branch 'master' of github.com:PrivateBin/PrivateBin into blob
This commit is contained in:
commit
2fce7bb96a
10
LICENSE.md
10
LICENSE.md
|
@ -30,6 +30,16 @@ the following restrictions:
|
||||||
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
|
### MIT license for kjua
|
||||||
|
|
||||||
|
Copyright (c) 2016 Lars Jung (https://larsjung.de)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
## GNU General Public License, version 2.0, for SJCL, rawdeflate and rawinflate
|
## GNU General Public License, version 2.0, for SJCL, rawdeflate and rawinflate
|
||||||
|
|
||||||
_Version 2, June 1991_
|
_Version 2, June 1991_
|
||||||
|
|
|
@ -441,7 +441,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) {
|
||||||
|
|
||||||
// auto-select language based on browser settings
|
// auto-select language based on browser settings
|
||||||
if (newLanguage.length === 0) {
|
if (newLanguage.length === 0) {
|
||||||
newLanguage = (navigator.language || navigator.userLanguage).substring(0, 2);
|
newLanguage = (navigator.language || navigator.userLanguage || 'en').substring(0, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if language is already used skip update
|
// if language is already used skip update
|
||||||
|
|
|
@ -99,6 +99,30 @@ describe('I18n', function () {
|
||||||
return language === result && language === alias;
|
return language === result && language === alias;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
jsc.property(
|
||||||
|
'should default to en',
|
||||||
|
function() {
|
||||||
|
var clean = jsdom('', {url: 'https://privatebin.net/'});
|
||||||
|
|
||||||
|
// when navigator.userLanguage is undefined and no default language
|
||||||
|
// is specified, it would throw an error
|
||||||
|
[ 'language', 'userLanguage' ].forEach(function (key) {
|
||||||
|
Object.defineProperty(navigator, key, {
|
||||||
|
value: undefined,
|
||||||
|
writeable: false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$.PrivateBin.I18n.reset('en');
|
||||||
|
$.PrivateBin.I18n.loadTranslations();
|
||||||
|
var result = $.PrivateBin.I18n.translate('en'),
|
||||||
|
alias = $.PrivateBin.I18n._('en');
|
||||||
|
|
||||||
|
clean();
|
||||||
|
return 'en' === result && 'en' === alias;
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ if ($MARKDOWN):
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-9HcFkJcGWfvpGHD7tTGYzBtx4TbVfR9z7oujlX2WZ2dYWVv/2QIW5eMSjpvfxUVTJVF+DHD7Ps/80qR8GcQsIg==" crossorigin="anonymous"></script>
|
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-RP/Q7x1nwpIRC2bOYlYNjOe85laGtKgKioX+h+Th0QKl01Gc2FPNrWNVtr3zJvNEpm4Oq3Ksi+av71GX3S/RBQ==" crossorigin="anonymous"></script>
|
||||||
<!--[if lt IE 10]>
|
<!--[if lt IE 10]>
|
||||||
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
|
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
|
|
@ -54,7 +54,7 @@ if ($QRCODE):
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-9HcFkJcGWfvpGHD7tTGYzBtx4TbVfR9z7oujlX2WZ2dYWVv/2QIW5eMSjpvfxUVTJVF+DHD7Ps/80qR8GcQsIg==" crossorigin="anonymous"></script>
|
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-RP/Q7x1nwpIRC2bOYlYNjOe85laGtKgKioX+h+Th0QKl01Gc2FPNrWNVtr3zJvNEpm4Oq3Ksi+av71GX3S/RBQ==" crossorigin="anonymous"></script>
|
||||||
<!--[if lt IE 10]>
|
<!--[if lt IE 10]>
|
||||||
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
|
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
|
Loading…
Reference in New Issue