--- /dev/null
+(function($){
+ /**
+ * Enable or disable an error message.
+ *
+ * <p id="my-error-message">The world is one fire.</p>
+ * Ex: $('#my-error-message').toggleError(false)
+ *
+ * @param bool isError
+ */
+ $.fn.toggleError = function (isError) {
+ this.toggleClass('install-validate-ok', !isError)
+ .toggleClass('install-validate-bad', isError)
+ .toggleClass('error', isError);
+
+ var errors = $('.install-validate-bad');
+ $('#install_button').prop('disabled', errors.length > 0);
+ return this;
+ };
+
+ /**
+ * Ex: $('.watch-these').useValidator(function(){
+ * $('#some-error-message').toggleError(booleanExpression);
+ * })
+ * @param cb
+ */
+ $.fn.useValidator = function(cb) {
+ cb();
+ this.on('change', cb);
+ return this;
+ };
+})($);
\ No newline at end of file
font-size: 80%;
}
+.civicrm-setup-body .install-validate-ok {
+ display: none;
+}
+
+.civicrm-setup-body .install-validate-bad {
+}
+
.civicrm-setup-body .reqTable {
border-collapse: collapse;
width: 100%;
.civicrm-setup-body input[type=submit]:hover {
background: #60A237;
}
+.civicrm-setup-body input[type=submit]:disabled {
+ background: #888;
+ cursor: not-allowed;
+}
.civicrm-setup-body .settingsTable input[type=text] { width: 80%; }
$r->body = $body;
$r->assets = [
['type' => 'script-url', 'url' => $this->getUrl('jquery.js')],
+ ['type' => 'script-url', 'url' => $this->urls['res'] . "installer.js"],
['type' => 'script-code', 'code' => 'window.csj$ = jQuery.noConflict();'],
['type' => 'style-url', 'url' => $this->urls['res'] . "template.css"],
['type' => 'style-url', 'url' => $this->getUrl('font-awesome.css')],