From d421c1321beb4f6d508368af7cbd298b2bbcce5e Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Tue, 22 Nov 2011 23:30:42 -0600 Subject: [PATCH] initial commit --- ABOUT | 6 + Introduction | 0 LICENSE | 137 + MANIFEST.in | 1 + Makefile | 123 + NEWINSTALL | 1 + README | 1178 +++ TODO | 3 + VERSION | 1 + __init__.py | 3 + anyserver.py | 300 + app.example.yaml | 86 + appengine_config.py | 5 + applications/admin/ABOUT | 6 + applications/admin/LICENSE | 137 + applications/admin/__init__.py | 0 applications/admin/controllers/appadmin.py | 430 + applications/admin/controllers/debug.py | 33 + applications/admin/controllers/default.py | 1329 +++ applications/admin/controllers/gae.py | 87 + applications/admin/controllers/mercurial.py | 82 + applications/admin/controllers/shell.py | 45 + applications/admin/controllers/toolbar.py | 29 + applications/admin/controllers/wizard.py | 551 ++ applications/admin/cron/crontab | 1 + applications/admin/cron/expire_sessions.py | 21 + applications/admin/languages/af.py | 87 + applications/admin/languages/bg-bg.py | 277 + applications/admin/languages/de-de.py | 341 + applications/admin/languages/es-es.py | 282 + applications/admin/languages/fr-fr.py | 279 + applications/admin/languages/he.py | 270 + applications/admin/languages/it-it.py | 264 + applications/admin/languages/it.py | 266 + applications/admin/languages/pl-pl.py | 262 + applications/admin/languages/pl.py | 277 + applications/admin/languages/pt-br.py | 320 + applications/admin/languages/zh-cn.py | 290 + applications/admin/languages/zh-tw.py | 302 + applications/admin/models/0.py | 65 + applications/admin/models/0_imports.py | 26 + applications/admin/models/access.py | 146 + applications/admin/models/buttons.py | 23 + applications/admin/models/db.py | 40 + applications/admin/models/menu.py | 33 + .../admin/models/plugin_multiselect.py | 4 + applications/admin/modules/__init__.py | 0 applications/admin/static/css/anytime.css | 56 + .../admin/static/css/jqueryMultiSelect.css | 47 + applications/admin/static/css/styles.css | 1065 +++ .../admin/static/eamy/bundle_markup.js | 389 + .../admin/static/eamy/bundle_python.js | 296 + .../admin/static/eamy/chap-bg-sidebar.gif | Bin 0 -> 300 bytes .../static/eamy/chap-bookmark-default.gif | Bin 0 -> 186 bytes .../static/eamy/chap-folding-expand-inner.gif | Bin 0 -> 119 bytes .../admin/static/eamy/chap-folding-expand.gif | Bin 0 -> 319 bytes .../admin/static/eamy/chap-folding-start.gif | Bin 0 -> 204 bytes .../admin/static/eamy/chap-folding-stop.gif | Bin 0 -> 204 bytes .../admin/static/eamy/chap-wrapped-row.gif | Bin 0 -> 92 bytes applications/admin/static/eamy/eamy.js | 8143 +++++++++++++++++ applications/admin/static/eamy/style.css | 56 + applications/admin/static/eamy/void.gif | Bin 0 -> 55 bytes .../admin/static/edit_area/autocompletion.js | 491 + .../admin/static/edit_area/edit_area.css | 530 ++ .../admin/static/edit_area/edit_area.js | 527 ++ .../static/edit_area/edit_area_compressor.php | 428 + .../admin/static/edit_area/edit_area_full.gz | Bin 0 -> 29377 bytes .../admin/static/edit_area/edit_area_full.js | 38 + .../edit_area/edit_area_full_with_plugins.js | 39 + .../static/edit_area/edit_area_functions.js | 1202 +++ .../static/edit_area/edit_area_loader.js | 1081 +++ .../static/edit_area/elements_functions.js | 336 + .../admin/static/edit_area/highlight.js | 407 + .../edit_area/images/autocompletion.gif | Bin 0 -> 359 bytes .../admin/static/edit_area/images/close.gif | Bin 0 -> 102 bytes .../static/edit_area/images/fullscreen.gif | Bin 0 -> 198 bytes .../static/edit_area/images/go_to_line.gif | Bin 0 -> 1053 bytes .../admin/static/edit_area/images/help.gif | Bin 0 -> 295 bytes .../static/edit_area/images/highlight.gif | Bin 0 -> 256 bytes .../admin/static/edit_area/images/load.gif | Bin 0 -> 1041 bytes .../admin/static/edit_area/images/move.gif | Bin 0 -> 257 bytes .../static/edit_area/images/newdocument.gif | Bin 0 -> 170 bytes .../admin/static/edit_area/images/opacity.png | Bin 0 -> 147 bytes .../static/edit_area/images/processing.gif | Bin 0 -> 825 bytes .../admin/static/edit_area/images/redo.gif | Bin 0 -> 169 bytes .../edit_area/images/reset_highlight.gif | Bin 0 -> 168 bytes .../admin/static/edit_area/images/save.gif | Bin 0 -> 285 bytes .../admin/static/edit_area/images/search.gif | Bin 0 -> 191 bytes .../edit_area/images/smooth_selection.gif | Bin 0 -> 174 bytes .../admin/static/edit_area/images/spacer.gif | Bin 0 -> 43 bytes .../edit_area/images/statusbar_resize.gif | Bin 0 -> 79 bytes .../admin/static/edit_area/images/undo.gif | Bin 0 -> 175 bytes .../static/edit_area/images/word_wrap.gif | Bin 0 -> 951 bytes .../admin/static/edit_area/keyboard.js | 145 + .../admin/static/edit_area/langs/bg.js | 54 + .../admin/static/edit_area/langs/cs.js | 48 + .../admin/static/edit_area/langs/de.js | 48 + .../admin/static/edit_area/langs/dk.js | 48 + .../admin/static/edit_area/langs/en.js | 48 + .../admin/static/edit_area/langs/eo.js | 48 + .../admin/static/edit_area/langs/es.js | 48 + .../admin/static/edit_area/langs/fi.js | 48 + .../admin/static/edit_area/langs/fr.js | 48 + .../admin/static/edit_area/langs/hr.js | 48 + .../admin/static/edit_area/langs/it.js | 48 + .../admin/static/edit_area/langs/ja.js | 48 + .../admin/static/edit_area/langs/mk.js | 48 + .../admin/static/edit_area/langs/nl.js | 48 + .../admin/static/edit_area/langs/pl.js | 48 + .../admin/static/edit_area/langs/pt.js | 48 + .../admin/static/edit_area/langs/ru.js | 48 + .../admin/static/edit_area/langs/sk.js | 48 + .../admin/static/edit_area/langs/zh.js | 48 + .../admin/static/edit_area/license.txt | 0 .../admin/static/edit_area/license_apache.txt | 7 + .../admin/static/edit_area/license_bsd.txt | 10 + .../admin/static/edit_area/license_lgpl.txt | 458 + .../admin/static/edit_area/manage_area.js | 623 ++ .../edit_area/plugins/charmap/charmap.js | 90 + .../edit_area/plugins/charmap/css/charmap.css | 64 + .../plugins/charmap/images/charmap.gif | Bin 0 -> 245 bytes .../edit_area/plugins/charmap/jscripts/map.js | 373 + .../edit_area/plugins/charmap/langs/bg.js | 12 + .../edit_area/plugins/charmap/langs/cs.js | 6 + .../edit_area/plugins/charmap/langs/de.js | 6 + .../edit_area/plugins/charmap/langs/dk.js | 6 + .../edit_area/plugins/charmap/langs/en.js | 6 + .../edit_area/plugins/charmap/langs/eo.js | 6 + .../edit_area/plugins/charmap/langs/es.js | 6 + .../edit_area/plugins/charmap/langs/fr.js | 6 + .../edit_area/plugins/charmap/langs/hr.js | 6 + .../edit_area/plugins/charmap/langs/it.js | 6 + .../edit_area/plugins/charmap/langs/ja.js | 6 + .../edit_area/plugins/charmap/langs/mk.js | 6 + .../edit_area/plugins/charmap/langs/nl.js | 6 + .../edit_area/plugins/charmap/langs/pl.js | 6 + .../edit_area/plugins/charmap/langs/pt.js | 6 + .../edit_area/plugins/charmap/langs/ru.js | 6 + .../edit_area/plugins/charmap/langs/sk.js | 6 + .../edit_area/plugins/charmap/langs/zh.js | 6 + .../edit_area/plugins/charmap/popup.html | 24 + .../edit_area/plugins/test/css/test.css | 3 + .../edit_area/plugins/test/images/test.gif | Bin 0 -> 87 bytes .../static/edit_area/plugins/test/langs/bg.js | 10 + .../static/edit_area/plugins/test/langs/cs.js | 4 + .../static/edit_area/plugins/test/langs/de.js | 4 + .../static/edit_area/plugins/test/langs/dk.js | 4 + .../static/edit_area/plugins/test/langs/en.js | 4 + .../static/edit_area/plugins/test/langs/eo.js | 4 + .../static/edit_area/plugins/test/langs/es.js | 4 + .../static/edit_area/plugins/test/langs/fr.js | 4 + .../static/edit_area/plugins/test/langs/hr.js | 4 + .../static/edit_area/plugins/test/langs/it.js | 4 + .../static/edit_area/plugins/test/langs/ja.js | 4 + .../static/edit_area/plugins/test/langs/mk.js | 4 + .../static/edit_area/plugins/test/langs/nl.js | 4 + .../static/edit_area/plugins/test/langs/pl.js | 4 + .../static/edit_area/plugins/test/langs/pt.js | 4 + .../static/edit_area/plugins/test/langs/ru.js | 4 + .../static/edit_area/plugins/test/langs/sk.js | 4 + .../static/edit_area/plugins/test/langs/zh.js | 4 + .../static/edit_area/plugins/test/test.js | 110 + .../static/edit_area/plugins/test/test2.js | 1 + .../edit_area/plugins/zencoding/core.js | 4 + .../edit_area/plugins/zencoding/langs/en.js | 4 + .../edit_area/plugins/zencoding/zencoding.js | 420 + .../admin/static/edit_area/reg_syntax.js | 166 + .../static/edit_area/reg_syntax/basic.js | 70 + .../static/edit_area/reg_syntax/brainfuck.js | 45 + .../admin/static/edit_area/reg_syntax/c.js | 63 + .../static/edit_area/reg_syntax/coldfusion.js | 120 + .../admin/static/edit_area/reg_syntax/cpp.js | 66 + .../admin/static/edit_area/reg_syntax/css.js | 85 + .../admin/static/edit_area/reg_syntax/html.js | 51 + .../admin/static/edit_area/reg_syntax/java.js | 57 + .../admin/static/edit_area/reg_syntax/js.js | 94 + .../admin/static/edit_area/reg_syntax/pas.js | 83 + .../admin/static/edit_area/reg_syntax/perl.js | 88 + .../admin/static/edit_area/reg_syntax/php.js | 157 + .../static/edit_area/reg_syntax/python.js | 145 + .../static/edit_area/reg_syntax/robotstxt.js | 25 + .../admin/static/edit_area/reg_syntax/ruby.js | 68 + .../admin/static/edit_area/reg_syntax/sql.js | 56 + .../admin/static/edit_area/reg_syntax/tsql.js | 88 + .../admin/static/edit_area/reg_syntax/vb.js | 53 + .../admin/static/edit_area/reg_syntax/xml.js | 57 + applications/admin/static/edit_area/regexp.js | 139 + .../admin/static/edit_area/resize_area.js | 73 + .../admin/static/edit_area/search_replace.js | 174 + .../admin/static/edit_area/template.html | 100 + .../admin/static/images/delete_icon.png | Bin 0 -> 855 bytes .../admin/static/images/dim_bullet.gif | Bin 0 -> 424 bytes applications/admin/static/images/embossed.png | Bin 0 -> 310 bytes applications/admin/static/images/folder.png | Bin 0 -> 823 bytes .../admin/static/images/folder_locked.png | Bin 0 -> 932 bytes .../admin/static/images/folder_sm.png | Bin 0 -> 764 bytes .../admin/static/images/header_bg.png | Bin 0 -> 149 bytes .../admin/static/images/header_shadow.png | Bin 0 -> 143 bytes applications/admin/static/images/help.png | Bin 0 -> 450 bytes applications/admin/static/images/menu.png | Bin 0 -> 1395 bytes .../admin/static/images/red_bullet.gif | Bin 0 -> 630 bytes .../admin/static/images/save_icon.png | Bin 0 -> 762 bytes applications/admin/static/images/search.png | Bin 0 -> 688 bytes .../admin/static/images/section_bullet.png | Bin 0 -> 718 bytes .../static/images/sidebar_background.jpg | Bin 0 -> 430 bytes .../admin/static/images/sidebar_bullet.gif | Bin 0 -> 426 bytes .../admin/static/images/sidebar_bullet.png | Bin 0 -> 718 bytes .../admin/static/images/small_button.png | Bin 0 -> 1371 bytes .../static/images/small_special_button.png | Bin 0 -> 1398 bytes applications/admin/static/images/spinner.gif | Bin 0 -> 158630 bytes applications/admin/static/images/start.png | Bin 0 -> 5498 bytes .../admin/static/images/test_icon.png | Bin 0 -> 879 bytes .../admin/static/images/ticket_section.png | Bin 0 -> 718 bytes applications/admin/static/js/ajax_editor.js | 104 + applications/admin/static/js/anytime.js | 790 ++ applications/admin/static/js/autoscroll.js | 62 + .../admin/static/js/jquery.hotkeys.js | 244 + applications/admin/static/js/jquery.js | 4 + .../admin/static/js/jquery.timeentry.js | 570 ++ .../admin/static/js/jqueryMultiSelect.js | 270 + applications/admin/static/js/web2py.js | 109 + .../plugin_multiselect/jquery.dimensions.js | 12 + .../plugin_multiselect/jquery.multiselect.css | 25 + .../plugin_multiselect/jquery.multiselect.js | 24 + .../admin/static/plugin_multiselect/start.js | 1 + applications/admin/views/appadmin.html | 233 + applications/admin/views/debug/index.html | 159 + applications/admin/views/default/about.html | 12 + .../admin/views/default/amy_ajax.html | 76 + .../admin/views/default/change_password.html | 9 + applications/admin/views/default/delete.html | 8 + .../admin/views/default/delete_plugin.html | 9 + applications/admin/views/default/design.html | 313 + .../admin/views/default/downgrade_web2py.html | 13 + applications/admin/views/default/edit.html | 92 + .../admin/views/default/edit_language.html | 18 + applications/admin/views/default/errors.html | 133 + applications/admin/views/default/index.html | 21 + applications/admin/views/default/peek.html | 16 + applications/admin/views/default/plugin.html | 221 + applications/admin/views/default/resolve.html | 24 + applications/admin/views/default/site.html | 158 + applications/admin/views/default/test.html | 20 + applications/admin/views/default/ticket.html | 132 + applications/admin/views/default/ticket.load | 130 + .../admin/views/default/uninstall.html | 9 + .../admin/views/default/upgrade_web2py.html | 13 + applications/admin/views/default/user.html | 19 + applications/admin/views/gae/deploy.html | 30 + applications/admin/views/generic.html | 18 + applications/admin/views/layout.html | 44 + .../admin/views/mercurial/commit.html | 33 + .../admin/views/mercurial/revision.html | 17 + applications/admin/views/shell/index.html | 165 + applications/admin/views/toolbar/index.html | 17 + applications/admin/views/web2py_ajax.html | 14 + .../admin/views/wizard/generated.html | 13 + applications/admin/views/wizard/step.html | 140 + applications/welcome/ABOUT | 2 + applications/welcome/LICENSE | 4 + applications/welcome/__init__.py | 0 applications/welcome/controllers/appadmin.py | 430 + applications/welcome/controllers/default.py | 70 + applications/welcome/cron/crontab | 1 + applications/welcome/languages/cs-cz.py | 131 + applications/welcome/languages/es-es.py | 259 + applications/welcome/languages/fr-ca.py | 167 + applications/welcome/languages/fr-fr.py | 155 + applications/welcome/languages/hi-hi.py | 82 + applications/welcome/languages/hu-hu.py | 93 + applications/welcome/languages/hu.py | 93 + applications/welcome/languages/it-it.py | 107 + applications/welcome/languages/it.py | 107 + applications/welcome/languages/pl-pl.py | 81 + applications/welcome/languages/pl.py | 104 + applications/welcome/languages/pt-br.py | 142 + applications/welcome/languages/pt-pt.py | 116 + applications/welcome/languages/pt.py | 116 + applications/welcome/languages/ru-ru.py | 96 + applications/welcome/languages/sk-sk.py | 111 + applications/welcome/languages/zh-tw.py | 165 + applications/welcome/models/db.py | 76 + applications/welcome/models/menu.py | 101 + applications/welcome/modules/__init__.py | 0 applications/welcome/private/auth.key | 1 + applications/welcome/static/css/anytime.css | 56 + applications/welcome/static/css/skeleton.css | 628 ++ applications/welcome/static/css/superfish.css | 151 + applications/welcome/static/css/web2py.css | 347 + applications/welcome/static/favicon.ico | Bin 0 -> 198 bytes applications/welcome/static/favicon.png | Bin 0 -> 323 bytes .../welcome/static/images/arrows-ffffff.png | Bin 0 -> 244 bytes .../static/images/css3buttons_backgrounds.png | Bin 0 -> 1367 bytes .../static/images/css3buttons_icons.png | Bin 0 -> 3322 bytes .../welcome/static/images/poweredby.png | Bin 0 -> 4150 bytes applications/welcome/static/images/shadow.png | Bin 0 -> 1698 bytes .../static/images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes applications/welcome/static/js/anytime.js | 790 ++ .../welcome/static/js/dd_belatedpng.js | 13 + applications/welcome/static/js/jquery.js | 4 + .../welcome/static/js/modernizr.custom.js | 4 + applications/welcome/static/js/superfish.js | 222 + applications/welcome/static/js/web2py.js | 109 + applications/welcome/static/robots.txt | 2 + applications/welcome/views/__init__.py | 0 applications/welcome/views/appadmin.html | 233 + applications/welcome/views/default/index.html | 31 + applications/welcome/views/default/user.html | 18 + applications/welcome/views/generic.html | 16 + applications/welcome/views/generic.json | 1 + applications/welcome/views/generic.jsonp | 16 + applications/welcome/views/generic.load | 30 + applications/welcome/views/generic.pdf | 11 + applications/welcome/views/generic.rss | 10 + applications/welcome/views/generic.xml | 1 + applications/welcome/views/layout.html | 163 + applications/welcome/views/web2py_ajax.html | 14 + cgihandler.py | 21 + doc/Makefile | 88 + doc/convert_faq.py | 42 + doc/generate_modules.py | 258 + doc/make-doc_html.bat | 3 + doc/make-doc_html.sh | 3 + doc/make.bat | 112 + doc/problematic_files.rst | 7 + doc/source/_static/pics/logo.png | Bin 0 -> 41466 bytes doc/source/_static/pics/logo_colored.png | Bin 0 -> 15988 bytes .../_static/pics/logo_colored_small.png | Bin 0 -> 17766 bytes doc/source/_static/pics/logo_small.jpg | Bin 0 -> 13421 bytes doc/source/_static/pics/logo_small.png | Bin 0 -> 17390 bytes doc/source/_static/rst/external_hint.txt | 22 + doc/source/conf.py | 251 + doc/source/docs_contrib.rst | 100 + doc/source/faq.rst | 9 + doc/source/glossary.rst | 15 + doc/source/gluon/gluon.compat.rst | 13 + doc/source/gluon/gluon.contrib.gateways.rst | 13 + doc/source/gluon/gluon.contrib.markdown.rst | 21 + doc/source/gluon/gluon.contrib.memcache.rst | 21 + doc/source/gluon/gluon.contrib.pyrtf.rst | 53 + doc/source/gluon/gluon.contrib.rst | 80 + doc/source/gluon/gluon.contrib.simplejson.rst | 37 + doc/source/gluon/gluon.rst | 220 + doc/source/index.rst | 91 + doc/source/modules.rst | 10 + doc/source/user_wiki.rst | 6 + doc/source/web2py_todo.rst | 28 + doc/sphinxext/local/generate_modules.py | 258 + doc/sphinxext/local/generate_modules_modif.py | 271 + doc/sphinxext/local/sphinx_tools.py | 87 + doc/sphinxext/numpydoc/LICENSE.txt | 97 + doc/sphinxext/numpydoc/MANIFEST.in | 2 + doc/sphinxext/numpydoc/__init__.py | 1 + doc/sphinxext/numpydoc/autosummary.py | 349 + .../numpydoc/autosummary_generate.py | 219 + doc/sphinxext/numpydoc/comment_eater.py | 158 + doc/sphinxext/numpydoc/compiler_unparse.py | 860 ++ doc/sphinxext/numpydoc/docscrape.py | 497 + doc/sphinxext/numpydoc/docscrape_sphinx.py | 149 + doc/sphinxext/numpydoc/numpydoc.py | 117 + doc/sphinxext/numpydoc/only_directives.py | 96 + doc/sphinxext/numpydoc/phantom_import.py | 162 + doc/sphinxext/numpydoc/plot_directive.py | 477 + doc/sphinxext/numpydoc/setup.py | 31 + .../numpydoc/tests/test_docscrape.py | 490 + epydoc.conf | 150 + epydoc.css | 410 + fcgihandler.py | 54 + gaehandler.py | 98 + gluon/__init__.py | 25 + gluon/admin.py | 455 + gluon/cache.py | 432 + gluon/cfs.py | 53 + gluon/compileapp.py | 573 ++ gluon/contenttype.py | 721 ++ gluon/contrib/AuthorizeNet.py | 261 + gluon/contrib/DowCommerce.py | 242 + gluon/contrib/__init__.py | 3 + gluon/contrib/comet_messaging.py | 192 + gluon/contrib/feedparser.py | 3908 ++++++++ gluon/contrib/gae_memcache.py | 53 + gluon/contrib/gae_retry.py | 88 + gluon/contrib/gateways/__init__.py | 2 + gluon/contrib/gateways/fcgi.py | 1332 +++ gluon/contrib/generics.py | 65 + gluon/contrib/google_wallet.py | 17 + gluon/contrib/gql.py | 7 + gluon/contrib/login_methods/__init__.py | 2 + gluon/contrib/login_methods/basic_auth.py | 25 + gluon/contrib/login_methods/cas_auth.py | 132 + .../contrib/login_methods/dropbox_account.py | 109 + gluon/contrib/login_methods/email_auth.py | 45 + .../login_methods/extended_login_form.py | 103 + .../login_methods/gae_google_account.py | 38 + gluon/contrib/login_methods/ldap_auth.py | 177 + .../contrib/login_methods/linkedin_account.py | 51 + gluon/contrib/login_methods/loginza.py | 112 + .../contrib/login_methods/oauth10a_account.py | 190 + .../contrib/login_methods/oauth20_account.py | 207 + gluon/contrib/login_methods/openid_auth.py | 632 ++ gluon/contrib/login_methods/pam_auth.py | 14 + gluon/contrib/login_methods/rpx_account.py | 127 + gluon/contrib/login_methods/x509_auth.py | 104 + gluon/contrib/markdown/LICENSE | 1 + gluon/contrib/markdown/__init__.py | 17 + gluon/contrib/markdown/markdown2.py | 1890 ++++ gluon/contrib/markmin/__init__.py | 2 + gluon/contrib/markmin/markmin.html | 35 + gluon/contrib/markmin/markmin.pdf | Bin 0 -> 116299 bytes gluon/contrib/markmin/markmin2html.py | 463 + gluon/contrib/markmin/markmin2latex.py | 285 + gluon/contrib/markmin/markmin2pdf.py | 130 + gluon/contrib/memcache/ChangeLog | 255 + gluon/contrib/memcache/PKG-INFO | 10 + gluon/contrib/memcache/README | 7 + gluon/contrib/memcache/__init__.py | 89 + gluon/contrib/memcache/memcache.py | 1153 +++ gluon/contrib/memdb.py | 908 ++ gluon/contrib/minify/__init__.py | 0 gluon/contrib/minify/cssmin.py | 230 + gluon/contrib/minify/jsmin.py | 374 + gluon/contrib/minify/minify.py | 112 + gluon/contrib/pam.py | 125 + gluon/contrib/populate.py | 166 + gluon/contrib/pyfpdf/README | 1 + gluon/contrib/pyfpdf/__init__.py | 5 + gluon/contrib/pyfpdf/designer.py | 736 ++ gluon/contrib/pyfpdf/fpdf.py | 1687 ++++ gluon/contrib/pyfpdf/html.py | 459 + gluon/contrib/pyfpdf/template.py | 278 + gluon/contrib/pymysql/LICENSE | 19 + gluon/contrib/pymysql/README | 37 + gluon/contrib/pymysql/__init__.py | 132 + gluon/contrib/pymysql/charset.py | 175 + gluon/contrib/pymysql/connections.py | 933 ++ gluon/contrib/pymysql/constants/CLIENT.py | 20 + gluon/contrib/pymysql/constants/COMMAND.py | 23 + gluon/contrib/pymysql/constants/ER.py | 472 + gluon/contrib/pymysql/constants/FIELD_TYPE.py | 32 + gluon/contrib/pymysql/constants/FLAG.py | 15 + .../pymysql/constants/SERVER_STATUS.py | 12 + gluon/contrib/pymysql/constants/__init__.py | 0 gluon/contrib/pymysql/converters.py | 347 + gluon/contrib/pymysql/cursors.py | 251 + gluon/contrib/pymysql/err.py | 141 + gluon/contrib/pymysql/tests/__init__.py | 7 + gluon/contrib/pymysql/tests/base.py | 19 + gluon/contrib/pymysql/tests/test_basic.py | 141 + gluon/contrib/pymysql/tests/test_example.py | 32 + gluon/contrib/pymysql/tests/test_issues.py | 240 + gluon/contrib/pymysql/times.py | 17 + gluon/contrib/pymysql/util.py | 20 + gluon/contrib/pyrtf/Constants.py | 158 + gluon/contrib/pyrtf/Elements.py | 757 ++ gluon/contrib/pyrtf/PropertySets.py | 489 + gluon/contrib/pyrtf/README | 19 + gluon/contrib/pyrtf/Renderer.py | 639 ++ gluon/contrib/pyrtf/Styles.py | 94 + gluon/contrib/pyrtf/__init__.py | 12 + gluon/contrib/pysimplesoap/__init__.py | 4 + gluon/contrib/pysimplesoap/client.py | 689 ++ gluon/contrib/pysimplesoap/server.py | 455 + gluon/contrib/pysimplesoap/simplexml.py | 416 + gluon/contrib/redis_cache.py | 126 + gluon/contrib/rss2.py | 590 ++ gluon/contrib/shell.py | 268 + gluon/contrib/simplejson/LICENSE.txt | 19 + gluon/contrib/simplejson/__init__.py | 440 + gluon/contrib/simplejson/decoder.py | 423 + gluon/contrib/simplejson/encoder.py | 503 + gluon/contrib/simplejson/ordered_dict.py | 120 + gluon/contrib/simplejson/scanner.py | 79 + gluon/contrib/simplejson/tool.py | 43 + gluon/contrib/simplejsonrpc.py | 147 + gluon/contrib/sms_utils.py | 114 + gluon/contrib/spreadsheet.py | 264 + gluon/contrib/stripe.py | 64 + gluon/contrib/taskbar_widget.py | 245 + gluon/contrib/user_agent_parser.py | 401 + gluon/custom_import.py | 327 + gluon/dal.py | 6416 +++++++++++++ gluon/debug.py | 87 + gluon/decoder.py | 77 + gluon/fileutils.py | 399 + gluon/globals.py | 602 ++ gluon/highlight.py | 338 + gluon/html.py | 2304 +++++ gluon/http.py | 131 + gluon/import_all.py | 112 + gluon/languages.py | 356 + gluon/main.py | 832 ++ gluon/myregex.py | 31 + gluon/newcron.py | 315 + gluon/portalocker.py | 127 + gluon/reserved_sql_keywords.py | 1716 ++++ gluon/restricted.py | 305 + gluon/rewrite.py | 1248 +++ gluon/rocket.py | 2076 +++++ gluon/rocket.py.footer | 48 + gluon/sanitizer.py | 227 + gluon/scheduler.py | 547 ++ gluon/serializers.py | 88 + gluon/settings.py | 13 + gluon/shell.py | 421 + gluon/sql.py | 8 + gluon/sqlhtml.py | 2252 +++++ gluon/storage.py | 226 + gluon/streamer.py | 111 + gluon/template.py | 933 ++ gluon/tests/__init__.py | 1 + gluon/tests/test.sh | 45 + gluon/tests/test_cache.py | 72 + gluon/tests/test_dal.py | 486 + gluon/tests/test_html.py | 122 + gluon/tests/test_is_url.py | 644 ++ gluon/tests/test_router.py | 872 ++ gluon/tests/test_routes.py | 363 + gluon/tests/test_storage.py | 78 + gluon/tests/test_template.py | 60 + gluon/tests/test_utils.py | 27 + gluon/tools.py | 4075 +++++++++ gluon/utils.py | 129 + gluon/validators.py | 2980 ++++++ gluon/widget.py | 984 ++ gluon/winservice.py | 166 + gluon/xmlrpc.py | 24 + isapiwsgihandler.py | 36 + logging.example.conf | 121 + modpythonhandler.py | 225 + options_std.py | 34 + queue.example.yaml | 8 + router.example.py | 202 + routes.example.py | 166 + scgihandler.py | 71 + scripts/access.wsgi | 65 + scripts/autoroutes.py | 141 + scripts/cleancss.py | 33 + scripts/cleanhtml.py | 61 + scripts/cleanjs.py | 17 + scripts/contentparser.py | 132 + scripts/cpdb.py | 682 ++ scripts/cpplugin.py | 26 + scripts/dbsessions2trash.py | 26 + scripts/dict_diff.py | 121 + scripts/extract_mysql_models.py | 107 + scripts/extract_pgsql_models.py | 284 + scripts/fixws.py | 24 + scripts/layout_make.py | 99 + scripts/make_min_web2py.py | 79 + scripts/nginx_scgi.conf | 115 + scripts/sessions2trash.py | 222 + scripts/setup-shared-hosting-2.4.sh | 12 + scripts/setup-virtualenv-web2py.sh | 101 + scripts/setup-web2py-fedora.sh | 409 + scripts/setup-web2py-nginx-uwsgi-ubuntu.sh | 81 + scripts/setup-web2py-ubuntu.sh | 169 + scripts/standalone_exe_cxfreeze.py | 64 + scripts/sync_languages.py | 47 + scripts/tickets2db.py | 51 + scripts/tickets2email.py | 51 + scripts/update-web2py.sh | 59 + scripts/update_web2py.py | 33 + scripts/web2py-lock.sh | 11 + scripts/web2py.archlinux.sh | 44 + scripts/web2py.fedora.sh | 82 + scripts/web2py.ubuntu.sh | 223 + setup.py | 80 + setup_app.py | 55 + setup_exe.conf | 24 + setup_exe.py | 185 + setup_exe_2.6.py | 167 + site-packages/__init__.py | 1 + splashlogo.gif | Bin 0 -> 9093 bytes w2p_apps | 27 + w2p_clone | 55 + w2p_run | 24 + web2py.icns | Bin 0 -> 39379 bytes web2py.ico | Bin 0 -> 113846 bytes web2py.py | 21 + wsgihandler.py | 45 + 580 files changed, 115527 insertions(+) create mode 100644 ABOUT create mode 100644 Introduction create mode 100644 LICENSE create mode 100644 MANIFEST.in create mode 100644 Makefile create mode 100644 NEWINSTALL create mode 100644 README create mode 100644 TODO create mode 100644 VERSION create mode 100644 __init__.py create mode 100644 anyserver.py create mode 100644 app.example.yaml create mode 100644 appengine_config.py create mode 100644 applications/admin/ABOUT create mode 100644 applications/admin/LICENSE create mode 100644 applications/admin/__init__.py create mode 100644 applications/admin/controllers/appadmin.py create mode 100644 applications/admin/controllers/debug.py create mode 100644 applications/admin/controllers/default.py create mode 100644 applications/admin/controllers/gae.py create mode 100644 applications/admin/controllers/mercurial.py create mode 100644 applications/admin/controllers/shell.py create mode 100644 applications/admin/controllers/toolbar.py create mode 100644 applications/admin/controllers/wizard.py create mode 100644 applications/admin/cron/crontab create mode 100644 applications/admin/cron/expire_sessions.py create mode 100644 applications/admin/languages/af.py create mode 100644 applications/admin/languages/bg-bg.py create mode 100644 applications/admin/languages/de-de.py create mode 100644 applications/admin/languages/es-es.py create mode 100644 applications/admin/languages/fr-fr.py create mode 100644 applications/admin/languages/he.py create mode 100644 applications/admin/languages/it-it.py create mode 100644 applications/admin/languages/it.py create mode 100644 applications/admin/languages/pl-pl.py create mode 100644 applications/admin/languages/pl.py create mode 100644 applications/admin/languages/pt-br.py create mode 100644 applications/admin/languages/zh-cn.py create mode 100644 applications/admin/languages/zh-tw.py create mode 100644 applications/admin/models/0.py create mode 100644 applications/admin/models/0_imports.py create mode 100644 applications/admin/models/access.py create mode 100644 applications/admin/models/buttons.py create mode 100644 applications/admin/models/db.py create mode 100644 applications/admin/models/menu.py create mode 100644 applications/admin/models/plugin_multiselect.py create mode 100644 applications/admin/modules/__init__.py create mode 100644 applications/admin/static/css/anytime.css create mode 100755 applications/admin/static/css/jqueryMultiSelect.css create mode 100644 applications/admin/static/css/styles.css create mode 100644 applications/admin/static/eamy/bundle_markup.js create mode 100644 applications/admin/static/eamy/bundle_python.js create mode 100755 applications/admin/static/eamy/chap-bg-sidebar.gif create mode 100755 applications/admin/static/eamy/chap-bookmark-default.gif create mode 100755 applications/admin/static/eamy/chap-folding-expand-inner.gif create mode 100755 applications/admin/static/eamy/chap-folding-expand.gif create mode 100755 applications/admin/static/eamy/chap-folding-start.gif create mode 100755 applications/admin/static/eamy/chap-folding-stop.gif create mode 100755 applications/admin/static/eamy/chap-wrapped-row.gif create mode 100644 applications/admin/static/eamy/eamy.js create mode 100644 applications/admin/static/eamy/style.css create mode 100755 applications/admin/static/eamy/void.gif create mode 100755 applications/admin/static/edit_area/autocompletion.js create mode 100755 applications/admin/static/edit_area/edit_area.css create mode 100755 applications/admin/static/edit_area/edit_area.js create mode 100755 applications/admin/static/edit_area/edit_area_compressor.php create mode 100755 applications/admin/static/edit_area/edit_area_full.gz create mode 100755 applications/admin/static/edit_area/edit_area_full.js create mode 100755 applications/admin/static/edit_area/edit_area_full_with_plugins.js create mode 100755 applications/admin/static/edit_area/edit_area_functions.js create mode 100755 applications/admin/static/edit_area/edit_area_loader.js create mode 100755 applications/admin/static/edit_area/elements_functions.js create mode 100755 applications/admin/static/edit_area/highlight.js create mode 100755 applications/admin/static/edit_area/images/autocompletion.gif create mode 100755 applications/admin/static/edit_area/images/close.gif create mode 100755 applications/admin/static/edit_area/images/fullscreen.gif create mode 100755 applications/admin/static/edit_area/images/go_to_line.gif create mode 100755 applications/admin/static/edit_area/images/help.gif create mode 100755 applications/admin/static/edit_area/images/highlight.gif create mode 100755 applications/admin/static/edit_area/images/load.gif create mode 100755 applications/admin/static/edit_area/images/move.gif create mode 100755 applications/admin/static/edit_area/images/newdocument.gif create mode 100755 applications/admin/static/edit_area/images/opacity.png create mode 100755 applications/admin/static/edit_area/images/processing.gif create mode 100755 applications/admin/static/edit_area/images/redo.gif create mode 100755 applications/admin/static/edit_area/images/reset_highlight.gif create mode 100755 applications/admin/static/edit_area/images/save.gif create mode 100755 applications/admin/static/edit_area/images/search.gif create mode 100755 applications/admin/static/edit_area/images/smooth_selection.gif create mode 100755 applications/admin/static/edit_area/images/spacer.gif create mode 100755 applications/admin/static/edit_area/images/statusbar_resize.gif create mode 100755 applications/admin/static/edit_area/images/undo.gif create mode 100755 applications/admin/static/edit_area/images/word_wrap.gif create mode 100755 applications/admin/static/edit_area/keyboard.js create mode 100755 applications/admin/static/edit_area/langs/bg.js create mode 100755 applications/admin/static/edit_area/langs/cs.js create mode 100755 applications/admin/static/edit_area/langs/de.js create mode 100755 applications/admin/static/edit_area/langs/dk.js create mode 100755 applications/admin/static/edit_area/langs/en.js create mode 100755 applications/admin/static/edit_area/langs/eo.js create mode 100755 applications/admin/static/edit_area/langs/es.js create mode 100755 applications/admin/static/edit_area/langs/fi.js create mode 100755 applications/admin/static/edit_area/langs/fr.js create mode 100755 applications/admin/static/edit_area/langs/hr.js create mode 100755 applications/admin/static/edit_area/langs/it.js create mode 100755 applications/admin/static/edit_area/langs/ja.js create mode 100755 applications/admin/static/edit_area/langs/mk.js create mode 100755 applications/admin/static/edit_area/langs/nl.js create mode 100755 applications/admin/static/edit_area/langs/pl.js create mode 100755 applications/admin/static/edit_area/langs/pt.js create mode 100755 applications/admin/static/edit_area/langs/ru.js create mode 100755 applications/admin/static/edit_area/langs/sk.js create mode 100755 applications/admin/static/edit_area/langs/zh.js create mode 100755 applications/admin/static/edit_area/license.txt create mode 100755 applications/admin/static/edit_area/license_apache.txt create mode 100755 applications/admin/static/edit_area/license_bsd.txt create mode 100755 applications/admin/static/edit_area/license_lgpl.txt create mode 100755 applications/admin/static/edit_area/manage_area.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/charmap.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/css/charmap.css create mode 100755 applications/admin/static/edit_area/plugins/charmap/images/charmap.gif create mode 100755 applications/admin/static/edit_area/plugins/charmap/jscripts/map.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/bg.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/cs.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/de.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/dk.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/en.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/eo.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/es.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/fr.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/hr.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/it.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/ja.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/mk.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/nl.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/pl.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/pt.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/ru.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/sk.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/zh.js create mode 100755 applications/admin/static/edit_area/plugins/charmap/popup.html create mode 100755 applications/admin/static/edit_area/plugins/test/css/test.css create mode 100755 applications/admin/static/edit_area/plugins/test/images/test.gif create mode 100755 applications/admin/static/edit_area/plugins/test/langs/bg.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/cs.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/de.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/dk.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/en.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/eo.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/es.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/fr.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/hr.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/it.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/ja.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/mk.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/nl.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/pl.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/pt.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/ru.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/sk.js create mode 100755 applications/admin/static/edit_area/plugins/test/langs/zh.js create mode 100755 applications/admin/static/edit_area/plugins/test/test.js create mode 100755 applications/admin/static/edit_area/plugins/test/test2.js create mode 100644 applications/admin/static/edit_area/plugins/zencoding/core.js create mode 100644 applications/admin/static/edit_area/plugins/zencoding/langs/en.js create mode 100644 applications/admin/static/edit_area/plugins/zencoding/zencoding.js create mode 100755 applications/admin/static/edit_area/reg_syntax.js create mode 100755 applications/admin/static/edit_area/reg_syntax/basic.js create mode 100755 applications/admin/static/edit_area/reg_syntax/brainfuck.js create mode 100755 applications/admin/static/edit_area/reg_syntax/c.js create mode 100755 applications/admin/static/edit_area/reg_syntax/coldfusion.js create mode 100755 applications/admin/static/edit_area/reg_syntax/cpp.js create mode 100755 applications/admin/static/edit_area/reg_syntax/css.js create mode 100755 applications/admin/static/edit_area/reg_syntax/html.js create mode 100755 applications/admin/static/edit_area/reg_syntax/java.js create mode 100755 applications/admin/static/edit_area/reg_syntax/js.js create mode 100755 applications/admin/static/edit_area/reg_syntax/pas.js create mode 100755 applications/admin/static/edit_area/reg_syntax/perl.js create mode 100755 applications/admin/static/edit_area/reg_syntax/php.js create mode 100755 applications/admin/static/edit_area/reg_syntax/python.js create mode 100755 applications/admin/static/edit_area/reg_syntax/robotstxt.js create mode 100755 applications/admin/static/edit_area/reg_syntax/ruby.js create mode 100755 applications/admin/static/edit_area/reg_syntax/sql.js create mode 100755 applications/admin/static/edit_area/reg_syntax/tsql.js create mode 100755 applications/admin/static/edit_area/reg_syntax/vb.js create mode 100755 applications/admin/static/edit_area/reg_syntax/xml.js create mode 100755 applications/admin/static/edit_area/regexp.js create mode 100755 applications/admin/static/edit_area/resize_area.js create mode 100755 applications/admin/static/edit_area/search_replace.js create mode 100755 applications/admin/static/edit_area/template.html create mode 100644 applications/admin/static/images/delete_icon.png create mode 100644 applications/admin/static/images/dim_bullet.gif create mode 100644 applications/admin/static/images/embossed.png create mode 100644 applications/admin/static/images/folder.png create mode 100644 applications/admin/static/images/folder_locked.png create mode 100644 applications/admin/static/images/folder_sm.png create mode 100644 applications/admin/static/images/header_bg.png create mode 100644 applications/admin/static/images/header_shadow.png create mode 100644 applications/admin/static/images/help.png create mode 100644 applications/admin/static/images/menu.png create mode 100644 applications/admin/static/images/red_bullet.gif create mode 100644 applications/admin/static/images/save_icon.png create mode 100644 applications/admin/static/images/search.png create mode 100644 applications/admin/static/images/section_bullet.png create mode 100644 applications/admin/static/images/sidebar_background.jpg create mode 100644 applications/admin/static/images/sidebar_bullet.gif create mode 100644 applications/admin/static/images/sidebar_bullet.png create mode 100644 applications/admin/static/images/small_button.png create mode 100644 applications/admin/static/images/small_special_button.png create mode 100644 applications/admin/static/images/spinner.gif create mode 100644 applications/admin/static/images/start.png create mode 100644 applications/admin/static/images/test_icon.png create mode 100644 applications/admin/static/images/ticket_section.png create mode 100644 applications/admin/static/js/ajax_editor.js create mode 100644 applications/admin/static/js/anytime.js create mode 100644 applications/admin/static/js/autoscroll.js create mode 100644 applications/admin/static/js/jquery.hotkeys.js create mode 100644 applications/admin/static/js/jquery.js create mode 100644 applications/admin/static/js/jquery.timeentry.js create mode 100755 applications/admin/static/js/jqueryMultiSelect.js create mode 100644 applications/admin/static/js/web2py.js create mode 100755 applications/admin/static/plugin_multiselect/jquery.dimensions.js create mode 100755 applications/admin/static/plugin_multiselect/jquery.multiselect.css create mode 100755 applications/admin/static/plugin_multiselect/jquery.multiselect.js create mode 100644 applications/admin/static/plugin_multiselect/start.js create mode 100644 applications/admin/views/appadmin.html create mode 100644 applications/admin/views/debug/index.html create mode 100644 applications/admin/views/default/about.html create mode 100644 applications/admin/views/default/amy_ajax.html create mode 100644 applications/admin/views/default/change_password.html create mode 100644 applications/admin/views/default/delete.html create mode 100644 applications/admin/views/default/delete_plugin.html create mode 100644 applications/admin/views/default/design.html create mode 100644 applications/admin/views/default/downgrade_web2py.html create mode 100644 applications/admin/views/default/edit.html create mode 100644 applications/admin/views/default/edit_language.html create mode 100644 applications/admin/views/default/errors.html create mode 100644 applications/admin/views/default/index.html create mode 100644 applications/admin/views/default/peek.html create mode 100644 applications/admin/views/default/plugin.html create mode 100644 applications/admin/views/default/resolve.html create mode 100644 applications/admin/views/default/site.html create mode 100644 applications/admin/views/default/test.html create mode 100644 applications/admin/views/default/ticket.html create mode 100644 applications/admin/views/default/ticket.load create mode 100644 applications/admin/views/default/uninstall.html create mode 100644 applications/admin/views/default/upgrade_web2py.html create mode 100644 applications/admin/views/default/user.html create mode 100644 applications/admin/views/gae/deploy.html create mode 100644 applications/admin/views/generic.html create mode 100644 applications/admin/views/layout.html create mode 100644 applications/admin/views/mercurial/commit.html create mode 100644 applications/admin/views/mercurial/revision.html create mode 100644 applications/admin/views/shell/index.html create mode 100644 applications/admin/views/toolbar/index.html create mode 100644 applications/admin/views/web2py_ajax.html create mode 100644 applications/admin/views/wizard/generated.html create mode 100644 applications/admin/views/wizard/step.html create mode 100644 applications/welcome/ABOUT create mode 100644 applications/welcome/LICENSE create mode 100644 applications/welcome/__init__.py create mode 100644 applications/welcome/controllers/appadmin.py create mode 100644 applications/welcome/controllers/default.py create mode 100644 applications/welcome/cron/crontab create mode 100644 applications/welcome/languages/cs-cz.py create mode 100644 applications/welcome/languages/es-es.py create mode 100644 applications/welcome/languages/fr-ca.py create mode 100644 applications/welcome/languages/fr-fr.py create mode 100644 applications/welcome/languages/hi-hi.py create mode 100644 applications/welcome/languages/hu-hu.py create mode 100644 applications/welcome/languages/hu.py create mode 100644 applications/welcome/languages/it-it.py create mode 100644 applications/welcome/languages/it.py create mode 100644 applications/welcome/languages/pl-pl.py create mode 100644 applications/welcome/languages/pl.py create mode 100644 applications/welcome/languages/pt-br.py create mode 100644 applications/welcome/languages/pt-pt.py create mode 100644 applications/welcome/languages/pt.py create mode 100644 applications/welcome/languages/ru-ru.py create mode 100644 applications/welcome/languages/sk-sk.py create mode 100644 applications/welcome/languages/zh-tw.py create mode 100644 applications/welcome/models/db.py create mode 100644 applications/welcome/models/menu.py create mode 100644 applications/welcome/modules/__init__.py create mode 100644 applications/welcome/private/auth.key create mode 100644 applications/welcome/static/css/anytime.css create mode 100755 applications/welcome/static/css/skeleton.css create mode 100644 applications/welcome/static/css/superfish.css create mode 100644 applications/welcome/static/css/web2py.css create mode 100644 applications/welcome/static/favicon.ico create mode 100644 applications/welcome/static/favicon.png create mode 100644 applications/welcome/static/images/arrows-ffffff.png create mode 100644 applications/welcome/static/images/css3buttons_backgrounds.png create mode 100644 applications/welcome/static/images/css3buttons_icons.png create mode 100644 applications/welcome/static/images/poweredby.png create mode 100644 applications/welcome/static/images/shadow.png create mode 100644 applications/welcome/static/images/ui-icons_222222_256x240.png create mode 100644 applications/welcome/static/js/anytime.js create mode 100644 applications/welcome/static/js/dd_belatedpng.js create mode 100644 applications/welcome/static/js/jquery.js create mode 100644 applications/welcome/static/js/modernizr.custom.js create mode 100644 applications/welcome/static/js/superfish.js create mode 100644 applications/welcome/static/js/web2py.js create mode 100644 applications/welcome/static/robots.txt create mode 100644 applications/welcome/views/__init__.py create mode 100644 applications/welcome/views/appadmin.html create mode 100644 applications/welcome/views/default/index.html create mode 100644 applications/welcome/views/default/user.html create mode 100644 applications/welcome/views/generic.html create mode 100644 applications/welcome/views/generic.json create mode 100644 applications/welcome/views/generic.jsonp create mode 100644 applications/welcome/views/generic.load create mode 100644 applications/welcome/views/generic.pdf create mode 100644 applications/welcome/views/generic.rss create mode 100644 applications/welcome/views/generic.xml create mode 100644 applications/welcome/views/layout.html create mode 100644 applications/welcome/views/web2py_ajax.html create mode 100755 cgihandler.py create mode 100755 doc/Makefile create mode 100755 doc/convert_faq.py create mode 100755 doc/generate_modules.py create mode 100755 doc/make-doc_html.bat create mode 100755 doc/make-doc_html.sh create mode 100755 doc/make.bat create mode 100755 doc/problematic_files.rst create mode 100755 doc/source/_static/pics/logo.png create mode 100755 doc/source/_static/pics/logo_colored.png create mode 100755 doc/source/_static/pics/logo_colored_small.png create mode 100755 doc/source/_static/pics/logo_small.jpg create mode 100755 doc/source/_static/pics/logo_small.png create mode 100755 doc/source/_static/rst/external_hint.txt create mode 100755 doc/source/conf.py create mode 100755 doc/source/docs_contrib.rst create mode 100755 doc/source/faq.rst create mode 100755 doc/source/glossary.rst create mode 100755 doc/source/gluon/gluon.compat.rst create mode 100755 doc/source/gluon/gluon.contrib.gateways.rst create mode 100755 doc/source/gluon/gluon.contrib.markdown.rst create mode 100755 doc/source/gluon/gluon.contrib.memcache.rst create mode 100755 doc/source/gluon/gluon.contrib.pyrtf.rst create mode 100755 doc/source/gluon/gluon.contrib.rst create mode 100755 doc/source/gluon/gluon.contrib.simplejson.rst create mode 100755 doc/source/gluon/gluon.rst create mode 100755 doc/source/index.rst create mode 100755 doc/source/modules.rst create mode 100755 doc/source/user_wiki.rst create mode 100755 doc/source/web2py_todo.rst create mode 100755 doc/sphinxext/local/generate_modules.py create mode 100755 doc/sphinxext/local/generate_modules_modif.py create mode 100755 doc/sphinxext/local/sphinx_tools.py create mode 100755 doc/sphinxext/numpydoc/LICENSE.txt create mode 100755 doc/sphinxext/numpydoc/MANIFEST.in create mode 100755 doc/sphinxext/numpydoc/__init__.py create mode 100755 doc/sphinxext/numpydoc/autosummary.py create mode 100755 doc/sphinxext/numpydoc/autosummary_generate.py create mode 100755 doc/sphinxext/numpydoc/comment_eater.py create mode 100755 doc/sphinxext/numpydoc/compiler_unparse.py create mode 100755 doc/sphinxext/numpydoc/docscrape.py create mode 100755 doc/sphinxext/numpydoc/docscrape_sphinx.py create mode 100755 doc/sphinxext/numpydoc/numpydoc.py create mode 100755 doc/sphinxext/numpydoc/only_directives.py create mode 100755 doc/sphinxext/numpydoc/phantom_import.py create mode 100755 doc/sphinxext/numpydoc/plot_directive.py create mode 100755 doc/sphinxext/numpydoc/setup.py create mode 100755 doc/sphinxext/numpydoc/tests/test_docscrape.py create mode 100755 epydoc.conf create mode 100644 epydoc.css create mode 100755 fcgihandler.py create mode 100755 gaehandler.py create mode 100644 gluon/__init__.py create mode 100644 gluon/admin.py create mode 100644 gluon/cache.py create mode 100644 gluon/cfs.py create mode 100644 gluon/compileapp.py create mode 100644 gluon/contenttype.py create mode 100755 gluon/contrib/AuthorizeNet.py create mode 100644 gluon/contrib/DowCommerce.py create mode 100644 gluon/contrib/__init__.py create mode 100644 gluon/contrib/comet_messaging.py create mode 100755 gluon/contrib/feedparser.py create mode 100644 gluon/contrib/gae_memcache.py create mode 100644 gluon/contrib/gae_retry.py create mode 100644 gluon/contrib/gateways/__init__.py create mode 100644 gluon/contrib/gateways/fcgi.py create mode 100644 gluon/contrib/generics.py create mode 100644 gluon/contrib/google_wallet.py create mode 100644 gluon/contrib/gql.py create mode 100644 gluon/contrib/login_methods/__init__.py create mode 100644 gluon/contrib/login_methods/basic_auth.py create mode 100644 gluon/contrib/login_methods/cas_auth.py create mode 100644 gluon/contrib/login_methods/dropbox_account.py create mode 100644 gluon/contrib/login_methods/email_auth.py create mode 100644 gluon/contrib/login_methods/extended_login_form.py create mode 100644 gluon/contrib/login_methods/gae_google_account.py create mode 100644 gluon/contrib/login_methods/ldap_auth.py create mode 100644 gluon/contrib/login_methods/linkedin_account.py create mode 100644 gluon/contrib/login_methods/loginza.py create mode 100644 gluon/contrib/login_methods/oauth10a_account.py create mode 100644 gluon/contrib/login_methods/oauth20_account.py create mode 100644 gluon/contrib/login_methods/openid_auth.py create mode 100644 gluon/contrib/login_methods/pam_auth.py create mode 100644 gluon/contrib/login_methods/rpx_account.py create mode 100644 gluon/contrib/login_methods/x509_auth.py create mode 100644 gluon/contrib/markdown/LICENSE create mode 100644 gluon/contrib/markdown/__init__.py create mode 100644 gluon/contrib/markdown/markdown2.py create mode 100644 gluon/contrib/markmin/__init__.py create mode 100644 gluon/contrib/markmin/markmin.html create mode 100644 gluon/contrib/markmin/markmin.pdf create mode 100755 gluon/contrib/markmin/markmin2html.py create mode 100755 gluon/contrib/markmin/markmin2latex.py create mode 100644 gluon/contrib/markmin/markmin2pdf.py create mode 100644 gluon/contrib/memcache/ChangeLog create mode 100644 gluon/contrib/memcache/PKG-INFO create mode 100644 gluon/contrib/memcache/README create mode 100644 gluon/contrib/memcache/__init__.py create mode 100644 gluon/contrib/memcache/memcache.py create mode 100644 gluon/contrib/memdb.py create mode 100644 gluon/contrib/minify/__init__.py create mode 100644 gluon/contrib/minify/cssmin.py create mode 100644 gluon/contrib/minify/jsmin.py create mode 100644 gluon/contrib/minify/minify.py create mode 100644 gluon/contrib/pam.py create mode 100644 gluon/contrib/populate.py create mode 100644 gluon/contrib/pyfpdf/README create mode 100644 gluon/contrib/pyfpdf/__init__.py create mode 100644 gluon/contrib/pyfpdf/designer.py create mode 100644 gluon/contrib/pyfpdf/fpdf.py create mode 100644 gluon/contrib/pyfpdf/html.py create mode 100755 gluon/contrib/pyfpdf/template.py create mode 100644 gluon/contrib/pymysql/LICENSE create mode 100644 gluon/contrib/pymysql/README create mode 100644 gluon/contrib/pymysql/__init__.py create mode 100644 gluon/contrib/pymysql/charset.py create mode 100644 gluon/contrib/pymysql/connections.py create mode 100644 gluon/contrib/pymysql/constants/CLIENT.py create mode 100644 gluon/contrib/pymysql/constants/COMMAND.py create mode 100644 gluon/contrib/pymysql/constants/ER.py create mode 100644 gluon/contrib/pymysql/constants/FIELD_TYPE.py create mode 100644 gluon/contrib/pymysql/constants/FLAG.py create mode 100644 gluon/contrib/pymysql/constants/SERVER_STATUS.py create mode 100644 gluon/contrib/pymysql/constants/__init__.py create mode 100644 gluon/contrib/pymysql/converters.py create mode 100644 gluon/contrib/pymysql/cursors.py create mode 100644 gluon/contrib/pymysql/err.py create mode 100644 gluon/contrib/pymysql/tests/__init__.py create mode 100644 gluon/contrib/pymysql/tests/base.py create mode 100644 gluon/contrib/pymysql/tests/test_basic.py create mode 100644 gluon/contrib/pymysql/tests/test_example.py create mode 100644 gluon/contrib/pymysql/tests/test_issues.py create mode 100644 gluon/contrib/pymysql/times.py create mode 100644 gluon/contrib/pymysql/util.py create mode 100644 gluon/contrib/pyrtf/Constants.py create mode 100644 gluon/contrib/pyrtf/Elements.py create mode 100644 gluon/contrib/pyrtf/PropertySets.py create mode 100644 gluon/contrib/pyrtf/README create mode 100644 gluon/contrib/pyrtf/Renderer.py create mode 100644 gluon/contrib/pyrtf/Styles.py create mode 100644 gluon/contrib/pyrtf/__init__.py create mode 100755 gluon/contrib/pysimplesoap/__init__.py create mode 100755 gluon/contrib/pysimplesoap/client.py create mode 100755 gluon/contrib/pysimplesoap/server.py create mode 100755 gluon/contrib/pysimplesoap/simplexml.py create mode 100644 gluon/contrib/redis_cache.py create mode 100644 gluon/contrib/rss2.py create mode 100755 gluon/contrib/shell.py create mode 100644 gluon/contrib/simplejson/LICENSE.txt create mode 100644 gluon/contrib/simplejson/__init__.py create mode 100644 gluon/contrib/simplejson/decoder.py create mode 100644 gluon/contrib/simplejson/encoder.py create mode 100644 gluon/contrib/simplejson/ordered_dict.py create mode 100644 gluon/contrib/simplejson/scanner.py create mode 100644 gluon/contrib/simplejson/tool.py create mode 100644 gluon/contrib/simplejsonrpc.py create mode 100644 gluon/contrib/sms_utils.py create mode 100644 gluon/contrib/spreadsheet.py create mode 100644 gluon/contrib/stripe.py create mode 100644 gluon/contrib/taskbar_widget.py create mode 100644 gluon/contrib/user_agent_parser.py create mode 100644 gluon/custom_import.py create mode 100644 gluon/dal.py create mode 100644 gluon/debug.py create mode 100644 gluon/decoder.py create mode 100644 gluon/fileutils.py create mode 100644 gluon/globals.py create mode 100644 gluon/highlight.py create mode 100644 gluon/html.py create mode 100644 gluon/http.py create mode 100644 gluon/import_all.py create mode 100644 gluon/languages.py create mode 100644 gluon/main.py create mode 100644 gluon/myregex.py create mode 100644 gluon/newcron.py create mode 100644 gluon/portalocker.py create mode 100644 gluon/reserved_sql_keywords.py create mode 100644 gluon/restricted.py create mode 100644 gluon/rewrite.py create mode 100644 gluon/rocket.py create mode 100644 gluon/rocket.py.footer create mode 100644 gluon/sanitizer.py create mode 100644 gluon/scheduler.py create mode 100644 gluon/serializers.py create mode 100644 gluon/settings.py create mode 100644 gluon/shell.py create mode 100644 gluon/sql.py create mode 100644 gluon/sqlhtml.py create mode 100644 gluon/storage.py create mode 100644 gluon/streamer.py create mode 100644 gluon/template.py create mode 100644 gluon/tests/__init__.py create mode 100755 gluon/tests/test.sh create mode 100644 gluon/tests/test_cache.py create mode 100644 gluon/tests/test_dal.py create mode 100644 gluon/tests/test_html.py create mode 100644 gluon/tests/test_is_url.py create mode 100644 gluon/tests/test_router.py create mode 100644 gluon/tests/test_routes.py create mode 100644 gluon/tests/test_storage.py create mode 100644 gluon/tests/test_template.py create mode 100644 gluon/tests/test_utils.py create mode 100644 gluon/tools.py create mode 100644 gluon/utils.py create mode 100644 gluon/validators.py create mode 100644 gluon/widget.py create mode 100644 gluon/winservice.py create mode 100644 gluon/xmlrpc.py create mode 100644 isapiwsgihandler.py create mode 100644 logging.example.conf create mode 100755 modpythonhandler.py create mode 100644 options_std.py create mode 100644 queue.example.yaml create mode 100644 router.example.py create mode 100644 routes.example.py create mode 100755 scgihandler.py create mode 100644 scripts/access.wsgi create mode 100644 scripts/autoroutes.py create mode 100755 scripts/cleancss.py create mode 100755 scripts/cleanhtml.py create mode 100644 scripts/cleanjs.py create mode 100755 scripts/contentparser.py create mode 100644 scripts/cpdb.py create mode 100644 scripts/cpplugin.py create mode 100644 scripts/dbsessions2trash.py create mode 100644 scripts/dict_diff.py create mode 100644 scripts/extract_mysql_models.py create mode 100644 scripts/extract_pgsql_models.py create mode 100755 scripts/fixws.py create mode 100755 scripts/layout_make.py create mode 100644 scripts/make_min_web2py.py create mode 100644 scripts/nginx_scgi.conf create mode 100755 scripts/sessions2trash.py create mode 100644 scripts/setup-shared-hosting-2.4.sh create mode 100644 scripts/setup-virtualenv-web2py.sh create mode 100644 scripts/setup-web2py-fedora.sh create mode 100644 scripts/setup-web2py-nginx-uwsgi-ubuntu.sh create mode 100755 scripts/setup-web2py-ubuntu.sh create mode 100644 scripts/standalone_exe_cxfreeze.py create mode 100755 scripts/sync_languages.py create mode 100755 scripts/tickets2db.py create mode 100755 scripts/tickets2email.py create mode 100755 scripts/update-web2py.sh create mode 100644 scripts/update_web2py.py create mode 100644 scripts/web2py-lock.sh create mode 100755 scripts/web2py.archlinux.sh create mode 100644 scripts/web2py.fedora.sh create mode 100755 scripts/web2py.ubuntu.sh create mode 100644 setup.py create mode 100755 setup_app.py create mode 100644 setup_exe.conf create mode 100755 setup_exe.py create mode 100644 setup_exe_2.6.py create mode 100644 site-packages/__init__.py create mode 100644 splashlogo.gif create mode 100755 w2p_apps create mode 100755 w2p_clone create mode 100755 w2p_run create mode 100644 web2py.icns create mode 100644 web2py.ico create mode 100755 web2py.py create mode 100644 wsgihandler.py diff --git a/ABOUT b/ABOUT new file mode 100644 index 00000000..646a97d2 --- /dev/null +++ b/ABOUT @@ -0,0 +1,6 @@ +web2py is an open source full-stack framework for agile development +of secure database-driven web-based applications, written and programmable in +Python. + +Created by Massimo Di Pierro + diff --git a/Introduction b/Introduction new file mode 100644 index 00000000..e69de29b diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..53e03dc8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,137 @@ +## Web2py License + +Web2py is Licensed under the LGPL license version 3 +(http://www.gnu.org/licenses/lgpl.html) + +Copyrighted (c) by Massimo Di Pierro (2007-2011) + +### On Commercial Redistribution + +In accordance with LGPL you may: +- redistribute web2py with your apps (including official web2py binary versions) +- release your applications which use official web2py libraries under any license you wish +But you must: +- make clear in the documentation that your application uses web2py +- release any modification of the web2py libraries under the LGPLv3 license + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM “AS IS†WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR OR CORRECTION. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT +HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, +BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL +DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES +OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +(Earlier versions of web2py, 1.0.*-1.90.*, were released under the GPL2 license plus a +commercial exception which, for practical purposes, was very similar to the current LPGLv3) + +### Licenses for third party contributed software + +web2py contains third party software under the gluon/contrib/ folder. +Each file/module in contrib is distributed with web2py under its original license. +Here we list some of them. + +#### gluon.contrib.simplejson LICENSE + +Copyright (c) 2006 Bob Ippolito - 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. + +#### gluon.contrib.rss2.py (originally PyRSS2Gen) LICENSE + +This is copyright (c) by Dalke Scientific Software, LLC and released under the +BSD license. See the file LICENSE in the distribution or + for details. + +#### gluon.contrib.markdown (markdown2) LICENSE + +MIT License from from + +#### gluon.contrib.feedparser LICENSE + +Copyright (c) 2002-2005, Mark Pilgrim + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +#### gluon.wsgiserver.py LICENSE (borrowed from cherrypy) + +Copyright (c) 2004, CherryPy Team (team@cherrypy.org) +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the CherryPy Team nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#### gluon.contrib.pam LICENSE + +Copyright (C) 2007-2009 Chris AtLee Licensed under the MIT license + +#### gluon.contrib.shell LICENSE + +Copyright (C) by Google inc. Apache 2.0 Lincense + +#### The javascript licenses are in the code itself + diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..7cd53a8d --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include VERSION LICENSE diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..88e455ac --- /dev/null +++ b/Makefile @@ -0,0 +1,123 @@ +clean: + rm -f httpserver.log + rm -f parameters*.py + rm -f -r applications/*/compiled + find ./ -name '*~' -exec rm -f {} \; + find ./ -name '*.orig' -exec rm -f {} \; + find ./ -name '*.rej' -exec rm -f {} \; + find ./ -name '#*' -exec rm -f {} \; + find ./ -name 'Thumbs.db' -exec rm -f {} \; + find ./gluon/ -name '.*' -exec rm -f {} \; + find ./gluon/ -name '*class' -exec rm -f {} \; + find ./applications/admin/ -name '.*' -exec rm -f {} \; + find ./applications/examples/ -name '.*' -exec rm -f {} \; + find ./applications/welcome/ -name '.*' -exec rm -f {} \; + find ./ -name '*.pyc' -exec rm -f {} \; +all: + echo "The Makefile is used to build the distribution." + echo "In order to run web2py you do not need to make anything." + echo "just run web2py.py" +epydoc: + ### build epydoc + rm -f -r applications/examples/static/epydoc/ + epydoc --config epydoc.conf + cp applications/examples/static/title.png applications/examples/static/epydoc +tests: + cd gluon/tests; ./test.sh 1>tests.log 2>&1 +update: + wget -O gluon/contrib/feedparser.py http://feedparser.googlecode.com/svn/trunk/feedparser/feedparser.py + wget -O gluon/contrib/simplejsonrpc.py http://rad2py.googlecode.com/hg/ide2py/simplejsonrpc.py +src: + echo 'Version 1.99.3 ('`date +%Y-%m-%d\ %H:%M:%S`') dev' > VERSION + ### rm -f all junk files + make clean + ### clean up baisc apps + rm -f routes.py + rm -f applications/*/sessions/* + rm -f applications/*/errors/* | echo 'too many files' + rm -f applications/*/cache/* + rm -f applications/admin/databases/* + rm -f applications/welcome/databases/* + rm -f applications/examples/databases/* + rm -f applications/admin/uploads/* + rm -f applications/welcome/uploads/* + rm -f applications/examples/uploads/* + ### make admin layout and appadmin the default + cp applications/admin/views/appadmin.html applications/welcome/views + cp applications/admin/views/appadmin.html applications/examples/views + cp applications/admin/controllers/appadmin.py applications/welcome/controllers + cp applications/admin/controllers/appadmin.py applications/examples/controllers + ### update the license + cp ABOUT applications/admin/ + cp ABOUT applications/examples/ + cp LICENSE applications/admin/ + cp LICENSE applications/examples/ + ### build web2py_src.zip + echo '' > NEWINSTALL + mv web2py_src.zip web2py_src_old.zip | echo 'no old' + cd ..; zip -r web2py/web2py_src.zip web2py/gluon/*.py web2py/gluon/contrib/* web2py/splashlogo.gif web2py/*.py web2py/ABOUT web2py/LICENSE web2py/README web2py/NEWINSTALL web2py/VERSION web2py/Makefile web2py/epydoc.css web2py/epydoc.conf web2py/app.example.yaml web2py/logging.example.conf web2py_exe.conf web2py/queue.example.yaml MANIFEST.in w2p_apps w2p_clone w2p_run startweb2py web2py/scripts/*.sh web2py/scripts/*.py web2py/applications/admin web2py/applications/examples/ web2py/applications/welcome web2py/applications/__init__.py web2py/site-packages/__init__.py web2py/gluon/tests/*.sh web2py/gluon/tests/*.py + +mdp: + make epydoc + make src + make app + make win +app: + echo 'did you uncomment import_all in gluon/main.py?' + python2.5 -c 'import compileall; compileall.compile_dir("gluon/")' + #python web2py.py -S welcome -R __exit__.py + find gluon -path '*.pyc' -exec cp {} ../web2py_osx/site-packages/{} \; + cd ../web2py_osx/site-packages/; zip -r ../site-packages.zip * + mv ../web2py_osx/site-packages.zip ../web2py_osx/web2py/web2py.app/Contents/Resources/lib/python2.5 + cp ABOUT ../web2py_osx/web2py/web2py.app/Contents/Resources + cp NEWINSTALL ../web2py_osx/web2py/web2py.app/Contents/Resources + cp LICENSE ../web2py_osx/web2py/web2py.app/Contents/Resources + cp VERSION ../web2py_osx/web2py/web2py.app/Contents/Resources + cp README ../web2py_osx/web2py/web2py.app/Contents/Resources + cp splashlogo.gif ../web2py_osx/web2py/web2py.app/Contents/Resources + cp options_std.py ../web2py_osx/web2py/web2py.app/Contents/Resources + cp routes.example.py ../web2py_osx/web2py/web2py.app/Contents/Resources + cp router.example.py ../web2py_osx/web2py/web2py.app/Contents/Resources + cp app.example.yaml ../web2py_osx/web2py/web2py.app/Contents/Resources + cp queue.example.yaml ../web2py_osx/web2py/web2py.app/Contents/Resources + cp -r applications/admin ../web2py_osx/web2py/web2py.app/Contents/Resources/applications + cp -r applications/welcome ../web2py_osx/web2py/web2py.app/Contents/Resources/applications + cp -r applications/examples ../web2py_osx/web2py/web2py.app/Contents/Resources/applications + cp applications/__init__.py ../web2py_osx/web2py/web2py.app/Contents/Resources/applications + cd ../web2py_osx; zip -r web2py_osx.zip web2py + mv ../web2py_osx/web2py_osx.zip . +win: + echo 'did you uncomment import_all in gluon/main.py?' + python2.5 -c 'import compileall; compileall.compile_dir("gluon/")' + find gluon -path '*.pyc' -exec cp {} ../web2py_win/library/{} \; + cd ../web2py_win/library/; zip -r ../library.zip * + mv ../web2py_win/library.zip ../web2py_win/web2py + cp ABOUT ../web2py_win/web2py/ + cp NEWINSTALL ../web2py_win/web2py/ + cp LICENSE ../web2py_win/web2py/ + cp VERSION ../web2py_win/web2py/ + cp README ../web2py_win/web2py/ + cp splashlogo.gif ../web2py_win/web2py/ + cp options_std.py ../web2py_win/web2py/ + cp routes.example.py ../web2py_win/web2py/ + cp router.example.py ../web2py_win/web2py/ + cp app.example.yaml ../web2py_win/web2py/ + cp queue.example.yaml ../web2py_win/web2py/ + cp -r applications/admin ../web2py_win/web2py/applications + cp -r applications/welcome ../web2py_win/web2py/applications + cp -r applications/examples ../web2py_win/web2py/applications + cp applications/__init__.py ../web2py_win/web2py/applications + cd ../web2py_win; zip -r web2py_win.zip web2py + mv ../web2py_win/web2py_win.zip . +pip: + # create Web2py distribution for upload to Pypi + # after upload clean Web2py sources with rm -R ./dist + python setup.py sdist +run: + python2.5 web2py.py -a hello +push: + make src + echo '' > NEWINSTALL + hg push + bzr push bzr+ssh://mdipierro@bazaar.launchpad.net/~mdipierro/web2py/devel --use-existing-dir + diff --git a/NEWINSTALL b/NEWINSTALL new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/NEWINSTALL @@ -0,0 +1 @@ + diff --git a/README b/README new file mode 100644 index 00000000..f0214576 --- /dev/null +++ b/README @@ -0,0 +1,1178 @@ +## INSTALLATION INSTRUCTION - IMPORTANT + +To start web2py there is NO NEED to install it. Just unzip and do: + +> python web2py.py + +Thats is it!!! + +## web2py file structure + +start web2py with: + + python web2py.py + +`` + \project + README + LICENSE + TODO + Makefile ## make all and make app + web2py.py ## the startup script (*) + parameters.py ## created at startup + admin.tar ## the admin app (*) + examples.tar ## examples and documentation app (*) + welcome.tar ## the welcome app (entry point) (*) + \gluon ## the core libraries (*) + \deposit ## used for zip and install apps + setup_app.py ## used by py2app to make OSX executable + setup_exe.py ## used by py2app to make Winows executble + wsgihandler.py ## to use Gluon with mod_wsgi + \dist ## used by py2app, py2exe + \build ## used by py2app, py2exe + \tests ## under development stuff + \docs ## in progress documentation + \applications ## are the apps + \welcome ## application welcome, for example + \models + \views + \controllers + \sessions + \errors + \cache + \static + \uploads + \modules +`` + +## EWF v1.5 -> v1.6 +- load and save .py in ascii, avoids problem with LF+CR on windows +- added path.join in compileapp, fixed problem with Windows compileapp + +## EWF v1.6 -> v1.7 +- in paths replace '\' with '/' to fix problem with windows paths +- using limitby in database administration +- replaced mime/miltupart with multipart/form-data to fix a windows problem + +## EWF v1.7 -> Gluon v1.0 +- Name change +- Improved layout.html + +## Gluon v1.0 -> v1.1 +- bug in sqlhtml with JOINS queries + +## Gluon v1.1 -> v1.2 +- fixed some typos in examples +- IS_IN_SET now supports labels +- cleanup in sql.py does not cleanup, just checks valid field and table names + +## Gluon v1.3 +- added IS_IN_DB, IS_NOT_IN_DB and updated examples accordingly + +## Gluon v1.4 +- fixed problem with IS_INT_IN_RANGE and IS_FLOAT_IN_RANGE. Now an error in a validator is reported as a ticket. Good validators should not raise Exceptions. +- IS_IN_DB displays "label (id)" +- it can upload files without extension +- migration is now optional (define_table has migrate=False option) + +## Gluon v1.5 +-
-> in errors.html +- replace('//','////') in sub in template.py + +## Gluon v1.8 +- no more chdir (thread unsafe) +- no more sys.stdout (thread unsafe) +- response.body is StringIO() +- admin/default/site informs about upgrade +- response.locker (optional) + +## Gluon v1.9 +- allow "count(*)" in select +- db.execute() +- fixed problem with continue and return in template +- removed try: ... except in sql.py +- fixed '\t' + +## Gluon v1.10 +- fixed concurrency problems with SQLDB._instances and SQLDB._folders, now use lock +- now, by default, edit SQLFORMs retain uploaded files + +## Gluon v1.11 +- appadmin allows to keep or delete uploaded files + +## Gluon v1.12 +- in sql.py +- handles NULL values properly +- unicode support (data always stored in utf-8) +- 'date' -> datetime.date ,'time' -> datetime.time, 'datetime' -> datetime.datetime, 'boolean' -> True/False +- most types have default validators +- SQLField(...,required=True) option. +- SQLRows has __str__ that serializes in CSV and xml() that serializes in HTML +- SQLTable has import_from_csv_file(...) +- gluon.simplejson for AJAX +- in validators.py +- IS_IN_DB(db,..) - db can be an SQLSet or an SQLDB +- better error messages +- in admin +- new import/export in csv, update and delete interface. +- in appadmin +- edit form allows to keep stored encrypted password +- in main.py +- http://host not defaults to http://host/init/default/index +- New third party modules +- gluon.simplejson(.dumps, .loads) +- gluon.pyrtf(.dumps) +- gluon.rss2(.dumps) + +## Gluon v1.13 +- (this is one of the biggest revisions ever) +- Improved sql.py has support MySQL, cxOracle (experimental), extract, like and better testing +- SQLDB.tables and SQLTable.fields are now SQLCalableList objects +- Fixed bug with editing integer fields storing zero +- Admin interface now says "insert new [tablename]" and display insert, select or update properly in the title. +- Added a cache mechamism. Works for data, controllers, views and SQLRows. +- main.py now uses a request.folder absolute path when not os.name in ['nt','posix']. Seems to work on windowsce devices, except no file locking has consequences. +- Now you can put modules in applications/[anyapp]/modules and import them with +- import applications.[anyapp].modules.[module] as [module] +- Fixed problem with init +- New applications/examples/controller/global.py controller for docs. + +## Gluon v1.14 +- Fixed a bug fix in URLs + +## Gluon v1.15 +- New try:... except. in gluon/main.py for when sessions cannot be saved +- Now validator/formatter method allows IS_DATE('%d/%m/%Y') + +## web2py v1.16 +- yes we changed the name! Turns out Gluon was trademarked by somebody else. +- Although we are not infringing the trademark since this is a non-commercial +- product we could have run into some issues. So we have been professional +- and changed the name to web2py. +- Now SQLFORMs and FORM can have a formname and multiple forms are allowed +- per page. +- A new examples/default/index page. +- web2py.py instead of runme.py +- mysql sets utf8 encoding. +- input integer field values are automatically converted int(). + +## web2py v1.17 +- I posted v1.16 too soon. v1.17 was released after 1h to fix some bugs. + +## web2py v1.18 +- removed vulnerability in accept_languages and session_id +- Minor bug fixes. Typos and cleanup cache. Textarea now clears. +- Support for PyAMF. +- T returns a class, not a string +- new template parser (faster?) +- got rid of sintaxhighlighter in favor of server side CODE +- fix problem with cacheondisk locking +- fix 'None' instead of NULL in IS_NOT_IN_DB (I think) +- gluon.contrib.markdown +- notnull and unique in SQLField now supported (tested on sqlite mysql and postgresql) +- Storage now has __getstate__ and __setstate__ needed for pickling. +- session files are now locked to make it work better with asynchronous requests +- cxoracle should work, apart for limitby +- .../examples is now mapped to .../examples/default/index etc. +- .../init is now mapped to .../welcome if init is not present + +## web2py 1.19 +- minor typos + +## web2py 1.20 +- new IFRAME, LABEL, FIELDSET validators +- P(..cr2br=True) option +- FORM and SQLFORM have hidden=dict(...) option for REST +- testing framework. +- improved examples pages + +## web2py 1.21 +- replaced paste.httpserver with cherrypy.wsgi server +- temporary sessions are no longer saved +- widget has [stop] button and graph +- logging is done by main by appfactory +- fixed a bug in sql belongs + +## web2py 1.22-1.25 +- fixed minor bugs, added IS_NULL_OR + +## web2py 1.26 +- added shell.py (thanks Limodou!) +- added memcache support + +## web2py 1.27 +- IS_NULL_OR now works will all fields +- admin creates paths to static files +- wsgiserver options are passed to HttpServer +- faking limitby for oracle to make appadmin work +- all objects inherit from object +- fixed bug in app names with . +- fixed bug in created RestrictedError object on windows +- shell is now in gluon and accessible via web2py.py + +## web2py 1.28 +- fixed bug with belongs, faster sql.py +- included jquery.js +- minor aestetical fixes +- sortable.js is gone + +## web2py 1.29 +- Now selet mutliple works with get, so does is IS_LENGTH +- Added IS_LIST_OF +- fixed problem with admin from windows and localhost + +## web2py 1.30 +- added flv to contenttype +- added support for appengine + +## web2py 1.31-1.41 +- some bug fixes, mostly better appengine support +- mssql support +- firebird support +- widgets support +- connection pools + +## 1.42 +- fixed security issue by removing slash escape in mysql +- removed random everywhere +- use uuid for session and tickets +- use http_x_forward_for to figure out the client causing a ticket +- use longtext and longblob for mysql +- main now really catches all exceptions +- no more warnings on GAE + +## 1.43-1.48 +- html.py rewrite (better support for custom forms) (Bill Ferrett) +- new stickers in examples (thanks Mateusz) +- on windows can run in taskbar (Mark Larsen) +- in admin|edit page link to edit|controller (Nathan Freeze) +- better error codes and routes_onerror (Timothy Farrell) +- DAL support for groupy and having +- DAL support for expressions instead of values +- DAL has experimental Informix support +- fixed bug with non-printable chars in DAL +- 'text' fields limited to 2**16 (to avoid mysql problems) +- widget has -quiet and -debug (Attila Csipa) +- web2py_session uses BLOB instead of TEXT +- improved IS_URL +- Runs with python 2.6 (Tim) +- On GAE uses GAE for static files (Robin) + + +## 1.49 +- fixed a bug with taskbar widget, thanks Mark +- fixed a bug with form.latest +- made many DIV methods private (_) + + +## 1.50 +- Fixed some bugs introduced in 1.49 + +## 1.51 +- Fixed more bugs introduced in 1.49 (sql _extra and html select) +- support for sqlite:memory: + +## 1.52 +- Fixed a minor bug with _extra[key] and key not str. +- check for upgrade via ajax + +## 1.53 +- On GAE upload data goes automatically in datastore (blob created automatically) +- New appadmin runs on GAE (most of it, not all) +- Martin Hufsky patch allow slicing of fields in DAL expressions + +## 1.54 +- fixed minor bugs + +## 1.55? +- rowcount +- fixed bug when IS_IN_DB involved multiple fields on GAE +- T.set_current_languages +- better unittests +- response.custom_commit and response.custom_rollback +- you can next cache calls (like cache a controller that caches a select). Thanks Iceberg +- db(....id==None).select() no longer returns an error but an empty SQLRows on GAE +- db(...).delete(delete_uploads=True) and SQLFORM.accepts(....delete_uploads=True) will delete all referenced uploaded files +- DIV.element and DIV.update +- sqlrows.json() +- SQLFORM.widgets +- URL(r=request,args=0) +- IS_IN_DB(...,multiple=True) for Many2Many (sort of) +- In URL(...,f) f is url encoded +- In routes_in=[['a/b/c/','a/b/c/?var=value']] +- simplejson 2.0.7 + + +## 1.56 +- Consider the following table: + +- db.define_table('cirlce', +- db.Field('radius','double'), +- db.Field('area','double'), +- db.Field('modified_on','datetime')) + +- now you can do: + +## add a comment in the forms +- db.circle.area.comment="(this is a comment)" + +## do not show area in create/edit forms +- db.circle.area.writable=False + +- ## do not show now in display forms +- db.circle.modified_on.readable=False + +## automatically timestamp when record cretaed +- db.circle.modified_on.default=request.now + +## automatically timestamp when record is modified +- db.circle.modified_on.update=request.now + +## make the radius appear in bold in display and table +- db.circle.radius.represent=lambda value: B(value) + +## make a form that automatically computes area +- pi=3.1415 +- form=SQLFOM(db.circle) +- if form.accepts(request.vars, +- onvalidation=lambda form: form.vars.area=pi*form.vars.radius**2): ... + +## make a create form in two possible ways: +- form=SQLFORM(db.circle) +- form=SQLFORM(db.circle,0) + +## make an update form in two possible ways: +- form=SQLFORM(db.circle,record) +- form=SQLFORM(db.circle,record_id) + +## make a display form in two possible ways: +- form=SQLFORM(db.circle,record,readonly=True) +- form=SQLFORM(db.circle,record_id,readonly=True) + +## so now you can do... + +- form=SQLFORM(db.circle,request.args[-1]) + +- and you get a create form if the URL ends in /0, you get an update +- form if the URL ends in /[valid_record_id] + +## you can also define once for all + +- timestamp=SQLTable(None,'timestamp', +- SQLField('created_on','datetime', +- writable=False, +- default=request.now), +- SQLField('modified_on','datetime', +- writable=False, +- default=request.now,update=request.now)) + +## and use it in all your tables + +- db.define_table('mytable',db.Field('somefield'),timestamp) + +## ## ## + +- One more feature in trunk.... + +- db.define_table('image',SQLField('file','upload')) + +- db.image.file.authorize=lambda row: True or False + +- then controller +- def download(): return response.download(request,db) +- id' is now a hidden field sqlform +- gql references converted to long +- admin login has autofocus +- new notation proposed by Robin, db.table[id] +- new UploadWidget shows images +- new generic.html shows request, response, session +- new LEGEND helper (thanks Marcus) +- fixed doctests in sql (thanks Robin) +- new notation for DB + +- record=db.table[id] +- db.table[id]=dict(...) +- del db.table[id] + +- request.env.web2py_version +- new class gluon.storage.Settings has lock_keys, lock_values +- jquery 1.3.1 +- PEP8 compliance +- new examples application +- runs on jython (no database drivers yet, thanks Phyo) +- fixed bugs in tests +- passes all unittest but test_rewite (not sure it should pass that one) + +- Lots of patches from Fran Boone (about tools) and Dougla Soares de Andarde (Python 2.6 compliance, user use of hashlib instead of md5, new markdown2.py) + +## 1.56.1-1.56.4 +- fixing lots of small bugs with tool and languages +- jquery.1.3.2 + +## 1.57 +- New ajax edit with keepalive (no longer logged out when editing code) +- Fixed conflict resolution page. +- Removed /user/bin/python from models/controllers + +## 1.58 +- Fixed some CRON bugs +- Fixed a bug with new ajax edit +- Experimental DB2 support in DAL +- Customizable font size in admin edit page +- New welcome/models/db.py shows how to memcache sessions on GAE with MEMDB +- More expressive titles in admin +- DB2 support. Thanks Denes! + +## 1.59-1.60 +- fixed lots of small bugs +- routes_in can filter by http_host + +## 1.61 +- fixed some typos +- auth.add_permissions(0,....) 0 indicates group of current user +- crud.update has deletable=True or False +- fixed issue with GAE detection -> gluon.settings.web2py_runtime -> request + +## 1.62 +- SQLFORMS and crud now show readble fields +- Better WingIDE support +- Languages are automatically translated +- T.force and lazyT works better, optional T.lazy=False +- gluon.storage.Messages are now translated without T +- if routes.py then request.env.web2py_original_uri +- db.table.field.isattachment = True +- internationalizaiton of admin by Yair +- admin.py by Alvaro +- new MENU helper +- new w2p file format +- new welcome app with auth, service and crud turned on + +## 1.63-1.63.4 +- no more import gluon. +- support for generic.xxx +- simplejson can handle datetime date and time + +## 1.63.5 +- You can do jQuery.noConflict() without breaking web2py_ajax +- Wigets can have attributes (thanks Hans) +- Lots of internal cleanup and better code reusage (thanks Hans) + +## 1.64 +- Models 2-3 times faster (thanks Alexey) +- Better LDAP support +- Works with Jython (including sqlite and postgresql with zxJDBC): + +- download jython-2.5rc3.jar +- download qlite-jdbc-3.6.14.2.jar +- java -jar jython-xxx.jar +- export CLASSPATH=$CLASSPATH:/Users/mdipierro/jython2.5rc3/sqlite-jdbc-3.6.14.2.jar +- cd web2py +- ../jython2.5rc3/jython web2py.py + +## 1.64.2 +- New IS_COMPLEX validator, thank Mr. Freeze +- Experimental Informix support +- Autologin on registration + +## 1.64.3 +- Some bug fixes + +## 1.64.4 +- Som bug fixes +- Informix Support +- response.render(stream) +- SQLFORM.factory +- SQLFORM.widgets.radio and SQLFORM.widgets.checkboxes + +## 1.65 +- reST docstrings for Sphinx, thanks Hans +- gluon/conrtib/login_methods/gae_google_account.py for google CAS login on GAE, thanks Hans +- fixed problem with Auth and Firebird 'password' issue +- new auth.settings.create_user_groups +- tickets stored on datastore on GAE and also logged, thanks Hans +- imporved IS_LENGTH with max and min, thanks Mateusz +- improved IS_EMAIL with filters, thanks Mateusz +- new IS_IMAGE checks for format and size, thanks Mateusz +- new IS_IPV4, thanks Mateusz + +## 1.65.1 +- spreadsheet +- shell history, thanks sherdim +- crontab editor, thanks Angelo +- gluon/contrib/login_methods/cas_auth.py (thanks Hans) +- DAL(...) instead of SQLDB(...) +- DAL('gae') instead of GQLDB() +- Field instead of SQLField +- (the old syntax still works) + +## 1.65.2 +- Fixed some small auth bugs +- Field.store(...) + +## 1.65.3-10 +- Fixed some small bugs and typos in the docstrings +- Fixed AMF3 support + +## 1.65.11 +- Fixed a sqlhtml bug with image upload + +## 1.65.12 +- lables in auth auto-translate (thanks Alvaro) +- better ldap_auth (thanks Fran) +- auth chacks locally for blocked accounts even for alternate login methods (thanks Fran) + +## 1.65.13 +- request.url (thanks Jonathan) +- restored uploadfield_newfilename +- new examples layout nad logo (thanks Mateusz) + +## 1.66 +- new doctypes +- form.vars.newfilename +- new HTML and XHTML helpers +- better IS_LENGTH + +## 1.67.0 +- Python 2.4 support (again) +- New layout for welcome +- changed defauld field sizes to 512 +- Field(uploadfolder="...") +- appadmin works on GAE (again, somehting got broken at some point) +- new wsgiserver 3.2.0 should fix recurrent broken download problems + +## 1.67.1 +- Bux fixed + +## 1.67.2 +- Security fix in markdown + +## 1.68.1 +- New official markdown with security fix +- rows.first() +- rows.last() +- New cron +- New hindi and spanish translation +- cached uploads allow for progress bars (thanks AndCycle) +- ingres support (thanks Chris) +- legacy database support for db2, mssql with non-int primary keys (thanks Denes) +- default setting of content-type (this may cause strange behavior in old apps when downloading images) +- IS_UPPER and IS_LOWER works with unicode +- CLENUP not takes regex of allowed/now allowed chartares +- New rewrite.py allows dynamic routes +- Better error messages for IS_INT_* and IS_FLOAT_* + +## 1.68.2 +- Fixing bug with admin and missing crontab +- Fixing bug with rewrite.load on GAE (thanks Willian Wang) + +## 1.69.1 +- Fixed a bug introduced in 1.68 about inserting unicode in DAL +- Fixed other small bugs +- Better support for legacy databases (thank Denes) +- response.meta replaces response.author, response.keywords, response.description +- response.files stets dependes in plugins +- better admin for packing/unpacking plugins +- reference fiels nor evaluate to DALRef with lazy evaluation (cool, thanks Mr Freeze) +- can insert a record in place of a reference +- record[e] instead of record._extra[e] (tentatively!) +- record.update_record() with no args +- rows.find() (thanks Mr Freeze) +- rows.exclude() +- rows.sort() +- rows[:] + +## 1.70.1 +- Fixed bug with Rows.as_list and DALRef +- Added Rows.as_dict (thanks Mr Freeze and Thedeus) +- Added request.wsgi (thanks hcvst) allows running wsgi apps under web2py and applying wegi middleware to regular web2py actions that return strings. +- Experimental distributed transactions between postgresql, mysql and firebird +- Finally local_import is here! + +## 1.71.1 +- Complete rewrite of Rows +- renamed DALStorage->Rows, DALRef->Reference +- Experimental serializarion of Row and Rows (get serialized to dict and list of dict) +- DAL(...,folder) and template.render(content=, context=) make it more modular + +## 1.72.1 - 1.72.3 +- Better support for legacy databases + +## 1.73.1 +- Fixed problem with storage and comparison of Row objects +- Fixed problem with mail on GAE +- Fixed problem with T in IS_DATE(TIME) error_message and format +- Rows[i].delete_record() +- Even better support for legacy databases +- Experimantal support for non UTF8 encoding in DB +- Better IPV4 (thanks Thandeus) +- T.current_languages default to 'en' and new T.set_current_languages(...) (thanks Yarko) +- INPUT(...,hideerror=False) used to fix rare chechbox widget problem +- Admin allows change of admin password +- New gluon/contrib/populate.py +- Size of input/textarea set by CSS no more by jQuery (thanks Iceberg) +- Customizable CSV (thanks Thandeus) +- More bug fixed (thanks Thandeus) +- Better regex for template fixed Jython problem (thank Jonathan) + +## 1.74.1 +- Moved to mercurial +- Default validators use the new define_table(....,format='...') +- New get_vars and post_vars compatible in 2.5 and 2.6 (thanks Tim) +- Major rewrite of gql.py extends DAL syntax on GAE +- No more *.w2p, welcome.w2p is create automatically, base apps are always upgraded +- export_to_csv(delimiter = ',', quotechar = '"', quoting = csv.QUOTE_MINIMAL), thanks Thadeus + +## 1.74.2-4 +- Fix bugs including including unicode in emails and blobs on GAE + +## 1.74.5 +- bug fixes +- restored python 2.4 support,thanks ont.rif +- support for native types on Google App Engine +- cache.ram usage statictics, thanks Thadus +- no more auth manu in scaffolding +- no more spash screen with -Q +- fixed doctest in html.py, thanks Anand Vaidya +- export_to_csv_file has represent, thanks Thadeus + +## 1.74.6 +- bug fixes +- IS_IN_DB(...,_and=IS_NOT_IN_DB) +- Smaller populate, thanks Piotr +- better slicing of fields, thanks Michael Fig +- Cache stats, thanks Thadeus +- Better gql.py +- IS_IN_DB and IS_IN_SET default to zero='', no longer zero=None + +## 1.74.7 +- request_password_reset and password reset verification +- python web2py.py -S app -M -R script.py -A arg1 arg2 arg3 +- T("%(a)s") % dict(a="hello") + +## 1.74.8 +- IS_SLUG, thanks Gustavo and Jonathan +- web2py.py -nogui, thanks Jeff Bauer +- solved a problem with jython, thanks Tim Farrel +- login has "remember be option", thanks Piotr Banasziewicz +- fixed problem with keepvalue in update forms, thanks Miguel Lopez + +## 1.74.9 +- IS_IN_SET(((0,'label0'),(1,'label1'))), thanks Falko Krause +- SQLFORM(...).accpets stores True or False in boolean types no None, thanks Frederik Wagner +- SQLFORM.factory(...,table_name='no_table'), thanks Thedeus +- jQuery 1.4.1 +- Fixed major problem with internationalization of multiple languages. +- Fixed a serius security issue with login +- Possibly fixed some issues with cron + +## 1.75.1 +- better cron +- better fetch +- logging of email failures +- new web2py.fedora.sh +- new setup-web2py-ubuntu.sh +- experimental autocomplete +- menus work on IE6 + +## 1.75.2 +- fetch supports cache +- curd.update(....,onaccept=crud.archive) magic +- new UUID mechnism fixes session conflicts with cloned machine in cloud +- allow to upload app and overwrite existing old ones, thanks Jonathan +- print gluon.tools.prettydate(request.now,T), thanks Richard + +## 1.75.3 +- added support for PAM authentican for apps and for admin +- INTRODUCED MAJOR BUG IN BEAUTIFY (upgrade to 1.75.4) IMMEDIATELY + +## 1.75.4 +- customizable BEAUTIFY, thanks John + +## 1.75.5 +- fixed behaviour with languages.py, thanks Iceberg +- added chinese (thanks Iceberg) and Hungarian (thanks Gyuris) +- fixed problem with GAE deleted by id (thanks what_ho) +- fixed bug in LOAD with custom views, thanks vhang +- improved IS_IN_SET takes iterator, dict, list and list of tuples, thanks Iceberg +- Auth(...,controller='default') +- Fixed major bug in parsing repeated request.vars, thanks Ben +- IS_DATE and IS_DATETIME can now handle any 00).select(),headers='fieldname:capitalize') +- Oracle limitby improved (thanks Sergey) +- fixed migrations in Firebird, thanks Jose Jachuf +- gluon/contrib/login_methods/linkedin_account.py (to be tested) + +## 1.76.5 +- Fixed a typo in auth that created some registration problems + +## 1.77.1 +- Replaced CherryPy with Rocket web server, thanks Tim +- CacheOnDisk allows to specify a folder +- IS_DATE/DATETIME can handle any year since 0 +- SQLTABLE(...,headers='fieldname:capitalize') +- Field().with_alias, thanks Nathan and Mengu +- has_membership(group=...,role=...), thank Jonathan +- db.define_table(username=True), thanks Jonathan +- gluon.tools.prettydate +- can specify hostname in routes_out (same syntax as routes in), thanks Martin +- db.table.bulk_insert([...records...]) now works on GAE, thanks Jon +- IS_EMAIL validates on 'localhost', thanks Jonathan +- welcome/views/layout.html uses ez.css, thanks Yarko +- mail attachments support utf8, thanks szimszon +- works with PyPy, thanks Joe +- better Firebird support, thanks Jose +- better Oracle support, thanks Gabriele +- cron supports days of week +- SQLFORM(...,formstyle="table3cols") or "table2cols" or "divs" or "ul" +- crud.settings.formstyle +- web2py.py -f folder allows to specify locations of applications, thanks Iceberg +- better/faster regex in template works in Jython +- fixed lots of small bugs + +## 1.77.2 +- fixed x-index in calendar +## 1.77.3 +- some cleanup of code in compileapp + +## 1.78.1 +- new template system allows {{block name}}{{end}}, thanks Thadeus +- fixed mime headers in emails, included PGP in emails, thanks Gyuris +- automatic database retry connect when pooling and lost connections +- OPTGROUP helper, thanks Iceberg +- web2py_ajax_trap captures all form submissions, thank you Skiros +- multicolumn checkwidget and arbitrary chars in multiple is_in_set, thanks hy +- Québécois for welcome, thanks Chris +- crud.search(), thanks Mr Freeze +- DAL(...migrate,fake_migrate), thanks Thadeus + +## 1.78.3 +- reverted temporarily to old template system because of backward compatibility issues + +## 1.79.1 +- x509 emails, thanks Gyuris +- attachment and html in Mail on GAE, thanks PanosJee +- fixed docstring in SQLTABLE, thanks aabelyakov +- TAG(html) parese html into helpers (experimental, still some problems with unicode, , thanks RobertVa for unicode help) +- DIV.elements(find=re.compile(....)) +- DIV.flatten() +- DIV.elements('....') supports jQuery syntax in '....' +- better it-it.py and it.py, thanks Marcello Della Longa +- Many Bug fixes: +- improved support for DAL and joins in postgresql/oracle, thanks Nico de Groot +- bux fixex in html.py, thanks Ian +- fixed an issue with registration_key==None, thanks Jay Kelkar +- fixed bug in gql.py, thanks NoNoNo +- fixed problem with multiple and checkboxes, thanks MIchael Howden +- fixed bug in gae, thanks NoNoNo +- restored 2.4 compatibility, thanks Paolo Gasparello +- auth.update() when pictures in profile +- formstyle can be a function, thanks Howden +- escape in sanitizer, thanks Howes +- add missing settings, thanks Hamdy +- find and exclude return empty Rows instead of [], thanks iceberg +- simplejson 2.1.1 should fix compatibility problems +- added sms_utils and Authorize.net in contrib + +## 1.79.2 +- solved simplejson imcompatibility problem + +## 1.80.1 +- MARKMIN helper (no backward compatibility promise yet) +- self._last_reference, thanks Dave (no backward compatibility promise yet) +- IS_EQUAL_TO +- zh-tw and better internationalization page, thanks Daniel Lin and Iceberg +- better crud.search, thanks MrFreeze +- Rocket interfaces, thanks Nik Klever +- db.table.field.uploadseparate=True, thanks Gyuris +- SCOPE_IDENITY for MSSQL, thanks Jose +- fixed email attachment issue, thanks Bob_in_Comox +- fixed problem with groupby and IS_IN_DB +- other bug fixes +- new implementation for local_import +- ajax(..,...,null) +- fixed Chrome bug in calendar.js, thanks Iceberg +- experimental scrips/web2py-setup-fedora.sh +- generic.load, thanks Iceberg + +## 1.81.1 +- rpx (janrain) support out of the box, allows login with Facebook, MySpace, etc. Thanks Mr Freeze +- Increased security (escape single and double quotes, thanks Craig" +- Fixed a bug with db.table.field.uploadseparate=True and autodelete +- New welcome app with superfish and jQuery 1.4.2 +- Deleted openwysiwyg from admin +- In XML and xmlescape quote defaults to True. Both ' and " are escaped. Thanks Craig Younkins + +## 1.81.2 +- fixed bug in Auth + +## 1.81.3 +- fixed bug in label names in formstyle +- fixed id names in admin test.html page + +## 1.81.4 +- Fixed gluon.tools to work work with load and base.css to nowrap labels + +## 1.81.5 +- Fixed a few bugs. The most important bugs we fixed are in memcache (thanks Scott) and in a process starvation issue with Rocket (thanks Mike Ellis and Tim). + +## 1.82.1 +- request.ajax to detect if action is called via ajax, tahnks Jonathan and David Mako +- more captcha options, thanks Vidul +- openid and oauth2 thanks Michele and Keith +- better PluginManager and load components +- new template system, thanks Thadeus +- new db.table(id,[field=value]) and db.table(query) syntax +- URL('index') (no more r=request), thanks Thadeus +- mail.send(message='...', ....) +- DAL([....]) for load balancing +- @service.soap(...) with mysimplesoap, thanks Mariano +- hideerror + +## 1.83.1 +- New error reporting mechanism (thanks Mariano) +- New routing system with app level routing (thanks Jonathan) +- Integrated GAE appstat and GAE precompilation (thanks Scott) +- New Field types "list:string", "list:integer", "list:reference" +- request.cid, request.ajax, A(cid=request.cid), response.js + +## 1.83.2 +- mostly cleanup + +## 1.84.1-4 +- flash now stays put in the top right corner +- improved behavior for URL and T objects +- new app level logging with logging.conf (thanks Jonathan) +- improved OpenID (thanks Michele) +- web2py_ajax handles prepend, append, hide (thanks Juris) +- web2py_ajax also handels pre-validation of decimal fields +- ru-ru translation (thanks Michele) +- sk-sk translation (thanks Julius) +- migrations save .table only if changed and after each ALTER TABLE (no more mysql inconsistencies) +- fixed bugs in SQLCustomField, Field(default=...), IS_IMAGE, IS_DECIMAL_IN_RANGE and a few more. +- Better validators (IS_DECIMAL_IN_RANGE, IS_INT_IN_RANGE, etc) thanks Jonatham +- Polymmodel support on GAE +- Experimental ListWidget +- moved DAL and routes to thread.local (thanks Jonathan, again) +- scripts/extract_mysql_models.py, thanks Falko Krause and Ron McOuat +- scripts/dbsessions2trash.py, thanks Scott + +## 1.85.1-3 +- fixed some bugs +- added pyfpdf, thank Mariano + +## 1.86.1-1.86.3 +- markmin2latex +- markmin2pdf +- fixed some bugs +- Storage getfirst, getlast, getall by Kevin and Nathan +- db(db.table), db(db.table.id) both suported and equivalent to db(db.table.id>0) +- postresql ssl support +- less un-necessary logging and warnings on GAE +- IS_DECIMAL_IN_RANGE and IS_FLOAT_IN_RANGE support dot="," (dot="." is default) +- on_failed_authorization can be a function, thanks Niphold +- gluon/contrib/login_methods/cas_auth.py for integration between CAS and Auth. + +## 1.86.3 +- Error reporting on save, thanks Mariano +recalled + +## 1.87.1-2 +- new layout for examples, thanks Bruno and Martin +- admin allow ``DEMO_MODE=True`` and ``FILTER_APPS=['welcome']`` +- fixed a possible problem with CRON and paths + + +## 1.87.3 +- fixed a major bug introduced in 1.87.1 that prevents appadmin from working for new apps created with 1.87.1-2. +- upgraded to clockpick 1.28, thanks villas + +## 1.88.1-2 +- better list: string support, thanks Bob +- jquery 1.4.3 +- scripts/autoroutes.py +- new admin wizard +- added retrieve_username to navbar (if username) +- internal rewrite for arbitrary paths (abspath), thanks Jonathan +- populate support for list: and decimal, thanks Chirstian +- markmin2latex has extra attribute +- better mercual admin allows list of files, versions and retrieve +- new error report system, thanks Thadeus and Selecta +- SQLFORM.accepts(detect_record_change).record_changed +- fixed cron for bytecode compiled apps, thanks Ãlvaro J. Iradier Muro +- other bugs fixes and pep8 compliant fixes + +## 1.89.1-.5 +- new admin layout (thanks Branko Vukelic) +- new admin search +- new admin language selector (thanks Yair) +- new Welcome app (thanks Martin Mulone) +- better wizard +- admin support for DEMO_MODE=True +- admin exposes GAE deployment button (always) +- MENU support None links (thanks Michael Wolfe) +- web2py.py -J for running cron (thanks Jonathan Lundell) +- fixed ~db.table.id on GAE (thanks MicLee) +- service.jsonrpc supports service.JsonRpcException (thanks Matt) +- bug fixes + +## 1.90.1 +- new DAL (complete rewrite of the web2py DAL is more modular) +- rewrite has fail safe reload, thanks Jonathan +- better CAS with v2 support, thanks Olivier ROCH VILATO +- better markmin2latex +- session.connect(separate=True) to handle many session files, thanks huaiyu wang +- changed bahvior of impersonate (more secure, can generate form or used as API) +- new rocket, thanks Tim +- new pyfpdf +- no more old style classes +- experimental couchdb support in new dal (only insert, select, update by id) +- mysql support out of the box via pymysql +- SQLITABLE(...,headers='labels') thanks Bruno +- optional: digitally signed URLs, thanks Brian Meredyk +- minor bug fixes + +## 1.90.2-4 +- pymysql no longer requires ssl (if not used) +- fixed bug with virtualfields +- fixed bug in truncate (new dal) +- fixed bug in select with alternate primary key (new dal) +- fixed bug with IS_IN_DB and self refences (also new dal) + +## 1.90.5 +- set poll = False in rocket because of poll python thread bug often unfixed, thanks Jonathan +- fixes issue with crud and reCaptcha + +## 1.90.6 +- fix issue with pickling new dal Row and Rows. + +## 1.91.1 +- LICENSE CHANGE FROM GPLv2 to LGPLv3 +- URL(...,hash_vars=...) allows to specify which vars need to be signed +- fixed bug with aliasing in new DAL + +## 1.91.2-1.91.5 +- fixed a problem with deplyment on GAE +- other new dal bug fixes + +## 1.91.6 +- web2py comet via gluon/contrib/comet_messaging.py (html5 websockets) experimental +- fixed problem with services (broken in 1.91.5), thanks Vollrath +- customizable uploadwidget, thanks Fran +- fixed problem with mail unicode support, thanks Richard +- fixed problem with linkto=None and references fields in SQLTABLE, thanks villas +- no more upgrade button on windows since does not work +- better remember-me login, thanks Martin Weissenboeck +- support for recatcha options +- support for GAE namespaces via DAL('gae://namespace') +- new rocket (1.2.2), thanks Tim +- many other bug fixes and improvements (thanks Jonathan) + +## 1.92.1 +- much improved routing (thanks Jonathan) +- Expression.__mod__ (thanks Denes) +- admin has MULTI_USER_MODE (admin/models/0.py) +- support for count(distinct=...) +- has_permissions(...,group_id) +- IS_MATCH(...,strict=True) +- URL(...,scheme=,host=,port=), thanks Jonathan +- admin in Afrikaans, thanks Caleb +- auth.signature (experimental) +- many other bug fixes + +## 1.93.1-2 +- support for multiple interfaces, thanks Jonathan +- jquery 1.5.1 +- simplejson 2.1.3 +- customizable simplejson +- leaner app.yaml +- css3 buttons in welcome +- android support (experimental) +- Field(':hidden'), Field('.readonly'), Field('name=value') +- combined expressions print db.data.body.len().sum() +- wizard can download plugins +- better json serilization (object.custom_json) +- better xml serialization (object.custom_xml) +- better formstyle support +- better comet_messaging.py (needs more testing) +- many bug fixes + +## 1.94.1 +- moderniz 1.17 +- web2py no longer saves session if no change, this makes it up up to 10x faster for simple actions +- experimental REST API +- better support for MSSQL NOT NULL +- small bug fixes + +## 1.94.2 +- reverted wrong behavior of auth.requires(condition) in 1.94.1 + +## 1.94.3 +- fixed major bug in auth redirection + +## 1.94.4 +- removed debug print statement that caused problems on GAE and mod_wsgi + +## 1.94.5 +- fixed a major bug with session introdued in 1.94.1 + +## 1.94.6 +- fixed a number of minor bugs including adding some missing files +- better session handling on session._unlock(..), thanks Jonathan +- added experimental pip support, thanks Lifeeth +- added experimental SAP DB support + +## 1.95.1 +- Google MySQL support (experimental) +- pip support, thanks lifeeth +- better setup_exe.py, thanks meredyk +- importved pyfpdf +- domain check in email_auth.py, thanks Gyuris +- added change_password_onvalidation and change_password_onaccept +- DAL(...,migrate_enabled=True) +- login_methods/loginza.py, thanks Vladimir +- bpython shell support, thanks Arun +- request.uuid and response.uuid (for a future toolbar) +- db._timings contains database query timing info +- efficient db(...).isempty() +- setup-web2py-nginx-uwsgi-ubuntu.sh +- Many bug fixes, thanks Jonathan + +## 1.96.1 + +- "from gluon import *" imports in every python module a web2py environment (A, DIV,..SQLFORM, DAL, Field,...) including current.request, current.response, current.session, current.T, current.cache, thanks Jonathan. +- conditional models in + models//a.py and models///a.py +- from mymodule import *, looks for mymodule in applications/thisapp/modules first and then in sys.path. No more need for local_import. Thanks Pierre. +- usage of generic.* views is - by default - restricted to localhost for security. This can be changed in a granular way with: response.generic_patterns=['*']. This is a slight change of behavior for new app but a major security fix. + +- all applications have cas 2.0 provider at http://.../user/cas/login +- all applications can delegate to login to external provider Auth(...,cas_provider='http://.../other_app/default/user/cas') +- A(...,callback=URL(...),larget='id') does Ajax +- URL(...,user_signature=True), LOAD(...,user_signature=True) can sign urls and @auth.requires_signature() will check the signature for any decorated action. + +- DAL(...,migrate_enabled=False) to disable all migrations +- DAL(...,fake_migrate_all=True) to rebuild all corrupted metadata +- new DAL metadata format (databases/*.table) +- DAL(...,adapter_arg={}) allows support for alternate drivers +- DAL now allows circular table defintions +- DAL(..,auto_import=True) automatically imports tables from metadata without need to db.define_table(...)s. +- new alterante syntax for inner joins: db(...).select(join=...) +- experimental cubrid database support +- DAL 'request_tenant' fields are special, the altomatically filer all records based on their default value. +- db._common_fields.append(Field('owner')) allows to add fields to ALL tables +- DAL ignores repeated fields with same names + +- web2py_ajax.html is more modular, thanks Anthony +- request.is_local +- request.is_http +- new sessions2trash.py thanks Jim Karsten +- corrupted cache files are automatically deleted +- new simpler API gluon.contrib.AuthorizeNet.procss(...) +- fixed recaptcha (as they released new API) +- messages in validators have default internationalization +- No more Auth(globals(),db), just Auth(db). Same for Crud and Service. +- scripts/access.wsgi allows apache+mod_wsgi to delegate authentication of any URL to any web2py app +- json now supports T(...) +- scripts/setup-web2py-nginx-uwsgi-ubuntu.sh +- web2py HTTP responses now set: "X-Powered-By: web2py", thanks Bruno +- mostly fixed generic.pdf. You can view any page in PDF if you have pdflatex installed or if your html follows the pyfpdf convention. +- auth.settings.extra_fields['auth_user'].append(Field('country')) allows to extend auth_* tables without need of definiting a custom auth_* table. Must be placed before auth.define_tables() +- {{=response.toolbar()}} to help you debug applications +- web based shell now supports object modifications (but no redefinitions of non-serializable types) +- jQuery 1.6.1 +- Lots of bug fixes + +# 1.96.2-1.96.4 +- bug fixes + +# 1.97.1 +- validate_and_update, thanks Bruno +- fixed problem with new custom import, thanks Mart +- fixed pyamf 0.6, thanks Alexei and Nickd +- fixed "+ =" bug in wizard +- fixed problem with allowed_patterns +- fixed problems with LOAD and vars and ajax +- closed lots of google code tickets +- checkboxes should now work with list:string +- web2py works on Android, thanks Corne Dickens +- new cpdb.py, thanks Mart +- improved translation (frech in particuler), thanks Pierre +- improved cas_auth.py, thanks Sergio +- IS_DATE and IS_DATETIME validators now work with native types +- better description of --shell, thanks Anthony +- extra SQLTABLE columns, thanks Martin +- fixed toolbar conflics, thanks Simon +- GAE password shows with **** + +# 1.98.1-1.98.2 +- fixed some problems with LOAD(ajax=False), thanks Anthony +- jquery 1.6.2 +- gevent.pywsgi adds ssl support, thanks Vasile +- import/export of blobs are base64 encoded +- max number of login attemts in admin, thanks Ross +- fixed joins with alias tables +- new field.custom_delete attribute +- removed resctions on large 'text fields, thanks Martin +- field.represent = lambda value,record: .... (record is optional) +- FORM.validate() and FORM.process(), thanks Bruno +- faster visrtualfields, thanks Howsec +- mail has ssl support separate from tls, thanks Eric +- TAG objects are now pickable +- new CAT tag for no tags +- request.user_agent(), thanks Ross +- fixed fawps support +- SQLFORM(...,separator=': ') now customizable +- many small bug fixes + +## 1.99.1 +- gluon/contrib/simplejsonrpc.py +- gluon/contrib/redis_cache.py +- support for A(name,callback=url,target='id',delete='tr') +- support for A(name,component=url,target='id',delete='tr') +- new pip installer, thanks Chris Steel +- isapiwsgihandler.py +- dal expression.coalesce(*options) +- gluon/contrib/simplejsonrpc.py, thanks Mariano +- expire_sessions.py respects expiration time, thanks iceberg +- addressed this issue: http://fuelyourcoding.com/jquery-events-stop-misusing-return-false/ +- x509 support (thanks Michele) +- form.process() and for.validate() +- rocket upgrade (1.2.4) +- jQuery upgrade (1.6.3) +- new syntax rows[i]('tablename.fieldname') +- new query syntax field.contains(list,all=True or False) +- new SQLFORM.grid and SQLFORM.smartgrid (should replace crud.search and crud.select) +- support for natural language queries (english only) in SQLFORM.grid +- support for computed columns and additional links in SQLFORM.grid +- new style virtual fields (experimental): db.table.field=Field.Lazy(...) +- request.utcnow +- cleaner/simpler welcome/models/db.py and welcome layout.html +- response.include_meta() and response.include_files(), thanks Denes +- dal auto-reconnect on time-out connections +- COL and COLGROUP helpers +- addresed OWASP #10, thanks Anthony and Eric +- auth.settings.login_after_registration=True +- detection of mobile devices and @mobilize helper (view.mobile.html), thanks Angelo +- experimental gluon/scheduler.py +- scripts/make_min_web2py.py +- crud.search has more options, thanks Denes +- many bug fixes (thanks Jonathan, Michele, Fran and others) diff --git a/TODO b/TODO new file mode 100644 index 00000000..3eea8037 --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +idea for scheduler +http://panela.blog-city.com/how_to_timeout_in_python_with_multiprocessing.htm + diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..73f696c1 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +Version 1.99.3 (2011-11-22 08:38:58) dev diff --git a/__init__.py b/__init__.py new file mode 100644 index 00000000..b28b04f6 --- /dev/null +++ b/__init__.py @@ -0,0 +1,3 @@ + + + diff --git a/anyserver.py b/anyserver.py new file mode 100644 index 00000000..e397ff8f --- /dev/null +++ b/anyserver.py @@ -0,0 +1,300 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +This file is part of the web2py Web Framework +Copyrighted by Massimo Di Pierro +License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) + +This file is based, although a rewrite, on MIT-licensed code from the Bottle web framework. +""" + +import os, sys, optparse, urllib +path = os.path.dirname(os.path.abspath(__file__)) +os.chdir(path) +sys.path = [path]+[p for p in sys.path if not p==path] +import gluon.main +from gluon.fileutils import read_file, write_file + +class Servers: + @staticmethod + def cgi(app, address=None, **options): + from wsgiref.handlers import CGIHandler + CGIHandler().run(app) # Just ignore host and port here + + @staticmethod + def flup(app,address, **options): + import flup.server.fcgi + flup.server.fcgi.WSGIServer(app, bindAddress=address).run() + + @staticmethod + def wsgiref(app,address,**options): # pragma: no cover + from wsgiref.simple_server import make_server, WSGIRequestHandler + class QuietHandler(WSGIRequestHandler): + def log_request(*args, **kw): pass + options['handler_class'] = QuietHandler + srv = make_server(address[0],address[1],app,**options) + srv.serve_forever() + + @staticmethod + def cherrypy(app,address, **options): + from cherrypy import wsgiserver + server = wsgiserver.CherryPyWSGIServer(address, app) + server.start() + + @staticmethod + def rocket(app,address, **options): + from gluon.rocket import CherryPyWSGIServer + server = CherryPyWSGIServer(address, app) + server.start() + + @staticmethod + def rocket_with_repoze_profiler(app,address, **options): + from gluon.rocket import CherryPyWSGIServer + from repoze.profile.profiler import AccumulatingProfileMiddleware + from gluon.settings import global_settings + global_settings.web2py_crontype = 'none' + wrapped = AccumulatingProfileMiddleware( + app, + log_filename='wsgi.prof', + discard_first_request=True, + flush_at_shutdown=True, + path = '/__profile__' + ) + server = CherryPyWSGIServer(address, wrapped) + server.start() + + @staticmethod + def paste(app,address,**options): + from paste import httpserver + from paste.translogger import TransLogger + httpserver.serve(app, host=address[0], port=address[1], **options) + + @staticmethod + def fapws(app,address, **options): + import fapws._evwsgi as evwsgi + from fapws import base + evwsgi.start(address[0],str(address[1])) + evwsgi.set_base_module(base) + def app(environ, start_response): + environ['wsgi.multiprocess'] = False + return app(environ, start_response) + evwsgi.wsgi_cb(('',app)) + evwsgi.run() + + + @staticmethod + def gevent(app,address, **options): + from gevent import monkey; monkey.patch_all() + from gevent import pywsgi + from gevent.pool import Pool + pywsgi.WSGIServer(address, app, spawn = 'workers' in options and Pool(int(options.workers)) or 'default').serve_forever() + + @staticmethod + def bjoern(app,address, **options): + import bjoern + bjoern.run(app, *address) + + @staticmethod + def tornado(app,address, **options): + import tornado.wsgi + import tornado.httpserver + import tornado.ioloop + container = tornado.wsgi.WSGIContainer(app) + server = tornado.httpserver.HTTPServer(container) + server.listen(address=address[0], port=address[1]) + tornado.ioloop.IOLoop.instance().start() + + @staticmethod + def twisted(app,address, **options): + from twisted.web import server, wsgi + from twisted.python.threadpool import ThreadPool + from twisted.internet import reactor + thread_pool = ThreadPool() + thread_pool.start() + reactor.addSystemEventTrigger('after', 'shutdown', thread_pool.stop) + factory = server.Site(wsgi.WSGIResource(reactor, thread_pool, app)) + reactor.listenTCP(address[1], factory, interface=address[0]) + reactor.run() + + @staticmethod + def diesel(app,address, **options): + from diesel.protocols.wsgi import WSGIApplication + app = WSGIApplication(app, port=address[1]) + app.run() + + @staticmethod + def gnuicorn(app,address, **options): + import gunicorn.arbiter + gunicorn.arbiter.Arbiter(address, 4, app).run() + + @staticmethod + def eventlet(app,address, **options): + from eventlet import wsgi, listen + wsgi.server(listen(address), app) + + @staticmethod + def mongrel2(app,address,**options): + import uuid + sys.path.append(os.path.abspath(os.path.dirname(__file__))) + from mongrel2 import handler + conn = handler.Connection(str(uuid.uuid4()), + "tcp://127.0.0.1:9997", + "tcp://127.0.0.1:9996") + mongrel2_handler(app,conn,debug=False) + + +def run(servername,ip,port,softcron=True,logging=False,profiler=None): + if logging: + application = gluon.main.appfactory(wsgiapp=gluon.main.wsgibase, + logfilename='httpserver.log', + profilerfilename=profiler) + else: + application = gluon.main.wsgibase + if softcron: + from gluon.settings import global_settings + global_settings.web2py_crontype = 'soft' + getattr(Servers,servername)(application,(ip,int(port))) + +def mongrel2_handler(application,conn,debug=False): + """ + Based on : + https://github.com/berry/Mongrel2-WSGI-Handler/blob/master/wsgi-handler.py + + WSGI handler based on the Python wsgiref SimpleHandler. + A WSGI application should return a iterable op StringTypes. + Any encoding must be handled by the WSGI application itself. + """ + from wsgiref.handlers import SimpleHandler + try: + import cStringIO as StringIO + except: + import StringIO + + # TODO - this wsgi handler executes the application and renders a page + # in memory completely before returning it as a response to the client. + # Thus, it does not "stream" the result back to the client. It should be + # possible though. The SimpleHandler accepts file-like stream objects. So, + # it should be just a matter of connecting 0MQ requests/response streams to + # the SimpleHandler requests and response streams. However, the Python API + # for Mongrel2 doesn't seem to support file-like stream objects for requests + # and responses. Unless I have missed something. + + while True: + if debug: print "WAITING FOR REQUEST" + + # receive a request + req = conn.recv() + if debug: print "REQUEST BODY: %r\n" % req.body + + if req.is_disconnect(): + if debug: print "DISCONNECT" + continue #effectively ignore the disconnect from the client + + # Set a couple of environment attributes a.k.a. header attributes + # that are a must according to PEP 333 + environ = req.headers + environ['SERVER_PROTOCOL'] = 'HTTP/1.1' # SimpleHandler expects a server_protocol, lets assume it is HTTP 1.1 + environ['REQUEST_METHOD'] = environ['METHOD'] + if ':' in environ['Host']: + environ['SERVER_NAME'] = environ['Host'].split(':')[0] + environ['SERVER_PORT'] = environ['Host'].split(':')[1] + else: + environ['SERVER_NAME'] = environ['Host'] + environ['SERVER_PORT'] = '' + environ['SCRIPT_NAME'] = '' # empty for now + environ['PATH_INFO'] = urllib.unquote(environ['PATH']) + if '?' in environ['URI']: + environ['QUERY_STRING'] = environ['URI'].split('?')[1] + else: + environ['QUERY_STRING'] = '' + if environ.has_key('Content-Length'): + environ['CONTENT_LENGTH'] = environ['Content-Length'] # necessary for POST to work with Django + environ['wsgi.input'] = req.body + + if debug: print "ENVIRON: %r\n" % environ + + # SimpleHandler needs file-like stream objects for + # requests, errors and responses + reqIO = StringIO.StringIO(req.body) + errIO = StringIO.StringIO() + respIO = StringIO.StringIO() + + # execute the application + handler = SimpleHandler(reqIO, respIO, errIO, environ, multithread = False, multiprocess = False) + handler.run(application) + + # Get the response and filter out the response (=data) itself, + # the response headers, + # the response status code and the response status description + response = respIO.getvalue() + response = response.split("\r\n") + data = response[-1] + headers = dict([r.split(": ") for r in response[1:-2]]) + code = response[0][9:12] + status = response[0][13:] + + # strip BOM's from response data + # Especially the WSGI handler from Django seems to generate them (2 actually, huh?) + # a BOM isn't really necessary and cause HTML parsing errors in Chrome and Safari + # See also: http://www.xs4all.nl/~mechiel/projects/bomstrip/ + # Although I still find this a ugly hack, it does work. + data = data.replace('\xef\xbb\xbf', '') + + # Get the generated errors + errors = errIO.getvalue() + + # return the response + if debug: print "RESPONSE: %r\n" % response + if errors: + if debug: print "ERRORS: %r" % errors + data = "%s\r\n\r\n%s" % (data, errors) + conn.reply_http(req, data, code = code, status = status, headers = headers) + +def main(): + usage = "python anyserver.py -s tornado -i 127.0.0.1 -p 8000 -l -P" + try: + version = read_file('VERSION') + except IOError: + version = '' + parser = optparse.OptionParser(usage, None, optparse.Option, version) + parser.add_option('-l', + '--logging', + action='store_true', + default=False, + dest='logging', + help='log into httpserver.log') + parser.add_option('-P', + '--profiler', + default=False, + dest='profiler', + help='profiler filename') + servers = ', '.join(x for x in dir(Servers) if not x[0]=='_') + parser.add_option('-s', + '--server', + default='rocket', + dest='server', + help='server name (%s)' % servers) + parser.add_option('-i', + '--ip', + default='127.0.0.1', + dest='ip', + help='ip address') + parser.add_option('-p', + '--port', + default='8000', + dest='port', + help='port number') + parser.add_option('-w', + '--workers', + default='', + dest='workers', + help='number of workers number') + (options, args) = parser.parse_args() + print 'starting %s on %s:%s...' % (options.server,options.ip,options.port) + run(options.server,options.ip,options.port,logging=options.logging,profiler=options.profiler) + + +if __name__=='__main__': + main() + diff --git a/app.example.yaml b/app.example.yaml new file mode 100644 index 00000000..538bfdeb --- /dev/null +++ b/app.example.yaml @@ -0,0 +1,86 @@ +# For Google App Engine deployment, copy this file to app.yaml +# and edit as required +# See http://code.google.com/appengine/docs/python/config/appconfig.html +# and http://web2py.com/book/default/chapter/11?search=app.yaml + +application: web2py +version: 1 +api_version: 1 + +# use this line for Python 2.5 +# +runtime: python + +# use these lines for Python 2.7 +# upload app with: appcfg.py update web2py (where 'web2py' is web2py's root directory) +# +# runtime: python27 +# threadsafe: true # true for WSGI & concurrent requests (Python 2.7 only) + +default_expiration: "24h" # for static files + +handlers: + +- url: /(?P.+?)/static/(?P.+) + static_files: applications/\1/static/\2 + upload: applications/(.+?)/static/(.+) + secure: optional + +- url: /favicon.ico + static_files: applications/welcome/static/favicon.ico + upload: applications/welcome/static/favicon.ico + +- url: /robots.txt + static_files: applications/welcome/static/robots.txt + upload: applications/welcome/static/robots.txt + +- url: .* + script: gaehandler.py # CGI +# script: gaehandler.wsgiapp # WSGI (Python 2.7 only) + secure: optional + +admin_console: + pages: + - name: Appstats + url: /_ah/stats + +skip_files: | + ^(.*/)?( + (app\.yaml)| + (app\.yml)| + (index\.yaml)| + (index\.yml)| + (#.*#)| + (.*~)| + (.*\.py[co])| + (.*/RCS/.*)| + (\..*)| + (applications/(admin|examples)/.*)| + ((admin|examples|welcome)\.(w2p|tar))| + (applications/.*?/(cron|databases|errors|cache|sessions)/.*)| + ((logs|scripts)/.*)| + (anyserver\.py)| + (web2py\.py)| + ((cgi|fcgi|modpython|wsgi)handler\.py)| + (epydoc\.(conf|css))| + (httpserver\.log)| + (logging\.example\.conf)| + (route[rs]\.example\.py)| + (setup_(app|exe)\.py)| + (splashlogo\.gif)| + (parameters_\d+\.py)| + (options_std.py)| + (gluon/tests/.*)| + (gluon/(rocket|winservice)\.py)| + (contrib/(gateways|markdown|memcache|pymysql)/.*)| + (contrib/(populate|taskbar_widget)\.py)| + (google_appengine/.*)| + (.*\.(bak|orig))| + )$ + +builtins: +- remote_api: on +- datastore_admin: on +- appstats: on +- admin_redirect: on +- deferred: on diff --git a/appengine_config.py b/appengine_config.py new file mode 100644 index 00000000..e1926ef6 --- /dev/null +++ b/appengine_config.py @@ -0,0 +1,5 @@ +def webapp_add_wsgi_middleware(app): + from google.appengine.ext.appstats import recording + app = recording.appstats_wsgi_middleware(app) + return app + diff --git a/applications/admin/ABOUT b/applications/admin/ABOUT new file mode 100644 index 00000000..646a97d2 --- /dev/null +++ b/applications/admin/ABOUT @@ -0,0 +1,6 @@ +web2py is an open source full-stack framework for agile development +of secure database-driven web-based applications, written and programmable in +Python. + +Created by Massimo Di Pierro + diff --git a/applications/admin/LICENSE b/applications/admin/LICENSE new file mode 100644 index 00000000..53e03dc8 --- /dev/null +++ b/applications/admin/LICENSE @@ -0,0 +1,137 @@ +## Web2py License + +Web2py is Licensed under the LGPL license version 3 +(http://www.gnu.org/licenses/lgpl.html) + +Copyrighted (c) by Massimo Di Pierro (2007-2011) + +### On Commercial Redistribution + +In accordance with LGPL you may: +- redistribute web2py with your apps (including official web2py binary versions) +- release your applications which use official web2py libraries under any license you wish +But you must: +- make clear in the documentation that your application uses web2py +- release any modification of the web2py libraries under the LGPLv3 license + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM “AS IS†WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR OR CORRECTION. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT +HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, +BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL +DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES +OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +(Earlier versions of web2py, 1.0.*-1.90.*, were released under the GPL2 license plus a +commercial exception which, for practical purposes, was very similar to the current LPGLv3) + +### Licenses for third party contributed software + +web2py contains third party software under the gluon/contrib/ folder. +Each file/module in contrib is distributed with web2py under its original license. +Here we list some of them. + +#### gluon.contrib.simplejson LICENSE + +Copyright (c) 2006 Bob Ippolito - 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. + +#### gluon.contrib.rss2.py (originally PyRSS2Gen) LICENSE + +This is copyright (c) by Dalke Scientific Software, LLC and released under the +BSD license. See the file LICENSE in the distribution or + for details. + +#### gluon.contrib.markdown (markdown2) LICENSE + +MIT License from from + +#### gluon.contrib.feedparser LICENSE + +Copyright (c) 2002-2005, Mark Pilgrim + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +#### gluon.wsgiserver.py LICENSE (borrowed from cherrypy) + +Copyright (c) 2004, CherryPy Team (team@cherrypy.org) +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the CherryPy Team nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#### gluon.contrib.pam LICENSE + +Copyright (C) 2007-2009 Chris AtLee Licensed under the MIT license + +#### gluon.contrib.shell LICENSE + +Copyright (C) by Google inc. Apache 2.0 Lincense + +#### The javascript licenses are in the code itself + diff --git a/applications/admin/__init__.py b/applications/admin/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/applications/admin/controllers/appadmin.py b/applications/admin/controllers/appadmin.py new file mode 100644 index 00000000..d20eb874 --- /dev/null +++ b/applications/admin/controllers/appadmin.py @@ -0,0 +1,430 @@ +# -*- coding: utf-8 -*- + +# ########################################################## +# ## make sure administrator is on localhost +# ########################################################### + +import os +import socket +import datetime +import copy +import gluon.contenttype +import gluon.fileutils + +# ## critical --- make a copy of the environment + +global_env = copy.copy(globals()) +global_env['datetime'] = datetime + +http_host = request.env.http_host.split(':')[0] +remote_addr = request.env.remote_addr +try: + hosts = (http_host, socket.gethostname(), + socket.gethostbyname(http_host), + '::1','127.0.0.1','::ffff:127.0.0.1') +except: + hosts = (http_host, ) + +if request.env.http_x_forwarded_for or request.env.wsgi_url_scheme\ + in ['https', 'HTTPS']: + session.secure() +elif (remote_addr not in hosts) and (remote_addr != "127.0.0.1"): + raise HTTP(200, T('appadmin is disabled because insecure channel')) + +if (request.application=='admin' and not session.authorized) or \ + (request.application!='admin' and not gluon.fileutils.check_credentials(request)): + redirect(URL('admin', 'default', 'index', + vars=dict(send=URL(args=request.args,vars=request.vars)))) + +ignore_rw = True +response.view = 'appadmin.html' +response.menu = [[T('design'), False, URL('admin', 'default', 'design', + args=[request.application])], [T('db'), False, + URL('index')], [T('state'), False, + URL('state')], [T('cache'), False, + URL('ccache')]] + +# ########################################################## +# ## auxiliary functions +# ########################################################### + + +def get_databases(request): + dbs = {} + for (key, value) in global_env.items(): + cond = False + try: + cond = isinstance(value, GQLDB) + except: + cond = isinstance(value, SQLDB) + if cond: + dbs[key] = value + return dbs + + +databases = get_databases(None) + + +def eval_in_global_env(text): + exec ('_ret=%s' % text, {}, global_env) + return global_env['_ret'] + + +def get_database(request): + if request.args and request.args[0] in databases: + return eval_in_global_env(request.args[0]) + else: + session.flash = T('invalid request') + redirect(URL('index')) + + +def get_table(request): + db = get_database(request) + if len(request.args) > 1 and request.args[1] in db.tables: + return (db, request.args[1]) + else: + session.flash = T('invalid request') + redirect(URL('index')) + + +def get_query(request): + try: + return eval_in_global_env(request.vars.query) + except Exception: + return None + + +def query_by_table_type(tablename,db,request=request): + keyed = hasattr(db[tablename],'_primarykey') + if keyed: + firstkey = db[tablename][db[tablename]._primarykey[0]] + cond = '>0' + if firstkey.type in ['string', 'text']: + cond = '!=""' + qry = '%s.%s.%s%s' % (request.args[0], request.args[1], firstkey.name, cond) + else: + qry = '%s.%s.id>0' % tuple(request.args[:2]) + return qry + + + +# ########################################################## +# ## list all databases and tables +# ########################################################### + + +def index(): + return dict(databases=databases) + + +# ########################################################## +# ## insert a new record +# ########################################################### + + +def insert(): + (db, table) = get_table(request) + form = SQLFORM(db[table], ignore_rw=ignore_rw) + if form.accepts(request.vars, session): + response.flash = T('new record inserted') + return dict(form=form,table=db[table]) + + +# ########################################################## +# ## list all records in table and insert new record +# ########################################################### + + +def download(): + import os + db = get_database(request) + return response.download(request,db) + +def csv(): + import gluon.contenttype + response.headers['Content-Type'] = \ + gluon.contenttype.contenttype('.csv') + db = get_database(request) + query = get_query(request) + if not query: + return None + response.headers['Content-disposition'] = 'attachment; filename=%s_%s.csv'\ + % tuple(request.vars.query.split('.')[:2]) + return str(db(query).select()) + + +def import_csv(table, file): + table.import_from_csv_file(file) + +def select(): + import re + db = get_database(request) + dbname = request.args[0] + regex = re.compile('(?P\w+)\.(?P\w+)=(?P\d+)') + if len(request.args)>1 and hasattr(db[request.args[1]],'_primarykey'): + regex = re.compile('(?P
\w+)\.(?P\w+)=(?P.+)') + if request.vars.query: + match = regex.match(request.vars.query) + if match: + request.vars.query = '%s.%s.%s==%s' % (request.args[0], + match.group('table'), match.group('field'), + match.group('value')) + else: + request.vars.query = session.last_query + query = get_query(request) + if request.vars.start: + start = int(request.vars.start) + else: + start = 0 + nrows = 0 + stop = start + 100 + table = None + rows = [] + orderby = request.vars.orderby + if orderby: + orderby = dbname + '.' + orderby + if orderby == session.last_orderby: + if orderby[0] == '~': + orderby = orderby[1:] + else: + orderby = '~' + orderby + session.last_orderby = orderby + session.last_query = request.vars.query + form = FORM(TABLE(TR(T('Query:'), '', INPUT(_style='width:400px', + _name='query', _value=request.vars.query or '', + requires=IS_NOT_EMPTY(error_message=T("Cannot be empty")))), TR(T('Update:'), + INPUT(_name='update_check', _type='checkbox', + value=False), INPUT(_style='width:400px', + _name='update_fields', _value=request.vars.update_fields + or '')), TR(T('Delete:'), INPUT(_name='delete_check', + _class='delete', _type='checkbox', value=False), ''), + TR('', '', INPUT(_type='submit', _value='submit'))), + _action=URL(r=request,args=request.args)) + if request.vars.csvfile != None: + try: + import_csv(db[request.vars.table], + request.vars.csvfile.file) + response.flash = T('data uploaded') + except Exception, e: + response.flash = DIV(T('unable to parse csv file'),PRE(str(e))) + if form.accepts(request.vars, formname=None): +# regex = re.compile(request.args[0] + '\.(?P
\w+)\.id\>0') + regex = re.compile(request.args[0] + '\.(?P
\w+)\..+') + + match = regex.match(form.vars.query.strip()) + if match: + table = match.group('table') + try: + nrows = db(query).count() + if form.vars.update_check and form.vars.update_fields: + db(query).update(**eval_in_global_env('dict(%s)' + % form.vars.update_fields)) + response.flash = T('%s rows updated', nrows) + elif form.vars.delete_check: + db(query).delete() + response.flash = T('%s rows deleted', nrows) + nrows = db(query).count() + if orderby: + rows = db(query).select(limitby=(start, stop), + orderby=eval_in_global_env(orderby)) + else: + rows = db(query).select(limitby=(start, stop)) + except Exception, e: + (rows, nrows) = ([], 0) + response.flash = DIV(T('Invalid Query'),PRE(str(e))) + return dict( + form=form, + table=table, + start=start, + stop=stop, + nrows=nrows, + rows=rows, + query=request.vars.query, + ) + + +# ########################################################## +# ## edit delete one record +# ########################################################### + + +def update(): + (db, table) = get_table(request) + keyed = hasattr(db[table],'_primarykey') + record = None + if keyed: + key = [f for f in request.vars if f in db[table]._primarykey] + if key: + record = db(db[table][key[0]] == request.vars[key[0]]).select().first() + else: + record = db(db[table].id == request.args(2)).select().first() + + if not record: + qry = query_by_table_type(table, db) + session.flash = T('record does not exist') + redirect(URL('select', args=request.args[:1], + vars=dict(query=qry))) + + if keyed: + for k in db[table]._primarykey: + db[table][k].writable=False + + form = SQLFORM(db[table], record, deletable=True, delete_label=T('Check to delete'), + ignore_rw=ignore_rw and not keyed, + linkto=URL('select', + args=request.args[:1]), upload=URL(r=request, + f='download', args=request.args[:1])) + + if form.accepts(request.vars, session): + session.flash = T('done!') + qry = query_by_table_type(table, db) + redirect(URL('select', args=request.args[:1], + vars=dict(query=qry))) + return dict(form=form,table=db[table]) + + +# ########################################################## +# ## get global variables +# ########################################################### + + +def state(): + return dict() + +def ccache(): + form = FORM( + P(TAG.BUTTON("Clear CACHE?", _type="submit", _name="yes", _value="yes")), + P(TAG.BUTTON("Clear RAM", _type="submit", _name="ram", _value="ram")), + P(TAG.BUTTON("Clear DISK", _type="submit", _name="disk", _value="disk")), + ) + + if form.accepts(request.vars, session): + clear_ram = False + clear_disk = False + session.flash = "" + if request.vars.yes: + clear_ram = clear_disk = True + if request.vars.ram: + clear_ram = True + if request.vars.disk: + clear_disk = True + + if clear_ram: + cache.ram.clear() + session.flash += "Ram Cleared " + if clear_disk: + cache.disk.clear() + session.flash += "Disk Cleared" + + redirect(URL(r=request)) + + try: + from guppy import hpy; hp=hpy() + except ImportError: + hp = False + + import shelve, os, copy, time, math + from gluon import portalocker + + ram = { + 'entries': 0, + 'bytes': 0, + 'objects': 0, + 'hits': 0, + 'misses': 0, + 'ratio': 0, + 'oldest': time.time(), + 'keys': [] + } + disk = copy.copy(ram) + total = copy.copy(ram) + disk['keys'] = [] + total['keys'] = [] + + def GetInHMS(seconds): + hours = math.floor(seconds / 3600) + seconds -= hours * 3600 + minutes = math.floor(seconds / 60) + seconds -= minutes * 60 + seconds = math.floor(seconds) + + return (hours, minutes, seconds) + + for key, value in cache.ram.storage.items(): + if isinstance(value, dict): + ram['hits'] = value['hit_total'] - value['misses'] + ram['misses'] = value['misses'] + try: + ram['ratio'] = ram['hits'] * 100 / value['hit_total'] + except (KeyError, ZeroDivisionError): + ram['ratio'] = 0 + else: + if hp: + ram['bytes'] += hp.iso(value[1]).size + ram['objects'] += hp.iso(value[1]).count + ram['entries'] += 1 + if value[0] < ram['oldest']: + ram['oldest'] = value[0] + ram['keys'].append((key, GetInHMS(time.time() - value[0]))) + + locker = open(os.path.join(request.folder, + 'cache/cache.lock'), 'a') + portalocker.lock(locker, portalocker.LOCK_EX) + disk_storage = shelve.open(os.path.join(request.folder, 'cache/cache.shelve')) + try: + for key, value in disk_storage.items(): + if isinstance(value, dict): + disk['hits'] = value['hit_total'] - value['misses'] + disk['misses'] = value['misses'] + try: + disk['ratio'] = disk['hits'] * 100 / value['hit_total'] + except (KeyError, ZeroDivisionError): + disk['ratio'] = 0 + else: + if hp: + disk['bytes'] += hp.iso(value[1]).size + disk['objects'] += hp.iso(value[1]).count + disk['entries'] += 1 + if value[0] < disk['oldest']: + disk['oldest'] = value[0] + disk['keys'].append((key, GetInHMS(time.time() - value[0]))) + + finally: + portalocker.unlock(locker) + locker.close() + disk_storage.close() + + total['entries'] = ram['entries'] + disk['entries'] + total['bytes'] = ram['bytes'] + disk['bytes'] + total['objects'] = ram['objects'] + disk['objects'] + total['hits'] = ram['hits'] + disk['hits'] + total['misses'] = ram['misses'] + disk['misses'] + total['keys'] = ram['keys'] + disk['keys'] + try: + total['ratio'] = total['hits'] * 100 / (total['hits'] + total['misses']) + except (KeyError, ZeroDivisionError): + total['ratio'] = 0 + + if disk['oldest'] < ram['oldest']: + total['oldest'] = disk['oldest'] + else: + total['oldest'] = ram['oldest'] + + ram['oldest'] = GetInHMS(time.time() - ram['oldest']) + disk['oldest'] = GetInHMS(time.time() - disk['oldest']) + total['oldest'] = GetInHMS(time.time() - total['oldest']) + + def key_table(keys): + return TABLE( + TR(TD(B('Key')), TD(B('Time in Cache (h:m:s)'))), + *[TR(TD(k[0]), TD('%02d:%02d:%02d' % k[1])) for k in keys], + **dict(_class='cache-keys', + _style="border-collapse: separate; border-spacing: .5em;")) + + ram['keys'] = key_table(ram['keys']) + disk['keys'] = key_table(disk['keys']) + total['keys'] = key_table(total['keys']) + + return dict(form=form, total=total, + ram=ram, disk=disk, object_stats=hp != False) + diff --git a/applications/admin/controllers/debug.py b/applications/admin/controllers/debug.py new file mode 100644 index 00000000..d860b615 --- /dev/null +++ b/applications/admin/controllers/debug.py @@ -0,0 +1,33 @@ +import sys +import cStringIO +import gluon.contrib.shell +import code, thread +from gluon.debug import communicate + + +if DEMO_MODE or MULTI_USER_MODE: + session.flash = T('disabled in demo mode') + redirect(URL('default','site')) + +FE=10**9 + +def index(): + app = request.args(0) or 'admin' + reset() + # read buffer + data = communicate() + return dict(app=app,data=data) + +def callback(): + app = request.args[0] + command = request.vars.statement + session['debug_commands:'+app].append(command) + output = communicate(command) + k = len(session['debug_commands:'+app]) - 1 + return '[%i] %s%s\n' % (k + 1, command, output) + +def reset(): + app = request.args(0) or 'admin' + session['debug_commands:'+app] = [] + return 'done' + diff --git a/applications/admin/controllers/default.py b/applications/admin/controllers/default.py new file mode 100644 index 00000000..df878b50 --- /dev/null +++ b/applications/admin/controllers/default.py @@ -0,0 +1,1329 @@ +# coding: utf8 + +from gluon.admin import * +from gluon.fileutils import abspath, read_file, write_file +from glob import glob +import shutil +import platform + +if DEMO_MODE and request.function in ['change_password','pack','pack_plugin','upgrade_web2py','uninstall','cleanup','compile_app','remove_compiled_app','delete','delete_plugin','create_file','upload_file','update_languages','reload_routes']: + session.flash = T('disabled in demo mode') + redirect(URL('site')) + +if not is_manager() and request.function in ['change_password','upgrade_web2py']: + session.flash = T('disabled in multi user mode') + redirect(URL('site')) + +if FILTER_APPS and request.args(0) and not request.args(0) in FILTER_APPS: + session.flash = T('disabled in demo mode') + redirect(URL('site')) + +def safe_open(a,b): + if DEMO_MODE and 'w' in b: + class tmp: + def write(self,data): pass + return tmp() + return open(a,b) + +def safe_read(a, b='r'): + safe_file = safe_open(a, b) + try: + return safe_file.read() + finally: + safe_file.close() + +def safe_write(a, value, b='w'): + safe_file = safe_open(a, b) + try: + safe_file.write(value) + finally: + safe_file.close() + +def get_app(name=None): + app = name or request.args(0) + if app and (not MULTI_USER_MODE or db(db.app.name==app)(db.app.owner==auth.user.id).count()): + return app + session.flash = 'App does not exist or your are not authorized' + redirect(URL('site')) + +def index(): + """ Index handler """ + + send = request.vars.send + if DEMO_MODE: + session.authorized = True + session.last_time = t0 + if not send: + send = URL('site') + if session.authorized: + redirect(send) + elif request.vars.password: + if verify_password(request.vars.password): + session.authorized = True + login_record(True) + + if CHECK_VERSION: + session.check_version = True + else: + session.check_version = False + + session.last_time = t0 + if isinstance(send, list): # ## why does this happen? + send = str(send[0]) + + redirect(send) + else: + times_denied = login_record(False) + if times_denied >= allowed_number_of_attempts: + response.flash = \ + T('admin disabled because too many invalid login attempts') + elif times_denied == allowed_number_of_attempts - 1: + response.flash = \ + T('You have one more login attempt before you are locked out') + else: + response.flash = T('invalid password.') + return dict(send=send) + + +def check_version(): + """ Checks if web2py is up to date """ + + session.forget() + session._unlock(response) + + new_version, version_number = check_new_version(request.env.web2py_version, + WEB2PY_VERSION_URL) + + if new_version == -1: + return A(T('Unable to check for upgrades'), _href=WEB2PY_URL) + elif new_version != True: + return A(T('web2py is up to date'), _href=WEB2PY_URL) + elif platform.system().lower() in ('windows','win32','win64') and os.path.exists("web2py.exe"): + return SPAN('You should upgrade to version %s' % version_number) + else: + return sp_button(URL('upgrade_web2py'), T('upgrade now')) \ + + XML(' %s' % version_number) + + +def logout(): + """ Logout handler """ + session.authorized = None + if MULTI_USER_MODE: + redirect(URL('user/logout')) + redirect(URL('index')) + + +def change_password(): + + if session.pam_user: + session.flash = T('PAM authenticated user, cannot change password here') + redirect(URL('site')) + form=SQLFORM.factory(Field('current_admin_password','password'), + Field('new_admin_password','password',requires=IS_STRONG()), + Field('new_admin_password_again','password')) + if form.accepts(request.vars): + if not verify_password(request.vars.current_admin_password): + form.errors.current_admin_password = T('invalid password') + elif form.vars.new_admin_password != form.vars.new_admin_password_again: + form.errors.new_admin_password_again = T('no match') + else: + path = abspath('parameters_%s.py' % request.env.server_port) + safe_write(path, 'password="%s"' % CRYPT()(request.vars.new_admin_password)[0]) + session.flash = T('password changed') + redirect(URL('site')) + return dict(form=form) + +def site(): + """ Site handler """ + + myversion = request.env.web2py_version + + # Shortcut to make the elif statements more legible + file_or_appurl = 'file' in request.vars or 'appurl' in request.vars + + if DEMO_MODE: + pass + + elif request.vars.filename and not 'file' in request.vars: + # create a new application + appname = cleanpath(request.vars.filename).replace('.', '_') + if app_create(appname, request): + if MULTI_USER_MODE: + db.app.insert(name=appname,owner=auth.user.id) + session.flash = T('new application "%s" created', appname) + redirect(URL('design',args=appname)) + else: + session.flash = \ + T('unable to create application "%s" (it may exist already)', request.vars.filename) + redirect(URL(r=request)) + + elif file_or_appurl and not request.vars.filename: + # can't do anything without an app name + msg = 'you must specify a name for the uploaded application' + response.flash = T(msg) + + elif file_or_appurl and request.vars.filename: + # fetch an application via URL or file upload + f = None + if request.vars.appurl is not '': + try: + f = urllib.urlopen(request.vars.appurl) + except Exception, e: + session.flash = DIV(T('Unable to download app because:'),PRE(str(e))) + redirect(URL(r=request)) + fname = request.vars.appurl + elif request.vars.file is not '': + f = request.vars.file.file + fname = request.vars.file.filename + + if f: + appname = cleanpath(request.vars.filename).replace('.', '_') + installed = app_install(appname, f, request, fname, + overwrite=request.vars.overwrite_check) + if f and installed: + msg = 'application %(appname)s installed with md5sum: %(digest)s' + session.flash = T(msg, dict(appname=appname, + digest=md5_hash(installed))) + elif f and request.vars.overwrite_check: + msg = 'unable to install application "%(appname)s"' + session.flash = T(msg, dict(appname=request.vars.filename)) + + else: + msg = 'unable to install application "%(appname)s"' + session.flash = T(msg, dict(appname=request.vars.filename)) + + redirect(URL(r=request)) + + regex = re.compile('^\w+$') + + if is_manager(): + apps = [f for f in os.listdir(apath(r=request)) if regex.match(f)] + else: + apps = [f.name for f in db(db.app.owner==auth.user_id).select()] + + if FILTER_APPS: + apps = [f for f in apps if f in FILTER_APPS] + + apps = sorted(apps,lambda a,b:cmp(a.upper(),b.upper())) + + return dict(app=None, apps=apps, myversion=myversion) + + +def pack(): + app = get_app() + + if len(request.args) == 1: + fname = 'web2py.app.%s.w2p' % app + filename = app_pack(app, request) + else: + fname = 'web2py.app.%s.compiled.w2p' % app + filename = app_pack_compiled(app, request) + + if filename: + response.headers['Content-Type'] = 'application/w2p' + disposition = 'attachment; filename=%s' % fname + response.headers['Content-Disposition'] = disposition + return safe_read(filename, 'rb') + else: + session.flash = T('internal error') + redirect(URL('site')) + +def pack_plugin(): + app = get_app() + if len(request.args) == 2: + fname = 'web2py.plugin.%s.w2p' % request.args[1] + filename = plugin_pack(app, request.args[1], request) + if filename: + response.headers['Content-Type'] = 'application/w2p' + disposition = 'attachment; filename=%s' % fname + response.headers['Content-Disposition'] = disposition + return safe_read(filename, 'rb') + else: + session.flash = T('internal error') + redirect(URL('plugin',args=request.args)) + +def upgrade_web2py(): + if 'upgrade' in request.vars: + (success, error) = upgrade(request) + if success: + session.flash = T('web2py upgraded; please restart it') + else: + session.flash = T('unable to upgrade because "%s"', error) + redirect(URL('site')) + elif 'noupgrade' in request.vars: + redirect(URL('site')) + return dict() + +def uninstall(): + app = get_app() + if 'delete' in request.vars: + if MULTI_USER_MODE: + if is_manager() and db(db.app.name==app).delete(): + pass + elif db(db.app.name==app)(db.app.owner==auth.user.id).delete(): + pass + else: + session.flash = T('no permission to uninstall "%s"', app) + redirect(URL('site')) + if app_uninstall(app, request): + session.flash = T('application "%s" uninstalled', app) + else: + session.flash = T('unable to uninstall "%s"', app) + redirect(URL('site')) + elif 'nodelete' in request.vars: + redirect(URL('site')) + return dict(app=app) + + +def cleanup(): + app = get_app() + clean = app_cleanup(app, request) + if not clean: + session.flash = T("some files could not be removed") + else: + session.flash = T('cache, errors and sessions cleaned') + + redirect(URL('site')) + + +def compile_app(): + app = get_app() + c = app_compile(app, request) + if not c: + session.flash = T('application compiled') + else: + session.flash = DIV(T('Cannot compile: there are errors in your app:'), + CODE(c)) + redirect(URL('site')) + + +def remove_compiled_app(): + """ Remove the compiled application """ + app = get_app() + remove_compiled_application(apath(app, r=request)) + session.flash = T('compiled application removed') + redirect(URL('site')) + +def delete(): + """ Object delete handler """ + app = get_app() + filename = '/'.join(request.args) + sender = request.vars.sender + + if isinstance(sender, list): # ## fix a problem with Vista + sender = sender[0] + + if 'nodelete' in request.vars: + redirect(URL(sender)) + elif 'delete' in request.vars: + try: + os.unlink(apath(filename, r=request)) + session.flash = T('file "%(filename)s" deleted', + dict(filename=filename)) + except Exception: + session.flash = T('unable to delete file "%(filename)s"', + dict(filename=filename)) + redirect(URL(sender)) + return dict(filename=filename, sender=sender) + +def enable(): + app = get_app() + filename = os.path.join(apath(app, r=request),'DISABLED') + if os.path.exists(filename): + os.unlink(filename) + return SPAN(T('Disable'),_style='color:green') + else: + open(filename,'wb').write(time.ctime()) + return SPAN(T('Enable'),_style='color:red') + +def peek(): + """ Visualize object code """ + app = get_app() + filename = '/'.join(request.args) + try: + data = safe_read(apath(filename, r=request)).replace('\r','') + except IOError: + session.flash = T('file does not exist') + redirect(URL('site')) + + extension = filename[filename.rfind('.') + 1:].lower() + + return dict(app=request.args[0], + filename=filename, + data=data, + extension=extension) + + +def test(): + """ Execute controller tests """ + app = get_app() + if len(request.args) > 1: + file = request.args[1] + else: + file = '.*\.py' + + controllers = listdir(apath('%s/controllers/' % app, r=request), file + '$') + + return dict(app=app, controllers=controllers) + +def keepalive(): + return '' + +def search(): + keywords=request.vars.keywords or '' + app = get_app() + def match(filename,keywords): + filename=os.path.join(apath(app, r=request),filename) + if keywords in read_file(filename,'rb'): + return True + return False + path = apath(request.args[0], r=request) + files1 = glob(os.path.join(path,'*/*.py')) + files2 = glob(os.path.join(path,'*/*.html')) + files3 = glob(os.path.join(path,'*/*/*.html')) + files=[x[len(path)+1:].replace('\\','/') for x in files1+files2+files3 if match(x,keywords)] + return response.json({'files':files}) + +def edit(): + """ File edit handler """ + # Load json only if it is ajax edited... + app = get_app() + filename = '/'.join(request.args) + # Try to discover the file type + if filename[-3:] == '.py': + filetype = 'python' + elif filename[-5:] == '.html': + filetype = 'html' + elif filename[-5:] == '.load': + filetype = 'html' + elif filename[-4:] == '.css': + filetype = 'css' + elif filename[-3:] == '.js': + filetype = 'js' + else: + filetype = 'html' + + # ## check if file is not there + + path = apath(filename, r=request) + + if ('revert' in request.vars) and os.path.exists(path + '.bak'): + try: + data = safe_read(path + '.bak') + data1 = safe_read(path) + except IOError: + session.flash = T('Invalid action') + if 'from_ajax' in request.vars: + return response.json({'error': str(T('Invalid action'))}) + else: + redirect(URL('site')) + + safe_write(path, data) + file_hash = md5_hash(data) + saved_on = time.ctime(os.stat(path)[stat.ST_MTIME]) + safe_write(path + '.bak', data1) + response.flash = T('file "%s" of %s restored', (filename, saved_on)) + else: + try: + data = safe_read(path) + except IOError: + session.flash = T('Invalid action') + if 'from_ajax' in request.vars: + return response.json({'error': str(T('Invalid action'))}) + else: + redirect(URL('site')) + + file_hash = md5_hash(data) + saved_on = time.ctime(os.stat(path)[stat.ST_MTIME]) + + if request.vars.file_hash and request.vars.file_hash != file_hash: + session.flash = T('file changed on disk') + data = request.vars.data.replace('\r\n', '\n').strip() + '\n' + safe_write(path + '.1', data) + if 'from_ajax' in request.vars: + return response.json({'error': str(T('file changed on disk')), + 'redirect': URL('resolve', + args=request.args)}) + else: + redirect(URL('resolve', args=request.args)) + elif request.vars.data: + safe_write(path + '.bak', data) + data = request.vars.data.replace('\r\n', '\n').strip() + '\n' + safe_write(path, data) + file_hash = md5_hash(data) + saved_on = time.ctime(os.stat(path)[stat.ST_MTIME]) + response.flash = T('file saved on %s', saved_on) + + data_or_revert = (request.vars.data or request.vars.revert) + + # Check compile errors + highlight = None + if filetype == 'python' and request.vars.data: + import _ast + try: + code = request.vars.data.rstrip().replace('\r\n','\n')+'\n' + compile(code, path, "exec", _ast.PyCF_ONLY_AST) + except Exception, e: + start = sum([len(line)+1 for l, line + in enumerate(request.vars.data.split("\n")) + if l < e.lineno-1]) + if e.text and e.offset: + offset = e.offset - (len(e.text) - len(e.text.splitlines()[-1])) + else: + offset = 0 + highlight = {'start': start, 'end': start + offset + 1} + try: + ex_name = e.__class__.__name__ + except: + ex_name = 'unknown exception!' + response.flash = DIV(T('failed to compile file because:'), BR(), + B(ex_name), T(' at line %s') % e.lineno, + offset and T(' at char %s') % offset or '', + PRE(str(e))) + + if data_or_revert and request.args[1] == 'modules': + # Lets try to reload the modules + try: + mopath = '.'.join(request.args[2:])[:-3] + exec 'import applications.%s.modules.%s' % (request.args[0], mopath) + reload(sys.modules['applications.%s.modules.%s' + % (request.args[0], mopath)]) + except Exception, e: + response.flash = DIV(T('failed to reload module because:'),PRE(str(e))) + + edit_controller = None + editviewlinks = None + view_link = None + if filetype == 'html' and len(request.args) >= 3: + cfilename = os.path.join(request.args[0], 'controllers', + request.args[2] + '.py') + if os.path.exists(apath(cfilename, r=request)): + edit_controller = URL('edit', args=[cfilename]) + view = request.args[3].replace('.html','') + view_link = URL(request.args[0],request.args[2],view) + elif filetype == 'python' and request.args[1] == 'controllers': + ## it's a controller file. + ## Create links to all of the associated view files. + app = get_app() + viewname = os.path.splitext(request.args[2])[0] + viewpath = os.path.join(app,'views',viewname) + aviewpath = apath(viewpath, r=request) + viewlist = [] + if os.path.exists(aviewpath): + if os.path.isdir(aviewpath): + viewlist = glob(os.path.join(aviewpath,'*.html')) + elif os.path.exists(aviewpath+'.html'): + viewlist.append(aviewpath+'.html') + if len(viewlist): + editviewlinks = [] + for v in viewlist: + vf = os.path.split(v)[-1] + vargs = "/".join([viewpath.replace(os.sep,"/"),vf]) + editviewlinks.append(A(T(vf.split(".")[0]),\ + _href=URL('edit',args=[vargs]))) + + if len(request.args) > 2 and request.args[1] == 'controllers': + controller = (request.args[2])[:-3] + functions = regex_expose.findall(data) + else: + (controller, functions) = (None, None) + + if 'from_ajax' in request.vars: + return response.json({'file_hash': file_hash, 'saved_on': saved_on, 'functions':functions, 'controller': controller, 'application': request.args[0], 'highlight': highlight }) + else: + + editarea_preferences = {} + editarea_preferences['FONT_SIZE'] = '10' + editarea_preferences['FULL_SCREEN'] = 'false' + editarea_preferences['ALLOW_TOGGLE'] = 'true' + editarea_preferences['REPLACE_TAB_BY_SPACES'] = '4' + editarea_preferences['DISPLAY'] = 'onload' + for key in editarea_preferences: + if globals().has_key(key): + editarea_preferences[key]=globals()[key] + return dict(app=request.args[0], + filename=filename, + filetype=filetype, + data=data, + edit_controller=edit_controller, + file_hash=file_hash, + saved_on=saved_on, + controller=controller, + functions=functions, + view_link=view_link, + editarea_preferences=editarea_preferences, + editviewlinks=editviewlinks) + +def resolve(): + """ + """ + + filename = '/'.join(request.args) + # ## check if file is not there + path = apath(filename, r=request) + a = safe_read(path).split('\n') + try: + b = safe_read(path + '.1').split('\n') + except IOError: + session.flash = 'Other file, no longer there' + redirect(URL('edit', args=request.args)) + + d = difflib.ndiff(a, b) + + def leading(line): + """ """ + + # TODO: we really need to comment this + z = '' + for (k, c) in enumerate(line): + if c == ' ': + z += ' ' + elif c == ' \t': + z += ' ' + elif k == 0 and c == '?': + pass + else: + break + + return XML(z) + + def getclass(item): + """ Determine item class """ + + if item[0] == ' ': + return 'normal' + if item[0] == '+': + return 'plus' + if item[0] == '-': + return 'minus' + + if request.vars: + c = '\n'.join([item[2:].rstrip() for (i, item) in enumerate(d) if item[0] \ + == ' ' or 'line%i' % i in request.vars]) + safe_write(path, c) + session.flash = 'files merged' + redirect(URL('edit', args=request.args)) + else: + # Making the short circuit compatible with <= python2.4 + gen_data = lambda index,item: not item[:1] in ['+','-'] and "" \ + or INPUT(_type='checkbox', + _name='line%i' % index, + value=item[0] == '+') + + diff = TABLE(*[TR(TD(gen_data(i,item)), + TD(item[0]), + TD(leading(item[2:]), + TT(item[2:].rstrip())), _class=getclass(item)) + for (i, item) in enumerate(d) if item[0] != '?']) + + return dict(diff=diff, filename=filename) + + +def edit_language(): + """ Edit language file """ + app = get_app() + filename = '/'.join(request.args) + from gluon.languages import read_dict, write_dict + strings = read_dict(apath(filename, r=request)) + keys = sorted(strings.keys(),lambda x,y: cmp(x.lower(), y.lower())) + rows = [] + rows.append(H2(T('Original/Translation'))) + + for key in keys: + name = md5_hash(key) + if key==strings[key]: + _class='untranslated' + else: + _class='translated' + if len(key) <= 40: + elem = INPUT(_type='text', _name=name,value=strings[key], + _size=70,_class=_class) + else: + elem = TEXTAREA(_name=name, value=strings[key], _cols=70, + _rows=5, _class=_class) + + # Making the short circuit compatible with <= python2.4 + k = (strings[key] != key) and key or B(key) + + rows.append(P(k, BR(), elem, TAG.BUTTON(T('delete'), + _onclick='return delkey("%s")' % name), _id=name)) + + rows.append(INPUT(_type='submit', _value=T('update'))) + form = FORM(*rows) + if form.accepts(request.vars, keepvalues=True): + strs = dict() + for key in keys: + name = md5_hash(key) + if form.vars[name]==chr(127): continue + strs[key] = form.vars[name] + write_dict(apath(filename, r=request), strs) + session.flash = T('file saved on %(time)s', dict(time=time.ctime())) + redirect(URL(r=request,args=request.args)) + return dict(app=request.args[0], filename=filename, form=form) + + +def about(): + """ Read about info """ + app = get_app() + # ## check if file is not there + about = safe_read(apath('%s/ABOUT' % app, r=request)) + license = safe_read(apath('%s/LICENSE' % app, r=request)) + return dict(app=app, about=MARKMIN(about), license=MARKMIN(license)) + + +def design(): + """ Application design handler """ + app = get_app() + + if not response.flash and app == request.application: + msg = T('ATTENTION: you cannot edit the running application!') + response.flash = msg + + if request.vars.pluginfile!=None and not isinstance(request.vars.pluginfile,str): + filename=os.path.basename(request.vars.pluginfile.filename) + if plugin_install(app, request.vars.pluginfile.file, + request, filename): + session.flash = T('new plugin installed') + redirect(URL('design',args=app)) + else: + session.flash = \ + T('unable to create application "%s"', request.vars.filename) + redirect(URL(r=request)) + elif isinstance(request.vars.pluginfile,str): + session.flash = T('plugin not specified') + redirect(URL(r=request)) + + + # If we have only pyc files it means that + # we cannot design + if os.path.exists(apath('%s/compiled' % app, r=request)): + session.flash = \ + T('application is compiled and cannot be designed') + redirect(URL('site')) + + # Get all models + models = listdir(apath('%s/models/' % app, r=request), '.*\.py$') + models=[x.replace('\\','/') for x in models] + defines = {} + for m in models: + data = safe_read(apath('%s/models/%s' % (app, m), r=request)) + defines[m] = regex_tables.findall(data) + defines[m].sort() + + # Get all controllers + controllers = sorted(listdir(apath('%s/controllers/' % app, r=request), '.*\.py$')) + controllers = [x.replace('\\','/') for x in controllers] + functions = {} + for c in controllers: + data = safe_read(apath('%s/controllers/%s' % (app, c), r=request)) + items = regex_expose.findall(data) + functions[c] = items + + # Get all views + views = sorted(listdir(apath('%s/views/' % app, r=request), '[\w/\-]+(\.\w+)+$')) + views = [x.replace('\\','/') for x in views if not x.endswith('.bak')] + extend = {} + include = {} + for c in views: + data = safe_read(apath('%s/views/%s' % (app, c), r=request)) + items = regex_extend.findall(data) + + if items: + extend[c] = items[0][1] + + items = regex_include.findall(data) + include[c] = [i[1] for i in items] + + # Get all modules + modules = listdir(apath('%s/modules/' % app, r=request), '.*\.py$') + modules = modules=[x.replace('\\','/') for x in modules] + modules.sort() + + # Get all static files + statics = listdir(apath('%s/static/' % app, r=request), '[^\.#].*') + statics = [x.replace('\\','/') for x in statics] + statics.sort() + + # Get all languages + languages = listdir(apath('%s/languages/' % app, r=request), '[\w-]*\.py') + + #Get crontab + cronfolder = apath('%s/cron' % app, r=request) + if not os.path.exists(cronfolder): os.mkdir(cronfolder) + crontab = apath('%s/cron/crontab' % app, r=request) + if not os.path.exists(crontab): + safe_write(crontab, '#crontab') + + plugins=[] + def filter_plugins(items,plugins): + plugins+=[item[7:].split('/')[0].split('.')[0] for item in items if item.startswith('plugin_')] + plugins[:]=list(set(plugins)) + plugins.sort() + return [item for item in items if not item.startswith('plugin_')] + + return dict(app=app, + models=filter_plugins(models,plugins), + defines=defines, + controllers=filter_plugins(controllers,plugins), + functions=functions, + views=filter_plugins(views,plugins), + modules=filter_plugins(modules,plugins), + extend=extend, + include=include, + statics=filter_plugins(statics,plugins), + languages=languages, + crontab=crontab, + plugins=plugins) + +def delete_plugin(): + """ Object delete handler """ + app=request.args(0) + plugin = request.args(1) + plugin_name='plugin_'+plugin + if 'nodelete' in request.vars: + redirect(URL('design',args=app)) + elif 'delete' in request.vars: + try: + for folder in ['models','views','controllers','static','modules']: + path=os.path.join(apath(app,r=request),folder) + for item in os.listdir(path): + if item.rsplit('.',1)[0] == plugin_name: + filename=os.path.join(path,item) + if os.path.isdir(filename): + shutil.rmtree(filename) + else: + os.unlink(filename) + session.flash = T('plugin "%(plugin)s" deleted', + dict(plugin=plugin)) + except Exception: + session.flash = T('unable to delete file plugin "%(plugin)s"', + dict(plugin=plugin)) + redirect(URL('design',args=request.args(0))) + return dict(plugin=plugin) + +def plugin(): + """ Application design handler """ + app = get_app() + plugin = request.args(1) + + if not response.flash and app == request.application: + msg = T('ATTENTION: you cannot edit the running application!') + response.flash = msg + + # If we have only pyc files it means that + # we cannot design + if os.path.exists(apath('%s/compiled' % app, r=request)): + session.flash = \ + T('application is compiled and cannot be designed') + redirect(URL('site')) + + # Get all models + models = listdir(apath('%s/models/' % app, r=request), '.*\.py$') + models=[x.replace('\\','/') for x in models] + defines = {} + for m in models: + data = safe_read(apath('%s/models/%s' % (app, m), r=request)) + defines[m] = regex_tables.findall(data) + defines[m].sort() + + # Get all controllers + controllers = sorted(listdir(apath('%s/controllers/' % app, r=request), '.*\.py$')) + controllers = [x.replace('\\','/') for x in controllers] + functions = {} + for c in controllers: + data = safe_read(apath('%s/controllers/%s' % (app, c), r=request)) + items = regex_expose.findall(data) + functions[c] = items + + # Get all views + views = sorted(listdir(apath('%s/views/' % app, r=request), '[\w/\-]+\.\w+$')) + views = [x.replace('\\','/') for x in views] + extend = {} + include = {} + for c in views: + data = safe_read(apath('%s/views/%s' % (app, c), r=request)) + items = regex_extend.findall(data) + if items: + extend[c] = items[0][1] + + items = regex_include.findall(data) + include[c] = [i[1] for i in items] + + # Get all modules + modules = listdir(apath('%s/modules/' % app, r=request), '.*\.py$') + modules = modules=[x.replace('\\','/') for x in modules] + modules.sort() + + # Get all static files + statics = listdir(apath('%s/static/' % app, r=request), '[^\.#].*') + statics = [x.replace('\\','/') for x in statics] + statics.sort() + + # Get all languages + languages = listdir(apath('%s/languages/' % app, r=request), '[\w-]*\.py') + + #Get crontab + crontab = apath('%s/cron/crontab' % app, r=request) + if not os.path.exists(crontab): + safe_write(crontab, '#crontab') + + def filter_plugins(items): + regex=re.compile('^plugin_'+plugin+'(/.*|\..*)?$') + return [item for item in items if regex.match(item)] + + return dict(app=app, + models=filter_plugins(models), + defines=defines, + controllers=filter_plugins(controllers), + functions=functions, + views=filter_plugins(views), + modules=filter_plugins(modules), + extend=extend, + include=include, + statics=filter_plugins(statics), + languages=languages, + crontab=crontab) + + +def create_file(): + """ Create files handler """ + try: + app = get_app(name=request.vars.location.split('/')[0]) + path = apath(request.vars.location, r=request) + filename = re.sub('[^\w./-]+', '_', request.vars.filename) + + if path[-11:] == '/languages/': + # Handle language files + if len(filename) == 0: + raise SyntaxError + if not filename[-3:] == '.py': + filename += '.py' + app = path.split('/')[-3] + path=os.path.join(apath(app, r=request),'languages',filename) + if not os.path.exists(path): + safe_write(path, '') + findT(apath(app, r=request), filename[:-3]) + session.flash = T('language file "%(filename)s" created/updated', + dict(filename=filename)) + redirect(request.vars.sender) + + elif path[-8:] == '/models/': + # Handle python models + if not filename[-3:] == '.py': + filename += '.py' + + if len(filename) == 3: + raise SyntaxError + + text = '# coding: utf8\n' + + elif path[-13:] == '/controllers/': + # Handle python controllers + if not filename[-3:] == '.py': + filename += '.py' + + if len(filename) == 3: + raise SyntaxError + + text = '# coding: utf8\n# %s\ndef index(): return dict(message="hello from %s")' + text = text % (T('try something like'), filename) + + elif path[-7:] == '/views/': + if request.vars.plugin and not filename.startswith('plugin_%s/' % request.vars.plugin): + filename = 'plugin_%s/%s' % (request.vars.plugin, filename) + # Handle template (html) views + if filename.find('.')<0: + filename += '.html' + extension = filename.split('.')[-1].lower() + + if len(filename) == 5: + raise SyntaxError + + msg = T('This is the %(filename)s template', + dict(filename=filename)) + if extension == 'html': + text = dedent(""" + {{extend 'layout.html'}} +

%s

+ {{=BEAUTIFY(response._vars)}}""" % msg) + else: + generic = os.path.join(path,'generic.'+extension) + if os.path.exists(generic): + text = read_file(generic) + else: + text = '' + + elif path[-9:] == '/modules/': + if request.vars.plugin and not filename.startswith('plugin_%s/' % request.vars.plugin): + filename = 'plugin_%s/%s' % (request.vars.plugin, filename) + # Handle python module files + if not filename[-3:] == '.py': + filename += '.py' + + if len(filename) == 3: + raise SyntaxError + + text = dedent(""" + #!/usr/bin/env python + # coding: utf8 + from gluon import *\n""") + + elif path[-8:] == '/static/': + if request.vars.plugin and not filename.startswith('plugin_%s/' % request.vars.plugin): + filename = 'plugin_%s/%s' % (request.vars.plugin, filename) + text = '' + else: + redirect(request.vars.sender) + + full_filename = os.path.join(path, filename) + dirpath = os.path.dirname(full_filename) + + if not os.path.exists(dirpath): + os.makedirs(dirpath) + + if os.path.exists(full_filename): + raise SyntaxError + + safe_write(full_filename, text) + session.flash = T('file "%(filename)s" created', + dict(filename=full_filename[len(path):])) + redirect(URL('edit', + args=[os.path.join(request.vars.location, filename)])) + except Exception, e: + if not isinstance(e,HTTP): + session.flash = T('cannot create file') + + redirect(request.vars.sender) + + +def upload_file(): + """ File uploading handler """ + + try: + filename = None + app = get_app(name=request.vars.location.split('/')[0]) + path = apath(request.vars.location, r=request) + + if request.vars.filename: + filename = re.sub('[^\w\./]+', '_', request.vars.filename) + else: + filename = os.path.split(request.vars.file.filename)[-1] + + if path[-8:] == '/models/' and not filename[-3:] == '.py': + filename += '.py' + + if path[-9:] == '/modules/' and not filename[-3:] == '.py': + filename += '.py' + + if path[-13:] == '/controllers/' and not filename[-3:] == '.py': + filename += '.py' + + if path[-7:] == '/views/' and not filename[-5:] == '.html': + filename += '.html' + + if path[-11:] == '/languages/' and not filename[-3:] == '.py': + filename += '.py' + + filename = os.path.join(path, filename) + dirpath = os.path.dirname(filename) + + if not os.path.exists(dirpath): + os.makedirs(dirpath) + + safe_write(filename, request.vars.file.file.read(), 'wb') + session.flash = T('file "%(filename)s" uploaded', + dict(filename=filename[len(path):])) + except Exception: + if filename: + d = dict(filename = filename[len(path):]) + else: + d = dict(filename = 'unkown') + session.flash = T('cannot upload file "%(filename)s"', d) + + redirect(request.vars.sender) + + +def errors(): + """ Error handler """ + import operator + import os + import pickle + import hashlib + + app = get_app() + + method = request.args(1) or 'new' + + + if method == 'new': + errors_path = apath('%s/errors' % app, r=request) + + delete_hashes = [] + for item in request.vars: + if item[:7] == 'delete_': + delete_hashes.append(item[7:]) + + hash2error = dict() + + for fn in listdir(errors_path, '^\w.*'): + fullpath = os.path.join(errors_path, fn) + if not os.path.isfile(fullpath): continue + try: + fullpath_file = open(fullpath, 'r') + try: + error = pickle.load(fullpath_file) + finally: + fullpath_file.close() + except IOError: + continue + + hash = hashlib.md5(error['traceback']).hexdigest() + + if hash in delete_hashes: + os.unlink(fullpath) + else: + try: + hash2error[hash]['count'] += 1 + except KeyError: + error_lines = error['traceback'].split("\n") + last_line = error_lines[-2] + error_causer = os.path.split(error['layer'])[1] + hash2error[hash] = dict(count=1, pickel=error, + causer=error_causer, + last_line=last_line, + hash=hash,ticket=fn) + + decorated = [(x['count'], x) for x in hash2error.values()] + decorated.sort(key=operator.itemgetter(0), reverse=True) + + return dict(errors = [x[1] for x in decorated], app=app, method=method) + + elif method == 'dbnew': + errors_path = apath('%s/errors' % app, r=request) + tk_db, tk_table = get_ticket_storage(app) + + delete_hashes = [] + for item in request.vars: + if item[:7] == 'delete_': + delete_hashes.append(item[7:]) + + hash2error = dict() + + for fn in tk_db(tk_table.id>0).select(): + try: + error = pickle.loads(fn.ticket_data) + except AttributeError: + tk_db(tk_table.id == fn.id).delete() + tk_db.commit() + + hash = hashlib.md5(error['traceback']).hexdigest() + + if hash in delete_hashes: + tk_db(tk_table.id == fn.id).delete() + tk_db.commit() + else: + try: + hash2error['hash']['count'] += 1 + except KeyError: + error_lines = error['traceback'].split("\n") + last_line = error_lines[-2] + error_causer = os.path.split(error['layer'])[1] + hash2error[hash] = dict(count=1, pickel=error, + causer=error_causer, + last_line=last_line, + hash=hash,ticket=fn.ticket_id) + + decorated = [(x['count'], x) for x in hash2error.values()] + + decorated.sort(key=operator.itemgetter(0), reverse=True) + + return dict(errors = [x[1] for x in decorated], app=app, method=method) + + elif method == 'dbold': + tk_db, tk_table = get_ticket_storage(app) + for item in request.vars: + if item[:7] == 'delete_': + tk_db(tk_table.ticket_id == item[7:]).delete() + tk_db.commit() + tickets_ = tk_db(tk_table.id>0).select(tk_table.ticket_id, tk_table.created_datetime, orderby=~tk_table.created_datetime) + tickets = [row.ticket_id for row in tickets_] + times = dict([(row.ticket_id, row.created_datetime) for row in tickets_]) + + return dict(app=app, tickets=tickets, method=method, times=times) + + else: + for item in request.vars: + if item[:7] == 'delete_': + os.unlink(apath('%s/errors/%s' % (app, item[7:]), r=request)) + func = lambda p: os.stat(apath('%s/errors/%s' % \ + (app, p), r=request)).st_mtime + tickets = sorted(listdir(apath('%s/errors/' % app, r=request), '^\w.*'), + key=func, + reverse=True) + + return dict(app=app, tickets=tickets, method=method) + +def get_ticket_storage(app): + private_folder = apath('%s/private' % app, r=request) + try: + db_string = open(os.path.join(private_folder, 'ticket_storage.txt')).read().replace('\r','').replace('\n','').strip() + except IOError: + raise Exception, "No ticket_storage.txt found in /private folder" + tickets_table = 'web2py_ticket' + tablename = tickets_table + '_' + app + db_path = apath('%s/databases' % app, r=request) + from gluon import DAL + ticketsdb = DAL(db_string, folder=db_path, auto_import=True) + if not ticketsdb.get(tablename): + table = ticketsdb.define_table( + tablename, + Field('ticket_id', length=100), + Field('ticket_data', 'text'), + Field('created_datetime', 'datetime'), + ) + return ticketsdb , ticketsdb.get(tablename) + +def make_link(path): + """ Create a link from a path """ + tryFile = path.replace('\\', '/') + + if os.path.isabs(tryFile) and os.path.isfile(tryFile): + (folder, filename) = os.path.split(tryFile) + (base, ext) = os.path.splitext(filename) + app = get_app() + + editable = {'controllers': '.py', 'models': '.py', 'views': '.html'} + for key in editable.keys(): + check_extension = folder.endswith("%s/%s" % (app,key)) + if ext.lower() == editable[key] and check_extension: + return A('"' + tryFile + '"', + _href=URL(r=request, + f='edit/%s/%s/%s' % (app, key, filename))).xml() + return '' + + +def make_links(traceback): + """ Make links using the given traceback """ + + lwords = traceback.split('"') + + # Making the short circuit compatible with <= python2.4 + result = (len(lwords) != 0) and lwords[0] or '' + + i = 1 + + while i < len(lwords): + link = make_link(lwords[i]) + + if link == '': + result += '"' + lwords[i] + else: + result += link + + if i + 1 < len(lwords): + result += lwords[i + 1] + i = i + 1 + + i = i + 1 + + return result + + +class TRACEBACK(object): + """ Generate the traceback """ + + def __init__(self, text): + """ TRACEBACK constructor """ + + self.s = make_links(CODE(text).xml()) + + def xml(self): + """ Returns the xml """ + + return self.s + + +def ticket(): + """ Ticket handler """ + + if len(request.args) != 2: + session.flash = T('invalid ticket') + redirect(URL('site')) + + app = get_app() + myversion = request.env.web2py_version + ticket = request.args[1] + e = RestrictedError() + e.load(request, app, ticket) + + return dict(app=app, + ticket=ticket, + output=e.output, + traceback=(e.traceback and TRACEBACK(e.traceback)), + snapshot=e.snapshot, + code=e.code, + layer=e.layer, + myversion=myversion) + +def ticketdb(): + """ Ticket handler """ + + if len(request.args) != 2: + session.flash = T('invalid ticket') + redirect(URL('site')) + + app = get_app() + myversion = request.env.web2py_version + ticket = request.args[1] + e = RestrictedError() + request.tickets_db = get_ticket_storage(app)[0] + e.load(request, app, ticket) + response.view = 'default/ticket.html' + return dict(app=app, + ticket=ticket, + output=e.output, + traceback=(e.traceback and TRACEBACK(e.traceback)), + snapshot=e.snapshot, + code=e.code, + layer=e.layer, + myversion=myversion) + +def error(): + """ Generate a ticket (for testing) """ + raise RuntimeError('admin ticket generator at your service') + +def update_languages(): + """ Update available languages """ + + app = get_app() + update_all_languages(apath(app, r=request)) + session.flash = T('Language files (static strings) updated') + redirect(URL('design',args=app,anchor='languages')) + +def twitter(): + session.forget() + session._unlock(response) + import gluon.tools + import gluon.contrib.simplejson as sj + try: + if TWITTER_HASH: + page = gluon.tools.fetch('http://twitter.com/%s?format=json'%TWITTER_HASH) + return sj.loads(page)['#timeline'] + else: + return 'disabled' + except Exception, e: + return DIV(T('Unable to download because:'),BR(),str(e)) + +def user(): + if MULTI_USER_MODE: + if not db(db.auth_user).count(): + auth.settings.registration_requires_approval = False + return dict(form=auth()) + else: + return dict(form=T("Disabled")) + +def reload_routes(): + """ Reload routes.py """ + import gluon.rewrite + gluon.rewrite.load() + redirect(URL('site')) diff --git a/applications/admin/controllers/gae.py b/applications/admin/controllers/gae.py new file mode 100644 index 00000000..290003c9 --- /dev/null +++ b/applications/admin/controllers/gae.py @@ -0,0 +1,87 @@ +### this works on linux only + +import re +try: + import fcntl + import subprocess + import signal + import os + import shutil + from gluon.fileutils import read_file, write_file +except: + session.flash='sorry, only on Unix systems' + redirect(URL(request.application,'default','site')) + +forever=10**8 + +def kill(): + p = cache.ram('gae_upload',lambda:None,forever) + if not p or p.poll()!=None: + return 'oops' + os.kill(p.pid, signal.SIGKILL) + cache.ram('gae_upload',lambda:None,-1) + +class EXISTS(object): + def __init__(self, error_message='file not found'): + self.error_message = error_message + def __call__(self, value): + if os.path.exists(value): + return (value,None) + return (value,self.error_message) + +def deploy(): + regex = re.compile('^\w+$') + apps = sorted(file for file in os.listdir(apath(r=request)) if regex.match(file)) + form = SQLFORM.factory( + Field('appcfg',default=GAE_APPCFG,label='Path to appcfg.py', + requires=EXISTS(error_message=T('file not found'))), + Field('google_application_id',requires=IS_ALPHANUMERIC()), + Field('applications','list:string', + requires=IS_IN_SET(apps,multiple=True), + label=T('web2py apps to deploy')), + Field('email',requires=IS_EMAIL(),label=T('GAE Email')), + Field('password','password',requires=IS_NOT_EMPTY(),label=T('GAE Password'))) + cmd = output = errors= "" + if form.accepts(request,session): + try: + kill() + except: + pass + ignore_apps = [item for item in apps \ + if not item in form.vars.applications] + regex = re.compile('\(applications/\(.*') + yaml = apath('../app.yaml', r=request) + if not os.path.exists(yaml): + example = apath('../app.example.yaml', r=request) + shutil.copyfile(example,yaml) + data = read_file(yaml) + data = re.sub('application:.*','application: %s' % form.vars.google_application_id,data) + data = regex.sub('(applications/(%s)/.*)|' % '|'.join(ignore_apps),data) + write_file(yaml, data) + + path = request.env.applications_parent + cmd = '%s --email=%s --passin update %s' % \ + (form.vars.appcfg, form.vars.email, path) + p = cache.ram('gae_upload', + lambda s=subprocess,c=cmd:s.Popen(c, shell=True, + stdin=s.PIPE, + stdout=s.PIPE, + stderr=s.PIPE, close_fds=True),-1) + p.stdin.write(form.vars.password+'\n') + fcntl.fcntl(p.stdout.fileno(), fcntl.F_SETFL, os.O_NONBLOCK) + fcntl.fcntl(p.stderr.fileno(), fcntl.F_SETFL, os.O_NONBLOCK) + return dict(form=form,command=cmd) + +def callback(): + p = cache.ram('gae_upload',lambda:None,forever) + if not p or p.poll()!=None: + return '' + try: + output = p.stdout.read() + except: + output='' + try: + errors = p.stderr.read() + except: + errors='' + return (output+errors).replace('\n','
') diff --git a/applications/admin/controllers/mercurial.py b/applications/admin/controllers/mercurial.py new file mode 100644 index 00000000..cd22786f --- /dev/null +++ b/applications/admin/controllers/mercurial.py @@ -0,0 +1,82 @@ +from gluon.fileutils import read_file, write_file + +if DEMO_MODE or MULTI_USER_MODE: + session.flash = T('disabled in demo mode') + redirect(URL('default','site')) +if not have_mercurial: + session.flash=T("Sorry, could not find mercurial installed") + redirect(URL('default','design',args=request.args(0))) + +_hgignore_content = """\ +syntax: glob +*~ +*.pyc +*.pyo +*.bak +*.bak2 +cache/* +private/* +uploads/* +databases/* +sessions/* +errors/* +""" + +def hg_repo(path): + import os + uio = ui.ui() + uio.quiet = True + if not os.environ.get('HGUSER') and not uio.config("ui", "username"): + os.environ['HGUSER'] = 'web2py@localhost' + try: + repo = hg.repository(ui=uio, path=path) + except: + repo = hg.repository(ui=uio, path=path, create=True) + hgignore = os.path.join(path, '.hgignore') + if not os.path.exists(hgignore): + write_file(hgignore, _hgignore_content) + return repo + +def commit(): + app = request.args(0) + path = apath(app, r=request) + repo = hg_repo(path) + form = FORM('Comment:',INPUT(_name='comment',requires=IS_NOT_EMPTY()), + INPUT(_type='submit',_value='Commit')) + if form.accepts(request.vars,session): + oldid = repo[repo.lookup('.')] + cmdutil.addremove(repo) + repo.commit(text=form.vars.comment) + if repo[repo.lookup('.')] == oldid: + response.flash = 'no changes' + try: + files = TABLE(*[TR(file) for file in repo[repo.lookup('.')].files()]) + changes = TABLE(TR(TH('revision'),TH('description'))) + for change in repo.changelog: + ctx=repo.changectx(change) + revision, description = ctx.rev(), ctx.description() + changes.append(TR(A(revision,_href=URL('revision', + args=(app,revision))), + description)) + except: + files = [] + changes = [] + return dict(form=form,files=files,changes=changes,repo=repo) + +def revision(): + app = request.args(0) + path = apath(app, r=request) + repo = hg_repo(path) + revision = request.args(1) + ctx=repo.changectx(revision) + form=FORM(INPUT(_type='submit',_value='revert')) + if form.accepts(request.vars): + hg.update(repo, revision) + session.flash = "reverted to revision %s" % ctx.rev() + redirect(URL('default','design',args=app)) + return dict( + files=ctx.files(), + rev=str(ctx.rev()), + desc=ctx.description(), + form=form + ) diff --git a/applications/admin/controllers/shell.py b/applications/admin/controllers/shell.py new file mode 100644 index 00000000..561e06eb --- /dev/null +++ b/applications/admin/controllers/shell.py @@ -0,0 +1,45 @@ +import sys +import cStringIO +import gluon.contrib.shell +import code, thread +from gluon.shell import env + +if DEMO_MODE or MULTI_USER_MODE: + session.flash = T('disabled in demo mode') + redirect(URL('default','site')) + +FE=10**9 + +def index(): + app = request.args(0) or 'admin' + reset() + return dict(app=app) + +def callback(): + app = request.args[0] + command = request.vars.statement + escape = command[:1]!='!' + history = session['history:'+app] = session.get('history:'+app,gluon.contrib.shell.History()) + if not escape: + command = command[1:] + if command == '%reset': + reset() + return '*** reset ***' + elif command[0] == '%': + try: + command=session['commands:'+app][int(command[1:])] + except ValueError: + return '' + session['commands:'+app].append(command) + environ=env(app,True) + output = gluon.contrib.shell.run(history,command,environ) + k = len(session['commands:'+app]) - 1 + #output = PRE(output) + #return TABLE(TR('In[%i]:'%k,PRE(command)),TR('Out[%i]:'%k,output)) + return 'In [%i] : %s%s\n' % (k + 1, command, output) + +def reset(): + app = request.args(0) or 'admin' + session['commands:'+app] = [] + session['history:'+app] = gluon.contrib.shell.History() + return 'done' diff --git a/applications/admin/controllers/toolbar.py b/applications/admin/controllers/toolbar.py new file mode 100644 index 00000000..34a87651 --- /dev/null +++ b/applications/admin/controllers/toolbar.py @@ -0,0 +1,29 @@ +import os +from gluon.settings import global_settings, read_file +# + +def index(): + app = request.args(0) + return dict(app=app) + +def profiler(): + """ + to use the profiler start web2py with -F profiler.log + """ + KEY = 'web2py_profiler_size' + filename = global_settings.cmd_options.profiler_filename + data = 'profiler disabled' + if filename: + if KEY in request.cookies: + size = int(request.cookies[KEY].value) + else: + size = 0 + if os.path.exists(filename): + data = read_file('profiler.log','rb') + if size=m: redirect(URL('step2')) + table=session.app['tables'][n] + form=SQLFORM.factory(Field('field_names','list:string', + default=session.app.get('table_'+table,[]))) + if form.accepts(request.vars) and form.vars.field_names: + fields=listify(form.vars.field_names) + if table=='auth_user': + for field in ['first_name','last_name','username','email','password']: + if not field in fields: + fields.append(field) + session.app['table_'+table]=[t.strip().lower() + for t in listify(form.vars.field_names) + if t.strip()] + try: + tables=sort_tables(session.app['tables']) + except RuntimeError: + response.flash=T('invalid circual reference') + else: + if n=m: redirect(URL('step4')) + page=session.app['pages'][n] + markmin_url='http://web2py.com/examples/static/markmin.html' + form=SQLFORM.factory(Field('content','text', + default=session.app.get('page_'+page,[]), + comment=A('use markmin', + _href=markmin_url,_target='_blank')), + formstyle='table2cols') + if form.accepts(request.vars): + session.app['page_'+page]=form.vars.content + if n expiration: + os.unlink(fullpath) + except: + logging.exception('failure to check %s'%fullpath) diff --git a/applications/admin/languages/af.py b/applications/admin/languages/af.py new file mode 100644 index 00000000..d57ff91c --- /dev/null +++ b/applications/admin/languages/af.py @@ -0,0 +1,87 @@ +# coding: utf8 +{ +'%Y-%m-%d': '%Y-%m-%d', +'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', +'(requires internet access)': '(vereis internet toegang)', +'(something like "it-it")': '(iets soos "it-it")', +'About': 'Oor', +'About application': 'Oor program', +'Additional code for your application': 'Additionele kode vir u application', +'Admin language': 'Admin taal', +'Application name:': 'Program naam:', +'Controllers': 'Beheerders', +'Deploy on Google App Engine': 'Stuur na Google App Engine toe', +'Edit application': 'Wysig program', +'Installed applications': 'Geinstalleerde apps', +'Languages': 'Tale', +'License for': 'Lisensie vir', +'Models': 'Modelle', +'Modules': 'Modules', +'New application wizard': 'Nuwe app wizard', +'New simple application': 'Nuwe eenvoudige app', +'Plugins': 'Plugins', +'Powered by': 'Aangedryf deur', +'Searching:': 'Soek:', +'Static files': 'Static files', +'Sure you want to delete this object?': 'Is jy seker jy will hierde object verwyder?', +'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller', +'The data representation, define database tables and sets': 'The data representation, define database tables and sets', +'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates', +'There are no plugins': 'Daar is geen plugins', +'These files are served without processing, your images go here': 'Hierdie lêre is sonder veranderinge geserved, jou images gaan hier', +'To create a plugin, name a file/folder plugin_[name]': 'Om ''n plugin te skep, noem ''n lêer/gids plugin_[name]', +'Translation strings for the application': 'Vertaling woorde vir die program', +'Upload & install packed application': 'Oplaai & install gepakte program', +'Upload a package:': 'Oplaai ''n package:', +'Use an url:': 'Gebruik n url:', +'Views': 'Views', +'About': 'oor', +'administrative interface': 'administrative interface', +'and rename it:': 'en verander die naam:', +'Change admin password': 'verander admin wagwoord', +'Check for upgrades': 'soek vir upgrades', +'Clean': 'maak skoon', +'collapse/expand all': 'collapse/expand all', +'Compile': 'kompileer', +'controllers': 'beheerders', +'Create': 'skep', +'create file with filename:': 'skep lêer met naam:', +'created by': 'geskep deur', +'crontab': 'crontab', +'currently running': 'loop tans', +'database administration': 'database administration', +'Deploy': 'deploy', +'direction: ltr': 'direction: ltr', +'download layouts': 'aflaai layouts', +'download plugins': 'aflaai plugins', +'Edit': 'wysig', +'Errors': 'foute', +'exposes': 'exposes', +'extends': 'extends', +'files': 'lêre', +'filter': 'filter', +'Help': 'hulp', +'includes': 'includes', +'Install': 'installeer', +'languages': 'tale', +'loading...': 'laai...', +'Logout': 'logout', +'models': 'modelle', +'modules': 'modules', +'Overwrite installed app': 'skryf oor geinstalleerde program', +'Pack all': 'pack alles', +'plugins': 'plugins', +'shell': 'shell', +'Site': 'site', +'Start wizard': 'start wizard', +'static': 'static', +'test': 'toets', +'Uninstall': 'verwyder', +'update all languages': 'update all languages', +'upload': 'oplaai', +'upload file:': 'oplaai lêer:', +'upload plugin file:': 'upload plugin lêer:', +'versioning': 'versioning', +'views': 'views', +'web2py Recent Tweets': 'web2py Onlangse Tweets', +} diff --git a/applications/admin/languages/bg-bg.py b/applications/admin/languages/bg-bg.py new file mode 100644 index 00000000..5a84a726 --- /dev/null +++ b/applications/admin/languages/bg-bg.py @@ -0,0 +1,277 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN', +'%Y-%m-%d': '%Y-%m-%d', +'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', +'%s rows deleted': '%s запиÑите бÑха изтрити', +'%s rows updated': '%s запиÑите бÑха обновени', +'(requires internet access)': '(requires internet access)', +'(something like "it-it")': '(something like "it-it")', +'A new version of web2py is available': 'A new version of web2py is available', +'A new version of web2py is available: %s': 'A new version of web2py is available: %s', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.', +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.', +'ATTENTION: you cannot edit the running application!': 'ATTENTION: you cannot edit the running application!', +'About': 'About', +'About application': 'About application', +'Additional code for your application': 'Additional code for your application', +'Admin is disabled because insecure channel': 'Admin is disabled because insecure channel', +'Admin is disabled because unsecure channel': 'Admin is disabled because unsecure channel', +'Admin language': 'Admin language', +'Administrator Password:': 'Administrator Password:', +'Application name:': 'Application name:', +'Are you sure you want to delete file "%s"?': 'Are you sure you want to delete file "%s"?', +'Are you sure you want to delete plugin "%s"?': 'Are you sure you want to delete plugin "%s"?', +'Are you sure you want to uninstall application "%s"': 'Are you sure you want to uninstall application "%s"', +'Are you sure you want to uninstall application "%s"?': 'Are you sure you want to uninstall application "%s"?', +'Are you sure you want to upgrade web2py now?': 'Are you sure you want to upgrade web2py now?', +'Available databases and tables': 'Available databases and tables', +'Cannot be empty': 'Cannot be empty', +'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'Cannot compile: there are errors in your app. Debug it, correct errors and try again.', +'Cannot compile: there are errors in your app:': 'Cannot compile: there are errors in your app:', +'Check to delete': 'Check to delete', +'Checking for upgrades...': 'Checking for upgrades...', +'Controllers': 'Controllers', +'Create new simple application': 'Create new simple application', +'Current request': 'Current request', +'Current response': 'Current response', +'Current session': 'Current session', +'DESIGN': 'DESIGN', +'Date and Time': 'Date and Time', +'Delete': 'Delete', +'Delete:': 'Delete:', +'Deploy on Google App Engine': 'Deploy on Google App Engine', +'Design for': 'Design for', +'EDIT': 'EDIT', +'Edit application': 'Edit application', +'Edit current record': 'Edit current record', +'Editing Language file': 'Editing Language file', +'Editing file': 'Editing file', +'Editing file "%s"': 'Editing file "%s"', +'Enterprise Web Framework': 'Enterprise Web Framework', +'Error logs for "%(app)s"': 'Error logs for "%(app)s"', +'Exception instance attributes': 'Exception instance attributes', +'Functions with no doctests will result in [passed] tests.': 'Functions with no doctests will result in [passed] tests.', +'Hello World': 'Здравей, ÑвÑÑ‚', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.', +'Import/Export': 'Import/Export', +'Installed applications': 'Installed applications', +'Internal State': 'Internal State', +'Invalid Query': 'Ðевалидна заÑвка', +'Invalid action': 'Invalid action', +'Language files (static strings) updated': 'Language files (static strings) updated', +'Languages': 'Languages', +'Last saved on:': 'Last saved on:', +'License for': 'License for', +'Login': 'Login', +'Login to the Administrative Interface': 'Login to the Administrative Interface', +'Models': 'Models', +'Modules': 'Modules', +'NO': 'NO', +'New Record': 'New Record', +'New application wizard': 'New application wizard', +'New simple application': 'New simple application', +'No databases in this application': 'No databases in this application', +'Original/Translation': 'Original/Translation', +'PAM authenticated user, cannot change password here': 'PAM authenticated user, cannot change password here', +'Peeking at file': 'Peeking at file', +'Plugin "%s" in application': 'Plugin "%s" in application', +'Plugins': 'Plugins', +'Powered by': 'Powered by', +'Query:': 'Query:', +'Resolve Conflict file': 'Resolve Conflict file', +'Rows in table': 'Rows in table', +'Rows selected': 'Rows selected', +'Saved file hash:': 'Saved file hash:', +'Searching:': 'Searching:', +'Static files': 'Static files', +'Sure you want to delete this object?': 'Сигурен ли Ñи, че иÑкаш да изтриеш този обект?', +'TM': 'TM', +'Testing application': 'Testing application', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.', +'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller', +'The data representation, define database tables and sets': 'The data representation, define database tables and sets', +'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates', +'There are no controllers': 'There are no controllers', +'There are no models': 'There are no models', +'There are no modules': 'There are no modules', +'There are no plugins': 'There are no plugins', +'There are no static files': 'There are no static files', +'There are no translators, only default language is supported': 'There are no translators, only default language is supported', +'There are no views': 'There are no views', +'These files are served without processing, your images go here': 'These files are served without processing, your images go here', +'This is the %(filename)s template': 'This is the %(filename)s template', +'Ticket': 'Ticket', +'To create a plugin, name a file/folder plugin_[name]': 'To create a plugin, name a file/folder plugin_[name]', +'Translation strings for the application': 'Translation strings for the application', +'Unable to check for upgrades': 'Unable to check for upgrades', +'Unable to download': 'Unable to download', +'Unable to download app because:': 'Unable to download app because:', +'Unable to download because': 'Unable to download because', +'Update:': 'Update:', +'Upload & install packed application': 'Upload & install packed application', +'Upload a package:': 'Upload a package:', +'Upload existing application': 'Upload existing application', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', +'Use an url:': 'Use an url:', +'Version': 'Version', +'Views': 'Views', +'Welcome to web2py': 'Добре дошъл в web2py', +'YES': 'YES', +'About': 'about', +'additional code for your application': 'additional code for your application', +'admin disabled because no admin password': 'admin disabled because no admin password', +'admin disabled because not supported on google app engine': 'admin disabled because not supported on google apps engine', +'admin disabled because unable to access password file': 'admin disabled because unable to access password file', +'administrative interface': 'administrative interface', +'and rename it (required):': 'and rename it (required):', +'and rename it:': 'and rename it:', +'appadmin': 'appadmin', +'appadmin is disabled because insecure channel': 'appadmin is disabled because insecure channel', +'application "%s" uninstalled': 'application "%s" uninstalled', +'application compiled': 'application compiled', +'application is compiled and cannot be designed': 'application is compiled and cannot be designed', +'arguments': 'arguments', +'back': 'back', +'cache': 'cache', +'cache, errors and sessions cleaned': 'cache, errors and sessions cleaned', +'cannot create file': 'cannot create file', +'cannot upload file "%(filename)s"': 'cannot upload file "%(filename)s"', +'Change admin password': 'change admin password', +'check all': 'check all', +'Check for upgrades': 'check for upgrades', +'Clean': 'clean', +'click here for online examples': 'щракни тук за онлайн примери', +'click here for the administrative interface': 'щракни тук за админиÑÑ‚Ñ€Ð°Ñ‚Ð¸Ð²Ð½Ð¸Ñ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ', +'click to check for upgrades': 'click to check for upgrades', +'code': 'code', +'collapse/expand all': 'collapse/expand all', +'Compile': 'compile', +'compiled application removed': 'compiled application removed', +'controllers': 'controllers', +'Create': 'create', +'create file with filename:': 'create file with filename:', +'create new application:': 'create new application:', +'created by': 'created by', +'crontab': 'crontab', +'currently running': 'currently running', +'currently saved or': 'currently saved or', +'data uploaded': 'данните бÑха качени', +'database': 'database', +'database %s select': 'database %s select', +'database administration': 'database administration', +'db': 'дб', +'defines tables': 'defines tables', +'delete': 'delete', +'delete all checked': 'delete all checked', +'delete plugin': 'delete plugin', +'Deploy': 'deploy', +'design': 'дизайн', +'direction: ltr': 'direction: ltr', +'done!': 'готово!', +'download layouts': 'download layouts', +'download plugins': 'download plugins', +'Edit': 'edit', +'edit controller': 'edit controller', +'edit views:': 'edit views:', +'Errors': 'errors', +'export as csv file': 'export as csv file', +'exposes': 'exposes', +'extends': 'extends', +'failed to reload module': 'failed to reload module', +'failed to reload module because:': 'failed to reload module because:', +'file "%(filename)s" created': 'file "%(filename)s" created', +'file "%(filename)s" deleted': 'file "%(filename)s" deleted', +'file "%(filename)s" uploaded': 'file "%(filename)s" uploaded', +'file "%(filename)s" was not deleted': 'file "%(filename)s" was not deleted', +'file "%s" of %s restored': 'file "%s" of %s restored', +'file changed on disk': 'file changed on disk', +'file does not exist': 'file does not exist', +'file saved on %(time)s': 'file saved on %(time)s', +'file saved on %s': 'file saved on %s', +'files': 'files', +'filter': 'filter', +'Help': 'help', +'htmledit': 'htmledit', +'includes': 'includes', +'insert new': 'insert new', +'insert new %s': 'insert new %s', +'Install': 'install', +'internal error': 'internal error', +'invalid password': 'invalid password', +'invalid request': 'невалидна заÑвка', +'invalid ticket': 'invalid ticket', +'language file "%(filename)s" created/updated': 'language file "%(filename)s" created/updated', +'languages': 'languages', +'languages updated': 'languages updated', +'loading...': 'loading...', +'login': 'login', +'Logout': 'logout', +'merge': 'merge', +'models': 'models', +'modules': 'modules', +'new application "%s" created': 'new application "%s" created', +'new plugin installed': 'new plugin installed', +'new record inserted': 'новиÑÑ‚ Ð·Ð°Ð¿Ð¸Ñ Ð±ÐµÑˆÐµ добавен', +'next 100 rows': 'next 100 rows', +'no match': 'no match', +'or import from csv file': 'or import from csv file', +'or provide app url:': 'or provide app url:', +'or provide application url:': 'or provide application url:', +'Overwrite installed app': 'overwrite installed app', +'Pack all': 'pack all', +'Pack compiled': 'pack compiled', +'pack plugin': 'pack plugin', +'password changed': 'password changed', +'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" deleted', +'plugins': 'plugins', +'previous 100 rows': 'previous 100 rows', +'record': 'record', +'record does not exist': 'запиÑÑŠÑ‚ не ÑъщеÑтвува', +'record id': 'record id', +'Remove compiled': 'remove compiled', +'restore': 'restore', +'revert': 'revert', +'save': 'save', +'selected': 'selected', +'session expired': 'session expired', +'shell': 'shell', +'Site': 'site', +'some files could not be removed': 'some files could not be removed', +'Start wizard': 'start wizard', +'state': 'ÑÑŠÑтоÑние', +'static': 'static', +'submit': 'submit', +'table': 'table', +'test': 'test', +'the application logic, each URL path is mapped in one exposed function in the controller': 'the application logic, each URL path is mapped in one exposed function in the controller', +'the data representation, define database tables and sets': 'the data representation, define database tables and sets', +'the presentations layer, views are also known as templates': 'the presentations layer, views are also known as templates', +'these files are served without processing, your images go here': 'these files are served without processing, your images go here', +'to previous version.': 'to previous version.', +'translation strings for the application': 'translation strings for the application', +'try': 'try', +'try something like': 'try something like', +'unable to create application "%s"': 'unable to create application "%s"', +'unable to delete file "%(filename)s"': 'unable to delete file "%(filename)s"', +'unable to delete file plugin "%(plugin)s"': 'unable to delete file plugin "%(plugin)s"', +'unable to parse csv file': 'не е възможна обработката на csv файла', +'unable to uninstall "%s"': 'unable to uninstall "%s"', +'unable to upgrade because "%s"': 'unable to upgrade because "%s"', +'uncheck all': 'uncheck all', +'Uninstall': 'uninstall', +'update': 'update', +'update all languages': 'update all languages', +'upgrade web2py now': 'upgrade web2py now', +'upload': 'upload', +'upload application:': 'upload application:', +'upload file:': 'upload file:', +'upload plugin file:': 'upload plugin file:', +'variables': 'variables', +'versioning': 'versioning', +'view': 'view', +'views': 'views', +'web2py Recent Tweets': 'web2py Recent Tweets', +'web2py is up to date': 'web2py is up to date', +'web2py upgraded; please restart it': 'web2py upgraded; please restart it', +} diff --git a/applications/admin/languages/de-de.py b/applications/admin/languages/de-de.py new file mode 100644 index 00000000..37e076c8 --- /dev/null +++ b/applications/admin/languages/de-de.py @@ -0,0 +1,341 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Update" ist ein optionaler Ausdruck wie "Feld1 = \'newvalue". JOIN Ergebnisse können nicht aktualisiert oder gelöscht werden', +'%Y-%m-%d': '%Y-%m-%d', +'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', +'%s rows deleted': '%s Zeilen gelöscht', +'%s rows updated': '%s Zeilen aktualisiert', +'(requires internet access)': '(requires internet access)', +'(something like "it-it")': '(so etwas wie "it-it")', +'A new version of web2py is available': 'Eine neue Version von web2py ist verfügbar', +'A new version of web2py is available: %s': 'Eine neue Version von web2py ist verfügbar: %s', +'A new version of web2py is available: Version 1.85.3 (2010-09-18 07:07:46)\n': 'Eine neue Version von web2py ist verfügbar: Version 1.85.3 (2010-09-18 07:07:46)\n', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ACHTUNG: Die Einwahl benötigt eine sichere (HTTPS) Verbindung. Es sei denn sie läuft Lokal(localhost).', +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ACHTUNG: Testen ist nicht threadsicher. Führen sie also nicht mehrere Tests gleichzeitig aus.', +'ATTENTION: This is an experimental feature and it needs more testing.': 'ACHTUNG: Dies ist eine experimentelle Funktion und benötigt noch weitere Tests.', +'ATTENTION: you cannot edit the running application!': 'ACHTUNG: Eine laufende Anwendung kann nicht editiert werden!', +'Abort': 'Abbrechen', +'About': 'Über', +'About application': 'Über die Anwendung', +'Additional code for your application': 'Additional code for your application', +'Admin is disabled because insecure channel': 'Appadmin ist deaktiviert, wegen der Benutzung eines unsicheren Kanals', +'Admin is disabled because unsecure channel': 'Appadmin ist deaktiviert, wegen der Benutzung eines unsicheren Kanals', +'Admin language': 'Admin language', +'Administrator Password:': 'Administrator Passwort:', +'Application name:': 'Application name:', +'Are you sure you want to delete file "%s"?': 'Sind Sie sich sicher, dass Sie diese Datei löschen wollen "%s"?', +'Are you sure you want to uninstall application "%s"': 'Sind Sie sich sicher, dass Sie diese Anwendung deinstallieren wollen "%s"', +'Are you sure you want to uninstall application "%s"?': 'Sind Sie sich sicher, dass Sie diese Anwendung deinstallieren wollen "%s"?', +'Are you sure you want to upgrade web2py now?': 'Sind Sie sich sicher, dass Sie web2py jetzt upgraden möchten?', +'Authentication': 'Authentifizierung', +'Available databases and tables': 'Verfügbare Datenbanken und Tabellen', +'Cannot be empty': 'Darf nicht leer sein', +'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'Nicht Kompilierbar:Es sind Fehler in der Anwendung. Beseitigen Sie die Fehler und versuchen Sie es erneut.', +'Change Password': 'Passwort ändern', +'Check to delete': 'Markiere zum löschen', +'Checking for upgrades...': 'Auf Updates überprüfen...', +'Client IP': 'Client IP', +'Controller': 'Controller', +'Controllers': 'Controller', +'Copyright': 'Urheberrecht', +'Create new simple application': 'Erzeuge neue Anwendung', +'Current request': 'Aktuelle Anfrage (request)', +'Current response': 'Aktuelle Antwort (response)', +'Current session': 'Aktuelle Sitzung (session)', +'DB Model': 'DB Modell', +'DESIGN': 'design', +'Database': 'Datenbank', +'Date and Time': 'Datum und Uhrzeit', +'Delete': 'Löschen', +'Delete:': 'Löschen:', +'Deploy on Google App Engine': 'Auf Google App Engine installieren', +'Description': 'Beschreibung', +'Design for': 'Design für', +'E-mail': 'E-mail', +'EDIT': 'BEARBEITEN', +'Edit': 'Bearbeiten', +'Edit Profile': 'Bearbeite Profil', +'Edit This App': 'Bearbeite diese Anwendung', +'Edit application': 'Bearbeite Anwendung', +'Edit current record': 'Bearbeite aktuellen Datensatz', +'Editing Language file': 'Sprachdatei bearbeiten', +'Editing file': 'Bearbeite Datei', +'Editing file "%s"': 'Bearbeite Datei "%s"', +'Enterprise Web Framework': 'Enterprise Web Framework', +'Error logs for "%(app)s"': 'Fehlerprotokoll für "%(app)s"', +'Exception instance attributes': 'Atribute der Ausnahmeinstanz', +'Expand Abbreviation': 'Kürzel erweitern', +'First name': 'Vorname', +'Functions with no doctests will result in [passed] tests.': 'Funktionen ohne doctests erzeugen [passed] in Tests', +'Go to Matching Pair': 'gehe zum übereinstimmenden Paar', +'Group ID': 'Gruppen ID', +'Hello World': 'Hallo Welt', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'Falls der obere Test eine Fehler-Ticketnummer enthält deutet das auf einen Fehler in der Ausführung des Controllers hin, noch bevor der Doctest ausgeführt werden konnte. Gewöhnlich führen fehlerhafte Einrückungen oder fehlerhafter Code ausserhalb der Funktion zu solchen Fehlern. Ein grüner Titel deutet darauf hin, dass alle Test(wenn sie vorhanden sind) erfolgreich durchlaufen wurden. In diesem Fall werden die Testresultate nicht angezeigt.', +'If you answer "yes", be patient, it may take a while to download': '', +'If you answer yes, be patient, it may take a while to download': 'If you answer yes, be patient, it may take a while to download', +'Import/Export': 'Importieren/Exportieren', +'Index': 'Index', +'Installed applications': 'Installierte Anwendungen', +'Internal State': 'interner Status', +'Invalid Query': 'Ungültige Abfrage', +'Invalid action': 'Ungültige Aktion', +'Invalid email': 'Ungültige Email', +'Key bindings': 'Tastenbelegungen', +'Key bindings for ZenConding Plugin': 'Tastenbelegungen für das ZenConding Plugin', +'Language files (static strings) updated': 'Sprachdatei (statisch Strings) aktualisiert', +'Languages': 'Sprachen', +'Last name': 'Nachname', +'Last saved on:': 'Zuletzt gespeichert am:', +'Layout': 'Layout', +'License for': 'Lizenz für', +'Login': 'Anmelden', +'Login to the Administrative Interface': 'An das Administrations-Interface anmelden', +'Logout': 'Abmeldung', +'Lost Password': 'Passwort vergessen', +'Main Menu': 'Menú principal', +'Match Pair': 'Paare finden', +'Menu Model': 'Menü Modell', +'Merge Lines': 'Zeilen zusammenfügen', +'Models': 'Modelle', +'Modules': 'Module', +'NO': 'NEIN', +'Name': 'Name', +'New Record': 'Neuer Datensatz', +'New application wizard': 'New application wizard', +'New simple application': 'New simple application', +'Next Edit Point': 'nächster Bearbeitungsschritt', +'No databases in this application': 'Keine Datenbank in dieser Anwendung', +'Origin': 'Herkunft', +'Original/Translation': 'Original/Übersetzung', +'Password': 'Passwort', +'Peeking at file': 'Dateiansicht', +'Plugin "%s" in application': 'Plugin "%s" in Anwendung', +'Plugins': 'Plugins', +'Powered by': 'Unterstützt von', +'Previous Edit Point': 'vorheriger Bearbeitungsschritt', +'Query:': 'Abfrage:', +'Record ID': 'Datensatz ID', +'Register': 'registrieren', +'Registration key': 'Registrierungsschlüssel', +'Reset Password key': 'Passwortschlüssel zurücksetzen', +'Resolve Conflict file': 'bereinige Konflikt-Datei', +'Role': 'Rolle', +'Rows in table': 'Zeilen in Tabelle', +'Rows selected': 'Zeilen ausgewählt', +'Save via Ajax': 'via Ajax sichern', +'Saved file hash:': 'Gespeicherter Datei-Hash:', +'Searching:': 'Searching:', +'Static files': 'statische Dateien', +'Stylesheet': 'Stylesheet', +'Sure you want to delete this object?': 'Wollen Sie das Objekt wirklich löschen?', +'TM': 'TM', +'Table name': 'Tabellen Name', +'Testing application': 'Teste die Anwendung', +'Testing controller': 'teste Controller', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'Die "query" ist eine Bedingung wie "db.table1.field1 == \'Wert\'". Etwas wie "db.table1.field1 db.table2.field2 ==" führt zu einem SQL JOIN.', +'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller', +'The data representation, define database tables and sets': 'The data representation, define database tables and sets', +'The output of the file is a dictionary that was rendered by the view': 'The output of the file is a dictionary that was rendered by the view', +'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates', +'There are no controllers': 'Keine Controller vorhanden', +'There are no models': 'Keine Modelle vorhanden', +'There are no modules': 'Keine Module vorhanden', +'There are no plugins': 'There are no plugins', +'There are no static files': 'Keine statischen Dateien vorhanden', +'There are no translators, only default language is supported': 'Keine Übersetzungen vorhanden, nur die voreingestellte Sprache wird unterstützt', +'There are no views': 'Keine Views vorhanden', +'These files are served without processing, your images go here': 'These files are served without processing, your images go here', +'This is a copy of the scaffolding application': 'Dies ist eine Kopie einer Grundgerüst-Anwendung', +'This is the %(filename)s template': 'Dies ist das Template %(filename)s', +'Ticket': 'Ticket', +'Timestamp': 'Timestamp', +'To create a plugin, name a file/folder plugin_[name]': 'Um ein Plugin zu erstellen benennen Sie eine(n) Datei/Ordner plugin_[Name]', +'Translation strings for the application': 'Translation strings for the application', +'Unable to check for upgrades': 'überprüfen von Upgrades nicht möglich', +'Unable to download': 'herunterladen nicht möglich', +'Unable to download app': 'herunterladen der Anwendung nicht möglich', +'Update:': 'Aktualisiere:', +'Upload & install packed application': 'Verpackte Anwendung hochladen und installieren', +'Upload a package:': 'Upload a package:', +'Upload existing application': 'lade existierende Anwendung hoch', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Benutze (...)&(...) für AND, (...)|(...) für OR, und ~(...) für NOT, um komplexe Abfragen zu erstellen.', +'Use an url:': 'Use an url:', +'User ID': 'Benutzer ID', +'Version': 'Version', +'View': 'View', +'Views': 'Views', +'Welcome %s': 'Willkommen %s', +'Welcome to web2py': 'Willkommen zu web2py', +'Which called the function': 'Which called the function', +'Wrap with Abbreviation': 'mit Kürzel einhüllen', +'YES': 'JA', +'You are successfully running web2py': 'web2by wird erfolgreich ausgeführt', +'You can modify this application and adapt it to your needs': 'Sie können diese Anwendung verändern und Ihren Bedürfnissen anpassen', +'You visited the url': 'Sie besuchten die URL', +'About': 'Über', +'additional code for your application': 'zusätzlicher Code für Ihre Anwendung', +'admin disabled because no admin password': ' admin ist deaktiviert, weil kein Admin-Passwort gesetzt ist', +'admin disabled because not supported on google apps engine': 'admin ist deaktiviert, es existiert dafür keine Unterstützung auf der google apps engine', +'admin disabled because unable to access password file': 'admin ist deaktiviert, weil kein Zugriff auf die Passwortdatei besteht', +'administrative interface': 'administrative interface', +'and rename it (required):': 'und benenne sie um (erforderlich):', +'and rename it:': ' und benenne sie um:', +'appadmin': 'appadmin', +'appadmin is disabled because insecure channel': 'Appadmin ist deaktiviert, wegen der Benutzung eines unsicheren Kanals', +'application "%s" uninstalled': 'Anwendung "%s" deinstalliert', +'application compiled': 'Anwendung kompiliert', +'application is compiled and cannot be designed': 'Die Anwendung ist kompiliert kann deswegen nicht mehr geändert werden', +'arguments': 'arguments', +'back': 'zurück', +'beautify': 'beautify', +'cache': 'Cache', +'cache, errors and sessions cleaned': 'Zwischenspeicher (cache), Fehler und Sitzungen (sessions) gelöscht', +'call': 'call', +'cannot create file': 'Kann Datei nicht erstellen', +'cannot upload file "%(filename)s"': 'Kann Datei nicht Hochladen "%(filename)s"', +'Change admin password': 'Administrator-Passwort ändern', +'change password': 'Passwort ändern', +'check all': 'alles auswählen', +'Check for upgrades': 'check for upgrades', +'Clean': 'löschen', +'click here for online examples': 'hier klicken für online Beispiele', +'click here for the administrative interface': 'hier klicken für die Administrationsoberfläche ', +'click to check for upgrades': 'hier klicken um nach Upgrades zu suchen', +'code': 'code', +'collapse/expand all': 'collapse/expand all', +'Compile': 'kompilieren', +'compiled application removed': 'kompilierte Anwendung gelöscht', +'controllers': 'Controllers', +'Create': 'erstellen', +'create file with filename:': 'erzeuge Datei mit Dateinamen:', +'create new application:': 'erzeuge neue Anwendung:', +'created by': 'created by', +'crontab': 'crontab', +'currently running': 'currently running', +'currently saved or': 'des derzeit gespeicherten oder', +'customize me!': 'pass mich an!', +'data uploaded': 'Daten hochgeladen', +'database': 'Datenbank', +'database %s select': 'Datenbank %s ausgewählt', +'database administration': 'Datenbankadministration', +'db': 'db', +'defines tables': 'definiere Tabellen', +'delete': 'löschen', +'delete all checked': 'lösche alle markierten', +'delete plugin': 'Plugin löschen', +'Deploy': 'deploy', +'design': 'design', +'direction: ltr': 'direction: ltr', +'documentation': 'Dokumentation', +'done!': 'fertig!', +'download layouts': 'download layouts', +'download plugins': 'download plugins', +'Edit': 'bearbeiten', +'edit controller': 'Bearbeite Controller', +'edit profile': 'bearbeite Profil', +'edit views:': 'Views bearbeiten:', +'Errors': 'Fehler', +'escape': 'escape', +'export as csv file': 'Exportieren als CSV-Datei', +'exposes': 'stellt zur Verfügung', +'extends': 'erweitert', +'failed to reload module': 'neu laden des Moduls fehlgeschlagen', +'file "%(filename)s" created': 'Datei "%(filename)s" erstellt', +'file "%(filename)s" deleted': 'Datei "%(filename)s" gelöscht', +'file "%(filename)s" uploaded': 'Datei "%(filename)s" hochgeladen', +'file "%(filename)s" was not deleted': 'Datei "%(filename)s" wurde nicht gelöscht', +'file "%s" of %s restored': 'Datei "%s" von %s wiederhergestellt', +'file changed on disk': 'Datei auf Festplatte geändert', +'file does not exist': 'Datei existiert nicht', +'file saved on %(time)s': 'Datei gespeichert am %(time)s', +'file saved on %s': 'Datei gespeichert auf %s', +'files': 'files', +'filter': 'filter', +'Help': 'Hilfe', +'htmledit': 'htmledit', +'includes': 'Einfügen', +'index': 'index', +'insert new': 'neu einfügen', +'insert new %s': 'neu einfügen %s', +'Install': 'installieren', +'internal error': 'interner Fehler', +'invalid password': 'Ungültiges Passwort', +'invalid request': 'ungültige Anfrage', +'invalid ticket': 'ungültiges Ticket', +'language file "%(filename)s" created/updated': 'Sprachdatei "%(filename)s" erstellt/aktualisiert', +'languages': 'Sprachen', +'languages updated': 'Sprachen aktualisiert', +'loading...': 'lade...', +'located in the file': 'located in Datei', +'login': 'anmelden', +'Logout': 'abmelden', +'lost password?': 'Passwort vergessen?', +'merge': 'verbinden', +'models': 'Modelle', +'modules': 'Module', +'new application "%s" created': 'neue Anwendung "%s" erzeugt', +'new record inserted': 'neuer Datensatz eingefügt', +'next 100 rows': 'nächsten 100 Zeilen', +'or import from csv file': 'oder importieren von cvs Datei', +'or provide app url:': 'oder geben Sie eine Anwendungs-URL an:', +'or provide application url:': 'oder geben Sie eine Anwendungs-URL an:', +'Overwrite installed app': 'installierte Anwendungen überschreiben', +'Pack all': 'verpacke alles', +'Pack compiled': 'Verpacke kompiliert', +'pack plugin': 'Plugin verpacken', +'please wait!': 'bitte warten!', +'plugins': 'plugins', +'previous 100 rows': 'vorherige 100 zeilen', +'record': 'Datensatz', +'record does not exist': 'Datensatz existiert nicht', +'record id': 'Datensatz id', +'register': 'Registrierung', +'Remove compiled': 'kompilat gelöscht', +'restore': 'wiederherstellen', +'revert': 'zurückkehren', +'save': 'sichern', +'selected': 'ausgewählt(e)', +'session expired': 'Sitzung Abgelaufen', +'shell': 'shell', +'Site': 'Seite', +'some files could not be removed': 'einige Dateien konnten nicht gelöscht werden', +'Start wizard': 'start wizard', +'state': 'Status', +'static': 'statische Dateien', +'submit': 'Absenden', +'table': 'Tabelle', +'test': 'Test', +'test_def': 'test_def', +'test_for': 'test_for', +'test_if': 'test_if', +'test_try': 'test_try', +'the application logic, each URL path is mapped in one exposed function in the controller': 'Die Logik der Anwendung, jeder URL-Pfad wird auf eine Funktion abgebildet die der Controller zur Verfügung stellt', +'the data representation, define database tables and sets': 'Die Datenrepräsentation definiert Mengen von Tabellen und Datenbanken ', +'the presentations layer, views are also known as templates': 'Die Präsentationsschicht, Views sind auch bekannt als Vorlagen/Templates', +'these files are served without processing, your images go here': 'Diese Dateien werden ohne Verarbeitung ausgeliefert. Beispielsweise Bilder kommen hier hin.', +'to previous version.': 'zu einer früheren Version.', +'translation strings for the application': 'Übersetzungs-Strings für die Anwendung', +'try': 'versuche', +'try something like': 'versuche so etwas wie', +'unable to create application "%s"': 'erzeugen von Anwendung "%s" nicht möglich', +'unable to delete file "%(filename)s"': 'löschen von Datein "%(filename)s" nicht möglich', +'unable to parse csv file': 'analysieren der cvs Datei nicht möglich', +'unable to uninstall "%s"': 'deinstallieren von "%s" nicht möglich', +'uncheck all': 'alles demarkieren', +'Uninstall': 'deinstallieren', +'update': 'aktualisieren', +'update all languages': 'aktualisiere alle Sprachen', +'upgrade web2py now': 'jetzt web2py upgraden', +'upload': 'upload', +'upload application:': 'lade Anwendung hoch:', +'upload file:': 'lade Datei hoch:', +'upload plugin file:': 'Plugin-Datei hochladen:', +'user': 'user', +'variables': 'variables', +'versioning': 'Versionierung', +'view': 'View', +'views': 'Views', +'web2py Recent Tweets': 'neuste Tweets von web2py', +'web2py is up to date': 'web2py ist auf dem neuesten Stand', +'xml': 'xml', +} diff --git a/applications/admin/languages/es-es.py b/applications/admin/languages/es-es.py new file mode 100644 index 00000000..f94a4423 --- /dev/null +++ b/applications/admin/languages/es-es.py @@ -0,0 +1,282 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN', +'%Y-%m-%d': '%Y-%m-%d', +'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', +'%s rows deleted': '%s filas eliminadas', +'%s rows updated': '%s filas actualizadas', +'(something like "it-it")': '(algo como "it-it")', +'A new version of web2py is available': 'Hay una nueva versión de web2py disponible', +'A new version of web2py is available: %s': 'Hay una nueva versión de web2py disponible: %s', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATENCION: Inicio de sesión requiere una conexión segura (HTTPS) o localhost.', +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATENCION: NO EJECUTE VARIAS PRUEBAS SIMULTANEAMENTE, NO SON THREAD SAFE.', +'ATTENTION: you cannot edit the running application!': 'ATENCION: no puede modificar la aplicación que se ejecuta!', +'About': 'Acerca de', +'About application': 'Acerca de la aplicación', +'Admin is disabled because insecure channel': 'Admin deshabilitado, el canal no es seguro', +'Admin is disabled because unsecure channel': 'Admin deshabilitado, el canal no es seguro', +'Administrator Password:': 'Contraseña del Administrador:', +'Are you sure you want to delete file "%s"?': '¿Está seguro que desea eliminar el archivo "%s"?', +'Are you sure you want to delete plugin "%s"?': '¿Está seguro que quiere eliminar el plugin "%s"?', +'Are you sure you want to uninstall application "%s"': '¿Está seguro que desea desinstalar la aplicación "%s"', +'Are you sure you want to uninstall application "%s"?': '¿Está seguro que desea desinstalar la aplicación "%s"?', +'Are you sure you want to upgrade web2py now?': '¿Está seguro que desea actualizar web2py ahora?', +'Available databases and tables': 'Bases de datos y tablas disponibles', +'Cannot be empty': 'No puede estar vacío', +'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'No se puede compilar: hay errores en su aplicación. Depure, corrija errores y vuelva a intentarlo.', +'Cannot compile: there are errors in your app:': 'No se puede compilar: hay errores en su aplicación:', +'Change Password': 'Cambie Contraseña', +'Check to delete': 'Marque para eliminar', +'Checking for upgrades...': 'Buscando actulizaciones...', +'Click row to expand traceback': 'Click row to expand traceback', +'Client IP': 'IP del Cliente', +'Controllers': 'Controladores', +'Count': 'Count', +'Create new application using the Wizard': 'Create new application using the Wizard', +'Create new simple application': 'Cree una nueva aplicación', +'Current request': 'Solicitud en curso', +'Current response': 'Respuesta en curso', +'Current session': 'Sesión en curso', +'DESIGN': 'DISEÑO', +'Date and Time': 'Fecha y Hora', +'Delete': 'Elimine', +'Delete:': 'Elimine:', +'Deploy on Google App Engine': 'Instale en Google App Engine', +'Description': 'Descripción', +'Design for': 'Diseño para', +'E-mail': 'Correo electrónico', +'EDIT': 'EDITAR', +'Edit Profile': 'Editar Perfil', +'Edit application': 'Editar aplicación', +'Edit current record': 'Edite el registro actual', +'Editing Language file': 'Editando archivo de lenguaje', +'Editing file': 'Editando archivo', +'Editing file "%s"': 'Editando archivo "%s"', +'Enterprise Web Framework': 'Armazón Empresarial para Internet', +'Error': 'Error', +'Error logs for "%(app)s"': 'Bitácora de errores en "%(app)s"', +'Exception instance attributes': 'Atributos de la instancia de Excepción', +'File': 'File', +'First name': 'Nombre', +'Functions with no doctests will result in [passed] tests.': 'Funciones sin doctests equivalen a pruebas [aceptadas].', +'Group ID': 'ID de Grupo', +'Hello World': 'Hola Mundo', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'Si el reporte anterior contiene un número de tiquete este indica un falla en la ejecución del controlador, antes de cualquier intento de ejecutat doctests. Esto generalmente se debe a un error en la indentación o un error por fuera del código de la función.\r\nUn titulo verde indica que todas las pruebas pasaron (si existen). En dicho caso los resultados no se muestran.', +'Import/Export': 'Importar/Exportar', +'Installed applications': 'Aplicaciones instaladas', +'Internal State': 'Estado Interno', +'Invalid Query': 'Consulta inválida', +'Invalid action': 'Acción inválida', +'Invalid email': 'Correo inválido', +'Language files (static strings) updated': 'Archivos de lenguaje (cadenas estáticas) actualizados', +'Languages': 'Lenguajes', +'Last name': 'Apellido', +'Last saved on:': 'Guardado en:', +'License for': 'Licencia para', +'Login': 'Inicio de sesión', +'Login to the Administrative Interface': 'Inicio de sesión para la Interfaz Administrativa', +'Logout': 'Fin de sesión', +'Lost Password': 'Contraseña perdida', +'Models': 'Modelos', +'Modules': 'Módulos', +'NO': 'NO', +'Name': 'Nombre', +'New Record': 'Registro nuevo', +'No databases in this application': 'No hay bases de datos en esta aplicación', +'Origin': 'Origen', +'Original/Translation': 'Original/Traducción', +'PAM authenticated user, cannot change password here': 'usuario autenticado por PAM, no puede cambiar la contraseña aquí', +'Password': 'Contraseña', +'Peeking at file': 'Visualizando archivo', +'Plugin "%s" in application': 'Plugin "%s" en aplicación', +'Plugins': 'Plugins', +'Powered by': 'Este sitio usa', +'Query:': 'Consulta:', +'Record ID': 'ID de Registro', +'Register': 'Registrese', +'Registration key': 'Contraseña de Registro', +'Resolve Conflict file': 'archivo Resolución de Conflicto', +'Role': 'Rol', +'Rows in table': 'Filas en la tabla', +'Rows selected': 'Filas seleccionadas', +'Saved file hash:': 'Hash del archivo guardado:', +'Static files': 'Archivos estáticos', +'Sure you want to delete this object?': '¿Está seguro que desea eliminar este objeto?', +'TM': 'MR', +'Table name': 'Nombre de la tabla', +'Testing application': 'Probando aplicación', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La "consulta" es una condición como "db.tabla1.campo1==\'valor\'". Algo como "db.tabla1.campo1==db.tabla2.campo2" resulta en un JOIN SQL.', +'There are no controllers': 'No hay controladores', +'There are no models': 'No hay modelos', +'There are no modules': 'No hay módulos', +'There are no static files': 'No hay archivos estáticos', +'There are no translators, only default language is supported': 'No hay traductores, sólo el lenguaje por defecto es soportado', +'There are no views': 'No hay vistas', +'This is the %(filename)s template': 'Esta es la plantilla %(filename)s', +'Ticket': 'Tiquete', +'Timestamp': 'Timestamp', +'To create a plugin, name a file/folder plugin_[name]': 'Para crear un plugin, nombre un archivo/carpeta plugin_[nombre]', +'Unable to check for upgrades': 'No es posible verificar la existencia de actualizaciones', +'Unable to download': 'No es posible la descarga', +'Unable to download app': 'No es posible descargar la aplicación', +'Unable to download app because:': 'No es posible descargar la aplicación porque:', +'Unable to download because': 'No es posible descargar porque', +'Update:': 'Actualice:', +'Upload & install packed application': 'Suba e instale aplicación empaquetada', +'Upload existing application': 'Suba esta aplicación', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) para AND, (...)|(...) para OR, y ~(...) para NOT, para crear consultas más complejas.', +'User ID': 'ID de Usuario', +'Version': 'Versión', +'Views': 'Vistas', +'Welcome to web2py': 'Bienvenido a web2py', +'YES': 'SI', +'About': 'acerca de', +'additional code for your application': 'código adicional para su aplicación', +'admin disabled because no admin password': ' por falta de contraseña', +'admin disabled because not supported on google app engine': 'admin deshabilitado, no es soportado en GAE', +'admin disabled because unable to access password file': 'admin deshabilitado, imposible acceder al archivo con la contraseña', +'and rename it (required):': 'y renombrela (requerido):', +'and rename it:': ' y renombrelo:', +'appadmin': 'appadmin', +'appadmin is disabled because insecure channel': 'admin deshabilitado, el canal no es seguro', +'application "%s" uninstalled': 'aplicación "%s" desinstalada', +'application compiled': 'aplicación compilada', +'application is compiled and cannot be designed': 'la aplicación está compilada y no puede ser modificada', +'arguments': 'argumentos', +'back': 'atrás', +'browse': 'buscar', +'cache': 'cache', +'cache, errors and sessions cleaned': 'cache, errores y sesiones eliminados', +'cannot create file': 'no es posible crear archivo', +'cannot upload file "%(filename)s"': 'no es posible subir archivo "%(filename)s"', +'Change admin password': 'cambie contraseña admin', +'check all': 'marcar todos', +'Clean': 'limpiar', +'click here for online examples': 'haga clic aquí para ver ejemplos en línea', +'click here for the administrative interface': 'haga clic aquí para usar la interfaz administrativa', +'click to check for upgrades': 'haga clic para buscar actualizaciones', +'click to open': 'click to open', +'code': 'código', +'commit (mercurial)': 'commit (mercurial)', +'Compile': 'compilar', +'compiled application removed': 'aplicación compilada removida', +'controllers': 'controladores', +'Create': 'crear', +'create file with filename:': 'cree archivo con nombre:', +'create new application:': 'nombre de la nueva aplicación:', +'created by': 'creado por', +'crontab': 'crontab', +'currently saved or': 'actualmente guardado o', +'customize me!': 'Adaptame!', +'data uploaded': 'datos subidos', +'database': 'base de datos', +'database %s select': 'selección en base de datos %s', +'database administration': 'administración base de datos', +'db': 'db', +'defines tables': 'define tablas', +'delete': 'eliminar', +'delete all checked': 'eliminar marcados', +'delete plugin': 'eliminar plugin', +'design': 'modificar', +'direction: ltr': 'direction: ltr', +'done!': 'listo!', +'Edit': 'editar', +'edit controller': 'editar controlador', +'edit views:': 'editar vistas:', +'Errors': 'errores', +'export as csv file': 'exportar como archivo CSV', +'exposes': 'expone', +'extends': 'extiende', +'failed to reload module': 'recarga del módulo ha fallado', +'failed to reload module because:': 'no es posible recargar el módulo por:', +'file "%(filename)s" created': 'archivo "%(filename)s" creado', +'file "%(filename)s" deleted': 'archivo "%(filename)s" eliminado', +'file "%(filename)s" uploaded': 'archivo "%(filename)s" subido', +'file "%(filename)s" was not deleted': 'archivo "%(filename)s" no fué eliminado', +'file "%s" of %s restored': 'archivo "%s" de %s restaurado', +'file changed on disk': 'archivo modificado en el disco', +'file does not exist': 'archivo no existe', +'file saved on %(time)s': 'archivo guardado %(time)s', +'file saved on %s': 'archivo guardado %s', +'Help': 'ayuda', +'htmledit': 'htmledit', +'includes': 'incluye', +'insert new': 'inserte nuevo', +'insert new %s': 'inserte nuevo %s', +'Install': 'instalar', +'internal error': 'error interno', +'invalid password': 'contraseña inválida', +'invalid request': 'solicitud inválida', +'invalid ticket': 'tiquete inválido', +'language file "%(filename)s" created/updated': 'archivo de lenguaje "%(filename)s" creado/actualizado', +'languages': 'lenguajes', +'languages updated': 'lenguajes actualizados', +'loading...': 'cargando...', +'login': 'inicio de sesión', +'Logout': 'fin de sesión', +'manage': 'manage', +'merge': 'combinar', +'models': 'modelos', +'modules': 'módulos', +'new application "%s" created': 'nueva aplicación "%s" creada', +'new plugin installed': 'nuevo plugin instalado', +'new record inserted': 'nuevo registro insertado', +'next 100 rows': '100 filas siguientes', +'no match': 'no encontrado', +'or import from csv file': 'o importar desde archivo CSV', +'or provide app url:': 'o provea URL de la aplicación:', +'or provide application url:': 'o provea URL de la aplicación:', +'Overwrite installed app': 'sobreescriba aplicación instalada', +'Pack all': 'empaquetar todo', +'Pack compiled': 'empaquete compiladas', +'pack plugin': 'empaquetar plugin', +'password changed': 'contraseña cambiada', +'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" eliminado', +'previous 100 rows': '100 filas anteriores', +'record': 'registro', +'record does not exist': 'el registro no existe', +'record id': 'id de registro', +'Remove compiled': 'eliminar compiladas', +'restore': 'restaurar', +'revert': 'revertir', +'save': 'guardar', +'selected': 'seleccionado(s)', +'session expired': 'sesión expirada', +'shell': 'shell', +'Site': 'sitio', +'some files could not be removed': 'algunos archivos no pudieron ser removidos', +'state': 'estado', +'static': 'estáticos', +'submit': 'enviar', +'table': 'tabla', +'test': 'probar', +'the application logic, each URL path is mapped in one exposed function in the controller': 'la lógica de la aplicación, cada ruta URL se mapea en una función expuesta en el controlador', +'the data representation, define database tables and sets': 'la representación de datos, define tablas y conjuntos de base de datos', +'the presentations layer, views are also known as templates': 'la capa de presentación, las vistas también son llamadas plantillas', +'these files are served without processing, your images go here': 'estos archivos son servidos sin procesar, sus imágenes van aquí', +'to previous version.': 'a la versión previa.', +'translation strings for the application': 'cadenas de caracteres de traducción para la aplicación', +'try': 'intente', +'try something like': 'intente algo como', +'unable to create application "%s"': 'no es posible crear la aplicación "%s"', +'unable to delete file "%(filename)s"': 'no es posible eliminar el archivo "%(filename)s"', +'unable to delete file plugin "%(plugin)s"': 'no es posible eliminar plugin "%(plugin)s"', +'unable to parse csv file': 'no es posible analizar el archivo CSV', +'unable to uninstall "%s"': 'no es posible instalar "%s"', +'unable to upgrade because "%s"': 'no es posible actualizar porque "%s"', +'uncheck all': 'desmarcar todos', +'Uninstall': 'desinstalar', +'update': 'actualizar', +'update all languages': 'actualizar todos los lenguajes', +'upgrade web2py now': 'actualize web2py ahora', +'upload application:': 'subir aplicación:', +'upload file:': 'suba archivo:', +'upload plugin file:': 'suba archivo de plugin:', +'variables': 'variables', +'versioning': 'versiones', +'view': 'vista', +'views': 'vistas', +'web2py Recent Tweets': 'Tweets Recientes de web2py', +'web2py is up to date': 'web2py está actualizado', +'web2py upgraded; please restart it': 'web2py actualizado; favor reiniciar', +} diff --git a/applications/admin/languages/fr-fr.py b/applications/admin/languages/fr-fr.py new file mode 100644 index 00000000..20b4144c --- /dev/null +++ b/applications/admin/languages/fr-fr.py @@ -0,0 +1,279 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression en option tels que "field1 = \'newvalue\'". Vous ne pouvez pas mettre à jour ou supprimer les résultats d\'une jointure "a JOIN"', +'%Y-%m-%d': '%d-%m-%Y', +'%Y-%m-%d %H:%M:%S': '%d-%m-%Y %H:%M:%S', +'%s rows deleted': 'lignes %s supprimé', +'%s rows updated': 'lignes %s mis à jour', +'(requires internet access)': '(requires internet access)', +'(something like "it-it")': '(quelque chose comme "it-it") ', +'A new version of web2py is available: %s': 'Une nouvelle version de web2py est disponible: %s ', +'A new version of web2py is available: Version 1.68.2 (2009-10-21 09:59:29)\n': 'Une nouvelle version de web2py est disponible: Version 1.68.2 (2009-10-21 09:59:29)\r\n', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATTENTION: nécessite une connexion sécurisée (HTTPS) ou être en localhost. ', +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATTENTION: les tests ne sont pas thread-safe DONC NE PAS EFFECTUER DES TESTS MULTIPLES SIMULTANÉMENT.', +'ATTENTION: you cannot edit the running application!': "ATTENTION: vous ne pouvez pas modifier l'application qui tourne!", +'About': 'À propos', +'About application': "A propos de l'application", +'Additional code for your application': 'Additional code for your application', +'Admin is disabled because insecure channel': 'Admin est désactivé parce que canal non sécurisé', +'Admin language': 'Admin language', +'Administrator Password:': 'Mot de passe Administrateur:', +'Application name:': 'Application name:', +'Are you sure you want to delete file "%s"?': 'Etes-vous sûr de vouloir supprimer le fichier «%s»?', +'Are you sure you want to delete plugin "%s"?': 'Etes-vous sûr de vouloir effacer le plugin "%s"?', +'Are you sure you want to delete this object?': 'Are you sure you want to delete this object?', +'Are you sure you want to uninstall application "%s"?': "Êtes-vous sûr de vouloir désinstaller l'application «%s»?", +'Are you sure you want to upgrade web2py now?': 'Are you sure you want to upgrade web2py now?', +'Available databases and tables': 'Bases de données et tables disponible', +'Cannot be empty': 'Ne peut pas être vide', +'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'Ne peut pas compiler: il y a des erreurs dans votre application. corriger les erreurs et essayez à nouveau.', +'Cannot compile: there are errors in your app:': 'Cannot compile: there are errors in your app:', +'Check to delete': 'Cocher pour supprimer', +'Checking for upgrades...': 'Vérification des mises à jour ... ', +'Controllers': 'Contrôleurs', +'Create new simple application': 'Créer une nouvelle application', +'Current request': 'Requête actuel', +'Current response': 'Réponse actuelle', +'Current session': 'Session en cours', +'Date and Time': 'Date et heure', +'Delete': 'Supprimer', +'Delete this file (you will be asked to confirm deletion)': 'Delete this file (you will be asked to confirm deletion)', +'Delete:': 'Supprimer:', +'Deploy on Google App Engine': 'Déployer sur Google App Engine', +'EDIT': 'MODIFIER', +'Edit application': "Modifier l'application", +'Edit current record': 'Modifier cet entrée', +'Editing Language file': 'Modifier le fichier de langue', +'Editing file': 'Modifier le fichier', +'Editing file "%s"': 'Modifier le fichier "% s" ', +'Enterprise Web Framework': 'Enterprise Web Framework', +'Error logs for "%(app)s"': 'Journal d\'erreurs pour "%(app)s"', +'Exception instance attributes': 'Exception instance attributes', +'Functions with no doctests will result in [passed] tests.': 'Des fonctions sans doctests entraînera tests [passed] .', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': "Si le rapport ci-dessus contient un numéro de ticket, cela indique une défaillance dans l'exécution du contrôleur, avant toute tentative d'exécuter les doctests. Cela est généralement dû à une erreur d'indentation ou une erreur à l'extérieur du code de la fonction.\r\nUn titre verte indique que tous les tests (si définie) passed. Dans ce cas, les résultats des essais ne sont pas affichées.", +'Import/Export': 'Importer/Exporter', +'Installed applications': 'Les applications installées', +'Internal State': 'État Interne', +'Invalid Query': 'Requête non valide', +'Invalid action': 'Action non valide', +'Language files (static strings) updated': 'Fichiers de langue (static strings) Mise à jour ', +'Languages': 'Langues', +'Last saved on:': 'Dernière sauvegarde le:', +'License for': 'Licence pour', +'Login': 'Connexion', +'Login to the Administrative Interface': "Se connecter à l'interface d'administration", +'Models': 'Modèles', +'Modules': 'Modules', +'NO': 'NON', +'New Record': 'Nouvel Entrée', +'New application wizard': 'New application wizard', +'New simple application': 'New simple application', +'No databases in this application': 'Aucune base de données dans cette application', +'Original/Translation': 'Original / Traduction', +'PAM authenticated user, cannot change password here': 'PAM authenticated user, cannot change password here', +'Peeking at file': 'Jeter un oeil au fichier', +'Plugin "%s" in application': 'Plugin "%s" dans l\'application', +'Plugins': 'Plugins', +'Powered by': 'Propulsé par', +'Query:': 'Requête: ', +'Resolve Conflict file': 'Résoudre les conflits de fichiers', +'Rows in table': 'Lignes de la table', +'Rows selected': 'Lignes sélectionnées', +"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Run tests in this file (to run all files, you may also use the button labelled 'test')", +'Save': 'Save', +'Saved file hash:': 'Hash du Fichier enregistré:', +'Searching:': 'Searching:', +'Static files': 'Fichiers statiques', +'Sure you want to delete this object?': 'Vous êtes sûr de vouloir supprimer cet objet? ', +'TM': 'MD', +'Testing application': "Test de l'application", +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La "requête" est une condition comme "db.table1.field1==\'value\'". Quelque chose comme "db.table1.field1==db.table2.field2" aboutit à un JOIN SQL.', +'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller', +'The data representation, define database tables and sets': 'The data representation, define database tables and sets', +'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates', +'There are no controllers': "Il n'existe pas de contrôleurs", +'There are no models': "Il n'existe pas de modèles", +'There are no modules': "Il n'existe pas de modules", +'There are no plugins': 'There are no plugins', +'There are no static files': "Il n'existe pas de fichiers statiques", +'There are no translators, only default language is supported': "Il n'y a pas de traducteurs, est prise en charge uniquement la langue par défaut", +'There are no views': "Il n'existe pas de vues", +'These files are served without processing, your images go here': 'These files are served without processing, your images go here', +'This is the %(filename)s template': 'Ceci est le modèle %(filename)s ', +'Ticket': 'Ticket', +'To create a plugin, name a file/folder plugin_[name]': 'Pour créer un plugin, créer un fichier /dossier plugin_[nom]', +'Translation strings for the application': 'Translation strings for the application', +'Unable to check for upgrades': 'Impossible de vérifier les mises à niveau', +'Unable to download': 'Impossible de télécharger', +'Unable to download app': 'Impossible de télécharger app', +'Unable to download app because:': 'Unable to download app because:', +'Unable to download because': 'Unable to download because', +'Update:': 'Mise à jour:', +'Upload & install packed application': 'Upload & install packed application', +'Upload a package:': 'Upload a package:', +'Upload existing application': 'charger une application existante', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Utilisez (...)&(...) pour AND, (...)|(...) pour OR, et ~(...) pour NOT et construire des requêtes plus complexes. ', +'Use an url:': 'Use an url:', +'Version': 'Version', +'Views': 'Vues', +'Web Framework': 'Web Framework', +'YES': 'OUI', +'About': 'à propos', +'additional code for your application': 'code supplémentaire pour votre application', +'admin disabled because no admin password': 'admin désactivé car aucun mot de passe admin', +'admin disabled because not supported on google app engine': 'admin désactivé car non pris en charge sur Google Apps engine', +'admin disabled because unable to access password file': "admin désactivé car incapable d'accéder au fichier mot de passe", +'administrative interface': 'administrative interface', +'and rename it (required):': 'et renommez-la (obligatoire):', +'and rename it:': 'et renommez-le:', +'appadmin': 'appadmin', +'appadmin is disabled because insecure channel': 'appadmin est désactivé parce que canal non sécurisé', +'application "%s" uninstalled': 'application "%s" désinstallé', +'application %(appname)s installed with md5sum: %(digest)s': 'application %(appname)s installed with md5sum: %(digest)s', +'application compiled': 'application compilée', +'application is compiled and cannot be designed': "l'application est compilée et ne peut être désigné", +'arguments': 'arguments', +'back': 'retour', +'cache': 'cache', +'cache, errors and sessions cleaned': 'cache, erreurs et sessions nettoyé', +'cannot create file': 'ne peu pas créer de fichier', +'cannot upload file "%(filename)s"': 'ne peu pas charger le fichier "%(filename)s"', +'Change admin password': 'change admin password', +'check all': 'tous vérifier ', +'Check for upgrades': 'check for upgrades', +'Clean': 'nettoyer', +'click to check for upgrades': 'Cliquez pour vérifier les mises à niveau', +'code': 'code', +'collapse/expand all': 'collapse/expand all', +'Compile': 'compiler', +'compiled application removed': 'application compilée enlevé', +'controllers': 'contrôleurs', +'Create': 'create', +'create file with filename:': 'créer un fichier avec nom de fichier:', +'create new application:': 'créer une nouvelle application:', +'created by': 'créé par', +'crontab': 'crontab', +'currently running': 'currently running', +'currently saved or': 'actuellement enregistrés ou', +'data uploaded': 'données chargées', +'database': 'base de données', +'database %s select': 'base de données %s sélectionner', +'database administration': 'administration base de données', +'db': 'db', +'defines tables': 'définit les tables', +'delete': 'supprimer', +'delete all checked': 'supprimer tout ce qui est cocher', +'delete plugin': ' supprimer plugin', +'Deploy': 'deploy', +'design': 'conception', +'direction: ltr': 'direction: ltr', +'docs': 'docs', +'done!': 'fait!', +'download layouts': 'download layouts', +'download plugins': 'download plugins', +'Edit': 'modifier', +'edit controller': 'modifier contrôleur', +'edit views:': 'edit views:', +'Errors': 'erreurs', +'export as csv file': 'exportation au format CSV', +'exposes': 'expose', +'exposes:': 'exposes:', +'extends': 'étend', +'failed to reload module': 'impossible de recharger le module', +'failed to reload module because:': 'failed to reload module because:', +'file "%(filename)s" created': 'fichier "%(filename)s" créé', +'file "%(filename)s" deleted': 'fichier "%(filename)s" supprimé', +'file "%(filename)s" uploaded': 'fichier "%(filename)s" chargé', +'file "%s" of %s restored': 'fichier "%s" de %s restauré', +'file changed on disk': 'fichier modifié sur le disque', +'file does not exist': "fichier n'existe pas", +'file saved on %(time)s': 'fichier enregistré le %(time)s', +'file saved on %s': 'fichier enregistré le %s', +'files': 'files', +'filter': 'filter', +'Help': 'aide', +'htmledit': 'edition html', +'includes': 'inclus', +'index': 'index', +'insert new': 'insérer nouveau', +'insert new %s': 'insérer nouveau %s', +'Install': 'install', +'internal error': 'erreur interne', +'invalid password': 'mot de passe invalide', +'invalid request': 'Demande incorrecte', +'invalid ticket': 'ticket non valide', +'language file "%(filename)s" created/updated': 'fichier de langue "%(filename)s" créé/mis à jour', +'languages': 'langues', +'loading...': 'Chargement ...', +'login': 'connexion', +'Logout': 'déconnexion', +'merge': 'fusionner', +'models': 'modèles', +'modules': 'modules', +'new application "%s" created': 'nouvelle application "%s" créée', +'new plugin installed': 'nouveau plugin installé', +'new record inserted': 'nouvelle entrée inséré', +'next 100 rows': '100 lignes suivantes', +'no match': 'no match', +'or import from csv file': 'ou importer depuis un fichier CSV ', +'or provide app url:': 'or provide app url:', +'or provide application url:': "ou fournir l'URL de l'application:", +'Overwrite installed app': 'overwrite installed app', +'Pack all': 'tout empaqueter', +'Pack compiled': 'paquet compilé', +'pack plugin': 'paquet plugin', +'password changed': 'password changed', +'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" supprimé', +'plugins': 'plugins', +'previous 100 rows': '100 lignes précédentes', +'record': 'entrée', +'record does not exist': "l'entrée n'existe pas", +'record id': 'id entrée', +'Remove compiled': 'retirer compilé', +'restore': 'restaurer', +'revert': 'revenir', +'save': 'sauver', +'selected': 'sélectionnés', +'session expired': 'la session a expiré ', +'shell': 'shell', +'Site': 'site', +'some files could not be removed': 'certains fichiers ne peuvent pas être supprimés', +'Start wizard': 'start wizard', +'state': 'état', +'static': 'statiques', +'submit': 'envoyer', +'table': 'table', +'test': 'tester', +'the application logic, each URL path is mapped in one exposed function in the controller': "la logique de l'application, chaque route URL est mappé dans une fonction exposée dans le contrôleur", +'the data representation, define database tables and sets': 'la représentation des données, défini les tables de bases de données et sets', +'the presentations layer, views are also known as templates': 'la couche des présentations, les vues sont également connus en tant que modèles', +'these files are served without processing, your images go here': 'ces fichiers sont servis sans transformation, vos images vont ici', +'to previous version.': 'à la version précédente.', +'translation strings for the application': "chaînes de traduction de l'application", +'try': 'essayer', +'try something like': 'essayez quelque chose comme', +'unable to create application "%s"': 'impossible de créer l\'application "%s"', +'unable to delete file "%(filename)s"': 'impossible de supprimer le fichier "%(filename)s"', +'unable to delete file plugin "%(plugin)s"': 'impossible de supprimer le plugin "%(plugin)s"', +'unable to parse csv file': "impossible d'analyser les fichiers CSV", +'unable to uninstall "%s"': 'impossible de désinstaller "%s"', +'unable to upgrade because "%s"': 'unable to upgrade because "%s"', +'uncheck all': 'tout décocher', +'Uninstall': 'désinstaller', +'update': 'mettre à jour', +'update all languages': 'mettre à jour toutes les langues', +'upgrade now': 'upgrade now', +'upgrade web2py now': 'upgrade web2py now', +'upload': 'upload', +'upload application:': "charger l'application:", +'upload file:': 'charger le fichier:', +'upload plugin file:': 'charger fichier plugin:', +'user': 'user', +'variables': 'variables', +'versioning': 'versioning', +'view': 'vue', +'views': 'vues', +'web2py Recent Tweets': 'web2py Tweets récentes', +'web2py is up to date': 'web2py est à jour', +'web2py upgraded; please restart it': 'web2py upgraded; please restart it', +} diff --git a/applications/admin/languages/he.py b/applications/admin/languages/he.py new file mode 100644 index 00000000..df89175d --- /dev/null +++ b/applications/admin/languages/he.py @@ -0,0 +1,270 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"עדכן" ×”×•× ×‘×™×˜×•×™ ×ופציונ×לי, כגון "field1=newvalue". ×ינך יוכל להשתמש בjoin, בעת שימוש ב"עדכן" ×ו "מחק".', +'%Y-%m-%d': '%Y-%m-%d', +'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', +'%s rows deleted': '%s רשומות נמחקו', +'%s rows updated': '%s רשומות עודכנו', +'(requires internet access)': '(requires internet access)', +'(something like "it-it")': '(למשל "it-it")', +'A new version of web2py is available: %s': '×’×™×¨×¡× ×—×“×©×” של web2py זמינה: %s', +'A new version of web2py is available: Version 1.85.3 (2010-09-18 07:07:46)\n': 'A new version of web2py is available: Version 1.85.3 (2010-09-18 07:07:46)\r\n', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'לתשומת ליבך: ניתן להתחבר רק בערוץ מ×ובטח (HTTPS) ×ו מlocalhost', +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'לתשומת ליבך: ×ין לערוך מספר בדיקות במקביל, שכן הן עשויות להפריע זו לזו', +'ATTENTION: you cannot edit the running application!': 'לתשומת ליבך: ×œ× × ×™×ª×Ÿ לערוך ×פליקציה בזמן הרצתה', +'About': '×ודות', +'About application': '×ודות ×פליקציה', +'Additional code for your application': 'Additional code for your application', +'Admin is disabled because insecure channel': 'ממשק ×”×דמין נוטרל בשל גישה ×œ× ×ž×ובטחת', +'Admin language': 'Admin language', +'Administrator Password:': 'סיסמת מנהל', +'Application name:': 'Application name:', +'Are you sure you want to delete file "%s"?': '×”×× ×תה בטוח שברצונך למחוק ×ת הקובץ "%s"?', +'Are you sure you want to delete plugin "%s"?': '×”×× ×תה בטוח שברצונך למחוק ×ת התוסף "%s"?', +'Are you sure you want to uninstall application "%s"?': '×”×× ×תה בטוח שברצונך להסיר ×ת ×”×פליקציה "%s"?', +'Are you sure you want to upgrade web2py now?': '×”×× ×תה בטוח ש×תה רוצה לשדרג ×ת web2py עכשיו?', +'Available databases and tables': 'מסדי × ×ª×•× ×™× ×•×˜×‘×œ×ות זמיני×', +'Cannot be empty': '×ינו יכול להיש×ר ריק', +'Cannot compile: there are errors in your app:': '×œ× × ×™×ª×Ÿ לקמפל: ישנן שגי×ות ב×פליקציה שלך:', +'Check to delete': 'סמן כדי למחוק', +'Checking for upgrades...': 'מחפש עדכוני×', +'Controllers': 'בקרי×', +'Create new simple application': 'צור ×פליקציה חדשה', +'Current request': 'בקשה נוכחית', +'Current response': 'מענה נוכחי', +'Current session': 'סשן ×–×”', +'Date and Time': 'ת×ריך ושעה', +'Delete': 'מחק', +'Delete:': 'מחק:', +'Deploy on Google App Engine': 'העלה ל Google App Engine', +'Detailed traceback description': 'Detailed traceback description', +'EDIT': 'ערוך!', +'Edit application': 'ערוך ×פליקציה', +'Edit current record': 'ערוך רשומה נוכחית', +'Editing Language file': 'עורך ×ת קובץ השפה', +'Editing file "%s"': 'עורך ×ת הקובץ "%s"', +'Enterprise Web Framework': 'סביבת הפיתוח לרשת', +'Error logs for "%(app)s"': 'דו"×— שגי×ות עבור ×פליקציה "%(app)s"', +'Error snapshot': 'Error snapshot', +'Error ticket': 'Error ticket', +'Exception instance attributes': 'נתוני החריגה', +'Frames': 'Frames', +'Functions with no doctests will result in [passed] tests.': 'פונקציות ×©×œ× ×”×•×’×“×¨ להן doctest ירשמו כבדיקות ש[עברו בהצלחה].', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': '×× ×‘×“×•"×— לעיל מופיע מספר דו"×— שגי××”, ×–×” מצביע על שגי××” בבקר, עוד לפני שניתן ×”×™×” להריץ ×ת ×”doctest. לרוב מדובר בשגי×ת ×”×–×—×”, ×ו שגי××” ש××™× ×” בקוד של הפונקציה.\r\nכותרת ירוקה מצביע על כך שכל הבדיקות (×× ×”×•×’×“×¨×•) עברו בהצלחה, במידה ותוצ×ות הבדיקה ×ינן מופיעות.', +'Import/Export': 'יב×\יצ×', +'Installed applications': '×פליקציות מותקנות', +'Internal State': 'מצב מובנה', +'Invalid Query': 'ש×ילתה ×œ× ×ª×§×™× ×”', +'Invalid action': 'הור××” ×œ× ×§×™×™×ž×ª', +'Language files (static strings) updated': 'קובץ השפה (מחרוזות סט×טיות) עודכן', +'Languages': 'שפות', +'Last saved on:': 'ל×חרונה נשמר בת×ריך:', +'License for': 'רשיון עבור', +'Login': 'התחבר', +'Login to the Administrative Interface': 'התחבר לממשק המנהל', +'Models': 'מבני נתוני×', +'Modules': 'מודולי×', +'NO': 'ל×', +'New Record': 'רשומה חדשה', +'New application wizard': 'New application wizard', +'New simple application': 'New simple application', +'No databases in this application': '×ין מסדי × ×ª×•× ×™× ×œ×פליקציה זו', +'Original/Translation': 'מקור\תרגו×', +'PAM authenticated user, cannot change password here': 'שינוי ×¡×™×¡×ž× ×‘×מצעות PAM ×ינו יכול להתבצע ×›×ן', +'Peeking at file': 'מעיין בקובץ', +'Plugin "%s" in application': 'פל×גין "%s" של ×פליקציה', +'Plugins': 'תוספי×', +'Powered by': 'מופעל ×¢"×™', +'Query:': 'ש×ילתה:', +'Resolve Conflict file': 'הסר קובץ היוצר קונפליקט', +'Rows in table': 'רשומות בטבלה', +'Rows selected': 'רשומות נבחרו', +'Saved file hash:': 'גיבוב הקובץ השמור:', +'Static files': '×§×‘×¦×™× ×¡×˜×טיי×', +'Sure you want to delete this object?': '×”×× ×תה בטוח שברצונך למחוק ×ובייקט ×–×”?', +'TM': 'סימן רשו×', +'Testing application': 'בודק ×ת ×”×פליקציה', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"ש×ליתה" ×”×™× ×ª× ××™ כגון "db1.table1.filed1=\'value\'" ביטוי כמו db.table1.field1=db.table2.field1 יחולל join', +'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller', +'The data representation, define database tables and sets': 'The data representation, define database tables and sets', +'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates', +'There are no controllers': '×ין בקרי×', +'There are no models': '×ין מבני נתוני×', +'There are no modules': '×ין מודולי×', +'There are no plugins': 'There are no plugins', +'There are no static files': '×ין ×§×‘×¦×™× ×¡×˜×טיי×', +'There are no translators, only default language is supported': '×ין תרגומי×. רק שפת ברירת המחדל נתמכת', +'There are no views': '×ין קבצי תצוגה', +'These files are served without processing, your images go here': 'These files are served without processing, your images go here', +'This is the %(filename)s template': 'זוהי תבנית הקובץ %(filename)s ', +'Ticket': 'דו"×— שגי××”', +'Ticket ID': 'Ticket ID', +'To create a plugin, name a file/folder plugin_[name]': 'כדי ליצור תוסף, ×§×¨× ×œ×§×•×‘×¥ ×ו סיפריה ×‘×©× ×œ×¤×™ התבנית plugin_[name]', +'Traceback': 'Traceback', +'Translation strings for the application': 'Translation strings for the application', +'Unable to check for upgrades': '×œ× × ×™×ª×Ÿ ×”×™×” לבדוק ×× ×™×© שדרוגי×', +'Unable to download app because:': '×œ× × ×™×ª×Ÿ ×”×™×” להוריד ×ת ×”×פליקציה ×›×™:', +'Unable to download because': '×œ× ×”×¦×œ×—×ª×™ להוריד ×›×™', +'Update:': 'עדכן:', +'Upload & install packed application': 'העלה והתקן ×פליקציה ×רוזה', +'Upload a package:': 'Upload a package:', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'השתמש ב (...)&(...) עבור תנ××™ AND, (...)|(...) עבור תנ××™ OR ו~(...) עבור תנ××™ NOT ליצירת ש×ילתות מורכבות', +'Use an url:': 'Use an url:', +'Version': 'גירס×', +'Views': 'מר××”', +'YES': 'כן', +'About': '×ודות', +'additional code for your application': 'קוד נוסף עבור ×”×פליקציה שלך', +'admin disabled because no admin password': 'ממשק המנהל מנוטרל ×›×™ ×œ× ×”×•×’×“×¨×” סיסמת מנהל', +'admin disabled because not supported on google app engine': 'ממשק המנהל נוטרל, ×›×™ ×ין תמיכה בGoogle app engine', +'admin disabled because unable to access password file': 'ממשק מנהל נוטרל, ×›×™ ×œ× × ×™×ª×Ÿ לגשת לקובץ הסיסמ×ות', +'administrative interface': 'administrative interface', +'and rename it (required):': 'ושנה ×ת שמו (חובה):', +'and rename it:': 'ושנה ×ת שמו:', +'appadmin': 'מנהל מסד הנתוני×', +'appadmin is disabled because insecure channel': 'מנהל מסד ×”× ×ª×•× ×™× × ×•×˜×¨×œ בשל ערוץ ×œ× ×ž×ובטח', +'application "%s" uninstalled': '×פליקציה "%s" הוסרה', +'application compiled': '×פליקציה קומפלה', +'application is compiled and cannot be designed': '×œ× × ×™×ª×Ÿ לערוך ×פליקציה מקומפלת', +'arguments': 'פרמטרי×', +'back': '×חורה', +'cache': 'מטמון', +'cache, errors and sessions cleaned': 'מטמון, שגי×ות וסשן נוקו', +'cannot create file': '×œ× ×ž×¦×œ×™×— ליצור קובץ', +'cannot upload file "%(filename)s"': '×œ× ×”×¦×œ×—×ª×™ להעלות ×ת הקובץ "%(filename)s"', +'Change admin password': 'סיסמת מנהל שונתה', +'check all': 'סמן הכל', +'Check for upgrades': 'check for upgrades', +'Clean': '× ×§×”', +'click to check for upgrades': 'לחץ כדי לחפש עדכוני×', +'code': 'קוד', +'collapse/expand all': 'collapse/expand all', +'Compile': 'קמפל', +'compiled application removed': '×פליקציה מקומפלת הוסרה', +'controllers': 'בקרי×', +'Create': 'צור', +'create file with filename:': 'צור קובץ בש×:', +'create new application:': 'צור ×פליקציה חדשה:', +'created by': 'נוצר ×¢"×™', +'crontab': 'משימות מתוזמנות', +'currently running': 'currently running', +'currently saved or': 'נשמר כעת ×ו', +'data uploaded': 'המידע הועלה', +'database': 'מסד נתוני×', +'database %s select': 'מסד ×”× ×ª×•× ×™× %s נבחר', +'database administration': 'ניהול מסד נתוני×', +'db': 'מסד נתוני×', +'defines tables': 'הגדר טבל×ות', +'delete': 'מחק', +'delete all checked': 'סמן הכל למחיקה', +'delete plugin': 'מחק תוסף', +'Deploy': 'deploy', +'design': 'עיצוב', +'direction: ltr': 'direction: rtl', +'done!': 'הסתיי×!', +'download layouts': 'download layouts', +'download plugins': 'download plugins', +'Edit': 'ערוך', +'edit controller': 'ערוך בקר', +'edit views:': 'ערוך קיבצי תצוגה:', +'Errors': 'שגי×ות', +'export as csv file': '×™×¦× ×œ×§×•×‘×¥ csv', +'exposes': 'חושף ×ת', +'extends': 'הרחבה של', +'failed to reload module because:': 'נכשל בטעינה חוזרת של מודול בגלל:', +'file "%(filename)s" created': 'הקובץ "%(filename)s" נוצר', +'file "%(filename)s" deleted': 'הקובץ "%(filename)s" נמחק', +'file "%(filename)s" uploaded': 'הקובץ "%(filename)s" הועלה', +'file "%s" of %s restored': 'הקובץ "%s" of %s שוחזר', +'file changed on disk': 'קובץ שונה על גבי הדיסק', +'file does not exist': 'קובץ ×œ× × ×ž×¦×', +'file saved on %(time)s': 'הקובץ נשמר בשעה %(time)s', +'file saved on %s': 'הקובץ נשמר ב%s', +'filter': 'filter', +'Help': 'עזרה', +'htmledit': 'עורך ויזו×לי', +'includes': 'מכיל', +'insert new': 'הכנס נוסף', +'insert new %s': 'הכנס %s נוסף', +'inspect attributes': 'inspect attributes', +'Install': 'התקן', +'internal error': 'שגי××” מובנית', +'invalid password': '×¡×™×¡×ž× ×©×’×•×™×”', +'invalid request': 'בקשה ×œ× ×ª×§×™× ×”', +'invalid ticket': 'דו"×— שגי××” ×œ× ×§×™×™×', +'language file "%(filename)s" created/updated': 'קובץ השפה "%(filename)s" נוצר\עודכן', +'languages': 'שפות', +'loading...': 'טוען...', +'locals': 'locals', +'login': 'התחבר', +'Logout': 'התנתק', +'merge': 'מזג', +'models': 'מבני נתוני×', +'modules': 'מודולי×', +'new application "%s" created': '×”×פליקציה "%s" נוצרה', +'new plugin installed': 'פל×גין חדש הותקן', +'new record inserted': 'הרשומה נוספה', +'next 100 rows': '100 הרשומות הב×ות', +'no match': '×œ× × ×ž×¦××” הת×מה', +'or import from csv file': '×ו ×™×‘× ×ž×§×•×‘×¥ csv', +'or provide app url:': '×ו ספק כתובת url של ×פליקציה', +'Overwrite installed app': 'התקן על גבי ×פלקציה מותקנת', +'Pack all': '×רוז הכל', +'Pack compiled': '×רוז מקומפל', +'pack plugin': '×רוז תוסף', +'password changed': '×¡×™×¡×ž× ×©×•× ×ª×”', +'plugin "%(plugin)s" deleted': 'תוסף "%(plugin)s" נמחק', +'plugins': 'plugins', +'previous 100 rows': '100 הרשומות הקודמות', +'record': 'רשומה', +'record does not exist': 'הרשומה ××™× ×” קיימת', +'record id': 'מזהה רשומה', +'Remove compiled': 'הסר מקומפל', +'request': 'request', +'response': 'response', +'restore': 'שחזר', +'revert': 'חזור ×œ×’×™×¨×¡× ×§×•×“×ž×ª', +'selected': 'נבחרו', +'session': 'session', +'session expired': '×ª× ×”×¡×©×Ÿ', +'shell': 'שורת פקודה', +'Site': '×תר', +'some files could not be removed': '×œ× × ×™×ª×Ÿ ×”×™×” להסיר חלק מהקבצי×', +'Start wizard': 'start wizard', +'state': 'מצב', +'static': '×§×‘×¦×™× ×¡×˜×טיי×', +'submit': 'שלח', +'table': 'טבלה', +'test': 'בדיקות', +'the application logic, each URL path is mapped in one exposed function in the controller': 'הלוגיקה של ×”×פליקציה, כל url ממופה לפונקציה חשופה בבקר', +'the data representation, define database tables and sets': 'ייצוג המידע, בו ×ž×•×’×“×¨×™× ×˜×‘×œ×ות ומבני×', +'the presentations layer, views are also known as templates': 'שכבת התצוגה, המכונה ×’× template', +'these files are served without processing, your images go here': '×לו ×”× ×§×‘×¦×™× ×”× ×©×œ×—×™× ×ž×”×©×¨×ª ×œ×œ× ×¢×™×‘×•×“. הכנס ×ת התמונות ×›×ן', +'to previous version.': '×ין ×’×™×¨×¡× ×§×•×“×ž×ª', +'translation strings for the application': 'מחרוזות ×ª×¨×’×•× ×¢×‘×•×¨ ×”×פליקציה', +'try': 'נסה', +'try something like': 'נסה משהו כמו', +'unable to create application "%s"': 'נכשל ביצירת ×”×פליקציה "%s"', +'unable to delete file "%(filename)s"': 'נכשל במחיקת הקובץ "%(filename)s"', +'unable to delete file plugin "%(plugin)s"': 'נכשל במחיקת התוסף "%(plugin)s"', +'unable to parse csv file': '×œ× ×”×¦×œ×—×ª×™ לנתח ×ת הקלט של קובץ csv', +'unable to uninstall "%s"': '×œ× × ×™×ª×Ÿ להסיר ×ת "%s"', +'unable to upgrade because "%s"': '×œ× × ×™×ª×Ÿ ×”×™×” לשדרג ×›×™ "%s"', +'uncheck all': 'הסר סימון מהכל', +'Uninstall': 'הסר התקנה', +'update': 'עדכן', +'update all languages': 'עדכן ×ת כלל קיבצי השפה', +'upgrade now': 'upgrade now', +'upgrade web2py now': 'שדרג ×ת web2py עכשיו', +'upload': 'upload', +'upload application:': 'העלה ×פליקציה:', +'upload file:': 'העלה קובץ:', +'upload plugin file:': 'העלה קובץ תוסף:', +'variables': 'משתני×', +'versioning': 'מנגנון גירס×ות', +'view': 'הצג', +'views': 'מר××”', +'web2py Recent Tweets': '×¦×™×•×¦×™× ××—×¨×•× ×™× ×©×œ web2py', +'web2py is up to date': 'web2py מותקנת בגירסתה ×”×חרונה', +'web2py upgraded; please restart it': 'web2py שודרגה; × × ×תחל ×ותה', +} diff --git a/applications/admin/languages/it-it.py b/applications/admin/languages/it-it.py new file mode 100644 index 00000000..1efb2917 --- /dev/null +++ b/applications/admin/languages/it-it.py @@ -0,0 +1,264 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ', +'%Y-%m-%d': '%d/%m/%Y', +'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S', +'%s rows deleted': '%s righe ("record") cancellate', +'%s rows updated': '%s righe ("record") modificate', +'(requires internet access)': '(requires internet access)', +'(something like "it-it")': '(qualcosa simile a "it-it")', +'A new version of web2py is available: %s': 'È disponibile una nuova versione di web2py: %s', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': "ATTENZIONE: L'accesso richiede una connessione sicura (HTTPS) o l'esecuzione di web2py in locale (connessione su localhost)", +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATTENTZIONE: NON ESEGUIRE PIÙ TEST IN PARALLELO (I TEST NON SONO "THREAD SAFE")', +'ATTENTION: you cannot edit the running application!': "ATTENZIONE: non puoi modificare l'applicazione correntemente in uso ", +'About': 'Informazioni', +'About application': "Informazioni sull'applicazione", +'Admin is disabled because insecure channel': 'amministrazione disabilitata: comunicazione non sicura', +'Administrator Password:': 'Password Amministratore:', +'Application name:': 'Application name:', +'Are you sure you want to delete file "%s"?': 'Confermi di voler cancellare il file "%s"?', +'Are you sure you want to delete plugin "%s"?': 'Confermi di voler cancellare il plugin "%s"?', +'Are you sure you want to uninstall application "%s"?': 'Confermi di voler disinstallare l\'applicazione "%s"?', +'Are you sure you want to upgrade web2py now?': 'Confermi di voler aggiornare web2py ora?', +'Available databases and tables': 'Database e tabelle disponibili', +'Cannot be empty': 'Non può essere vuoto', +'Cannot compile: there are errors in your app:': "Compilazione fallita: ci sono errori nell'applicazione.", +'Check to delete': 'Seleziona per cancellare', +'Checking for upgrades...': 'Controllo aggiornamenti in corso...', +'Controller': 'Controller', +'Controllers': 'Controllers', +'Copyright': 'Copyright', +'Create new simple application': 'Crea nuova applicazione', +'Current request': 'Richiesta (request) corrente', +'Current response': 'Risposta (response) corrente', +'Current session': 'Sessione (session) corrente', +'DB Model': 'Modello di DB', +'Database': 'Database', +'Date and Time': 'Data and Ora', +'Delete': 'Cancella', +'Delete:': 'Cancella:', +'Deploy on Google App Engine': 'Installa su Google App Engine', +'EDIT': 'MODIFICA', +'Edit': 'Modifica', +'Edit This App': 'Modifica questa applicazione', +'Edit application': 'Modifica applicazione', +'Edit current record': 'Modifica record corrente', +'Editing Language file': 'Modifica file linguaggio', +'Editing file "%s"': 'Modifica del file "%s"', +'Enterprise Web Framework': 'Enterprise Web Framework', +'Error logs for "%(app)s"': 'Log degli errori per "%(app)s"', +'Exception instance attributes': 'Exception instance attributes', +'Functions with no doctests will result in [passed] tests.': 'I test delle funzioni senza "doctests" risulteranno sempre [passed].', +'Hello World': 'Salve Mondo', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.', +'Import/Export': 'Importa/Esporta', +'Index': 'Indice', +'Installed applications': 'Applicazioni installate', +'Internal State': 'Stato interno', +'Invalid Query': 'Richiesta (query) non valida', +'Invalid action': 'Azione non valida', +'Language files (static strings) updated': 'Linguaggi (documenti con stringhe statiche) aggiornati', +'Languages': 'Linguaggi', +'Last saved on:': 'Ultimo salvataggio:', +'Layout': 'Layout', +'License for': 'Licenza relativa a', +'Login': 'Accesso', +'Login to the Administrative Interface': "Accesso all'interfaccia amministrativa", +'Main Menu': 'Menu principale', +'Menu Model': 'Menu Modelli', +'Models': 'Modelli', +'Modules': 'Moduli', +'NO': 'NO', +'New Record': 'Nuovo elemento (record)', +'New application wizard': 'New application wizard', +'New simple application': 'New simple application', +'No databases in this application': 'Nessun database presente in questa applicazione', +'Original/Translation': 'Originale/Traduzione', +'PAM authenticated user, cannot change password here': 'utente autenticato tramite PAM, impossibile modificare password qui', +'Peeking at file': 'Uno sguardo al file', +'Plugin "%s" in application': 'Plugin "%s" nell\'applicazione', +'Plugins': 'I Plugins', +'Powered by': 'Powered by', +'Query:': 'Richiesta (query):', +'Resolve Conflict file': 'File di risoluzione conflitto', +'Rows in table': 'Righe nella tabella', +'Rows selected': 'Righe selezionate', +'Saved file hash:': 'Hash del file salvato:', +'Static files': 'Files statici', +'Stylesheet': 'Foglio di stile (stylesheet)', +'Sure you want to delete this object?': 'Vuoi veramente cancellare questo oggetto?', +'TM': 'TM', +'Testing application': 'Test applicazione in corsg', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La richiesta (query) è una condizione come ad esempio "db.tabella1.campo1==\'valore\'". Una condizione come "db.tabella1.campo1==db.tabella2.campo2" produce un "JOIN" SQL.', +'There are no controllers': 'Non ci sono controller', +'There are no models': 'Non ci sono modelli', +'There are no modules': 'Non ci sono moduli', +'There are no static files': 'Non ci sono file statici', +'There are no translators, only default language is supported': 'Non ci sono traduzioni, viene solo supportato il linguaggio di base', +'There are no views': 'Non ci sono viste ("view")', +'This is the %(filename)s template': 'Questo è il template %(filename)s', +'Ticket': 'Ticket', +'To create a plugin, name a file/folder plugin_[name]': 'Per creare un plugin, chiamare un file o cartella plugin_[nome]', +'Unable to check for upgrades': 'Impossibile controllare presenza di aggiornamenti', +'Unable to download app because:': 'Impossibile scaricare applicazione perché', +'Unable to download because': 'Impossibile scaricare perché', +'Update:': 'Aggiorna:', +'Upload & install packed application': 'Carica ed installa pacchetto con applicazione', +'Upload a package:': 'Upload a package:', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Per costruire richieste (query) più complesse si usano (...)&(...) come "e" (AND), (...)|(...) come "o" (OR), e ~(...) come negazione (NOT).', +'Use an url:': 'Use an url:', +'Version': 'Versione', +'View': 'Vista', +'Views': 'viste', +'Welcome %s': 'Benvenuto %s', +'Welcome to web2py': 'Benvenuto su web2py', +'YES': 'SI', +'About': 'informazioni', +'additional code for your application': 'righe di codice aggiuntive per la tua applicazione', +'admin disabled because no admin password': 'amministrazione disabilitata per mancanza di password amministrativa', +'admin disabled because not supported on google app engine': 'amministrazione non supportata da Google Apps Engine', +'admin disabled because unable to access password file': 'amministrazione disabilitata per impossibilità di leggere il file delle password', +'administrative interface': 'administrative interface', +'and rename it (required):': 'e rinominala (obbligatorio):', +'and rename it:': 'e rinominala:', +'appadmin': 'appadmin ', +'appadmin is disabled because insecure channel': 'amministrazione app (appadmin) disabilitata: comunicazione non sicura', +'application "%s" uninstalled': 'applicazione "%s" disinstallata', +'application compiled': 'applicazione compilata', +'application is compiled and cannot be designed': "l'applicazione è compilata e non si può modificare", +'arguments': 'arguments', +'back': 'indietro', +'cache': 'cache', +'cache, errors and sessions cleaned': 'pulitura cache, errori and sessioni ', +'cannot create file': 'impossibile creare il file', +'cannot upload file "%(filename)s"': 'impossibile caricare il file "%(filename)s"', +'Change admin password': 'change admin password', +'change password': 'cambia password', +'check all': 'controlla tutto', +'Check for upgrades': 'check for upgrades', +'Clean': 'pulisci', +'click here for online examples': 'clicca per vedere gli esempi', +'click here for the administrative interface': "clicca per l'interfaccia amministrativa", +'click to check for upgrades': 'clicca per controllare presenza di aggiornamenti', +'code': 'code', +'Compile': 'compila', +'compiled application removed': "rimosso il codice compilato dell'applicazione", +'controllers': 'controllers', +'Create': 'crea', +'create file with filename:': 'crea un file col nome:', +'create new application:': 'create new application:', +'created by': 'creato da', +'crontab': 'crontab', +'currently running': 'currently running', +'currently saved or': 'attualmente salvato o', +'customize me!': 'Personalizzami!', +'data uploaded': 'dati caricati', +'database': 'database', +'database %s select': 'database %s select', +'database administration': 'amministrazione database', +'db': 'db', +'defines tables': 'defininisce le tabelle', +'delete': 'Cancella', +'delete all checked': 'cancella tutti i selezionati', +'delete plugin': 'cancella plugin', +'Deploy': 'deploy', +'design': 'progetta', +'direction: ltr': 'direction: ltr', +'done!': 'fatto!', +'Edit': 'modifica', +'edit controller': 'modifica controller', +'edit profile': 'modifica profilo', +'edit views:': 'modifica viste (view):', +'Errors': 'errori', +'export as csv file': 'esporta come file CSV', +'exposes': 'espone', +'extends': 'estende', +'failed to reload module because:': 'ricaricamento modulo fallito perché:', +'file "%(filename)s" created': 'creato il file "%(filename)s"', +'file "%(filename)s" deleted': 'cancellato il file "%(filename)s"', +'file "%(filename)s" uploaded': 'caricato il file "%(filename)s"', +'file "%s" of %s restored': 'ripristinato "%(filename)s"', +'file changed on disk': 'il file ha subito una modifica su disco', +'file does not exist': 'file inesistente', +'file saved on %(time)s': "file salvato nell'istante %(time)s", +'file saved on %s': 'file salvato: %s', +'Help': 'aiuto', +'htmledit': 'modifica come html', +'includes': 'include', +'insert new': 'inserisci nuovo', +'insert new %s': 'inserisci nuovo %s', +'Install': 'installa', +'internal error': 'errore interno', +'invalid password': 'password non valida', +'invalid request': 'richiesta non valida', +'invalid ticket': 'ticket non valido', +'language file "%(filename)s" created/updated': 'file linguaggio "%(filename)s" creato/aggiornato', +'languages': 'linguaggi', +'loading...': 'caricamento...', +'login': 'accesso', +'Logout': 'uscita', +'merge': 'unisci', +'models': 'modelli', +'modules': 'moduli', +'new application "%s" created': 'creata la nuova applicazione "%s"', +'new plugin installed': 'installato nuovo plugin', +'new record inserted': 'nuovo record inserito', +'next 100 rows': 'prossime 100 righe', +'no match': 'nessuna corrispondenza', +'or import from csv file': 'oppure importa da file CSV', +'or provide app url:': "oppure fornisci url dell'applicazione:", +'Overwrite installed app': 'sovrascrivi applicazione installata', +'Pack all': 'crea pacchetto', +'Pack compiled': 'crea pacchetto del codice compilato', +'pack plugin': 'crea pacchetto del plugin', +'password changed': 'password modificata', +'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" cancellato', +'previous 100 rows': '100 righe precedenti', +'record': 'record', +'record does not exist': 'il record non esiste', +'record id': 'ID del record', +'register': 'registrazione', +'Remove compiled': 'rimozione codice compilato', +'restore': 'ripristino', +'revert': 'versione precedente', +'selected': 'selezionato', +'session expired': 'sessions scaduta', +'shell': 'shell', +'Site': 'sito', +'some files could not be removed': 'non è stato possibile rimuovere alcuni files', +'Start wizard': 'start wizard', +'state': 'stato', +'static': 'statico', +'submit': 'invia', +'table': 'tabella', +'test': 'test', +'the application logic, each URL path is mapped in one exposed function in the controller': 'logica dell\'applicazione, ogni percorso "URL" corrisponde ad una funzione esposta da un controller', +'the data representation, define database tables and sets': 'rappresentazione dei dati, definizione di tabelle di database e di "set" ', +'the presentations layer, views are also known as templates': 'Presentazione dell\'applicazione, viste (views, chiamate anche "templates")', +'these files are served without processing, your images go here': 'questi files vengono serviti così come sono, le immagini vanno qui', +'to previous version.': 'torna a versione precedente', +'translation strings for the application': "stringhe di traduzioni per l'applicazione", +'try': 'prova', +'try something like': 'prova qualcosa come', +'unable to create application "%s"': 'impossibile creare applicazione "%s"', +'unable to delete file "%(filename)s"': 'impossibile rimuovere file "%(plugin)s"', +'unable to delete file plugin "%(plugin)s"': 'impossibile rimuovere file di plugin "%(plugin)s"', +'unable to parse csv file': 'non riesco a decodificare questo file CSV', +'unable to uninstall "%s"': 'impossibile disinstallare "%s"', +'unable to upgrade because "%s"': 'impossibile aggiornare perché "%s"', +'uncheck all': 'smarca tutti', +'Uninstall': 'disinstalla', +'update': 'aggiorna', +'update all languages': 'aggiorna tutti i linguaggi', +'upgrade web2py now': 'upgrade web2py now', +'upload application:': 'carica applicazione:', +'upload file:': 'carica file:', +'upload plugin file:': 'carica file di plugin:', +'variables': 'variables', +'versioning': 'sistema di versioni', +'view': 'vista', +'views': 'viste', +'web2py Recent Tweets': 'Tweets recenti per web2py', +'web2py is up to date': 'web2py è aggiornato', +'web2py upgraded; please restart it': 'web2py aggiornato; prego riavviarlo', +} diff --git a/applications/admin/languages/it.py b/applications/admin/languages/it.py new file mode 100644 index 00000000..c362937c --- /dev/null +++ b/applications/admin/languages/it.py @@ -0,0 +1,266 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ', +'%Y-%m-%d': '%d/%m/%Y', +'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S', +'%s rows deleted': '%s righe ("record") cancellate', +'%s rows updated': '%s righe ("record") modificate', +'(requires internet access)': '(requires internet access)', +'(something like "it-it")': '(qualcosa simile a "it-it")', +'A new version of web2py is available: %s': 'È disponibile una nuova versione di web2py: %s', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': "ATTENZIONE: L'accesso richiede una connessione sicura (HTTPS) o l'esecuzione di web2py in locale (connessione su localhost)", +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATTENTZIONE: NON ESEGUIRE PIÙ TEST IN PARALLELO (I TEST NON SONO "THREAD SAFE")', +'ATTENTION: you cannot edit the running application!': "ATTENZIONE: non puoi modificare l'applicazione correntemente in uso ", +'About': 'Informazioni', +'About application': "Informazioni sull'applicazione", +'Admin is disabled because insecure channel': 'amministrazione disabilitata: comunicazione non sicura', +'Admin language': 'Admin language', +'Administrator Password:': 'Password Amministratore:', +'Application name:': 'Application name:', +'Are you sure you want to delete file "%s"?': 'Confermi di voler cancellare il file "%s"?', +'Are you sure you want to delete plugin "%s"?': 'Confermi di voler cancellare il plugin "%s"?', +'Are you sure you want to uninstall application "%s"?': 'Confermi di voler disinstallare l\'applicazione "%s"?', +'Are you sure you want to upgrade web2py now?': 'Confermi di voler aggiornare web2py ora?', +'Available databases and tables': 'Database e tabelle disponibili', +'Cannot be empty': 'Non può essere vuoto', +'Cannot compile: there are errors in your app:': "Compilazione fallita: ci sono errori nell'applicazione.", +'Check to delete': 'Seleziona per cancellare', +'Checking for upgrades...': 'Controllo aggiornamenti in corso...', +'Controller': 'Controller', +'Controllers': 'Controllers', +'Copyright': 'Copyright', +'Create new simple application': 'Crea nuova applicazione', +'Current request': 'Richiesta (request) corrente', +'Current response': 'Risposta (response) corrente', +'Current session': 'Sessione (session) corrente', +'DB Model': 'Modello di DB', +'Database': 'Database', +'Date and Time': 'Data and Ora', +'Delete': 'Cancella', +'Delete:': 'Cancella:', +'Deploy on Google App Engine': 'Installa su Google App Engine', +'EDIT': 'MODIFICA', +'Edit': 'Modifica', +'Edit This App': 'Modifica questa applicazione', +'Edit application': 'Modifica applicazione', +'Edit current record': 'Modifica record corrente', +'Editing Language file': 'Modifica file linguaggio', +'Editing file "%s"': 'Modifica del file "%s"', +'Enterprise Web Framework': 'Enterprise Web Framework', +'Error logs for "%(app)s"': 'Log degli errori per "%(app)s"', +'Exception instance attributes': 'Exception instance attributes', +'Functions with no doctests will result in [passed] tests.': 'I test delle funzioni senza "doctests" risulteranno sempre [passed].', +'Hello World': 'Salve Mondo', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.', +'Import/Export': 'Importa/Esporta', +'Index': 'Indice', +'Installed applications': 'Applicazioni installate', +'Internal State': 'Stato interno', +'Invalid Query': 'Richiesta (query) non valida', +'Invalid action': 'Azione non valida', +'Language files (static strings) updated': 'Linguaggi (documenti con stringhe statiche) aggiornati', +'Languages': 'Linguaggi', +'Last saved on:': 'Ultimo salvataggio:', +'Layout': 'Layout', +'License for': 'Licenza relativa a', +'Login': 'Accesso', +'Login to the Administrative Interface': "Accesso all'interfaccia amministrativa", +'Main Menu': 'Menu principale', +'Menu Model': 'Menu Modelli', +'Models': 'Modelli', +'Modules': 'Moduli', +'NO': 'NO', +'New Record': 'Nuovo elemento (record)', +'New application wizard': 'New application wizard', +'New simple application': 'New simple application', +'No databases in this application': 'Nessun database presente in questa applicazione', +'Original/Translation': 'Originale/Traduzione', +'PAM authenticated user, cannot change password here': 'utente autenticato tramite PAM, impossibile modificare password qui', +'Peeking at file': 'Uno sguardo al file', +'Plugin "%s" in application': 'Plugin "%s" nell\'applicazione', +'Plugins': 'I Plugins', +'Powered by': 'Powered by', +'Query:': 'Richiesta (query):', +'Resolve Conflict file': 'File di risoluzione conflitto', +'Rows in table': 'Righe nella tabella', +'Rows selected': 'Righe selezionate', +'Saved file hash:': 'Hash del file salvato:', +'Static files': 'Files statici', +'Stylesheet': 'Foglio di stile (stylesheet)', +'Sure you want to delete this object?': 'Vuoi veramente cancellare questo oggetto?', +'TM': 'TM', +'Testing application': 'Test applicazione in corsg', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La richiesta (query) è una condizione come ad esempio "db.tabella1.campo1==\'valore\'". Una condizione come "db.tabella1.campo1==db.tabella2.campo2" produce un "JOIN" SQL.', +'There are no controllers': 'Non ci sono controller', +'There are no models': 'Non ci sono modelli', +'There are no modules': 'Non ci sono moduli', +'There are no static files': 'Non ci sono file statici', +'There are no translators, only default language is supported': 'Non ci sono traduzioni, viene solo supportato il linguaggio di base', +'There are no views': 'Non ci sono viste ("view")', +'This is the %(filename)s template': 'Questo è il template %(filename)s', +'Ticket': 'Ticket', +'To create a plugin, name a file/folder plugin_[name]': 'Per creare un plugin, chiamare un file o cartella plugin_[nome]', +'Unable to check for upgrades': 'Impossibile controllare presenza di aggiornamenti', +'Unable to download app because:': 'Impossibile scaricare applicazione perché', +'Unable to download because': 'Impossibile scaricare perché', +'Unable to download because:': 'Unable to download because:', +'Update:': 'Aggiorna:', +'Upload & install packed application': 'Carica ed installa pacchetto con applicazione', +'Upload a package:': 'Upload a package:', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Per costruire richieste (query) più complesse si usano (...)&(...) come "e" (AND), (...)|(...) come "o" (OR), e ~(...) come negazione (NOT).', +'Use an url:': 'Use an url:', +'Version': 'Versione', +'View': 'Vista', +'Views': 'viste', +'Welcome %s': 'Benvenuto %s', +'Welcome to web2py': 'Benvenuto su web2py', +'YES': 'SI', +'About': 'informazioni', +'additional code for your application': 'righe di codice aggiuntive per la tua applicazione', +'admin disabled because no admin password': 'amministrazione disabilitata per mancanza di password amministrativa', +'admin disabled because not supported on google app engine': 'amministrazione non supportata da Google Apps Engine', +'admin disabled because unable to access password file': 'amministrazione disabilitata per impossibilità di leggere il file delle password', +'administrative interface': 'administrative interface', +'and rename it (required):': 'e rinominala (obbligatorio):', +'and rename it:': 'e rinominala:', +'appadmin': 'appadmin ', +'appadmin is disabled because insecure channel': 'amministrazione app (appadmin) disabilitata: comunicazione non sicura', +'application "%s" uninstalled': 'applicazione "%s" disinstallata', +'application compiled': 'applicazione compilata', +'application is compiled and cannot be designed': "l'applicazione è compilata e non si può modificare", +'arguments': 'arguments', +'back': 'indietro', +'cache': 'cache', +'cache, errors and sessions cleaned': 'pulitura cache, errori and sessioni ', +'cannot create file': 'impossibile creare il file', +'cannot upload file "%(filename)s"': 'impossibile caricare il file "%(filename)s"', +'Change admin password': 'change admin password', +'change password': 'cambia password', +'check all': 'controlla tutto', +'Check for upgrades': 'check for upgrades', +'Clean': 'pulisci', +'click here for online examples': 'clicca per vedere gli esempi', +'click here for the administrative interface': "clicca per l'interfaccia amministrativa", +'click to check for upgrades': 'clicca per controllare presenza di aggiornamenti', +'code': 'code', +'Compile': 'compila', +'compiled application removed': "rimosso il codice compilato dell'applicazione", +'controllers': 'controllers', +'Create': 'crea', +'create file with filename:': 'crea un file col nome:', +'create new application:': 'create new application:', +'created by': 'creato da', +'crontab': 'crontab', +'currently running': 'currently running', +'currently saved or': 'attualmente salvato o', +'customize me!': 'Personalizzami!', +'data uploaded': 'dati caricati', +'database': 'database', +'database %s select': 'database %s select', +'database administration': 'amministrazione database', +'db': 'db', +'defines tables': 'defininisce le tabelle', +'delete': 'Cancella', +'delete all checked': 'cancella tutti i selezionati', +'delete plugin': 'cancella plugin', +'Deploy': 'deploy', +'design': 'progetta', +'direction: ltr': 'direction: ltr', +'done!': 'fatto!', +'Edit': 'modifica', +'edit controller': 'modifica controller', +'edit profile': 'modifica profilo', +'edit views:': 'modifica viste (view):', +'Errors': 'errori', +'export as csv file': 'esporta come file CSV', +'exposes': 'espone', +'extends': 'estende', +'failed to reload module because:': 'ricaricamento modulo fallito perché:', +'file "%(filename)s" created': 'creato il file "%(filename)s"', +'file "%(filename)s" deleted': 'cancellato il file "%(filename)s"', +'file "%(filename)s" uploaded': 'caricato il file "%(filename)s"', +'file "%s" of %s restored': 'ripristinato "%(filename)s"', +'file changed on disk': 'il file ha subito una modifica su disco', +'file does not exist': 'file inesistente', +'file saved on %(time)s': "file salvato nell'istante %(time)s", +'file saved on %s': 'file salvato: %s', +'Help': 'aiuto', +'htmledit': 'modifica come html', +'includes': 'include', +'insert new': 'inserisci nuovo', +'insert new %s': 'inserisci nuovo %s', +'Install': 'installa', +'internal error': 'errore interno', +'invalid password': 'password non valida', +'invalid request': 'richiesta non valida', +'invalid ticket': 'ticket non valido', +'language file "%(filename)s" created/updated': 'file linguaggio "%(filename)s" creato/aggiornato', +'languages': 'linguaggi', +'loading...': 'caricamento...', +'login': 'accesso', +'Logout': 'uscita', +'merge': 'unisci', +'models': 'modelli', +'modules': 'moduli', +'new application "%s" created': 'creata la nuova applicazione "%s"', +'new plugin installed': 'installato nuovo plugin', +'new record inserted': 'nuovo record inserito', +'next 100 rows': 'prossime 100 righe', +'no match': 'nessuna corrispondenza', +'or import from csv file': 'oppure importa da file CSV', +'or provide app url:': "oppure fornisci url dell'applicazione:", +'Overwrite installed app': 'sovrascrivi applicazione installata', +'Pack all': 'crea pacchetto', +'Pack compiled': 'crea pacchetto del codice compilato', +'pack plugin': 'crea pacchetto del plugin', +'password changed': 'password modificata', +'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" cancellato', +'previous 100 rows': '100 righe precedenti', +'record': 'record', +'record does not exist': 'il record non esiste', +'record id': 'ID del record', +'register': 'registrazione', +'Remove compiled': 'rimozione codice compilato', +'restore': 'ripristino', +'revert': 'versione precedente', +'selected': 'selezionato', +'session expired': 'sessions scaduta', +'shell': 'shell', +'Site': 'sito', +'some files could not be removed': 'non è stato possibile rimuovere alcuni files', +'Start wizard': 'start wizard', +'state': 'stato', +'static': 'statico', +'submit': 'invia', +'table': 'tabella', +'test': 'test', +'the application logic, each URL path is mapped in one exposed function in the controller': 'logica dell\'applicazione, ogni percorso "URL" corrisponde ad una funzione esposta da un controller', +'the data representation, define database tables and sets': 'rappresentazione dei dati, definizione di tabelle di database e di "set" ', +'the presentations layer, views are also known as templates': 'Presentazione dell\'applicazione, viste (views, chiamate anche "templates")', +'these files are served without processing, your images go here': 'questi files vengono serviti così come sono, le immagini vanno qui', +'to previous version.': 'torna a versione precedente', +'translation strings for the application': "stringhe di traduzioni per l'applicazione", +'try': 'prova', +'try something like': 'prova qualcosa come', +'unable to create application "%s"': 'impossibile creare applicazione "%s"', +'unable to delete file "%(filename)s"': 'impossibile rimuovere file "%(plugin)s"', +'unable to delete file plugin "%(plugin)s"': 'impossibile rimuovere file di plugin "%(plugin)s"', +'unable to parse csv file': 'non riesco a decodificare questo file CSV', +'unable to uninstall "%s"': 'impossibile disinstallare "%s"', +'unable to upgrade because "%s"': 'impossibile aggiornare perché "%s"', +'uncheck all': 'smarca tutti', +'Uninstall': 'disinstalla', +'update': 'aggiorna', +'update all languages': 'aggiorna tutti i linguaggi', +'upgrade web2py now': 'upgrade web2py now', +'upload application:': 'carica applicazione:', +'upload file:': 'carica file:', +'upload plugin file:': 'carica file di plugin:', +'variables': 'variables', +'versioning': 'sistema di versioni', +'view': 'vista', +'views': 'viste', +'web2py Recent Tweets': 'Tweets recenti per web2py', +'web2py is up to date': 'web2py è aggiornato', +'web2py upgraded; please restart it': 'web2py aggiornato; prego riavviarlo', +} diff --git a/applications/admin/languages/pl-pl.py b/applications/admin/languages/pl-pl.py new file mode 100644 index 00000000..7ce3496f --- /dev/null +++ b/applications/admin/languages/pl-pl.py @@ -0,0 +1,262 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:', +'%Y-%m-%d': '%Y-%m-%d', +'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', +'%s rows deleted': 'Wierszy usuniÄ™tych: %s', +'%s rows updated': 'Wierszy uaktualnionych: %s', +'(requires internet access)': '(requires internet access)', +'(something like "it-it")': '(coÅ› podobnego do "it-it")', +'A new version of web2py is available': 'Nowa wersja web2py jest dostÄ™pna', +'A new version of web2py is available: %s': 'A new version of web2py is available: %s', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'UWAGA: Wymagane jest bezpieczne (HTTPS) połączenie lub połączenia z lokalnego adresu.', +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.', +'ATTENTION: you cannot edit the running application!': 'UWAGA: nie można edytować uruchomionych aplikacji!', +'About': 'Informacje o', +'About application': 'Informacje o aplikacji', +'Admin is disabled because insecure channel': 'Admin is disabled because insecure channel', +'Admin is disabled because unsecure channel': 'Panel administracyjny wyłączony z powodu braku bezpiecznego połączenia', +'Admin language': 'Admin language', +'Administrator Password:': 'HasÅ‚o administratora:', +'Application name:': 'Application name:', +'Are you sure you want to delete file "%s"?': 'Czy na pewno chcesz usunąć plik "%s"?', +'Are you sure you want to delete plugin "%s"?': 'Are you sure you want to delete plugin "%s"?', +'Are you sure you want to uninstall application "%s"': 'Czy na pewno chcesz usunąć aplikacjÄ™ "%s"', +'Are you sure you want to uninstall application "%s"?': 'Czy na pewno chcesz usunąć aplikacjÄ™ "%s"?', +'Are you sure you want to upgrade web2py now?': 'Are you sure you want to upgrade web2py now?', +'Available databases and tables': 'DostÄ™pne bazy danych i tabele', +'Cannot be empty': 'Nie może być puste', +'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'Nie można skompilować: w Twojej aplikacji sÄ… błędy . Znajdź je, popraw a nastÄ™pnie spróbój ponownie.', +'Cannot compile: there are errors in your app:': 'Cannot compile: there are errors in your app:', +'Check to delete': 'Zaznacz aby usunąć', +'Checking for upgrades...': 'Checking for upgrades...', +'Controllers': 'Kontrolery', +'Create new simple application': 'Utwórz nowÄ… aplikacjÄ™', +'Current request': 'Aktualne żądanie', +'Current response': 'Aktualna odpowiedź', +'Current session': 'Aktualna sesja', +'DESIGN': 'PROJEKTUJ', +'Date and Time': 'Data i godzina', +'Delete': 'UsuÅ„', +'Delete:': 'UsuÅ„:', +'Deploy on Google App Engine': 'Umieść na Google App Engine', +'Design for': 'Projekt dla', +'EDIT': 'EDYTUJ', +'Edit application': 'Edycja aplikacji', +'Edit current record': 'Edytuj aktualny rekord', +'Editing Language file': 'Editing Language file', +'Editing file': 'Edycja pliku', +'Editing file "%s"': 'Edycja pliku "%s"', +'Enterprise Web Framework': 'Enterprise Web Framework', +'Error logs for "%(app)s"': 'Wpisy błędów dla "%(app)s"', +'Exception instance attributes': 'Exception instance attributes', +'Functions with no doctests will result in [passed] tests.': 'Functions with no doctests will result in [passed] tests.', +'Hello World': 'Witaj Åšwiecie', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.', +'Import/Export': 'Importuj/eksportuj', +'Installed applications': 'Zainstalowane aplikacje', +'Internal State': 'Stan wewnÄ™trzny', +'Invalid Query': 'Błędne zapytanie', +'Invalid action': 'Błędna akcja', +'Language files (static strings) updated': 'Language files (static strings) updated', +'Languages': 'TÅ‚umaczenia', +'Last saved on:': 'Ostatnio zapisany:', +'License for': 'Licencja dla', +'Login': 'Zaloguj', +'Login to the Administrative Interface': 'Logowanie do panelu administracyjnego', +'Models': 'Modele', +'Modules': 'ModuÅ‚y', +'NO': 'NIE', +'New Record': 'Nowy rekord', +'New application wizard': 'New application wizard', +'New simple application': 'New simple application', +'No databases in this application': 'Brak baz danych w tej aplikacji', +'Original/Translation': 'OryginaÅ‚/tÅ‚umaczenie', +'PAM authenticated user, cannot change password here': 'PAM authenticated user, cannot change password here', +'Peeking at file': 'PodglÄ…d pliku', +'Plugin "%s" in application': 'Plugin "%s" in application', +'Plugins': 'Plugins', +'Powered by': 'Powered by', +'Query:': 'Zapytanie:', +'Resolve Conflict file': 'Resolve Conflict file', +'Rows in table': 'Wiersze w tabeli', +'Rows selected': 'Wierszy wybranych', +'Saved file hash:': 'Suma kontrolna zapisanego pliku:', +'Static files': 'Pliki statyczne', +'Sure you want to delete this object?': 'Czy na pewno chcesz usunąć ten obiekt?', +'TM': 'TM', +'Testing application': 'Testing application', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"Zapytanie" jest warunkiem postaci "db.tabela1.pole1==\'wartość\'". Takie coÅ› jak "db.tabela1.pole1==db.tabela2.pole2" oznacza SQL JOIN.', +'There are no controllers': 'Brak kontrolerów', +'There are no models': 'Brak modeli', +'There are no modules': 'Brak modułów', +'There are no static files': 'Brak plików statycznych', +'There are no translators, only default language is supported': 'Brak plików tÅ‚umaczeÅ„, wspierany jest tylko domyÅ›lny jÄ™zyk', +'There are no views': 'Brak widoków', +'This is the %(filename)s template': 'To jest szablon %(filename)s', +'Ticket': 'Bilet', +'To create a plugin, name a file/folder plugin_[name]': 'To create a plugin, name a file/folder plugin_[name]', +'Unable to check for upgrades': 'Nie można sprawdzić aktualizacji', +'Unable to download': 'Nie można Å›ciÄ…gnąć', +'Unable to download app because:': 'Unable to download app because:', +'Unable to download because': 'Unable to download because', +'Update:': 'Uaktualnij:', +'Upload & install packed application': 'Upload & install packed application', +'Upload a package:': 'Upload a package:', +'Upload existing application': 'WyÅ›lij istniejÄ…cÄ… aplikacjÄ™', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Użyj (...)&(...) jako AND, (...)|(...) jako OR oraz ~(...) jako NOT do tworzenia bardziej skomplikowanych zapytaÅ„.', +'Use an url:': 'Use an url:', +'Version': 'Version', +'Views': 'Widoki', +'Welcome to web2py': 'Witaj w web2py', +'YES': 'TAK', +'About': 'informacje', +'additional code for your application': 'dodatkowy kod Twojej aplikacji', +'admin disabled because no admin password': 'panel administracyjny wyłączony z powodu braku hasÅ‚a administracyjnego', +'admin disabled because not supported on google app engine': 'admin disabled because not supported on google apps engine', +'admin disabled because unable to access password file': 'panel administracyjny wyłączony z powodu braku dostÄ™pu do pliku z hasÅ‚em', +'administrative interface': 'administrative interface', +'and rename it (required):': 'i nadaj jej nowÄ… nazwÄ™ (wymagane):', +'and rename it:': 'i nadaj mu nowÄ… nazwÄ™:', +'appadmin': 'administracja aplikacji', +'appadmin is disabled because insecure channel': 'appadmin is disabled because insecure channel', +'application "%s" uninstalled': 'aplikacja "%s" zostaÅ‚a odinstalowana', +'application compiled': 'aplikacja zostaÅ‚a skompilowana', +'application is compiled and cannot be designed': 'aplikacja jest skompilowana i nie może być projektowana', +'arguments': 'arguments', +'back': 'back', +'cache': 'cache', +'cache, errors and sessions cleaned': 'pamięć podrÄ™czna, bilety błędów oraz pliki sesji zostaÅ‚y wyczyszczone', +'cannot create file': 'nie można utworzyć pliku', +'cannot upload file "%(filename)s"': 'nie można wysÅ‚ać pliku "%(filename)s"', +'Change admin password': 'change admin password', +'check all': 'zaznacz wszystko', +'Check for upgrades': 'check for upgrades', +'Clean': 'oczyść', +'click here for online examples': 'kliknij aby przejść do interaktywnych przykÅ‚adów', +'click here for the administrative interface': 'kliknij aby przejść do panelu administracyjnego', +'click to check for upgrades': 'kliknij aby sprawdzić aktualizacje', +'code': 'code', +'Compile': 'skompiluj', +'compiled application removed': 'skompilowana aplikacja zostaÅ‚a usuniÄ™ta', +'controllers': 'kontrolery', +'Create': 'create', +'create file with filename:': 'utwórz plik o nazwie:', +'create new application:': 'utwórz nowÄ… aplikacjÄ™:', +'created by': 'created by', +'crontab': 'crontab', +'currently running': 'currently running', +'currently saved or': 'aktualnie zapisany lub', +'data uploaded': 'dane wysÅ‚ane', +'database': 'baza danych', +'database %s select': 'wybór z bazy danych %s', +'database administration': 'administracja bazy danych', +'db': 'baza danych', +'defines tables': 'zdefiniuj tabele', +'delete': 'usuÅ„', +'delete all checked': 'usuÅ„ wszystkie zaznaczone', +'delete plugin': 'delete plugin', +'Deploy': 'deploy', +'design': 'projektuj', +'direction: ltr': 'direction: ltr', +'done!': 'zrobione!', +'Edit': 'edytuj', +'edit controller': 'edytuj kontroler', +'edit views:': 'edit views:', +'Errors': 'błędy', +'export as csv file': 'eksportuj jako plik csv', +'exposes': 'eksponuje', +'extends': 'rozszerza', +'failed to reload module': 'nie udaÅ‚o siÄ™ przeÅ‚adować moduÅ‚u', +'failed to reload module because:': 'failed to reload module because:', +'file "%(filename)s" created': 'plik "%(filename)s" zostaÅ‚ utworzony', +'file "%(filename)s" deleted': 'plik "%(filename)s" zostaÅ‚ usuniÄ™ty', +'file "%(filename)s" uploaded': 'plik "%(filename)s" zostaÅ‚ wysÅ‚any', +'file "%(filename)s" was not deleted': 'plik "%(filename)s" nie zostaÅ‚ usuniÄ™ty', +'file "%s" of %s restored': 'plik "%s" z %s zostaÅ‚ odtworzony', +'file changed on disk': 'plik na dysku zostaÅ‚ zmieniony', +'file does not exist': 'plik nie istnieje', +'file saved on %(time)s': 'plik zapisany o %(time)s', +'file saved on %s': 'plik zapisany o %s', +'Help': 'pomoc', +'htmledit': 'edytuj HTML', +'includes': 'zawiera', +'insert new': 'wstaw nowy rekord tabeli', +'insert new %s': 'wstaw nowy rekord do tabeli %s', +'Install': 'install', +'internal error': 'wewnÄ™trzny błąd', +'invalid password': 'błędne hasÅ‚o', +'invalid request': 'błędne zapytanie', +'invalid ticket': 'błędny bilet', +'language file "%(filename)s" created/updated': 'plik tÅ‚umaczeÅ„ "%(filename)s" zostaÅ‚ utworzony/uaktualniony', +'languages': 'pliki tÅ‚umaczeÅ„', +'languages updated': 'pliki tÅ‚umaczeÅ„ zostaÅ‚y uaktualnione', +'loading...': 'wczytywanie...', +'login': 'zaloguj', +'Logout': 'wyloguj', +'merge': 'merge', +'models': 'modele', +'modules': 'moduÅ‚y', +'new application "%s" created': 'nowa aplikacja "%s" zostaÅ‚a utworzona', +'new plugin installed': 'new plugin installed', +'new record inserted': 'nowy rekord zostaÅ‚ wstawiony', +'next 100 rows': 'nastÄ™pne 100 wierszy', +'no match': 'no match', +'or import from csv file': 'lub zaimportuj z pliku csv', +'or provide app url:': 'or provide app url:', +'or provide application url:': 'lub podaj url aplikacji:', +'Overwrite installed app': 'overwrite installed app', +'Pack all': 'spakuj wszystko', +'Pack compiled': 'spakuj skompilowane', +'pack plugin': 'pack plugin', +'password changed': 'password changed', +'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" deleted', +'previous 100 rows': 'poprzednie 100 wierszy', +'record': 'record', +'record does not exist': 'rekord nie istnieje', +'record id': 'id rekordu', +'Remove compiled': 'usuÅ„ skompilowane', +'restore': 'odtwórz', +'revert': 'przywróć', +'save': 'zapisz', +'selected': 'zaznaczone', +'session expired': 'sesja wygasÅ‚a', +'shell': 'powÅ‚oka', +'Site': 'strona główna', +'some files could not be removed': 'niektóre pliki nie mogÅ‚y zostać usuniÄ™te', +'Start wizard': 'start wizard', +'state': 'stan', +'static': 'pliki statyczne', +'submit': 'submit', +'table': 'tabela', +'test': 'testuj', +'the application logic, each URL path is mapped in one exposed function in the controller': 'logika aplikacji, każda Å›cieżka URL jest mapowana na jednÄ… z funkcji eksponowanych w kontrolerze', +'the data representation, define database tables and sets': 'reprezentacja danych, definicje zbiorów i tabel bazy danych', +'the presentations layer, views are also known as templates': 'warstwa prezentacji, widoki zwane sÄ… również szablonami', +'these files are served without processing, your images go here': 'pliki obsÅ‚ugiwane bez interpretacji, to jest miejsce na Twoje obrazy', +'to previous version.': 'do poprzedniej wersji.', +'translation strings for the application': 'ciÄ…gi tÅ‚umaczeÅ„ dla aplikacji', +'try': 'spróbój', +'try something like': 'spróbój czegos takiego jak', +'unable to create application "%s"': 'nie można utworzyć aplikacji "%s"', +'unable to delete file "%(filename)s"': 'nie można usunąć pliku "%(filename)s"', +'unable to delete file plugin "%(plugin)s"': 'unable to delete file plugin "%(plugin)s"', +'unable to parse csv file': 'nie można sparsować pliku csv', +'unable to uninstall "%s"': 'nie można odinstalować "%s"', +'unable to upgrade because "%s"': 'unable to upgrade because "%s"', +'uncheck all': 'odznacz wszystko', +'Uninstall': 'odinstaluj', +'update': 'uaktualnij', +'update all languages': 'uaktualnij wszystkie pliki tÅ‚umaczeÅ„', +'upgrade web2py now': 'upgrade web2py now', +'upload application:': 'wyÅ›lij plik aplikacji:', +'upload file:': 'wyÅ›lij plik:', +'upload plugin file:': 'upload plugin file:', +'variables': 'variables', +'versioning': 'versioning', +'view': 'widok', +'views': 'widoki', +'web2py Recent Tweets': 'najnowsze tweety web2py', +'web2py is up to date': 'web2py jest aktualne', +'web2py upgraded; please restart it': 'web2py upgraded; please restart it', +} diff --git a/applications/admin/languages/pl.py b/applications/admin/languages/pl.py new file mode 100644 index 00000000..7b866f2c --- /dev/null +++ b/applications/admin/languages/pl.py @@ -0,0 +1,277 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:', +'%Y-%m-%d': '%Y-%m-%d', +'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', +'%s rows deleted': 'Wierszy usuniÄ™tych: %s', +'%s rows updated': 'Wierszy uaktualnionych: %s', +'(requires internet access)': '(requires internet access)', +'(something like "it-it")': '(coÅ› podobnego do "it-it")', +'A new version of web2py is available': 'Nowa wersja web2py jest dostÄ™pna', +'A new version of web2py is available: %s': 'Nowa wersja web2py jest dostÄ™pna: %s', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'UWAGA: Wymagane jest bezpieczne (HTTPS) połączenie lub połączenie z lokalnego adresu.', +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'UWAGA: TESTOWANIE NIE JEST BEZPIECZNE W ÅšRODOWISKU WIELOWÄ„TKOWYM, TAK WIĘC NIE URUCHAMIAJ WIELU TESTÓW JEDNOCZEÅšNIE.', +'ATTENTION: you cannot edit the running application!': 'UWAGA: nie można edytować uruchomionych aplikacji!', +'About': 'Informacje o', +'About application': 'Informacje o aplikacji', +'Additional code for your application': 'Additional code for your application', +'Admin is disabled because insecure channel': 'Panel administracyjny wyłączony z powodu braku bezpiecznego połączenia', +'Admin is disabled because unsecure channel': 'Panel administracyjny wyłączony z powodu braku bezpiecznego połączenia', +'Administrator Password:': 'HasÅ‚o administratora:', +'Application name:': 'Application name:', +'Are you sure you want to delete file "%s"?': 'Czy na pewno chcesz usunąć plik "%s"?', +'Are you sure you want to delete plugin "%s"?': 'Czy na pewno chcesz usunąć wtyczkÄ™ "%s"?', +'Are you sure you want to uninstall application "%s"': 'Czy na pewno chcesz usunąć aplikacjÄ™ "%s"', +'Are you sure you want to uninstall application "%s"?': 'Czy na pewno chcesz usunąć aplikacjÄ™ "%s"?', +'Are you sure you want to upgrade web2py now?': 'Are you sure you want to upgrade web2py now?', +'Available databases and tables': 'DostÄ™pne bazy danych i tabele', +'Cannot be empty': 'Nie może być puste', +'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'Nie można skompilować: w Twojej aplikacji sÄ… błędy . Znajdź je, popraw a nastÄ™pnie spróbój ponownie.', +'Cannot compile: there are errors in your app:': 'Cannot compile: there are errors in your app:', +'Check to delete': 'Zaznacz aby usunąć', +'Checking for upgrades...': 'Sprawdzanie aktualizacji...', +'Controllers': 'Kontrolery', +'Create new simple application': 'Utwórz nowÄ… aplikacjÄ™', +'Current request': 'Aktualne żądanie', +'Current response': 'Aktualna odpowiedź', +'Current session': 'Aktualna sesja', +'DESIGN': 'PROJEKTUJ', +'Date and Time': 'Data i godzina', +'Delete': 'UsuÅ„', +'Delete:': 'UsuÅ„:', +'Deploy on Google App Engine': 'Umieść na Google App Engine', +'Design for': 'Projekt dla', +'EDIT': 'EDYTUJ', +'Edit application': 'Edycja aplikacji', +'Edit current record': 'Edytuj aktualny rekord', +'Editing Language file': 'Edytuj plik tÅ‚umaczeÅ„', +'Editing file': 'Edycja pliku', +'Editing file "%s"': 'Edycja pliku "%s"', +'Enterprise Web Framework': 'Enterprise Web Framework', +'Error logs for "%(app)s"': 'Wpisy błędów dla "%(app)s"', +'Exception instance attributes': 'Exception instance attributes', +'Functions with no doctests will result in [passed] tests.': 'Funkcje bez doctestów bÄ™dÄ… dołączone do [zaliczonych] testów.', +'Hello World': 'Witaj Åšwiecie', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'Jeżeli powyższy raport zawiera numer biletu błędu, oznacza to błąd podczas wykonywania kontrolera przez próbÄ… uruchomienia doctestów. Zazwyczaj jest to spowodowane nieprawidÅ‚owymi wciÄ™ciami linii kodu lub błędami w module poza ciaÅ‚em funkcji.\nTytuÅ‚ w kolorze zielonym oznacza, ze wszystkie (zdefiniowane) testy zakoÅ„czyÅ‚y siÄ™ sukcesem. W tej sytuacji ich wyniki nie sÄ… pokazane.', +'Import/Export': 'Importuj/eksportuj', +'Installed applications': 'Zainstalowane aplikacje', +'Internal State': 'Stan wewnÄ™trzny', +'Invalid Query': 'Błędne zapytanie', +'Invalid action': 'Błędna akcja', +'Language files (static strings) updated': 'Pliki tÅ‚umaczeÅ„ (ciÄ…gi statyczne) zostaÅ‚y uaktualnione', +'Languages': 'TÅ‚umaczenia', +'Last saved on:': 'Ostatnio zapisany:', +'License for': 'Licencja dla', +'Login': 'Zaloguj', +'Login to the Administrative Interface': 'Logowanie do panelu administracyjnego', +'Models': 'Modele', +'Modules': 'ModuÅ‚y', +'NO': 'NIE', +'New Record': 'Nowy rekord', +'New application wizard': 'New application wizard', +'New simple application': 'New simple application', +'No databases in this application': 'Brak baz danych w tej aplikacji', +'Original/Translation': 'OryginaÅ‚/tÅ‚umaczenie', +'PAM authenticated user, cannot change password here': 'PAM authenticated user, cannot change password here', +'Peeking at file': 'PodglÄ…d pliku', +'Plugin "%s" in application': 'Wtyczka "%s" w aplikacji', +'Plugins': 'Wtyczki', +'Powered by': 'Zasilane przez', +'Query:': 'Zapytanie:', +'Resolve Conflict file': 'Rozwiąż konflikt plików', +'Rows in table': 'Wiersze w tabeli', +'Rows selected': 'Wierszy wybranych', +'Saved file hash:': 'Suma kontrolna zapisanego pliku:', +'Searching:': 'Searching:', +'Static files': 'Pliki statyczne', +'Sure you want to delete this object?': 'Czy na pewno chcesz usunąć ten obiekt?', +'TM': 'TM', +'Testing application': 'Testowanie aplikacji', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"Zapytanie" jest warunkiem postaci "db.tabela1.pole1==\'wartość\'". Takie coÅ› jak "db.tabela1.pole1==db.tabela2.pole2" oznacza SQL JOIN.', +'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller', +'The data representation, define database tables and sets': 'The data representation, define database tables and sets', +'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates', +'There are no controllers': 'Brak kontrolerów', +'There are no models': 'Brak modeli', +'There are no modules': 'Brak modułów', +'There are no plugins': 'There are no plugins', +'There are no static files': 'Brak plików statycznych', +'There are no translators, only default language is supported': 'Brak plików tÅ‚umaczeÅ„, wspierany jest tylko domyÅ›lny jÄ™zyk', +'There are no views': 'Brak widoków', +'These files are served without processing, your images go here': 'These files are served without processing, your images go here', +'This is the %(filename)s template': 'To jest szablon %(filename)s', +'Ticket': 'Bilet', +'To create a plugin, name a file/folder plugin_[name]': 'Aby utworzyć wtyczkÄ™, nazwij plik/katalog plugin_[nazwa]', +'Translation strings for the application': 'Translation strings for the application', +'Unable to check for upgrades': 'Nie można sprawdzić aktualizacji', +'Unable to download': 'Nie można Å›ciÄ…gnąć', +'Unable to download app': 'Nie można Å›ciÄ…gnąć aplikacji', +'Unable to download app because:': 'Unable to download app because:', +'Unable to download because': 'Unable to download because', +'Update:': 'Uaktualnij:', +'Upload & install packed application': 'Upload & install packed application', +'Upload a package:': 'Upload a package:', +'Upload existing application': 'WyÅ›lij istniejÄ…cÄ… aplikacjÄ™', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Użyj (...)&(...) jako AND, (...)|(...) jako OR oraz ~(...) jako NOT do tworzenia bardziej skomplikowanych zapytaÅ„.', +'Use an url:': 'Use an url:', +'Version': 'Wersja', +'Views': 'Widoki', +'Welcome to web2py': 'Witaj w web2py', +'YES': 'TAK', +'About': 'informacje', +'additional code for your application': 'dodatkowy kod Twojej aplikacji', +'admin disabled because no admin password': 'panel administracyjny wyłączony z powodu braku hasÅ‚a administracyjnego', +'admin disabled because not supported on google app engine': 'panel administracyjny wyłączony z powodu braku wsparcia na google apps engine', +'admin disabled because unable to access password file': 'panel administracyjny wyłączony z powodu braku dostÄ™pu do pliku z hasÅ‚em', +'administrative interface': 'administrative interface', +'and rename it (required):': 'i nadaj jej nowÄ… nazwÄ™ (wymagane):', +'and rename it:': 'i nadaj mu nowÄ… nazwÄ™:', +'appadmin': 'administracja aplikacji', +'appadmin is disabled because insecure channel': 'administracja aplikacji wyłączona z powodu braku bezpiecznego połączenia', +'application "%s" uninstalled': 'aplikacja "%s" zostaÅ‚a odinstalowana', +'application compiled': 'aplikacja zostaÅ‚a skompilowana', +'application is compiled and cannot be designed': 'aplikacja jest skompilowana i nie może być projektowana', +'arguments': 'arguments', +'back': 'wstecz', +'cache': 'cache', +'cache, errors and sessions cleaned': 'pamięć podrÄ™czna, bilety błędów oraz pliki sesji zostaÅ‚y wyczyszczone', +'cannot create file': 'nie można utworzyć pliku', +'cannot upload file "%(filename)s"': 'nie można wysÅ‚ać pliku "%(filename)s"', +'Change admin password': 'change admin password', +'check all': 'zaznacz wszystko', +'Check for upgrades': 'check for upgrades', +'Clean': 'oczyść', +'click here for online examples': 'kliknij aby przejść do interaktywnych przykÅ‚adów', +'click here for the administrative interface': 'kliknij aby przejść do panelu administracyjnego', +'click to check for upgrades': 'kliknij aby sprawdzić aktualizacje', +'code': 'code', +'collapse/expand all': 'collapse/expand all', +'Compile': 'skompiluj', +'compiled application removed': 'skompilowana aplikacja zostaÅ‚a usuniÄ™ta', +'controllers': 'kontrolery', +'Create': 'create', +'create file with filename:': 'utwórz plik o nazwie:', +'create new application:': 'utwórz nowÄ… aplikacjÄ™:', +'created by': 'utworzone przez', +'crontab': 'crontab', +'currently running': 'currently running', +'currently saved or': 'aktualnie zapisany lub', +'data uploaded': 'dane wysÅ‚ane', +'database': 'baza danych', +'database %s select': 'wybór z bazy danych %s', +'database administration': 'administracja bazy danych', +'db': 'baza danych', +'defines tables': 'zdefiniuj tabele', +'delete': 'usuÅ„', +'delete all checked': 'usuÅ„ wszystkie zaznaczone', +'delete plugin': 'usuÅ„ wtyczkÄ™', +'Deploy': 'deploy', +'design': 'projektuj', +'direction: ltr': 'direction: ltr', +'done!': 'zrobione!', +'download layouts': 'download layouts', +'download plugins': 'download plugins', +'Edit': 'edytuj', +'edit controller': 'edytuj kontroler', +'edit views:': 'edit views:', +'Errors': 'błędy', +'export as csv file': 'eksportuj jako plik csv', +'exposes': 'eksponuje', +'extends': 'rozszerza', +'failed to reload module': 'nie udaÅ‚o siÄ™ przeÅ‚adować moduÅ‚u', +'failed to reload module because:': 'failed to reload module because:', +'file "%(filename)s" created': 'plik "%(filename)s" zostaÅ‚ utworzony', +'file "%(filename)s" deleted': 'plik "%(filename)s" zostaÅ‚ usuniÄ™ty', +'file "%(filename)s" uploaded': 'plik "%(filename)s" zostaÅ‚ wysÅ‚any', +'file "%(filename)s" was not deleted': 'plik "%(filename)s" nie zostaÅ‚ usuniÄ™ty', +'file "%s" of %s restored': 'plik "%s" z %s zostaÅ‚ odtworzony', +'file changed on disk': 'plik na dysku zostaÅ‚ zmieniony', +'file does not exist': 'plik nie istnieje', +'file saved on %(time)s': 'plik zapisany o %(time)s', +'file saved on %s': 'plik zapisany o %s', +'files': 'files', +'filter': 'filter', +'Help': 'pomoc', +'htmledit': 'edytuj HTML', +'includes': 'zawiera', +'insert new': 'wstaw nowy rekord tabeli', +'insert new %s': 'wstaw nowy rekord do tabeli %s', +'Install': 'install', +'internal error': 'wewnÄ™trzny błąd', +'invalid password': 'błędne hasÅ‚o', +'invalid request': 'błędne zapytanie', +'invalid ticket': 'błędny bilet', +'language file "%(filename)s" created/updated': 'plik tÅ‚umaczeÅ„ "%(filename)s" zostaÅ‚ utworzony/uaktualniony', +'languages': 'pliki tÅ‚umaczeÅ„', +'languages updated': 'pliki tÅ‚umaczeÅ„ zostaÅ‚y uaktualnione', +'loading...': 'wczytywanie...', +'login': 'zaloguj', +'Logout': 'wyloguj', +'merge': 'zespól', +'models': 'modele', +'modules': 'moduÅ‚y', +'new application "%s" created': 'nowa aplikacja "%s" zostaÅ‚a utworzona', +'new plugin installed': 'nowa wtyczka zostaÅ‚a zainstalowana', +'new record inserted': 'nowy rekord zostaÅ‚ wstawiony', +'next 100 rows': 'nastÄ™pne 100 wierszy', +'no match': 'no match', +'or import from csv file': 'lub zaimportuj z pliku csv', +'or provide app url:': 'or provide app url:', +'or provide application url:': 'lub podaj url aplikacji:', +'Overwrite installed app': 'overwrite installed app', +'Pack all': 'spakuj wszystko', +'Pack compiled': 'spakuj skompilowane', +'pack plugin': 'spakuj wtyczkÄ™', +'password changed': 'password changed', +'plugin "%(plugin)s" deleted': 'wtyczka "%(plugin)s" zostaÅ‚a usuniÄ™ta', +'plugins': 'plugins', +'previous 100 rows': 'poprzednie 100 wierszy', +'record': 'rekord', +'record does not exist': 'rekord nie istnieje', +'record id': 'ID rekordu', +'Remove compiled': 'usuÅ„ skompilowane', +'restore': 'odtwórz', +'revert': 'przywróć', +'save': 'zapisz', +'selected': 'zaznaczone', +'session expired': 'sesja wygasÅ‚a', +'shell': 'powÅ‚oka', +'Site': 'strona główna', +'some files could not be removed': 'niektóre pliki nie mogÅ‚y zostać usuniÄ™te', +'Start wizard': 'start wizard', +'state': 'stan', +'static': 'pliki statyczne', +'submit': 'wyÅ›lij', +'table': 'tabela', +'test': 'testuj', +'the application logic, each URL path is mapped in one exposed function in the controller': 'logika aplikacji, każda Å›cieżka URL jest mapowana na jednÄ… z funkcji eksponowanych w kontrolerze', +'the data representation, define database tables and sets': 'reprezentacja danych, definicje zbiorów i tabel bazy danych', +'the presentations layer, views are also known as templates': 'warstwa prezentacji, widoki zwane sÄ… również szablonami', +'these files are served without processing, your images go here': 'pliki obsÅ‚ugiwane bez interpretacji, to jest miejsce na Twoje obrazy', +'to previous version.': 'do poprzedniej wersji.', +'translation strings for the application': 'ciÄ…gi tÅ‚umaczeÅ„ dla aplikacji', +'try': 'spróbój', +'try something like': 'spróbój czegos takiego jak', +'unable to create application "%s"': 'nie można utworzyć aplikacji "%s"', +'unable to delete file "%(filename)s"': 'nie można usunąć pliku "%(filename)s"', +'unable to delete file plugin "%(plugin)s"': 'nie można usunÄ…c pliku wtyczki "%(plugin)s"', +'unable to parse csv file': 'nie można sparsować pliku csv', +'unable to uninstall "%s"': 'nie można odinstalować "%s"', +'unable to upgrade because "%s"': 'unable to upgrade because "%s"', +'uncheck all': 'odznacz wszystko', +'Uninstall': 'odinstaluj', +'update': 'uaktualnij', +'update all languages': 'uaktualnij wszystkie pliki tÅ‚umaczeÅ„', +'upgrade web2py now': 'upgrade web2py now', +'upload': 'upload', +'upload application:': 'wyÅ›lij plik aplikacji:', +'upload file:': 'wyÅ›lij plik:', +'upload plugin file:': 'wyÅ›lij plik wtyczki:', +'variables': 'variables', +'versioning': 'versioning', +'view': 'widok', +'views': 'widoki', +'web2py Recent Tweets': 'najnowsze tweety web2py', +'web2py is up to date': 'web2py jest aktualne', +'web2py upgraded; please restart it': 'web2py upgraded; please restart it', +} diff --git a/applications/admin/languages/pt-br.py b/applications/admin/languages/pt-br.py new file mode 100644 index 00000000..664802c2 --- /dev/null +++ b/applications/admin/languages/pt-br.py @@ -0,0 +1,320 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novo_valor\'". Não é permitido atualizar ou apagar resultados de um JOIN', +'%Y-%m-%d': '%d/%m/%Y', +'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S', +'%s rows deleted': '%s registros apagados', +'%s rows updated': '%s registros atualizados', +'(requires internet access)': '(requer acesso a internet)', +'(something like "it-it")': '(algo como "it-it")', +'A new version of web2py is available': 'Está disponível uma nova versão do web2py', +'A new version of web2py is available: %s': 'Está disponível uma nova versão do web2py: %s', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATENÇÃO o login requer uma conexão segura (HTTPS) ou executar de localhost.', +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATENÇÃO OS TESTES NÃO THREAD SAFE, NÃO EFETUE MÚLTIPLOS TESTES AO MESMO TEMPO.', +'ATTENTION: you cannot edit the running application!': 'ATENÇÃO: Não pode modificar a aplicação em execução!', +'About': 'Sobre', +'About application': 'Sobre a aplicação', +'Additional code for your application': 'Additional code for your application', +'Admin is disabled because insecure channel': 'Admin desabilitado pois o canal não é seguro', +'Admin is disabled because unsecure channel': 'Admin desabilitado pois o canal não é seguro', +'Admin language': 'Linguagem do Admin', +'Administrator Password:': 'Senha de administrador:', +'Application name:': 'Nome da aplicação:', +'Are you sure you want to delete file "%s"?': 'Tem certeza que deseja apagar o arquivo "%s"?', +'Are you sure you want to delete plugin "%s"?': 'Tem certeza que deseja apagar o plugin "%s"?', +'Are you sure you want to uninstall application "%s"': 'Tem certeza que deseja apagar a aplicação "%s"?', +'Are you sure you want to uninstall application "%s"?': 'Tem certeza que deseja apagar a aplicação "%s"?', +'Are you sure you want to upgrade web2py now?': 'Tem certeza que deseja atualizar o web2py agora?', +'Available databases and tables': 'Bancos de dados e tabelas disponíveis', +'Cannot be empty': 'Não pode ser vazio', +'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'Não é possível compilar: Existem erros em sua aplicação. Depure, corrija os errros e tente novamente', +'Cannot compile: there are errors in your app:': 'Não é possível compilar: Existem erros em sua aplicação', +'Change Password': 'Trocar Senha', +'Check to delete': 'Marque para apagar', +'Checking for upgrades...': 'Buscando atualizações...', +'Click row to expand traceback': 'Clique em uma coluna para expandir o log do erro', +'Client IP': 'IP do cliente', +'Controllers': 'Controladores', +'Count': 'Contagem', +'Create new application using the Wizard': 'Criar nova aplicação utilizando o assistente', +'Create new simple application': 'Crie uma nova aplicação', +'Current request': 'Requisição atual', +'Current response': 'Resposta atual', +'Current session': 'Sessão atual', +'DESIGN': 'Projeto', +'Date and Time': 'Data e Hora', +'Delete': 'Apague', +'Delete:': 'Apague:', +'Deploy on Google App Engine': 'Publicar no Google App Engine', +'Description': 'Descrição', +'Design for': 'Projeto de', +'Detailed traceback description': 'Detailed traceback description', +'E-mail': 'E-mail', +'EDIT': 'EDITAR', +'Edit Profile': 'Editar Perfil', +'Edit application': 'Editar aplicação', +'Edit current record': 'Editar o registro atual', +'Editing Language file': 'Editando arquivo de linguagem', +'Editing file': 'Editando arquivo', +'Editing file "%s"': 'Editando arquivo "%s"', +'Enterprise Web Framework': 'Framework web empresarial', +'Error': 'Erro', +'Error logs for "%(app)s"': 'Logs de erro para "%(app)s"', +'Error snapshot': 'Error snapshot', +'Error ticket': 'Error ticket', +'Exception instance attributes': 'Atributos da instancia de excessão', +'File': 'Arquivo', +'First name': 'Nome', +'Frames': 'Frames', +'Functions with no doctests will result in [passed] tests.': 'Funções sem doctests resultarão em testes [aceitos].', +'Group ID': 'ID do Grupo', +'Hello World': 'Olá Mundo', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'Se o relatório acima contém um número de ticket, isso indica uma falha no controlador em execução, antes de tantar executar os doctests. Isto acontece geralmente por erro de endentação ou erro fora do código da função.\nO titulo em verde indica que os testes (se definidos) passaram. Neste caso os testes não são mostrados.', +'Import/Export': 'Importar/Exportar', +'Installed applications': 'Aplicações instaladas', +'Internal State': 'Estado Interno', +'Invalid Query': 'Consulta inválida', +'Invalid action': 'Ação inválida', +'Invalid email': 'E-mail inválido', +'Language files (static strings) updated': 'Arquivos de linguagem (textos estáticos) atualizados', +'Languages': 'Linguagens', +'Last name': 'Sobrenome', +'Last saved on:': 'Salvo em:', +'License for': 'Licença para', +'Login': 'Entrar', +'Login to the Administrative Interface': 'Entrar na interface adminitrativa', +'Logout': 'Sair', +'Lost Password': 'Senha perdida', +'Models': 'Modelos', +'Modules': 'Módulos', +'NO': 'NÃO', +'Name': 'Nome', +'New Record': 'Novo registro', +'New application wizard': 'Assistente para novas aplicações ', +'New simple application': 'Nova aplicação básica', +'No databases in this application': 'Não existem bancos de dados nesta aplicação', +'Origin': 'Origem', +'Original/Translation': 'Original/Tradução', +'PAM authenticated user, cannot change password here': 'usuario autenticado por PAM, não pode alterar a senha por aqui', +'Password': 'Senha', +'Peeking at file': 'Visualizando arquivo', +'Plugin "%s" in application': 'Plugin "%s" na aplicação', +'Plugins': 'Plugins', +'Powered by': 'Este site utiliza', +'Query:': 'Consulta:', +'Record ID': 'ID do Registro', +'Register': 'Registrar-se', +'Registration key': 'Chave de registro', +'Resolve Conflict file': 'Arquivo de resolução de conflito', +'Role': 'Papel', +'Rows in table': 'Registros na tabela', +'Rows selected': 'Registros selecionados', +'Saved file hash:': 'Hash do arquivo salvo:', +'Searching:': 'Searching:', +'Static files': 'Arquivos estáticos', +'Sure you want to delete this object?': 'Tem certeza que deseja apaagr este objeto?', +'TM': 'MR', +'Table name': 'Nome da tabela', +'Testing application': 'Testando a aplicação', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'A "consulta" é uma condição como "db.tabela.campo1==\'valor\'". Algo como "db.tabela1.campo1==db.tabela2.campo2" resulta em um JOIN SQL.', +'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller', +'The data representation, define database tables and sets': 'The data representation, define database tables and sets', +'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates', +'There are no controllers': 'Não existem controllers', +'There are no models': 'Não existem modelos', +'There are no modules': 'Não existem módulos', +'There are no plugins': 'There are no plugins', +'There are no static files': 'Não existem arquicos estáticos', +'There are no translators, only default language is supported': 'Não há traduções, somente a linguagem padrão é suportada', +'There are no views': 'Não existem visões', +'These files are served without processing, your images go here': 'These files are served without processing, your images go here', +'This is the %(filename)s template': 'Este é o template %(filename)s', +'Ticket': 'Ticket', +'Ticket ID': 'Ticket ID', +'Timestamp': 'Data Atual', +'To create a plugin, name a file/folder plugin_[name]': 'Para criar um plugin, nomeio um arquivo/pasta como plugin_[nome]', +'Traceback': 'Traceback', +'Translation strings for the application': 'Translation strings for the application', +'Unable to check for upgrades': 'Não é possível checar as atualizações', +'Unable to download': 'Não é possível efetuar o download', +'Unable to download app': 'Não é possível baixar a aplicação', +'Unable to download app because:': 'Não é possível baixar a aplicação porque:', +'Unable to download because': 'Não é possível baixar porque', +'Update:': 'Atualizar:', +'Upload & install packed application': 'Faça upload e instale uma aplicação empacotada', +'Upload a package:': 'Faça upload de um pacote:', +'Upload existing application': 'Faça upload de uma aplicação existente', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) para AND, (...)|(...) para OR, y ~(...) para NOT, para criar consultas mais complexas.', +'Use an url:': 'Use uma url:', +'User ID': 'ID do Usuario', +'Version': 'Versão', +'Views': 'Visões', +'Welcome to web2py': 'Bem-vindo ao web2py', +'YES': 'SIM', +'About': 'sobre', +'additional code for your application': 'código adicional para sua aplicação', +'admin disabled because no admin password': ' admin desabilitado por falta de senha definida', +'admin disabled because not supported on google app engine': 'admin dehabilitado, não é soportado no GAE', +'admin disabled because unable to access password file': 'admin desabilitado, não foi possível ler o arquivo de senha', +'administrative interface': 'interface administrativa', +'and rename it (required):': 'e renomeie (requerido):', +'and rename it:': ' e renomeie:', +'appadmin': 'appadmin', +'appadmin is disabled because insecure channel': 'admin desabilitado, canal inseguro', +'application "%s" uninstalled': 'aplicação "%s" desinstalada', +'application compiled': 'aplicação compilada', +'application is compiled and cannot be designed': 'A aplicação está compilada e não pode ser modificada', +'arguments': 'argumentos', +'back': 'voltar', +'browse': 'buscar', +'cache': 'cache', +'cache, errors and sessions cleaned': 'cache, erros e sessões eliminadas', +'cannot create file': 'Não é possível criar o arquivo', +'cannot upload file "%(filename)s"': 'não é possível fazer upload do arquivo "%(filename)s"', +'Change admin password': 'mudar senha de administrador', +'check all': 'marcar todos', +'Check for upgrades': 'checar por atualizações', +'Clean': 'limpar', +'click here for online examples': 'clique para ver exemplos online', +'click here for the administrative interface': 'Clique aqui para acessar a interface administrativa', +'click to check for upgrades': 'clique aqui para checar por atualizações', +'click to open': 'clique para abrir', +'code': 'código', +'collapse/expand all': 'collapse/expand all', +'commit (mercurial)': 'commit (mercurial)', +'Compile': 'compilar', +'compiled application removed': 'aplicação compilada removida', +'controllers': 'controladores', +'Create': 'criar', +'create file with filename:': 'criar um arquivo com o nome:', +'create new application:': 'nome da nova aplicação:', +'created by': 'criado por', +'crontab': 'crontab', +'currently running': 'Executando', +'currently saved or': 'Atualmente salvo ou', +'customize me!': 'Modifique-me', +'data uploaded': 'Dados enviados', +'database': 'banco de dados', +'database %s select': 'Seleção no banco de dados %s', +'database administration': 'administração de banco de dados', +'db': 'db', +'defines tables': 'define as tabelas', +'delete': 'apagar', +'delete all checked': 'apagar marcados', +'delete plugin': 'apagar plugin', +'Deploy': 'publicar', +'design': 'modificar', +'direction: ltr': 'direção: ltr', +'done!': 'feito!', +'download layouts': 'download layouts', +'download plugins': 'download plugins', +'Edit': 'editar', +'edit controller': 'editar controlador', +'edit views:': 'editar visões:', +'Errors': 'erros', +'export as csv file': 'exportar como arquivo CSV', +'exposes': 'expõe', +'extends': 'estende', +'failed to reload module': 'Falha ao recarregar o módulo', +'failed to reload module because:': 'falha ao recarregar o módulo por:', +'file "%(filename)s" created': 'arquivo "%(filename)s" criado', +'file "%(filename)s" deleted': 'arquivo "%(filename)s" apagado', +'file "%(filename)s" uploaded': 'arquivo "%(filename)s" enviado', +'file "%(filename)s" was not deleted': 'arquivo "%(filename)s" não foi apagado', +'file "%s" of %s restored': 'arquivo "%s" de %s restaurado', +'file changed on disk': 'arquivo modificado no disco', +'file does not exist': 'arquivo não existe', +'file saved on %(time)s': 'arquivo salvo em %(time)s', +'file saved on %s': 'arquivo salvo em %s', +'files': 'files', +'filter': 'filter', +'Help': 'ajuda', +'htmledit': 'htmledit', +'includes': 'inclui', +'insert new': 'inserir novo', +'insert new %s': 'inserir novo %s', +'inspect attributes': 'inspect attributes', +'Install': 'instalar', +'internal error': 'erro interno', +'invalid password': 'senha inválida', +'invalid request': 'solicitação inválida', +'invalid ticket': 'ticket inválido', +'language file "%(filename)s" created/updated': 'arquivo de linguagem "%(filename)s" criado/atualizado', +'languages': 'linguagens', +'languages updated': 'linguagens atualizadas', +'loading...': 'carregando...', +'locals': 'locals', +'login': 'inicio de sessão', +'Logout': 'finalizar sessão', +'manage': 'gerenciar', +'merge': 'juntar', +'models': 'modelos', +'modules': 'módulos', +'new application "%s" created': 'nova aplicação "%s" criada', +'new plugin installed': 'novo plugin instalado', +'new record inserted': 'novo registro inserido', +'next 100 rows': 'próximos 100 registros', +'no match': 'não encontrado', +'or import from csv file': 'ou importar de um arquivo CSV', +'or provide app url:': 'ou forneça a url de uma aplicação:', +'or provide application url:': 'ou forneça a url de uma aplicação:', +'Overwrite installed app': 'sobrescrever aplicação instalada', +'Pack all': 'criar pacote', +'Pack compiled': 'criar pacote compilado', +'pack plugin': 'empacotar plugin', +'password changed': 'senha alterada', +'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" eliminado', +'plugins': 'plugins', +'previous 100 rows': '100 registros anteriores', +'record': 'registro', +'record does not exist': 'o registro não existe', +'record id': 'id do registro', +'Remove compiled': 'eliminar compilados', +'request': 'request', +'response': 'response', +'restore': 'restaurar', +'revert': 'reverter', +'save': 'salvar', +'selected': 'selecionado(s)', +'session': 'session', +'session expired': 'sessão expirada', +'shell': 'Terminal', +'Site': 'site', +'some files could not be removed': 'alguns arquicos não puderam ser removidos', +'Start wizard': 'iniciar assistente', +'state': 'estado', +'static': 'estáticos', +'submit': 'enviar', +'table': 'tabela', +'test': 'testar', +'the application logic, each URL path is mapped in one exposed function in the controller': 'A lógica da aplicação, cada URL é mapeada para uma função exposta pelo controlador', +'the data representation, define database tables and sets': 'A representação dos dadps, define tabelas e estruturas de dados', +'the presentations layer, views are also known as templates': 'A camada de apresentação, As visões também são chamadas de templates', +'these files are served without processing, your images go here': 'Estes arquivos são servidos sem processamento, suas imagens ficam aqui', +'to previous version.': 'para a versão anterior.', +'translation strings for the application': 'textos traduzidos para a aplicação', +'try': 'tente', +'try something like': 'tente algo como', +'unable to create application "%s"': 'não é possível criar a aplicação "%s"', +'unable to delete file "%(filename)s"': 'não é possível criar o arquico "%(filename)s"', +'unable to delete file plugin "%(plugin)s"': 'não é possível criar o plugin "%(plugin)s"', +'unable to parse csv file': 'não é possível analisar o arquivo CSV', +'unable to uninstall "%s"': 'não é possível instalar "%s"', +'unable to upgrade because "%s"': 'não é possível atualizar porque "%s"', +'uncheck all': 'desmarcar todos', +'Uninstall': 'desinstalar', +'update': 'atualizar', +'update all languages': 'atualizar todas as linguagens', +'upgrade web2py now': 'atualize o web2py agora', +'upload': 'upload', +'upload application:': 'Fazer upload de uma aplicação:', +'upload file:': 'Enviar arquivo:', +'upload plugin file:': 'Enviar arquivo de plugin:', +'variables': 'variáveis', +'versioning': 'versionamento', +'view': 'visão', +'views': 'visões', +'web2py Recent Tweets': 'Tweets Recentes de @web2py', +'web2py is up to date': 'web2py está atualizado', +'web2py upgraded; please restart it': 'web2py atualizado; favor reiniciar', +} diff --git a/applications/admin/languages/zh-cn.py b/applications/admin/languages/zh-cn.py new file mode 100644 index 00000000..2e169051 --- /dev/null +++ b/applications/admin/languages/zh-cn.py @@ -0,0 +1,290 @@ +# coding: utf8 +{ +'"browse"': '游览', +'"save"': '"ä¿å­˜"', +'"submit"': '"æäº¤"', +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"æ›´æ–°"是å¯é…置项 如 "field1=\'newvalue\'",你无法在JOIN 中更新或删除', +'%Y-%m-%d': '%Y-%m-%d', +'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', +'%s rows deleted': '%s 行已删', +'%s rows updated': '%s 行更新', +'(requires internet access)': '(requires internet access)', +'(something like "it-it")': '(就酱 "it-it")', +'A new version of web2py is available': '新版本web2pyå·²ç»å¯ç”¨', +'A new version of web2py is available: %s': '新版本web2pyå·²ç»å¯ç”¨: %s', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': '', +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': '', +'ATTENTION: you cannot edit the running application!': '注æ„: ä¸èƒ½ä¿®æ”¹æ­£åœ¨è¿è¡Œä¸­çš„应用!', +'About': '关于', +'About application': '关于这个应用', +'Admin is disabled because insecure channel': '管ç†å› ä¸å®‰å…¨é€šé“而关闭', +'Admin is disabled because unsecure channel': '管ç†å› ä¸ç¨³å®šé€šé“而关闭', +'Admin language': 'Admin language', +'Administrator Password:': '管ç†å‘˜å¯†ç :', +'Application name:': 'Application name:', +'Are you sure you want to delete file "%s"?': '你真想删除文件"%s"?', +'Are you sure you want to delete plugin "%s"?': 'Are you sure you want to delete plugin "%s"?', +'Are you sure you want to uninstall application "%s"': '你真确定è¦å¸è½½åº”用 "%s"', +'Are you sure you want to uninstall application "%s"?': '你真确定è¦å¸è½½åº”用 "%s" ?', +'Are you sure you want to upgrade web2py now?': 'Are you sure you want to upgrade web2py now?', +'Available databases and tables': 'å¯ç”¨æ•°æ®åº“/表', +'Cannot be empty': 'ä¸èƒ½ä¸å¡«', +'Cannot compile: there are errors in your app.        Debug it, correct errors and try again.': '无法编译: 应用中有错误,请修订åŽå†è¯•.', +'Cannot compile: there are errors in your app:': 'Cannot compile: there are errors in your app:', +'Change Password': '修改密ç ', +'Check to delete': '检验删除', +'Checking for upgrades...': 'æ˜¯å¦æœ‰å‡çº§ç‰ˆæœ¬æ£€æŸ¥ing...', +'Client IP': '客户端IP', +'Controllers': '控制器s', +'Create new simple application': '创建一个新应用', +'Current request': '当å‰è¯·æ±‚', +'Current response': '当å‰è¿”回', +'Current session': '当å‰ä¼šè¯', +'DESIGN': '设计', +'Date and Time': '时间日期', +'Delete': '删除', +'Delete:': '删除:', +'Deploy on Google App Engine': '部署到GAE', +'Description': 'æè¿°', +'Design for': '设计:', +'E-mail': '邮箱:', +'EDIT': '编辑', +'Edit Profile': '修订é…ç½®', +'Edit application': '修订应用', +'Edit current record': '修订当å‰è®°å½•', +'Editing Language file': '修订语言文件', +'Editing file': '修订文件', +'Editing file "%s"': '修订文件 %s', +'Enterprise Web Framework': '强æ‚çš„ç½‘ç»œå¼€å‘æ¡†æž¶', +'Error logs for "%(app)s"': '"%(app)s" 的错误日志', +'Exception instance attributes': 'Exception instance attributes', +'First name': 'å§“', +'Functions with no doctests will result in [passed] tests.': '', +'Group ID': '组ID', +'Hello World': 'é“å¯é“,éžå¸¸é“ï¼›åå¯å,éžå¸¸å', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.', +'Import/Export': '导入/导出', +'Installed applications': '已安装的应用', +'Internal State': '内部状æ€', +'Invalid Query': '无效查询', +'Invalid action': '无效动作', +'Invalid email': '无效的email', +'Language files (static strings) updated': '语言文件(陿€éƒ¨åˆ†)已更新', +'Languages': '语言', +'Last name': 'å', +'Last saved on:': '最åŽä¿å­˜äºŽ:', +'License for': '许å¯è¯', +'Login': '登录', +'Login to the Administrative Interface': '登录到管ç†å‘˜ç•Œé¢', +'Logout': '注销', +'Lost Password': '忘记密ç ', +'Models': '模型s', +'Modules': '模å—s', +'NO': 'ä¸', +'Name': 'å§“å', +'New Record': '新记录', +'New application wizard': 'New application wizard', +'New simple application': 'New simple application', +'No databases in this application': '这应用没有数æ®åº“', +'Origin': 'èµ·æº', +'Original/Translation': '原始文件/翻译文件', +'PAM authenticated user, cannot change password here': 'PAM authenticated user, cannot change password here', +'Password': '密ç ', +'Peeking at file': '选个文件', +'Plugin "%s" in application': 'Plugin "%s" in application', +'Plugins': 'Plugins', +'Powered by': '', +'Query:': '查询', +'Record ID': '记录ID', +'Register': '注册', +'Registration key': '注册密匙', +'Resolve Conflict file': 'è§£å†³å†²çªæ–‡ä»¶', +'Role': '角色', +'Rows in table': '表行', +'Rows selected': '行选择', +'Saved file hash:': '已存文件Hash:', +'Static files': '陿€æ–‡ä»¶', +'Sure you want to delete this object?': '真的è¦åˆ é™¤è¿™ä¸ªå¯¹è±¡?', +'TM': '', +'Table name': '表å', +'Testing application': '应用测试', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '', +'There are no controllers': '冇控制器', +'There are no models': '冇模型s', +'There are no modules': '冇模å—s', +'There are no static files': '冇陿€æ–‡ä»¶', +'There are no translators, only default language is supported': '没有找到相应翻译,åªèƒ½ä½¿ç”¨é»˜è®¤è¯­è¨€', +'There are no views': '冇视图', +'This is the %(filename)s template': '这是 %(filename)s 模æ¿', +'Ticket': '传票', +'Timestamp': '时间戳', +'To create a plugin, name a file/folder plugin_[name]': 'To create a plugin, name a file/folder plugin_[name]', +'Unable to check for upgrades': '无法检查是å¦éœ€è¦å‡çº§', +'Unable to download': '无法下载', +'Unable to download app': '无法下载应用', +'Unable to download app because:': 'Unable to download app because:', +'Unable to download because': 'Unable to download because', +'Update:': 'æ›´æ–°:', +'Upload & install packed application': 'Upload & install packed application', +'Upload a package:': 'Upload a package:', +'Upload existing application': '上传已有应用', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...)  for NOT to build more complex queries.': '', +'Use an url:': 'Use an url:', +'User ID': '用户ID', +'Version': '版本', +'Views': '视图', +'Welcome to web2py': '欢迎使用web2py', +'YES': '是', +'About': '关于', +'additional code for your application': '给你的应用附加代ç ', +'admin disabled because no admin password': '管ç†å‘˜éœ€è¦è®¾å®šå¯†ç ï¼Œå¦åˆ™æ— æ³•管ç†', +'admin disabled because not supported on google app engine': '未支æŒGAE,无法管ç†', +'admin disabled because unable to access password file': '需è¦å¯ä»¥æ“ä½œå¯†ç æ–‡ä»¶ï¼Œå¦åˆ™æ— æ³•进行管ç†', +'administrative interface': 'administrative interface', +'and rename it (required):': 'é‡å‘½å为 (å¿…é¡»):', +'and rename it:': ' é‡å‘½å为:', +'appadmin': '应用管ç†', +'appadmin is disabled because insecure channel': '应用管ç†å› éžæ³•通é“失效', +'application "%s" uninstalled': '应用"%s" 已被å¸è½½', +'application compiled': '应用已编译完', +'application is compiled and cannot be designed': '应用已编译完无法设计', +'arguments': 'arguments', +'back': 'back', +'cache': 'cache', +'cache, errors and sessions cleaned': '缓存ã€é”™è¯¯ã€sesiones已被清空', +'cannot create file': '无法创建文件', +'cannot upload file "%(filename)s"': '无法上传文件 "%(filename)s"', +'Change admin password': 'change admin password', +'check all': '检查所有', +'Check for upgrades': 'check for upgrades', +'Clean': '清除', +'click here for online examples': '猛击此处,查看在线实例', +'click here for the administrative interface': '猛击此处,进入管ç†ç•Œé¢', +'click to check for upgrades': 'çŒ›å‡»æŸ¥çœ‹æ˜¯å¦æœ‰å‡çº§ç‰ˆæœ¬', +'code': 'code', +'Compile': '编译', +'compiled application removed': '已编译应用已移走', +'controllers': '控制器', +'Create': 'create', +'create file with filename:': '创建文件用这å:', +'create new application:': '创建新应用:', +'created by': '创建自', +'crontab': '定期事务', +'currently running': 'currently running', +'currently saved or': 'ä¿å­˜å½“å‰çš„æˆ–', +'customize me!': '定制俺!', +'data uploaded': 'æ•°æ®å·²ä¸Šä¼ ', +'database': 'æ•°æ®åº“', +'database %s select': 'æ•°æ®åº“ %s 选择', +'database administration': 'æ•°æ®åº“管ç†', +'db': '', +'defines tables': '已定义表', +'delete': '删除', +'delete all checked': '删除所有选择的', +'delete plugin': 'delete plugin', +'Deploy': 'deploy', +'design': '设计', +'direction: ltr': 'direction: ltr', +'done!': 'æžå®š!', +'Edit': '修改', +'edit controller': '修订控制器', +'edit views:': 'edit views:', +'Errors': '错误', +'export as csv file': '导出为CSV文件', +'exposes': '暴露', +'extends': '扩展', +'failed to reload module': '釿–°åŠ è½½æ¨¡å—失败', +'failed to reload module because:': 'failed to reload module because:', +'file "%(filename)s" created': '文件 "%(filename)s" 已创建', +'file "%(filename)s" deleted': '文件 "%(filename)s" 已删除', +'file "%(filename)s" uploaded': '文件 "%(filename)s" 已上传', +'file "%(filename)s" was not deleted': '文件 "%(filename)s" 没删除', +'file "%s" of %s restored': '文件"%s" 有关 %s å·²é‡å­˜', +'file changed on disk': '硬盘上的文件已ç»ä¿®æ”¹', +'file does not exist': '文件并ä¸å­˜åœ¨', +'file saved on %(time)s': '文件ä¿å­˜äºŽ %(time)s', +'file saved on %s': '文件ä¿å­˜åœ¨ %s', +'Help': '帮助', +'htmledit': 'html编辑', +'includes': '包å«', +'insert new': 'æ–°æ’å…¥', +'insert new %s': 'æ–°æ’å…¥ %s', +'Install': 'install', +'internal error': '内部错误', +'invalid password': '无效密ç ', +'invalid request': '无效请求', +'invalid ticket': '无效传票', +'language file "%(filename)s" created/updated': '语言文件 "%(filename)s"被创建/æ›´æ–°', +'languages': '语言', +'languages updated': '语言已被刷新', +'loading...': '载入中...', +'login': '登录', +'Logout': '注销', +'merge': 'åˆå¹¶', +'models': '模型s', +'modules': '模å—s', +'new application "%s" created': '新应用 "%s"已被创建', +'new plugin installed': 'new plugin installed', +'new record inserted': '新记录被æ’å…¥', +'next 100 rows': 'åŽ100行', +'no match': 'no match', +'or import from csv file': '或者,从csv文件导入', +'or provide app url:': 'or provide app url:', +'or provide application url:': '或者,æä¾›åº”用所在地å€é“¾æŽ¥:', +'Overwrite installed app': 'overwrite installed app', +'Pack all': '全部打包', +'Pack compiled': '包编译完', +'pack plugin': 'pack plugin', +'password changed': 'password changed', +'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" deleted', +'previous 100 rows': 'å‰100行', +'record': 'record', +'record does not exist': '记录并ä¸å­˜åœ¨', +'record id': '记录ID', +'Remove compiled': '已移除', +'restore': 'é‡å­˜', +'revert': 'æ¢å¤', +'save': 'ä¿å­˜', +'selected': '已选', +'session expired': '会è¯è¿‡æœŸ', +'shell': '', +'Site': '总站', +'some files could not be removed': '有些文件无法被移除', +'Start wizard': 'start wizard', +'state': '状æ€', +'static': '陿€æ–‡ä»¶', +'submit': 'æäº¤', +'table': '表', +'test': '测试', +'the application logic, each URL path is mapped in one exposed function in the controller': '应用逻辑:æ¯ä¸ªURL由控制器暴露的函å¼å®Œæˆæ˜ å°„', +'the data representation, define database tables and sets': 'æ•°æ®è¡¨è¾¾å¼,定义数æ®åº“/表', +'the presentations layer, views are also known as templates': 'æäº¤å±‚/视图都在模æ¿ä¸­å¯çŸ¥', +'these files are served without processing, your images go here': '', +'to previous version.': 'to previous version.', +'to  previous version.': '退回å‰ä¸€ç‰ˆæœ¬', +'translation strings for the application': '应用的翻译字串', +'try': 'å°è¯•', +'try something like': 'å°è¯•', +'unable to create application "%s"': '无法创建应用 "%s"', +'unable to delete file "%(filename)s"': '无法删除文件 "%(filename)s"', +'unable to delete file plugin "%(plugin)s"': 'unable to delete file plugin "%(plugin)s"', +'unable to parse csv file': 'æ— æ³•ç”Ÿæˆ cvs', +'unable to uninstall "%s"': '无法å¸è½½ "%s"', +'unable to upgrade because "%s"': 'unable to upgrade because "%s"', +'uncheck all': 'å选全部', +'Uninstall': 'å¸è½½', +'update': 'æ›´æ–°', +'update all languages': '更新所有语言', +'upgrade web2py now': 'upgrade web2py now', +'upload application:': 'æäº¤å·²æœ‰çš„应用:', +'upload file:': 'æäº¤æ–‡ä»¶:', +'upload plugin file:': 'upload plugin file:', +'variables': 'variables', +'versioning': '版本', +'view': '视图', +'views': '视图s', +'web2py Recent Tweets': 'twitter上的web2py进展实播', +'web2py is up to date': 'web2pyçŽ°åœ¨å·²ç»æ˜¯æœ€æ–°çš„版本了', +'web2py upgraded; please restart it': 'web2py upgraded; please restart it', +} diff --git a/applications/admin/languages/zh-tw.py b/applications/admin/languages/zh-tw.py new file mode 100644 index 00000000..88ef684a --- /dev/null +++ b/applications/admin/languages/zh-tw.py @@ -0,0 +1,302 @@ +# coding: utf8 +{ +'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"æ›´æ–°" æ˜¯é¸æ“‡æ€§çš„æ¢ä»¶å¼, æ ¼å¼å°±åƒ "欄ä½1=\'值\'". 但是 JOIN 的資料ä¸å¯ä»¥ä½¿ç”¨ update 或是 delete"', +'%Y-%m-%d': '%Y-%m-%d', +'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', +'%s rows deleted': '已刪除 %s ç­†', +'%s rows updated': '已更新 %s ç­†', +'(something like "it-it")': '(æ ¼å¼é¡žä¼¼ "zh-tw")', +'A new version of web2py is available': '新版的 web2py 已發行', +'A new version of web2py is available: %s': '新版的 web2py 已發行: %s', +'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': '注æ„: 登入管ç†å¸³è™Ÿéœ€è¦å®‰å…¨é€£ç·š(HTTPS)或是在本機連線(localhost).', +'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': '注æ„: 因為在測試模å¼ä¸ä¿è­‰å¤šåŸ·è¡Œç·’安全性,也就是說ä¸å¯ä»¥åŒæ™‚執行多個測試案例', +'ATTENTION: you cannot edit the running application!': '注æ„:ä¸å¯ç·¨è¼¯æ­£åœ¨åŸ·è¡Œçš„æ‡‰ç”¨ç¨‹å¼!', +'About': '關於', +'About application': '關於本應用程å¼', +'Admin is disabled because insecure channel': '管ç†åŠŸèƒ½(Admin)在ä¸å®‰å…¨é€£ç·šç’°å¢ƒä¸‹è‡ªå‹•關閉', +'Admin is disabled because unsecure channel': '管ç†åŠŸèƒ½(Admin)在ä¸å®‰å…¨é€£ç·šç’°å¢ƒä¸‹è‡ªå‹•關閉', +'Administrator Password:': '管ç†å“¡å¯†ç¢¼:', +'Are you sure you want to delete file "%s"?': '確定è¦åˆªé™¤æª”案"%s"?', +'Are you sure you want to delete plugin "%s"?': '確定è¦åˆªé™¤æ’ä»¶ "%s"?', +'Are you sure you want to uninstall application "%s"': '確定è¦ç§»é™¤æ‡‰ç”¨ç¨‹å¼ "%s"', +'Are you sure you want to uninstall application "%s"?': '確定è¦ç§»é™¤æ‡‰ç”¨ç¨‹å¼ "%s"', +'Are you sure you want to upgrade web2py now?': '確定ç¾åœ¨è¦å‡ç´š web2py?', +'Authentication': 'é©—è­‰', +'Available databases and tables': 'å¯æä¾›çš„è³‡æ–™åº«å’Œè³‡æ–™è¡¨', +'Cannot be empty': 'ä¸å¯ç©ºç™½', +'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': '無法編譯:應用程å¼ä¸­å«æœ‰éŒ¯èª¤ï¼Œè«‹é™¤éŒ¯å¾Œå†è©¦ä¸€æ¬¡.', +'Cannot compile: there are errors in your app:': '無法編譯: 在你的應用程å¼å­˜åœ¨éŒ¯èª¤:', +'Change Password': '變更密碼', +'Check to delete': '打勾代表刪除', +'Check to delete:': '打勾代表刪除:', +'Checking for upgrades...': '檢查新版本中...', +'Client IP': '客戶端網å€(IP)', +'Controller': '控件', +'Controllers': '控件', +'Copyright': '版權所有', +'Create new simple application': '創建應用程å¼', +'Current request': 'ç›®å‰ç¶²è·¯è³‡æ–™è¦æ±‚(request)', +'Current response': 'ç›®å‰ç¶²è·¯è³‡æ–™å›žæ‡‰(response)', +'Current session': 'ç›®å‰ç¶²è·¯é€£ç·šè³‡è¨Š(session)', +'DB Model': '資料庫模組', +'DESIGN': '設計', +'Database': '資料庫', +'Date and Time': '日期和時間', +'Delete': '刪除', +'Delete:': '刪除:', +'Deploy on Google App Engine': 'é…置到 Google App Engine', +'Description': 'æè¿°', +'Design for': '設計為了', +'E-mail': 'é›»å­éƒµä»¶', +'EDIT': '編輯', +'Edit': '編輯', +'Edit Profile': '編輯設定檔', +'Edit This App': '編輯本應用程å¼', +'Edit application': '編輯應用程å¼', +'Edit current record': '編輯當å‰ç´€éŒ„', +'Editing Language file': '編輯語言檔案', +'Editing file': '編輯檔案', +'Editing file "%s"': '編輯檔案"%s"', +'Enterprise Web Framework': '伿¥­ç¶²ç«™å¹³å°', +'Error logs for "%(app)s"': '"%(app)s"的錯誤紀錄', +'Exception instance attributes': 'Exception instance attributes', +'First name': 'å', +'Functions with no doctests will result in [passed] tests.': '沒有 doctests çš„å‡½å¼æœƒé¡¯ç¤º [passed].', +'Group ID': '群組編號', +'Hello World': 'å—¨! 世界', +'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.', +'Import/Export': '匯入/匯出', +'Index': '索引', +'Installed applications': 'å·²å®‰è£æ‡‰ç”¨ç¨‹å¼', +'Internal State': '內部狀態', +'Invalid Query': 'ä¸åˆæ³•的查詢', +'Invalid action': 'ä¸åˆæ³•的動作(action)', +'Invalid email': 'ä¸åˆæ³•的電å­éƒµä»¶', +'Language files (static strings) updated': '語言檔已更新', +'Languages': 'å„國語言', +'Last name': 'å§“', +'Last saved on:': '最後儲存時間:', +'Layout': 'ç¶²é é…ç½®', +'License for': '許å¯è­‰', +'Login': '登入', +'Login to the Administrative Interface': '登入到管ç†å“¡ä»‹é¢', +'Logout': '登出', +'Lost Password': '密碼éºå¿˜', +'Main Menu': '主é¸å–®', +'Menu Model': 'é¸å–®æ¨¡çµ„(menu)', +'Models': '資料模組', +'Modules': 'ç¨‹å¼æ¨¡çµ„', +'NO': 'å¦', +'Name': 'åå­—', +'New Record': '新紀錄', +'No databases in this application': '這應用程å¼ä¸å«è³‡æ–™åº«', +'Origin': '原文', +'Original/Translation': '原文/翻譯', +'PAM authenticated user, cannot change password here': 'PAM 授權使用者, 無法在此變更密碼', +'Password': '密碼', +"Password fields don't match": '密碼欄ä¸åŒ¹é…', +'Peeking at file': 'é¸å€‹æ–‡ä»¶', +'Plugin "%s" in application': '在應用程å¼çš„æ’ä»¶ "%s"', +'Plugins': 'æ’ä»¶', +'Powered by': '基於以下技術構建:', +'Query:': '查詢:', +'Record ID': '紀錄編號', +'Register': '註冊', +'Registration key': '註冊金鑰', +'Remember me (for 30 days)': '記ä½å¸³è™Ÿ(30 天)', +'Reset Password key': 'é‡è¨­å¯†ç¢¼', +'Resolve Conflict file': '解決è¡çªæª”案', +'Role': '角色', +'Rows in table': '在資料表è£çš„資料', +'Rows selected': 'ç­†è³‡æ–™è¢«é¸æ“‡', +'Saved file hash:': '檔案雜湊值已紀錄:', +'Static files': 'éœæ…‹æª”案', +'Stylesheet': 'ç¶²é é¢¨æ ¼æª”', +'Submit': '傳é€', +'Sure you want to delete this object?': '確定è¦åˆªé™¤æ­¤ç‰©ä»¶?', +'TM': 'TM', +'Table name': '資料表å稱', +'Testing application': '測試中的應用程å¼', +'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"查詢"æ˜¯ä¸€å€‹åƒ "db.表1.欄ä½1==\'值\'" çš„æ¢ä»¶å¼. 以"db.表1.欄ä½1==db.表2.欄ä½2"æ–¹å¼å‰‡ç›¸ç•¶æ–¼åŸ·è¡Œ JOIN SQL.', +'There are no controllers': '沒有控件(controllers)', +'There are no models': '沒有資料庫模組(models)', +'There are no modules': 'æ²’æœ‰ç¨‹å¼æ¨¡çµ„(modules)', +'There are no static files': 'æ²’æœ‰éœæ…‹æª”案', +'There are no translators, only default language is supported': '沒有翻譯檔,åªæ”¯æ´åŽŸå§‹èªžè¨€', +'There are no views': '沒有視圖', +'This is the %(filename)s template': '這是%(filename)s檔案的樣æ¿(template)', +'Ticket': 'å•題單', +'Timestamp': '時間標記', +'To create a plugin, name a file/folder plugin_[name]': '檔案或目錄å稱以 plugin_開頭來創建æ’ä»¶', +'Unable to check for upgrades': '無法åšå‡ç´šæª¢æŸ¥', +'Unable to download': '無法下載', +'Unable to download app': '無法下載應用程å¼', +'Unable to download app because:': '無法下載應用程å¼å› ç‚º:', +'Unable to download because': '因為下列原因無法下載:', +'Update:': 'æ›´æ–°:', +'Upload & install packed application': '上傳並安è£å·²æ‰“包的應用程å¼', +'Upload existing application': '更新存在的應用程å¼', +'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': '使用下列方å¼ä¾†çµ„åˆæ›´è¤‡é›œçš„æ¢ä»¶å¼, (...)&(...) ä»£è¡¨åŒæ™‚存在的æ¢ä»¶, (...)|(...) 代表擇一的æ¢ä»¶, ~(...)則代表å呿¢ä»¶.', +'User %(id)s Logged-in': '使用者 %(id)s 已登入', +'User %(id)s Registered': '使用者 %(id)s 已註冊', +'User ID': '使用者編號', +'Verify Password': '驗證密碼', +'Version': '版本', +'View': '視圖', +'Views': '視圖', +'Welcome %s': '歡迎 %s', +'Welcome to web2py': '歡迎使用 web2py', +'YES': '是', +'About': '關於', +'additional code for your application': '應用程å¼é¡å¤–的程å¼ç¢¼', +'admin disabled because no admin password': '管ç†ä»‹é¢é—œé–‰åŽŸå› æ˜¯æ²’æœ‰è¨­å®šç®¡ç†å“¡å¯†ç¢¼ ', +'admin disabled because not supported on google app engine': '管ç†ä»‹é¢é—œé–‰åŽŸå› æ˜¯ä¸æ”¯æ´åœ¨google apps engine環境下é‹ä½œ', +'admin disabled because unable to access password file': '管ç†ä»‹é¢é—œé–‰åŽŸå› æ˜¯ç„¡æ³•å­˜å–密碼檔', +'amy_ajax': 'amy_ajax', +'and rename it (required):': 'åŒæ™‚æ›´å為(å¿…è¦çš„):', +'and rename it:': 'åŒæ™‚æ›´å為:', +'appadmin': '應用程å¼ç®¡ç†å“¡', +'appadmin is disabled because insecure channel': '管ç†ä»‹é¢é—œé–‰ç†ç”±æ˜¯é€£ç·šæ–¹å¼ä¸å®‰å…¨', +'application "%s" uninstalled': 'å·²ç§»é™¤æ‡‰ç”¨ç¨‹å¼ "%s"', +'application compiled': '已編譯應用程å¼', +'application is compiled and cannot be designed': '應用程å¼å·²ç¶“ç·¨è­¯ç„¡æ³•é‡æ–°è¨­è¨ˆ', +'arguments': 'arguments', +'back': '回復(back)', +'cache': 'å¿«å–記憶體', +'cache, errors and sessions cleaned': 'å¿«å–記憶體,錯誤紀錄,連線紀錄已清除', +'cannot create file': '無法創建檔案', +'cannot upload file "%(filename)s"': '無法上傳檔案 "%(filename)s"', +'Change admin password': 'change admin password', +'change_password': '變更密碼', +'check all': 'å…¨é¸', +'Clean': '清除', +'click here for online examples': '點此處進入線上範例', +'click here for the administrative interface': '點此處進入管ç†ä»‹é¢', +'click to check for upgrades': '點擊打勾以便å‡ç´š', +'code': 'code', +'Compile': '編譯', +'compiled application removed': '已移除已編譯的應用程å¼', +'controllers': '控件', +'Create': '創建', +'create file with filename:': '創建檔案:', +'create new application:': '創建新應用程å¼:', +'created by': '創建自', +'crontab': '定時執行表', +'currently saved or': 'ç¾åœ¨å­˜æª”或', +'customize me!': '請調整我!', +'data uploaded': '資料已上傳', +'database': '資料庫', +'database %s select': '已鏿“‡ %s 資料庫', +'database administration': '資料庫管ç†', +'db': 'db', +'defines tables': '定義資料表', +'delete': '刪除', +'delete all checked': 'åˆªé™¤æ‰€æœ‰å·²é¸æ“‡é …ç›®', +'delete plugin': '刪除æ’ä»¶', +'delete_plugin': '刪除æ’ä»¶', +'design': '設計', +'direction: ltr': 'direction: ltr', +'done!': '完æˆ!', +'Edit': '編輯', +'edit controller': '編輯控件', +'edit views:': '編輯視圖', +'edit_language': '編輯語言檔', +'Errors': '錯誤紀錄', +'export as csv file': '以逗號分隔檔(csv)æ ¼å¼åŒ¯å‡º', +'exposes': '外顯', +'extends': '擴展', +'failed to reload module because:': 'å› ç‚ºä¸‹åˆ—åŽŸå› ç„¡æ³•é‡æ–°è¼‰å…¥ç¨‹å¼æ¨¡çµ„:', +'file "%(filename)s" created': '檔案 "%(filename)s" 已創建', +'file "%(filename)s" deleted': '檔案 "%(filename)s" 已刪除', +'file "%(filename)s" uploaded': '檔案 "%(filename)s" 已上傳', +'file "%s" of %s restored': '檔案 %s çš„ "%s" 已回存', +'file changed on disk': '在ç£ç¢Ÿä¸Šæª”案已改變', +'file does not exist': '檔案ä¸å­˜åœ¨', +'file saved on %(time)s': '檔案已於 %(time)s 儲存', +'file saved on %s': '檔案在 %s 已儲存', +'Help': '說明檔', +'htmledit': 'html編輯', +'includes': '包å«', +'index': '索引', +'insert new': 'æ’入新資料', +'insert new %s': 'æ’入新資料 %s', +'Install': '安è£', +'internal error': '內部錯誤', +'invalid password': '密碼錯誤', +'invalid request': 'ä¸åˆæ³•çš„ç¶²è·¯è¦æ±‚(request)', +'invalid ticket': 'ä¸åˆæ³•çš„å•題單號', +'language file "%(filename)s" created/updated': '語言檔"%(filename)s"已創建或更新', +'languages': '語言檔', +'loading...': '載入中...', +'login': '登入', +'Logout': '登出', +'merge': 'åˆä½µ', +'models': '資料庫模組', +'modules': 'ç¨‹å¼æ¨¡çµ„', +'new application "%s" created': 'å·²å‰µå»ºæ–°çš„æ‡‰ç”¨ç¨‹å¼ "%s"', +'new plugin installed': 'å·²å®‰è£æ–°æ’ä»¶', +'new record inserted': '已新增新紀錄', +'next 100 rows': '往後 100 ç­†', +'no match': '無法匹é…', +'or import from csv file': '或是從逗號分隔檔(CSV)匯入', +'or provide app url:': '或是æä¾›æ‡‰ç”¨ç¨‹å¼çš„安è£ç¶²å€:', +'Overwrite installed app': '覆蓋已安è£çš„æ‡‰ç”¨ç¨‹å¼', +'Pack all': '全部打包', +'Pack compiled': '打包已編譯資料', +'pack plugin': '打包æ’ä»¶', +'password changed': '密碼已變更', +'peek': 'é¸å–', +'plugin': 'æ’ä»¶', +'plugin "%(plugin)s" deleted': '已刪除æ’ä»¶"%(plugin)s"', +'previous 100 rows': 'å¾€å‰ 100 ç­†', +'record': '紀錄', +'record does not exist': '紀錄ä¸å­˜åœ¨', +'record id': '紀錄編號', +'register': '註冊', +'Remove compiled': '編譯檔案已移除', +'resolve': '解決', +'restore': '回存', +'revert': 'å呿¢å¾©', +'save': '儲存', +'selected': '已鏿“‡', +'session expired': '連線(session)å·²éŽæ™‚', +'shell': '命令列æ“作介é¢', +'Site': '網站', +'some files could not be removed': '部份檔案無法移除', +'state': '狀態', +'static': 'éœæ…‹æª”案', +'submit': '傳é€', +'table': '資料表', +'test': '測試', +'the application logic, each URL path is mapped in one exposed function in the controller': '應用程å¼é‚輯 - æ¯å€‹ç¶²å€è·¯å¾‘å°æ‡‰åˆ°ä¸€å€‹æŽ§ä»¶çš„函å¼', +'the data representation, define database tables and sets': '資料展ç¾å±¤ - 用來定義資料表和集åˆ', +'the presentations layer, views are also known as templates': '外觀展ç¾å±¤ - 視圖有時也被稱為樣æ¿', +'these files are served without processing, your images go here': '這些檔案ä¿ç•™æœªç¶“處ç†,ä½ çš„å½±åƒæª”在此', +'ticket': 'å•題單', +'to previous version.': '到å‰ä¸€å€‹ç‰ˆæœ¬', +'translation strings for the application': '翻譯此應用程å¼çš„字串', +'try': '嘗試', +'try something like': '嘗試如', +'unable to create application "%s"': 'ç„¡æ³•å‰µå»ºæ‡‰ç”¨ç¨‹å¼ "%s"', +'unable to delete file "%(filename)s"': '無法刪除檔案 "%(filename)s"', +'unable to delete file plugin "%(plugin)s"': '無法刪查æ’件檔 "%(plugin)s"', +'unable to parse csv file': '無法解æžé€—號分隔檔(csv)', +'unable to uninstall "%s"': 'ç„¡æ³•ç§»é™¤å®‰è£ "%s"', +'unable to upgrade because "%s"': '無法å‡ç´šå› ç‚º "%s"', +'uncheck all': 'å…¨ä¸é¸', +'Uninstall': '解除安è£', +'update': 'æ›´æ–°', +'update all languages': '將程å¼ä¸­å¾…ç¿»è­¯èªžå¥æ›´æ–°åˆ°æ‰€æœ‰çš„語言檔', +'upgrade web2py now': 'upgrade web2py now', +'upgrade_web2py': 'å‡ç´š web2py', +'upload application:': '上傳應用程å¼:', +'upload file:': '上傳檔案:', +'upload plugin file:': '上傳æ’件檔:', +'variables': 'variables', +'versioning': '版本管ç†', +'view': '視圖', +'views': '視圖', +'web2py Recent Tweets': 'web2py 最近的 Tweets', +'web2py is up to date': 'web2py 已經是最新版', +'web2py upgraded; please restart it': 'å·²å‡ç´š web2py ; è«‹é‡æ–°å•Ÿå‹•', +} diff --git a/applications/admin/models/0.py b/applications/admin/models/0.py new file mode 100644 index 00000000..3ebdc455 --- /dev/null +++ b/applications/admin/models/0.py @@ -0,0 +1,65 @@ +EXPIRATION = 60 * 60 # logout after 60 minutes of inactivity +CHECK_VERSION = True +WEB2PY_URL = 'http://web2py.com' +WEB2PY_VERSION_URL = WEB2PY_URL+'/examples/default/version' + +########################################################################### +# Preferences for EditArea +# the user-interface feature that allows you to edit files in your web +# browser. + +## Default editor +TEXT_EDITOR = 'edit_area' or 'amy' + +### edit_area +# The default font size, measured in 'points'. The value must be an integer > 0 +FONT_SIZE = 10 + +# Displays the editor in full screen mode. The value must be 'true' or 'false' +FULL_SCREEN = 'false' + +# Display a check box under the editor to allow the user to switch +# between the editor and a simple +# HTML text area. The value must be 'true' or 'false' +ALLOW_TOGGLE = 'true' + +# Replaces tab characters with space characters. +# The value can be 'false' (meaning that tabs are not replaced), +# or an integer > 0 that specifies the number of spaces to replace a tab with. +REPLACE_TAB_BY_SPACES = 4 + +# Toggle on/off the code editor instead of textarea on startup +DISPLAY = "onload" or "later" + +# if demo mode is True then admin works readonly and does not require login +DEMO_MODE = False + +# if visible_apps is not empty only listed apps will be accessible +FILTER_APPS = [] + +# To upload on google app engine this has to point to the proper appengine +# config file +import os +# extract google_appengine_x.x.x.zip to web2py root directory +#GAE_APPCFG = os.path.abspath(os.path.join('appcfg.py')) +# extract google_appengine_x.x.x.zip to applications/admin/private/ +GAE_APPCFG = os.path.abspath(os.path.join('/usr/local/bin/appcfg.py')) + +# To use web2py as a teaching tool, set MULTI_USER_MODE to True +MULTI_USER_MODE = False + +# configurable twitterbox, set to None/False to suppress +TWITTER_HASH = "web2py" + +# parameter for downloading LAYOUTS +LAYOUTS_APP = 'http://web2py.com/layouts' +#LAYOUTS_APP = 'http://127.0.0.1:8000/layouts' + + +# parameter for downloading PLUGINS +PLUGINS_APP = 'http://web2py.com/plugins' +#PLUGINS_APP = 'http://127.0.0.1:8000/plugins' + +# set the language +if 'adminLanguage' in request.cookies and not (request.cookies['adminLanguage'] is None): + T.force(request.cookies['adminLanguage'].value) diff --git a/applications/admin/models/0_imports.py b/applications/admin/models/0_imports.py new file mode 100644 index 00000000..a3567914 --- /dev/null +++ b/applications/admin/models/0_imports.py @@ -0,0 +1,26 @@ +import time +import os +import sys +import re +import urllib +import cgi +import difflib +import shutil +import stat +import socket + +from textwrap import dedent + +try: + from mercurial import ui, hg, cmdutil + have_mercurial = True +except ImportError: + have_mercurial = False + +from gluon.utils import md5_hash +from gluon.fileutils import listdir, cleanpath, up +from gluon.fileutils import tar, tar_compiled, untar, fix_newlines +from gluon.languages import findT, update_all_languages +from gluon.myregex import * +from gluon.restricted import * +from gluon.compileapp import compile_application, remove_compiled_application diff --git a/applications/admin/models/access.py b/applications/admin/models/access.py new file mode 100644 index 00000000..f1972e08 --- /dev/null +++ b/applications/admin/models/access.py @@ -0,0 +1,146 @@ +import os, time +from gluon import portalocker +from gluon.admin import apath +from gluon.fileutils import read_file +# ########################################################### +# ## make sure administrator is on localhost or https +# ########################################################### + +http_host = request.env.http_host.split(':')[0] + +if request.env.web2py_runtime_gae: + session_db = DAL('gae') + session.connect(request, response, db=session_db) + hosts = (http_host, ) + +if request.env.http_x_forwarded_for or request.is_https: + session.secure() +elif not request.is_local and not DEMO_MODE: + raise HTTP(200, T('Admin is disabled because insecure channel')) + +try: + _config = {} + port = int(request.env.server_port or 0) + restricted(read_file(apath('../parameters_%i.py' % port, request)), _config) + + if not 'password' in _config or not _config['password']: + raise HTTP(200, T('admin disabled because no admin password')) +except IOError: + import gluon.fileutils + if request.env.web2py_runtime_gae: + if gluon.fileutils.check_credentials(request): + session.authorized = True + session.last_time = time.time() + else: + raise HTTP(200, + T('admin disabled because not supported on google app engine')) + else: + raise HTTP(200, T('admin disabled because unable to access password file')) + + +def verify_password(password): + session.pam_user = None + if DEMO_MODE: + return True + elif not 'password' in _config: + return False + elif _config['password'].startswith('pam_user:'): + session.pam_user = _config['password'][9:].strip() + import gluon.contrib.pam + return gluon.contrib.pam.authenticate(session.pam_user,password) + else: + return _config['password'] == CRYPT()(password)[0] + + +# ########################################################### +# ## handle brute-force login attacks +# ########################################################### + +deny_file = os.path.join(request.folder, 'private', 'hosts.deny') +allowed_number_of_attempts = 5 +expiration_failed_logins = 3600 + +def read_hosts_deny(): + import datetime + hosts = {} + if os.path.exists(deny_file): + hosts = {} + f = open(deny_file, 'r') + portalocker.lock(f, portalocker.LOCK_SH) + for line in f.readlines(): + if not line.strip() or line.startswith('#'): + continue + fields = line.strip().split() + if len(fields) > 2: + hosts[fields[0].strip()] = ( # ip + int(fields[1].strip()), # n attemps + int(fields[2].strip()) # last attempts + ) + portalocker.unlock(f) + f.close() + return hosts + +def write_hosts_deny(denied_hosts): + f = open(deny_file, 'w') + portalocker.lock(f, portalocker.LOCK_EX) + for key, val in denied_hosts.items(): + if time.time()-val[1] < expiration_failed_logins: + line = '%s %s %s\n' % (key, val[0], val[1]) + f.write(line) + portalocker.unlock(f) + f.close() + +def login_record(success=True): + denied_hosts = read_hosts_deny() + val = (0,0) + if success and request.client in denied_hosts: + del denied_hosts[request.client] + elif not success and not request.is_local: + val = denied_hosts.get(request.client,(0,0)) + if time.time()-val[1]= allowed_number_of_attempts: + return val[0] # locked out + time.sleep(2**val[0]) + val = (val[0]+1,int(time.time())) + denied_hosts[request.client] = val + write_hosts_deny(denied_hosts) + return val[0] + + +# ########################################################### +# ## session expiration +# ########################################################### + +t0 = time.time() +if session.authorized: + + if session.last_time and session.last_time < t0 - EXPIRATION: + session.flash = T('session expired') + session.authorized = False + else: + session.last_time = t0 + +if not session.authorized and not \ + (request.controller == 'default' and \ + request.function in ('index','user')): + + if request.env.query_string: + query_string = '?' + request.env.query_string + else: + query_string = '' + + if request.env.web2py_original_uri: + url = request.env.web2py_original_uri + else: + url = request.env.path_info + query_string + redirect(URL(request.application, 'default', 'index', vars=dict(send=url))) +elif session.authorized and \ + request.controller == 'default' and \ + request.function == 'index': + redirect(URL(request.application, 'default', 'site')) + + +if request.controller=='appadmin' and DEMO_MODE: + session.flash = 'Appadmin disabled in demo mode' + redirect(URL('default','sites')) + diff --git a/applications/admin/models/buttons.py b/applications/admin/models/buttons.py new file mode 100644 index 00000000..1c986400 --- /dev/null +++ b/applications/admin/models/buttons.py @@ -0,0 +1,23 @@ +# Template helpers + +import os + +def button(href, label): + return A(SPAN(label),_class='button',_href=href) + +def button_enable(href, app): + if os.path.exists(os.path.join(apath(app,r=request),'DISABLED')): + label = SPAN(T('Enable'),_style='color:red') + else: + label = SPAN(T('Disable'),_style='color:green') + id = 'enable_'+app + return A(label,_class='button',_id=id,callback=href,target=id) + +def sp_button(href, label): + return A(SPAN(label),_class='button special',_href=href) + +def helpicon(): + return IMG(_src=URL('static', 'images/help.png'), _alt='help') + +def searchbox(elementid): + return TAG[''](LABEL(IMG(_src=URL('static', 'images/search.png'), _alt=T('filter')), _class='icon', _for=elementid), ' ', INPUT(_id=elementid, _type='text', _size=12)) diff --git a/applications/admin/models/db.py b/applications/admin/models/db.py new file mode 100644 index 00000000..395d1d21 --- /dev/null +++ b/applications/admin/models/db.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# this file is released under public domain and you can use without limitations + +if MULTI_USER_MODE: + db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB + from gluon.tools import * + mail = Mail() # mailer + auth = Auth(globals(),db) # authentication/authorization + crud = Crud(globals(),db) # for CRUD helpers using auth + service = Service(globals()) # for json, xml, jsonrpc, xmlrpc, amfrpc + plugins = PluginManager() + + mail.settings.server = 'logging' or 'smtp.gmail.com:587' # your SMTP server + mail.settings.sender = 'you@gmail.com' # your email + mail.settings.login = 'username:password' # your credentials or None + + auth.settings.hmac_key = '' # before define_tables() + auth.define_tables() # creates all needed tables + auth.settings.mailer = mail # for user email verification + auth.settings.registration_requires_verification = False + auth.settings.registration_requires_approval = True + auth.messages.verify_email = 'Click on the link http://'+request.env.http_host+URL('default','user',args=['verify_email'])+'/%(key)s to verify your email' + auth.settings.reset_password_requires_verification = True + auth.messages.reset_password = 'Click on the link http://'+request.env.http_host+URL('default','user',args=['reset_password'])+'/%(key)s to reset your password' + + db.define_table('app',Field('name'),Field('owner',db.auth_user)) + +if not session.authorized and MULTI_USER_MODE: + if auth.user and not request.function=='user': + session.authorized = True + elif not request.function=='user': + redirect(URL('default','user/login')) + +def is_manager(): + if not MULTI_USER_MODE: + return True + elif auth.user and auth.user.id==1: + return True + else: + return False diff --git a/applications/admin/models/menu.py b/applications/admin/models/menu.py new file mode 100644 index 00000000..a1e2ca8b --- /dev/null +++ b/applications/admin/models/menu.py @@ -0,0 +1,33 @@ +# ########################################################### +# ## generate menu +# ########################################################### + +_a = request.application +_c = request.controller +_f = request.function +response.title = '%s %s' % (_f, '/'.join(request.args)) +response.subtitle = 'admin' +response.menu = [(T('Site'), _f == 'site', URL(_a,'default','site'))] + +if request.args: + _t = request.args[0] + response.menu.append((T('Edit'), _c == 'default' and _f == 'design', + URL(_a,'default','design',args=_t))) + response.menu.append((T('About'), _c == 'default' and _f == 'about', + URL(_a,'default','about',args=_t))) + response.menu.append((T('Errors'), _c == 'default' and _f == 'errors', + URL(_a,'default','errors',args=_t))) + response.menu.append((T('Versioning'), + _c == 'mercurial' and _f == 'commit', + URL(_a,'mercurial','commit',args=_t))) + +if not session.authorized: + response.menu = [(T('Login'), True, '')] +else: + response.menu.append((T('Logout'), False, + URL(_a,'default',f='logout'))) + +if os.path.exists('applications/examples'): + response.menu.append((T('Help'), False, URL('examples','default','index'))) +else: + response.menu.append((T('Help'), False, 'http://web2py.com/examples')) diff --git a/applications/admin/models/plugin_multiselect.py b/applications/admin/models/plugin_multiselect.py new file mode 100644 index 00000000..0b4c9dcc --- /dev/null +++ b/applications/admin/models/plugin_multiselect.py @@ -0,0 +1,4 @@ +response.files.append(URL('static','plugin_multiselect/jquery.dimensions.js')) +response.files.append(URL('static','plugin_multiselect/jquery.multiselect.js')) +response.files.append(URL('static','plugin_multiselect/jquery.multiselect.css')) +response.files.append(URL('static','plugin_multiselect/start.js')) diff --git a/applications/admin/modules/__init__.py b/applications/admin/modules/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/applications/admin/static/css/anytime.css b/applications/admin/static/css/anytime.css new file mode 100644 index 00000000..90eaf2db --- /dev/null +++ b/applications/admin/static/css/anytime.css @@ -0,0 +1,56 @@ +/* anytimec.css 4.1112H (anytime.css 4.1112H) +Copyright 2008-2010 Andrew M. Andrews III (www.AMA3.com). Some Rights +Reserved. This work licensed under the Creative Commons Attribution- +Noncommercial-Share Alike 3.0 Unported License except in jurisdicitons +for which the license has been ported by Creative Commons International, +where the work is licensed under the applicable ported license instead. +For a copy of the unported license, visit +http://creativecommons.org/licenses/by-nc-sa/3.0/ +or send a letter to Creative Commons, 171 Second Street, Suite 300, +San Francisco, California, 94105, USA. For ported versions of the +license, visit http://creativecommons.org/international/ +Any+Time is a trademark of Andrew M. Andrews III. */ +.AnyTime-pkr * {border:0;font: inherit;font-size: x-small;font-style:normal;font-weight:normal;list-style-type:none;margin:0;padding:0;white-space: nowrap} +.AnyTime-win {background-color:#F0F0F1;border:3px solid #C0C0C0;font:normal normal normal xx-small/normal sans-serif;padding-bottom:0.2em;-moz-border-radius:6px;-webkit-border-radius:6px} +.AnyTime-pkr .AnyTime-cloak {background-color:#D7D7D7;opacity:0.7;filter:alpha(opacity=70)} +.AnyTime-pkr .AnyTime-hdr {background-color:#D0D0D1;color:#606062;font-family:Arial,Helvetica,sans-serif;font-size:medium;font-weight:normal;height:1em;margin:0;padding:0 0 0.4em 0;text-align:center;-moz-border-radius:2px;-webkit-border-radius:2px} +.AnyTime-pkr .AnyTime-x-btn {background-color:#FCFCFF;border:1px solid #F99;color:#FF9F9F;cursor:default;float:right;margin:0.3em;text-align:center;width:1.5em;-moz-border-radius:0.4em;-webkit-border-radius:0.4em} +.AnyTime-pkr .AnyTime-btn {background-color:#FCFCFE;border:1px solid #999;color:#606062;cursor:default;float:left;font-family:Arial,Helvetica,sans-serif;height:1.5em;margin-bottom:1px;margin-right:1px;padding-top:0.1em;-moz-border-radius:0.4em;-webkit-border-radius:0.4em} +.AnyTime-pkr .AnyTime-body {padding:0.5em} +.AnyTime-pkr .AnyTime-date {float:left;padding:0 0.5em} +.AnyTime-pkr .AnyTime-lbl {clear:left;color:#606063;font-family:Arial,Helvetica,sans-serif;font-size:100%;font-weight:normal;font-style:normal;height:1.3em;margin:0;padding:0;text-align:center} +.AnyTime-pkr .AnyTime-yrs {height:2.6em;text-align:center;width:18.6em} +.AnyTime-pkr .AnyTime-yrs-past-btn {width:2.7em} +.AnyTime-pkr .AnyTime-yr-prior-btn, .AnyTime-pkr .AnyTime-yr-cur-btn, .AnyTime-pkr .AnyTime-yr-next-btn {width:3.75em} +.AnyTime-pkr .AnyTime-yrs-ahead-btn {width:2.7em} +.AnyTime-pkr .AnyTime-mons {height:4.8em;text-align:center;width:18.8em} +.AnyTime-pkr .AnyTime-mon-btn {width:2.75em} +.AnyTime-pkr .AnyTime-mon7-btn {clear:left} +.AnyTime-pkr .AnyTime-dom-table {background-color:#F0F0F1;border:1px solid #E3E3E4;border-spacing:1px;width:18.6em} +.AnyTime-pkr th.AnyTime-dow {background-color:#C0C0C1;color:white;font-family:Arial,Helvetica,sans-serif;font-size:95%;font-weight:normal;font-style:normal} +.AnyTime-pkr .AnyTime-dom-btn {float:none;height:1.7em;text-align:right;padding:0 0.5em 0 0} +.AnyTime-pkr .AnyTime-dom-btn-empty {background-color:#F3F3F4;border:1px solid #C0C0c1} +.AnyTime-pkr .AnyTime-time {float:left;padding:0 0 0 1em;text-align:center} +.AnyTime-pkr .AnyTime-hrs {float:left;padding-left:0.5em;padding-right:0.5em;text-align:center;width:7.2em} +.AnyTime-pkr .AnyTime-hrs-am, .AnyTime-pkr .AnyTime-hrs-pm {float:left;width:3.6em} +.AnyTime-pkr .AnyTime-hr-btn {text-align:right;padding-right:0.25em;width:3em; } +.AnyTime-pkr .AnyTime-mins {float:left;padding-left:0.5em;padding-right:0.5em;text-align:center;width:4.7em} +.AnyTime-pkr .AnyTime-mins-tens, .AnyTime-pkr .AnyTime-mins-ones {float:left;width:2.3em} +.AnyTime-pkr .AnyTime-min-ten-btn, .AnyTime-pkr .AnyTime-min-one-btn {float:left;text-align:center;width:2em} +.AnyTime-pkr .AnyTime-min-ten-btn-empty, .AnyTime-pkr .AnyTime-min-one-btn-empty {background-color:#F3F3F4;border:1px solid #C0C0c1} +.AnyTime-pkr .AnyTime-secs {float:left;padding-left:0.5em;padding-right:0.5em;text-align:center;width:4.7em} +.AnyTime-pkr .AnyTime-secs-tens, .AnyTime-pkr .AnyTime-secs-ones {float:left;width:2.3em} +.AnyTime-pkr .AnyTime-sec-ten-btn, .AnyTime-pkr .AnyTime-sec-one-btn {float:left;text-align:center;width:2em} +.AnyTime-pkr .AnyTime-sec-ten-btn-empty, .AnyTime-pkr .AnyTime-sec-one-btn-empty {background-color:#F3F3F4;border:1px solid #C0C0c1} +.AnyTime-pkr .AnyTime-offs {clear:left;float:left;padding-left:0.5em;padding-top:0.5em;text-align:center} +.AnyTime-pkr .AnyTime-off-select-btn {width:1.5em} +.AnyTime-pkr .AnyTime-body-yr-selector {padding:1em; } +.AnyTime-pkr .AnyTime-yr-mil, .AnyTime-pkr .AnyTime-yr-cent, .AnyTime-pkr .AnyTime-yr-dec, .AnyTime-pkr .AnyTime-yr-yr {float:left;width:2.5em} +.AnyTime-pkr .AnyTime-mil-btn, .AnyTime-pkr .AnyTime-cent-btn, .AnyTime-pkr .AnyTime-dec-btn, .AnyTime-pkr .AnyTime-yr-btn {float:left;text-align:center;width:2em} +.AnyTime-pkr .AnyTime-yr-era {float:left;padding-left:1em;width:4.1em} +.AnyTime-pkr .AnyTime-era-btn {text-align:center;width:3em} +.AnyTime-pkr .AnyTime-body-off-selector {margin:0.5em; } +.AnyTime-pkr .AnyTime-off-off-btn {clear:left;padding-left:1em;padding-right:1em;text-align:left} +.AnyTime-pkr .AnyTime-cur-btn {border:1px solid #333334;background-color:#C0C0C1;color:#FCFCFE;font-weight:bold} +.AnyTime-pkr .AnyTime-out-btn {background-color:#F0F0F1;border:1px solid #C0C0c1} +.AnyTime-pkr .AnyTime-focus-btn {border:1px dashed black} \ No newline at end of file diff --git a/applications/admin/static/css/jqueryMultiSelect.css b/applications/admin/static/css/jqueryMultiSelect.css new file mode 100755 index 00000000..6a26b85c --- /dev/null +++ b/applications/admin/static/css/jqueryMultiSelect.css @@ -0,0 +1,47 @@ +.multiSelect { + width: 200px; + border: solid 1px #BBB; + background: #FFF right center no-repeat; + padding: 2px 4px; + padding-right: 20px; + display: inline; +} + +.multiSelect.hover { + background: right center no-repeat; +} + +.multiSelect.active, +.multiSelect.focus { + border: inset 1px #000; +} + +.multiSelect.active { + background: right center no-repeat; +} + +.multiSelectOptions { + width: 500px; + max-height: 150px; + margin-top: -1px; + overflow: auto; + border: solid 1px #B2B2B2; + background: #FFF; +} + +.multiSelectOptions LABEL { + padding: 2px 5px; + display: block; +} + +.multiSelectOptions LABEL.checked { + background: #E6E6E6; +} + +.multiSelectOptions LABEL.selectAll { + border-bottom: dotted 1px #CCC; +} + +.multiSelectOptions LABEL.hover { + background: #CFCFCF; +} \ No newline at end of file diff --git a/applications/admin/static/css/styles.css b/applications/admin/static/css/styles.css new file mode 100644 index 00000000..f7a562ed --- /dev/null +++ b/applications/admin/static/css/styles.css @@ -0,0 +1,1065 @@ +/** +* cSans v0.6.3 +* 2009 Copyright A navalla suíza http://anavallasuiza.com +* cSans is released under the GNU Affero GPL version 3 - more information at http://www.fsf.org/licensing/licenses/agpl-3.0.html +*/ + +/* 1. RESET */ +html,body,div,span,object,iframe, +h1,h2,h3,h4,h5,h6,p,blockquote,pre, +a,abbr,acronym,address,code, +del,dfn,em,img,q,dl,dt,dd,ol,ul,li, +fieldset,form,label,legend,textarea, +table,caption,tbody,tfoot,thead,tr,th,td { + margin:0; + padding:0; + border:0; +} +textarea,select,input { font-size:1em; } +html,body { height:100%; } +body { + font-family:Arial,Helvetica,"Liberation Sans",Sans,sans-serif; + font-size: 12pt; + line-height:1.25em; + text-align:center; + background:#fff; + color:#000; +} +.page,.expanded-page { text-align:left; } + +/* 2. DEBUG: Show borders to stress an element */ +.omg-red,.omg-yellow,.omg-blue,.omg-green,.omg-black,.omg-white { + border-top:dotted 3px; + border-bottom:dotted 3px; +} +.omg-red { border-color:red; } +.omg-yellow { border-color:yellow; } +.omg-blue { border-color:blue; } +.omg-green { border-color:green; } +.omg-black { border-color:black; } +.omg-white { border-color:white; } + +/* 3. BASIC STYLES */ +/* 3.1. Titles */ +h1,h2,h3,h4,h5,h6 { + font-weight:bold; + line-height:1em; + margin:1em 0 0.5em 0; +} +h1 { font-size:2em; } +h2 { font-size:1.75em; } +h3 { font-size:1.5em; } +h4 { font-size:1.125em; } +h5 { font-size:1em; } +h6 { font-size:1em; font-weight:normal; } + +/* 3.2. Lists */ +ul,dd { margin-left:1em; } +ol { list-style-type:decimal; margin-left:1.5em; } +dl dt { font-weight:bold; } + +/* 3.3. Tables */ +table { border-collapse:collapse; border-spacing:0; } +caption,th { font-weight:bold; } +th,td { text-align:left; padding:0; border:1px solid #ccc; } +tfoot { font-style:italic; } + +/* 3.4. Images */ +a img { border:none; } +img.right { margin-left:1em; } +img.left { margin-right:1em; } + +/* 3.5. Forms */ +fieldset { border:1px solid #ccc; } +legend { font-weight:bold; font-size:1.2em; } +input { margin:0; } +input.text,input.password { overflow-y:visible; } +textarea { width:400px; height:100px; border:1px solid #ccc; overflow-y: auto; } +select { margin:0; font-size:1em; } +input,textarea,select { font-family:Arial,sans-serif; font-size: 1em; } + +/* 3.6. Monospace elements */ +pre,code,tt { font-family:"Courier New", Courier, monospace; line-height:1.5; } +pre,code { white-space:pre; } +tt { display:block; line-height:1.5; } + +/* 3.7. Block elements */ +p,form,table,address,blockquote,pre,code,tt,ul,ol,dl { margin-bottom:1em; } + +/* 3.8. Inline elements */ +em,dfn { font-style:italic; } + +/* 3.9. HR element */ +hr { + background:none; + visibility:hidden; + clear:both; + float:none; + width:100%; + height:1px; + border:none; + margin:-1px 0; +} + +/* 3.10. Flash objects */ +object { outline:none; } + +/* 4. UTILS */ +/* 4.1. Images with link and without link must overwrite background, width and height properties in your css */ +.image a,.image li,.image { + background-repeat:no-repeat; + background-color:transparent; + margin:0; + padding:0; + outline:none; + font-size:0px !important; + line-height:0em !important; + letter-spacing:-20px; + text-indent: -2px; + display:block; + overflow:hidden; + text-align:left; + border: none; +} +.image a { + display:block; + width:100%; + height:100%; + height:inherit; +} +ol.image,ul.image { + background:none; + width:100%; + height:auto; + float:left; +} +.image li { + float:left; +} +span.image,strong.image,em.image,a.image { + display:inline-block; + vertical-align:bottom; +} +input.image { cursor:pointer; } + +/* 4.2. Simple tabs system. You can overwrite background and text styles */ +.tabs { + list-style:none; + padding:0; + margin:0; + float:left; + width:100%; +} +.tabs li { + float:left; + margin:0 1px 0 0; +} +.tabs li span, +.tabs li a { + float: left; + padding:2px 5px; + white-space:nowrap; + text-align:center; + cursor:pointer; + outline:0; + text-decoration:none; +} +.tabs li span { cursor:default; } +.tabs .select a,.tabs a:hover { + background:#ddd; +} + +/* 4.3. Convert a block element (like a fieldset) into a inline element */ +.inline { + border:none; + margin:0; + padding:0; + display:inline; +} +fieldset.inline { + display:block; + float:left; + width: 100%; +} + +/* 4.4. Inline-block element must content any element inside (div, p, etc) for the correct visualization in FF<3 */ +.inline-block-top,.inline-block-middle,.inline-block-bottom { + float:none !important; + display:inline-block; +} +.inline-block-top { vertical-align:top !important; } +.inline-block-middle { vertical-align:middle !important; } +.inline-block-bottom { vertical-align:bottom !important; } + +/* 4.5. Float elements */ +.left { float:left !important; } +.right,.right-right { float:right !important; } +.right-right { text-align:right !important; } +.right-full { width:100%; text-align:right !important; } + +/* 4.6. Clear */ +.clear,.content,.page,.expanded-page { display:block; } +.clear:after,.tabs:after,.content:after,.page:after,.expanded-page:after { + content:" "; + display:block; + height:0; + clear:both; + visibility:hidden; + font-size:0; +} + +/* 4.7. Destroy margin collapse */ +.no-collapse { padding-top:1px; } + +/* 4.8. Hide an element */ +.hide { display:none; } + +/* 5. LAYOUT */ +/* 5.1. Row */ +.row { + float:left; + width:100%; + margin:0; + padding:0; + border:none; +} + +/* 5.2. Last column in a row */ +.last { margin-right:0 !important; } + +/* 5.3. Content */ +.content { + padding:0; + margin:0; +} + +/* 6. HACKS */ +img { -ms-interpolation-mode:bicubic; } /* IE */ +.clear,.tabs,.content,.page,.expanded-page { + *overflow-y:auto; /* IE7 */ + *overflow-x:hidden; /* IE7 */ + _height:1%; /* IE6 */ + _overflow-y:visible; /* IE6 */ + _overflow-x:visible; /* IE6 */ +} +a.image,span.image,strong.image,em.image,.inline-block-top,.inline-block-middle,.inline-block-bottom { + display:-moz-inline-box; /* FF<3 */ + -moz-box-orient:vertical; /* FF<3 */ + *display:inline; /* IE */ +} + +/** +* cSans Button plugin v0.3.1 +* 2009 Copyright A navalla suíza http://anavallasuiza.com +* cSans is released under the GNU Affero GPL version 3 - more information at http://www.fsf.org/licensing/licenses/agpl-3.0.html +*/ + +/* 1. BASIC STYLES */ + +ul.button { + list-style: none; + padding: 0; + margin: 0; + display:block; + } +ul.button { + overflow-y: auto; + overflow-x: hidden; + } +ul.button li { + float: left; + margin: 0; + } +ul.button li a { + display: block; + z-index: 2; + } +a.button { + display: inline-block; + vertical-align: middle; + } + +/* 1.1. Normal status */ +a.button, +ul.button li a { + background-position: 100% 0; + background-repeat: no-repeat; + white-space: nowrap; + text-align: center; + cursor: pointer; + outline: 0; + } +a.button span, +ul.button li a span { + display: block; + background-position: 0 0; + background-repeat: no-repeat; + } + +/* 1.2. Hover/selected status */ +a.button:hover, +a.button.select, +ul.button li a:hover, +ul.button li.select a { + background-position: 100% -70px !important; + } +a.button:hover span, +a.button.select span, +ul.button li a:hover span, +ul.button li.select a span { + background-position: 0 -70px !important; + } + +/* 2. EDITABLE STYLES */ + +/* 2.1. Image background used */ +a.button, +.button a, +.button span { + background-image: url(../images/button.png); + } + +/* 2.2. Normal status (Example for padding 10px) */ +a.button, +.button a { + padding: 0 10px 0 0; /* Padding-right: 10px */ + margin: 0 1px 0 10px; /* Margin-left: 10px */ + text-decoration: none; + } +.button span { + padding: 4px 0 6px 10px; /*Padding-left: 10px */ + margin: 0 0 0 -10px; /* Margin-left: -10px */ + } + +/* 3. HACKS */ + +ul.button { + _height: 1%; /* IE6 */ + _overflow-y: visible; /* IE6 */ + _overflow-x: visible; /* IE6 */ + } +a.button span { + _float: left; /* Only IE6 */ + _position: relative; /* Only IE6 */ + } +a.button { + display: -moz-inline-box; /* FF<3 */ + display: inline-block; /* FF<3 */ + -moz-box-orient: vertical; /* FF<3 */ + *display: inline; /* IE */ + } + +/** +* cSans Tooltip pluging v0.1 +* 2009 Copyright A navalla suíza http://anavallasuiza.com +* cSans is released under the GNU Affero GPL version 3 - more information at http://www.fsf.org/licensing/licenses/agpl-3.0.html +*/ + +/* BASIC STYLES */ + +.tooltip:hover { + background:transparent; + text-decoration:none; + } +.tooltip span { + display:none; + padding:5px; + margin-left:10px; + width:150px; + } +.tooltip:hover span { + cursor: default; + display:inline; + position:absolute; + } + +/** +* cSans Flexible v0.1 +* 2009 Copyright A navalla suíza http://anavallasuiza.com +* cSans is released under the GNU Affero GPL version 3 - more information at http://www.fsf.org/licensing/licenses/agpl-3.0.html +*/ + +/* 1. BASIC STYLES */ +/* 1.1 Widths */ +.f10 { width:10%; } +.f20 { width:20%; } +.f25 { width:25%; } +.f30 { width:30%; } +.f33 { width:33.33%; } +.f40 { width:40%; } +.f50 { width:50%; } +.f60 { width:60%; } +.f66 { width:66.66%; } +.f70 { width:70%; } +.f75 { width:75%; } +.f80 { width:80%; } +.f90 { width:90%; } +.f100 { width:100%; } + +.f10,.f20,.f25,.f30,.f33,.f40,.f50,.f60,.f66,.f70,.f75,.f80,.f90,.f100 { + float:left; + overflow:hidden; +} + +/* 1.2 Margin-left */ +.fl10 { margin-left:10%; } +.fl20 { margin-left:20%; } +.fl25 { margin-left:25%; } +.fl30 { margin-left:30%; } +.fl33 { margin-left:33.33%; } +.fl40 { margin-left:40%; } +.fl50 { margin-left:50%; } +.fl60 { margin-left:60%; } +.fl66 { margin-left:66.66%; } +.fl70 { margin-left:70%; } +.fl75 { margin-left:75%; } +.fl80 { margin-left:80%; } +.fl90 { margin-left:90%; } +.fl100 { margin-left:100%; } + +/* 1.3 Margin-right */ +.fr10 { margin-right:10%; } +.fr20 { margin-right:20%; } +.fr25 { margin-right:25%; } +.fr30 { margin-right:30%; } +.fr33 { margin-right:33.33%; } +.fr40 { margin-right:40%; } +.fr50 { margin-right:50%; } +.fr60 { margin-right:60%; } +.fr66 { margin-right:66.66%; } +.fr70 { margin-right:70%; } +.fr75 { margin-right:75%; } +.fr80 { margin-right:80%; } +.fr90 { margin-right:90%; } +.fr100 { margin-right:100%; } + +/* 2. HACKS */ +.f10,.f20,.f25,.f30,.f33,.f40,.f50,.f60,.f66,.f70,.f75,.f80,.f90,.f100 { + _display:inline; /* IE5-6 */ + *margin-left:-1px; /* IE5-7 */ +} + +/** +* web2py Nuovo Theme +* ------------------ +**/ + +/* Basics */ + +html, body { + font-size: 13px; + text-align: left; + color: #333; + padding: 0; + margin: 0; + background: #fff url(../images/header_shadow.png) repeat-x left 33px; +} + +a { + color: #e8953c; + text-decoration: none; +} + +label { + color: #777; + font-weight: bold; + font-size: 100%; +} + +img { + vertical-align: baseline; +} + +td, th { + border: none; +} + +.center { + text-align: center; +} + +.centerblock { + margin: 0 auto; +} + +.clear { + clear: both; +} + +.att { + color: #d22; +} + +/* General */ + +h3 { + padding-left: 18px; + background: url(../images/sidebar_bullet.gif) no-repeat; + color: #555; + font-weight: normal; + font-size: 130%; +} + +.formfield { + padding: 0.7em 0.5em; + -moz-border-radius: 0.3em; + border-radius: 0.3em; + margin: 1em 0; + border: 1px solid #ddd; +} + +.buttongroup { + padding: 0.7em 0.5em; +} + +.formfield { + background: #eee; +} + +.flash { + position: fixed; + top: 2em; + right: 2em; + background: #e8953c; + color: #fff; + border: 2px solid #fff; + -moz-border-radius: 0.7em; + border-radius: 0.7em; + padding: 0.5em 1em; +} + +.tooltip span { + background: #9fb364; + color: #eef1d9; + border: 1px solid #eef1d9; + font-style: italic; + width: 20%; + padding: 0.3em; + -moz-border-radius: 0.5em; + border-radius: 0.5em; + font-size: 13px; + text-transform: none; +} + +.help { + width: 60%; + font-size: 1em; + padding: 0.3em; + -moz-border-radius: 0.5em; + border-radius: 0.5em; + background: #eef1d9; + color: #9fb364; + font-style: italic; + text-transform: none; +} + +.help h3 { + color: #9fb364; + font-size: 1.2em; + background: transparent; + font-weight: bold; +} + +.icon img { + vertical-align: middle; + cursor: pointer; +} + +.form td { + padding: 0.2em 1em 0.2em 0; +} + +/* Buttons */ + +.controls a.button, +.controls a.button span { + background-image: url(../images/small_button.png); +} + +.controls a.button span { + padding-top: 2px; +} + +.controls a.button { + color: #333; +} + +.controls a.special, +.controls a.special span { + background-image: url(../images/small_special_button.png); +} + +.controls a.special { + color: #ddd; +} + +/* Header */ + +#header { + background: #292929 url(../images/header_bg.png) repeat-x; + height: 33px; + overflow: hidden; +} + +/* Home button */ + +#start { + position: absolute; + top: 2px; + left: 13px; + margin: 0; +} + +#start a.button { + display: block; +} + +#start a.button, +#start a.button span { + background-image: url(../images/start.png); +} + +#start a { + text-indent: -999px; + overflow: hidden; + padding: 0; + margin: 0; +} + +#start a.button span { + width: 112px; + height: 36px; + padding: 0; + margin: 0; +} + +/* Menu */ + +#menu { + float: right; + margin: 3px 13px 0 0; +} + +#menu li { + float: left; + list-style: none; + margin-right: 0.4em; +} + +#menu a.button, +#menu a.button span { + background-image: url(../images/menu.png); +} + +#menu a.button { + padding-right: 1em; +} + +#menu a.button span { + padding-left: 1em; +} + +#menu a { + color: #333; +} + +/* Main area */ + +#main { + padding: 2em 1em 5em; + position: relative; +} + +#main h2 { + margin-top: 0; + font-weight: normal; + text-transform: uppercase; + border-bottom: 1px dotted #aaa; + padding-left: 18px; + background: transparent url(../images/section_bullet.png) no-repeat left 3px; + color: #aaa; +} + +/* Applist */ + +.applist h3 { + color: #aaa; + font-weight: normal; +} + +.applist ul { + margin: 0; +} + +.applist li { + list-style: none; + padding: 0; +} + +h3.editableapp, +h3.currentapp { + padding: 5px 0 5px 54px; +} + +h3.editableapp { + background: #fff url(../images/folder.png) no-repeat; +} + +h3.currentapp { + background: #fff url(../images/folder_locked.png) no-repeat; +} + +.applist .controls { + margin-left: 1.5em; +} + + +/* Site sidebar */ + +.sidebar_inner { + margin: 0 1em 0; + -moz-border-radius: 0.5em; + border-radius: 0.5em; + border: 1px solid #ddd; + min-width:400px; +} + +.sidebar h4 { + color: #888; +} + +.pwdchange { + padding: 1em; + float: right !important; +} + +.sidebar .box { + clear: right; + margin-top: 2em; + border-top: 1px solid #eee; + padding: 0 1em; +} + +.sidebar .box { + background: url(../images/sidebar_background.jpg) no-repeat; +} + +.sidebar .upgrade_version { + color: #71c837; +} + +/* Tweets */ + +#tweets ol { + margin: 1em 0; +} + +#tweets ol li { + background: #ebe8d0; + list-style: none; + -moz-border-radius: 0.5em; + border-radius: 0.5em; + padding: 0.5em; + margin: 1em 0; + border: 1px solid #aaa; +} + +#tweets .entry-date { + font-weight: bold; + display: block; +} + +/* Design/Plugin page */ + +.component { + cursor: pointer; +} + +.component_contents { + padding-left: 20px; +} + +.component_contents li { + list-style: none; +} + +.component_contents div.comptools { + margin-bottom: 1em; + padding-bottom: 0.5em; +} + +.component_contents div.formfield form { + margin-bottom: 0.2em; + margin-top: 0.2em; +} + +.file { + font-weight: bold; +} + +.folder { + display: block; + padding: 4px 0 4px 40px; + background: url(../images/folder_sm.png) no-repeat; + margin: 0.5em 0; +} + +.folder .file { + font-weight: bold; +} + +.sublist { + margin-left: 0; + border-left: 1px dotted #aaa; + padding-left: 0.5em; + margin-top: 0.5em; + margin-bottom: 0.0em; +} + +/* About */ + +.legalese { + background: #eee url(../images/embossed.png) repeat-y; + padding: 1em 1em 1em 2em; +} + +/* Wizard */ + +.step li { + list-style: none; + margin-left: 1em; + margin-top: 0.5em; +} + +.step #wizard_nav .box { + border-bottom: 1px dotted #aaa; + padding: 0.5em; +} + +.step #wizard_form { + padding: 0.5em 0 2em 2em; +} + +/* Editor */ + +.edit #body { + height: auto; + width: 100%; +} + +.edit .help li { + list-style: none; + padding: 0.5em 0; +} + +.edit .help tt { + font-weight: bold; + font-style: normal; + display: inline; /* Rest cSans base style */ + border: 1px solid #999; + background: #333; + color: #ddd; + padding: 0.3em; + -moz-border-radius: 0.3em; + border-radius: 0.3em; +} + +/* Ticket */ + +ul#snapshot > li { + list-style: none; +} + +.inspect td, +.versions td, +.inspect th, +.versions th { + padding: 0.3em; + // border: 1px solid #aaa; +} + +.inspect th, +.versions th { + background: #ddd; + color: #777; +} + +.ticket h3 { + margin-top: 0.5em; + background: url(../images/ticket_section.png) no-repeat; + padding: 30px; + text-transform: uppercase; +} + + +.ticket .inspect li { + list-style: none; +} + +#frames ul { + margin: 0; +} + +#frames li { + margin: 0.5em 0; + padding: 0; + list-style: none; +} + +/* Errors */ + +.errors table.sortable th { + background: url(../images/header_bg.png) repeat-x; + color: #eee; + // border-right: 1px solid #eee; + padding-top: 0.5em; +} + +.errors table.sortable td { + border-bottom: 1px dotted #ddd; + padding: 0.4em 0.2em; +} + +/* Tests */ + +.test h3.failed { + background-image: url(../images/red_bullet.gif); +} + +.test h3.nodoctests { + background-image: url(../images/dim_bullet.gif); +} + +/* Footer */ + +#footer { + padding: 1em 0 0; + color: #eee; + text-align: center; + background: #292929 url(../images/header_bg.png) repeat-x; + height: 45px; + overflow: hidden; + clear: both; +} + +/* Shell */ + +.shell #wrapper { + margin: 0 auto; +} + +.shell #output { + width: 75%; + height:30em; +} + +.shell #output, +.shell #output pre { + color: #e8953c; + background: white; + border: 1px solid #333; +} + +.shell .prompt, +.shell #output, +.shell pre, +.shell #caret { + font-family: monospace; +} + +.shell .prompt, +.shell #output, +.shell #caret { + font-size: 10pt; + padding: 6px; + padding-right: 0em; +} + +.shell #shellwrapper { + background: white; + border: 1px solid #333; + color: #e8953c; + width: 75%; + // padding: 6px; + // -moz-border-radius: 1em; + // border-radius: 1em; + margin: 1em 0 +} + +.shell #caret { + border: 0; + float: left; +} + +.shell .prompt { + color: #e8953c; + width: 85%; + height: 4em; + border: 0; +} + +.shell .prompt, .shell #output { + overflow: auto; +} + +.shell table, tr, td { + text-align: left; + vertical-align: top; +} + +.shell pre { + border: 0; + padding: 0; + margin: 0; + color: #333333; +} + +.shell .message { + width: 100%; + color: #8AD; + font-weight: bold; + font-style: italic; +} + +.shell .error { + color: #F44; +} + +.shell .username { + font-weight: bold; +} + +.shell dd{ + color: #000033; +} + +.shell dt{ + color: #333333; +} + +.shell #ajax-status { + font-weight: bold; +} + +.shell .processing { + background-image: url('../images/spinner.gif'); +} + +.shell #caret { + width: 2.5em; + margin-right: 0px; + padding-right: 0px; + border-right: 0px; +} + + +/* ie7 hacks */ + +.sublist { + zoom: 1; +} + +.untranslated { background-color: #FFCC00; } +.translated { background-color: white; } +.ui-multiselect { border: 1px solid #ccc; width:400px;} +#editor_area textarea { height: 400px; width: 100% } diff --git a/applications/admin/static/eamy/bundle_markup.js b/applications/admin/static/eamy/bundle_markup.js new file mode 100644 index 00000000..e690eb0d --- /dev/null +++ b/applications/admin/static/eamy/bundle_markup.js @@ -0,0 +1,389 @@ +/* + * eAmy.Offline - Amy Editor embedded for offline use. + * http://www.april-child.com/amy + * + * Published under MIT License. + * Copyright (c) 2007-2008 Petr Krontorád, April-Child.com + + 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. + + * + * + * This file is auto-generated from original Fry Framework and Amy Editor sources.. + */ + + +// Generated from theme definition file. +$class('ac.chap.theme.EAmy < ac.chap.Theme'); + + ac.chap.theme.EAmy.prototype.initDefinition = function() + { +// $call(this, 'ac.chap.Theme.initDefinition');this.cssId = 'black'; +//this.background = '#072240'; +//this.textColor = '#DFEFFF'; +//this.caretColor = 'lime'; +//this.caretRowStyleActive = '#041629'; +//this.selectionStyle = '#86553b'; +//this.colorScheme[ac.chap.TOKEN_MULTIROW_COMMENT] = 'color:#0084FF;font-style:italic'; +//this.colorScheme[ac.chap.TOKEN_SINGLEROW_COMMENT] = 'color:#0084FF;font-style:italic'; +//this.colorScheme[ac.chap.TOKEN_SINGLE_QUOTED] = 'color:#00DF00'; +//this.colorScheme[ac.chap.TOKEN_DOUBLE_QUOTED] = 'color:#00DF00'; +//this.colorScheme[ac.chap.CHUNK_KEYWORD] = 'color:#FF9D00'; +//this.colorScheme[ac.chap.CHUNK_NUMBER] = 'color:#FF5B8C'; +//this.colorScheme[ac.chap.CHUNK_OPERATOR] = 'color:#FF9D00;'; +//this.colorScheme[ac.chap.CHUNK_PARENTHESIS] = 'color:#FFF177'; +//this.colorScheme[ac.chap.CHUNK_KEYWORD_CUSTOM] = 'color:#54FFB8'; +//this.colorScheme[ac.chap.CHUNK_FUNCTION_NAME] = 'color:#FFE000'; +//this.colorScheme[ac.chap.CHUNK_LIBRARY] = 'color:#71E5B6'; +//this.colorScheme[ac.chap.CHUNK_LIBRARY_CUSTOM] = 'color:#FF78E5'; + + $call(this, 'ac.chap.Theme.initDefinition');this.cssId = 'twilight'; +this.background = '#141414'; +this.textColor = '#F8F8F8'; +this.caretColor = '#A7A7A7'; +this.caretRowStyleActive = '#1B1B1B'; +this.selectionStyle = '#3C4043'; +this.colorScheme[ac.chap.TOKEN_MULTIROW_COMMENT] = 'color:#605A60;font-style:italic'; +this.colorScheme[ac.chap.TOKEN_SINGLEROW_COMMENT] = 'color:#605A60;font-style:italic'; +this.colorScheme[ac.chap.TOKEN_SINGLE_QUOTED] = 'color:#8B9F67'; +this.colorScheme[ac.chap.TOKEN_DOUBLE_QUOTED] = 'color:#D4F29E'; +this.colorScheme[ac.chap.CHUNK_KEYWORD] = 'color:#D2A964'; +this.colorScheme[ac.chap.CHUNK_NUMBER] = 'color:#DE6848'; +this.colorScheme[ac.chap.CHUNK_OPERATOR] = 'color:#EFC25A;'; +this.colorScheme[ac.chap.CHUNK_PARENTHESIS] = 'color:#ABC4DC'; +this.colorScheme[ac.chap.CHUNK_KEYWORD_CUSTOM] = 'color:#A0849E'; +this.colorScheme[ac.chap.CHUNK_FUNCTION_NAME] = 'color:#DAD280'; +this.colorScheme[ac.chap.CHUNK_LIBRARY] = 'color:#7286A8'; +this.colorScheme[ac.chap.CHUNK_LIBRARY_CUSTOM] = 'color:#A55C29'; +} + + +// Generated from bundle keymap definition file. +ac.chap.KeyMap.prototype.initDefinition = function() + { + var _ = '\n'; + this.compile + (""+_+ "KEY: 0" ++_+ " insert(character:true)" ++_+ "KEY: -37" ++_+ " caret(move:'left')" ++_+ "KEY: -37+shift" ++_+ " caret(move:'left')" ++_+ " selection(add:true)" ++_+ "KEY: -37+ctrl" ++_+ " caret(move:'prev_regexp', re:'[^|._A-Z ,|(|);]*$')" ++_+ "KEY: -37+alt" ++_+ " caret(move:'prev_word')" ++_+ "KEY: -37+ctrl+shift" ++_+ " caret(move:'prev_regexp', re:'[^|._A-Z ,|(|);]*$')" ++_+ " selection(add:true)" ++_+ "KEY: -37+alt+shift" ++_+ " caret(move:'prev_word')" ++_+ " selection(add:true)" ++_+ "KEY: -37+meta" ++_+ " caret(move:'row_start')" ++_+ "KEY: -37+meta+shift" ++_+ " caret(move:'row_start')" ++_+ " selection(add:true)" ++_+ "KEY: -39" ++_+ " caret(move:'right')" ++_+ "KEY: -39+shift" ++_+ " caret(move:'right')" ++_+ " selection(add:true)" ++_+ "KEY: -39+ctrl" ++_+ " caret(move:'next_regexp', re:'^[^|._A-Z ,|(|);]*')" ++_+ "KEY: -39+alt" ++_+ " caret(move:'next_word')" ++_+ "KEY: -39+ctrl+shift" ++_+ " caret(move:'next_regexp', re:'^[^|._A-Z ,|(|);]*')" ++_+ " selection(add:true)" ++_+ "KEY: -39+alt+shift" ++_+ " caret(move:'next_word')" ++_+ " selection(add:true)" ++_+ "KEY: -39+meta" ++_+ " caret(move:'row_end')" ++_+ "KEY: -39+meta+shift" ++_+ " caret(move:'row_end')" ++_+ " selection(add:true)" ++_+ "KEY: -38" ++_+ " caret(move:'up')" ++_+ "KEY: -38+shift" ++_+ " caret(move:'up')" ++_+ " selection(add:true)" ++_+ "KEY: -40" ++_+ " caret(move:'down')" ++_+ "KEY: -40+shift" ++_+ " caret(move:'down')" ++_+ " selection(add:true)" ++_+ "KEY: -13" ++_+ " insert(row:true)" ++_+ "KEY: -8" ++_+ " delete(character:true)" ++_+ "KEY: -46" ++_+ " delete(character:false)" ++_+ "KEY: 75+ctrl+shift" ++_+ " delete(row:true)" ++_+ "KEY: -27" ++_+ " custom(action:'WordComplete', direction:true)" ++_+ "KEY: -27+shift" ++_+ " custom(action:'WordComplete', direction:false)" ++_+ "KEY: -9" ++_+ " custom(action:'SnippetComplete')" ++_+ "KEY: 123" ++_+ " custom(action:'AutoComplete', use_selection:true, text:'}')" ++_+ "KEY: 34" ++_+ " custom(action:'AutoComplete', use_selection:true, text:'\"')" ++_+ "KEY: 91" ++_+ " custom(action:'AutoComplete', use_selection:true, text:']')" ++_+ "KEY: 40" ++_+ " custom(action:'AutoComplete', use_selection:true, text:')')" ++_+ "KEY: -36" ++_+ " caret(move:'doc_start')" ++_+ "KEY: -36+shift" ++_+ " caret(move:'doc_start')" ++_+ " selection(add:true)" ++_+ "KEY: -35" ++_+ " caret(move:'doc_end')" ++_+ "KEY: -35+shift" ++_+ " caret(move:'doc_end')" ++_+ " selection(add:true)" ++_+ "KEY: -34+meta" ++_+ " caret(move:'page_down')" ++_+ "KEY: -34+meta+shift" ++_+ " caret(move:'page_down')" ++_+ " selection(add:true)" ++_+ "KEY: -33+meta" ++_+ " caret(move:'page_up')" ++_+ "KEY: -33+meta+shift" ++_+ " caret(move:'page_down')" ++_+ " selection(add:true)" ++_+ "KEY: 99+meta" ++_+ " clipboard(copy:true)" ++_+ "KEY: 120+meta" ++_+ " clipboard(cut:true)" ++_+ "KEY: 122+meta" ++_+ " undo()" ++_+ "KEY: 90+meta+shift" ++_+ " redo()" ++_+ "KEY: 97+meta" ++_+ " selection(all:true)" ++_+ "KEY: 97+ctrl" ++_+ " selection(all:true)" ++_+ "KEY: -113" ++_+ " custom(action:'GoToBookmark', direction:1)" ++_+ "KEY: -113+shift" ++_+ " custom(action:'GoToBookmark', direction:-1)" ++_+ "KEY: -113+meta" ++_+ " custom(action:'ToggleBookmark')" ++_+ "KEY: 91+meta" ++_+ " custom(action:'Indent', direction:'left')" ++_+ "KEY: 93+meta" ++_+ " custom(action:'Indent', direction:'right')" ++_+ "KEY: 47+meta" ++_+ " custom(action:'Comment')" ++_+ "KEY: 43+meta" ++_+ " custom(action:'RuntimeOption', key:'font.size', value:'bigger')" ++_+ "KEY: 45+meta" ++_+ " custom(action:'RuntimeOption', key:'font.size', value:'smaller')" ++_+ "KEY: 101+meta" ++_+ " custom(action:'SetSearchKeyword')" ++_+ "KEY: 103+meta" ++_+ " custom(action:'SearchKeyword', direction:'down')" ++_+ "KEY: 71+shift+meta" ++_+ " custom(action:'SearchKeyword', direction:'up')" ++_+ "KEY: 102+ctrl" ++_+ " custom(action:'SearchInteractive')" ++_+ "KEY: 83+ctrl+shift" ++_+ " custom(action:'SearchInteractive')" ++_+ "KEY: 102+meta" ++_+ " custom(action:'SearchInteractive')" ++_+ "KEY: -13" ++_+ " custom(action:'SmartIndent', split_line:true, indent_tab_when_starts:'class module def if else unless rescue ensure while do __class__')" ++_+ "KEY: -13+meta" ++_+ " custom(action:'SmartIndent', split_line:false, indent_tab_when_starts:'class module def if else unless rescue ensure while do __class__')" ++_+ "KEY: 39" ++_+ " custom(action:'AutoComplete', use_selection:true, text:'\\'')" +)}; + +$class('ac.chap.lang.EAmy < ac.chap.Language'); + + ac.chap.lang.EAmy.prototype.initDefinition = function() + { + $call(this, 'ac.chap.Language.initDefinition'); +this.singleQuoteStringMarker = "'"; +this.singleQuoteStringMarkerException = "\\"; +this.doubleQuoteStringMarker = "\""; +this.doubleQuoteStringMarkerException = "\\" +this.wordDelimiter = /[\w\.\d]/; +this.indentIgnoreMarker = /[\.]/; +this.foldingStartMarkers = [/^\s*<(div)\b.*>/i, /^\s*<(ul)\b.*>/i]; +this.foldingParityMarkers = [/^\s*<(div)\b.*>/i, /^\s*<(ul)\b.*>/i]; +this.foldingStopMarkers = [/^\s*<\/(div)>/i, /^\s*<\/(ul)>/i]; +this.singleRowCommentStartMarkers = []; +this.multiRowCommentStartMarker = ""; +this.chunkRules.push([/(([^\w]|^)(\d{1,}[\d\.Ee]*)([^w]|$))/i, 3, ac.chap.CHUNK_NUMBER]) +this.chunkRules.push([/(\+|\-|\*|\/|\=|\!|\^|\%|\||\&|\<|\>)/i, 0, ac.chap.CHUNK_OPERATOR]) +this.chunkRules.push([/(\(|\)|\[|\]|\{|\})/i, 0, ac.chap.CHUNK_PARENTHESIS]) +this.chunkRules.push([/((<|<\/)([\w-_\:]*)([ >]))/i, 3, ac.chap.CHUNK_KEYWORD]) +this.chunkRules.push([/(([ \t])([\w-_\:]*)(=$))/i, 3, ac.chap.CHUNK_KEYWORD_CUSTOM]) +this.chunkRules.push([/(([^\w]|^)(!DOCTYPE)([^\w]|$))/i, 3, ac.chap.CHUNK_LIBRARY]) +this.chunkRules.push([/(([^\w]|^)(\d{1,}[\d\.Ee]*)([^w]|$))/i, 3, ac.chap.CHUNK_NUMBER]) +this.chunkRules.push([/(\+|\-|\*|\/|\=|\!|\^|\%|\||\&|\<|\>)/i, 0, ac.chap.CHUNK_OPERATOR]) +this.chunkRules.push([/(\(|\)|\[|\]|\{|\})/i, 0, ac.chap.CHUNK_PARENTHESIS]) +this.chunkRules.push([/((<|<\/)([\w-_\:]*)([ >]))/i, 3, ac.chap.CHUNK_KEYWORD]) +this.chunkRules.push([/(([ \t])([\w-_\:]*)(=$))/i, 3, ac.chap.CHUNK_KEYWORD_CUSTOM]) +this.chunkRules.push([/(([^\w]|^)(!DOCTYPE)([^\w]|$))/i, 3, ac.chap.CHUNK_LIBRARY]) +} +var snippet = {}; +snippet = {tab_activation: '', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'ie6', code: '$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'iegte7', code: '$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'ie5', code: '$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'ie', code: '$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'ienot', code: '${1:${AMY_SELECTED_TEXT: IE Conditional Comment: NOT Internet Explorer }}$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'ielte6', code: '$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: '$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'ielt6', code: '$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: '${0:${AMY_SELECTED_TEXT/\A(.*)<\/em>\z|.*/(?1:$1:$0<\/em>)/m}}'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: '${0:${AMY_SELECTED_TEXT/\A(.*)<\/strong>\z|.*/(?1:$1:$0<\/strong>)/m}}'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'left', code: '←'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'backtab', code: '⇤'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'enter', code: '⌅'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'arrow', code: '→'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'option', code: '⌥'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'shift', code: '⇧'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: ' '}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'delete', code: '⌦'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'backspace', code: '⌫'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'escape', code: '⎋'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'tab', code: '⇥'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'up', code: '↑'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'control', code: '⌃'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'return', code: '↩'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'down', code: '↓'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'command', code: '⌘'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'doctype', code: '\n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'doctype', code: '\n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'doctypexf', code: '\n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'doctypext', code: '\n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'doctypex', code: '\n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'doctypexs', code: '\n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 't', code: '<{${1:tag_name}}>$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'body', code: '\n $0\n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'textarea', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'div', code: '\n ${0:$AMY_SELECTED_TEXT}\n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: '
'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'title', code: '${1:${AMY_FILENAME/((.+)\..*)?/(?2:$2:Page Title)/}}'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'movie', code: '\n \n \n \n \n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'input', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'head', code: '\n \n ${1:${AMY_FILENAME/((.+)\..*)?/(?2:$2:Page Title)/}}\n $0\n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'meta', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'h1', code: '

${1:$AMY_SELECTED_TEXT}

'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'form', code: '\n $0\n\n

\n'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'link', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'style', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'table', code: '
\n \n \n
${5:Header}
${0:Data}
'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'base', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'scriptsrc', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'mailto', code: '
${3:email me}'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'script', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'c', code: 'class="$1"'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'i', code: 'id="$1"'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'p', code: '{{pass}}'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'ex', code: '{{extend \'${1:layout.html}\'}}'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'for', code: '{{for ${1:bar} in ${2:foo}:}}\n $0\n{{pass}}'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'if', code: '{{if ${1:foo} ${2:==/!=/=>/=/<} ${3:bar}:}}\n $0\n{{pass}}'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '=', code: '{{=$0}}'}; +eamy.snippets.push(snippet); + + diff --git a/applications/admin/static/eamy/bundle_python.js b/applications/admin/static/eamy/bundle_python.js new file mode 100644 index 00000000..f9aa9732 --- /dev/null +++ b/applications/admin/static/eamy/bundle_python.js @@ -0,0 +1,296 @@ +/* + * eAmy.Offline - Amy Editor embedded for offline use. + * http://www.april-child.com/amy + * + * Published under MIT License. + * Copyright (c) 2007-2008 Petr Krontorád, April-Child.com + + 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. + + * + * + * This file is auto-generated from original Fry Framework and Amy Editor sources.. + */ + + +// Generated from theme definition file. +$class('ac.chap.theme.EAmy < ac.chap.Theme'); + + ac.chap.theme.EAmy.prototype.initDefinition = function() + { +// $call(this, 'ac.chap.Theme.initDefinition');this.cssId = 'black'; +//this.background = '#072240'; +//this.textColor = '#DFEFFF'; +//this.caretColor = 'lime'; +//this.caretRowStyleActive = '#041629'; +//this.selectionStyle = '#86553b'; +//this.colorScheme[ac.chap.TOKEN_MULTIROW_COMMENT] = 'color:#0084FF;font-style:italic'; +//this.colorScheme[ac.chap.TOKEN_SINGLEROW_COMMENT] = 'color:#0084FF;font-style:italic'; +//this.colorScheme[ac.chap.TOKEN_SINGLE_QUOTED] = 'color:#00DF00'; +//this.colorScheme[ac.chap.TOKEN_DOUBLE_QUOTED] = 'color:#00DF00'; +//this.colorScheme[ac.chap.CHUNK_KEYWORD] = 'color:#FF9D00'; +//this.colorScheme[ac.chap.CHUNK_NUMBER] = 'color:#FF5B8C'; +//this.colorScheme[ac.chap.CHUNK_OPERATOR] = 'color:#FF9D00;'; +//this.colorScheme[ac.chap.CHUNK_PARENTHESIS] = 'color:#FFF177'; +//this.colorScheme[ac.chap.CHUNK_KEYWORD_CUSTOM] = 'color:#54FFB8'; +//this.colorScheme[ac.chap.CHUNK_FUNCTION_NAME] = 'color:#FFE000'; +//this.colorScheme[ac.chap.CHUNK_LIBRARY] = 'color:#71E5B6'; +//this.colorScheme[ac.chap.CHUNK_LIBRARY_CUSTOM] = 'color:#FF78E5'; +// + $call(this, 'ac.chap.Theme.initDefinition'); +this.cssId = 'twilight'; +this.background = '#141414'; +this.textColor = '#F8F8F8'; +this.caretColor = '#A7A7A7'; +this.caretRowStyleActive = '#1B1B1B'; +this.selectionStyle = '#3C4043'; +this.colorScheme[ac.chap.TOKEN_MULTIROW_COMMENT] = 'color:#605A60;font-style:italic'; +this.colorScheme[ac.chap.TOKEN_SINGLEROW_COMMENT] = 'color:#605A60;font-style:italic'; +this.colorScheme[ac.chap.TOKEN_SINGLE_QUOTED] = 'color:#8B9F67'; +this.colorScheme[ac.chap.TOKEN_DOUBLE_QUOTED] = 'color:#D4F29E'; +this.colorScheme[ac.chap.CHUNK_KEYWORD] = 'color:#D2A964'; +this.colorScheme[ac.chap.CHUNK_NUMBER] = 'color:#DE6848'; +this.colorScheme[ac.chap.CHUNK_OPERATOR] = 'color:#EFC25A;'; +this.colorScheme[ac.chap.CHUNK_PARENTHESIS] = 'color:#ABC4DC'; +this.colorScheme[ac.chap.CHUNK_KEYWORD_CUSTOM] = 'color:#A0849E'; +this.colorScheme[ac.chap.CHUNK_FUNCTION_NAME] = 'color:#DAD280'; +this.colorScheme[ac.chap.CHUNK_LIBRARY] = 'color:#7286A8'; +this.colorScheme[ac.chap.CHUNK_LIBRARY_CUSTOM] = 'color:#A55C29'; +} + + + +// Generated from bundle keymap definition file. +ac.chap.KeyMap.prototype.initDefinition = function() + { + var _ = '\n'; + this.compile + (""+_+ "KEY: 0" ++_+ " insert(character:true)" ++_+ "KEY: -37" ++_+ " caret(move:'left')" ++_+ "KEY: -37+shift" ++_+ " caret(move:'left')" ++_+ " selection(add:true)" ++_+ "KEY: -37+ctrl" ++_+ " caret(move:'prev_regexp', re:'[^|._A-Z ,|(|);]*$')" ++_+ "KEY: -37+alt" ++_+ " caret(move:'prev_word')" ++_+ "KEY: -37+ctrl+shift" ++_+ " caret(move:'prev_regexp', re:'[^|._A-Z ,|(|);]*$')" ++_+ " selection(add:true)" ++_+ "KEY: -37+alt+shift" ++_+ " caret(move:'prev_word')" ++_+ " selection(add:true)" ++_+ "KEY: -37+meta" ++_+ " caret(move:'row_start')" ++_+ "KEY: -37+meta+shift" ++_+ " caret(move:'row_start')" ++_+ " selection(add:true)" ++_+ "KEY: -39" ++_+ " caret(move:'right')" ++_+ "KEY: -39+shift" ++_+ " caret(move:'right')" ++_+ " selection(add:true)" ++_+ "KEY: -39+ctrl" ++_+ " caret(move:'next_regexp', re:'^[^|._A-Z ,|(|);]*')" ++_+ "KEY: -39+alt" ++_+ " caret(move:'next_word')" ++_+ "KEY: -39+ctrl+shift" ++_+ " caret(move:'next_regexp', re:'^[^|._A-Z ,|(|);]*')" ++_+ " selection(add:true)" ++_+ "KEY: -39+alt+shift" ++_+ " caret(move:'next_word')" ++_+ " selection(add:true)" ++_+ "KEY: -39+meta" ++_+ " caret(move:'row_end')" ++_+ "KEY: -39+meta+shift" ++_+ " caret(move:'row_end')" ++_+ " selection(add:true)" ++_+ "KEY: -38" ++_+ " caret(move:'up')" ++_+ "KEY: -38+shift" ++_+ " caret(move:'up')" ++_+ " selection(add:true)" ++_+ "KEY: -40" ++_+ " caret(move:'down')" ++_+ "KEY: -40+shift" ++_+ " caret(move:'down')" ++_+ " selection(add:true)" ++_+ "KEY: -13" ++_+ " insert(row:true)" ++_+ "KEY: -8" ++_+ " delete(character:true)" ++_+ "KEY: -46" ++_+ " delete(character:false)" ++_+ "KEY: 75+ctrl+shift" ++_+ " delete(row:true)" ++_+ "KEY: -27" ++_+ " custom(action:'WordComplete', direction:true)" ++_+ "KEY: -27+shift" ++_+ " custom(action:'WordComplete', direction:false)" ++_+ "KEY: -9" ++_+ " custom(action:'SnippetComplete')" ++_+ "KEY: 123" ++_+ " custom(action:'AutoComplete', use_selection:true, text:'}')" ++_+ "KEY: 34" ++_+ " custom(action:'AutoComplete', use_selection:true, text:'\"')" ++_+ "KEY: 91" ++_+ " custom(action:'AutoComplete', use_selection:true, text:']')" ++_+ "KEY: 40" ++_+ " custom(action:'AutoComplete', use_selection:true, text:')')" ++_+ "KEY: -36" ++_+ " caret(move:'doc_start')" ++_+ "KEY: -36+shift" ++_+ " caret(move:'doc_start')" ++_+ " selection(add:true)" ++_+ "KEY: -35" ++_+ " caret(move:'doc_end')" ++_+ "KEY: -35+shift" ++_+ " caret(move:'doc_end')" ++_+ " selection(add:true)" ++_+ "KEY: -34+meta" ++_+ " caret(move:'page_down')" ++_+ "KEY: -34+meta+shift" ++_+ " caret(move:'page_down')" ++_+ " selection(add:true)" ++_+ "KEY: -33+meta" ++_+ " caret(move:'page_up')" ++_+ "KEY: -33+meta+shift" ++_+ " caret(move:'page_down')" ++_+ " selection(add:true)" ++_+ "KEY: 99+meta" ++_+ " clipboard(copy:true)" ++_+ "KEY: 120+meta" ++_+ " clipboard(cut:true)" ++_+ "KEY: 122+meta" ++_+ " undo()" ++_+ "KEY: 90+meta+shift" ++_+ " redo()" ++_+ "KEY: 97+meta" ++_+ " selection(all:true)" ++_+ "KEY: 97+ctrl" ++_+ " selection(all:true)" ++_+ "KEY: -113" ++_+ " custom(action:'GoToBookmark', direction:1)" ++_+ "KEY: -113+shift" ++_+ " custom(action:'GoToBookmark', direction:-1)" ++_+ "KEY: -113+meta" ++_+ " custom(action:'ToggleBookmark')" ++_+ "KEY: 91+meta" ++_+ " custom(action:'Indent', direction:'left')" ++_+ "KEY: 93+meta" ++_+ " custom(action:'Indent', direction:'right')" ++_+ "KEY: 47+meta" ++_+ " custom(action:'Comment')" ++_+ "KEY: 43+meta" ++_+ " custom(action:'RuntimeOption', key:'font.size', value:'bigger')" ++_+ "KEY: 45+meta" ++_+ " custom(action:'RuntimeOption', key:'font.size', value:'smaller')" ++_+ "KEY: 101+meta" ++_+ " custom(action:'SetSearchKeyword')" ++_+ "KEY: 103+meta" ++_+ " custom(action:'SearchKeyword', direction:'down')" ++_+ "KEY: 71+shift+meta" ++_+ " custom(action:'SearchKeyword', direction:'up')" ++_+ "KEY: 102+ctrl" ++_+ " custom(action:'SearchInteractive')" ++_+ "KEY: 83+ctrl+shift" ++_+ " custom(action:'SearchInteractive')" ++_+ "KEY: 102+meta" ++_+ " custom(action:'SearchInteractive')" ++_+ "KEY: -13" ++_+ " custom(action:'SmartIndent', split_line:true, indent_tab_when_starts:'class module def if else unless rescue ensure while do __class__')" ++_+ "KEY: -13+meta" ++_+ " custom(action:'SmartIndent', split_line:false, indent_tab_when_starts:'class module def if else unless rescue ensure while do __class__')" ++_+ "KEY: 39" ++_+ " custom(action:'AutoComplete', use_selection:true, text:'\\'')" +)}; + +$class('ac.chap.lang.EAmy < ac.chap.Language'); + + ac.chap.lang.EAmy.prototype.initDefinition = function() + { + $call(this, 'ac.chap.Language.initDefinition'); +this.singleQuoteStringMarker = "'"; +this.singleQuoteStringMarkerException = "\\"; +this.doubleQuoteStringMarker = "\""; +this.doubleQuoteStringMarkerException = "\\"; +this.wordDelimiter = /[\w\d]/; +this.indentIgnoreMarker = /[\t \s]/; +this.foldingStartMarkers = [/^\s*def|class/i]; +this.foldingParityMarkers = [/do|(^\s*if)|(^\s*def)|(^\s*class)/i]; +this.foldingStopMarkers = [/^\s{0,1}$/i]; +this.singleRowCommentStartMarkers = ['#']; +this.multiRowCommentStartMarker = "\"\"\""; +this.multiRowCommentEndMarker = "\"\"\""; +this.stringInterpolation = ['(#\{[^\}]*\})', 1]; +this.chunkRules.push([/(([^\w]|^)(\d{1,}[\d\.Ee]*)([^w]|$))/i, 3, ac.chap.CHUNK_NUMBER]) +this.chunkRules.push([/(\+|\-|\*|\/|\=|\!|\^|\%|\||\&|\<|\>)/i, 0, ac.chap.CHUNK_OPERATOR]) +this.chunkRules.push([/(\(|\)|\[|\]|\{|\})/i, 0, ac.chap.CHUNK_PARENTHESIS]) +this.chunkRules.push([/(([^\w]|^)(elif|else|except|finally|for|if|try|while|with)([^\w]|$))/i, 3, ac.chap.CHUNK_KEYWORD]) +this.chunkRules.push([/(([^\w]|^)(@[\w]*|break|continue|pass|raise|return|yield|and|in|is|not|or|as|assert|del|exec|print)([^\w]|$))/i, 3, ac.chap.CHUNK_KEYWORD_CUSTOM]) +this.chunkRules.push([/((def[ ]{1,})([\w]{1,}))/i, 3, ac.chap.CHUNK_FUNCTION_NAME]) +this.chunkRules.push([/(([^\w]|^)(__import__|all|abs|any|apply|callable|chr|cmp|coerce|compile|delattr|dir|divmod|eval|execfile|filter|getattr|globals|hasattr|hash|hex|id|input|intern|isinstance|issubclass|iter|len|locals|map|max|min|oct|ord|pow|range|raw_input|reduce|reload|repr|round|setattr|sorted|sum|unichr|vars|zip|basestring|bool|buffer|classmethod|complex|dict|enumerate|file|float|frozenset|int|list|long|object|open|property|reversed|set|slice|staticmethod|str|super|tuple|type|unicode|xrange)([^\w]|$))/i, 3, ac.chap.CHUNK_LIBRARY]) +this.chunkRules.push([/(([^\w]|^)((__(all|bases|class|debug|dict|doc|file|members|metaclass|methods|name|slots|weakref)__)|(import|from| abs|add|and|call|cmp|coerce|complex|contains|del|delattr|delete|delitem|delslice|div|divmod|enter|eq|exit|float|floordiv|ge|get|getattr|getattribute|getitem|getslice|gt|hash|hex|iadd|iand|idiv|ifloordiv|ilshift|imod|imul|init|int|invert|ior|ipow|irshift|isub|iter|itruediv|ixor|le|len|long|lshift|lt|mod|mul|ne|neg|new|nonzero|oct|or|pos|pow|radd|rand|rdiv|rdivmod|repr|rfloordiv|rlshift|rmod|rmul|ror|rpow|rrshift|rshift|rsub|rtruediv|rxor|set|setattr|setitem|setslice|str|sub|truediv|unicode|xor))([^\w]|$))/i, 3, ac.chap.CHUNK_LIBRARY_CUSTOM]) +} +var snippet = {}; +snippet = {tab_activation: '', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'ifmain', code: 'if __name__ == '+"'"+'__main__'+"'"+':\n ${1:main()}$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'try', code: 'try:\n ${1:pass}\nexcept ${2:Exception}, ${3:e}:\n ${4:raise e}\nelse:\n ${5:pass}'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'property', code: 'def ${1:foo}():\n doc = "${2:The $1 property.}"\n def fget(self):\n ${3:return self._$1}\n def fset(self, value):\n ${4:self._$1 = value}\n def fdel(self):\n ${5:del self._$1}\n return locals()\n$1 = property(**$1())$0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: ''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '__', code: '__${1:init}__'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '.', code: 'self.'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: '', code: ''}; +eamy.snippets.push(snippet); +//snippet = {tab_activation: 'def', code: 'def ${1:fname}(${2:`if [ "$TM_CURRENT_LINE" != "" ]\n # poor man'+"'"+'s way ... check if there is an indent or not\n # (cuz we would have lost the class scope by this point)\n then\n echo "self"\n fi`}):\n ${3/.+/"""/}${3:docstring for $1}${3/.+/"""\n/}${3/.+/\t/}${0:pass}'}; +//eamy.snippets.push(snippet); +snippet = {tab_activation: 'def', code: 'def ${1:fname}(${2:`if [ "$TM_CURRENT_LINE" != "" ]\n # poor man'+"'"+'s way ... check if there is an indent or not\n # (cuz we would have lost the class scope by this point)\n then\n echo "self"\n fi`}):\n ${3:}\n ${0:return dict()}'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'class', code: 'class ${1:ClassName}(${2:object}):\n ${3/.+/"""/}${3:docstring for $1}${3/.+/"""\n/}${3/.+/\t/}def __init__(self${4/([^,])?(.*)/(?1:, )/}${4:arg}):\n ${5:super($1, self).__init__()}\n${4/(\A\s*,\s*\Z)|,?\s*([A-Za-z_][a-zA-Z0-9_]*)\s*(=[^,]*)?(,\s*|$)/(?2:\t\tself.$2 = $2\n)/g} $0'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'aurm', code: '@auth.requires_membership(\'$0\'):'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'dbt', code: '${1:db_name}.define_table("${2:table_name}",\n SQLField("${3:field_name}", "${4:string/text/password/blob/upload/boolean/integer/double/time/date/datetime/db.reference_table}", ${5:length=$6}, ${7:default="$8"}),$9\n)'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'dbf', code: 'SQLField("${1:field_name}", "${2:string/text/password/blob/upload/boolean/integer/double/time/date/datetime/db.reference_table}", ${3:length=$4}, ${5:default="$6"}),$7'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'dbi', code: '${1:db_name}.${2:table_name}.insert(\n ${3:field_name}="$4" $5\n)'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 't', code: 'T("$0")'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'rev', code: 'response.view=\'$0\''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'ref', code: 'response.flash=\'$0\''}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 're', code: 'redirect(\'$0\')'}; +eamy.snippets.push(snippet); +snippet = {tab_activation: 'rej', code: 'response.json=\'$0\''}; +eamy.snippets.push(snippet); diff --git a/applications/admin/static/eamy/chap-bg-sidebar.gif b/applications/admin/static/eamy/chap-bg-sidebar.gif new file mode 100755 index 0000000000000000000000000000000000000000..6bfabdfb25a282dc6db7c72d9810c5075559a7b6 GIT binary patch literal 300 zcmV+{0n`3RNk%w1VPF7|0Du4h=H}+&;^HCs1ONa4001li0001B0FVFx0{@JUsmtvT zqnxzbYk=Oo`wxcVNS5Y_rs}F;?hD8AOe5@#=lag~Tn!8ghs1{Oh)gP%p`!B%jY62z zs`W~eYPZ}V_6rUpyX3N2B2KH-Si^|L?^oICunTc<4f?xOju; z_&CKVIXMDpd3ivoxw(Pq`N$bM`AKRhda78eiig_Dw+j2_Iy)C@TSl9!cFVh^`wP}9 z3YH!-2&`i_b}c w=W(Km&jRD#LXlkyHZW9hH1khPE{w5o>riHzIzcpvb4r7Qv;fPx0uBai0M)lT(*OVf literal 0 HcmV?d00001 diff --git a/applications/admin/static/eamy/chap-folding-expand-inner.gif b/applications/admin/static/eamy/chap-folding-expand-inner.gif new file mode 100755 index 0000000000000000000000000000000000000000..957ee60ad0174ff5a3ea03451f32b2e7e74a377b GIT binary patch literal 119 zcmZ?wbhEHbS5Ex@_4WV!u$PyP{m*9jpULn)pW}bE+~?UD|KHsHAJ6c4UheZd*ZyDI^7z)Z z|49u0KfieP^y&Xy%};Jz`oAju`E8)Phy{v2Sr|cTbwC8jPYi4^4h;egRs{-&7peqG z@Nn@R`EZpXkm*K)lWGhLhs1T&Y9=3^_{N5(hO9jOCluC-rI<0d%~|Ky`zgIdRWzc2 kK_y<+Ks%CKmqCnIQ7JM?%FD+uAjp%!P@dhx*^$8-0C^CL^Z)<= literal 0 HcmV?d00001 diff --git a/applications/admin/static/eamy/chap-folding-start.gif b/applications/admin/static/eamy/chap-folding-start.gif new file mode 100755 index 0000000000000000000000000000000000000000..4395e03e30a3a327149c2add8129d697e93e1ae9 GIT binary patch literal 204 zcmV;-05ktbNk%w1VGIBa0K@_Ssi~=~tgOs4%>V!Y!^6YM%F4jNz|PLj*x1;$wYA#X z+PJv5*4EamtEVvY^t80J?d|RB>+90e(&6FZ zv$M0!&CUD!``g>wA^8LW00062EC2ui01N;O000F^pdbp$;e6wWa6k(r)W|fh+bALw z?EJn6kw9laBu)|mM5To(4j8S1p(QC=0#O2QLwxWK+TF#I=^dsn&7vl)xd8V!Y!^6YM%F4jNz|PLj*x1;$wYA#X z+PJv5*4EamtEVvY^t80J?d|RB>+90e(&6FZ zv$M0!&CUD!``g>wA^8LW00062EC2ui01N;O000F^pg@ddDHK4et_G?u8hZqEka<^4 z%=9x18=Wg)`3)qgR*GR9U{V!CATenUI)R8_QR@aE0)e8jN;Mc^0VT2GAkyiN/g, '' ); +} + +String.prototype.replaceMarkup = function( charRep ) +{ + return this.replace( /(<(.|\n)+?>)/g, function() + { + var t = ''; + for ( var i=0; i/g, '>' ).replace( /' ).replace( /&/g, '&' ); +} + +String.prototype.surround = function(t, side) +{ + side = side || 3; + return (1==1&side?t:'')+this+(2==2&side?t:''); +} + +String.prototype.surroundTag = function(t) +{ + return '<'+t+'>'+this+''; +} + +// example of use: var pattern = '? is ?; alert(pattern.embed('Decin', 'sunny')); pattern = '@city is @weather'; alert(pattern.embed({weather:'cloudy', city:'Decin'})) +String.prototype.embed = function() +{ + var t = this; + if ( 1 == arguments.length && 'object' == typeof arguments[0] ) + { + // named placeholders + for ( var i in arguments[0] ) + { + eval('var re=/@'+i+'/g;'); + t = t.replace(re, arguments[0][i]); + } + } + else + { + // anonymous placeholders `?` + for ( var i=0; i opacity ) + { + opacity = 0; + } + if ( 1 < opacity ) + { + opacity = 1; + } + if ( $__tune.isIE ) + { + node.style.filter = 'alpha(opacity='+(100*opacity)+')'; + } + else + { + node.style.opacity = opacity; + node.style.MozOpacity = opacity; + } + }, + getPageScrollPosition:function() + { + var d = document.documentElement; + if ( d && d.scrollTop) + { + return [d.scrollLeft, d.scrollTop]; + } + else if (document.body) + { + return [document.body.scrollLeft, document.body.scrollTop]; + } + else + { + return [0, 0]; + } + } + }, + event: + { + get:function(evt, type) + { + if ( $notset(evt.target) ) + { + evt.target = evt.srcElement; + evt.stopPropagation = function() + { + window.event.cancelBubble = true; + }; + } + evt.stop = function() + { + evt.stopPropagation(); + evt.stopped = true; + } + evt.$ = $(evt.target); + if ( $notset(evt.pageX) ) + { + evt.pageX = evt.clientX + document.body.scrollLeft; + evt.pageY = evt.clientY + document.body.scrollTop; + } + evt.getOffsetX = function() + { + if ( $notset(evt.offsetX) ) + { + var pos = evt.$.abspos(); + evt.offsetX = evt.pageX - pos.x; + evt.offsetY = evt.pageY - pos.y; + } + return evt.offsetX; + } + evt.getOffsetY = function() + { + if ( $notset(evt.offsetY) ) + { + var pos = evt.$.abspos(); + evt.offsetX = evt.pageX - pos.x; + evt.offsetY = evt.pageY - pos.y; + } + return evt.offsetY; + } + evt.isAnyControlKeyPressed = function() + { + return evt.metaKey||evt.ctrlKey||evt.altKey||evt.shiftKey; + } + evt.KEY_ESCAPE = 27; + evt.KEY_ENTER = 13; + evt.KEY_ARR_RIGHT = 39; + evt.KEY_ARR_LEFT = 37; + evt.KEY_ARR_UP = 38; + evt.KEY_ARR_DOWN = 40; + return evt; + }, + addListener:function(node, type, listener) + { + if ( $__tune.isIE && node.attachEvent ) + { + node.attachEvent('on'+type, listener); + } + else + { + node.addEventListener(type, listener, false); + } + }, + removeListener:function(node, type, listener) + { + if ( node.detachEvent ) + { + node.detachEvent('on'+type, listener); + node['on'+type] = null; + } + else if ( node.removeEventListener ) + { + node.removeEventListener(type, listener, false); + } + } + }, + behavior: + { + disablePageScroll:function() + { + if ( $notset($__tune.__prop.page_scroll) ) + { + $__tune.__prop.page_scroll = [$().s().overflow, $().ga('scroll')]; + } + $().s('overflow:hidden').sa('scroll', 'no'); + }, + enablePageScroll:function() + { + $().s('overflow:auto').sa('scroll', 'yes'); + }, + disableCombos:function() + { + $().g('select', function(node) + { + node.sa('__dis_combo', node.s().visibility); + $(node).v(false); + }); + }, + enableCombos:function() + { + $().g('select', function(node) + { + node.s({visibility:node.ga('__dis_combo') || 'visible'}); + }); + }, + clearSelection:function() + { + try + { + if ( window.getSelection ) + { + if ( $__tune.isSafari ) + { + window.getSelection().collapse(); + } + else + { + window.getSelection().removeAllRanges(); + } + } + else + { + if ( document.selection ) + { + if ( document.selection.empty ) + { + document.selection.empty(); + } + else + { + if ( document.selection.clear ) + { + document.selection.clear(); + } + } + } + } + } + catch (e) {} + }, + makeBodyUnscrollable:function() + { + $().s('position:fixed').w(fry.ui.info.page.width); + } + }, + ui: + { + scrollbarWidth:-1!=navigator.appVersion.indexOf('intosh')?15:17 + }, + selection: + { + setRange:function(el, selectionStart, selectionEnd) + { + if (el.setSelectionRange) + { + el.focus(); + el.setSelectionRange(selectionStart, selectionEnd); + } + else if (el.createTextRange) + { + var range = el.createTextRange(); + range.collapse(true); + range.moveEnd('character', selectionEnd); + range.moveStart('character', selectionStart); + range.select(); + } + } + } +} +// some browsers masks its presence having Gecko string somewhere inside its userAgent field... +$__tune.isGecko = !$__tune.isSafari&&!$__tune.isIE&&-1!=navigator.userAgent.indexOf('ecko'); +$__tune.isSafari2 = $__tune.isSafari && -1 != navigator.appVersion.indexOf('Kit/4'); +$__tune.isSafari3 = $__tune.isSafari && -1 != navigator.appVersion.indexOf('Kit/5'); + + +// Node manipulations + +function ACNode(node) +{ + this.$ = node; + if ( node ) + { + node.setAttribute('fryis', '1'); + } +} +// `$$` creates new node +ACNode.prototype.$$ = function(tagName) +{ + return $$(tagName); +} +// *is* - tells whether node is a part of the active DOM tree (that is displayed on page). Node may exist only in memory before appending or after removing when references, in which case node.is() will return false. +ACNode.prototype.is = function() +{ + return this.$ && null != this.$.parentNode; +} +// *i*d +ACNode.prototype.i = function(id) +{ + if ( 'undefined' == typeof id ) + { + return this.$.id||''; + } + this.$.id = id; + return this; +} +// class *n*ame +ACNode.prototype.n = function(n) +{ + if ( 'undefined' == typeof n) + { + return this.$.className||''; + } + this.$.className = n; + return this; +} +// *e*vent listener, if called with one argument only, previously registered listeners are removed +ACNode.prototype.e = function(t, c, oneUseOnly) +{ + var ser_type_id = 'fryse-'+t; + if ( !c ) + { + if ( null != this.$.getAttribute(ser_type_id) ) + { + var ser_listeners = this.$.getAttribute(ser_type_id).split(','); + // console.log('*E* removing listeners for %s, listeners: %s', t, ser_listeners); + for ( var i=0; i h ) + { + this.$.style.fontSize = '1px'; + } + return this; +} +// *s*tyle information - argument can be either "{color:'red', backgroundColor:'blue'}" or "'color:red;background-color:blue'" +ACNode.prototype.s = function(s) +{ + if ( 'undefined' == typeof s ) + { + return this.$.style; + } + if ( 'object' == typeof s ) + { + for ( var n in s ) + { + this.$.style[n] = s[n]; + } + } + else if ( 'string' == typeof s ) + { + if ( '' != s ) + { + var styles = s.split(';'); + for ( var i=0; idiv>table>tbody>tr>td>` and node at `td` +// to return second div you would call `gp('tr/tbody/table/div')` or `tr/table/div:1`, first div could be acquired using `table/div:2` etc. you can use `*` for any node. +ACNode.prototype.gp = function(q) +{ + if ( 'string' == typeof q ) + { + q = q.split('/'); + } + var fq = []; + for ( var i=0; i to && to>=from ) + { + self.clearInterval(t); + } + else + { + c(i, control); + if ( control.stopped ) + { + self.clearInterval(t); + } + } + i++; + }, interval); +} +// $dotimes +// ======== +// Repeats embedded code n times. +/* Usage: + $dotimes(20, function(i) + { + // your code, i is the counter parameter + }) +*/ +var $dotimes = function(n, c) +{ + for ( var i=0; i i ) + { + control.skip(); + return; + } + tr.n(0==i%2 ? 'even' : 'odd'); + if ( 20 < i ) + { + control.stop(); + } + }) +*/ +var $foreach = function(o, c) +{ + if ( !o ) + { + c = null; + return; + } + if ( 'undefined' == typeof o.length && 'function' != typeof o.__length ) + { + c = null; + return; + } + var n = 'function' == typeof o.__length ? o.__length() : o.length; + var control = + { + stopped:false, + stop:function() + { + this.stopped = true; + }, + skipped:false, + skip:function() + { + this.skipped = true; + }, + removed:false, + remove:function(stopAfterwards) + { + this.removed = true; + this.stopped = true == stopAfterwards; + } + } + // cannot just extend Array.prototype for `item()` method due bug in IE6 iteration mechanism. Some day (>2010 :) this might get fixed and will become obsolete + for ( var i=0; i= evt.keyCode) + { + fry.keyboard.pushKey(evt.keyCode + 32, fry.keyboard.META_KEY); + evt.preventDefault(); + return true; + } + } + } + fry.keyboard.initialized = true; + fry.keyboard.start(); +} + +fry.keyboard.start = function() +{ + fry.keyboard.stopped = false; +} + +fry.keyboard.stop = function() +{ + fry.keyboard.stopped = true; +} + +fry.keyboard.disableTextfieldsEditation = function() +{ + fry.keyboard.allowTextfieldsEditation(true); +} + +fry.keyboard.allowTextfieldsEditation = function(disable) +{ + var lst = document.getElementsByTagName('input'); + var n = lst.length; + for (var i=0; i evt.keyCode)) + { + // control code + mask++; + } + if (!fry.keyboard.pushKey(code, mask)) + { + return true; + } + } + evt.preventDefault(); + evt.stopPropagation(); + return false; +} + +fry.keyboard.paste.ff_mac = function(evt) +{ + fry.keyboard.last_down_evt = null; + // catching Command+C, Command+X, it's a FF.mac hack + if (evt.metaKey && ((67 == evt.keyCode && 0 == evt.charCode && 67 == evt.which) || (88 == evt.keyCode && 0 == evt.charCode && 88 == evt.which))) + { + return fry.keyboard.shared.copy(evt); + } + else + { + return 86 == evt.keyCode && 0 == evt.charCode && 86 == evt.which && evt.metaKey; + } +} + +fry.keyboard.down.ff_mac = function(evt) +{ + return false; +} + +fry.keyboard.press.ff_mac = function(evt) +{ + if (null != fry.keyboard.last_down_evt) + { + return; + } + var mask = (evt.altKey ? 2 : 0) + (evt.ctrlKey ? 4 : 0) + (evt.shiftKey ? 8 : 0) + (evt.metaKey ? 16 : 0); + if (!evt.charCode || (evt.charCode == evt.keyCode)) + { + // control code + fry.keyboard.pushKey(evt.keyCode, 1 + mask); + } + else + { + if (!fry.keyboard.pushKey(evt.charCode, mask)) + { + return true; + } + } + evt.preventDefault(); + evt.stopPropagation(); + return false; +} + +fry.keyboard.paste.webkit = function(evt) +{ + if ($__tune.isMac) + { + return (86 == evt.keyCode && (0 == evt.charCode || 118 == evt.charCode) && evt.metaKey); + } + else + { + return (86 == evt.keyCode && (0 == evt.charCode || 118 == evt.charCode) && evt.ctrlKey); + } +} + +fry.keyboard.down.webkit = function(evt) +{ + if (0 != evt.keyCode && (48 > evt.keyCode || (111 < evt.keyCode && 128 > evt.keyCode) || 60000 < evt.charCode)) + { + var mask = (evt.altKey ? 2 : 0) + (evt.ctrlKey ? 4 : 0) + (evt.shiftKey ? 8 : 0) + (evt.metaKey ? 16 : 0); + if (!evt.charCode || 111 < evt.keyCode || 32 > evt.charCode || 60000 < evt.charCode) + { + // control code + fry.keyboard.pushKey(evt.keyCode, 1 + mask); + } + else + { + if (!fry.keyboard.pushKey(evt.charCode, mask)) + { + return true; + } + } + evt.preventDefault(); + evt.stopPropagation(); + fry.keyboard.last_down_evt = null; + return false; + } + fry.keyboard.last_down_evt = evt; + return true; +} + +fry.keyboard.press.webkit = function(evt) +{ + if (null != fry.keyboard.last_down_evt) + { + var mask = (evt.altKey ? 2 : 0) + (evt.ctrlKey ? 4 : 0) + (evt.shiftKey ? 8 : 0) + (evt.metaKey ? 16 : 0); + var code = !evt.keyCode ? evt.charCode : evt.keyCode; + if (evt.keyCode == evt.charCode && evt.keyCode == fry.keyboard.last_down_evt.charCode && evt.keyCode > 60000) + { + code = fry.keyboard.last_down_evt.keyCode; + } + if (evt.keyCode == fry.keyboard.last_down_evt.keyCode && 48 > evt.keyCode) + { + // control code + mask++; + } + else + { + var r_mask = fry.keyboard.SHIFT_KEY + fry.keyboard.META_KEY; + if (r_mask == (mask & r_mask) && 97 <= code && 122 >= code) + { + code -= 32; + } + } + if (!fry.keyboard.pushKey(code, mask)) + { + return true; + } + } + evt.preventDefault(); + evt.stopPropagation(); + return false; +} + +fry.keyboard.paste.ie = function(evt) +{ + if (evt.ctrlKey && (67 == evt.keyCode || 88 == evt.keyCode)) + { + // ctrl+c, ctrl+x + return fry.keyboard.shared.copy(evt); + } + else + { + return false; + } +} + +fry.keyboard.down.ie = function(evt) +{ + fry.keyboard.last_down_evt = evt; + if (48 > evt.keyCode || (111 < evt.keyCode && 128 > evt.keyCode)) + { + // control code for IE + var mask = 1 + (evt.altKey ? 2 : 0) + (evt.ctrlKey ? 4 : 0) + (evt.shiftKey ? 8 : 0) + (evt.metaKey ? 16 : 0); + return !fry.keyboard.pushKey(evt.keyCode, mask) + } + else + { + var code = evt.keyCode; + // disabling some other keys (A, F, N, R, S, T) + if (82 == evt.keyCode || 65 == evt.keyCode || 83 == evt.keyCode || 70 == evt.keyCode || 78 == evt.keyCode || 84 == evt.keyCode) + { + if (!evt.shiftKey) + { + code += 32; + } + var mask = (evt.altKey ? 2 : 0) + (evt.ctrlKey ? 4 : 0) + (evt.shiftKey ? 8 : 0) + (evt.metaKey ? 16 : 0); + return !fry.keyboard.pushKey(code, mask); + } + } + return true; +} + +fry.keyboard.press.ie = function(evt) +{ + if (null != fry.keyboard.last_down_evt) + { + var mask = (evt.altKey ? 2 : 0) + (evt.ctrlKey ? 4 : 0) + (evt.shiftKey ? 8 : 0) + (evt.metaKey ? 16 : 0); + return !fry.keyboard.pushKey(evt.keyCode, mask); + } + return false; +} + + +fry.keyboard.paste.opera = function(evt) +{ + return 86 == evt.keyCode && 86 == evt.which && evt.ctrlKey; +} + +fry.keyboard.down.opera = function(evt) +{ + fry.keyboard.last_down_evt = evt; + return false; +} + +fry.keyboard.press.opera = function(evt) +{ + var e = fry.keyboard.last_down_evt; + var mask = (evt.altKey ? 2 : 0) + (evt.ctrlKey ? 4 : 0) + (evt.shiftKey ? 8 : 0) + (evt.metaKey ? 16 : 0); + var prev_mask = (e.altKey ? 2 : 0) + (e.ctrlKey ? 4 : 0) + (e.shiftKey ? 8 : 0) + (e.metaKey ? 16 : 0); + if ((evt.keyCode == fry.keyboard.last_down_evt.keyCode || 0 == e.keyCode) && (0 == evt.which || 48 > e.keyCode || 111 < e.keyCode)) + { + mask++; + } + if (!fry.keyboard.pushKey(evt.keyCode, mask)) + { + return true; + } + evt.preventDefault(); + evt.stopPropagation(); + return false; +} + +fry.keyboard.addListener = function(listener) +{ + fry.keyboard.listener = listener; +} + +fry.keyboard.removeListener = function(listener) +{ + fry.keyboard.listener = null; +} + + +fry.keyboard.pushKey = function(code, mask) +{ + if (32 == code) + { + mask = mask & 65534; + } + var was_clipboard_copy = false; + var was_clipboard_cut = false; + if ($__tune.isMac) + { + was_clipboard_copy = (99 == code) && (fry.keyboard.META_KEY == (mask & fry.keyboard.META_KEY)); + was_clipboard_cut = (120 == code) && (fry.keyboard.META_KEY == (mask & fry.keyboard.META_KEY)); + } + else + { + was_clipboard_copy = (1 == code || 99 == code) && (fry.keyboard.CTRL_KEY == (mask & fry.keyboard.CTRL_KEY)); + was_clipboard_cut = (24 == code || 120 == code) && (fry.keyboard.CTRL_KEY == (mask & fry.keyboard.CTRL_KEY)); + } + if (was_clipboard_copy || was_clipboard_cut) + { + fry.keyboard.prepareClipboard(); + fry.keyboard.clipboard.copiedContent = ''; + var was_custom_content = false; + if (fry.keyboard.listener) + { + var content = fry.keyboard.listener(0, fry.keyboard.CONTROL_CODE | fry.keyboard.SIG_CLIPBOARD_GET); + if ('string' == typeof content) + { + was_custom_content = true; + fry.keyboard.clipboard.copiedContent = content; + } + } + if (was_custom_content) + { + fry.keyboard.clipboard.node.value = fry.keyboard.clipboard.copiedContent; + fry.keyboard.clipboard.node.select(); + fry.keyboard.clipboard.node.focus(); + } + fry.keyboard.pushKey(0, fry.keyboard.CONTROL_CODE | (was_clipboard_cut ? fry.keyboard.CUT : fry.keyboard.COPY)); + fry.keyboard.clipboard.content = fry.keyboard.clipboard.copiedContent; + // returning false will enforce propagation + return !was_custom_content; + } + if (fry.keyboard.PASTE == (mask & fry.keyboard.PASTE)) + { + fry.keyboard.clipboard.pastedContent = code; + fry.keyboard.clipboard.content = fry.keyboard.clipboard.pastedContent; + code = 0; + } + // filtering out solo-keys Ctrl, Shift, Alt that are triggered by some browsers. + if ((17 == code && 5 == (mask & 5)) || (16 == code && 9 == (mask & 9)) || (18 == code && 3 == (mask & 3))) + { + return true; + } + // filtering out Command+V on FF.mac + if (118 == code && 16 == mask) + { + return true; + } + if (fry.keyboard.listener) + { + // console.info(code); + if (13 != code && 0 != (mask & (fry.keyboard.CONTROL_CODE + fry.keyboard.META_KEY + fry.keyboard.CTRL_KEY))) + { + // some keystroke occured that we really want to know about the listener result, we have to call it immediatelly + return fry.keyboard.listener(code, mask); + } + else + { + // let's ease the pain of the browser + setTimeout('fry.keyboard.listener('+code+','+mask+')', 10); + } + } + else + { + fry.keyboard.buffer.unshift([code, mask]); + } + return true; +} + +fry.keyboard.popKey = function() +{ + return fry.keyboard.buffer.pop(); +} + +fry.keyboard.getClipboardContent = function() +{ + return fry.keyboard.clipboard.content; +} + + +/*--------*/ +var client = {conf:{fry:{backendURL:''}}}; +var eamy = +{ + snippets:[], + instances:[] +}; + +/* + * ac.Chap - Text Editing Component - Core + */ + +if ( 'undefined' == typeof ac ) +{ + var ac = {chap:{}}; +} + +ac.chap = +{ + state: + { + active:null + }, + + TOKEN_MULTIROW_COMMENT:0, + TOKEN_SINGLEROW_COMMENT:1, + TOKEN_SINGLE_QUOTED:2, + TOKEN_DOUBLE_QUOTED:3, + TOKEN_NEWROW:4, + TOKEN_WHITESPACE:5, + + ROWSTATE_NONE:0, + ROWSTATE_FOLD_START:1, + ROWSTATE_FOLD_STOP:2, + ROWSTATE_FOLD_EXPAND:4, + ROWSTATE_FOLD_COLLAPSED:8, + ROWSTATE_SELECTION:16, + ROWSTATE_BOOKMARK:32, + + CHUNK_KEYWORD:4, + CHUNK_NUMBER:5, + CHUNK_OPERATOR:6, + CHUNK_PARENTHESIS:7, + CHUNK_KEYWORD_CUSTOM:8, + CHUNK_FUNCTION_NAME:9, + CHUNK_LIBRARY:10, + CHUNK_LIBRARY_CUSTOM:11, + + ACTION_CARET:1, + ACTION_SELECTION:2, + ACTION_INSERT:3, + ACTION_UPDATE:4, + ACTION_DELETE:5, + ACTION_CLIPBOARD:6, + ACTION_UNDO:7, + ACTION_REDO:8, + ACTION_CUSTOM:9, + + ACTION_RES_REDRAWCARET:1, + ACTION_RES_REDRAWTEXT:2, + ACTION_RES_SELECTIONCHANGED:4, + ACTION_RES_SCROLLTOCARET:8, + + CKEY_NONE:0, + CKEY_ALT:2, + CKEY_CTRL:4, + CKEY_SHIFT:8, + CKEY_META:16, + + TRANSLOG_TYPE_INSERT:1, + TRANSLOG_TYPE_REMOVE:2, + + ACTION_LISTENER_BEFORE:1, + ACTION_LISTENER_AFTER:2, + ACTION_LISTENER_BOTH:3 + +} + + + +ac.chap.activeComponent = null; +ac.chap.instanceId = 1; + +ac.chap.getActiveComponent = function() +{ + return ac.chap.activeComponent; +} + +ac.chap.setActiveComponent = function(component) +{ + fry.keyboard.initialize(); + if (null != ac.chap.activeComponent) + { + ac.chap.activeComponent.blur(); + } + ac.chap.activeComponent = component; + if (null != component) + { + if (ac.widget) + { + ac.widget.focus(component); + } + ac.chap.activeComponent.focus(); + } + else + { + if (!ac.widget) + { + fry.keyboard.stop(); + } + } +} + +ac.chap.route = function(type, windowId, viewIndex, pars) +{ + if ( null == ac.chap.activeComponent ) + { + return; + } + if ( 'undefined' == typeof ac.chap.activeComponent.views[viewIndex] ) + { + return; + } + switch ( type ) + { + case 'expand-folding': + { + ac.chap.activeComponent.expandFolding(pars); + } + } +} + +ac.chap.caretThread = setInterval(function() +{ + if (null != ac.chap.activeComponent) + { + ac.chap.activeComponent.showCaret(true, true); + } +}, 600); + +$(document.documentElement).e($__tune.isSafari2?'mousedown':'click', function(evt) +{ + var elem = evt.$.$; + while ( null != elem && document.documentElement != elem ) + { + if ( 'true' == elem.getAttribute('chap-view') ) + { + evt.stop(); + return; + } + elem = elem.parentNode; + } + ac.chap.setActiveComponent(null); +}); + + +ac.chap.keyboardListener = function(code, mask) +{ + if (null == ac.chap.activeComponent) + { + return; + } + return ac.chap.activeComponent.standaloneKeyboardListener(code, mask); +} +if ('undefined' == typeof ac['widget']) +{ + // chap is not a part of Fry MVC, must handle keyboardListener itself + fry.keyboard.addListener(ac.chap.keyboardListener); +} + +$class('ac.chap.Window', +{ + construct:function(options, userId) + { + this.instanceId = ac.chap.instanceId++; + this.ident = 'ac-chap-' + this.instanceId; + this.userId = userId | 0; + this.caret = null; + this.options = null; + this.state = null; + + this.views = []; + this.activeView = null; + this.viewLayoutNodes = []; + + this.char_map = []; + this.row_id_map = []; + this.syntax_map = []; + this.style_map = []; + + this.row_id_sequence = 1; + + this.language = null; + this.keymap = null; + this.snippets = []; + this.commands = []; + + this.selection = null; + this.transaction_log = []; + this.redo_log = []; + + this.setOptions(options||{}); + this.setState(); + }, + destruct:function() + { + $delete(this.state); + $delete(this.options); + $delete(this.char_map); + $delete(this.row_id_map); + $delete(this.syntax_map); + $delete(this.style_map); + this.hide(); + $delete(this.activeView); + } +}); + +ac.chap.Window.prototype.focus = function() +{ + this.showCaret(); +} + +ac.chap.Window.prototype.blur = function() +{ + this.hideCaret(); +} + +// compatibility layer with AC Fry Widget library +ac.chap.Window.prototype.onFocus = function() +{ + ac.chap.setActiveComponent(this); + this.focus(); +} + +ac.chap.Window.prototype.onBlur = function() +{ + ac.chap.setActiveComponent(null); + this.blur(); +} + +ac.chap.Window.prototype.onResize = function(width, height) +{ +} + +ac.chap.Window.prototype.onSystemClipboardCopy = function() +{ + return this.getSelection(); +} + +ac.chap.Window.prototype.onSystemClipboardCut = function() +{ + this.runAction(ac.chap.ACTION_CLIPBOARD, {cut:true}); + return this.processActionResult(true, true); +} + +ac.chap.Window.prototype.onSystemClipboardPaste = function(content) +{ + this.runAction(ac.chap.ACTION_CLIPBOARD, {paste:true, content:content}); + return this.processActionResult(true, true); +} + +ac.chap.Window.prototype.hasKeyboardListenerActive = function() +{ + return true; +} +ac.chap.Window.prototype.onCut = function(selection, callbackOk) +{ +} + +ac.chap.Window.prototype.onPaste = function(selection, wasCut) +{ +} + +ac.chap.Window.prototype.setOptions = function(options) +{ + this.options = + { + initialCaretPosition:[0,0], + tokenizerLazyLaunch:900, + syntaxHighlightingEnabled:true, + remoteBackendURL:'', + font:{ + size:11, + family: $__tune.isMac ? "Consolas, 'Bitstream Vera Sans mono', 'Courier', 'Monaco', monospaced" : "Consolas, 'Courier New', 'Courier', monospaced", + allowedSizes: [8, 9, 10, 11, 12, 13, 14, 17, 21, 24, 27, 30, 34, 38, 42] + } + }; + if ( $isset(options.initial_caret_position) ) + { + this.options.initialCaretPosition = [options.initial_caret_position[0], options.initial_caret_position[1]]; + } + if ( $isset(options.language) ) + { + this.language = $new(options.language); + } + else + { + this.language = $new(ac.chap.Language); + } + if ( $isset(options.keymap) ) + { + this.keymap = $new(options.keymap); + } + else + { + this.keymap = $new(ac.chap.KeyMap); + } + if ( $isset(options.syntaxHighlightingEnabled) ) + { + this.options.syntaxHighlightingEnabled = options.syntaxHighlightingEnabled; + } + if ( $isset(options.remoteBackendURL) ) + { + this.options.remoteBackendURL = options.remoteBackendURL; + } + else + { + if ( client && client.conf && client.conf.fry ) + { + this.options.remoteBackendURL = client.conf.fry.backendURL; + } + } + if ($isset(options.font)) + { + if ($isset(options.font['size'])) + { + this.options.font.size = options.font.size; + } + if ($isset(options.font['family'])) + { + this.options.font.family = options.font.family; + } + } +} + +ac.chap.Window.prototype.setState = function() +{ + this.state = + { + lastKeyTimePressed:0, + caretPhase:1, + lastKeyCode:0, + lastControlKey:0, + lastCaretPosition:[], + tokenizerTimer:null, + scheduledTokenizerTime:0, + transactionLogStopped:false, + actionListeners:[], + actionListenersStopped:false, + caretListener:null, + commandListener:null, + transactionListener:[null,800], + passThroughKeysListener:null + } + this.caret = + { + position:[this.options.initialCaretPosition[0], this.options.initialCaretPosition[1]], + mode:1 // 1 normal, 2 overwrite + } +} + +ac.chap.Window.prototype.addView = function(layoutNode, options, renderAfter) +{ + var view_index = this.views.length; + this.viewLayoutNodes.push(layoutNode); + this.views.push($new(ac.chap.View, this, view_index, options||{})); + this.row_id_map[view_index] = []; + if ( 0 < view_index ) + { +// console.log(view_index); + // creating duplicate + var n = this.row_id_map[0].length; + for ( var i=0; i= 0; i--) + { + if (font_size > font_sizes[i]) + { + font_size = font_sizes[i]; + break; + } + } + } + else + { + if (font_sizes[0] <= value && value <= font_sizes[font_sizes.length-1]) + { + font_size = value; + } + } + this.options.font.size = font_size; + redraw = true; + } + else if ('font.family' == key) + { + this.options.font.family = value; + redraw = true; + } + else if ('word.wrap' == key) + { + if (this.activeView) + { + this.hideCaret(); + this.activeView.options.wordWrap = value; + this.activeView.reloadOptions(); + this.showCaret(); + } + } + if (redraw) + { + this.hideCaret(); + var num_views = this.views.length; + for (var i=0; i caret_col ) + { + caret_col++; + } + else + { + if ( 'undefined' != typeof this.char_map[caret_row+1] ) + { + caret_row++; + caret_col = 0; + } + } + this.setCaretPosition(caret_row, caret_col); + return ac.chap.ACTION_RES_REDRAWCARET; + } + else if ( 'up' == direction ) + { + if ( 0 < caret_row ) + { + var move_end = this.char_map[caret_row].length == caret_col; + if ( move_end ) + { + caret_col = this.char_map[caret_row-1].length; + } + else + { + caret_col = Math.min(this.char_map[caret_row-1].length, caret_col); + } + this.setCaretPosition(caret_row-1, caret_col); + return ac.chap.ACTION_RES_REDRAWCARET; + } + } + else if ( 'down' == direction ) + { + if ( 'undefined' != typeof this.char_map[caret_row+1] ) + { + var move_end = this.char_map[caret_row].length == caret_col; + if ( move_end ) + { + caret_col = this.char_map[caret_row+1].length; + } + else + { + caret_col = Math.min(this.char_map[caret_row+1].length, caret_col); + } + this.setCaretPosition(caret_row+1, caret_col); + return ac.chap.ACTION_RES_REDRAWCARET; + } + } + else if ( 'prev_word' == direction ) + { + if ( 0 < caret_col ) + { + var ch = this.char_map[caret_row].charAt(caret_col-1); + var re = this.language.wordDelimiter; + var look_for_wch = re.test(ch); + while ( 0 != caret_col ) + { + ch = this.char_map[caret_row].charAt(caret_col-1); + if ( look_for_wch != re.test(ch) ) + { + break; + } + caret_col--; + } + } + else + { + if ( 0 < caret_row ) + { + caret_row--; + caret_col = this.char_map[caret_row].length; + } + } + this.setCaretPosition(caret_row, caret_col); + return ac.chap.ACTION_RES_REDRAWCARET; + } + else if ( 'next_word' == direction ) + { + if ( this.char_map[caret_row].length > caret_col ) + { + var ch = this.char_map[caret_row].charAt(caret_col); + var re = this.language.wordDelimiter; + var look_for_wch = re.test(ch); + while ( this.char_map[caret_row].length > caret_col ) + { + ch = this.char_map[caret_row].charAt(caret_col); + if ( look_for_wch != re.test(ch) ) + { + break; + } + caret_col++; + } + } + else + { + if ( 'undefined' != typeof this.char_map[caret_row+1] ) + { + caret_row++; + caret_col = 0; + } + } + this.setCaretPosition(caret_row, caret_col); + return ac.chap.ACTION_RES_REDRAWCARET; + } + else if ( 'prev_regexp' == direction ) + { + if ( 0 < caret_col ) + { + var row = this.char_map[caret_row].substring(0, caret_col); + var re = new RegExp(params['re'].replace('|', '\\')); + var matches = re.exec(row); + if (0 == matches.length) + { + console.warning('Invalid RE definition for `prev_regexp\' direction in ACTION_CARET.move action in keymap.'); + caret_col--; + } + else + { + caret_col -= matches[0].length + 1; + } + } + else + { + if ( 0 < caret_row ) + { + caret_row--; + caret_col = this.char_map[caret_row].length; + } + } + this.setCaretPosition(caret_row, caret_col); + return ac.chap.ACTION_RES_REDRAWCARET; + } + else if ( 'next_regexp' == direction ) + { + if ( this.char_map[caret_row].length > caret_col ) + { + var row = this.char_map[caret_row].substr(caret_col + 1); + var re = new RegExp(params['re'].replace('|', '\\')); + var matches = re.exec(row); + if (0 == matches.length) + { + console.warning('Invalid RE definition for `next_regexp\' direction in ACTION_CARET.move action in keymap.'); + caret_col++; + } + else + { + caret_col += matches[0].length + 1; + } + } + else + { + if ( 'undefined' != typeof this.char_map[caret_row+1] ) + { + caret_row++; + caret_col = 0; + } + } + this.setCaretPosition(caret_row, caret_col); + return ac.chap.ACTION_RES_REDRAWCARET; + } + else if ( 'row_start' == direction ) + { + if ( 0 < caret_col ) + { + caret_col = 0; + this.setCaretPosition(caret_row, caret_col); + return ac.chap.ACTION_RES_REDRAWCARET; + } + } + else if ( 'row_end' == direction ) + { + if ( this.char_map[caret_row].length > caret_col ) + { + caret_col = this.char_map[caret_row].length; + this.setCaretPosition(caret_row, caret_col); + return ac.chap.ACTION_RES_REDRAWCARET; + } + } + else if ( 'page_up' == direction ) + { + if (this.activeView) + { + var row = caret_row - this.activeView.numRows; + if (0 > row) + { + row = 0; + } + this.setCaretPosition(row, 0 != caret_col ? this.char_map[row].length : 0); + return ac.chap.ACTION_RES_REDRAWCARET; + } + return 0; + } + else if ( 'page_down' == direction ) + { + if (this.activeView) + { + var row = caret_row + this.activeView.numRows; + if (this.char_map.length <= row) + { + row = this.char_map.length-1; + } + this.setCaretPosition(row, 0 != caret_col ? this.char_map[row].length : 0); + return ac.chap.ACTION_RES_REDRAWCARET; + } + return 0; + } + else if ( 'doc_start' == direction ) + { + this.setCaretPosition(0,0); + return ac.chap.ACTION_RES_REDRAWCARET; + } + else if ( 'doc_end' == direction ) + { + var last_index = this.char_map.length-1 + this.setCaretPosition(last_index, this.char_map[last_index].length-1); + return ac.chap.ACTION_RES_REDRAWCARET; + } + } + else if ( $isset(params.moveBy) ) + { + var offset = params.moveBy; + if ( 'column' == offset ) + { + //move by params.value columns, newlines are counted as column, params.value may be negative indication caret moving to the left + if ( 0 < params.value ) + { + var range_source = (this.char_map[caret_row].substr(caret_col)+'\n'+this.char_map.slice(caret_row+1).join('\n')).substr(0, params.value); + range_source = range_source.split('\n'); + caret_row += range_source.length-1; + caret_col = range_source[range_source.length-1].length + (1==range_source.length ? caret_col : 0); + } + else + { + var range_source = (this.char_map.slice(0, caret_row).join('\n')+'\n'+this.char_map[caret_row].substr(0, caret_col)); + range_source = range_source.substr(range_source.length+params.value); + range_source = range_source.split('\n'); + caret_row -= (range_source.length-1); + caret_col = (1==range_source.length ? caret_col : this.char_map[caret_row].length) - range_source[0].length; + } + this.setCaretPosition(caret_row, caret_col); + return ac.chap.ACTION_RES_REDRAWCARET; + } + else if ( 'row' == offset ) + { + // move by params.value rows + } + else if ( 'page' == offset ) + { + // move by params.value pages + } + } + else if ( $isset(params.moveTo) ) + { + // move to params.moveTo[0], params.moveTo[1] + this.setCaretPosition(params.moveTo[0], params.moveTo[1]); + return ac.chap.ACTION_RES_REDRAWCARET; + } + };break; + case ac.chap.ACTION_SELECTION: + { + if ( $isset(params.remove) ) + { + var changed = this.removeSelection(); + return ac.chap.ACTION_RES_REDRAWCARET | (changed ? ac.chap.ACTION_RES_REDRAWTEXT : 0); + } + else if ( $isset(params.add) ) + { + this.addSelection([caret_row, caret_col], this.state.lastCaretPosition); + this.renderSelection(); + return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_SELECTIONCHANGED; + } + else if ( $isset(params.all) ) + { + $__tune.behavior.clearSelection(); + this.addAllSelection(); + this.renderSelection(); + return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_SELECTIONCHANGED; + } + };break; + case ac.chap.ACTION_INSERT: + { + var str = null; + if ( $isset(params.row) ) + { + var ins_content = '\n'; + caret_col = 0; + // if ( 0 < caret_row ) + // { + // // indenting by previous row + // var t = this.char_map[caret_row]; + // var n = t.length; + // var re = this.language.indentIgnoreMarker; + // while ( caret_col width ) + { + // will go before [row,column] + source = this.char_map.slice(0, row).join('\n')+'\n'+this.char_map[row].substr(0, column); + return source.substr(source.length+width); + } + else + { + // will go after [row,column] + source = this.char_map.slice(row).join('\n').substr(column); + return source.substr(0, width); + } +} + +ac.chap.Window.prototype.getWordAt = function(row, column, numWords) +{ + // if numWords <0 returns words before otherwise after position. if omitted, default value is -1 that is word before caret + // also, if more than one word is required, returns array of words as result + row = $getdef(row, this.caret.position[0]); + column = $getdef(column, this.caret.position[1]); + numWords = $getdef(numWords, -1); + var words = []; + var re = this.language.wordDelimiter; + var required_words = numWords; + var direction_after = 0 < numWords; + var next_word = true; + required_words = Math.abs(-numWords); + if ( !direction_after ) + { + column--; + if ( -1 == column ) + { + row--; + if ( -1 == row ) + { + return words; + } + column = this.char_map[row].length-1; + } + } + while (true) + { + var ch = this.char_map[row].charAt(column) + if ( re.test(ch) ) + { + if ( next_word ) + { + words.push(''); + next_word = false; + } + // word character found + if ( direction_after ) + { + words[words.length-1] += ch; + } + else + { + words[words.length-1] = ch + words[words.length-1]; + } + } + else + { + if ( required_words == words.length ) + { + break; + } + next_word = true; + } + + column += (direction_after ? 1 : -1); + if ( 0 > column ) + { + row--; + if ( -1 == row ) + { + break; + } + next_word = true; + column = this.char_map[row].length-1; + } + else if ( this.char_map[row].length <= column ) + { + row++; + if ( this.char_map.length == row ) + { + break; + } + next_word = true; + column = 0; + } + } + if ( 1 == required_words ) + { + return words[0] ? words[0] : false; + } + return words; +} + +ac.chap.Window.prototype.getLineAt = function(row) +{ + return this.char_map[row]; +} + +ac.chap.Window.prototype.getText = function() +{ + return this.char_map.join('\n'); +} + +ac.chap.Window.prototype.getNumRows = function() +{ + return this.char_map.length; +} + +ac.chap.Window.prototype.getSyntaxHighlightingSource = function() +{ + if (null != this.activeView) + { + return this.activeView.getSyntaxHighlightingSource(); + } + return 'ni'; +} + +ac.chap.Window.prototype.getCaretAbsolutePosition = function() +{ + if ( null != this.activeView ) + { + var pos = this.activeView.getRenderedCharPosition(this.caret.position[0], this.caret.position[1]); + if ( null != pos ) + { + var root_pos = this.activeView.nodeScrollArea.abspos(); + return [pos[0]+root_pos.x+this.activeView.options.colWidth, pos[1]+root_pos.y+this.activeView.options.rowHeight]; + } + } + return null; +} + +ac.chap.Window.prototype.stopTransactionLog = function() +{ + this.state.transactionLogStopped = true; +} + +ac.chap.Window.prototype.startTransactionLog = function() +{ + this.state.transactionLogStopped = false; +} + +ac.chap.Window.prototype.addAllSelection = function() +{ + var num_rows = this.char_map.length; + var num_views = this.views.length; + for ( var i=0; i offset_x - mid_char_w ) + { + col_index = i; + break; + } + else if ( w - mid_char_w < offset_x && (dim[0] % w + 2*mid_char_w >= offset_x)) + { + // last char + col_index = i+1; + break; + } + } + i++; + } +// console.log('%s, %s', row_index, col_index); + if ( i == num_chars ) + { + col_index = i; + } +// console.log('CHANGE CARET to: %s', col_index); + this.hideCaret(); + if ( evt.shiftKey ) + { + this.addSelection([row_index, col_index], this.state.lastCaretPosition); + this.renderText(); + } + else + { + this.setCaretPosition(row_index, col_index); + this.state.caretPhase = 1; + view.showCaret(); + this.state.lastCaretPosition = [this.caret.position[0], this.caret.position[1]]; + if ( this.removeSelection() ) + { + this.renderText(); + } + } + ac.chap.setActiveComponent(this); +} + +ac.chap.Window.prototype.foldingize = function() +{ + var startRowIndex = 0; + + var source_rows = this.char_map.slice(startRowIndex); + + // creating folding info + var n = source_rows.length; + var foldings = []; + var foldings_index = -1; + for ( var i=0; i ixs[i][1] ) + { + found_marker_index = i; + lowest = ixs[i][1]; + } + } + } + if ( -1 == found_marker_index ) + { + break; + } + var start_index = ixs[found_marker_index][1]; + var skipped_source = source.substr(0, start_index); + var num_skipped_rows = skipped_source.split('\n').length; + cursor.row += num_skipped_rows - 1; + cursor.col = (1 == num_skipped_rows ? col_offset : 0) + skipped_source.length - ('\n'+skipped_source).lastIndexOf('\n'); + + if ( 'undefined' == typeof syntax_map[cursor.row] ) + { + syntax_map[cursor.row] = []; + } + + var start_marker_len = ixs[found_marker_index][2].length; + var end_marker_len = ixs[found_marker_index][3].length; + source = source.substr(start_index+start_marker_len); + + var token_type = ixs[found_marker_index][0]; + + var end_index = source.indexOf(ixs[found_marker_index][3]); + var sub_source = source; + var end_index_offset = 0; + var except = false; + while ( 0 < end_index && '' != ixs[found_marker_index][4] && ixs[found_marker_index][4] == sub_source.charAt(end_index-end_marker_len) ) + { + except = true; + end_index_offset += end_index + end_marker_len; + sub_source = sub_source.substr(end_index+end_marker_len); + end_index = sub_source.indexOf(ixs[found_marker_index][3]); + } + if ( except && -1 != end_index ) + { + end_index += end_index_offset; + } + if ( -1 == end_index ) + { + syntax_map[cursor.row].push([token_type, cursor.col, -1, '']); + fillRowTokens(token_type, cursor.row+1, -1); + break; + } + else + { + var block_source = source.substr(0, end_index); + var num_block_rows = '\n' == ixs[found_marker_index][3] ? 1 : block_source.split('\n').length; + var cursor_col_end = block_source.length - ('\n'+block_source).lastIndexOf('\n'); + + syntax_map[cursor.row].push([token_type, cursor.col, 1 == num_block_rows ? (cursor.col+end_index+start_marker_len+end_marker_len) : -1, ixs[found_marker_index][2]]); + fillRowTokens(token_type, cursor.row+1, cursor.row+num_block_rows-1); + if ( 1 == num_block_rows ) + { + col_offset = cursor.col + end_index + start_marker_len + end_marker_len; + if ( '\n' == ixs[found_marker_index][3] ) + { + cursor.row++; + col_offset = 0; + } + } + else + { + if ( 'undefined' == typeof syntax_map[cursor.row+num_block_rows] ) + { + syntax_map[cursor.row+num_block_rows-1] = []; + } + syntax_map[cursor.row+num_block_rows-1].push([token_type, -1, cursor_col_end + end_marker_len, '']); +// var a = block_source.split('\n'); + col_offset = cursor_col_end + end_marker_len; + cursor.row += num_block_rows -1; + } +// console.log(num_block_rows); + source = source.substr(end_index+end_marker_len); + } + } + delete ixs; + delete source; + + var n = Math.max(syntax_map.length, this.syntax_map.length); + for ( i=0; i'; + } + } + return ht; + } + var nodes = this.nodeEditArea.childNodes; + var ht = ''; + for (var i=0; i') ) + { + str = str.replace(/>/g, '>'); + } + if ( -1 != str.indexOf('<') ) + { + str = str.replace( / 1 2 3 =  1 2 3 +function ch_encode_markup_spaces(str) +{ + var n = str.length - str.replace(/ /g, '').length; + for ( var i=0; i/g, '').length); + return arguments[1]+(is_inside?'~`~`~`~`':' '); + }); + } + return str.replace(/~`~`~`~`/g, ' '); +} + + +ac.chap.View.prototype.getRenderedCharDimension = function(rowIndex, colIndex) +{ + return [this.options.colWidth, this.options.rowHeight]; +} + +ac.chap.View.prototype.getRenderedStringDimension = function(rowIndex, colIndex, width) +{ + if ( 'undefined' != typeof this.window.char_map[rowIndex] ) + { + if ( colIndex < this.window.char_map[rowIndex].length ) + { + var str = this.window.char_map[rowIndex].substr(colIndex, width); + var ix = 0; + var tab = this.options.tabelator; + while ( -1 != ix ) + { + ix = str.indexOf('\t'); + if ( -1 != ix ) + { + str = str.substr(0,ix)+tab.substr(0, tab.length-(ix % tab.length))+str.substr(ix+1); + } + } +// console.log('(getrenderedstringdimension) = [%s], ix:%s w:%s %s', this.options.colWidth*str.length, colIndex, width, str); + return [this.options.colWidth*str.length, this.options.rowHeight]; + } + } + return [0,0]; +} + +ac.chap.View.prototype.getVirtualStringDimension = function(row, colIndex, width) +{ + if ( colIndex < row.length ) + { + var str = row.substr(colIndex, width); + var ix = 0; + var tab = this.options.tabelator; + while ( -1 != ix ) + { + ix = str.indexOf('\t'); + if ( -1 != ix ) + { + str = str.substr(0,ix)+tab.substr(0, tab.length-(ix % tab.length))+str.substr(ix+1); + } + } +// console.log('(getrenderedstringdimension) = [%s], ix:%s w:%s %s', this.options.colWidth*str.length, colIndex, width, str); + return [this.options.colWidth*str.length, this.options.rowHeight]; + } + return [0,0]; +} + +ac.chap.View.prototype.getRenderedCharPosition = function(rowIndex, colIndex) +{ + var node_row = this.getRowNode(rowIndex); + if ( null != node_row && null != node_row.parentNode ) + { + var offset_x = this.getRenderedStringDimension(rowIndex, 0, colIndex)[0]; + var offset_y = 0; + var dim = this.getRenderedCharDimension(rowIndex, colIndex); + offset_x -= dim[0]; + if ( this.options.wordWrap ) + { + if ( 0 < colIndex ) + { + var w = this.options.colWidth * (this.numCols); + offset_y = this.options.rowHeight * (Math.floor(offset_x/w)); + offset_x = (offset_x) % w; + } + } + return [offset_x, node_row.offsetTop+offset_y, node_row]; + } + return null; +} + +ac.chap.View.prototype.getRowNode = function(rowIndex) +{ + return document.getElementById('row-'+this.window.instanceId+'-'+this.index+'-'+rowIndex); +} + +ac.chap.View.prototype.getVirtualCharPosition = function(nodeRow, row, colIndex) +{ + var offset_x = this.getVirtualStringDimension(row, 0, colIndex)[0]; + var offset_y = 0; + var dim = this.getRenderedCharDimension(0, colIndex); + offset_x -= dim[0]; + if ( this.options.wordWrap ) + { + if ( 0 < colIndex ) + { + var w = this.options.colWidth * (this.numCols); + offset_y = this.options.rowHeight * (Math.floor(offset_x/w)); + offset_x = (offset_x) % w; + } + } + return [offset_x, nodeRow.offsetTop+offset_y]; +} + +ac.chap.View.prototype.showCaret = function(skipScroll) +{ + var caret_row = this.window.caret.position[0]; + var caret_col = this.window.caret.position[1]; + + pos = this.getRenderedCharPosition(caret_row, caret_col); + if ( null != pos ) + { + // caret is visible + var node_row = pos[2]; + var node = document.getElementById('ac-chap-caret-'+this.window.instanceId); + if ( null != node ) + { + node.parentNode.removeChild(node); + } + if ( 1 == this.window.state.caretPhase ) + { + // displaying caret + node = document.createElement('div'); + node.id = 'ac-chap-caret-'+this.window.instanceId; + node.style.position = 'absolute'; + node.style.font = '1px arial'; // IE + node.style.width = this.options.colWidth + 'px'; + node.style.height = this.options.rowHeight + 'px'; + pos[2] = this.options.colWidth; + pos[3] = this.options.rowHeight; + pos = this.theme.adjustCaretPosition(this.window.caret.mode, pos); + node.style.left = pos[0]+'px'; + node.style.top = pos[1]+'px'; + this.theme.renderCaret(this.window.caret.mode, node); + this.nodeCaret = node_row.appendChild(node); + node_row.style.background = this.theme.caretRowStyleActive; + + if ( !skipScroll ) + { + // might be out of borders, at least partially + if ( 0 > node_row.offsetTop - (this.nodeScrollArea.$.scrollTop % this.options.rowHeight) ) + { + // top margin overlay, first rendered row is partially hidden + this.scrollToRow(caret_row); + } + else if ( node_row.offsetTop > this.options.rowHeight*(this.numRows-1)-$__tune.ui.scrollbarWidth ) + { + // bottom margin overlay + this.scrollToRow(caret_row-Math.floor(this.numRows/2)); + } + } + this.nodeCaretRow = node_row; + } + if ('undefined' != typeof this.state.lastCaretRowIndex && this.state.lastCaretRowIndex != caret_row) + { + var last_node_row = this.getRowNode(this.state.lastCaretRowIndex); + if (last_node_row) + { + last_node_row.style.background = 'transparent'; + } + } + this.state.lastCaretRowIndex = caret_row; + } + else + { + if ( !skipScroll ) + { + // scrolling into view + this.scrollToRow(caret_row - Math.floor(this.numRows/2)); + } + } +} + +ac.chap.View.prototype.hideCaret = function(skipCaretRow) +{ + if ( null != this.nodeCaret && null != this.nodeCaret.parentNode ) + { + this.nodeCaret.parentNode.removeChild(this.nodeCaret); + this.nodeCaret = null; + } + if ( !skipCaretRow && null != this.nodeCaretRow ) + { +// console.log('off(hide) caret line background for %s', this.nodeCaretRow.id); + this.nodeCaretRow.style.background = 'transparent'; + } +// console.log('hide caret'); +} + +ac.chap.View.prototype.scrollToRow = function(rowIndex, setCaretToo, dontRefreshCaret) +{ + this.nodeScrollArea.$.scrollTop = this.options.rowHeight * rowIndex - Math.floor(this.nodeRoot.$.offsetHeight/3); + if (setCaretToo) + { + this.window.runAction(ac.chap.ACTION_CARET, {moveTo:[rowIndex, 0]}); + this.window.runAction(ac.chap.ACTION_CARET, {move:'row_end'}); + } + if (!dontRefreshCaret) + { + this.window.state.caretPhase = 1; + this.showCaret(true); + } +} + +ac.chap.View.prototype.expandFolding = function(rowIndex) +{ + if ( 'undefined' == typeof this.window.row_id_map[this.index][rowIndex] ) + { + return; + } + var row_state = this.window.row_id_map[this.index][rowIndex][2]; + if (0 == (ac.chap.ROWSTATE_FOLD_EXPAND & row_state)) + { + return; + } + var end_row_index = this.window.row_id_map[this.index][rowIndex][3][1]; + this.window.row_id_map[this.index][rowIndex][2] &= (65535 - ac.chap.ROWSTATE_FOLD_EXPAND); + this.window.row_id_map[this.index][rowIndex][1] = false; + for ( var i=rowIndex+1; i<=end_row_index; i++ ) + { + this.window.row_id_map[this.index][i][1] = false; + this.window.row_id_map[this.index][i][2] &= (65535 - ac.chap.ROWSTATE_FOLD_COLLAPSED); + } + this.recalculateVisibleRows(); + var me = this; + // console.log('expanding: %i, start: %i', rowIndex, end_row_index); + $runafter(40, function(){me.renderText(true)}); +} + +ac.chap.View.prototype.resize = function() +{ + var h = this.nodeRoot.p().h(); + this.nodeRoot.h(h); + $(this.nodeSidebar).h(h); + this.nodeScrollArea.h(h); + this.nodeFillArea.h(h-$__tune.ui.scrollbarWidth); + $(this.nodeSelectionArea).h(h-$__tune.ui.scrollbarWidth+this.options.rowHeight); + this.recalculateNumRows(); + this.recalculateVisibleRows(); + this.renderText(true); +} + +ac.chap.View.prototype.reloadOptions = function() +{ + this.calculateColRowDim(); + this.recalculateNumCols(false, true); + this.recalculateNumRows(); + this.recalculateVisibleRows(); + this.renderSidebarStub(); + this.renderText(true); +} + +ac.chap.View.prototype.recalculateNumCols = function(node, withoutScrollbar) +{ + node = node || this.nodeRoot; + var w = node.$.offsetWidth; + if (withoutScrollbar) + { + w -= $__tune.ui.scrollbarWidth+61; + } + this.numCols = Math.floor(w/this.options.colWidth); +} + +ac.chap.View.prototype.recalculateNumRows = function(node) +{ + node = node || this.nodeRoot; + this.numRows = Math.floor(node.$.offsetHeight/this.options.rowHeight); +} + +ac.chap.View.prototype.showInteractiveSearch = function() +{ + this.hideInteractiveSearch(); + var pos = this.nodeRoot.abspos(); + var node = $().a($$()).pos(true).x(pos.x+58).y(pos.y).z(2000).w(this.nodeRoot.w()-$__tune.ui.scrollbarWidth-61).h(24).o(0.8); + node.s('background:#000;border:1px solid #777;border-top:0;'); + var search_key_id = 'is_key_?'.embed(this.window.ident); + var ht = '
'; + node.t(ht); + var me = this; + var status_node = node.g('td:0'); + var search_key_node = node.g('input:0'); + var original_caret_pos = [me.window.caret.position[0], me.window.caret.position[1]]; + var last_keyword = ''; + var selection = me.window.getSelection(); + search_key_node.e('keydown', function(evt) + { + evt.stopPropagation(); + if (40 == evt.keyCode) + { + me.window.runAction(ac.chap.ACTION_CUSTOM, {action:'SearchKeyword', direction:'down'}); + me.scrollToRow(me.window.caret.position[0], false, true); + me.window.processActionResult(true, true); + evt.preventDefault(); + return true; + } + else if (38 == evt.keyCode) + { + me.window.runAction(ac.chap.ACTION_CUSTOM, {action:'SearchKeyword', direction:'up'}); + me.scrollToRow(me.window.caret.position[0], false, true); + me.window.processActionResult(true, true); + evt.preventDefault(); + return true; + } + else if (27 == evt.keyCode) + { + finish(true); + evt.preventDefault(); + return true; + } + else if (13 == evt.keyCode) + { + finish(); + evt.preventDefault(); + return true; + } + }).e('keyup', function(evt) + { + evt.stopPropagation(); + search(); + + }).$.focus(); + node.g('img:0').e('click', function(evt) + { + evt.stopPropagation(); + finish(true); + }); + + function finish(canceled) + { + if (canceled) + { + me.window.removeSelection(); + me.window.runAction(ac.chap.ACTION_CARET, {moveTo:[original_caret_pos[0], original_caret_pos[1]]}); + me.scrollToRow(me.window.caret.position[0], false, true); + me.window.processActionResult(true, true); + } + ac.chap.setActiveComponent(me.window); + me.hideInteractiveSearch(); + } + + function update_status(numFound) + { + status_node.t('Found ? results.'.embed(numFound)); + } + + function search() + { + var keyword = search_key_node.$.value.trim(); + if ('' == keyword || last_keyword == keyword) + { + if ('' == keyword) + { + update_status(0); + } + return; + } + update_status(me.window.getText().split(keyword).length - 1); + last_keyword = keyword; + me.window.removeSelection(); + me.window.runAction(ac.chap.ACTION_CARET, {moveTo:[original_caret_pos[0], original_caret_pos[1]]}); + me.window.runAction(ac.chap.ACTION_CUSTOM, {action:'SetSearchKeyword', keyword:keyword}); + me.window.runAction(ac.chap.ACTION_CUSTOM, {action:'SearchKeyword', direction:'down'}); + me.scrollToRow(me.window.caret.position[0], false, true); + me.window.processActionResult(true, true); + } + + if (null != selection) + { + search_key_node.$.value = selection; + search_key_node.$.select(); + search_key_node.$.focus(); + search(); + } + + + + this.interactiveSearchNode = node; +} + +ac.chap.View.prototype.hideInteractiveSearch = function() +{ + if (this.interactiveSearchNode && this.interactiveSearchNode.is()) + { + this.interactiveSearchNode.rs(); + } +} + +ac.chap.View.prototype.render = function(node) +{ + var w = node.$.offsetWidth; + var h = node.$.offsetHeight; + this.recalculateNumRows(node); + this.recalculateNumCols(node); + node.sa('chap-view', 'true'); + var me = this; + this.nodeRoot = node.a($$()).pos(true).w(w).h(h).n('acw-chap').s('background:?'.embed(this.theme.background)); + this.interactiveSearchNode = null; + + var w_rows = 58; + w -= w_rows; + this.nodeSidebar = this.nodeRoot.a($$()).pos(true).x(0).y(0).w(w_rows).h(h).s('overflow:hidden').n('sidebar'); + + // rendering sidebar stub + this.renderSidebarStub(); + + + this.nodeScrollArea = this.nodeRoot.a($$()).pos(true).x(w_rows).y(0).w(w).h(h).n('scroll-area').s('overflow:auto'); + this.nodeScrollArea.e('scroll', function(evt) + { + var offset = Math.floor(me.nodeScrollArea.$.scrollTop/me.options.rowHeight); + var map = me.window.row_id_map[me.index]; + var row_index = 0; + for ( var i=0; i' + ch_encode_markup(token[1]) + ''; + } + else + { + rend_chunk += ch_encode_markup(token[1]); + } + i += token[1].length - 1; + // offset = i + token[1].length; + offset = i + 1; + // console.log(token, offset, rend_chunk); + } + rend_chunk += ch_encode_markup(chunk.substr(offset)); + chunk = rend_chunk; + } + else + { + chunk = ch_encode_markup(chunk); + } + return chunk; +} + +ac.chap.View.prototype.renderTextRow = function(node, rowIndex, renderedPreviously) +{ + var row = this.window.char_map[rowIndex]; + var rendered_row = ''; + var offset = 0; + var font_style = ';font:' + this.window.options.font.size + 'px ' + this.window.options.font.family; + var interpolation = this.window.language.stringInterpolation; + + var row_state = this.window.row_id_map[this.index][rowIndex][2]; + + if ( 'undefined' != typeof this.window.syntax_map[rowIndex] && 0 < this.window.syntax_map[rowIndex].length ) + { + // console.log(this.window.syntax_map[rowIndex]); + var n = this.window.syntax_map[rowIndex].length; + for ( var i=0; i' + ch_encode_markup(chunk.substring(0, m.index)) + ''; + new_chunk += this.renderChunk(chunk.substr(m.index, m[interpolation[1]].length)); + chunk = chunk.substr(m.index + m[interpolation[1]].length); + // console.warn(chunk); + } + new_chunk += '' + ch_encode_markup(chunk) + ''; + // console.info(new_chunk); + rendered_row += new_chunk; + } + else + { + rendered_row += ''+ch_encode_markup(chunk)+''; + // console.log(rendered_row); + } + } + else + { + rendered_row += ch_encode_markup(chunk); + } + offset = -1 == end_offset ? row.length : end_offset; + } + } + rendered_row += this.renderChunk(row.substr(offset)); + // console.log(rendered_row); + // rendering custom selection (search results, errors and such) + // !!!!!!!!!! + // NOT USED NOW !!!!! + // !!!!!!!!!! + // !!!!!!!!!! + // !!!!!!!!!! + // !!!!!!!!!! + if ( false && ac.chap.ROWSTATE_SELECTION == (row_state & ac.chap.ROWSTATE_SELECTION) ) + { + var range = this.window.row_id_map[this.index][rowIndex][5]; + if ( 0 == range[0] && this.window.char_map[rowIndex].length == range[1] ) + { + rendered_row = ''+rendered_row+''; + } + else + { + // console.log(range); + var raw = rendered_row; + var n = raw.length; + var col_index = 0; + var selection_started = false; + var offset = 0; + // console.log('before: %s', raw); + for ( var i=0; i'); + i += ix; + // console.log('ix: %s', ix); + + if ( selection_started ) + { + var c = ''; + rendered_row = rendered_row.substr(0, i+offset+1)+c+rendered_row.substr(i+offset+1); + offset += c.length; + } + continue; + } + if ( range[0] == col_index ) + { + selection_started = true; + var c = ''; + rendered_row = rendered_row.substr(0, i+offset)+c+rendered_row.substr(i+offset); + offset += c.length; + } + if ( selection_started && range[1]-1 < col_index ) + { + selection_started = false; + var c = ''; + rendered_row = rendered_row.substr(0, i+offset)+c+rendered_row.substr(i+offset); + break; + } + if ( '&' == ch ) + { + if ( '<' == raw.substr(i, 4) || '>' == raw.substr(i, 4) ) + { + i += 3; + } + else if ( '&' == raw.substr(i, 5) ) + { + i += 4; + } + } + col_index++; + } + if ( selection_started ) + { + rendered_row += ''; + } + } + } +// console.log(rendered_row); + // making intelligent tabelators - note, using simple replace of \t doesn't work + var ix = 0; + var tab = this.options.tabelator; + var raw = this.window.char_map[rowIndex]; + var tab_stack = []; + while ( -1 != ix ) + { + ix = raw.indexOf('\t'); + if ( -1 != ix ) + { + var tab_length = tab.length - (ix % tab.length); + raw = raw.substr(0,ix)+tab.substr(0, tab_length)+raw.substr(ix+1); + tab_stack.push(tab_length); + } + } + for ( var i=0; i'); + if ( -1 == ix ) + { + break; + } + i += ix; + continue; + } + var n_ch = 0; + if ( '&' == ch ) + { + if ( '<' == rendered_row.substr(i,4) || '>' == rendered_row.substr(i,4) ) + { + n_ch = 3; + } + else if ( '&' == rendered_row.substr(i,5) ) + { + n_ch = 4; + } + } + printable += ch.charAt(0); + if ( this.numCols == printable.length ) + { + raw = raw.substr(0, i+offset+n_ch)+'
'+raw.substr(i+offset+n_ch); + num_subrows++; + offset += 4; + printable = ''; + } + i += n_ch; + } + rendered_row = raw; + } + if ( ac.chap.ROWSTATE_FOLD_EXPAND == (row_state & ac.chap.ROWSTATE_FOLD_EXPAND) ) + { + var end_index = this.window.row_id_map[this.index][rowIndex][3][1]; + var content = ch_encode_markup(this.window.char_map.slice(rowIndex, end_index+1).join('\n').replace(/"/ig, "''")); + rendered_row += '
'.embed(content); + } + node.setAttribute('num-subrows', num_subrows); + + if ( $__tune.isIE ) + { + // IE trims input source in innerHTML + rendered_row = ch_encode_markup_spaces(rendered_row); + } + node.innerHTML = rendered_row; +} + +ac.chap.View.prototype.recalculateVisibleRows = function() +{ + var map = this.window.row_id_map[this.index]; + var n = map.length; + var i = 0; + var num_visibles = 0; + while ( i < n ) + { + var state = map[i][2]; + if ( 0 == (ac.chap.ROWSTATE_FOLD_COLLAPSED & state) ) + { + num_visibles++; + } + i++; + } + this.numVisibleRows = num_visibles; +} + +ac.chap.View.prototype.getVisibleRowIndices = function() +{ + var map = this.window.row_id_map[this.index]; + var i = 0; + var index = this.startRow; + var indices = []; + while ( i++ <= this.numRows ) + { + if ( 'undefined' == typeof this.window.row_id_map[this.index][index] ) + { + break; + } + var state = this.window.row_id_map[this.index][index][2]; + if ( ac.chap.ROWSTATE_FOLD_COLLAPSED == (ac.chap.ROWSTATE_FOLD_COLLAPSED & state) ) + { + // collapsed + i--; + index++; + continue; + } + indices.push(index); + if ( ac.chap.ROWSTATE_FOLD_EXPAND == (state & ac.chap.ROWSTATE_FOLD_EXPAND) ) + { + // collapsed folding + var refered_row_index = this.window.row_id_map[this.index][index][3][1]; + index = refered_row_index + 1; + } + else + { + index++; + } + } + return indices; +} + +ac.chap.View.prototype.renderRowSidebar = function(position, rowIndex, rowNode, forceCompleteRedraw) +{ + if (!this.nodeSidebar.firstChild.childNodes.item(position)) + { + return; + } + var bar_node = this.nodeSidebar.firstChild.childNodes.item(position).firstChild; + if ( 0 == rowNode.offsetHeight ) + { + rowNode.style.height = this.options.rowHeight; + } + var num_subrows = parseInt(rowNode.getAttribute('num-subrows')); + var cache_id = forceCompleteRedraw ? 'none' : (num_subrows+':'+this.window.row_id_map[this.index][rowIndex].join('-')); + if (bar_node.getAttribute('sidebar-cache-id') == cache_id && 'none' != cache_id) + { + return; + } + if ('none' != cache_id) + { + bar_node.setAttribute('sidebar-cache-id', cache_id); + bar_node.firstChild.style.fontSize = (this.window.options.font.size-2) + 'px'; + } + // console.log(cache_id); + + var row_height = num_subrows * this.options.rowHeight; + bar_node.parentNode.style.height = row_height + 'px'; + if (forceCompleteRedraw) + { + bar_node.firstChild.style.fontSize = (this.window.options.font.size-2) + 'px'; + } + var ht = rowIndex+1; + if ( this.options.wordWrap ) + { + var htt = '
'; + for ( var i=1; i this.numCols ) + { + ix_r++; + ix_c -= this.numCols; + } + if ( ii == range[1] ) + { + offset[2] = ix_r; + offset[3] = ix_c; + break; + } + } + if ( -1 == offset[3] ) + { + offset[2] = ix_r+1;//offset[0]+1; + } + node_row_selection.style.top = (node_row.offsetTop + this.options.rowHeight*offset[0]) + 'px'; +// console.log('%o', offset); + if ( offset[0] == offset[2] ) + { + // selection stays non-wrapped + node_row_selection.style.left = offset[1]*this.options.colWidth + 'px'; + node_row_selection.style.width = ((offset[3]-offset[1])*this.options.colWidth) + 'px'; +// console.log(node_row_selection.style.width); + } + else + { + // finishing current node + if ( -1 == offset[1] ) + { + // caret stays on the end of the row + node_row_selection.style.left = (ix_c*this.options.colWidth) + 'px'; + node_row_selection.style.width = (node_row.offsetWidth - (ix_c*this.options.colWidth)) + 'px'; + } + else + { + node_row_selection.style.left = (offset[1]*this.options.colWidth) + 'px'; + node_row_selection.style.width = (node_row.offsetWidth - (offset[1]*this.options.colWidth)) + 'px'; + } + // marking as non-cacheable + node_row_selection.removeAttribute('cachid'); + // creating additional ones + for ( ii=offset[0]+1; ii<=offset[2]; ii++ ) + { + node_row_selection = node_cache.appendChild(document.createElement('div')); + node_row_selection.style.background = this.theme.selectionStyle; + node_row_selection.style.position = 'absolute'; + node_row_selection.style.left = '0px'; + node_row_selection.style.top = (node_row.offsetTop+ii*this.options.rowHeight) + 'px'; + node_row_selection.style.height = this.options.rowHeight + 'px'; + if ( ii != offset[2] ) + { + node_row_selection.style.width = node_row.offsetWidth + 'px'; + } + else + { + node_row_selection.style.width = ((offset[3])*this.options.colWidth) + 'px'; + } + } + } + + } + else + { + var offset_x1 = this.getRenderedStringDimension(row_index, 0, range[0])[0]; + var offset_x2 = this.getRenderedStringDimension(row_index, 0, range[1]+1)[0]; + node_row_selection.style.left = offset_x1 + 'px'; + node_row_selection.style.width = (offset_x2 - offset_x1) + 'px'; + } + } + } + // console.log('selection after range: %o', this.window.row_id_map[this.index][row_index][3]); + + } + } + // console.log('%o', this.window.row_id_map[this.index][0]); + var ht = node_cache.innerHTML; + this.nodeSelectionArea.innerHTML = ht; +} + +ac.chap.View.prototype.renderText = function(forceCompleteRedraw) +{ + var row_indices = this.getVisibleRowIndices(); + var num_rows = row_indices.length; +// console.log('view: %s - row indices: %o', this.index, row_indices); + +// console.log('view: %s - num rows x cols [%s x %s]', this.index, this.numRows, this.numCols); + // checking to see if only one row changed - the most usual case + var changed_row_index = -1; + var changed_row_position = -1; + for ( var i=0; i fill_area_h ) + { + fill_area_h = this.nodeRoot.h()-$__tune.ui.scrollbarWidth; + } + this.nodeFillArea.h(fill_area_h); + + } + else + { + this.nodeEditAreaCache.innerHTML = ''; + } + if ( parseInt(this.nodeSidebar.firstChild.style.top) != top_offset ) + { + this.nodeSidebar.firstChild.style.top = (top_offset)+'px'; + this.nodeSidebar.firstChild.style.height = (this.nodeSidebar.offsetHeight - $__tune.ui.scrollbarWidth - top_offset)+'px'; + } + this.renderSelection(); +} + + + +/* + * ac.Chap - Text Editing Component widget - Settings file + */ + +if ( 'undefined' == typeof ac ) +{ + var ac = {chap:{}}; +} + + +$class('ac.chap.KeyMap', +{ + construct:function() + { + this.definition = {}; + this.isMac = true; + this.wordCompleteCache = null; + this.snippetCompleteCache = null; + this.searchKeyword = ''; + this.initDefinition(); + } +}); + +ac.chap.KeyMap.prototype.initDefinition = function() +{ +} + +ac.chap.KeyMap.prototype.importCommands = function(commands) +{ + var n = commands.length; + for ( var i=0; i looking_for_len && words_prev[i+1].substr(0, looking_for_len) == looking_for ) + { + if ( -1 == found_words_index.indexOf(' '+words_prev[i+1]) ) + { + found_words.push(words_prev[i+1]); + found_words_index += ' '+words_prev[i+1]; + } + } + if ( words_next[i] && words_next[i].length > looking_for_len && words_next[i].substr(0, looking_for_len) == looking_for ) + { + if ( -1 == found_words_index.indexOf(' '+words_next[i]) ) + { + found_words.push(words_next[i]); + found_words_index += ' '+words_next[i]; + } + } + } + if ( 1 < found_words.length ) + { +// console.log('results found: %o', found_words); + wcc.results = found_words; + wcc.index = 0; + proceed_complete = true; + } + } + else + { + proceed_complete = true; + } + var num_results = wcc.results.length; + if ( proceed_complete && 0 < num_results ) + { + var index = wcc.index; + index += params.direction ? 1 : -1; + if ( num_results <= index ) + { + index = 0; + } + else if ( 0 > index ) + { + index = num_results-1; + } +// console.log('n:%s i:%s', num_results, index); + // let's not add the following operation to the transaction/undo log + component.stopTransactionLog(); + component.runAction(ac.chap.ACTION_CARET, {move:'prev_word'}); + component.runAction(ac.chap.ACTION_SELECTION, {add:true}); + component.runAction(ac.chap.ACTION_DELETE, {character:false}); + component.runAction(ac.chap.ACTION_INSERT, {string:wcc.results[index]}); + component.startTransactionLog(); + wcc.index = index; + wcc.position = [component.caret.position[0], component.caret.position[1]]; + } + else + { + wcc.results = []; + } + this.wordCompleteCache = wcc; + return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_REDRAWTEXT; +} + +ac.chap.KeyMap.prototype.getAffectedRows = function(component, caretRow) +{ + var from_row = caretRow; + var to_row = caretRow; + if (null != component.selection) + { + var start_pos = component.selection.startPosition[0]; + var end_pos = component.selection.endPosition[0]; + if (-1 == component.selection.endPosition[1]) + { + end_pos--; + } + from_row = Math.min(start_pos, end_pos); + to_row = Math.max(start_pos, end_pos); + } + return [from_row, to_row]; +} + +ac.chap.KeyMap.prototype.action_Indent = function(keyCode, controlKeysMask, caretRow, caretCol, component, params) +{ + var affected_rows = this.getAffectedRows(component, caretRow); + var tab = component.getTabelator(); + for (var i=affected_rows[0]; i<=affected_rows[1]; i++) + { + if ('right' == params.direction) + { + component.insertIntoCharacterMap(tab, i, 0); + } + else + { + var row = component.char_map[i]; + var index = 0; + while (('\t' == row.charAt(index) || ' ' == row.charAt(index)) && (row.length > index) && (tab.length > index)) index++; + if (0 < index) + { + component.removeFromCharacterMap(i, 0, i, index); + } + } + } + return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_REDRAWTEXT | ac.chap.ACTION_RES_SELECTIONCHANGED; +} + +ac.chap.KeyMap.prototype.action_Comment = function(keyCode, controlKeysMask, caretRow, caretCol, component, params) +{ + if (!component.language) + { + return 0; + } + var markers = component.language.singleRowCommentStartMarkers; + if (0 == markers.length) + { + return 0; + } + var marker = markers[0]; + var tab = component.getTabelator(); + var affected_rows = this.getAffectedRows(component, caretRow); + var tab = component.getTabelator(); + var prepend_text = marker + ' '; + for (var i=affected_rows[0]; i<=affected_rows[1]; i++) + { + var row = component.char_map[i]; + var index = row.indexOf(marker); + if (-1 != index && 0 == row.substring(0, index).replace(tab, '').replace(' ', '')) + { + // was commented + component.removeFromCharacterMap(i, 0, i, index+marker.length); + } + else + { + // will be commented + component.insertIntoCharacterMap(marker, i, 0); + } + } + return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_REDRAWTEXT | ac.chap.ACTION_RES_SELECTIONCHANGED; +} + +ac.chap.KeyMap.prototype.action_RuntimeOption = function(keyCode, controlKeysMask, caretRow, caretCol, component, params) +{ + component.setRuntimeOption(params['key'], params['value']); + return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_REDRAWTEXT | ac.chap.ACTION_RES_SELECTIONCHANGED; +} + +ac.chap.KeyMap.prototype.action_SearchInteractive = function(keyCode, controlKeysMask, caretRow, caretCol, component, params) +{ + component.showInteractiveSearch(); + return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_SELECTIONCHANGED; +} + +ac.chap.KeyMap.prototype.action_SetSearchKeyword = function(keyCode, controlKeysMask, caretRow, caretCol, component, params) +{ + if (params['keyword']) + { + this.searchKeyword = params['keyword']; + return 0; + } + if (component.selection && component.selection.startPosition[0] == component.selection.endPosition[0]) + { + this.searchKeyword = component.getSelection(); + return ac.chap.ACTION_RES_SELECTIONCHANGED; + } + return 0; +} + +ac.chap.KeyMap.prototype.action_SearchKeyword = function(keyCode, controlKeysMask, caretRow, caretCol, component, params) +{ + if ('' == this.searchKeyword) + { + return 0; + } + row_index = caretRow; + var index = 0; + var search_down = 'down' == params['direction']; + do + { + var row = component.char_map[row_index]; + var offset = 0; + console.log(ac.chap.activeComponent.activeView); + if (row_index == caretRow) + { + if (search_down) + { + // if (row.substring(caretCol, this.searchKeyword.length) == this.searchKeyword) + // { + // // offset = this.searchKeyword.length; + // } + row = row.substr(caretCol) + offset += caretCol; + } + else + { + if (row.substring(caretCol-this.searchKeyword.length, caretCol)) + { + offset = this.searchKeyword.length; + } + row = row.substring(0, caretCol - offset); + offset = 0; + } + } + index = search_down ? row.indexOf(this.searchKeyword) : row.lastIndexOf(this.searchKeyword); + if (-1 != index) + { + index += offset; + component.runAction(ac.chap.ACTION_SELECTION, {remove:true}); + component.runAction(ac.chap.ACTION_CARET, {moveTo:[row_index, index]}); + component.runAction(ac.chap.ACTION_CARET, {store:true}); + component.runAction(ac.chap.ACTION_CARET, {moveTo:[row_index, index+this.searchKeyword.length]}); + component.runAction(ac.chap.ACTION_SELECTION, {add:true}); + return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_SELECTIONCHANGED | ac.chap.ACTION_RES_SCROLLTOCARET; + } + row_index += search_down ? 1 : -1; + if (search_down && row_index == component.char_map.length) + { + row_index = 0; + } + else if (!search_down && -1 == row_index) + { + row_index = component.char_map.length-1; + } + } + while (caretRow != row_index); + return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_SELECTIONCHANGED; +} + +ac.chap.KeyMap.prototype.action_SmartIndent = function(keyCode, controlKeysMask, caretRow, caretCol, component, params) +{ + // console.log(params); + var line = component.getLineAt(caretRow); + var m = params['indent_tab_when_ends'] ? line.match(/^([ \t]*)(.*)$/) : line.match(/^([ \t]*)([^ \t]*)/); + // console.log(m); + var prepend_text = m[1]; + if (params['indent_tab_when_ends'] || params['indent_tab_when_starts']) + { + m[2] = m[2].trim(); + var indent_when_values = params['indent_tab_when_ends'] ? params['indent_tab_when_ends'].split(' ') : params['indent_tab_when_starts'].split(' '); + for (var i=0; i#'); + code = code.substr(start_ix+4, m[3].length)+'##'+code.substr(start_ix+m[0].length-m[1].length); + any_change = true; + } + else + { + break; + } + } + code_chunks.push(code); + code = code_chunks.join(''); + } + re = /##/; + while ( true ) + { + m = re.exec(code) + if ( null == m ) + { + break; + } + tabstops[m[1]][1] = tabstops[m[1]][1].replace(/##/g, ''); + tabstops[m[1]][2] = m.index; + tabstops[m[1]][3] = tabstops[m[1]][1].length; + code = code.substr(0, m.index)+code.substr(m.index+m[0].length).replace('##', ''); + } + + // [getting mirrors] + re = /\{\$\{(\d)\:([^\}]*)\}\}/; + while ( true ) + { + m = re.exec(code) + if ( null == m ) + { + break; + } + code = code.substr(0, m.index)+m[2]+code.substr(m.index+m[0].length); + var ix_end = code.indexOf('{$'+m[1]+'}'); + if ( -1 == ix_end ) + { + console.error('Invalid snippet definition. Mirror `?` does not have `{$?}` mirrored location specified.'.embed(m[1], m[1])); + break; + } + tabstops[m[1]] = ['mi', m[2], m.index, m[2].length, ix_end]; + if ( m.index > ix_end ) + { + console.error('Unsupported feature. Mirror `?` should have mirrored location positioned AFTER itself.'.embed(m[1])); + } + code = code.substr(0, ix_end)+code.substr(ix_end+4); + } + + // [getting tabstops] + re = /(^|[^\\])\$(\d)/; + while (true) + { + m = re.exec(code); + if ( null == m ) + { + break; + } + tab_id = m[2]; + if ( tabstops[tab_id] ) + { + console.error('Invalid snippet definition. Tabstop `?` already defined as placeholder at position `?`. Snippet source: `?`.'.embed(tab_id, m.index, code)); + break; + } + var start_ix = m.index+m[1].length; + tabstops[tab_id] = ['ts', '', start_ix, 0]; + code = code.substr(0, start_ix)+code.substr(start_ix+2); + var offset = m[1].length + 2; + for ( var tab_id in tabstops ) + { + // console.log('adjusting: %s, %s < %s', tab_id, start_ix, tabstops[tab_id][2]); + if ( 'mi' == tabstops[tab_id][0] ) + { + if ( start_ix < tabstops[tab_id][2] ) + { + tabstops[tab_id][2] -= offset; + } + if ( start_ix < tabstops[tab_id][4] ) + { + tabstops[tab_id][4] -= offset; + } + } + else if ( 'ph' == tabstops[tab_id][0] && start_ix < tabstops[tab_id][2] ) + { + tabstops[tab_id][2] -= offset; + } + } + } + // $0 not defined, will be at the end of the snippet by default + if ( !tabstops[0] ) + { + tabstops[0] = ['ts', '', code.length, 0]; + } + + // [postprocessing - unescape] + code = code.replace(/\0/g, '$'); + + + for ( var tab_id in tabstops ) + { + var placeholder = tabstops[tab_id]; +// console.log('#%s : %o', tab_id, placeholder); + } + var scc = + { + firstInitialized:true, + insertCaretPosition:[caretRow, caretCol], + tabstops: tabstops, + callbackIndex: -1, + activeTabStopIndex:tabstops[1] ? 1 : 0, + activeTabStopRange:[], + activeTabStopContent:'', + activeTabStopNested:[], + wasSelection:wasSelection, + tabActivation:tabActivation + } + + if ( !scc.wasSelection ) + { + component.runAction(ac.chap.ACTION_CARET, {move:'prev_word'}); + component.runAction(ac.chap.ACTION_SELECTION, {add:true}); + component.runAction(ac.chap.ACTION_DELETE, {character:true}); + } + + var tabstop = tabstops[scc.activeTabStopIndex]; + + + component.runAction(ac.chap.ACTION_INSERT, {string:code.substr(0, tabstop[2])}); + component.runAction(ac.chap.ACTION_INSERT, {string:code.substr(tabstop[2]), skipCaretChange:true}); + + // selecting default value + var selection_changed = false; + if ( '' != tabstop[1] ) + { + component.runAction(ac.chap.ACTION_CARET, {store:true}); + component.runAction(ac.chap.ACTION_CARET, {moveBy:'column', value:tabstop[1].length}); + component.runAction(ac.chap.ACTION_SELECTION, {add:true}); + selection_changed = true; + } + + if ( 0 != scc.activeTabStopIndex ) + { + // starting action listener + this.snippetCompleteCache = scc; + this.snippetCompleteCache.callbackIndex = component.addActionListener(ac.chap.ACTION_LISTENER_BOTH, this, this.snippetCompleteActionListener); + } + } + return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_REDRAWTEXT | (selection_changed ? ac.chap.ACTION_RES_SELECTIONCHANGED : 0); +// return ac.chap.ACTION_RES_REDRAWCARET | ac.chap.ACTION_RES_REDRAWTEXT; +} + +ac.chap.KeyMap.prototype.snippetCompleteActionListener = function(component, action, type, actionResult, actionType, params, caretRow, caretCol) +{ + var scc = action.snippetCompleteCache; + + if ( ac.chap.ACTION_LISTENER_BEFORE == type && !scc.firstInitialized ) + { + // before action listener + // check if we are still in the tabstop range +// var offset = component.char_map[caretRow].substr() + // console.log('activeTabStopRange: %o', scc.activeTabStopRange); + if ( caretRow < scc.activeTabStopRange[0] || caretRow > scc.activeTabStopRange[2] || caretCol < scc.activeTabStopRange[1] || caretCol > scc.activeTabStopRange[3] ) + { + // out of range, canceling whole snippet logic + component.removeActionListener(scc.callbackIndex); + component.removeSelection(); + delete action.snippetCompleteCache; + // console.log('CANCELED'); + return; + } +// console.log('before: %s - [%s,%s]', actionType, caretRow, caretCol); + } + else + { + // after action listener + if ( scc.firstInitialized ) + { + scc.firstInitialized = false; + var tabstop = scc.tabstops[scc.activeTabStopIndex]; + caretCol -= tabstop[1].length; + var code_rows = tabstop[1].split('\n'); + var num_code_rows = code_rows.length; + var to_caret_row = caretRow + num_code_rows - 1; + var to_caret_col = (to_caret_row == caretRow ? caretCol : 0) + code_rows[num_code_rows-1].length; + scc.activeTabStopRange = [caretRow, caretCol, to_caret_row, to_caret_col]; + scc.stopMarker = component.char_map[to_caret_row].substr(to_caret_col); + // creating list of nested tabstops + for ( var i in scc.tabstops ) + { + if ( i == scc.activeTabStopIndex ) + { + continue; + } + var c_tabstop = scc.tabstops[i]; + if ( c_tabstop[2] >= tabstop[2] && (c_tabstop[2] + c_tabstop[3] <= tabstop[2] + tabstop[3]) ) + { + scc.activeTabStopNested[i] = true; + } + } + if ( 'mi' != tabstop[0] ) + { + scc.activeTabStopContent = tabstop[1]; + } + scc.firstRealRun = false; + +// action.snippetCompletePostInit(component, caretRow, caretCol); + // console.log('firstRealRun: %o', scc.activeTabStopRange); + } + else + { + // console.log('next: %o', scc.activeTabStopRange); + // adjust the range by finding the stop marker + var n = component.char_map.length; + var i = scc.activeTabStopRange[0]; + var found = false; + var max_iter = 50; +// var offset_range = [scc.activeTabStopRange[2], scc.activeTabStopRange[3]]; + var new_content = ''; + var old_content = scc.activeTabStopContent; + while ( i active_offset ) + { + if ( scc.activeTabStopNested[i] ) + { + // nested + delete scc.tabstops[i]; + } + else + { + tabstop[2] += offset; + // console.log('ADJUSTING: #%s by %s, new: %s', i, offset, tabstop[2]); + } + } + } + } + } + // console.log('after %s(%s, %s) : %o', actionType, caretRow, caretCol, scc.activeTabStopRange); + } +} + + +ac.chap.KeyMap.prototype.compile = function(source) +{ + /* example: + + KEY: -13+shift + selection(add:true) + caret(move:'up') + + KEY: -27 + caret(move:'row_end') + + ... + .. + . + */ + var rows = source.split('\n'); + var n = rows.length; + var re_definition = /^KEY\:\s*[-\d]*[\+\w\s]*$/; + var re_chain = /^[^\(]*\(.*\)\s*$/; + var src = ''; + var chain = []; + var last_key_code = null; + for ( var i=0; i)/i, 0, ac.chap.CHUNK_OPERATOR], + [/(\(|\)|\[|\]|\{|\})/i, 0, ac.chap.CHUNK_PARENTHESIS] + ]; + this.wordDelimiter = /[\w\.\d]/; + this.indentIgnoreMarker = /[\.]/; +} + + +ac.chap.lang = {}; + + + + + + +/* loader stuff - you are free to modify as needed */ + + +// !! Make sure, bundle_*.js is loaded prior launching this function - the bundle defines ac.chap.langEAmy, EAmyJavaScript etc. +function showEditor(templateNode) +{ + var source = templateNode.value; + templateNode = $(templateNode); + var w = templateNode.w(); + var h = templateNode.h(); + + var node = templateNode.p().ib($$(), templateNode).w(w).h(h); + templateNode.d(false); + + var language = ac.chap.lang.JavaScript; + var keymap = ac.chap.keymap.EAmyJavaScript; + + var instance = $new(ac.chap.Window, {language:ac.chap.lang.EAmy, keymap:ac.chap.Keymap}); + instance.addView(node, {theme:ac.chap.theme.EAmy, rowHeight:11, colWidth:7, wordWrap:true, tabelator:' '}); + + instance.show(); + instance.setSnippets(eamy.snippets); + instance.keymap.importSnippets(eamy.snippets); + instance.edit(source); + eamy.instances.push(instance); + +} + +// !! Remove from here and include in your section if you want. +// document.write(''); + + +// Performed upon loading the page. You are free to remove it and call the showEditor() (or modified version of it) in order to launch the editing component. Code of the showEditor should give you enough clue. +$__tune.event.addListener(self, 'load', function(evt) +{ + // this is basically a search for any
";html=t.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;father=d.getElementById(id).parentNode;next=d.getElementById(id).nextSibling;if(next==null)father.appendChild(span); +else father.insertBefore(span,next);}if(!eAs[id]["initialized"]){t.execCommand(id,"EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(t.isIE){t.init_ie_textarea(id);}var area=eAs[id];for(i=0;i';}for(i=0;i';t.iframe_script+='';}if(!t.iframe_css){t.iframe_css="";}template=t.template.replace(/\[__BASEURL__\]/g,t.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=t.translate(template,area["settings"]["language"],"template");template=template.replace("[__CSSRULES__]",t.iframe_css);template=template.replace("[__JSCODE__]",t.iframe_script);template=template.replace("[__EA_VERSION__]",t.version);area.textarea=d.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')delete window.frames["frame_"+area["settings"]["id"]];father=area.textarea.parentNode;content=d.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["id"];content.style.borderWidth="0px";setAttribute(content,"frameBorder","0");content.style.overflow="hidden";content.style.display="none";next=area.textarea.nextSibling;if(next==null)father.appendChild(content); +else father.insertBefore(content,next);f=window.frames["frame_"+area["settings"]["id"]];f.document.open();f.eAs=eAs;f.area_id=area["settings"]["id"];f.document.area_id=area["settings"]["id"];f.document.write(template);f.document.close();},toggle:function(id,toggle_to){if(!toggle_to)toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true&&toggle_to=="off"){this.toggle_off(id);} +else if(eAs[id]["displayed"]==false&&toggle_to=="on"){this.toggle_on(id);}return false;},toggle_off:function(id){var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];if(f.editArea.fullscreen['isFull'])f.editArea.toggle_full_screen(false);eAs[id]["displayed"]=false;t.wrap="off";setAttribute(t,"wrap","off");parNod=t.parentNode;nxtSib=t.nextSibling;parNod.removeChild(t);parNod.insertBefore(t,nxtSib);t.value=f.editArea.textarea.value;selStart=f.editArea.last_selection["selectionStart"];selEnd=f.editArea.last_selection["selectionEnd"];scrollTop=f.document.getElementById("result").scrollTop;scrollLeft=f.document.getElementById("result").scrollLeft;document.getElementById("frame_"+id).style.display='none';t.style.display="inline";try{t.focus();}catch(e){};if(this.isIE){t.selectionStart=selStart;t.selectionEnd=selEnd;t.focused=true;set_IE_selection(t);} +else{if(this.isOpera&&this.isOpera < 9.6){t.setSelectionRange(0,0);}try{t.setSelectionRange(selStart,selEnd);}catch(e){};}t.scrollTop=scrollTop;t.scrollLeft=scrollLeft;f.editArea.execCommand("toggle_off");}},toggle_on:function(id){var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];area=f.editArea;area.textarea.value=t.value;curPos=eAs[id]["settings"]["cursor_position"];if(t.use_last==true){selStart=t.last_selectionStart;selEnd=t.last_selectionEnd;scrollTop=t.last_scrollTop;scrollLeft=t.last_scrollLeft;t.use_last=false;} +else if(curPos=="auto"){try{selStart=t.selectionStart;selEnd=t.selectionEnd;scrollTop=t.scrollTop;scrollLeft=t.scrollLeft;}catch(ex){}}this.set_editarea_size_from_textarea(id,document.getElementById("frame_"+id));t.style.display="none";document.getElementById("frame_"+id).style.display="inline";area.execCommand("focus");eAs[id]["displayed"]=true;area.execCommand("update_size");f.document.getElementById("result").scrollTop=scrollTop;f.document.getElementById("result").scrollLeft=scrollLeft;area.area_select(selStart,selEnd-selStart);area.execCommand("toggle_on");} +else{elem=document.getElementById(id);elem.last_selectionStart=elem.selectionStart;elem.last_selectionEnd=elem.selectionEnd;elem.last_scrollTop=elem.scrollTop;elem.last_scrollLeft=elem.scrollLeft;elem.use_last=true;eAL.start(id);}},set_editarea_size_from_textarea:function(id,frame){var elem,width,height;elem=document.getElementById(id);width=Math.max(eAs[id]["settings"]["min_width"],elem.offsetWidth)+"px";height=Math.max(eAs[id]["settings"]["min_height"],elem.offsetHeight)+"px";if(elem.style.width.indexOf("%")!=-1)width=elem.style.width;if(elem.style.height.indexOf("%")!=-1)height=elem.style.height;frame.style.width=width;frame.style.height=height;},set_base_url:function(){var t=this,elems,i,docBasePath;if(!this.baseURL){elems=document.getElementsByTagName('script');for(i=0;i';html+='';return html;},get_control_html:function(button_name,lang){var t=this,i,but,html,si;for(i=0;i";case "|":case "separator":return '';case "select_font":html="";return html;case "syntax_selection":html="";return html;}return "["+button_name+"]";},get_template:function(){if(this.template==""){var xhr_object=null;if(window.XMLHttpRequest)xhr_object=new XMLHttpRequest(); +else if(window.ActiveXObject)xhr_object=new ActiveXObject("Microsoft.XMLHTTP"); +else{alert("XMLHTTPRequest not supported. EditArea not loaded");return;}xhr_object.open("GET",this.baseURL+"template.html",false);xhr_object.send(null);if(xhr_object.readyState==4)this.template=xhr_object.responseText; +else this.has_error();}},translate:function(text,lang,mode){if(mode=="word")text=eAL.get_word_translation(text,lang); +else if(mode="template"){eAL.current_language=lang;text=text.replace(/\{\$([^\}]+)\}/gm,eAL.translate_template);}return text;},translate_template:function(){return eAL.get_word_translation(EAL.prototype.translate_template.arguments[1],eAL.current_language);},get_word_translation:function(val,lang){var i;for(i in eAL.lang[lang]){if(i==val)return eAL.lang[lang][i];}return "_"+val;},load_script:function(url){var t=this,d=document,script,head;if(t.loadedFiles[url])return;try{script=d.createElement("script");script.type="text/javascript";script.src=url;script.charset="UTF-8";d.getElementsByTagName("head")[0].appendChild(script);}catch(e){d.write('');}t.loadedFiles[url]=true;},add_event:function(obj,name,handler){try{if(obj.attachEvent){obj.attachEvent("on"+name,handler);} +else{obj.addEventListener(name,handler,false);}}catch(e){}},remove_event:function(obj,name,handler){try{if(obj.detachEvent)obj.detachEvent("on"+name,handler); +else obj.removeEventListener(name,handler,false);}catch(e){}},reset:function(e){var formObj,is_child,i,x;formObj=eAL.isIE ? window.event.srcElement:e.target;if(formObj.tagName!='FORM')formObj=formObj.form;for(i in eAs){is_child=false;for(x=0;x old_sel["start"])this.setSelectionRange(id,new_sel["end"],new_sel["end"]); +else this.setSelectionRange(id,old_sel["start"]+open_tag.length,old_sel["start"]+open_tag.length);},hide:function(id){var fs=window.frames,d=document,t=this,scrollTop,scrollLeft,span;if(d.getElementById(id)&&!t.hidden[id]){t.hidden[id]={};t.hidden[id]["selectionRange"]=t.getSelectionRange(id);if(d.getElementById(id).style.display!="none"){t.hidden[id]["scrollTop"]=d.getElementById(id).scrollTop;t.hidden[id]["scrollLeft"]=d.getElementById(id).scrollLeft;}if(fs["frame_"+id]){t.hidden[id]["toggle"]=eAs[id]["displayed"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;} +else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}t.hidden[id]["scrollTop"]=scrollTop;t.hidden[id]["scrollLeft"]=scrollLeft;if(eAs[id]["displayed"]==true)eAL.toggle_off(id);}span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='none';}d.getElementById(id).style.display="none";}},show:function(id){var fs=window.frames,d=document,t=this,span;if((elem=d.getElementById(id))&&t.hidden[id]){elem.style.display="inline";elem.scrollTop=t.hidden[id]["scrollTop"];elem.scrollLeft=t.hidden[id]["scrollLeft"];span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='inline';}if(fs["frame_"+id]){elem.style.display="inline";if(t.hidden[id]["toggle"]==true)eAL.toggle_on(id);scrollTop=t.hidden[id]["scrollTop"];scrollLeft=t.hidden[id]["scrollLeft"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;} +else{elem.scrollTop=scrollTop;elem.scrollLeft=scrollLeft;}}sel=t.hidden[id]["selectionRange"];t.setSelectionRange(id,sel["start"],sel["end"]);delete t.hidden[id];}},getCurrentFile:function(id){return this.execCommand(id,'get_file',this.execCommand(id,'curr_file'));},getFile:function(id,file_id){return this.execCommand(id,'get_file',file_id);},getAllFiles:function(id){return this.execCommand(id,'get_all_files()');},openFile:function(id,file_infos){return this.execCommand(id,'open_file',file_infos);},closeFile:function(id,file_id){return this.execCommand(id,'close_file',file_id);},setFileEditedMode:function(id,file_id,to){var reg1,reg2;reg1=new RegExp('\\\\','g');reg2=new RegExp('"','g');return this.execCommand(id,'set_file_edited_mode("'+file_id.replace(reg1,'\\\\').replace(reg2,'\\"')+'",'+to+')');},execCommand:function(id,cmd,fct_param){switch(cmd){case "EA_init":if(eAs[id]['settings']["EA_init_callback"].length>0)eval(eAs[id]['settings']["EA_init_callback"]+"('"+id+"');");break;case "EA_delete":if(eAs[id]['settings']["EA_delete_callback"].length>0)eval(eAs[id]['settings']["EA_delete_callback"]+"('"+id+"');");break;case "EA_submit":if(eAs[id]['settings']["submit_callback"].length>0)eval(eAs[id]['settings']["submit_callback"]+"('"+id+"');");break;}if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(fct_param!=undefined)return eval('window.frames["frame_'+id+'"].editArea.'+cmd+'(fct_param);'); +else return eval('window.frames["frame_'+id+'"].editArea.'+cmd+';');}return false;}};var eAL=new EAL();var eAs={}; function getAttribute(elm,aName){var aValue,taName,i;try{aValue=elm.getAttribute(aName);}catch(exept){}if(! aValue){for(i=0;i < elm.attributes.length;i++){taName=elm.attributes[i] .name.toLowerCase();if(taName==aName){aValue=elm.attributes[i] .value;return aValue;}}}return aValue;};function setAttribute(elm,attr,val){if(attr=="class"){elm.setAttribute("className",val);elm.setAttribute("class",val);} +else{elm.setAttribute(attr,val);}};function getChildren(elem,elem_type,elem_attribute,elem_attribute_match,option,depth){if(!option)var option="single";if(!depth)var depth=-1;if(elem){var children=elem.childNodes;var result=null;var results=[];for(var x=0;x0){results=results.concat(result);}} +else if(result!=null){return result;}}}}if(option=="all")return results;}return null;};function isChildOf(elem,parent){if(elem){if(elem==parent)return true;while(elem.parentNode !='undefined'){return isChildOf(elem.parentNode,parent);}}return false;};function getMouseX(e){if(e!=null&&typeof(e.pageX)!="undefined"){return e.pageX;} +else{return(e!=null?e.x:event.x)+document.documentElement.scrollLeft;}};function getMouseY(e){if(e!=null&&typeof(e.pageY)!="undefined"){return e.pageY;} +else{return(e!=null?e.y:event.y)+document.documentElement.scrollTop;}};function calculeOffsetLeft(r){return calculeOffset(r,"offsetLeft")};function calculeOffsetTop(r){return calculeOffset(r,"offsetTop")};function calculeOffset(element,attr){var offset=0;while(element){offset+=element[attr];element=element.offsetParent}return offset;};function get_css_property(elem,prop){if(document.defaultView){return document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop);} +else if(elem.currentStyle){var prop=prop.replace(/-\D/gi,function(sMatch){return sMatch.charAt(sMatch.length-1).toUpperCase();});return elem.currentStyle[prop];} +else return null;}var _mCE;function start_move_element(e,id,frame){var elem_id=(e.target||e.srcElement).id;if(id)elem_id=id;if(!frame)frame=window;if(frame.event)e=frame.event;_mCE=frame.document.getElementById(elem_id);_mCE.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);_mCE.start_pos_x=mouse_x-(_mCE.style.left.replace("px","")||calculeOffsetLeft(_mCE));_mCE.start_pos_y=mouse_y-(_mCE.style.top.replace("px","")||calculeOffsetTop(_mCE));return false;};function end_move_element(e){_mCE.frame.document.onmousemove="";_mCE.frame.document.onmouseup="";_mCE=null;};function move_element(e){var newTop,newLeft,maxLeft;if(_mCE.frame&&_mCE.frame.event)e=_mCE.frame.event;newTop=getMouseY(e)-_mCE.start_pos_y;newLeft=getMouseX(e)-_mCE.start_pos_x;maxLeft=_mCE.frame.document.body.offsetWidth-_mCE.offsetWidth;max_top=_mCE.frame.document.body.offsetHeight-_mCE.offsetHeight;newTop=Math.min(Math.max(0,newTop),max_top);newLeft=Math.min(Math.max(0,newLeft),maxLeft);_mCE.style.top=newTop+"px";_mCE.style.left=newLeft+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return{"start":textarea.selectionStart,"end":textarea.selectionEnd};};function setSelectionRange(t,start,end){t.focus();start=Math.max(0,Math.min(t.value.length,start));end=Math.max(start,Math.min(t.value.length,end));if(nav.isOpera&&nav.isOpera < 9.6){t.selectionEnd=1;t.selectionStart=0;t.selectionEnd=1;t.selectionStart=0;}t.selectionStart=start;t.selectionEnd=end;if(nav.isIE)set_IE_selection(t);};function get_IE_selection(t){var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;if(t&&t.focused){if(!t.ea_line_height){div=d.createElement("div");div.style.fontFamily=get_css_property(t,"font-family");div.style.fontSize=get_css_property(t,"font-size");div.style.visibility="hidden";div.innerHTML="0";d.body.appendChild(div);t.ea_line_height=div.offsetHeight;d.body.removeChild(div);}range=d.selection.createRange();try{stored_range=range.duplicate();stored_range.moveToElementText(t);stored_range.setEndPoint('EndToEnd',range);if(stored_range.parentElement()==t){elem=t;scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}relative_top=range.offsetTop-calculeOffsetTop(t)+scrollTop;line_start=Math.round((relative_top / t.ea_line_height)+1);line_nb=Math.round(range.boundingHeight / t.ea_line_height);range_start=stored_range.text.length-range.text.length;tab=t.value.substr(0,range_start).split("\n");range_start+=(line_start-tab.length)*2;t.selectionStart=range_start;range_end=t.selectionStart+range.text.length;tab=t.value.substr(0,range_start+range.text.length).split("\n");range_end+=(line_start+line_nb-1-tab.length)*2;t.selectionEnd=range_end;}}catch(e){}}if(t&&t.id){setTimeout("get_IE_selection(document.getElementById('"+t.id+"'));",50);}};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){event.srcElement.focused=false;}function set_IE_selection(t){var nbLineStart,nbLineStart,nbLineEnd,range;if(!window.closed){nbLineStart=t.value.substr(0,t.selectionStart).split("\n").length-1;nbLineEnd=t.value.substr(0,t.selectionEnd).split("\n").length-1;try{range=document.selection.createRange();range.moveToElementText(t);range.setEndPoint('EndToStart',range);range.moveStart('character',t.selectionStart-nbLineStart);range.moveEnd('character',t.selectionEnd-nbLineEnd-(t.selectionStart-nbLineStart));range.select();}catch(e){}}};eAL.waiting_loading["elements_functions.js"]="loaded"; + EAL.prototype.start_resize_area=function(){var d=document,a,div,width,height,father;d.onmouseup=eAL.end_resize_area;d.onmousemove=eAL.resize_area;eAL.toggle(eAL.resize["id"]);a=eAs[eAL.resize["id"]]["textarea"];div=d.getElementById("edit_area_resize");if(!div){div=d.createElement("div");div.id="edit_area_resize";div.style.border="dashed #888888 1px";}width=a.offsetWidth-2;height=a.offsetHeight-2;div.style.display="block";div.style.width=width+"px";div.style.height=height+"px";father=a.parentNode;father.insertBefore(div,a);a.style.display="none";eAL.resize["start_top"]=calculeOffsetTop(div);eAL.resize["start_left"]=calculeOffsetLeft(div);};EAL.prototype.end_resize_area=function(e){var d=document,div,a,width,height;d.onmouseup="";d.onmousemove="";div=d.getElementById("edit_area_resize");a=eAs[eAL.resize["id"]]["textarea"];width=Math.max(eAs[eAL.resize["id"]]["settings"]["min_width"],div.offsetWidth-4);height=Math.max(eAs[eAL.resize["id"]]["settings"]["min_height"],div.offsetHeight-4);if(eAL.isIE==6){width-=2;height-=2;}a.style.width=width+"px";a.style.height=height+"px";div.style.display="none";a.style.display="inline";a.selectionStart=eAL.resize["selectionStart"];a.selectionEnd=eAL.resize["selectionEnd"];eAL.toggle(eAL.resize["id"]);return false;};EAL.prototype.resize_area=function(e){var allow,newHeight,newWidth;allow=eAs[eAL.resize["id"]]["settings"]["allow_resize"];if(allow=="both"||allow=="y"){newHeight=Math.max(20,getMouseY(e)-eAL.resize["start_top"]);document.getElementById("edit_area_resize").style.height=newHeight+"px";}if(allow=="both"||allow=="x"){newWidth=Math.max(20,getMouseX(e)-eAL.resize["start_left"]);document.getElementById("edit_area_resize").style.width=newWidth+"px";}return false;};eAL.waiting_loading["resize_area.js"]="loaded"; + EAL.prototype.get_regexp=function(text_array){res="(\\b)(";for(i=0;i0)res+="|";res+=this.get_escaped_regexp(text_array[i]);}res+=")(\\b)";reg=new RegExp(res);return res;};EAL.prototype.get_escaped_regexp=function(str){return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g,"\\$1");};EAL.prototype.init_syntax_regexp=function(){var lang_style={};for(var lang in this.load_syntax){if(!this.syntax[lang]){this.syntax[lang]={};this.syntax[lang]["keywords_reg_exp"]={};this.keywords_reg_exp_nb=0;if(this.load_syntax[lang]['KEYWORDS']){param="g";if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)param+="i";for(var i in this.load_syntax[lang]['KEYWORDS']){if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function")continue;this.syntax[lang]["keywords_reg_exp"][i]=new RegExp(this.get_regexp(this.load_syntax[lang]['KEYWORDS'][i]),param);this.keywords_reg_exp_nb++;}}if(this.load_syntax[lang]['OPERATORS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['OPERATORS']){if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);nb++;}if(str.length>0)this.syntax[lang]["operators_reg_exp"]=new RegExp("("+str+")","g");}if(this.load_syntax[lang]['DELIMITERS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['DELIMITERS']){if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);nb++;}if(str.length>0)this.syntax[lang]["delimiters_reg_exp"]=new RegExp("("+str+")","g");}var syntax_trace=[];this.syntax[lang]["quotes"]={};var quote_tab=[];if(this.load_syntax[lang]['QUOTEMARKS']){for(var i in this.load_syntax[lang]['QUOTEMARKS']){if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);this.syntax[lang]["quotes"][x]=x;quote_tab[quote_tab.length]="("+x+"(\\\\.|[^"+x+"])*(?:"+x+"|$))";syntax_trace.push(x);}}this.syntax[lang]["comments"]={};if(this.load_syntax[lang]['COMMENT_SINGLE']){for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";syntax_trace.push(x);this.syntax[lang]["comments"][x]="\n";}}if(this.load_syntax[lang]['COMMENT_MULTI']){for(var i in this.load_syntax[lang]['COMMENT_MULTI']){if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function")continue;var start=this.get_escaped_regexp(i);var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";syntax_trace.push(start);syntax_trace.push(end);this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];}}if(quote_tab.length>0)this.syntax[lang]["comment_or_quote_reg_exp"]=new RegExp("("+quote_tab.join("|")+")","gi");if(syntax_trace.length>0)this.syntax[lang]["syntax_trace_regexp"]=new RegExp("((.|\n)*?)(\\\\*("+syntax_trace.join("|")+"|$))","gmi");if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){this.syntax[lang]["script_delimiters"]={};for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function")continue;this.syntax[lang]["script_delimiters"][i]=this.load_syntax[lang]['SCRIPT_DELIMITERS'];}}this.syntax[lang]["custom_regexp"]={};if(this.load_syntax[lang]['REGEXPS']){for(var i in this.load_syntax[lang]['REGEXPS']){if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function")continue;var val=this.load_syntax[lang]['REGEXPS'][i];if(!this.syntax[lang]["custom_regexp"][val['execute']])this.syntax[lang]["custom_regexp"][val['execute']]={};this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp':new RegExp(val['search'],val['modifiers']),'class':val['class']};}}if(this.load_syntax[lang]['STYLES']){lang_style[lang]={};for(var i in this.load_syntax[lang]['STYLES']){if(typeof(this.load_syntax[lang]['STYLES'][i])=="function")continue;if(typeof(this.load_syntax[lang]['STYLES'][i])!="string"){for(var j in this.load_syntax[lang]['STYLES'][i]){lang_style[lang][j]=this.load_syntax[lang]['STYLES'][i][j];}} +else{lang_style[lang][i]=this.load_syntax[lang]['STYLES'][i];}}}var style="";for(var i in lang_style[lang]){if(lang_style[lang][i].length>0){style+="."+lang+" ."+i.toLowerCase()+" span{"+lang_style[lang][i]+"}\n";style+="."+lang+" ."+i.toLowerCase()+"{"+lang_style[lang][i]+"}\n";}}this.syntax[lang]["styles"]=style;}}};eAL.waiting_loading["reg_syntax.js"]="loaded"; +var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "".replace(/Ã/g,'this').replace(/Â/g,'textarea').replace(/Ã/g,'function').replace(/Ä/g,'prototype').replace(/Ã…/g,'settings').replace(/Æ/g,'length').replace(/Ç/g,'style').replace(/È/g,'parent').replace(/É/g,'last_selection').replace(/Ê/g,'value').replace(/Ë/g,'true').replace(/ÃŒ/g,'false'); +editAreaLoader.template= " EditArea [__CSSRULES__] [__JSCODE__]
[__TOOLBAR__]
 
 
{$position}: {$line_abbr} 0, {$char_abbr} 0 {$total}: {$line_abbr} 0, {$char_abbr} 0 resize
{$processing}
{$search} {$close_popup}
{$replace} {$move_popup}

{$find_next} {$replace} {$replace_all}
{$close_popup}

Editarea [__EA_VERSION__]


{$shortcuts}:

{$tab}: {$add_tab}
{$shift}+{$tab}: {$remove_tab}
{$ctrl}+f: {$search_command}
{$ctrl}+r: {$replace_command}
{$ctrl}+h: {$highlight}
{$ctrl}+g: {$go_to_line}
{$ctrl}+z: {$undo}
{$ctrl}+y: {$redo}
{$ctrl}+e: {$help}
{$ctrl}+q, {$esc}: {$close_popup}
{$accesskey} E: {$toggle}

{$about_notice}
"; +editAreaLoader.iframe_css= ""; diff --git a/applications/admin/static/edit_area/edit_area_full_with_plugins.js b/applications/admin/static/edit_area/edit_area_full_with_plugins.js new file mode 100755 index 00000000..cf1492ea --- /dev/null +++ b/applications/admin/static/edit_area/edit_area_full_with_plugins.js @@ -0,0 +1,39 @@ + function EAL(){var t=this;t.version="0.8.1.1";date=new Date();t.start_time=date.getTime();t.win="loading";t.error=false;t.baseURL="";t.template="";t.lang={};t.load_syntax={};t.syntax={};t.loadedFiles=[];t.waiting_loading={};t.scripts_to_load=[];t.sub_scripts_to_load=[];t.resize=[];t.hidden={};t.default_settings={debug:false,smooth_selection:true,font_size:"10",font_family:"monospace",start_highlight:false,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,word_wrap,|,help",begin_toolbar:"",end_toolbar:"",is_multi_files:false,allow_resize:"both",show_line_colors:false,min_width:400,min_height:125,replace_tab_by_spaces:false,allow_toggle:true,language:"en",syntax:"",syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml",display:"onload",max_undo:30,browsers:"known",plugins:"",gecko_spellcheck:false,fullscreen:false,is_editable:true,cursor_position:"begin",word_wrap:false,autocompletion:false,load_callback:"",save_callback:"",change_callback:"",submit_callback:"",EA_init_callback:"",EA_delete_callback:"",EA_load_callback:"",EA_unload_callback:"",EA_toggle_on_callback:"",EA_toggle_off_callback:"",EA_file_switch_on_callback:"",EA_file_switch_off_callback:"",EA_file_close_callback:""};t.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['word_wrap','word_wrap.gif','toggle_word_wrap',true],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];t.set_browser_infos(t);if(t.isIE>=6||t.isGecko||(t.isWebKit&&!t.isSafari<3)||t.isOpera>=9||t.isCamino)t.isValidBrowser=true; +else t.isValidBrowser=false;t.set_base_url();for(var i=0;i0)s["toolbar"]=s["begin_toolbar"]+","+s["toolbar"];if(s["end_toolbar"].length>0)s["toolbar"]=s["toolbar"]+","+s["end_toolbar"];s["tab_toolbar"]=s["toolbar"].replace(/ /g,"").split(",");s["plugins"]=s["plugins"].replace(/ /g,"").split(",");for(i=0;i0){s["syntax"]=s["syntax"].toLowerCase();t.load_script(t.baseURL+"reg_syntax/"+s["syntax"]+".js");}eAs[s["id"]]={"settings":s};eAs[s["id"]]["displayed"]=false;eAs[s["id"]]["hidden"]=false;t.start(s["id"]);},delete_instance:function(id){var d=document,fs=window.frames,span,iframe;eAL.execCommand(id,"EA_delete");if(fs["frame_"+id]&&fs["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");fs["frame_"+id].editArea.execCommand("EA_unload");}span=d.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);iframe=d.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete fs["frame_"+id];}catch(e){}}delete eAs[id];},start:function(id){var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;if(t.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(i in t.waiting_loading){if(t.waiting_loading[i]!="loaded"&&typeof(t.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!t.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!t.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)t.init_syntax_regexp();if(!d.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){span=d.createElement("span");span.id="EditAreaArroundInfos_"+id;if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked='checked'":"";html+="
";html+="";html+="
";}if(eAs[id]["settings"]["debug"])html+="
";html=t.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;father=d.getElementById(id).parentNode;next=d.getElementById(id).nextSibling;if(next==null)father.appendChild(span); +else father.insertBefore(span,next);}if(!eAs[id]["initialized"]){t.execCommand(id,"EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(t.isIE){t.init_ie_textarea(id);}area=eAs[id];for(i=0;i';}for(i=0;i';t.iframe_script+='';}if(!t.iframe_css){t.iframe_css="";}template=t.template.replace(/\[__BASEURL__\]/g,t.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=t.translate(template,area["settings"]["language"],"template");template=template.replace("[__CSSRULES__]",t.iframe_css);template=template.replace("[__JSCODE__]",t.iframe_script);template=template.replace("[__EA_VERSION__]",t.version);area.textarea=d.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')delete window.frames["frame_"+area["settings"]["id"]];father=area.textarea.parentNode;content=d.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["id"];content.style.borderWidth="0px";setAttribute(content,"frameBorder","0");content.style.overflow="hidden";content.style.display="none";next=area.textarea.nextSibling;if(next==null)father.appendChild(content); +else father.insertBefore(content,next);f=window.frames["frame_"+area["settings"]["id"]];f.document.open();f.eAs=eAs;f.area_id=area["settings"]["id"];f.document.area_id=area["settings"]["id"];f.document.write(template);f.document.close();},toggle:function(id,toggle_to){if(!toggle_to)toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true&&toggle_to=="off"){this.toggle_off(id);} +else if(eAs[id]["displayed"]==false&&toggle_to=="on"){this.toggle_on(id);}return false;},toggle_off:function(id){var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];if(f.editArea.fullscreen['isFull'])f.editArea.toggle_full_screen(false);eAs[id]["displayed"]=false;t.wrap="off";setAttribute(t,"wrap","off");parNod=t.parentNode;nxtSib=t.nextSibling;parNod.removeChild(t);parNod.insertBefore(t,nxtSib);t.value=f.editArea.textarea.value;selStart=f.editArea.last_selection["selectionStart"];selEnd=f.editArea.last_selection["selectionEnd"];scrollTop=f.document.getElementById("result").scrollTop;scrollLeft=f.document.getElementById("result").scrollLeft;document.getElementById("frame_"+id).style.display='none';t.style.display="inline";try{t.focus();}catch(e){};if(this.isIE){t.selectionStart=selStart;t.selectionEnd=selEnd;t.focused=true;set_IE_selection(t);} +else{if(this.isOpera&&this.isOpera < 9.6){t.setSelectionRange(0,0);}try{t.setSelectionRange(selStart,selEnd);}catch(e){};}t.scrollTop=scrollTop;t.scrollLeft=scrollLeft;f.editArea.execCommand("toggle_off");}},toggle_on:function(id){var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];area=f.editArea;area.textarea.value=t.value;curPos=eAs[id]["settings"]["cursor_position"];if(t.use_last==true){selStart=t.last_selectionStart;selEnd=t.last_selectionEnd;scrollTop=t.last_scrollTop;scrollLeft=t.last_scrollLeft;t.use_last=false;} +else if(curPos=="auto"){try{selStart=t.selectionStart;selEnd=t.selectionEnd;scrollTop=t.scrollTop;scrollLeft=t.scrollLeft;}catch(ex){}}this.set_editarea_size_from_textarea(id,document.getElementById("frame_"+id));t.style.display="none";document.getElementById("frame_"+id).style.display="inline";area.execCommand("focus");eAs[id]["displayed"]=true;area.execCommand("update_size");f.document.getElementById("result").scrollTop=scrollTop;f.document.getElementById("result").scrollLeft=scrollLeft;area.area_select(selStart,selEnd-selStart);area.execCommand("toggle_on");} +else{elem=document.getElementById(id);elem.last_selectionStart=elem.selectionStart;elem.last_selectionEnd=elem.selectionEnd;elem.last_scrollTop=elem.scrollTop;elem.last_scrollLeft=elem.scrollLeft;elem.use_last=true;eAL.start(id);}},set_editarea_size_from_textarea:function(id,frame){var elem,width,height;elem=document.getElementById(id);width=Math.max(eAs[id]["settings"]["min_width"],elem.offsetWidth)+"px";height=Math.max(eAs[id]["settings"]["min_height"],elem.offsetHeight)+"px";if(elem.style.width.indexOf("%")!=-1)width=elem.style.width;if(elem.style.height.indexOf("%")!=-1)height=elem.style.height;frame.style.width=width;frame.style.height=height;},set_base_url:function(){var t=this,elems,i,docBasePath;if(!this.baseURL){elems=document.getElementsByTagName('script');for(i=0;i';html+='';return html;},get_control_html:function(button_name,lang){var t=this,i,but,html,si;for(i=0;i";case "|":case "separator":return '';case "select_font":html="";return html;case "syntax_selection":html="";return html;}return "["+button_name+"]";},get_template:function(){if(this.template==""){var xhr_object=null;if(window.XMLHttpRequest)xhr_object=new XMLHttpRequest(); +else if(window.ActiveXObject)xhr_object=new ActiveXObject("Microsoft.XMLHTTP"); +else{alert("XMLHTTPRequest not supported. EditArea not loaded");return;}xhr_object.open("GET",this.baseURL+"template.html",false);xhr_object.send(null);if(xhr_object.readyState==4)this.template=xhr_object.responseText; +else this.has_error();}},translate:function(text,lang,mode){if(mode=="word")text=eAL.get_word_translation(text,lang); +else if(mode="template"){eAL.current_language=lang;text=text.replace(/\{\$([^\}]+)\}/gm,eAL.translate_template);}return text;},translate_template:function(){return eAL.get_word_translation(EAL.prototype.translate_template.arguments[1],eAL.current_language);},get_word_translation:function(val,lang){var i;for(i in eAL.lang[lang]){if(i==val)return eAL.lang[lang][i];}return "_"+val;},load_script:function(url){var t=this,d=document,script,head;if(t.loadedFiles[url])return;try{script=d.createElement("script");script.type="text/javascript";script.src=url;script.charset="UTF-8";d.getElementsByTagName("head")[0].appendChild(script);}catch(e){d.write('');}t.loadedFiles[url]=true;},add_event:function(obj,name,handler){try{if(obj.attachEvent){obj.attachEvent("on"+name,handler);} +else{obj.addEventListener(name,handler,false);}}catch(e){}},remove_event:function(obj,name,handler){try{if(obj.detachEvent)obj.detachEvent("on"+name,handler); +else obj.removeEventListener(name,handler,false);}catch(e){}},reset:function(e){var formObj,is_child,i,x;formObj=eAL.isIE ? window.event.srcElement:e.target;if(formObj.tagName!='FORM')formObj=formObj.form;for(i in eAs){is_child=false;for(x=0;x old_sel["start"])this.setSelectionRange(id,new_sel["end"],new_sel["end"]); +else this.setSelectionRange(id,old_sel["start"]+open_tag.length,old_sel["start"]+open_tag.length);},hide:function(id){var fs=window.frames,d=document,t=this,scrollTop,scrollLeft,span;if(d.getElementById(id)&&!t.hidden[id]){t.hidden[id]={};t.hidden[id]["selectionRange"]=t.getSelectionRange(id);if(d.getElementById(id).style.display!="none"){t.hidden[id]["scrollTop"]=d.getElementById(id).scrollTop;t.hidden[id]["scrollLeft"]=d.getElementById(id).scrollLeft;}if(fs["frame_"+id]){t.hidden[id]["toggle"]=eAs[id]["displayed"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;} +else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}t.hidden[id]["scrollTop"]=scrollTop;t.hidden[id]["scrollLeft"]=scrollLeft;if(eAs[id]["displayed"]==true)eAL.toggle_off(id);}span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='none';}d.getElementById(id).style.display="none";}},show:function(id){var fs=window.frames,d=document,t=this,span;if((elem=d.getElementById(id))&&t.hidden[id]){elem.style.display="inline";elem.scrollTop=t.hidden[id]["scrollTop"];elem.scrollLeft=t.hidden[id]["scrollLeft"];span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='inline';}if(fs["frame_"+id]){elem.style.display="inline";if(t.hidden[id]["toggle"]==true)eAL.toggle_on(id);scrollTop=t.hidden[id]["scrollTop"];scrollLeft=t.hidden[id]["scrollLeft"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;} +else{elem.scrollTop=scrollTop;elem.scrollLeft=scrollLeft;}}sel=t.hidden[id]["selectionRange"];t.setSelectionRange(id,sel["start"],sel["end"]);delete t.hidden[id];}},getCurrentFile:function(id){return this.execCommand(id,'get_file',this.execCommand(id,'curr_file'));},getFile:function(id,file_id){return this.execCommand(id,'get_file',file_id);},getAllFiles:function(id){return this.execCommand(id,'get_all_files()');},openFile:function(id,file_infos){return this.execCommand(id,'open_file',file_infos);},closeFile:function(id,file_id){return this.execCommand(id,'close_file',file_id);},setFileEditedMode:function(id,file_id,to){var reg1,reg2;reg1=new RegExp('\\\\','g');reg2=new RegExp('"','g');return this.execCommand(id,'set_file_edited_mode("'+file_id.replace(reg1,'\\\\').replace(reg2,'\\"')+'",'+to+')');},execCommand:function(id,cmd,fct_param){switch(cmd){case "EA_init":if(eAs[id]['settings']["EA_init_callback"].length>0)eval(eAs[id]['settings']["EA_init_callback"]+"('"+id+"');");break;case "EA_delete":if(eAs[id]['settings']["EA_delete_callback"].length>0)eval(eAs[id]['settings']["EA_delete_callback"]+"('"+id+"');");break;case "EA_submit":if(eAs[id]['settings']["submit_callback"].length>0)eval(eAs[id]['settings']["submit_callback"]+"('"+id+"');");break;}if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(fct_param!=undefined)return eval('window.frames["frame_'+id+'"].editArea.'+cmd+'(fct_param);'); +else return eval('window.frames["frame_'+id+'"].editArea.'+cmd+';');}return false;}};var eAL=new EAL();var eAs={}; function getAttribute(elm,aName){var aValue,taName,i;try{aValue=elm.getAttribute(aName);}catch(exept){}if(! aValue){for(i=0;i < elm.attributes.length;i++){taName=elm.attributes[i] .name.toLowerCase();if(taName==aName){aValue=elm.attributes[i] .value;return aValue;}}}return aValue;};function setAttribute(elm,attr,val){if(attr=="class"){elm.setAttribute("className",val);elm.setAttribute("class",val);} +else{elm.setAttribute(attr,val);}};function getChildren(elem,elem_type,elem_attribute,elem_attribute_match,option,depth){if(!option)var option="single";if(!depth)var depth=-1;if(elem){var children=elem.childNodes;var result=null;var results=[];for(var x=0;x0){results=results.concat(result);}} +else if(result!=null){return result;}}}}if(option=="all")return results;}return null;};function isChildOf(elem,parent){if(elem){if(elem==parent)return true;while(elem.parentNode !='undefined'){return isChildOf(elem.parentNode,parent);}}return false;};function getMouseX(e){if(e!=null&&typeof(e.pageX)!="undefined"){return e.pageX;} +else{return(e!=null?e.x:event.x)+document.documentElement.scrollLeft;}};function getMouseY(e){if(e!=null&&typeof(e.pageY)!="undefined"){return e.pageY;} +else{return(e!=null?e.y:event.y)+document.documentElement.scrollTop;}};function calculeOffsetLeft(r){return calculeOffset(r,"offsetLeft")};function calculeOffsetTop(r){return calculeOffset(r,"offsetTop")};function calculeOffset(element,attr){var offset=0;while(element){offset+=element[attr];element=element.offsetParent}return offset;};function get_css_property(elem,prop){if(document.defaultView){return document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop);} +else if(elem.currentStyle){var prop=prop.replace(/-\D/gi,function(sMatch){return sMatch.charAt(sMatch.length-1).toUpperCase();});return elem.currentStyle[prop];} +else return null;}var _mCE;function start_move_element(e,id,frame){var elem_id=(e.target||e.srcElement).id;if(id)elem_id=id;if(!frame)frame=window;if(frame.event)e=frame.event;_mCE=frame.document.getElementById(elem_id);_mCE.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);_mCE.start_pos_x=mouse_x-(_mCE.style.left.replace("px","")||calculeOffsetLeft(_mCE));_mCE.start_pos_y=mouse_y-(_mCE.style.top.replace("px","")||calculeOffsetTop(_mCE));return false;};function end_move_element(e){_mCE.frame.document.onmousemove="";_mCE.frame.document.onmouseup="";_mCE=null;};function move_element(e){var newTop,newLeft,maxLeft;if(_mCE.frame&&_mCE.frame.event)e=_mCE.frame.event;newTop=getMouseY(e)-_mCE.start_pos_y;newLeft=getMouseX(e)-_mCE.start_pos_x;maxLeft=_mCE.frame.document.body.offsetWidth-_mCE.offsetWidth;max_top=_mCE.frame.document.body.offsetHeight-_mCE.offsetHeight;newTop=Math.min(Math.max(0,newTop),max_top);newLeft=Math.min(Math.max(0,newLeft),maxLeft);_mCE.style.top=newTop+"px";_mCE.style.left=newLeft+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return{"start":textarea.selectionStart,"end":textarea.selectionEnd};};function setSelectionRange(t,start,end){t.focus();start=Math.max(0,Math.min(t.value.length,start));end=Math.max(start,Math.min(t.value.length,end));if(this.isOpera&&this.isOpera < 9.6){t.selectionEnd=1;t.selectionStart=0;t.selectionEnd=1;t.selectionStart=0;}t.selectionStart=start;t.selectionEnd=end;if(isIE)set_IE_selection(t);};function get_IE_selection(t){var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;if(t&&t.focused){if(!t.ea_line_height){div=d.createElement("div");div.style.fontFamily=get_css_property(t,"font-family");div.style.fontSize=get_css_property(t,"font-size");div.style.visibility="hidden";div.innerHTML="0";d.body.appendChild(div);t.ea_line_height=div.offsetHeight;d.body.removeChild(div);}range=d.selection.createRange();try{stored_range=range.duplicate();stored_range.moveToElementText(t);stored_range.setEndPoint('EndToEnd',range);if(stored_range.parentElement()==t){elem=t;scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}relative_top=range.offsetTop-calculeOffsetTop(t)+scrollTop;line_start=Math.round((relative_top / t.ea_line_height)+1);line_nb=Math.round(range.boundingHeight / t.ea_line_height);range_start=stored_range.text.length-range.text.length;tab=t.value.substr(0,range_start).split("\n");range_start+=(line_start-tab.length)*2;t.selectionStart=range_start;range_end=t.selectionStart+range.text.length;tab=t.value.substr(0,range_start+range.text.length).split("\n");range_end+=(line_start+line_nb-1-tab.length)*2;t.selectionEnd=range_end;}}catch(e){}}setTimeout("get_IE_selection(document.getElementById('"+t.id+"'));",50);};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){event.srcElement.focused=false;}function set_IE_selection(t){var nbLineStart,nbLineStart,nbLineEnd,range;if(!window.closed){nbLineStart=t.value.substr(0,t.selectionStart).split("\n").length-1;nbLineEnd=t.value.substr(0,t.selectionEnd).split("\n").length-1;try{range=document.selection.createRange();range.moveToElementText(t);range.setEndPoint('EndToStart',range);range.moveStart('character',t.selectionStart-nbLineStart);range.moveEnd('character',t.selectionEnd-nbLineEnd-(t.selectionStart-nbLineStart));range.select();}catch(e){}}};eAL.waiting_loading["elements_functions.js"]="loaded"; + EAL.prototype.start_resize_area=function(){var d=document,a,div,width,height,father;d.onmouseup=eAL.end_resize_area;d.onmousemove=eAL.resize_area;eAL.toggle(eAL.resize["id"]);a=eAs[eAL.resize["id"]]["textarea"];div=d.getElementById("edit_area_resize");if(!div){div=d.createElement("div");div.id="edit_area_resize";div.style.border="dashed #888888 1px";}width=a.offsetWidth-2;height=a.offsetHeight-2;div.style.display="block";div.style.width=width+"px";div.style.height=height+"px";father=a.parentNode;father.insertBefore(div,a);a.style.display="none";eAL.resize["start_top"]=calculeOffsetTop(div);eAL.resize["start_left"]=calculeOffsetLeft(div);};EAL.prototype.end_resize_area=function(e){var d=document,div,a,width,height;d.onmouseup="";d.onmousemove="";div=d.getElementById("edit_area_resize");a=eAs[eAL.resize["id"]]["textarea"];width=Math.max(eAs[eAL.resize["id"]]["settings"]["min_width"],div.offsetWidth-4);height=Math.max(eAs[eAL.resize["id"]]["settings"]["min_height"],div.offsetHeight-4);if(eAL.isIE==6){width-=2;height-=2;}a.style.width=width+"px";a.style.height=height+"px";div.style.display="none";a.style.display="inline";a.selectionStart=eAL.resize["selectionStart"];a.selectionEnd=eAL.resize["selectionEnd"];eAL.toggle(eAL.resize["id"]);return false;};EAL.prototype.resize_area=function(e){var allow,newHeight,newWidth;allow=eAs[eAL.resize["id"]]["settings"]["allow_resize"];if(allow=="both"||allow=="y"){newHeight=Math.max(20,getMouseY(e)-eAL.resize["start_top"]);document.getElementById("edit_area_resize").style.height=newHeight+"px";}if(allow=="both"||allow=="x"){newWidth=Math.max(20,getMouseX(e)-eAL.resize["start_left"]);document.getElementById("edit_area_resize").style.width=newWidth+"px";}return false;};eAL.waiting_loading["resize_area.js"]="loaded"; + EAL.prototype.get_regexp=function(text_array){res="(\\b)(";for(i=0;i0)res+="|";res+=this.get_escaped_regexp(text_array[i]);}res+=")(\\b)";reg=new RegExp(res);return res;};EAL.prototype.get_escaped_regexp=function(str){return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g,"\\$1");};EAL.prototype.init_syntax_regexp=function(){var lang_style={};for(var lang in this.load_syntax){if(!this.syntax[lang]){this.syntax[lang]={};this.syntax[lang]["keywords_reg_exp"]={};this.keywords_reg_exp_nb=0;if(this.load_syntax[lang]['KEYWORDS']){param="g";if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)param+="i";for(var i in this.load_syntax[lang]['KEYWORDS']){if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function")continue;this.syntax[lang]["keywords_reg_exp"][i]=new RegExp(this.get_regexp(this.load_syntax[lang]['KEYWORDS'][i]),param);this.keywords_reg_exp_nb++;}}if(this.load_syntax[lang]['OPERATORS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['OPERATORS']){if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);nb++;}if(str.length>0)this.syntax[lang]["operators_reg_exp"]=new RegExp("("+str+")","g");}if(this.load_syntax[lang]['DELIMITERS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['DELIMITERS']){if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);nb++;}if(str.length>0)this.syntax[lang]["delimiters_reg_exp"]=new RegExp("("+str+")","g");}var syntax_trace=[];this.syntax[lang]["quotes"]={};var quote_tab=[];if(this.load_syntax[lang]['QUOTEMARKS']){for(var i in this.load_syntax[lang]['QUOTEMARKS']){if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);this.syntax[lang]["quotes"][x]=x;quote_tab[quote_tab.length]="("+x+"(\\\\.|[^"+x+"])*(?:"+x+"|$))";syntax_trace.push(x);}}this.syntax[lang]["comments"]={};if(this.load_syntax[lang]['COMMENT_SINGLE']){for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";syntax_trace.push(x);this.syntax[lang]["comments"][x]="\n";}}if(this.load_syntax[lang]['COMMENT_MULTI']){for(var i in this.load_syntax[lang]['COMMENT_MULTI']){if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function")continue;var start=this.get_escaped_regexp(i);var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";syntax_trace.push(start);syntax_trace.push(end);this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];}}if(quote_tab.length>0)this.syntax[lang]["comment_or_quote_reg_exp"]=new RegExp("("+quote_tab.join("|")+")","gi");if(syntax_trace.length>0)this.syntax[lang]["syntax_trace_regexp"]=new RegExp("((.|\n)*?)(\\\\*("+syntax_trace.join("|")+"|$))","gmi");if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){this.syntax[lang]["script_delimiters"]={};for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function")continue;this.syntax[lang]["script_delimiters"][i]=this.load_syntax[lang]['SCRIPT_DELIMITERS'];}}this.syntax[lang]["custom_regexp"]={};if(this.load_syntax[lang]['REGEXPS']){for(var i in this.load_syntax[lang]['REGEXPS']){if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function")continue;var val=this.load_syntax[lang]['REGEXPS'][i];if(!this.syntax[lang]["custom_regexp"][val['execute']])this.syntax[lang]["custom_regexp"][val['execute']]={};this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp':new RegExp(val['search'],val['modifiers']),'class':val['class']};}}if(this.load_syntax[lang]['STYLES']){lang_style[lang]={};for(var i in this.load_syntax[lang]['STYLES']){if(typeof(this.load_syntax[lang]['STYLES'][i])=="function")continue;if(typeof(this.load_syntax[lang]['STYLES'][i])!="string"){for(var j in this.load_syntax[lang]['STYLES'][i]){lang_style[lang][j]=this.load_syntax[lang]['STYLES'][i][j];}} +else{lang_style[lang][i]=this.load_syntax[lang]['STYLES'][i];}}}var style="";for(var i in lang_style[lang]){if(lang_style[lang][i].length>0){style+="."+lang+" ."+i.toLowerCase()+" span{"+lang_style[lang][i]+"}\n";style+="."+lang+" ."+i.toLowerCase()+"{"+lang_style[lang][i]+"}\n";}}this.syntax[lang]["styles"]=style;}}};eAL.waiting_loading["reg_syntax.js"]="loaded"; +var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "".replace(/Ã/g,'this').replace(/Â/g,'textarea').replace(/Ã/g,'function').replace(/Ä/g,'prototype').replace(/Ã…/g,'settings').replace(/Æ/g,'length').replace(/Ç/g,'style').replace(/È/g,'parent').replace(/É/g,'last_selection').replace(/Ê/g,'value').replace(/Ë/g,'true').replace(/ÃŒ/g,'false'); +editAreaLoader.all_plugins_loaded=true; +editAreaLoader.template= " EditArea [__CSSRULES__] [__JSCODE__]
[__TOOLBAR__]
 
 
{$position}: {$line_abbr} 0, {$char_abbr} 0 {$total}: {$line_abbr} 0, {$char_abbr} 0 resize
{$processing}
{$search} {$close_popup}
{$replace} {$move_popup}

{$find_next} {$replace} {$replace_all}
{$close_popup}

Editarea [__EA_VERSION__]


{$shortcuts}:

{$tab}: {$add_tab}
{$shift}+{$tab}: {$remove_tab}
{$ctrl}+f: {$search_command}
{$ctrl}+r: {$replace_command}
{$ctrl}+h: {$highlight}
{$ctrl}+g: {$go_to_line}
{$ctrl}+z: {$undo}
{$ctrl}+y: {$redo}
{$ctrl}+e: {$help}
{$ctrl}+q, {$esc}: {$close_popup}
{$accesskey} E: {$toggle}

{$about_notice}
"; +editAreaLoader.iframe_css= ""; diff --git a/applications/admin/static/edit_area/edit_area_functions.js b/applications/admin/static/edit_area/edit_area_functions.js new file mode 100755 index 00000000..4067b03a --- /dev/null +++ b/applications/admin/static/edit_area/edit_area_functions.js @@ -0,0 +1,1202 @@ + //replace tabulation by the good number of white spaces + EditArea.prototype.replace_tab= function(text){ + return text.replace(/((\n?)([^\t\n]*)\t)/gi, editArea.smartTab); // slower than simple replace... + }; + + // call by the replace_tab function + EditArea.prototype.smartTab= function(){ + val=" "; + return EditArea.prototype.smartTab.arguments[2] + EditArea.prototype.smartTab.arguments[3] + val.substr(0, editArea.tab_nb_char - (EditArea.prototype.smartTab.arguments[3].length)%editArea.tab_nb_char); + }; + + EditArea.prototype.show_waiting_screen= function(){ + width = this.editor_area.offsetWidth; + height = this.editor_area.offsetHeight; + if( !(this.isIE && this.isIE<6) ) + { + width -= 2; + height -= 2; + } + this.processing_screen.style.display= "block"; + this.processing_screen.style.width = width+"px"; + this.processing_screen.style.height = height+"px"; + this.waiting_screen_displayed = true; + }; + + EditArea.prototype.hide_waiting_screen= function(){ + this.processing_screen.style.display="none"; + this.waiting_screen_displayed= false; + }; + + EditArea.prototype.add_style= function(styles){ + if(styles.length>0){ + newcss = document.createElement("style"); + newcss.type="text/css"; + newcss.media="all"; + if(newcss.styleSheet){ // IE + newcss.styleSheet.cssText = styles; + } else { // W3C + newcss.appendChild(document.createTextNode(styles)); + } + document.getElementsByTagName("head")[0].appendChild(newcss); + } + }; + + EditArea.prototype.set_font= function(family, size){ + var t=this, a=this.textarea, s=this.settings, elem_font, i, elem; + // list all elements concerned by font changes + var elems= ["textarea", "content_highlight", "cursor_pos", "end_bracket", "selection_field", "selection_field_text", "line_number"]; + + if(family && family!="") + s["font_family"]= family; + if(size && size>0) + s["font_size"] = size; + if( t.isOpera && t.isOpera < 9.6 ) // opera<9.6 can't manage non monospace font + s['font_family']="monospace"; + + // update the select tag + if( elem_font = _$("area_font_size") ) + { + for( i = 0; i < elem_font.length; i++ ) + { + if( elem_font.options[i].value && elem_font.options[i].value == s["font_size"] ) + elem_font.options[i].selected=true; + } + } + + /* + * somethimes firefox has rendering mistake with non-monospace font for text width in textarea vs in div for changing font size (eg: verdana change between 11pt to 12pt) + * => looks like a browser internal random bug as text width can change while content_highlight is updated + * we'll check if the font-size produce the same text width inside textarea and div and if not, we'll increment the font-size + * + * This is an ugly fix + */ + if( t.isFirefox ) + { + var nbTry = 3; + do { + var div1 = document.createElement( 'div' ), text1 = document.createElement( 'textarea' ); + var styles = { + width: '40px', + overflow: 'scroll', + zIndex: 50, + visibility: 'hidden', + fontFamily: s["font_family"], + fontSize: s["font_size"]+"pt", + lineHeight: t.lineHeight+"px", + padding: '0', + margin: '0', + border: 'none', + whiteSpace: 'nowrap' + }; + var diff, changed = false; + for( i in styles ) + { + div1.style[ i ] = styles[i]; + text1.style[ i ] = styles[i]; + } + // no wrap for this text + text1.wrap = 'off'; + text1.setAttribute('wrap', 'off'); + t.container.appendChild( div1 ); + t.container.appendChild( text1 ); + // try to make FF to bug + div1.innerHTML = text1.value = 'azertyuiopqsdfghjklm'; + div1.innerHTML = text1.value = text1.value+'wxcvbn^p*ù$!:;,,'; + diff = text1.scrollWidth - div1.scrollWidth; + + // firefox return here a diff of 1 px between equals scrollWidth (can't explain) + if( Math.abs( diff ) >= 2 ) + { + s["font_size"]++; + changed = true; + } + t.container.removeChild( div1 ); + t.container.removeChild( text1 ); + nbTry--; + }while( changed && nbTry > 0 ); + } + + + // calc line height + elem = t.test_font_size; + elem.style.fontFamily = ""+s["font_family"]; + elem.style.fontSize = s["font_size"]+"pt"; + elem.innerHTML = "0"; + t.lineHeight = elem.offsetHeight; + + // update font for all concerned elements + for( i=0; i tags + t.add_style("pre{font-family:"+s["font_family"]+"}"); + + // old opera and IE>=8 doesn't update font changes to the textarea + if( ( t.isOpera && t.isOpera < 9.6 ) || t.isIE >= 8 ) + { + var parNod = a.parentNode, nxtSib = a.nextSibling, start= a.selectionStart, end= a.selectionEnd; + parNod.removeChild(a); + parNod.insertBefore(a, nxtSib); + t.area_select(start, end-start); + } + + // force update of selection field + this.focus(); + this.update_size(); + this.check_line_selection(); + }; + + EditArea.prototype.change_font_size= function(){ + var size=_$("area_font_size").value; + if(size>0) + this.set_font("", size); + }; + + + EditArea.prototype.open_inline_popup= function(popup_id){ + this.close_all_inline_popup(); + var popup= _$(popup_id); + var editor= _$("editor"); + + // search matching icon + for(var i=0; i lines.length) + start= this.textarea.value.length; + else{ + for(var i=0; i0){ + //alert(miss_top); + zone.scrollTop= zone.scrollTop + miss_top; + }else if( zone.scrollTop > cursor_pos_top){ + // when erase all the content -> does'nt scroll back to the top + //alert("else: "+cursor_pos_top); + zone.scrollTop= cursor_pos_top; + } + + // manage left scroll + //var cursor_pos_left= parseInt(_$("cursor_pos").style.left.replace("px","")); + var cursor_pos_left= _$("cursor_pos").cursor_left; + var max_width_visible= zone.clientWidth + zone.scrollLeft; + var miss_left= cursor_pos_left + 10 - max_width_visible; + if(miss_left>0){ + zone.scrollLeft= zone.scrollLeft + miss_left + 50; + }else if( zone.scrollLeft > cursor_pos_left){ + zone.scrollLeft= cursor_pos_left ; + }else if( zone.scrollLeft == 45){ + // show the line numbers if textarea align to it's left + zone.scrollLeft=0; + } + }; + + EditArea.prototype.check_undo= function(only_once){ + if(!editAreas[this.id]) + return false; + if(this.textareaFocused && editAreas[this.id]["displayed"]==true){ + var text=this.textarea.value; + if(this.previous.length<=1) + this.switchClassSticky(_$("undo"), 'editAreaButtonDisabled', true); + + if(!this.previous[this.previous.length-1] || this.previous[this.previous.length-1]["text"] != text){ + this.previous.push({"text": text, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd}); + if(this.previous.length > this.settings["max_undo"]+1) + this.previous.shift(); + + } + if(this.previous.length >= 2) + this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false); + } + + if(!only_once) + setTimeout("editArea.check_undo()", 3000); + }; + + EditArea.prototype.undo= function(){ + //alert("undo"+this.previous.length); + if(this.previous.length > 0) + { + this.getIESelection(); + // var pos_cursor=this.textarea.selectionStart; + this.next.push( { "text": this.textarea.value, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd } ); + var prev= this.previous.pop(); + if( prev["text"] == this.textarea.value && this.previous.length > 0 ) + prev =this.previous.pop(); + this.textarea.value = prev["text"]; + this.last_undo = prev["text"]; + this.area_select(prev["selStart"], prev["selEnd"]-prev["selStart"]); + this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false); + this.resync_highlight(true); + //alert("undo"+this.previous.length); + this.check_file_changes(); + } + }; + + EditArea.prototype.redo= function(){ + if(this.next.length > 0) + { + /*this.getIESelection();*/ + //var pos_cursor=this.textarea.selectionStart; + var next= this.next.pop(); + this.previous.push(next); + this.textarea.value= next["text"]; + this.last_undo= next["text"]; + this.area_select(next["selStart"], next["selEnd"]-next["selStart"]); + this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false); + this.resync_highlight(true); + this.check_file_changes(); + } + if( this.next.length == 0) + this.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true); + }; + + EditArea.prototype.check_redo= function(){ + if(editArea.next.length == 0 || editArea.textarea.value!=editArea.last_undo){ + editArea.next= []; // undo the ability to use "redo" button + editArea.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true); + } + else + { + this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false); + } + }; + + + // functions that manage icons roll over, disabled, etc... + EditArea.prototype.switchClass = function(element, class_name, lock_state) { + var lockChanged = false; + + if (typeof(lock_state) != "undefined" && element != null) { + element.classLock = lock_state; + lockChanged = true; + } + + if (element != null && (lockChanged || !element.classLock)) { + element.oldClassName = element.className; + element.className = class_name; + } + }; + + EditArea.prototype.restoreAndSwitchClass = function(element, class_name) { + if (element != null && !element.classLock) { + this.restoreClass(element); + this.switchClass(element, class_name); + } + }; + + EditArea.prototype.restoreClass = function(element) { + if (element != null && element.oldClassName && !element.classLock) { + element.className = element.oldClassName; + element.oldClassName = null; + } + }; + + EditArea.prototype.setClassLock = function(element, lock_state) { + if (element != null) + element.classLock = lock_state; + }; + + EditArea.prototype.switchClassSticky = function(element, class_name, lock_state) { + var lockChanged = false; + if (typeof(lock_state) != "undefined" && element != null) { + element.classLock = lock_state; + lockChanged = true; + } + + if (element != null && (lockChanged || !element.classLock)) { + element.className = class_name; + element.oldClassName = class_name; + } + }; + + //make the "page up" and "page down" buttons works correctly + EditArea.prototype.scroll_page= function(params){ + var dir= params["dir"], shift_pressed= params["shift"]; + var lines= this.textarea.value.split("\n"); + var new_pos=0, length=0, char_left=0, line_nb=0, curLine=0; + var toScrollAmount = _$("result").clientHeight -30; + var nbLineToScroll = 0, diff= 0; + + if(dir=="up"){ + nbLineToScroll = Math.ceil( toScrollAmount / this.lineHeight ); + + // fix number of line to scroll + for( i = this.last_selection["line_start"]; i - diff > this.last_selection["line_start"] - nbLineToScroll ; i-- ) + { + if( elem = _$('line_'+ i) ) + { + diff += Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight ); + } + } + nbLineToScroll -= diff; + + if(this.last_selection["selec_direction"]=="up"){ + for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]-nbLineToScroll, lines.length); line_nb++){ + new_pos+= lines[line_nb].length + 1; + } + char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1); + if(shift_pressed) + length=this.last_selection["selectionEnd"]-new_pos-char_left; + this.area_select(new_pos+char_left, length); + view="top"; + }else{ + view="bottom"; + for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-1-nbLineToScroll, lines.length); line_nb++){ + new_pos+= lines[line_nb].length + 1; + } + char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1); + if(shift_pressed){ + //length=this.last_selection["selectionEnd"]-new_pos-char_left; + start= Math.min(this.last_selection["selectionStart"], new_pos+char_left); + length= Math.max(new_pos+char_left, this.last_selection["selectionStart"] )- start ; + if(new_pos+char_left < this.last_selection["selectionStart"]) + view="top"; + }else + start=new_pos+char_left; + this.area_select(start, length); + + } + } + else + { + var nbLineToScroll= Math.floor( toScrollAmount / this.lineHeight ); + // fix number of line to scroll + for( i = this.last_selection["line_start"]; i + diff < this.last_selection["line_start"] + nbLineToScroll ; i++ ) + { + if( elem = _$('line_'+ i) ) + { + diff += Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight ); + } + } + nbLineToScroll -= diff; + + if(this.last_selection["selec_direction"]=="down"){ + view="bottom"; + for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-2+nbLineToScroll, lines.length); line_nb++){ + if(line_nb==this.last_selection["line_start"]-1) + char_left= this.last_selection["selectionStart"] -new_pos; + new_pos+= lines[line_nb].length + 1; + + } + if(shift_pressed){ + length=Math.abs(this.last_selection["selectionStart"]-new_pos); + length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]); + //length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left); + this.area_select(Math.min(this.last_selection["selectionStart"], new_pos), length); + }else{ + this.area_select(new_pos+char_left, 0); + } + + }else{ + view="top"; + for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+nbLineToScroll-1, lines.length, lines.length); line_nb++){ + if(line_nb==this.last_selection["line_start"]-1) + char_left= this.last_selection["selectionStart"] -new_pos; + new_pos+= lines[line_nb].length + 1; + } + if(shift_pressed){ + length=Math.abs(this.last_selection["selectionEnd"]-new_pos-char_left); + length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"])- char_left-1; + //length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left); + this.area_select(Math.min(this.last_selection["selectionEnd"], new_pos+char_left), length); + if(new_pos+char_left > this.last_selection["selectionEnd"]) + view="bottom"; + }else{ + this.area_select(new_pos+char_left, 0); + } + + } + } + //console.log( new_pos, char_left, length, nbLineToScroll, toScrollAmount, _$("result").clientHeigh ); + this.check_line_selection(); + this.scroll_to_view(view); + }; + + EditArea.prototype.start_resize= function(e){ + parent.editAreaLoader.resize["id"] = editArea.id; + parent.editAreaLoader.resize["start_x"] = (e)? e.pageX : event.x + document.body.scrollLeft; + parent.editAreaLoader.resize["start_y"] = (e)? e.pageY : event.y + document.body.scrollTop; + if(editArea.isIE) + { + editArea.textarea.focus(); + editArea.getIESelection(); + } + parent.editAreaLoader.resize["selectionStart"] = editArea.textarea.selectionStart; + parent.editAreaLoader.resize["selectionEnd"] = editArea.textarea.selectionEnd; + parent.editAreaLoader.start_resize_area(); + }; + + EditArea.prototype.toggle_full_screen= function(to){ + var t=this, p=parent, a=t.textarea, html, frame, selStart, selEnd, old, icon; + if(typeof(to)=="undefined") + to= !t.fullscreen['isFull']; + old = t.fullscreen['isFull']; + t.fullscreen['isFull']= to; + icon = _$("fullscreen"); + selStart = t.textarea.selectionStart; + selEnd = t.textarea.selectionEnd; + html = p.document.getElementsByTagName("html")[0]; + frame = p.document.getElementById("frame_"+t.id); + + if(to && to!=old) + { // toogle on fullscreen + + t.fullscreen['old_overflow'] = p.get_css_property(html, "overflow"); + t.fullscreen['old_height'] = p.get_css_property(html, "height"); + t.fullscreen['old_width'] = p.get_css_property(html, "width"); + t.fullscreen['old_scrollTop'] = html.scrollTop; + t.fullscreen['old_scrollLeft'] = html.scrollLeft; + t.fullscreen['old_zIndex'] = p.get_css_property(frame, "z-index"); + if(t.isOpera){ + html.style.height = "100%"; + html.style.width = "100%"; + } + html.style.overflow = "hidden"; + html.scrollTop = 0; + html.scrollLeft = 0; + + frame.style.position = "absolute"; + frame.style.width = html.clientWidth+"px"; + frame.style.height = html.clientHeight+"px"; + frame.style.display = "block"; + frame.style.zIndex = "999999"; + frame.style.top = "0px"; + frame.style.left = "0px"; + + // if the iframe was in a div with position absolute, the top and left are the one of the div, + // so I fix it by seeing at witch position the iframe start and correcting it + frame.style.top = "-"+p.calculeOffsetTop(frame)+"px"; + frame.style.left = "-"+p.calculeOffsetLeft(frame)+"px"; + + // parent.editAreaLoader.execCommand(t.id, "update_size();"); + // var body=parent.document.getElementsByTagName("body")[0]; + // body.appendChild(frame); + + t.switchClassSticky(icon, 'editAreaButtonSelected', false); + t.fullscreen['allow_resize']= t.resize_allowed; + t.allow_resize(false); + + //t.area_select(selStart, selEnd-selStart); + + + // opera can't manage to do a direct size update + if(t.isFirefox){ + p.editAreaLoader.execCommand(t.id, "update_size();"); + t.area_select(selStart, selEnd-selStart); + t.scroll_to_view(); + t.focus(); + }else{ + setTimeout("parent.editAreaLoader.execCommand('"+ t.id +"', 'update_size();');editArea.focus();", 10); + } + + + } + else if(to!=old) + { // toogle off fullscreen + frame.style.position="static"; + frame.style.zIndex= t.fullscreen['old_zIndex']; + + if(t.isOpera) + { + html.style.height = "auto"; + html.style.width = "auto"; + html.style.overflow = "auto"; + } + else if(t.isIE && p!=top) + { // IE doesn't manage html overflow in frames like in normal page... + html.style.overflow = "auto"; + } + else + { + html.style.overflow = t.fullscreen['old_overflow']; + } + html.scrollTop = t.fullscreen['old_scrollTop']; + html.scrollLeft = t.fullscreen['old_scrollLeft']; + + p.editAreaLoader.hide(t.id); + p.editAreaLoader.show(t.id); + + t.switchClassSticky(icon, 'editAreaButtonNormal', false); + if(t.fullscreen['allow_resize']) + t.allow_resize(t.fullscreen['allow_resize']); + if(t.isFirefox){ + t.area_select(selStart, selEnd-selStart); + setTimeout("editArea.scroll_to_view();", 10); + } + + //p.editAreaLoader.remove_event(p.window, "resize", editArea.update_size); + } + + }; + + EditArea.prototype.allow_resize= function(allow){ + var resize= _$("resize_area"); + if(allow){ + + resize.style.visibility="visible"; + parent.editAreaLoader.add_event(resize, "mouseup", editArea.start_resize); + }else{ + resize.style.visibility="hidden"; + parent.editAreaLoader.remove_event(resize, "mouseup", editArea.start_resize); + } + this.resize_allowed= allow; + }; + + + EditArea.prototype.change_syntax= function(new_syntax, is_waiting){ + // alert("cahnge to "+new_syntax); + // the syntax is the same + if(new_syntax==this.settings['syntax']) + return true; + + // check that the syntax is one allowed + var founded= false; + for(var i=0; i"; + elem.innerHTML= "*"+ this.files[id]['title'] + close +""; + _$('tab_browsing_list').appendChild(elem); + var elem= document.createElement('text'); + this.update_size(); + } + + // open file callback (for plugin) + if(id!="") + this.execCommand('file_open', this.files[id]); + + this.switch_to_file(id, true); + return true; + } + else + return false; + }; + + // close the given file + EditArea.prototype.close_file= function(id){ + if(this.files[id]) + { + this.save_file(id); + + // close file callback + if(this.execCommand('file_close', this.files[id])!==false) + { + // remove the tab in the toolbar + var li= _$(this.files[id]['html_id']); + li.parentNode.removeChild(li); + // select a new file + if(id== this.curr_file) + { + var next_file= ""; + var is_next= false; + for(var i in this.files) + { + if( is_next ) + { + next_file = i; + break; + } + else if( i == id ) + is_next = true; + else + next_file = i; + } + // display the next file + this.switch_to_file(next_file); + } + // clear datas + delete (this.files[id]); + this.update_size(); + } + } + }; + + // backup current file datas + EditArea.prototype.save_file= function(id){ + var t= this, save, a_links, a_selects, save_butt, img, i; + if(t.files[id]) + { + var save= t.files[id]; + save['last_selection'] = t.last_selection; + save['last_text_to_highlight'] = t.last_text_to_highlight; + save['last_hightlighted_text'] = t.last_hightlighted_text; + save['previous'] = t.previous; + save['next'] = t.next; + save['last_undo'] = t.last_undo; + save['smooth_selection'] = t.smooth_selection; + save['do_highlight'] = t.do_highlight; + save['syntax'] = t.settings['syntax']; + save['text'] = t.textarea.value; + save['scroll_top'] = t.result.scrollTop; + save['scroll_left'] = t.result.scrollLeft; + save['selection_start'] = t.last_selection["selectionStart"]; + save['selection_end'] = t.last_selection["selectionEnd"]; + save['font_size'] = t.settings["font_size"]; + save['font_family'] = t.settings["font_family"]; + save['word_wrap'] = t.settings["word_wrap"]; + save['toolbar'] = {'links':{}, 'selects': {}}; + + // save toolbar buttons state for fileSpecific buttons + a_links= _$("toolbar_1").getElementsByTagName("a"); + for( i=0; i