summaryrefslogtreecommitdiff
path: root/webhelper
Commit message (Collapse)AuthorAge
* Create a parallel version of WebHelper2 for WebKit2-3.0Philip Chimento2015-08-07
| | | | | | | | We cannot switch eos-virtual-school to WebKit2-4.0 because of regressions, but we already committed to using WebHelper2 to localize it. This adds a version of WebHelper2 that is compatible with WebKit2-3.0. [endlessm/eos-sdk#3430]
* Webhelper local:// URI schemePhilip Chimento2015-06-26
| | | | | | | | This adds a local:// URI scheme available to applications using WebHelper which behaves just like the file:// URI scheme only with fewer security restrictions. [endlessm/eos-shell#2309]
* Use ProxyConstructor asynchronouslyPhilip Chimento2015-06-18
| | | | | | | | I did not realize that the constructor returned from Gio.DBus.makeProxyWrapper did a synchronous DBus call unless you passed it a callback. It should be used asynchronously. [endlessm/eos-sdk#3296]
* Handle excess whitespace in stringsPhilip Chimento2015-06-18
| | | | | | | | | | | | Whitespace between words and tags doesn't matter to HTML. Indeed, the text in a translatable element may be formatted any way over any number of lines, so we normalize all consecutive whitespace to be just one space character and strip whitespace from the beginning and end of the strings. This is so that translators are not confronted with strange newlines and whitespace on Transifex. [endlessm/eos-sdk#3291]
* webhelper: cast ngettext() number to guint64 instead of gulongCosimo Cecchi2015-05-22
| | | | | | This fixes the test suite on my BRIX. [endlessm/eos-sdk#291]
* Export webview DBus objects when bus readyPhilip Chimento2015-05-22
| | | | | | | | | Instead of starting an idle function when a webview page is created that waits until the bus connection object is ready before exporting an object on it, we save all page IDs that we haven't registered yet and instead register them all at once when the bus is ready. [endlessm/eos-sdk#291]
* Expose ngettext() to client-side JSPhilip Chimento2015-05-21
| | | | | | | | | This exposes the function set by webhelper.set_ngettext() to the client- side Javascript as a ngettext() function, defined on the global window object. This allows apps to translate messages that need to be separated into singular and plural, just like the C ngettext() function. [endlessm/eos-sdk#291]
* Expose gettext() to client-side JSPhilip Chimento2015-05-21
| | | | | | | | | | | | | | This exposes the function set by webhelper.set_gettext() to the client- side Javascript as a gettext() function, defined on the global window object. This allows apps to translate messages that are generated at runtime, not just messages in static HTML. Some often-used JavaScriptCore operations can be turned into separate functions, which we can put in a separate source file. This is in anticipation of the next commit where we will define another function property of the global object. [endlessm/eos-sdk#291]
* Implement web actions in WebHelper2Philip Chimento2015-05-21
| | | | | | | | | | | This allows communicating with the host program through URIs of the form webhelper://action?param=value&param2=value2. Actions can be defined on the WebHelper object and given a callback in Javascript. Unfortunately we have to use a private C library to register the URI scheme, because of https://bugs.webkit.org/show_bug.cgi?id=116672 [endlessm/eos-sdk#291]
* WebHelper2 for translating WebKit2 viewsPhilip Chimento2015-05-21
| | | | | | | | | | | This adds a new Javascript module, WebHelper2. It's the WebKit2 analogue to WebHelper. It offers a facility for calling gettext() on the contents of DOM elements in your web page. It accomplishes this using an extension module that's loaded into WebKit's web process. [endlessm/eos-sdk#291]
* Move webhelper Makefile code into toplevelPhilip Chimento2015-05-20
| | | | | | In the interest of consolidating the makefiles for readability. [endlessm/eos-sdk#291]
* Enable Gjs and C coverage reports.Sam Spilsbury2015-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now provide a new m4 module eos-coverage.m4, which is installed into the system aclocal directory. This macro provides three new commands for SDK consumers to use: EOS_COVERAGE_REPORT([languages]) - Enables a "coverage report". The first argument is a space separated list of unquoted languages to collect coverage information for. Valid values at the moment are "c" and "js". For each language specified, the macro will check for support for collecting coverage and enable reporting accordingly. Raw coverage output goes in $(abs_top_builddir)/_coverage/output/$language accordingly. The macro then checks to see if a coverage reporter, either genhtml, or cobertura, is available and enables them. A reporter must be installed and available for coverage reports to be generated. The coverage-genhtml is enabled if lcov is installed and available. This is generally used by developers themselves as it creates a self-contained report. The coverage-covertura is enabled if a program called lcov-result-merger is installed and a python module called lcov_cobertura are installed. lcov-result-merger can be installed from Node Package Manager. lcov_cobertura can be installed from PyPI. lcov-result-merger is necessary because each test suite is run in a separate subprocess and so there will be multiple entries per source file in the coverage.lcov file generated by gjs. lcov_cobertura doesn't handle that properly and so the results need to be merged together properly. JavaScript Coverage Details =========================== A variable called EOS_JS_COVERAGE_FILES should be defined containing a list of all javascript files to be considered a "part of" the coverage report, before EOS_COVERAGE_RULES are substituted. For example: EOS_JS_COVERAGE_FILES = $(SRCS) @EOS_COVERAGE_RULES@ AM_JS_LOG_FLAGS += @EOS_COVERAGE_JS_LOG_FLAGS@ C/C++ Coverage Details ====================== Certain additions also need to be made for Makefiles where coverage reporting is enabled on a C project: @EOS_COVERAGE_RULES@ AM_CFLAGS += @EOS_C_COVERAGE_CFLAGS@ AM_LDFLAGS += @EOS_C_COVERAGE_LDFLAGS@ If a target's CFLAGS is overridden and AM_CFLAGS is not used, then @EOS_C_COVERAGE_CFLAGS@ must be added to its CFLAGS. Blacklisting patterns ===================== If a path should not appear in the coverage report, then it can be blacklisted by adding a glob expression to EOS_COVERAGE_BLACKLIST_PATTERNS. Clean rules =========== A clean-coverage target is added to the dependencies for the clean-local target automatically by EOS_COVERAGE_RULES. [endlessm/eos-shell#2264]
* Add publicly available font size propertyPatrick Ward2014-01-29
| | | | | | Added a publicly available calculated font size property. This allows Endless applications to perform actions based on the calculated font size of an EosWindow. In particular, the WebHelper application now uses the property to update the 'default-font-size' property of a WebSettings object. [endlessm/eos-sdk#484]
* WebHelper documentation improvementsPhilip Chimento2013-09-23
| | | | | | A few formatting improvements [endlessm/eos-sdk#310]
* Don't forget to import String.format()Philip Chimento2013-09-23
| | | | | | Previously, it wasn't imported [endlessm/eos-sdk#310]
* URIdecode web action namePhilip Chimento2013-09-23
| | | | | | | In case the name of the web action is URIencoded, make sure to URIdecode it before looking it up in the dictionary of defined web actions. [endlessm/eos-sdk#310]
* Update WebHelper API to be introspectablePhilip Chimento2013-09-23
| | | | | | | | | - Replace _webActions with define_web_action() method and another define_web_actions() method for the Endless.js overrides file - Replace _translationFunction with set_translation_function() and get_translation_function() [endlessm/eos-sdk#310]
* Documentation for WebHelperPhilip Chimento2013-09-19
| | | | | | | | This adds the infrastructure for autogenerating HTML documentation from a Javascript module using NaturalDocs, and then adds documentation comments to webhelper.js. [endlessm/eos-sdk#302]
* Do translation with webhelperPhilip Chimento2013-09-16
| | | | | | | | Previously, the translation was such that it did a dummy translation, italicizing the text to be translated. Now it looks for a translationFunction property on the app object, and calls that on the text. [endlessm/eos-sdk#290]
* Better error checking on web actionsPhilip Chimento2013-09-16
| | | | | | | - Move normal URI test to the top - Throw an exception if a nonexistent web action is called. [endlessm/eos-sdk#290]
* Adjust API so that "public" functions don't start with _Philip Chimento2013-09-16
| | | | | | | | Also, since the functions will likely be translated into C in the future, give_them_underscored_names insteadOfCamelCase, in order to avoid API changes. [endlessm/eos-sdk#290]
* Install WebHelper into GJS modules directoryPhilip Chimento2013-09-12
WebHelper is now importable using const WebHelper = imports.webhelper; [endlessm/eos-sdk#289]