partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 56c34bf317712190db0a7756790810aba26c75d1
parent 3e2e9bf500f2dd4e19e17fe8e9dc55c648ee4ee1
Author: Felicitus <felicitus@felicitus.org>
Date:   Thu, 30 Jun 2011 02:30:22 +0200

Made autologin and different parameters suitable for deferred JS loading

Diffstat:
Mfrontend/index.php | 8++++----
Mfrontend/js/PartKeepr.js | 8+++++++-
2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/frontend/index.php b/frontend/index.php @@ -58,14 +58,14 @@ $maxUploadSize = ($maxPostSize < $maxFilesize) ? $maxPostSize : $maxFilesize; $imagick = new Imagick(); ?> <script type="text/javascript"> - -PartKeepr.setMaxUploadSize(<?php echo $maxUploadSize; ?>); -PartKeepr.setAvailableImageFormats(<?php echo json_encode($imagick->queryFormats()); ?>); +window.maxUploadSize = <?php echo $maxUploadSize; ?>; +window.availableImageFormats = <?php echo json_encode($imagick->queryFormats()); ?>; <?php if ($autoLogin) { ?> -PartKeepr.setAutoLogin("admin","admin"); +window.autoLoginUsername = "admin"; +window.autoLoginPassword = "admin"; <?php } ?> diff --git a/frontend/js/PartKeepr.js b/frontend/js/PartKeepr.js @@ -19,7 +19,13 @@ Ext.application({ var o = new PartKeepr.LoginDialog(); o.show(); - + + PartKeepr.setMaxUploadSize(window.maxUploadSize); + PartKeepr.setAvailableImageFormats(window.availableImageFormats); + + if (window.autoLoginUsername) { + PartKeepr.setAutoLogin(window.autoLoginUsername,window.autoLoginPassword); + } Ext.QuickTips.init(); }, login: function () {