D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
htdocs
/
modules
/
site-import
/
scripts
/
Filename :
common.js
back
Copy
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved. // Convert newlines to HTML line breaks (<br/> tag) function nl2br(str) { return str.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1<br/>$2'); } function formatStr(str) { return nl2br(str.escapeHTML()); } // Get URL to migrator's image (from htdocs/images directory) specified by image filename, // which could be used in "src" attribute of <img> tag. function migratorImage(image) { return "/modules/site-import/images/" + image; } // Shortcut to toggle (show/hide) child elements of specified root element matching specified CSS class. function toggleChildElement(rootElement, childClass, isToggle) { rootElement.select('.' + childClass).each(function(childElement) { childElement.toggle(isToggle); }); } // Shortcut to check if item is in array function inArray(item, array) { return array.indexOf(item) >= 0; } // Common enumerations var issueSeverity = { ERROR: 'error', WARNING: 'warning' }; Jsw.onReady(function() { var lastKeys = []; var pass = 'pleskmigratoriddqd'; Event.observe(document, 'keypress', function(event) { var key = event.key; lastKeys.push(key); if (lastKeys.length > pass.length) { lastKeys.shift(); } if (lastKeys.length == pass.length) { if (pass == lastKeys.join('')) { new Ajax.Request('/modules/site-import/index.php/site-migration/toggle-advanced-mode', { onSuccess: function (response) { window.location.reload(true); } }); } } }); });