--- /dev/null
+<?php
+/*******************************************************************************
+ * Copyright (C) 2007 Easter-eggs
+ * http://ldapsaisie.labs.libre-entreprise.org
+ *
+ * Author: See AUTHORS file in top-level directory.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+******************************************************************************/
+
+class LSsmoothbox {
+
+ /*
+ * Méthode chargeant les dépendances d'affichage
+ *
+ * @retval void
+ */
+ public static function loadDependenciesDisplay() {
+ if (LSsession :: loadLSclass('LSconfirmBox')) {
+ LSconfirmBox :: loadDependenciesDisplay();
+ }
+ LSsession :: addJSscript('LSsmoothbox.js');
+ LSsession :: addCssFile('LSsmoothbox.css');
+
+ LSsession :: addJSconfigParam('LSsmoothbox_labels', array(
+ 'close_confirm_text' => _('Are you sure to want to close this window and lose all changes ?'),
+ 'validate' => _('Validate')
+ ));
+ }
+
+}
+
+?>
var LSsmoothbox = new Class({
initialize: function(options) {
+ this.labels = varLSdefault.LSjsConfig['LSsmoothbox_labels'];
+ if (!$type(this.labels)) {
+ this.labels = {
+ close_confirm_text: 'Are you sure to want to close this window and lose all changes ?',
+ validate: 'Validate'
+ };
+ }
this.build();
this._displayValidBtn = false;
this.validBtn = new Element('span');
this.validBtn.setProperty('id','validBtn-LSsmoothbox');
- this.validBtn.set('html','Valider');
+ this.validBtn.set('html',this.labels.validate);
this.validBtn.injectInside(this.win);
this.validBtn.addEvent('click',this.valid.bindWithEvent(this,true));
},
var startStyles = this.getStartStyles();
var endStyles = this.getEndStyles();
-
- this.closeStyles = startStyles;
this.win.setStyles(startStyles);
this.fx.winOpen.setOptions({onComplete: this.displayContent.bind(this)});
if (!this._closeConfirmOpened) {
this._closeConfirmOpened = 1;
this.confirmBox = new LSconfirmBox({
- text: 'Are you sure to want to close this window and lose all changes ?',
- title: 'Warning',
- validate_label: 'Validate',
- cancel_label: 'Cancel',
+ text: this.labels.close_confirm_text,
startElement: this.closeBtn,
onConfirm: this.cancel.bind(this),
onClose: (function(){this._closeConfirmOpened=0;}).bind(this)
delete this.confirmBox;
}
+ var closeStyles = {
+ width: 0,
+ height: 0,
+ top: this.closeBtn.getTop(),
+ left: this.closeBtn.getLeft()
+ };
+
this.fx.over.cancel();
this.fx.over.start(0);
this.hideContent();
this.fx.winClose.start({
- width: this.closeStyles.width,
- height: this.closeStyles.height,
- top: this.closeStyles.top,
- left: this.closeStyles.left,
+ width: closeStyles.width,
+ height: closeStyles.height,
+ top: closeStyles.top,
+ left: closeStyles.left,
opacity: [1, 0]
});
this._open=0;
fnct(this);
}
catch(e) {
- LSdebug('LSsmoothbox :: '+event+'() -> rater');
+ LSdebug('LSsmoothbox :: '+event+'() -> failed');
}
},this);
}