From 91c37bbb7642b996e4c386b3033cca02831371ef Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Mon, 20 Jun 2011 20:29:30 +0200 Subject: moved core stuff to /core --- core/js/js.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 core/js/js.js (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js new file mode 100644 index 00000000000..7e44b7ce6d5 --- /dev/null +++ b/core/js/js.js @@ -0,0 +1,23 @@ +var _l10ncache = {}; +function t(app,text){ + if( !( app in _l10ncache )){ + $.post( oc_webroot+'/l10n/javascript.php', {'app': app}, function(jsondata){ + _l10ncache[app] = jsondata.data; + }); + + // Bad answer ... + if( !( app in _l10ncache )){ + _l10ncache[app] = []; + } + } + if( typeof( _l10ncache[app][text] ) !== 'undefined' ){ + return _l10ncache[app][text]; + } + else{ + return text; + } +} + +$(document).ready(function(){ + // Put fancy stuff in here +}); -- cgit v1.2.3