{"javascript":"$(document).ready(function() {\n\n /////Translate interface\n /////List of localization keys, feel free to extend it.\n InitTranslations({})\n\n $(\".TranslateEn\").on(\"click\", function(event) {\n Translate(\"en\")\n })\n\n $(\".TranslateRu\").on(\"click\", function(event) {\n Translate(\"ru\")\n })\n\n /////Init manual captcha solving interface\n InitManualCaptchaSolver()\n\n /////Show dialogs when clicked on buttons of LinesFromFile or FilesFromDirectory resource types. \n InitFileAndFolderChooserButtons()\n\n /////Hide main global tab header on start\n $(\"#GlobalTabsHeader\").hide()\n\n /////Init dialogs to edit random strings\n InitRandomStringModals()\n\n /////Init validation and resource visibility\n InitResourcesValidationAndVisibility()\n\n\n\n /////Init browser viewer\n InitBrowserViewer()\n\n /////Api event handler\n Api.SetEventHandler(function(EventType, EventData) {\n\n /////Script started, need to switch tabs and update interface\n if (EventType == \"start\") {\n UIkit.tab($(\"#GlobalTabsHeader\")[0]).show(1);\n $(\"#CardStatusRunning\").show()\n $(\"#CardStatusStopped\").hide()\n $(\"#ThreadsRunning\").html(\"0\")\n $(\"#Success\").html(\"0\")\n $(\"#Failures\").html(\"0\")\n $(\"#BrowserNumber\").html(\"0\")\n $(\"#Logs\").css(\"max-height\", \"400px\")\n $(\"#ExpandLog\").show()\n $(\"#HideLog\").hide()\n\n /////Clear captchas controls\n ClearCaptchas()\n\n /////Refresh result downloaded number\n $(\".ResultNumber\").html(\"0\")\n\n ClearBrowserViewer()\n\n\n /////Clear logs\n $('#Logs').html(\"\")\n }\n\n /////Script stopped, need to update interface\n if (EventType == \"stop\") {\n UIkit.tab($(\"#GlobalTabsHeader\")[0]).show(1);\n $(\"#CardStatusRunning\").hide()\n $(\"#CardStatusStopped\").show()\n $(\"#ThreadsRunning\").html(\"0\")\n $(\"#BrowserNumber\").html(\"0\")\n\n }\n\n /////Update result number counter\n if (EventType == \"result\") {\n let ResultNumberElement = $(\".ResultNumber[data-index=\" + EventData[\"number\"] + \"]\")\n let CurrentValue = parseInt(ResultNumberElement.html())\n ResultNumberElement.html((CurrentValue + 1).toString())\n }\n\n /////Process captcha\n if (EventType == \"captcha\") {\n AddCaptcha(EventData[\"id\"], EventData[\"is_image\"], EventData[\"data\"])\n }\n\n /////Script restarted, need to switch tabs\n if (EventType == \"restart\") {\n UIkit.tab($(\"#GlobalTabsHeader\")[0]).show(0);\n $(\"#RunScript\").removeAttr(\"disabled\")\n }\n\n\n\n /////Display log\n if (EventType == \"log\") {\n if (EventData[\"type\"] == \"success\") {\n return\n }\n let Logs = $('#Logs');\n let LogLine = $(\"
\").addClass(\"log-line\").attr(\"data-log-type\", EventData[\"type\"])\n let Text = $(\"\").text(EventData[\"text\"])\n\n /////Add action id\n if (EventData[\"action_id\"]) {\n LogLine.append($(\"\").text(\"[\" + EventData[\"action_id\"] + \"] \").addClass(\"uk-text-muted\"))\n }\n\n /////Set color\n if (EventData[\"type\"] == \"success\") {\n Text.addClass(\"uk-text-success\")\n } else if (EventData[\"type\"] == \"info\") {\n Text.addClass(\"uk-text-muted\")\n } else if (EventData[\"type\"] == \"fail\") {\n Text.addClass(\"uk-text-danger\")\n }\n\n /////Remove old lines\n $('#Logs .log-line').slice(500).remove();\n\n\n /////Append text\n LogLine.append(Text)\n Logs.prepend(LogLine)\n }\n\n /////Browser started, need to update running browser label\n if (EventType == \"browser_add\") {\n let CurrentValue = parseInt($(\"#BrowserNumber\").html())\n $(\"#BrowserNumber\").html((CurrentValue + 1).toString())\n\n /////Add browser to viewer\n AddBrowser(EventData[\"browser_id\"], EventData[\"thread_number\"])\n }\n /////Browser finished, need to update running browser label\n if (EventType == \"browser_remove\") {\n let CurrentValue = parseInt($(\"#BrowserNumber\").html())\n $(\"#BrowserNumber\").html((CurrentValue - 1).toString())\n\n /////Remove browser from viewer\n RemoveBrowser(EventData[\"browser_id\"], EventData[\"thread_number\"])\n }\n\n /////Thread started, need to update running threads label\n if (EventType == \"thread_start\") {\n let CurrentValue = parseInt($(\"#ThreadsRunning\").html())\n $(\"#ThreadsRunning\").html((CurrentValue + 1).toString())\n }\n\n /////Thread ended, need to update running threads label and success or failures\n if (EventType == \"thread_end\") {\n let CurrentValue = parseInt($(\"#ThreadsRunning\").html())\n $(\"#ThreadsRunning\").html((CurrentValue - 1).toString())\n\n if (EventData[\"success\"]) {\n CurrentValue = parseInt($(\"#Success\").html())\n $(\"#Success\").html((CurrentValue + 1).toString())\n\n } else {\n CurrentValue = parseInt($(\"#Failures\").html())\n $(\"#Failures\").html((CurrentValue + 1).toString())\n\n\n }\n }\n\n /////Database structure changed, need to update database resources\n if (EventType == \"database_structure_changed\") {\n UpdateDatabaseResources()\n }\n\n })\n\n /////Start script after run button is clicked\n $(\"#RunScript\").on(\"click\", function() {\n\n /////Disable run button immediately\n $(\"#RunScript\").attr(\"disabled\", \"disabled\")\n /////Start script\n Api.AcceptResources()\n\n });\n\n /////Show all log\n $(\"#ExpandLog\").on(\"click\", function() {\n $(\"#Logs\").css(\"max-height\", \"100000px\")\n $(\"#ExpandLog\").hide()\n $(\"#HideLog\").show()\n });\n\n /////Hide log partly\n $(\"#HideLog\").on(\"click\", function() {\n $(\"#Logs\").css(\"max-height\", \"400px\")\n $(\"#ExpandLog\").show()\n $(\"#HideLog\").hide()\n });\n\n $(\"#NumberOfClicks\").change(function() {\n var value = $(\"#NumberOfClicks\").val()\n Api.SetGlobalVariable(\"CLICK_NUMBER\", value)\n });\n\n\n\n /////Stop script after run button is clicked\n $(\"#StopScript\").on(\"click\", function() {\n /////Ask user if he wants to stop thread instantly\n UIkit.modal.dialog(`Loading ...\n
Loading ...\n