From c2e50df89f1edc866507ace22183bdbe7aee0214 Mon Sep 17 00:00:00 2001 From: Bartek Igielski Date: Thu, 4 May 2017 08:23:59 +0200 Subject: [PATCH 1/3] Updated whitelist and blacklist to target more JS files --- .../Test/Js/_files/blacklist/magento.txt | 32 +++++++++---------- .../Test/Js/_files/whitelist/magento.txt | 7 +++- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt index 4842ec2677765..e476e1ed28b2f 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt @@ -1,27 +1,27 @@ -app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js -app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js -app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/options/price-type-handler.js +// 3RD PARTY LIBS app/code/Magento/Customer/view/frontend/web/js/zxcvbn.js -app/code/Magento/Rule/view/adminhtml/web/rules.js -app/code/Magento/Sales/view/adminhtml/web/order/create/giftmessage.js -app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js -app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js -app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/magento-swagger.js -app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui.js -app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/en.js -app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/es.js -app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/pt.js -app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/ru.js -app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/translator.js app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/backbone-min.js -app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/marked.js -app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/swagger-oauth.js app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/handlebars-2.0.0.js app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/highlight.7.3.pack.js app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/jquery-1.8.0.min.js app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/jquery.ba-bbq.min.js app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/jquery.slideto.min.js app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/jquery.wiggle.min.js +app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/marked.js +app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/swagger-oauth.js app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/underscore-min.js + +// TO REFACTORING +app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js +app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js +app/code/Magento/Rule/view/adminhtml/web/rules.js +app/code/Magento/Sales/view/adminhtml/web/order/create/giftmessage.js +app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js +app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui.js lib/web/mage/adminhtml/tools.js lib/web/mage/adminhtml/varienLoader.js +lib/web/magnifier/magnifier.js +lib/web/magnifier/magnify.js +lib/web/varien/form.js +lib/web/varien/js.js diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt index 159b91df0b4fe..817397fbf03f6 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt @@ -1,5 +1,10 @@ app/code/**/*.js app/design/**/*.js dev/tests/js/jasmine/tests/**/*.js +lib/web/css/docs/source/js/dropdown.js +lib/web/extjs/defaults.js +lib/web/less/config.less.js lib/web/mage/**/*.js -vendor/magento/**/*.js \ No newline at end of file +lib/web/magnifier/**/*.js +lib/web/varien/**/*.js +vendor/magento/**/*.js From 398e3950c3e7dbaf9d33dc834493e59486c1d293 Mon Sep 17 00:00:00 2001 From: Bartek Igielski Date: Thu, 4 May 2017 08:36:45 +0200 Subject: [PATCH 2/3] Automatic refactor using fix flag for ESLint and JSCS --- .../view/adminhtml/web/js/direct-post.js | 595 +- .../catalog/product/composite/configure.js | 184 +- .../Magento/Rule/view/adminhtml/web/rules.js | 141 +- .../adminhtml/web/order/create/giftmessage.js | 529 +- .../view/adminhtml/web/order/packaging.js | 1569 +- .../frontend/web/swagger-ui/js/lang/en.js | 96 +- .../frontend/web/swagger-ui/js/lang/es.js | 94 +- .../frontend/web/swagger-ui/js/lang/pt.js | 96 +- .../frontend/web/swagger-ui/js/lang/ru.js | 94 +- .../web/swagger-ui/js/lang/translator.js | 27 +- .../web/swagger-ui/js/magento-swagger.js | 43 +- .../frontend/web/swagger-ui/js/swagger-ui.js | 55394 ++++++++-------- lib/web/css/docs/source/js/dropdown.js | 18 +- lib/web/less/config.less.js | 4 +- lib/web/mage/adminhtml/tools.js | 266 +- lib/web/mage/adminhtml/varienLoader.js | 114 +- lib/web/magnifier/magnifier.js | 112 +- lib/web/magnifier/magnify.js | 113 +- lib/web/varien/form.js | 183 +- lib/web/varien/js.js | 291 +- 20 files changed, 31607 insertions(+), 28356 deletions(-) diff --git a/app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js b/app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js index 11da861ea5b85..e43341ca2b337 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js +++ b/app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js @@ -6,322 +6,347 @@ (function (factory) { if (typeof define === 'function' && define.amd) { define([ - "jquery", - "mage/backend/validation", - "prototype" + 'jquery', + 'mage/backend/validation', + 'prototype' ], factory); } else { factory(jQuery); } }(function (jQuery) { -window.directPost = Class.create(); -directPost.prototype = { - initialize : function(methodCode, iframeId, controller, orderSaveUrl, cgiUrl, nativeAction) { - var prepare = function (event, method) { - if (method === 'authorizenet_directpost') { - this.preparePayment(); - } else { - jQuery('#edit_form') - .off('submitOrder.authorizenet'); + window.directPost = Class.create(); + directPost.prototype = { + initialize: function (methodCode, iframeId, controller, orderSaveUrl, cgiUrl, nativeAction) { + var prepare = function (event, method) { + if (method === 'authorizenet_directpost') { + this.preparePayment(); + } else { + jQuery('#edit_form') + .off('submitOrder.authorizenet'); + } + }; + + this.iframeId = iframeId; + this.controller = controller; + this.orderSaveUrl = orderSaveUrl; + this.nativeAction = nativeAction; + this.cgiUrl = cgiUrl; + this.code = methodCode; + this.inputs = ['cc_type', 'cc_number', 'expiration', 'expiration_yr', 'cc_cid']; + this.headers = []; + this.isValid = true; + this.paymentRequestSent = false; + this.orderIncrementId = false; + this.successUrl = false; + this.hasError = false; + this.tmpForm = false; + + this.onLoadIframe = this.loadIframe.bindAsEventListener(this); + this.onLoadOrderIframe = this.loadOrderIframe.bindAsEventListener(this); + this.onSubmitAdminOrder = this.submitAdminOrder.bindAsEventListener(this); + + jQuery('#edit_form').on('changePaymentMethod', prepare.bind(this)); + + jQuery('#edit_form').trigger( + 'changePaymentMethod', + [ + jQuery('#edit_form').find(':radio[name="payment[method]"]:checked').val() + ] + ); + }, + + validate: function () { + this.isValid = true; + this.inputs.each(function (elemIndex) { + if ($(this.code + '_' + elemIndex)) { + if (!jQuery.validator.validateElement($(this.code + '_' + elemIndex))) { + this.isValid = false; + } + } + }, this); + + return this.isValid; + }, + + changeInputOptions: function (param, value) { + this.inputs.each(function (elemIndex) { + if ($(this.code + '_' + elemIndex)) { + $(this.code + '_' + elemIndex).writeAttribute(param, value); + } + }, this); + }, + + preparePayment: function () { + this.changeInputOptions('autocomplete', 'off'); + jQuery('#edit_form') + .off('submitOrder') + .on('submitOrder.authorizenet', this.submitAdminOrder.bind(this)); + + if ($(this.iframeId)) { + // Temporary solution will be removed after refactoring Authorize.Net (sales) functionality + jQuery('.scalable.save:not(disabled)').removeAttr('onclick'); + jQuery(document).off('click.directPost'); + jQuery(document).on( + 'click.directPost', + '.scalable.save:not(disabled)', + jQuery.proxy(this.onSubmitAdminOrder, this) + ); + $('order-' + this.iframeId).observe('load', this.onLoadOrderIframe); + $(this.iframeId).observe('load', this.onLoadIframe); } - }; - this.iframeId = iframeId; - this.controller = controller; - this.orderSaveUrl = orderSaveUrl; - this.nativeAction = nativeAction; - this.cgiUrl = cgiUrl; - this.code = methodCode; - this.inputs = ['cc_type', 'cc_number', 'expiration', 'expiration_yr', 'cc_cid']; - this.headers = []; - this.isValid = true; - this.paymentRequestSent = false; - this.orderIncrementId = false; - this.successUrl = false; - this.hasError = false; - this.tmpForm = false; - - this.onLoadIframe = this.loadIframe.bindAsEventListener(this); - this.onLoadOrderIframe = this.loadOrderIframe.bindAsEventListener(this); - this.onSubmitAdminOrder = this.submitAdminOrder.bindAsEventListener(this); - - jQuery('#edit_form').on('changePaymentMethod', prepare.bind(this)); - - jQuery('#edit_form').trigger( - 'changePaymentMethod', - [ - jQuery('#edit_form').find(':radio[name="payment[method]"]:checked').val() - ] - ); - }, - - validate : function() { - this.isValid = true; - this.inputs.each(function(elemIndex) { - if ($(this.code + '_' + elemIndex)) { - if (!jQuery.validator.validateElement($(this.code + '_' + elemIndex))) { - this.isValid = false; + }, + + loadIframe: function () { + if (this.paymentRequestSent) { + if (!this.orderRequestSent) { + this.paymentRequestSent = false; + + if (!this.hasError) { + this.returnQuote(); + } else { + this.changeInputOptions('disabled', false); + jQuery('body').trigger('processStop'); + enableElements('save'); + } + } + + if (this.tmpForm) { + document.body.removeChild(this.tmpForm); } } - }, this); + }, - return this.isValid; - }, + loadOrderIframe: function () { + if (this.orderRequestSent) { + $(this.iframeId).hide(); + var data = $('order-' + this.iframeId).contentWindow.document.body.getElementsByTagName('pre')[0].innerHTML; - changeInputOptions : function(param, value) { - this.inputs.each(function(elemIndex) { - if ($(this.code + '_' + elemIndex)) { - $(this.code + '_' + elemIndex).writeAttribute(param, value); + this.saveAdminOrderSuccess(data); + this.orderRequestSent = false; } - }, this); - }, - - preparePayment : function() { - this.changeInputOptions('autocomplete', 'off'); - jQuery('#edit_form') - .off('submitOrder') - .on('submitOrder.authorizenet', this.submitAdminOrder.bind(this)); - if ($(this.iframeId)) { - // Temporary solution will be removed after refactoring Authorize.Net (sales) functionality - jQuery('.scalable.save:not(disabled)').removeAttr('onclick'); - jQuery(document).off('click.directPost'); - jQuery(document).on( - 'click.directPost', - '.scalable.save:not(disabled)', - jQuery.proxy(this.onSubmitAdminOrder, this) - ); - $('order-' + this.iframeId).observe('load', this.onLoadOrderIframe); - $(this.iframeId).observe('load', this.onLoadIframe); - } - }, - - loadIframe : function() { - if (this.paymentRequestSent) { - if (!this.orderRequestSent) { - this.paymentRequestSent = false; - if (!this.hasError) { - this.returnQuote(); - } else { + }, + + showError: function (msg) { + this.hasError = true; + + if (this.controller == 'onepage') { + $(this.iframeId).hide(); + this.resetLoadWaiting(); + } + alert(msg); + }, + + returnQuote: function () { + var url = this.orderSaveUrl.replace('place', 'returnQuote'); + + new Ajax.Request(url, { + onSuccess: function (transport) { + try { + response = transport.responseText.evalJSON(true); + } catch (e) { + response = {}; + } + + if (response.error_message) { + alert(response.error_message); + } + $(this.iframeId).show(); this.changeInputOptions('disabled', false); jQuery('body').trigger('processStop'); enableElements('save'); + }.bind(this) + }); + }, + + setLoadWaiting: function () { + this.headers.each(function (header) { + header.removeClassName('allow'); + }); + checkout.setLoadWaiting('review'); + }, + + resetLoadWaiting: function () { + this.headers.each(function (header) { + header.addClassName('allow'); + }); + checkout.setLoadWaiting(false); + }, + + submitAdminOrder: function () { + // Temporary solution will be removed after refactoring Authorize.Net (sales) functionality + var editForm = jQuery('#edit_form'); + + if (editForm.valid()) { + // Temporary solution will be removed after refactoring Authorize.Net (sales) functionality + paymentMethodEl = editForm.find(':radio[name="payment[method]"]:checked'); + this.hasError = false; + + if (paymentMethodEl.val() == this.code) { + jQuery('body').trigger('processStart'); + setLoaderPosition(); + this.changeInputOptions('disabled', 'disabled'); + this.paymentRequestSent = true; + this.orderRequestSent = true; + // Temporary solutions will be removed after refactoring Authorize.Net (sales) functionality + editForm.attr('action', this.orderSaveUrl); + editForm.attr('target', + jQuery('#order-' + this.iframeId).attr('name')); + editForm.append(this.createHiddenElement('controller', this.controller)); + disableElements('save'); + // Temporary solutions will be removed after refactoring Authorize.Net (sales) functionality + order._realSubmit(); + } else { + editForm.attr('action', this.nativeAction); + editForm.attr('target', '_top'); + disableElements('save'); + // Temporary solutions will be removed after refactoring Authorize.Net (sales) functionality + order._realSubmit(); } } - if (this.tmpForm) { - document.body.removeChild(this.tmpForm); + }, + + recollectQuote: function () { + var area = ['sidebar', 'items', 'shipping_method', 'billing_method', 'totals', 'giftmessage']; + + area = order.prepareArea(area); + var url = order.loadBaseUrl + 'block/' + area; + var info = $('order-items_grid').select('input', 'select', 'textarea'); + var data = {}; + + for (var i = 0; i < info.length; i++) { + if (!info[i].disabled && (info[i].type != 'checkbox' || info[i].checked)) { + data[info[i].name] = info[i].getValue(); + } } - } - }, - - loadOrderIframe : function() { - if (this.orderRequestSent) { - $(this.iframeId).hide(); - var data = $('order-' + this.iframeId).contentWindow.document.body.getElementsByTagName('pre')[0].innerHTML; - this.saveAdminOrderSuccess(data); - this.orderRequestSent = false; - } - }, + data.reset_shipping = true; + data.update_items = true; - showError : function(msg) { - this.hasError = true; - if (this.controller == 'onepage') { - $(this.iframeId).hide(); - this.resetLoadWaiting(); - } - alert(msg); - }, - - returnQuote : function() { - var url = this.orderSaveUrl.replace('place', 'returnQuote'); - new Ajax.Request(url, { - onSuccess : function(transport) { - try { - response = transport.responseText.evalJSON(true); - } catch (e) { - response = {}; + if ($('coupons:code') && $F('coupons:code')) { + data['order[coupon][code]'] = $F('coupons:code'); + } + data.json = true; + new Ajax.Request(url, { + parameters: data, + loaderArea: 'html-body', + onSuccess: function (transport) { + jQuery('#edit_form').submit(); } - if (response.error_message) { - alert(response.error_message); + }); + + }, + + saveAdminOrderSuccess: function (data) { + try { + response = data.evalJSON(true); + } catch (e) { + response = {}; + } + + if (response.directpost) { + this.orderIncrementId = response.directpost.fields.x_invoice_num; + var paymentData = {}; + + for (var key in response.directpost.fields) { + paymentData[key] = response.directpost.fields[key]; } - $(this.iframeId).show(); - this.changeInputOptions('disabled', false); - jQuery('body').trigger('processStop'); - enableElements('save'); - }.bind(this) - }); - }, - - setLoadWaiting : function() { - this.headers.each(function(header) { - header.removeClassName('allow'); - }); - checkout.setLoadWaiting('review'); - }, - - resetLoadWaiting : function() { - this.headers.each(function(header) { - header.addClassName('allow'); - }); - checkout.setLoadWaiting(false); - }, - - submitAdminOrder : function() { - // Temporary solution will be removed after refactoring Authorize.Net (sales) functionality - var editForm = jQuery('#edit_form'); - if (editForm.valid()) { - // Temporary solution will be removed after refactoring Authorize.Net (sales) functionality - paymentMethodEl = editForm.find(':radio[name="payment[method]"]:checked'); - this.hasError = false; - if (paymentMethodEl.val() == this.code) { - jQuery('body').trigger('processStart'); - setLoaderPosition(); - this.changeInputOptions('disabled', 'disabled'); - this.paymentRequestSent = true; - this.orderRequestSent = true; - // Temporary solutions will be removed after refactoring Authorize.Net (sales) functionality - editForm.attr('action', this.orderSaveUrl); - editForm.attr('target', - jQuery('#order-' + this.iframeId).attr('name')); - editForm.append(this.createHiddenElement('controller', this.controller)); - disableElements('save'); - // Temporary solutions will be removed after refactoring Authorize.Net (sales) functionality - order._realSubmit(); + var preparedData = this.preparePaymentRequest(paymentData); + + this.sendPaymentRequest(preparedData); } else { - editForm.attr('action', this.nativeAction); - editForm.attr('target', '_top'); - disableElements('save'); - // Temporary solutions will be removed after refactoring Authorize.Net (sales) functionality - order._realSubmit(); + if (response.redirect) { + window.location = response.redirect; + } + + if (response.error_messages) { + var msg = response.error_messages; + + if (typeof msg == 'object') { + msg = msg.join('\n'); + } + + if (msg) { + alert(msg); + } + } } - } - }, - - recollectQuote : function() { - var area = [ 'sidebar', 'items', 'shipping_method', 'billing_method', 'totals', 'giftmessage' ]; - area = order.prepareArea(area); - var url = order.loadBaseUrl + 'block/' + area; - var info = $('order-items_grid').select('input', 'select', 'textarea'); - var data = {}; - for ( var i = 0; i < info.length; i++) { - if (!info[i].disabled && (info[i].type != 'checkbox' || info[i].checked)) { - data[info[i].name] = info[i].getValue(); + }, + + preparePaymentRequest: function (data) { + if ($(this.code + '_cc_cid')) { + data.x_card_code = $(this.code + '_cc_cid').value; } - } - data.reset_shipping = true; - data.update_items = true; - if ($('coupons:code') && $F('coupons:code')) { - data['order[coupon][code]'] = $F('coupons:code'); - } - data.json = true; - new Ajax.Request(url, { - parameters : data, - loaderArea : 'html-body', - onSuccess : function(transport) { - jQuery('#edit_form').submit(); - }.bind(this) - }); - - }, - - saveAdminOrderSuccess : function(data) { - try { - response = data.evalJSON(true); - } catch (e) { - response = {}; - } + var year = $(this.code + '_expiration_yr').value; - if (response.directpost) { - this.orderIncrementId = response.directpost.fields.x_invoice_num; - var paymentData = {}; - for ( var key in response.directpost.fields) { - paymentData[key] = response.directpost.fields[key]; + if (year.length > 2) { + year = year.substring(2); } - var preparedData = this.preparePaymentRequest(paymentData); - this.sendPaymentRequest(preparedData); - } else { - if (response.redirect) { - window.location = response.redirect; + var month = parseInt($(this.code + '_expiration').value, 10); + + if (month < 10) { + month = '0' + month; } - if (response.error_messages) { - var msg = response.error_messages; - if (typeof (msg) == 'object') { - msg = msg.join("\n"); - } - if (msg) { - alert(msg); - } + + data.x_exp_date = month + '/' + year; + data.x_card_num = $(this.code + '_cc_number').value; + + return data; + }, + + sendPaymentRequest: function (preparedData) { + this.recreateIframe(); + this.tmpForm = document.createElement('form'); + this.tmpForm.style.display = 'none'; + this.tmpForm.enctype = 'application/x-www-form-urlencoded'; + this.tmpForm.method = 'POST'; + document.body.appendChild(this.tmpForm); + this.tmpForm.action = this.cgiUrl; + this.tmpForm.target = $(this.iframeId).readAttribute('name'); + this.tmpForm.setAttribute('target', $(this.iframeId).readAttribute('name')); + + for (var param in preparedData) { + this.tmpForm.appendChild(this.createHiddenElement(param, preparedData[param])); } - } - }, - preparePaymentRequest : function(data) { - if ($(this.code + '_cc_cid')) { - data.x_card_code = $(this.code + '_cc_cid').value; - } - var year = $(this.code + '_expiration_yr').value; - if (year.length > 2) { - year = year.substring(2); - } - var month = parseInt($(this.code + '_expiration').value, 10); - if (month < 10) { - month = '0' + month; - } + this.paymentRequestSent = true; + this.tmpForm.submit(); + }, - data.x_exp_date = month + '/' + year; - data.x_card_num = $(this.code + '_cc_number').value; - - return data; - }, - - sendPaymentRequest : function(preparedData) { - this.recreateIframe(); - this.tmpForm = document.createElement('form'); - this.tmpForm.style.display = 'none'; - this.tmpForm.enctype = 'application/x-www-form-urlencoded'; - this.tmpForm.method = 'POST'; - document.body.appendChild(this.tmpForm); - this.tmpForm.action = this.cgiUrl; - this.tmpForm.target = $(this.iframeId).readAttribute('name'); - this.tmpForm.setAttribute('target', $(this.iframeId).readAttribute('name')); - - for ( var param in preparedData) { - this.tmpForm.appendChild(this.createHiddenElement(param, preparedData[param])); - } + createHiddenElement: function (name, value) { + var field; - this.paymentRequestSent = true; - this.tmpForm.submit(); - }, - - createHiddenElement : function(name, value) { - var field; - if (isIE) { - field = document.createElement('input'); - field.setAttribute('type', 'hidden'); - field.setAttribute('name', name); - field.setAttribute('value', value); - } else { - field = document.createElement('input'); - field.type = 'hidden'; - field.name = name; - field.value = value; - } + if (isIE) { + field = document.createElement('input'); + field.setAttribute('type', 'hidden'); + field.setAttribute('name', name); + field.setAttribute('value', value); + } else { + field = document.createElement('input'); + field.type = 'hidden'; + field.name = name; + field.value = value; + } - return field; - }, - - recreateIframe : function() { - if ($(this.iframeId)) { - var nextElement = $(this.iframeId).next(); - var src = $(this.iframeId).readAttribute('src'); - var name = $(this.iframeId).readAttribute('name'); - $(this.iframeId).stopObserving(); - $(this.iframeId).remove(); - var iframe = '