Update RapydScript

This commit is contained in:
Kovid Goyal 2016-04-25 16:39:04 +05:30
parent 55960b33a4
commit 60a531283c
33 changed files with 34 additions and 5 deletions

Binary file not shown.

View File

@ -518,7 +518,7 @@ def install(translation_data):
t.install()
return t
has_prop = Object.prototype.hasOwnProperty
has_prop = Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty)
class Translations:
@ -536,14 +536,14 @@ class Translations:
def gettext(self, text):
for t in self.translations:
m = t[0]['entries']
if has_prop.call(m, text):
if has_prop(m, text):
return m[text][0]
return text
def ngettext(self, text, plural, n):
for t in self.translations:
m = t[0]['entries']
if has_prop.call(m, text):
if has_prop(m, text):
idx = t[1](n)
return m[text][idx] or (text if n is 1 else plural)
return text if n is 1 else plural

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from cfi import scroll_to, at_current, at

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from gettext import gettext as _

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
import traceback
from ajax import ajax

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
import traceback
from ajax import encode_query

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
boss = None
session_data = None

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from dom import build_rule, svgicon
from elementmaker import E

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from dom import clear
from elementmaker import E

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from ajax import ajax
from dom import clear, set_css, build_rule, svgicon

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
DARK = '#39322B'
LIGHT = '#F6F3E9'

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from book_list.theme import get_color, get_font_size
from dom import set_css, clear, create_keyframes, build_rule, svgicon

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
import traceback
from book_list.globals import get_boss, get_session_data

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
import traceback
from ajax import ajax_send

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
UNDEFINED_DATE = Date('0101-01-01T00:00:00+00:00')

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
simple_vendor_prefixes = {
'animation': v"['webkit', 'moz', 'o']",

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from pythonize import strings

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
KEYCODE_MAP = K = Object.create(None)
K[8] = 'backspace'

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from ajax import ajax, ajax_send
from elementmaker import E

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
# Based on code originally written by Peter Sorotkin
# http://code.google.com/p/epub-revision/source/browse/trunk/src/samples/cfi/epubcfi.js

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from gettext import gettext as _
from encodings import base64encode, base64decode

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from dom import set_css
from read_book.globals import get_boss

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from aes import GCM, random_bytes
from encodings import hexlify

View File

@ -1,6 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import bound_methods
from __python__ import bound_methods, hash_literals
import traceback
from aes import GCM

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from read_book.globals import iframe_id

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from dom import clear
from encodings import base64decode, utf8_decode

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
opts = {}

View File

@ -1,6 +1,7 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
# globals: __RENDER_VERSION__
from __python__ import hash_literals
import traceback
from ajax import ajax, encode_query

View File

@ -1,7 +1,7 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import bound_methods, hash_literals
from __python__ import bound_methods
from book_list.globals import get_session_data
from elementmaker import E
from gettext import gettext as _

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from ajax import ajax_send

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
import initialize # noqa: unused-import
from ajax import ajax

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
def debounce(func, wait, immediate=False):
# Returns a function, that, as long as it continues to be invoked, will not

View File

@ -1,5 +1,6 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from dom import build_rule, clear, svgicon, create_keyframes
from elementmaker import E