/* globals jQuery, ripples */ (function($) { // Selector to select only not already processed elements $.expr[":"].notmdproc = function(obj){ if ($(obj).data("mdproc")) { return false; } else { return true; } }; function _isChar(evt) { if (typeof evt.which == "undefined") { return true; } else if (typeof evt.which == "number" && evt.which > 0) { return !evt.ctrlKey && !evt.metaKey && !evt.altKey && evt.which != 8; } return false; } $.material = { "options": { "withRipples": ".btn:not(.btn-link), .card-image, .navbar a:not(.withoutripple), .nav-tabs a:not(.withoutripple), .withripple", "inputElements": "input.form-control, textarea.form-control, select.form-control", "checkboxElements": ".checkbox > label > input[type=checkbox]", "radioElements": ".radio > label > input[type=radio]" }, "checkbox": function(selector) { // Add fake-checkbox to material checkboxes $((selector) ? selector : this.options.checkboxElements) .filter(":notmdproc") .data("mdproc", true) .after(""); }, "radio": function(selector) { // Add fake-radio to material radios $((selector) ? selector : this.options.radioElements) .filter(":notmdproc") .data("mdproc", true) .after(""); }, "input": function(selector) { $((selector) ? selector : this.options.inputElements) .filter(":notmdproc") .data("mdproc", true) .each( function() { var $this = $(this); $this.wrap("
"); $this.after(""); if ($this.hasClass("floating-label")) { var placeholder = $this.attr("placeholder"); $this.attr("placeholder", null).removeClass("floating-label"); $this.after("