const Routing = require('./routing') const FormPnw = function(w) { this.window = w } FormPnw.prototype.init = function() { var doc = this.window.document doc.addEventListener('mousemove', function() { var forms = doc.querySelectorAll('form[data-form-bot]') for (var i = 0, len = forms.length; i < len; i++) { var form = forms[i] var action = form.getAttribute('action') action = action.replace(Routing.generate('blog_tech_form_without_javascript', [], false) + '?page=', '') action = decodeURIComponent(action) form.setAttribute('action', action) form.removeAttribute('data-form-bot') } }) } module.exports = FormPnw