Worked on ScriptManager

This commit is contained in:
Aaron Yarborough 2017-02-10 14:32:29 +00:00
parent 84d0481371
commit bfdb9405fc
5 changed files with 45 additions and 3 deletions

View file

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankingBot.ScriptManagement
{
public static class ScriptBundles
{
public static string[] Global => new[]
{
"jquery-3.1.1.min"
};
}
}

View file

@ -19,9 +19,20 @@ namespace BankingBot.ScriptManagement
_browserBot = browserBot; _browserBot = browserBot;
} }
public T Execute<T>(string scriptPath, Dictionary<string, string> data = null) public T Execute<T>(string scriptPath, Dictionary<string, string> data = null, string[] includedScripts = null)
{ {
var scriptContent = File.ReadAllText(scriptPath); var scriptContent = "";
if (includedScripts != null)
{
foreach (var script in includedScripts)
{
var includedScriptContent = File.ReadAllText(script).Trim();
scriptContent += includedScriptContent;
}
}
scriptContent += File.ReadAllText(scriptPath).Trim();
if (data != null) if (data != null)
{ {

View file

@ -0,0 +1,11 @@
var global = (function (module) {
function testFunction() {
console.log("test!");
}
return {
testFunction: testFunction
};
})(global || {});

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,3 @@
(function () { (function () {
var test = (/*{test}*/); var netVersion = __$netVersion;
})(); })();