├── .gitignore ├── NetBash.Sample ├── Commands │ ├── GreetCommand.cs │ ├── GridCommand.cs │ ├── LengthCommand.cs │ ├── SleepCommand.cs │ └── SparkCommand.cs ├── Content │ ├── Site.css │ └── themes │ │ └── base │ │ ├── images │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_454545_256x240.png │ │ ├── ui-icons_888888_256x240.png │ │ └── ui-icons_cd0a0a_256x240.png │ │ ├── jquery.ui.accordion.css │ │ ├── jquery.ui.all.css │ │ ├── jquery.ui.autocomplete.css │ │ ├── jquery.ui.base.css │ │ ├── jquery.ui.button.css │ │ ├── jquery.ui.core.css │ │ ├── jquery.ui.datepicker.css │ │ ├── jquery.ui.dialog.css │ │ ├── jquery.ui.progressbar.css │ │ ├── jquery.ui.resizable.css │ │ ├── jquery.ui.selectable.css │ │ ├── jquery.ui.slider.css │ │ ├── jquery.ui.tabs.css │ │ └── jquery.ui.theme.css ├── Controllers │ ├── AccountController.cs │ └── HomeController.cs ├── Global.asax ├── Global.asax.cs ├── Models │ └── AccountModels.cs ├── NetBash.Sample.csproj ├── Properties │ └── AssemblyInfo.cs ├── Scripts │ ├── MicrosoftAjax.debug.js │ ├── MicrosoftAjax.js │ ├── MicrosoftMvcAjax.debug.js │ ├── MicrosoftMvcAjax.js │ ├── MicrosoftMvcValidation.debug.js │ ├── MicrosoftMvcValidation.js │ ├── jquery-1.5.1-vsdoc.js │ ├── jquery-1.5.1.js │ ├── jquery-1.5.1.min.js │ ├── jquery-ui-1.8.11.js │ ├── jquery-ui-1.8.11.min.js │ ├── jquery.unobtrusive-ajax.js │ ├── jquery.unobtrusive-ajax.min.js │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ ├── modernizr-1.7.js │ └── modernizr-1.7.min.js ├── Views │ ├── Account │ │ ├── ChangePassword.cshtml │ │ ├── ChangePasswordSuccess.cshtml │ │ ├── LogOn.cshtml │ │ └── Register.cshtml │ ├── Home │ │ ├── About.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ └── _LogOnPartial.cshtml │ ├── Web.config │ └── _ViewStart.cshtml ├── Web.Debug.config ├── Web.Release.config ├── Web.config └── packages.config ├── NetBash.nupkg ├── NetBash.sln ├── NetBash ├── AssemblyLocator.cs ├── CommandResult.cs ├── Commands │ ├── ReloadCommands.cs │ ├── ServerCommand.cs │ ├── ShortcutsCommand.cs │ ├── TimeCommand.cs │ └── UpTimeCommand.cs ├── Content │ └── App_Start │ │ └── NetBashStart.cs.pp ├── Formatting │ ├── SparkExtensions.cs │ └── TableExtensions.cs ├── Helpers │ └── StringExtensions.cs ├── IWebCommand.cs ├── NetBash.Settings.cs ├── NetBash.cs ├── NetBash.csproj ├── Properties │ └── AssemblyInfo.cs ├── UI │ ├── NetBashHandler.cs │ ├── jquery-js.js │ ├── keymaster-js.js │ ├── script-js.js │ ├── style-css.css │ └── style.less ├── WebCommandAttribute.cs ├── lib │ └── dotless.Compiler.exe └── packages │ ├── EntityFramework.4.1.10331.0 │ ├── EntityFramework.4.1.10331.0.nupkg │ └── lib │ │ ├── EntityFramework.dll │ │ └── EntityFramework.xml │ ├── Modernizr.1.7 │ ├── Content │ │ └── Scripts │ │ │ ├── modernizr-1.7.js │ │ │ └── modernizr-1.7.min.js │ └── Modernizr.1.7.nupkg │ ├── Newtonsoft.Json.4.0.4 │ ├── Newtonsoft.Json.4.0.4.nupkg │ └── lib │ │ ├── net20 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ │ ├── net35 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ │ ├── net40 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ │ ├── sl3-wp │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ │ └── sl4 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── jQuery.1.5.1 │ ├── Content │ │ └── Scripts │ │ │ ├── jquery-1.5.1.js │ │ │ └── jquery-1.5.1.min.js │ └── jQuery.1.5.1.nupkg │ ├── jQuery.UI.Combined.1.8.11 │ ├── Content │ │ ├── Content │ │ │ └── themes │ │ │ │ └── base │ │ │ │ ├── images │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ ├── ui-icons_454545_256x240.png │ │ │ │ ├── ui-icons_888888_256x240.png │ │ │ │ └── ui-icons_cd0a0a_256x240.png │ │ │ │ ├── jquery.ui.accordion.css │ │ │ │ ├── jquery.ui.all.css │ │ │ │ ├── jquery.ui.autocomplete.css │ │ │ │ ├── jquery.ui.base.css │ │ │ │ ├── jquery.ui.button.css │ │ │ │ ├── jquery.ui.core.css │ │ │ │ ├── jquery.ui.datepicker.css │ │ │ │ ├── jquery.ui.dialog.css │ │ │ │ ├── jquery.ui.progressbar.css │ │ │ │ ├── jquery.ui.resizable.css │ │ │ │ ├── jquery.ui.selectable.css │ │ │ │ ├── jquery.ui.slider.css │ │ │ │ ├── jquery.ui.tabs.css │ │ │ │ └── jquery.ui.theme.css │ │ └── Scripts │ │ │ ├── jquery-ui-1.8.11.js │ │ │ └── jquery-ui-1.8.11.min.js │ └── jQuery.UI.Combined.1.8.11.nupkg │ ├── jQuery.Validation.1.8.0 │ ├── Content │ │ └── Scripts │ │ │ ├── jquery.validate-vsdoc.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ └── jQuery.Validation.1.8.0.nupkg │ ├── jQuery.vsdoc.1.5.1 │ ├── Content │ │ └── Scripts │ │ │ └── jquery-1.5.1-vsdoc.js │ └── jQuery.vsdoc.1.5.1.nupkg │ └── repositories.config ├── README.md ├── netbash.nuspec └── packages ├── NDesk.Options.0.2.1 ├── NDesk.Options.0.2.1.nupkg └── lib │ └── NDesk.Options.dll └── repositories.config /.gitignore: -------------------------------------------------------------------------------- 1 | #ignore thumbnails created by windows 2 | Thumbs.db 3 | #Ignore files build by Visual Studio 4 | *.obj 5 | *.pdb 6 | *.user 7 | *.aps 8 | *.pch 9 | *.vspscc 10 | *_i.c 11 | *_p.c 12 | *.ncb 13 | *.suo 14 | *.tlb 15 | *.tlh 16 | *.bak 17 | *.cache 18 | *.ilk 19 | *.log 20 | ClientBin 21 | [Bb]in 22 | [Dd]ebug*/ 23 | *.lib 24 | *.sbr 25 | obj/ 26 | [Rr]elease*/ 27 | _ReSharper*/ 28 | [Tt]est[Rr]esult* 29 | Examples*/ 30 | SerializerTest*/ 31 | *.csproj.user 32 | *.resharper* 33 | Download/ 34 | #Ignore files from MonoDevelop 35 | *.pidb 36 | *.userprefs -------------------------------------------------------------------------------- /NetBash.Sample/Commands/GreetCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using NDesk.Options; 6 | using System.Text; 7 | using System.IO; 8 | 9 | namespace NetBash.Sample.Commands 10 | { 11 | //implemented example from http://tirania.org/blog/archive/2008/Oct-14.html using NDesk.Options 12 | 13 | [WebCommand("greet", "Usage: greet [OPTIONS]+ message")] 14 | public class GreetCommand : IWebCommand 15 | { 16 | bool show_help = false; 17 | List names = new List(); 18 | int repeat = 1; 19 | int verbosity; 20 | 21 | public bool ReturnHtml 22 | { 23 | get { return false; } 24 | } 25 | 26 | public string Process(string[] args) 27 | { 28 | var sw = new StringWriter(); 29 | 30 | var p = new OptionSet() { 31 | { "n|name=", "the name of someone to greet.", 32 | v => names.Add (v) }, 33 | { "r|repeat=", "the number of times to repeat the greeting.", 34 | (int v) => repeat = v }, 35 | { "v", "increase debug message verbosity", 36 | v => { if (v != null) ++verbosity; } }, 37 | { "h|help", "show this message and exit", 38 | v => show_help = v != null }, 39 | }; 40 | 41 | List extras; 42 | try 43 | { 44 | extras = p.Parse(args); 45 | } 46 | catch (OptionException e) 47 | { 48 | sw.Write("greet: "); 49 | sw.WriteLine(e.Message); 50 | sw.WriteLine("Try `greet --help' for more information."); 51 | return sw.ToString(); 52 | } 53 | 54 | if (show_help) 55 | return showHelp(p); 56 | 57 | string message; 58 | if (extras.Count > 0) 59 | { 60 | message = string.Join(" ", extras.ToArray()); 61 | debug(sw, "Using new message: {0}", message); 62 | } 63 | else 64 | { 65 | message = "Hello {0}!"; 66 | debug(sw, "Using default message: {0}", message); 67 | } 68 | 69 | foreach (string name in names) 70 | { 71 | for (int i = 0; i < repeat; ++i) 72 | sw.WriteLine(message, name); 73 | } 74 | 75 | return sw.ToString(); 76 | } 77 | 78 | private string showHelp(OptionSet p) 79 | { 80 | var sb = new StringWriter(); 81 | 82 | sb.WriteLine("Usage: greet [OPTIONS]+ message"); 83 | sb.WriteLine("Greet a list of individuals with an optional message."); 84 | sb.WriteLine("If no message is specified, a generic greeting is used."); 85 | sb.WriteLine(); 86 | sb.WriteLine("Options:"); 87 | 88 | p.WriteOptionDescriptions(sb); 89 | 90 | return sb.ToString(); 91 | } 92 | 93 | private void debug(StringWriter sw, string format, params object[] args) 94 | { 95 | if (verbosity > 0) 96 | { 97 | sw.Write("# "); 98 | sw.WriteLine(format, args); 99 | } 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /NetBash.Sample/Commands/GridCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Text; 6 | using System.IO; 7 | using NetBash.Formatting; 8 | 9 | namespace NetBash.Sample.Commands 10 | { 11 | [WebCommand("grid", "Usage: grid")] 12 | public class GridCommand : IWebCommand 13 | { 14 | public bool ReturnHtml 15 | { 16 | get { return false; } 17 | } 18 | 19 | public string Process(string[] args) 20 | { 21 | var tempData = new List 22 | { 23 | new GridData 24 | { 25 | RowId = 1, 26 | SomeName = "NUMBER1", 27 | Longtext = "12345678901234567890", 28 | SomeDate = DateTime.Today 29 | }, 30 | new GridData 31 | { 32 | RowId = 2, 33 | SomeName = "sup bro", 34 | Longtext = "I AM THE GREATEST", 35 | SomeDate = DateTime.Now.AddDays(21) 36 | }, 37 | new GridData 38 | { 39 | RowId = 5, 40 | SomeName = "GridCommand", 41 | Longtext = "List", 42 | SomeDate = DateTime.Now.AddDays(-3) 43 | } 44 | }; 45 | 46 | return tempData.ToConsoleTable(); 47 | } 48 | } 49 | 50 | public class GridData 51 | { 52 | public int RowId { get; set; } 53 | public string SomeName { get; set; } 54 | public string Longtext { get; set; } 55 | public DateTime SomeDate { get; set; } 56 | } 57 | } -------------------------------------------------------------------------------- /NetBash.Sample/Commands/LengthCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace NetBash.Sample.Commands 7 | { 8 | [WebCommand("length", "counts chars in string")] 9 | public class LengthCommand : IWebCommand 10 | { 11 | public bool ReturnHtml 12 | { 13 | get { return false; } 14 | } 15 | 16 | public string Process(string[] args) 17 | { 18 | return string.Join(" ", args).Length.ToString(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /NetBash.Sample/Commands/SleepCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Threading; 6 | 7 | namespace NetBash.Sample.Commands 8 | { 9 | [WebCommand("sleep", "Sleeps for given amount of time")] 10 | public class SleepCommand : IWebCommand 11 | { 12 | public bool ReturnHtml 13 | { 14 | get { return false; } 15 | } 16 | 17 | public string Process(string[] args) 18 | { 19 | int sleeptime = 1000; 20 | 21 | if(args.Any()) 22 | int.TryParse(args[0].Trim(), out sleeptime); 23 | 24 | Thread.Sleep(sleeptime); 25 | 26 | return string.Format("Slept for {0} milliseconds", sleeptime); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /NetBash.Sample/Commands/SparkCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using NetBash.Formatting; 6 | 7 | namespace NetBash.Sample.Commands 8 | { 9 | [WebCommand("spark", "Turns this: 1 2 3 4 5 into this: ▁▂▃▄▅▆▇")] 10 | public class SparkCommand : IWebCommand 11 | { 12 | public string Process(string[] args) 13 | { 14 | if (!args.Any()) 15 | throw new ApplicationException("To use this command list values like this: 1 2 81 232 13"); 16 | 17 | if (args.Count() == 1) 18 | return args.First().Spark(); 19 | 20 | return args.Spark(); 21 | } 22 | 23 | public bool ReturnHtml 24 | { 25 | get { return false; } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /NetBash.Sample/Content/Site.css: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------- 2 | The base color for this template is #5c87b2. If you'd like 3 | to use a different color start by replacing all instances of 4 | #5c87b2 with your new color. 5 | ----------------------------------------------------------*/ 6 | body { 7 | background-color: #5c87b2; 8 | font-size: .85em; 9 | font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif; 10 | margin: 0; 11 | padding: 0; 12 | color: #696969; 13 | } 14 | 15 | a:link { 16 | color: #034af3; 17 | text-decoration: underline; 18 | } 19 | 20 | a:visited { 21 | color: #505abc; 22 | } 23 | 24 | a:hover { 25 | color: #1d60ff; 26 | text-decoration: none; 27 | } 28 | 29 | a:active { 30 | color: #12eb87; 31 | } 32 | 33 | p, ul { 34 | margin-bottom: 20px; 35 | line-height: 1.6em; 36 | } 37 | 38 | header, 39 | footer, 40 | nav, 41 | section { 42 | display: block; 43 | } 44 | 45 | /* HEADINGS 46 | ----------------------------------------------------------*/ 47 | h1, h2, h3, h4, h5, h6 { 48 | font-size: 1.5em; 49 | color: #000; 50 | } 51 | 52 | h1 { 53 | font-size: 2em; 54 | padding-bottom: 0; 55 | margin-bottom: 0; 56 | } 57 | 58 | h2 { 59 | padding: 0 0 10px 0; 60 | } 61 | 62 | h3 { 63 | font-size: 1.2em; 64 | } 65 | 66 | h4 { 67 | font-size: 1.1em; 68 | } 69 | 70 | h5, h6 { 71 | font-size: 1em; 72 | } 73 | 74 | /* PRIMARY LAYOUT ELEMENTS 75 | ----------------------------------------------------------*/ 76 | 77 | /* you can specify a greater or lesser percentage for the 78 | page width. Or, you can specify an exact pixel width. */ 79 | .page { 80 | width: 90%; 81 | margin-left: auto; 82 | margin-right: auto; 83 | } 84 | 85 | header, #header { 86 | position: relative; 87 | margin-bottom: 0px; 88 | color: #000; 89 | padding: 0; 90 | } 91 | 92 | header h1, #header h1 { 93 | font-weight: bold; 94 | padding: 5px 0; 95 | margin: 0; 96 | color: #fff; 97 | border: none; 98 | line-height: 2em; 99 | font-size: 32px !important; 100 | text-shadow: 1px 1px 2px #111; 101 | } 102 | 103 | #main { 104 | padding: 30px 30px 15px 30px; 105 | background-color: #fff; 106 | border-radius: 4px 0 0 0; 107 | -webkit-border-radius: 4px 0 0 0; 108 | -moz-border-radius: 4px 0 0 0; 109 | } 110 | 111 | footer, 112 | #footer { 113 | background-color: #fff; 114 | color: #999; 115 | padding: 10px 0; 116 | text-align: center; 117 | line-height: normal; 118 | margin: 0 0 30px 0; 119 | font-size: .9em; 120 | border-radius: 0 0 4px 4px; 121 | -webkit-border-radius: 0 0 4px 4px; 122 | -moz-border-radius: 0 0 4px 4px; 123 | } 124 | 125 | /* TAB MENU 126 | ----------------------------------------------------------*/ 127 | ul#menu { 128 | border-bottom: 1px #5C87B2 solid; 129 | padding: 0 0 2px; 130 | position: relative; 131 | margin: 0; 132 | text-align: right; 133 | } 134 | 135 | ul#menu li { 136 | display: inline; 137 | list-style: none; 138 | } 139 | 140 | ul#menu li#greeting { 141 | padding: 10px 20px; 142 | font-weight: bold; 143 | text-decoration: none; 144 | line-height: 2.8em; 145 | color: #fff; 146 | } 147 | 148 | ul#menu li a { 149 | padding: 10px 20px; 150 | font-weight: bold; 151 | text-decoration: none; 152 | line-height: 2.8em; 153 | background-color: #e8eef4; 154 | color: #034af3; 155 | border-radius: 4px 4px 0 0; 156 | -webkit-border-radius: 4px 4px 0 0; 157 | -moz-border-radius: 4px 4px 0 0; 158 | } 159 | 160 | ul#menu li a:hover { 161 | background-color: #fff; 162 | text-decoration: none; 163 | } 164 | 165 | ul#menu li a:active { 166 | background-color: #a6e2a6; 167 | text-decoration: none; 168 | } 169 | 170 | ul#menu li.selected a { 171 | background-color: #fff; 172 | color: #000; 173 | } 174 | 175 | /* FORM LAYOUT ELEMENTS 176 | ----------------------------------------------------------*/ 177 | 178 | fieldset { 179 | border: 1px solid #ddd; 180 | padding: 0 1.4em 1.4em 1.4em; 181 | margin: 0 0 1.5em 0; 182 | } 183 | 184 | legend { 185 | font-size: 1.2em; 186 | font-weight: bold; 187 | } 188 | 189 | textarea { 190 | min-height: 75px; 191 | } 192 | 193 | input[type="text"], 194 | input[type="password"] { 195 | border: 1px solid #ccc; 196 | padding: 2px; 197 | font-size: 1.2em; 198 | color: #444; 199 | width: 200px; 200 | } 201 | 202 | select { 203 | border: 1px solid #ccc; 204 | padding: 2px; 205 | font-size: 1.2em; 206 | color: #444; 207 | } 208 | 209 | input[type="submit"] { 210 | font-size: 1.2em; 211 | padding: 5px; 212 | } 213 | 214 | /* TABLE 215 | ----------------------------------------------------------*/ 216 | 217 | table { 218 | border: solid 1px #e8eef4; 219 | border-collapse: collapse; 220 | } 221 | 222 | table td { 223 | padding: 5px; 224 | border: solid 1px #e8eef4; 225 | } 226 | 227 | table th { 228 | padding: 6px 5px; 229 | text-align: left; 230 | background-color: #e8eef4; 231 | border: solid 1px #e8eef4; 232 | } 233 | 234 | /* MISC 235 | ----------------------------------------------------------*/ 236 | .clear { 237 | clear: both; 238 | } 239 | 240 | .error { 241 | color: Red; 242 | } 243 | 244 | nav, 245 | #menucontainer { 246 | margin-top: 40px; 247 | } 248 | 249 | div#title { 250 | display: block; 251 | float: left; 252 | text-align: left; 253 | } 254 | 255 | #logindisplay { 256 | font-size: 1.1em; 257 | display: block; 258 | text-align: right; 259 | margin: 10px; 260 | color: White; 261 | } 262 | 263 | #logindisplay a:link { 264 | color: white; 265 | text-decoration: underline; 266 | } 267 | 268 | #logindisplay a:visited { 269 | color: white; 270 | text-decoration: underline; 271 | } 272 | 273 | #logindisplay a:hover { 274 | color: white; 275 | text-decoration: none; 276 | } 277 | 278 | /* Styles for validation helpers 279 | -----------------------------------------------------------*/ 280 | .field-validation-error { 281 | color: #ff0000; 282 | } 283 | 284 | .field-validation-valid { 285 | display: none; 286 | } 287 | 288 | .input-validation-error { 289 | border: 1px solid #ff0000; 290 | background-color: #ffeeee; 291 | } 292 | 293 | .validation-summary-errors { 294 | font-weight: bold; 295 | color: #ff0000; 296 | } 297 | 298 | .validation-summary-valid { 299 | display: none; 300 | } 301 | 302 | /* Styles for editor and display helpers 303 | ----------------------------------------------------------*/ 304 | .display-label, 305 | .editor-label { 306 | margin: 1em 0 0 0; 307 | } 308 | 309 | .display-field, 310 | .editor-field { 311 | margin: 0.5em 0 0 0; 312 | } 313 | 314 | .text-box { 315 | width: 30em; 316 | } 317 | 318 | .text-box.multi-line { 319 | height: 6.5em; 320 | } 321 | 322 | .tri-state { 323 | width: 6em; 324 | } 325 | -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.Sample/Content/themes/base/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.accordion.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Accordion 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Accordion#theming 14 | */ 15 | /* IE/Win - Fix animation bug - #4615 */ 16 | .ui-accordion { width: 100%; } 17 | .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } 18 | .ui-accordion .ui-accordion-li-fix { display: inline; } 19 | .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } 20 | .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } 21 | .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } 22 | .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } 23 | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } 24 | .ui-accordion .ui-accordion-content-active { display: block; } 25 | -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.all.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI CSS Framework 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Theming 14 | */ 15 | @import "jquery.ui.base.css"; 16 | @import "jquery.ui.theme.css"; 17 | -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.autocomplete.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Autocomplete 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * http://docs.jquery.com/UI/Autocomplete#theming 13 | */ 14 | .ui-autocomplete { position: absolute; cursor: default; } 15 | 16 | /* workarounds */ 17 | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ 18 | 19 | /* 20 | * Note: While Microsoft is not the author of this file, Microsoft is 21 | * offering you a license subject to the terms of the Microsoft Software 22 | * License Terms for Microsoft ASP.NET Model View Controller 3. 23 | * Microsoft reserves all other rights. The notices below are provided 24 | * for informational purposes only and are not the license terms under 25 | * which Microsoft distributed this file. 26 | * 27 | * jQuery UI Menu 1.8.11 28 | * 29 | * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) 30 | * 31 | * http://docs.jquery.com/UI/Menu#theming 32 | */ 33 | .ui-menu { 34 | list-style:none; 35 | padding: 2px; 36 | margin: 0; 37 | display:block; 38 | float: left; 39 | } 40 | .ui-menu .ui-menu { 41 | margin-top: -3px; 42 | } 43 | .ui-menu .ui-menu-item { 44 | margin:0; 45 | padding: 0; 46 | zoom: 1; 47 | float: left; 48 | clear: left; 49 | width: 100%; 50 | } 51 | .ui-menu .ui-menu-item a { 52 | text-decoration:none; 53 | display:block; 54 | padding:.2em .4em; 55 | line-height:1.5; 56 | zoom:1; 57 | } 58 | .ui-menu .ui-menu-item a.ui-state-hover, 59 | .ui-menu .ui-menu-item a.ui-state-active { 60 | font-weight: normal; 61 | margin: -1px; 62 | } 63 | -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.base.css: -------------------------------------------------------------------------------- 1 | @import url("jquery.ui.core.css"); 2 | @import url("jquery.ui.resizable.css"); 3 | @import url("jquery.ui.selectable.css"); 4 | @import url("jquery.ui.accordion.css"); 5 | @import url("jquery.ui.autocomplete.css"); 6 | @import url("jquery.ui.button.css"); 7 | @import url("jquery.ui.dialog.css"); 8 | @import url("jquery.ui.slider.css"); 9 | @import url("jquery.ui.tabs.css"); 10 | @import url("jquery.ui.datepicker.css"); 11 | @import url("jquery.ui.progressbar.css"); -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.button.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Button 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Button#theming 14 | */ 15 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ 16 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ 17 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ 18 | .ui-button-icons-only { width: 3.4em; } 19 | button.ui-button-icons-only { width: 3.7em; } 20 | 21 | /*button text element */ 22 | .ui-button .ui-button-text { display: block; line-height: 1.4; } 23 | .ui-button-text-only .ui-button-text { padding: .4em 1em; } 24 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } 25 | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } 26 | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } 27 | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } 28 | /* no icon support for input elements, provide padding by default */ 29 | input.ui-button { padding: .4em 1em; } 30 | 31 | /*button icon element(s) */ 32 | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } 33 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } 34 | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } 35 | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 36 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 37 | 38 | /*button sets*/ 39 | .ui-buttonset { margin-right: 7px; } 40 | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } 41 | 42 | /* workarounds */ 43 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ 44 | -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.core.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI CSS Framework 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Theming/API 14 | */ 15 | 16 | /* Layout helpers 17 | ----------------------------------*/ 18 | .ui-helper-hidden { display: none; } 19 | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } 20 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 21 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 22 | .ui-helper-clearfix { display: inline-block; } 23 | /* required comment for clearfix to work in Opera \*/ 24 | * html .ui-helper-clearfix { height:1%; } 25 | .ui-helper-clearfix { display:block; } 26 | /* end clearfix */ 27 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 28 | 29 | 30 | /* Interaction Cues 31 | ----------------------------------*/ 32 | .ui-state-disabled { cursor: default !important; } 33 | 34 | 35 | /* Icons 36 | ----------------------------------*/ 37 | 38 | /* states and images */ 39 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 40 | 41 | 42 | /* Misc visuals 43 | ----------------------------------*/ 44 | 45 | /* Overlays */ 46 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } 47 | -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.datepicker.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Datepicker 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Datepicker#theming 14 | */ 15 | .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } 16 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } 17 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } 18 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } 19 | .ui-datepicker .ui-datepicker-prev { left:2px; } 20 | .ui-datepicker .ui-datepicker-next { right:2px; } 21 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } 22 | .ui-datepicker .ui-datepicker-next-hover { right:1px; } 23 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } 24 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } 25 | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } 26 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} 27 | .ui-datepicker select.ui-datepicker-month, 28 | .ui-datepicker select.ui-datepicker-year { width: 49%;} 29 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } 30 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } 31 | .ui-datepicker td { border: 0; padding: 1px; } 32 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } 33 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } 34 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } 35 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } 36 | 37 | /* with multiple calendars */ 38 | .ui-datepicker.ui-datepicker-multi { width:auto; } 39 | .ui-datepicker-multi .ui-datepicker-group { float:left; } 40 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } 41 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } 42 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } 43 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } 44 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } 45 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } 46 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } 47 | .ui-datepicker-row-break { clear:both; width:100%; } 48 | 49 | /* RTL support */ 50 | .ui-datepicker-rtl { direction: rtl; } 51 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } 52 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } 53 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } 54 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } 55 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } 56 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } 57 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } 58 | .ui-datepicker-rtl .ui-datepicker-group { float:right; } 59 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 60 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 61 | 62 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ 63 | .ui-datepicker-cover { 64 | display: none; /*sorry for IE5*/ 65 | display/**/: block; /*sorry for IE5*/ 66 | position: absolute; /*must have*/ 67 | z-index: -1; /*must have*/ 68 | filter: mask(); /*must have*/ 69 | top: -4px; /*must have*/ 70 | left: -4px; /*must have*/ 71 | width: 200px; /*must have*/ 72 | height: 200px; /*must have*/ 73 | } -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.dialog.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Dialog 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Dialog#theming 14 | */ 15 | .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } 16 | .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } 17 | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } 18 | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } 19 | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } 20 | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } 21 | .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } 22 | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } 23 | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } 24 | .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } 25 | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } 26 | .ui-draggable .ui-dialog-titlebar { cursor: move; } 27 | -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.progressbar.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Progressbar 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Progressbar#theming 14 | */ 15 | .ui-progressbar { height:2em; text-align: left; } 16 | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.resizable.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Resizable 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)] 12 | * 13 | * http://docs.jquery.com/UI/Resizable#theming 14 | */ 15 | .ui-resizable { position: relative;} 16 | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} 17 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } 18 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } 19 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } 20 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } 21 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } 22 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } 23 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } 24 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } 25 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.selectable.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Selectable 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Selectable#theming 14 | */ 15 | .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } 16 | -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.slider.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Slider 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Slider#theming 14 | */ 15 | .ui-slider { position: relative; text-align: left; } 16 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } 17 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } 18 | 19 | .ui-slider-horizontal { height: .8em; } 20 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } 21 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } 22 | .ui-slider-horizontal .ui-slider-range-min { left: 0; } 23 | .ui-slider-horizontal .ui-slider-range-max { right: 0; } 24 | 25 | .ui-slider-vertical { width: .8em; height: 100px; } 26 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } 27 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } 28 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; } 29 | .ui-slider-vertical .ui-slider-range-max { top: 0; } -------------------------------------------------------------------------------- /NetBash.Sample/Content/themes/base/jquery.ui.tabs.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | * 9 | * jQuery UI Tabs 1.8.11 10 | * 11 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 12 | * 13 | * http://docs.jquery.com/UI/Tabs#theming 14 | */ 15 | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ 16 | .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } 17 | .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } 18 | .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } 19 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } 20 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } 21 | .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ 22 | .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } 23 | .ui-tabs .ui-tabs-hide { display: none !important; } 24 | -------------------------------------------------------------------------------- /NetBash.Sample/Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | using System.Web.Security; 8 | using NetBash.Sample.Models; 9 | 10 | namespace NetBash.Sample.Controllers 11 | { 12 | public class AccountController : Controller 13 | { 14 | 15 | // 16 | // GET: /Account/LogOn 17 | 18 | public ActionResult LogOn() 19 | { 20 | return View(); 21 | } 22 | 23 | // 24 | // POST: /Account/LogOn 25 | 26 | [HttpPost] 27 | public ActionResult LogOn(LogOnModel model, string returnUrl) 28 | { 29 | if (ModelState.IsValid) 30 | { 31 | if (Membership.ValidateUser(model.UserName, model.Password)) 32 | { 33 | FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe); 34 | if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/") 35 | && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\")) 36 | { 37 | return Redirect(returnUrl); 38 | } 39 | else 40 | { 41 | return RedirectToAction("Index", "Home"); 42 | } 43 | } 44 | else 45 | { 46 | ModelState.AddModelError("", "The user name or password provided is incorrect."); 47 | } 48 | } 49 | 50 | // If we got this far, something failed, redisplay form 51 | return View(model); 52 | } 53 | 54 | // 55 | // GET: /Account/LogOff 56 | 57 | public ActionResult LogOff() 58 | { 59 | FormsAuthentication.SignOut(); 60 | 61 | return RedirectToAction("Index", "Home"); 62 | } 63 | 64 | // 65 | // GET: /Account/Register 66 | 67 | public ActionResult Register() 68 | { 69 | return View(); 70 | } 71 | 72 | // 73 | // POST: /Account/Register 74 | 75 | [HttpPost] 76 | public ActionResult Register(RegisterModel model) 77 | { 78 | if (ModelState.IsValid) 79 | { 80 | // Attempt to register the user 81 | MembershipCreateStatus createStatus; 82 | Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus); 83 | 84 | if (createStatus == MembershipCreateStatus.Success) 85 | { 86 | FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */); 87 | return RedirectToAction("Index", "Home"); 88 | } 89 | else 90 | { 91 | ModelState.AddModelError("", ErrorCodeToString(createStatus)); 92 | } 93 | } 94 | 95 | // If we got this far, something failed, redisplay form 96 | return View(model); 97 | } 98 | 99 | // 100 | // GET: /Account/ChangePassword 101 | 102 | [Authorize] 103 | public ActionResult ChangePassword() 104 | { 105 | return View(); 106 | } 107 | 108 | // 109 | // POST: /Account/ChangePassword 110 | 111 | [Authorize] 112 | [HttpPost] 113 | public ActionResult ChangePassword(ChangePasswordModel model) 114 | { 115 | if (ModelState.IsValid) 116 | { 117 | 118 | // ChangePassword will throw an exception rather 119 | // than return false in certain failure scenarios. 120 | bool changePasswordSucceeded; 121 | try 122 | { 123 | MembershipUser currentUser = Membership.GetUser(User.Identity.Name, true /* userIsOnline */); 124 | changePasswordSucceeded = currentUser.ChangePassword(model.OldPassword, model.NewPassword); 125 | } 126 | catch (Exception) 127 | { 128 | changePasswordSucceeded = false; 129 | } 130 | 131 | if (changePasswordSucceeded) 132 | { 133 | return RedirectToAction("ChangePasswordSuccess"); 134 | } 135 | else 136 | { 137 | ModelState.AddModelError("", "The current password is incorrect or the new password is invalid."); 138 | } 139 | } 140 | 141 | // If we got this far, something failed, redisplay form 142 | return View(model); 143 | } 144 | 145 | // 146 | // GET: /Account/ChangePasswordSuccess 147 | 148 | public ActionResult ChangePasswordSuccess() 149 | { 150 | return View(); 151 | } 152 | 153 | #region Status Codes 154 | private static string ErrorCodeToString(MembershipCreateStatus createStatus) 155 | { 156 | // See http://go.microsoft.com/fwlink/?LinkID=177550 for 157 | // a full list of status codes. 158 | switch (createStatus) 159 | { 160 | case MembershipCreateStatus.DuplicateUserName: 161 | return "User name already exists. Please enter a different user name."; 162 | 163 | case MembershipCreateStatus.DuplicateEmail: 164 | return "A user name for that e-mail address already exists. Please enter a different e-mail address."; 165 | 166 | case MembershipCreateStatus.InvalidPassword: 167 | return "The password provided is invalid. Please enter a valid password value."; 168 | 169 | case MembershipCreateStatus.InvalidEmail: 170 | return "The e-mail address provided is invalid. Please check the value and try again."; 171 | 172 | case MembershipCreateStatus.InvalidAnswer: 173 | return "The password retrieval answer provided is invalid. Please check the value and try again."; 174 | 175 | case MembershipCreateStatus.InvalidQuestion: 176 | return "The password retrieval question provided is invalid. Please check the value and try again."; 177 | 178 | case MembershipCreateStatus.InvalidUserName: 179 | return "The user name provided is invalid. Please check the value and try again."; 180 | 181 | case MembershipCreateStatus.ProviderError: 182 | return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."; 183 | 184 | case MembershipCreateStatus.UserRejected: 185 | return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator."; 186 | 187 | default: 188 | return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."; 189 | } 190 | } 191 | #endregion 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /NetBash.Sample/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace NetBash.Sample.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public ActionResult Index() 12 | { 13 | ViewBag.Message = "Welcome to ASP.NET MVC!"; 14 | 15 | return View(); 16 | } 17 | 18 | public ActionResult About() 19 | { 20 | return View(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /NetBash.Sample/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="NetBash.Sample.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /NetBash.Sample/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace NetBash.Sample 9 | { 10 | // Note: For instructions on enabling IIS6 or IIS7 classic mode, 11 | // visit http://go.microsoft.com/?LinkId=9394801 12 | 13 | public class MvcApplication : System.Web.HttpApplication 14 | { 15 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 16 | { 17 | filters.Add(new HandleErrorAttribute()); 18 | } 19 | 20 | public static void RegisterRoutes(RouteCollection routes) 21 | { 22 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 23 | 24 | routes.MapRoute( 25 | "Default", // Route name 26 | "{controller}/{action}/{id}", // URL with parameters 27 | new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults 28 | ); 29 | 30 | } 31 | 32 | protected void Application_Start() 33 | { 34 | AreaRegistration.RegisterAllAreas(); 35 | 36 | RegisterGlobalFilters(GlobalFilters.Filters); 37 | RegisterRoutes(RouteTable.Routes); 38 | 39 | NetBash.Init(); 40 | 41 | NetBash.Settings.Authorize = (request) => 42 | { 43 | return request.IsLocal; 44 | }; 45 | 46 | //NetBash.Settings.HiddenByDefault = true; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /NetBash.Sample/Models/AccountModels.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Globalization; 5 | using System.Web.Mvc; 6 | using System.Web.Security; 7 | 8 | namespace NetBash.Sample.Models 9 | { 10 | 11 | public class ChangePasswordModel 12 | { 13 | [Required] 14 | [DataType(DataType.Password)] 15 | [Display(Name = "Current password")] 16 | public string OldPassword { get; set; } 17 | 18 | [Required] 19 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 20 | [DataType(DataType.Password)] 21 | [Display(Name = "New password")] 22 | public string NewPassword { get; set; } 23 | 24 | [DataType(DataType.Password)] 25 | [Display(Name = "Confirm new password")] 26 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 27 | public string ConfirmPassword { get; set; } 28 | } 29 | 30 | public class LogOnModel 31 | { 32 | [Required] 33 | [Display(Name = "User name")] 34 | public string UserName { get; set; } 35 | 36 | [Required] 37 | [DataType(DataType.Password)] 38 | [Display(Name = "Password")] 39 | public string Password { get; set; } 40 | 41 | [Display(Name = "Remember me?")] 42 | public bool RememberMe { get; set; } 43 | } 44 | 45 | public class RegisterModel 46 | { 47 | [Required] 48 | [Display(Name = "User name")] 49 | public string UserName { get; set; } 50 | 51 | [Required] 52 | [DataType(DataType.EmailAddress)] 53 | [Display(Name = "Email address")] 54 | public string Email { get; set; } 55 | 56 | [Required] 57 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 58 | [DataType(DataType.Password)] 59 | [Display(Name = "Password")] 60 | public string Password { get; set; } 61 | 62 | [DataType(DataType.Password)] 63 | [Display(Name = "Confirm password")] 64 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 65 | public string ConfirmPassword { get; set; } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /NetBash.Sample/NetBash.Sample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 7 | 8 | 2.0 9 | {774201D2-F1BA-4595-9828-204A5390395A} 10 | {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 11 | Library 12 | Properties 13 | NetBash.Sample 14 | NetBash.Sample 15 | v4.0 16 | false 17 | false 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | pdbonly 30 | true 31 | bin\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\NetBash\packages\EntityFramework.4.1.10331.0\lib\EntityFramework.dll 39 | 40 | 41 | 42 | ..\packages\NDesk.Options.0.2.1\lib\NDesk.Options.dll 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Code 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | Global.asax 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | Designer 124 | 125 | 126 | Web.config 127 | 128 | 129 | Web.config 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | {AD552539-66F6-4FA2-8763-D76893A6DF69} 163 | NetBash 164 | 165 | 166 | 167 | 168 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | False 182 | True 183 | 62866 184 | / 185 | http://localhost/NetBash.Sample 186 | False 187 | False 188 | 189 | 190 | False 191 | 192 | 193 | 194 | 195 | -------------------------------------------------------------------------------- /NetBash.Sample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NetBash.Sample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("NetBash.Sample")] 13 | [assembly: AssemblyCopyright("Copyright © 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("194c039d-fd9c-4ee7-a12b-cacbe149f2e5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /NetBash.Sample/Scripts/MicrosoftMvcAjax.js: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------- 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | //---------------------------------------------------------- 4 | // MicrosoftMvcAjax.js 5 | 6 | Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_AjaxOptions=function(){return {};} 7 | Sys.Mvc.InsertionMode=function(){};Sys.Mvc.InsertionMode.prototype = {replace:0,insertBefore:1,insertAfter:2} 8 | Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode',false);Sys.Mvc.AjaxContext=function(request,updateTarget,loadingElement,insertionMode){this.$3=request;this.$4=updateTarget;this.$1=loadingElement;this.$0=insertionMode;} 9 | Sys.Mvc.AjaxContext.prototype={$0:0,$1:null,$2:null,$3:null,$4:null,get_data:function(){if(this.$2){return this.$2.get_responseData();}else{return null;}},get_insertionMode:function(){return this.$0;},get_loadingElement:function(){return this.$1;},get_object:function(){var $0=this.get_response();return ($0)?$0.get_object():null;},get_response:function(){return this.$2;},set_response:function(value){this.$2=value;return value;},get_request:function(){return this.$3;},get_updateTarget:function(){return this.$4;}} 10 | Sys.Mvc.AsyncHyperlink=function(){} 11 | Sys.Mvc.AsyncHyperlink.handleClick=function(anchor,evt,ajaxOptions){evt.preventDefault();Sys.Mvc.MvcHelpers.$2(anchor.href,'post','',anchor,ajaxOptions);} 12 | Sys.Mvc.MvcHelpers=function(){} 13 | Sys.Mvc.MvcHelpers.$0=function($p0,$p1,$p2){if($p0.disabled){return null;}var $0=$p0.name;if($0){var $1=$p0.tagName.toUpperCase();var $2=encodeURIComponent($0);var $3=$p0;if($1==='INPUT'){var $4=$3.type;if($4==='submit'){return $2+'='+encodeURIComponent($3.value);}else if($4==='image'){return $2+'.x='+$p1+'&'+$2+'.y='+$p2;}}else if(($1==='BUTTON')&&($0.length)&&($3.type==='submit')){return $2+'='+encodeURIComponent($3.value);}}return null;} 14 | Sys.Mvc.MvcHelpers.$1=function($p0){var $0=$p0.elements;var $1=new Sys.StringBuilder();var $2=$0.length;for(var $4=0;$4<$2;$4++){var $5=$0[$4];var $6=$5.name;if(!$6||!$6.length){continue;}var $7=$5.tagName.toUpperCase();if($7==='INPUT'){var $8=$5;var $9=$8.type;if(($9==='text')||($9==='password')||($9==='hidden')||((($9==='checkbox')||($9==='radio'))&&$5.checked)){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($8.value));$1.append('&');}}else if($7==='SELECT'){var $A=$5;var $B=$A.options.length;for(var $C=0;$C<$B;$C++){var $D=$A.options[$C];if($D.selected){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($D.value));$1.append('&');}}}else if($7==='TEXTAREA'){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent(($5.value)));$1.append('&');}}var $3=$p0._additionalInput;if($3){$1.append($3);$1.append('&');}return $1.toString();} 15 | Sys.Mvc.MvcHelpers.$2=function($p0,$p1,$p2,$p3,$p4){if($p4.confirm){if(!confirm($p4.confirm)){return;}}if($p4.url){$p0=$p4.url;}if($p4.httpMethod){$p1=$p4.httpMethod;}if($p2.length>0&&!$p2.endsWith('&')){$p2+='&';}$p2+='X-Requested-With=XMLHttpRequest';var $0=$p1.toUpperCase();var $1=($0==='GET'||$0==='POST');if(!$1){$p2+='&';$p2+='X-HTTP-Method-Override='+$0;}var $2='';if($0==='GET'||$0==='DELETE'){if($p0.indexOf('?')>-1){if(!$p0.endsWith('&')){$p0+='&';}$p0+=$p2;}else{$p0+='?';$p0+=$p2;}}else{$2=$p2;}var $3=new Sys.Net.WebRequest();$3.set_url($p0);if($1){$3.set_httpVerb($p1);}else{$3.set_httpVerb('POST');$3.get_headers()['X-HTTP-Method-Override']=$0;}$3.set_body($2);if($p1.toUpperCase()==='PUT'){$3.get_headers()['Content-Type']='application/x-www-form-urlencoded;';}$3.get_headers()['X-Requested-With']='XMLHttpRequest';var $4=null;if($p4.updateTargetId){$4=$get($p4.updateTargetId);}var $5=null;if($p4.loadingElementId){$5=$get($p4.loadingElementId);}var $6=new Sys.Mvc.AjaxContext($3,$4,$5,$p4.insertionMode);var $7=true;if($p4.onBegin){$7=$p4.onBegin($6)!==false;}if($5){Sys.UI.DomElement.setVisible($6.get_loadingElement(),true);}if($7){$3.add_completed(Function.createDelegate(null,function($p1_0){ 16 | Sys.Mvc.MvcHelpers.$3($3,$p4,$6);}));$3.invoke();}} 17 | Sys.Mvc.MvcHelpers.$3=function($p0,$p1,$p2){$p2.set_response($p0.get_executor());if($p1.onComplete&&$p1.onComplete($p2)===false){return;}var $0=$p2.get_response().get_statusCode();if(($0>=200&&$0<300)||$0===304||$0===1223){if($0!==204&&$0!==304&&$0!==1223){var $1=$p2.get_response().getResponseHeader('Content-Type');if(($1)&&($1.indexOf('application/x-javascript')!==-1)){eval($p2.get_data());}else{Sys.Mvc.MvcHelpers.updateDomElement($p2.get_updateTarget(),$p2.get_insertionMode(),$p2.get_data());}}if($p1.onSuccess){$p1.onSuccess($p2);}}else{if($p1.onFailure){$p1.onFailure($p2);}}if($p2.get_loadingElement()){Sys.UI.DomElement.setVisible($p2.get_loadingElement(),false);}} 18 | Sys.Mvc.MvcHelpers.updateDomElement=function(target,insertionMode,content){if(target){switch(insertionMode){case 0:target.innerHTML=content;break;case 1:if(content&&content.length>0){target.innerHTML=content+target.innerHTML.trimStart();}break;case 2:if(content&&content.length>0){target.innerHTML=target.innerHTML.trimEnd()+content;}break;}}} 19 | Sys.Mvc.AsyncForm=function(){} 20 | Sys.Mvc.AsyncForm.handleClick=function(form,evt){var $0=Sys.Mvc.MvcHelpers.$0(evt.target,evt.offsetX,evt.offsetY);form._additionalInput = $0;} 21 | Sys.Mvc.AsyncForm.handleSubmit=function(form,evt,ajaxOptions){evt.preventDefault();var $0=form.validationCallbacks;if($0){for(var $2=0;$2<$0.length;$2++){var $3=$0[$2];if(!$3()){return;}}}var $1=Sys.Mvc.MvcHelpers.$1(form);Sys.Mvc.MvcHelpers.$2(form.action,form.method||'post',$1,form,ajaxOptions);} 22 | Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); 23 | // ---- Do not remove this footer ---- 24 | // Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) 25 | // ----------------------------------- 26 | -------------------------------------------------------------------------------- /NetBash.Sample/Scripts/jquery.unobtrusive-ajax.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | /*! 4 | ** Unobtrusive Ajax support library for jQuery 5 | ** Copyright (C) Microsoft Corporation. All rights reserved. 6 | */ 7 | 8 | /*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ 9 | /*global window: false, jQuery: false */ 10 | 11 | (function ($) { 12 | var data_click = "unobtrusiveAjaxClick", 13 | data_validation = "unobtrusiveValidation"; 14 | 15 | function getFunction(code, argNames) { 16 | var fn = window, parts = (code || "").split("."); 17 | while (fn && parts.length) { 18 | fn = fn[parts.shift()]; 19 | } 20 | if (typeof (fn) === "function") { 21 | return fn; 22 | } 23 | argNames.push(code); 24 | return Function.constructor.apply(null, argNames); 25 | } 26 | 27 | function isMethodProxySafe(method) { 28 | return method === "GET" || method === "POST"; 29 | } 30 | 31 | function asyncOnBeforeSend(xhr, method) { 32 | if (!isMethodProxySafe(method)) { 33 | xhr.setRequestHeader("X-HTTP-Method-Override", method); 34 | } 35 | } 36 | 37 | function asyncOnSuccess(element, data, contentType) { 38 | var mode; 39 | 40 | if (contentType.indexOf("application/x-javascript") !== -1) { // jQuery already executes JavaScript for us 41 | return; 42 | } 43 | 44 | mode = (element.getAttribute("data-ajax-mode") || "").toUpperCase(); 45 | $(element.getAttribute("data-ajax-update")).each(function (i, update) { 46 | var top; 47 | 48 | switch (mode) { 49 | case "BEFORE": 50 | top = update.firstChild; 51 | $("
").html(data).contents().each(function () { 52 | update.insertBefore(this, top); 53 | }); 54 | break; 55 | case "AFTER": 56 | $("
").html(data).contents().each(function () { 57 | update.appendChild(this); 58 | }); 59 | break; 60 | default: 61 | $(update).html(data); 62 | break; 63 | } 64 | }); 65 | } 66 | 67 | function asyncRequest(element, options) { 68 | var confirm, loading, method, duration; 69 | 70 | confirm = element.getAttribute("data-ajax-confirm"); 71 | if (confirm && !window.confirm(confirm)) { 72 | return; 73 | } 74 | 75 | loading = $(element.getAttribute("data-ajax-loading")); 76 | duration = element.getAttribute("data-ajax-loading-duration") || 0; 77 | 78 | $.extend(options, { 79 | type: element.getAttribute("data-ajax-method") || undefined, 80 | url: element.getAttribute("data-ajax-url") || undefined, 81 | beforeSend: function (xhr) { 82 | var result; 83 | asyncOnBeforeSend(xhr, method); 84 | result = getFunction(element.getAttribute("data-ajax-begin"), ["xhr"]).apply(this, arguments); 85 | if (result !== false) { 86 | loading.show(duration); 87 | } 88 | return result; 89 | }, 90 | complete: function () { 91 | loading.hide(duration); 92 | getFunction(element.getAttribute("data-ajax-complete"), ["xhr", "status"]).apply(this, arguments); 93 | }, 94 | success: function (data, status, xhr) { 95 | asyncOnSuccess(element, data, xhr.getResponseHeader("Content-Type") || "text/html"); 96 | getFunction(element.getAttribute("data-ajax-success"), ["data", "status", "xhr"]).apply(this, arguments); 97 | }, 98 | error: getFunction(element.getAttribute("data-ajax-failure"), ["xhr", "status", "error"]) 99 | }); 100 | 101 | options.data.push({ name: "X-Requested-With", value: "XMLHttpRequest" }); 102 | 103 | method = options.type.toUpperCase(); 104 | if (!isMethodProxySafe(method)) { 105 | options.type = "POST"; 106 | options.data.push({ name: "X-HTTP-Method-Override", value: method }); 107 | } 108 | 109 | $.ajax(options); 110 | } 111 | 112 | function validate(form) { 113 | var validationInfo = $(form).data(data_validation); 114 | return !validationInfo || !validationInfo.validate || validationInfo.validate(); 115 | } 116 | 117 | $("a[data-ajax=true]").live("click", function (evt) { 118 | evt.preventDefault(); 119 | asyncRequest(this, { 120 | url: this.href, 121 | type: "GET", 122 | data: [] 123 | }); 124 | }); 125 | 126 | $("form[data-ajax=true] input[type=image]").live("click", function (evt) { 127 | var name = evt.target.name, 128 | $target = $(evt.target), 129 | form = $target.parents("form")[0], 130 | offset = $target.offset(); 131 | 132 | $(form).data(data_click, [ 133 | { name: name + ".x", value: Math.round(evt.pageX - offset.left) }, 134 | { name: name + ".y", value: Math.round(evt.pageY - offset.top) } 135 | ]); 136 | 137 | setTimeout(function () { 138 | $(form).removeData(data_click); 139 | }, 0); 140 | }); 141 | 142 | $("form[data-ajax=true] :submit").live("click", function (evt) { 143 | var name = evt.target.name, 144 | form = $(evt.target).parents("form")[0]; 145 | 146 | $(form).data(data_click, name ? [{ name: name, value: evt.target.value }] : []); 147 | 148 | setTimeout(function () { 149 | $(form).removeData(data_click); 150 | }, 0); 151 | }); 152 | 153 | $("form[data-ajax=true]").live("submit", function (evt) { 154 | var clickInfo = $(this).data(data_click) || []; 155 | evt.preventDefault(); 156 | if (!validate(this)) { 157 | return; 158 | } 159 | asyncRequest(this, { 160 | url: this.action, 161 | type: this.method || "GET", 162 | data: clickInfo.concat($(this).serializeArray()) 163 | }); 164 | }); 165 | }(jQuery)); -------------------------------------------------------------------------------- /NetBash.Sample/Scripts/jquery.unobtrusive-ajax.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive Ajax support library for jQuery 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | (function(a){var b="unobtrusiveAjaxClick",g="unobtrusiveValidation";function c(d,b){var a=window,c=(d||"").split(".");while(a&&c.length)a=a[c.shift()];if(typeof a==="function")return a;b.push(d);return Function.constructor.apply(null,b)}function d(a){return a==="GET"||a==="POST"}function f(b,a){!d(a)&&b.setRequestHeader("X-HTTP-Method-Override",a)}function h(c,b,e){var d;if(e.indexOf("application/x-javascript")!==-1)return;d=(c.getAttribute("data-ajax-mode")||"").toUpperCase();a(c.getAttribute("data-ajax-update")).each(function(f,c){var e;switch(d){case"BEFORE":e=c.firstChild;a("
").html(b).contents().each(function(){c.insertBefore(this,e)});break;case"AFTER":a("
").html(b).contents().each(function(){c.appendChild(this)});break;default:a(c).html(b)}})}function e(b,e){var j,k,g,i;j=b.getAttribute("data-ajax-confirm");if(j&&!window.confirm(j))return;k=a(b.getAttribute("data-ajax-loading"));i=b.getAttribute("data-ajax-loading-duration")||0;a.extend(e,{type:b.getAttribute("data-ajax-method")||undefined,url:b.getAttribute("data-ajax-url")||undefined,beforeSend:function(d){var a;f(d,g);a=c(b.getAttribute("data-ajax-begin"),["xhr"]).apply(this,arguments);a!==false&&k.show(i);return a},complete:function(){k.hide(i);c(b.getAttribute("data-ajax-complete"),["xhr","status"]).apply(this,arguments)},success:function(a,e,d){h(b,a,d.getResponseHeader("Content-Type")||"text/html");c(b.getAttribute("data-ajax-success"),["data","status","xhr"]).apply(this,arguments)},error:c(b.getAttribute("data-ajax-failure"),["xhr","status","error"])});e.data.push({name:"X-Requested-With",value:"XMLHttpRequest"});g=e.type.toUpperCase();if(!d(g)){e.type="POST";e.data.push({name:"X-HTTP-Method-Override",value:g})}a.ajax(e)}function i(c){var b=a(c).data(g);return!b||!b.validate||b.validate()}a("a[data-ajax=true]").live("click",function(a){a.preventDefault();e(this,{url:this.href,type:"GET",data:[]})});a("form[data-ajax=true] input[type=image]").live("click",function(c){var g=c.target.name,d=a(c.target),f=d.parents("form")[0],e=d.offset();a(f).data(b,[{name:g+".x",value:Math.round(c.pageX-e.left)},{name:g+".y",value:Math.round(c.pageY-e.top)}]);setTimeout(function(){a(f).removeData(b)},0)});a("form[data-ajax=true] :submit").live("click",function(c){var e=c.target.name,d=a(c.target).parents("form")[0];a(d).data(b,e?[{name:e,value:c.target.value}]:[]);setTimeout(function(){a(d).removeData(b)},0)});a("form[data-ajax=true]").live("submit",function(d){var c=a(this).data(b)||[];d.preventDefault();if(!i(this))return;e(this,{url:this.action,type:this.method||"GET",data:c.concat(a(this).serializeArray())})})})(jQuery); -------------------------------------------------------------------------------- /NetBash.Sample/Scripts/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | (function(a){var d=a.validator,b,f="unobtrusiveValidation";function c(a,b,c){a.rules[b]=c;if(a.message)a.messages[b]=a.message}function i(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function g(a){return a.substr(0,a.lastIndexOf(".")+1)}function e(a,b){if(a.indexOf("*.")===0)a=a.replace("*.",b);return a}function l(c,d){var b=a(this).find("[data-valmsg-for='"+d[0].name+"']"),e=a.parseJSON(b.attr("data-valmsg-replace"))!==false;b.removeClass("field-validation-valid").addClass("field-validation-error");c.data("unobtrusiveContainer",b);if(e){b.empty();c.removeClass("input-validation-error").appendTo(b)}else c.hide()}function k(e,d){var c=a(this).find("[data-valmsg-summary=true]"),b=c.find("ul");if(b&&b.length&&d.errorList.length){b.empty();c.addClass("validation-summary-errors").removeClass("validation-summary-valid");a.each(d.errorList,function(){a("
  • ").html(this.message).appendTo(b)})}}function j(c){var b=c.data("unobtrusiveContainer"),d=a.parseJSON(b.attr("data-valmsg-replace"));if(b){b.addClass("field-validation-valid").removeClass("field-validation-error");c.removeData("unobtrusiveContainer");d&&b.empty()}}function h(d){var b=a(d),c=b.data(f);if(!c){c={options:{errorClass:"input-validation-error",errorElement:"span",errorPlacement:a.proxy(l,d),invalidHandler:a.proxy(k,d),messages:{},rules:{},success:a.proxy(j,d)},attachValidation:function(){b.validate(this.options)},validate:function(){b.validate();return b.valid()}};b.data(f,c)}return c}d.unobtrusive={adapters:[],parseElement:function(b,i){var d=a(b),f=d.parents("form")[0],c,e,g;if(!f)return;c=h(f);c.options.rules[b.name]=e={};c.options.messages[b.name]=g={};a.each(this.adapters,function(){var c="data-val-"+this.name,i=d.attr(c),h={};if(i!==undefined){c+="-";a.each(this.params,function(){h[this]=d.attr(c+this)});this.adapt({element:b,form:f,message:i,params:h,rules:e,messages:g})}});jQuery.extend(e,{__dummy__:true});!i&&c.attachValidation()},parse:function(b){a(b).find(":input[data-val=true]").each(function(){d.unobtrusive.parseElement(this,true)});a("form").each(function(){var a=h(this);a&&a.attachValidation()})}};b=d.unobtrusive.adapters;b.add=function(c,a,b){if(!b){b=a;a=[]}this.push({name:c,params:a,adapt:b});return this};b.addBool=function(a,b){return this.add(a,function(d){c(d,b||a,true)})};b.addMinMax=function(e,g,f,a,d,b){return this.add(e,[d||"min",b||"max"],function(b){var e=b.params.min,d=b.params.max;if(e&&d)c(b,a,[e,d]);else if(e)c(b,g,e);else d&&c(b,f,d)})};b.addSingleVal=function(a,b,d){return this.add(a,[b||"val"],function(e){c(e,d||a,e.params[b])})};d.addMethod("__dummy__",function(){return true});d.addMethod("regex",function(b,c,d){var a;if(this.optional(c))return true;a=(new RegExp(d)).exec(b);return a&&a.index===0&&a[0].length===b.length});b.addSingleVal("accept","exts").addSingleVal("regex","pattern");b.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");b.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");b.add("equalto",["other"],function(b){var h=g(b.element.name),i=b.params.other,d=e(i,h),f=a(b.form).find(":input[name="+d+"]")[0];c(b,"equalTo",f)});b.add("required",function(a){(a.element.tagName.toUpperCase()!=="INPUT"||a.element.type.toUpperCase()!=="CHECKBOX")&&c(a,"required",true)});b.add("remote",["url","type","additionalfields"],function(b){var d={url:b.params.url,type:b.params.type||"GET",data:{}},f=g(b.element.name);a.each(i(b.params.additionalfields||b.element.name),function(h,g){var c=e(g,f);d.data[c]=function(){return a(b.form).find(":input[name='"+c+"']").val()}});c(b,"remote",d)});a(function(){d.unobtrusive.parse(document)})})(jQuery); -------------------------------------------------------------------------------- /NetBash.Sample/Scripts/modernizr-1.7.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Note: While Microsoft is not the author of this file, Microsoft is 3 | * offering you a license subject to the terms of the Microsoft Software 4 | * License Terms for Microsoft ASP.NET Model View Controller 3. 5 | * Microsoft reserves all other rights. The notices below are provided 6 | * for informational purposes only and are not the license terms under 7 | * which Microsoft distributed this file. 8 | */ 9 | // Modernizr v1.7 www.modernizr.com 10 | window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.rgba=function(){A("background-color:rgba(150,255,150,.5)");return D(k.backgroundColor,"rgba")},r.hsla=function(){A("background-color:hsla(120,40%,100%,.5)");return D(k.backgroundColor,"rgba")||D(k.backgroundColor,"hsla")},r.multiplebgs=function(){A("background:url(//:),url(//:),red url(//:)");return(new RegExp("(url\\s*\\(.*?){3}")).test(k.background)},r.backgroundsize=function(){return F("backgroundSize")},r.borderimage=function(){return F("borderImage")},r.borderradius=function(){return F("borderRadius","",function(a){return D(a,"orderRadius")})},r.boxshadow=function(){return F("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return F("animationName")},r.csscolumns=function(){return F("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";A((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return D(k.backgroundImage,"gradient")},r.cssreflections=function(){return F("boxReflect")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")},r.fontface=function(){var a,c,d=h||g,e=b.createElement("style"),f=b.implementation||{hasFeature:function(){return!1}};e.type="text/css",d.insertBefore(e,d.firstChild),a=e.sheet||e.styleSheet;var i=f.hasFeature("CSS2","")?function(b){if(!a||!b)return!1;var c=!1;try{a.insertRule(b,0),c=/src/i.test(a.cssRules[0].cssText),a.deleteRule(a.cssRules.length-1)}catch(d){}return c}:function(b){if(!a||!b)return!1;a.cssText=b;return a.cssText.length!==0&&/src/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(b.split(" ")[0])===0};c=i('@font-face { font-family: "font"; src: url(data:,); }'),d.removeChild(e);return c},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,f&&a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="";return a.childNodes.length!==1}()&&function(a,b){function p(a,b){var c=-1,d=a.length,e,f=[];while(++cChange Password 8 |

    9 | Use the form below to change your password. 10 |

    11 |

    12 | New passwords are required to be a minimum of @Membership.MinRequiredPasswordLength characters in length. 13 |

    14 | 15 | 16 | 17 | 18 | @using (Html.BeginForm()) { 19 | @Html.ValidationSummary(true, "Password change was unsuccessful. Please correct the errors and try again.") 20 |
    21 |
    22 | Account Information 23 | 24 |
    25 | @Html.LabelFor(m => m.OldPassword) 26 |
    27 |
    28 | @Html.PasswordFor(m => m.OldPassword) 29 | @Html.ValidationMessageFor(m => m.OldPassword) 30 |
    31 | 32 |
    33 | @Html.LabelFor(m => m.NewPassword) 34 |
    35 |
    36 | @Html.PasswordFor(m => m.NewPassword) 37 | @Html.ValidationMessageFor(m => m.NewPassword) 38 |
    39 | 40 |
    41 | @Html.LabelFor(m => m.ConfirmPassword) 42 |
    43 |
    44 | @Html.PasswordFor(m => m.ConfirmPassword) 45 | @Html.ValidationMessageFor(m => m.ConfirmPassword) 46 |
    47 | 48 |

    49 | 50 |

    51 |
    52 |
    53 | } 54 | -------------------------------------------------------------------------------- /NetBash.Sample/Views/Account/ChangePasswordSuccess.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Change Password"; 3 | } 4 | 5 |

    Change Password

    6 |

    7 | Your password has been changed successfully. 8 |

    9 | -------------------------------------------------------------------------------- /NetBash.Sample/Views/Account/LogOn.cshtml: -------------------------------------------------------------------------------- 1 | @model NetBash.Sample.Models.LogOnModel 2 | 3 | @{ 4 | ViewBag.Title = "Log On"; 5 | } 6 | 7 |

    Log On

    8 |

    9 | Please enter your user name and password. @Html.ActionLink("Register", "Register") if you don't have an account. 10 |

    11 | 12 | 13 | 14 | 15 | @Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.") 16 | 17 | @using (Html.BeginForm()) { 18 |
    19 |
    20 | Account Information 21 | 22 |
    23 | @Html.LabelFor(m => m.UserName) 24 |
    25 |
    26 | @Html.TextBoxFor(m => m.UserName) 27 | @Html.ValidationMessageFor(m => m.UserName) 28 |
    29 | 30 |
    31 | @Html.LabelFor(m => m.Password) 32 |
    33 |
    34 | @Html.PasswordFor(m => m.Password) 35 | @Html.ValidationMessageFor(m => m.Password) 36 |
    37 | 38 |
    39 | @Html.CheckBoxFor(m => m.RememberMe) 40 | @Html.LabelFor(m => m.RememberMe) 41 |
    42 | 43 |

    44 | 45 |

    46 |
    47 |
    48 | } 49 | -------------------------------------------------------------------------------- /NetBash.Sample/Views/Account/Register.cshtml: -------------------------------------------------------------------------------- 1 | @model NetBash.Sample.Models.RegisterModel 2 | 3 | @{ 4 | ViewBag.Title = "Register"; 5 | } 6 | 7 |

    Create a New Account

    8 |

    9 | Use the form below to create a new account. 10 |

    11 |

    12 | Passwords are required to be a minimum of @Membership.MinRequiredPasswordLength characters in length. 13 |

    14 | 15 | 16 | 17 | 18 | @using (Html.BeginForm()) { 19 | @Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.") 20 |
    21 |
    22 | Account Information 23 | 24 |
    25 | @Html.LabelFor(m => m.UserName) 26 |
    27 |
    28 | @Html.TextBoxFor(m => m.UserName) 29 | @Html.ValidationMessageFor(m => m.UserName) 30 |
    31 | 32 |
    33 | @Html.LabelFor(m => m.Email) 34 |
    35 |
    36 | @Html.TextBoxFor(m => m.Email) 37 | @Html.ValidationMessageFor(m => m.Email) 38 |
    39 | 40 |
    41 | @Html.LabelFor(m => m.Password) 42 |
    43 |
    44 | @Html.PasswordFor(m => m.Password) 45 | @Html.ValidationMessageFor(m => m.Password) 46 |
    47 | 48 |
    49 | @Html.LabelFor(m => m.ConfirmPassword) 50 |
    51 |
    52 | @Html.PasswordFor(m => m.ConfirmPassword) 53 | @Html.ValidationMessageFor(m => m.ConfirmPassword) 54 |
    55 | 56 |

    57 | 58 |

    59 |
    60 |
    61 | } 62 | -------------------------------------------------------------------------------- /NetBash.Sample/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "About Us"; 3 | } 4 | 5 |

    About

    6 |

    7 | Put content here. 8 |

    9 | -------------------------------------------------------------------------------- /NetBash.Sample/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Home Page"; 3 | } 4 | 5 |

    @ViewBag.Message

    6 |

    7 | To learn more about ASP.NET MVC visit http://asp.net/mvc. 8 |

    9 | -------------------------------------------------------------------------------- /NetBash.Sample/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Error"; 5 | } 6 | 7 |

    8 | Sorry, an error occurred while processing your request. 9 |

    10 | -------------------------------------------------------------------------------- /NetBash.Sample/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | @ViewBag.Title 5 | 6 | 7 | 8 | @NetBash.NetBash.RenderIncludes() 9 | 10 | 11 |
    12 | 26 |
    27 | @RenderBody() 28 |
    29 | 31 |
    32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /NetBash.Sample/Views/Shared/_LogOnPartial.cshtml: -------------------------------------------------------------------------------- 1 | @if(Request.IsAuthenticated) { 2 | Welcome @User.Identity.Name! 3 | [ @Html.ActionLink("Log Off", "LogOff", "Account") ] 4 | } 5 | else { 6 | @:[ @Html.ActionLink("Log On", "LogOn", "Account") ] 7 | } 8 | -------------------------------------------------------------------------------- /NetBash.Sample/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /NetBash.Sample/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /NetBash.Sample/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /NetBash.Sample/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /NetBash.Sample/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /NetBash.Sample/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /NetBash.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukencode/NetBash/7593058a1bdab58afe331278b459a3e6ca0dcd0e/NetBash.nupkg -------------------------------------------------------------------------------- /NetBash.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetBash", "NetBash.\NetBash.csproj", "{AD552539-66F6-4FA2-8763-D76893A6DF69}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetBash.Sample", "NetBash.Sample\NetBash.Sample.csproj", "{774201D2-F1BA-4595-9828-204A5390395A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {AD552539-66F6-4FA2-8763-D76893A6DF69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {AD552539-66F6-4FA2-8763-D76893A6DF69}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {AD552539-66F6-4FA2-8763-D76893A6DF69}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {AD552539-66F6-4FA2-8763-D76893A6DF69}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {774201D2-F1BA-4595-9828-204A5390395A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {774201D2-F1BA-4595-9828-204A5390395A}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {774201D2-F1BA-4595-9828-204A5390395A}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {774201D2-F1BA-4595-9828-204A5390395A}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /NetBash/AssemblyLocator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Web; 7 | using System.Web.Compilation; 8 | 9 | namespace NetBash 10 | { 11 | internal static class AssemblyLocator 12 | { 13 | private static ReadOnlyCollection AllAssemblies = null; 14 | private static ReadOnlyCollection BinFolderAssemblies = null; 15 | 16 | public static ReadOnlyCollection GetAssemblies() 17 | { 18 | if (AllAssemblies == null) 19 | { 20 | AllAssemblies = new ReadOnlyCollection(BuildManager.GetReferencedAssemblies().Cast().ToList()); 21 | } 22 | 23 | return AllAssemblies; 24 | } 25 | 26 | public static ReadOnlyCollection GetBinFolderAssemblies() 27 | { 28 | if (BinFolderAssemblies == null) 29 | { 30 | IList binFolderAssemblies = new List(); 31 | 32 | string binFolder = HttpRuntime.AppDomainAppPath + "bin\\"; 33 | IList dllFiles = Directory.GetFiles(binFolder, "*.dll", 34 | SearchOption.TopDirectoryOnly).ToList(); 35 | 36 | foreach (string dllFile in dllFiles) 37 | { 38 | try 39 | { 40 | AssemblyName assemblyName = AssemblyName.GetAssemblyName(dllFile); 41 | 42 | Assembly locatedAssembly = AllAssemblies.FirstOrDefault(a => 43 | AssemblyName.ReferenceMatchesDefinition(a.GetName(), assemblyName)); 44 | 45 | if (locatedAssembly != null) 46 | { 47 | binFolderAssemblies.Add(locatedAssembly); 48 | } 49 | } 50 | catch 51 | { 52 | //whatevs 53 | } 54 | } 55 | 56 | BinFolderAssemblies = new ReadOnlyCollection(binFolderAssemblies); 57 | } 58 | 59 | return BinFolderAssemblies; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /NetBash/CommandResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace NetBash 7 | { 8 | internal class CommandResult 9 | { 10 | public string Result { get; set; } 11 | public bool IsHtml { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /NetBash/Commands/ReloadCommands.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace NetBash.Commands 7 | { 8 | [WebCommand("load-commands", "Reloads command assemblies")] 9 | public class ReloadCommands : IWebCommand 10 | { 11 | public bool ReturnHtml 12 | { 13 | get { return false; } 14 | } 15 | 16 | public string Process(string[] args) 17 | { 18 | NetBash.Current.LoadCommands(); 19 | return "Commands loaded, type 'help' to see them"; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /NetBash/Commands/ServerCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web; 6 | 7 | namespace NetBash.Commands 8 | { 9 | [WebCommand("server", "Displays server info")] 10 | public class ServerCommand : IWebCommand 11 | { 12 | public bool ReturnHtml 13 | { 14 | get { return false; } 15 | } 16 | 17 | public string Process(string[] args) 18 | { 19 | var sb = new StringBuilder(); 20 | var context = HttpContext.Current; 21 | 22 | sb.AppendLine("Name - " + context.Server.MachineName); 23 | sb.AppendLine("IP - " + context.Request.ServerVariables["LOCAL_ADDR"]); 24 | sb.AppendLine("Domain - " + context.Request.ServerVariables["Server_Name"]); 25 | sb.AppendLine("Port - " + context.Request.ServerVariables["Server_Port"]); 26 | 27 | return sb.ToString(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /NetBash/Commands/ShortcutsCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace NetBash.Commands 7 | { 8 | [WebCommand("shortcuts", "Displays keyboard shortcuts")] 9 | public class ShortcutsCommand : IWebCommand 10 | { 11 | public bool ReturnHtml 12 | { 13 | get { return false; } 14 | } 15 | 16 | public string Process(string[] args) 17 | { 18 | var sb = new StringBuilder(); 19 | 20 | sb.AppendFormat("{0} - {1}", "`".PadRight(7), "Opens and focuses NetBash"); 21 | sb.AppendLine(); 22 | sb.AppendFormat("{0} - {1}", "esc".PadRight(7), "Closes NetBash"); 23 | sb.AppendLine(); 24 | sb.AppendFormat("{0} - {1}", "↑".PadRight(7), "Puts last command in text box (only when focuses)"); 25 | sb.AppendLine(); 26 | sb.AppendFormat("{0} - {1}", "shift+`".PadRight(7), "Toggle Netbash"); 27 | 28 | return sb.ToString(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /NetBash/Commands/TimeCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace NetBash.Commands 7 | { 8 | [WebCommand("time", "Displays server time")] 9 | public class TimeCommand : IWebCommand 10 | { 11 | public bool ReturnHtml 12 | { 13 | get { return false; } 14 | } 15 | 16 | public string Process(string[] args) 17 | { 18 | return DateTime.Now.ToString(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /NetBash/Commands/UpTimeCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Diagnostics; 6 | 7 | namespace NetBash.Commands 8 | { 9 | [WebCommand("uptime", "Display server uptime")] 10 | public class UpTimeCommand : IWebCommand 11 | { 12 | public bool ReturnHtml 13 | { 14 | get { return false; } 15 | } 16 | 17 | public string Process(string[] args) 18 | { 19 | return UpTime.ToReadableString(); 20 | } 21 | 22 | public TimeSpan UpTime 23 | { 24 | get 25 | { 26 | using (var uptime = new PerformanceCounter("System", "System Up Time")) 27 | { 28 | uptime.NextValue(); //Call this an extra time before reading its value 29 | return TimeSpan.FromSeconds(uptime.NextValue()); 30 | } 31 | } 32 | } 33 | } 34 | 35 | internal static class TimeSpanExtensions 36 | { 37 | internal static string ToReadableString(this TimeSpan span) 38 | { 39 | string formatted = string.Format("{0}{1}{2}{3}", 40 | span.Days > 0 ? string.Format("{0:0} days, ", span.Days) : string.Empty, 41 | span.Hours > 0 ? string.Format("{0:0} hours, ", span.Hours) : string.Empty, 42 | span.Minutes > 0 ? string.Format("{0:0} minutes, ", span.Minutes) : string.Empty, 43 | span.Seconds > 0 ? string.Format("{0:0} seconds", span.Seconds) : string.Empty); 44 | 45 | if (formatted.EndsWith(", ")) formatted = formatted.Substring(0, formatted.Length - 2); 46 | 47 | return formatted; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /NetBash/Content/App_Start/NetBashStart.cs.pp: -------------------------------------------------------------------------------- 1 | [assembly: WebActivator.PreApplicationStartMethod(typeof($rootnamespace$.App_Start.NetBashStart), "Start")] 2 | namespace $rootnamespace$.App_Start { 3 | using NetBash; 4 | public static class NetBashStart { 5 | public static void Start() { 6 | NetBash.Init(); 7 | 8 | //TODO: replace with your own auth code 9 | //NetBash.Settings.Authorize = (request) => 10 | // { 11 | // return request.IsLocal; 12 | // }; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /NetBash/Formatting/SparkExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace NetBash.Formatting 7 | { 8 | public static class SparkExtensions 9 | { 10 | public static String Spark(this string input) 11 | { 12 | var numbers = new List(); 13 | 14 | foreach (var c in input) 15 | { 16 | //lol char graph 17 | numbers.Add((int)c); 18 | } 19 | 20 | return numbers.Spark(); 21 | } 22 | 23 | public static String Spark(this IEnumerable input) 24 | { 25 | var numbers = new List(); 26 | 27 | foreach (var c in input) 28 | { 29 | numbers.Add(Double.Parse(c.ToString())); 30 | } 31 | 32 | return numbers.Spark(); 33 | } 34 | 35 | public static String Spark(this IEnumerable input) 36 | { 37 | return input.Select(v => (double)v).Spark(); 38 | } 39 | 40 | public static String Spark(this IEnumerable input) 41 | { 42 | return input.Select(v => (double)v).Spark(); 43 | } 44 | 45 | public static String Spark(this IEnumerable input) 46 | { 47 | double min = input.Min(); 48 | double max = input.Max(); 49 | double intervalSize = max - min; 50 | 51 | StringBuilder sb = new StringBuilder(input.Count()); 52 | String sparks = "▁▂▃▄▅▆▇"; 53 | 54 | foreach (var d in input) 55 | { 56 | int sparkIndex = (int)((d - min) / intervalSize * (sparks.Length - 1)); 57 | sb.Append(sparks[sparkIndex]); 58 | } 59 | 60 | return sb.ToString(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /NetBash/Formatting/TableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Data; 6 | 7 | namespace NetBash.Formatting 8 | { 9 | public static class TableExtensions 10 | { 11 | public static string ToConsoleTable(this IEnumerable data) 12 | { 13 | var type = typeof(T); 14 | var isEmpty = data == null || !data.Any(); 15 | 16 | //Lets start with a string builder 17 | var sb = new StringBuilder(); 18 | 19 | //If its a list of primatives just output them straight up, yo 20 | if (type.IsPrimitive || typeof(String) == type || typeof(Decimal) == type) 21 | { 22 | foreach (var row in data) 23 | { 24 | sb.Append(row.ToString()); 25 | } 26 | 27 | return sb.ToString(); 28 | } 29 | 30 | //Headers 31 | var properties = type.GetProperties(); 32 | 33 | //get the column widths 34 | var columnWidths = new Dictionary(); 35 | foreach (var prop in properties) 36 | { 37 | var max = prop.Name.Length; 38 | 39 | if (!isEmpty) 40 | { 41 | max = data.Max(row => prop.GetValue(row, null).ToString().Length); 42 | 43 | if (prop.Name.Length > max) 44 | max = prop.Name.Length; 45 | } 46 | 47 | //Add some space 48 | columnWidths.Add(prop.Name, max + 3); 49 | } 50 | 51 | foreach (var prop in properties) 52 | { 53 | sb.AppendFormat("{0,-" + columnWidths[prop.Name] + "}", prop.Name.ToUpper()); 54 | } 55 | 56 | //Bust out a linebreak after the headers 57 | sb.AppendLine(); 58 | 59 | //Another dashed linebreak 60 | for (int i = 0; i < columnWidths.Sum(c => c.Value); i++) 61 | { 62 | sb.Append("-"); 63 | } 64 | 65 | sb.AppendLine(); 66 | 67 | if (!isEmpty) 68 | { 69 | foreach (var row in data) 70 | { 71 | foreach (var prop in properties) 72 | { 73 | sb.AppendFormat("{0,-" + columnWidths[prop.Name] + "}", prop.GetValue(row, null)); 74 | } 75 | 76 | sb.AppendLine(); 77 | } 78 | } 79 | else 80 | { 81 | sb.AppendLine("NO RESULTS"); 82 | } 83 | 84 | //Another dashed linebreak 85 | for (int i = 0; i < columnWidths.Sum(c => c.Value); i++) 86 | { 87 | sb.Append("-"); 88 | } 89 | 90 | sb.AppendLine(); 91 | 92 | return sb.ToString(); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /NetBash/Helpers/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace NetBash.Helpers 7 | { 8 | internal static class StringExtensions 9 | { 10 | //string to command args from http://stackoverflow.com/a/298990/71683 11 | 12 | internal static IEnumerable SplitCommandLine(this string commandLine) 13 | { 14 | bool inQuotes = false; 15 | 16 | return commandLine.Split(c => 17 | { 18 | if (c == '\"') 19 | inQuotes = !inQuotes; 20 | 21 | return !inQuotes && c == ' '; 22 | }) 23 | .Select(arg => arg.Trim().TrimMatchingQuotes('\"')) 24 | .Where(arg => !string.IsNullOrEmpty(arg)); 25 | } 26 | 27 | internal static IEnumerable Split(this string str, Func controller) 28 | { 29 | int nextPiece = 0; 30 | 31 | for (int c = 0; c < str.Length; c++) 32 | { 33 | if (controller(str[c])) 34 | { 35 | yield return str.Substring(nextPiece, c - nextPiece); 36 | nextPiece = c + 1; 37 | } 38 | } 39 | 40 | yield return str.Substring(nextPiece); 41 | } 42 | 43 | internal static string TrimMatchingQuotes(this string input, char quote) 44 | { 45 | if ((input.Length >= 2) && 46 | (input[0] == quote) && (input[input.Length - 1] == quote)) 47 | return input.Substring(1, input.Length - 2); 48 | 49 | return input; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /NetBash/IWebCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace NetBash 7 | { 8 | public interface IWebCommand 9 | { 10 | string Process(string[] args); 11 | bool ReturnHtml { get; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /NetBash/NetBash.Settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.ComponentModel; 6 | using System.Web; 7 | using System.Reflection; 8 | 9 | namespace NetBash 10 | { 11 | public partial class NetBash 12 | { 13 | /// 14 | /// Various configuration properties. 15 | /// 16 | public static class Settings 17 | { 18 | public static string RouteBasePath { get; set; } 19 | public static string Hash { get; private set; } 20 | public static string Version { get; private set; } 21 | public static string WelcomeMessage { get; set; } 22 | public static bool HiddenByDefault { get; set; } 23 | public static Func Authorize { get; set; } 24 | 25 | static Settings() 26 | { 27 | byte[] contents = System.IO.File.ReadAllBytes(typeof(Settings).Assembly.Location); 28 | var md5 = System.Security.Cryptography.MD5.Create(); 29 | Guid hash = new Guid(md5.ComputeHash(contents)); 30 | Hash = hash.ToString(); 31 | 32 | var v = Assembly.GetExecutingAssembly().GetName().Version; 33 | Version = string.Format("{0}.{1}.{2}", v.Major, v.Minor, v.Build); 34 | 35 | WelcomeMessage = string.Format("NetBash {0} - Type \"help\" to list commands", Version); 36 | 37 | RouteBasePath = "~/"; 38 | 39 | HiddenByDefault = false; 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /NetBash/NetBash.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web.Routing; 6 | using System.Web; 7 | using NetBash.UI; 8 | using System.Reflection; 9 | using System.Web.Compilation; 10 | using NetBash.Helpers; 11 | 12 | namespace NetBash 13 | { 14 | public partial class NetBash 15 | { 16 | private List _commandTypes; 17 | private static Type _attributeType = typeof(WebCommandAttribute); 18 | private static Type _interfaceType = typeof(IWebCommand); 19 | 20 | public static void Init() 21 | { 22 | NetBashHandler.RegisterRoutes(); 23 | } 24 | 25 | private static Type[] TryGetTypes(Assembly assembly) 26 | { 27 | try 28 | { 29 | return assembly.GetTypes(); 30 | } 31 | catch (ReflectionTypeLoadException) 32 | { 33 | return Type.EmptyTypes; 34 | } 35 | } 36 | 37 | internal void LoadCommands() 38 | { 39 | _interfaceType = typeof(IWebCommand); 40 | var assemblies = AssemblyLocator.GetAssemblies(); 41 | 42 | var results = from a in assemblies 43 | from t in TryGetTypes(a) 44 | where _interfaceType.IsAssignableFrom(t) 45 | select t; 46 | 47 | _commandTypes = results.ToList(); 48 | 49 | //if we still cant find any throw exception 50 | if (_commandTypes == null || !_commandTypes.Any()) 51 | throw new ApplicationException("No commands found"); 52 | } 53 | 54 | internal CommandResult Process(string commandText) 55 | { 56 | if (_commandTypes == null || !_commandTypes.Any()) 57 | LoadCommands(); 58 | 59 | if (string.IsNullOrWhiteSpace(commandText)) 60 | throw new ArgumentNullException("commandText", "Command text cannot be empty"); 61 | 62 | var split = commandText.SplitCommandLine(); 63 | var command = (split.FirstOrDefault() ?? commandText).ToLower(); 64 | 65 | if (command == "help") 66 | return renderHelp(); 67 | 68 | var commandType = (from c in _commandTypes 69 | let attr = (WebCommandAttribute)c.GetCustomAttributes(_attributeType, false).FirstOrDefault() 70 | where attr != null 71 | && attr.Name.ToLower() == command 72 | select c).FirstOrDefault(); 73 | 74 | if(commandType == null) 75 | throw new ArgumentException(string.Format("Command '{0}' not found", command.ToUpper())); 76 | 77 | var webCommand = (IWebCommand)Activator.CreateInstance(commandType); 78 | 79 | var result = new CommandResult() { IsHtml = webCommand.ReturnHtml }; 80 | result.Result = webCommand.Process(split.Skip(1).ToArray()); 81 | 82 | return result; 83 | } 84 | 85 | private CommandResult renderHelp() 86 | { 87 | var sb = new StringBuilder(); 88 | 89 | sb.AppendLine("CLEAR - Clears current console window"); 90 | 91 | foreach (var t in _commandTypes) 92 | { 93 | var attr = (WebCommandAttribute)t.GetCustomAttributes(_attributeType, false).FirstOrDefault(); 94 | 95 | if(attr == null) 96 | continue; 97 | 98 | sb.AppendLine(string.Format("{0} - {1}", attr.Name.ToUpper().PadRight(15, ' '), attr.Description)); 99 | } 100 | 101 | return new CommandResult { Result = sb.ToString(), IsHtml = false }; 102 | } 103 | 104 | public static IHtmlString RenderIncludes() 105 | { 106 | return NetBashHandler.RenderIncludes(); 107 | } 108 | 109 | #region singleton 110 | static readonly NetBash instance= new NetBash(); 111 | 112 | // Explicit static constructor to tell C# compiler 113 | // not to mark type as beforefieldinit 114 | static NetBash() 115 | { 116 | } 117 | 118 | NetBash() 119 | { 120 | } 121 | 122 | public static NetBash Current 123 | { 124 | get 125 | { 126 | return instance; 127 | } 128 | } 129 | #endregion 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /NetBash/NetBash.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {AD552539-66F6-4FA2-8763-D76893A6DF69} 9 | Library 10 | Properties 11 | NetBash 12 | NetBash 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | "$(ProjectDir)lib\dotless.Compiler.exe" -m "$(ProjectDir)UI\style.less" "$(ProjectDir)UI\style-css.css" 84 | 85 | 92 | -------------------------------------------------------------------------------- /NetBash/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NetBash")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("NetBash")] 13 | [assembly: AssemblyCopyright("Copyright © 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("42ad9a22-17ee-47d2-8774-7341bb6623c6")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.3.0")] 36 | //[assembly: AssemblyFileVersion("0.2")] 37 | -------------------------------------------------------------------------------- /NetBash/UI/NetBashHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Text.RegularExpressions; 7 | using System.Web; 8 | using System.Web.Routing; 9 | using System.Web.Script.Serialization; 10 | 11 | namespace NetBash.UI 12 | { 13 | public class NetBashHandler : IRouteHandler, IHttpHandler 14 | { 15 | internal static HtmlString RenderIncludes() 16 | { 17 | if (NetBash.Settings.Authorize != null && !NetBash.Settings.Authorize(HttpContext.Current.Request)) 18 | return new HtmlString(""); //not authorized dont render 19 | 20 | const string format = 21 | @" 22 | 26 | 27 | "; 28 | 29 | var result = ""; 30 | result = string.Format(format, 31 | ensureTrailingSlash(VirtualPathUtility.ToAbsolute(NetBash.Settings.RouteBasePath)), 32 | NetBash.Settings.Hash, NetBash.Settings.WelcomeMessage, 33 | NetBash.Settings.Version, 34 | NetBash.Settings.HiddenByDefault.ToString().ToLower(), 35 | NetBash.Settings.RouteBasePath.Replace("~", "")); 36 | 37 | return new HtmlString(result); 38 | } 39 | 40 | internal static void RegisterRoutes() 41 | { 42 | var urls = new[] 43 | { 44 | "netbash", 45 | "netbash-jquery-js", 46 | "netbash-keymaster-js", 47 | "netbash-style-css", 48 | "netbash-script-js" 49 | }; 50 | 51 | var routes = RouteTable.Routes; 52 | var handler = new NetBashHandler(); 53 | var prefix = ensureTrailingSlash((NetBash.Settings.RouteBasePath ?? "").Replace("~/", "")); 54 | 55 | using (routes.GetWriteLock()) 56 | { 57 | foreach (var url in urls) 58 | { 59 | var route = new Route(prefix + url, handler) 60 | { 61 | // we have to specify these, so no MVC route helpers will match, e.g. @Html.ActionLink("Home", "Index", "Home") 62 | Defaults = new RouteValueDictionary(new { controller = "NetBashHandler", action = "ProcessRequest" }) 63 | }; 64 | 65 | // put our routes at the beginning, like a boss 66 | routes.Insert(0, route); 67 | } 68 | } 69 | } 70 | 71 | private static string ensureTrailingSlash(string input) 72 | { 73 | if (string.IsNullOrEmpty(input)) return ""; 74 | return Regex.Replace(input, "/+$", "") + "/"; 75 | } 76 | 77 | public IHttpHandler GetHttpHandler(RequestContext requestContext) 78 | { 79 | return this; // elegant? I THINK SO. 80 | } 81 | 82 | /// 83 | /// Try to keep everything static so we can easily be reused. 84 | /// 85 | public bool IsReusable 86 | { 87 | get { return true; } 88 | } 89 | 90 | /// 91 | /// Returns either includes' css/javascript or results' html. 92 | /// 93 | public void ProcessRequest(HttpContext context) 94 | { 95 | string output; 96 | string path = context.Request.AppRelativeCurrentExecutionFilePath; 97 | 98 | switch (Path.GetFileNameWithoutExtension(path).ToLower()) 99 | { 100 | case "netbash-jquery-js": 101 | case "netbash-script-js": 102 | case "netbash-style-css": 103 | case "netbash-keymaster-js": 104 | output = Includes(context, path); 105 | break; 106 | 107 | case "netbash": 108 | output = RenderCommand(context); 109 | break; 110 | 111 | default: 112 | output = NotFound(context); 113 | break; 114 | } 115 | 116 | context.Response.Write(output); 117 | } 118 | 119 | private static string RenderCommand(HttpContext context) 120 | { 121 | if (NetBash.Settings.Authorize != null && !NetBash.Settings.Authorize(HttpContext.Current.Request)) 122 | throw new UnauthorizedAccessException(); 123 | 124 | string commandResponse; 125 | var success = true; 126 | var isHtml = true; 127 | 128 | try 129 | { 130 | var result = NetBash.Current.Process(context.Request.Params["Command"]); 131 | if (result.IsHtml) 132 | { 133 | //on your way 134 | commandResponse = result.Result; 135 | } 136 | else 137 | { 138 | //encode it 139 | commandResponse = HttpUtility.HtmlEncode(result.Result); 140 | } 141 | isHtml = result.IsHtml; 142 | } 143 | catch (Exception ex) 144 | { 145 | success = false; 146 | commandResponse = ex.Message; 147 | } 148 | 149 | var response = new { Success = success, IsHtml = isHtml, Content = commandResponse }; 150 | 151 | context.Response.ContentType = "application/json"; 152 | 153 | var sb = new StringBuilder(); 154 | var serializer = new JavaScriptSerializer(); 155 | serializer.Serialize(response, sb); 156 | 157 | return sb.ToString(); 158 | } 159 | 160 | /// 161 | /// Handles rendering static content files. 162 | /// 163 | private static string Includes(HttpContext context, string path) 164 | { 165 | var response = context.Response; 166 | var extension = "." + path.Split('-').LastOrDefault(); 167 | 168 | switch (extension) 169 | { 170 | case ".js": 171 | response.ContentType = "application/javascript"; 172 | break; 173 | case ".css": 174 | response.ContentType = "text/css"; 175 | break; 176 | case ".gif": 177 | response.ContentType = "image/gif"; 178 | break; 179 | default: 180 | return NotFound(context); 181 | } 182 | 183 | var cache = response.Cache; 184 | cache.SetCacheability(System.Web.HttpCacheability.Public); 185 | cache.SetExpires(DateTime.Now.AddDays(7)); 186 | cache.SetValidUntilExpires(true); 187 | 188 | var embeddedFile = Path.GetFileName(path).Replace("netbash-", "") + extension; 189 | return GetResource(embeddedFile); 190 | } 191 | 192 | private static string GetResource(string filename) 193 | { 194 | string result; 195 | 196 | if (!_ResourceCache.TryGetValue(filename, out result)) 197 | { 198 | using (var stream = typeof(NetBashHandler).Assembly.GetManifestResourceStream("NetBash.UI." + filename)) 199 | using (var reader = new StreamReader(stream)) 200 | { 201 | result = reader.ReadToEnd(); 202 | } 203 | 204 | _ResourceCache[filename] = result; 205 | } 206 | 207 | return result; 208 | } 209 | 210 | /// 211 | /// Embedded resource contents keyed by filename. 212 | /// 213 | private static readonly Dictionary _ResourceCache = new Dictionary(); 214 | 215 | /// 216 | /// Helper method that sets a proper 404 response code. 217 | /// 218 | private static string NotFound(HttpContext context, string contentType = "text/plain", string message = null) 219 | { 220 | context.Response.StatusCode = 404; 221 | context.Response.ContentType = contentType; 222 | 223 | return message; 224 | } 225 | } 226 | } 227 | -------------------------------------------------------------------------------- /NetBash/UI/keymaster-js.js: -------------------------------------------------------------------------------- 1 | // keymaster.js 2 | // (c) 2011 Thomas Fuchs 3 | // keymaster.js may be freely distributed under the MIT license. 4 | (function (a) { function h(a, b) { var c = a.length; while (c--) if (a[c] === b) return c; return -1 } function i(a) { var b, g, i, j, k, m; g = (a.target || a.srcElement).tagName, b = a.keyCode; if (b == 93 || b == 224) b = 91; if (b in d) { d[b] = !0; for (j in f) f[j] == b && (l[j] = !0); return } if (g == "INPUT" || g == "SELECT" || g == "TEXTAREA") return; if (!(b in c)) return; for (k = 0; k < c[b].length; k++) { i = c[b][k]; if (i.scope == e || i.scope == "all") { m = i.mods.length > 0; for (j in d) if (!d[j] && h(i.mods, +j) > -1 || d[j] && h(i.mods, +j) == -1) m = !1; (i.mods.length == 0 && !d[16] && !d[18] && !d[17] && !d[91] || m) && i.method(a, i) === !1 && (a.preventDefault ? a.preventDefault() : a.returnValue = !1, a.stopPropagation && a.stopPropagation(), a.cancelBubble && (a.cancelBubble = !0)) } } } function j(a) { var b = a.keyCode, c; if (b == 93 || b == 224) b = 91; if (b in d) { d[b] = !1; for (c in f) f[c] == b && (l[c] = !1) } } function k() { for (b in d) d[b] = !1; for (b in f) l[b] = !1 } function l(a, b, d) { var e, h, i, j; d === undefined && (d = b, b = "all"), a = a.replace(/\s/g, ""), e = a.split(","), e[e.length - 1] == "" && (e[e.length - 2] += ","); for (i = 0; i < e.length; i++) { h = [], a = e[i].split("+"); if (a.length > 1) { h = a.slice(0, a.length - 1); for (j = 0; j < h.length; j++) h[j] = f[h[j]]; a = [a[a.length - 1]] } a = a[0], a = g[a] || a.toUpperCase().charCodeAt(0), a in c || (c[a] = []), c[a].push({ shortcut: e[i], scope: b, method: d, key: e[i], mods: h }) } } function m(a) { e = a || "all" } function n() { return e || "all" } function o(a, b, c) { a.addEventListener ? a.addEventListener(b, c, !1) : a.attachEvent && a.attachEvent("on" + b, function () { c(window.event) }) } var b, c = {}, d = { 16: !1, 18: !1, 17: !1, 91: !1 }, e = "all", f = { "⇧": 16, shift: 16, "⌥": 18, alt: 18, option: 18, "⌃": 17, ctrl: 17, control: 17, "⌘": 91, command: 91 }, g = { backspace: 8, tab: 9, clear: 12, enter: 13, "return": 13, esc: 27, escape: 27, space: 32, left: 37, up: 38, right: 39, down: 40, del: 46, "delete": 46, home: 36, end: 35, pageup: 33, pagedown: 34, ",": 188, ".": 190, "/": 191, "`": 192, "-": 189, "=": 187, ";": 186, "'": 222, "[": 219, "]": 221, "\\": 220 }; for (b = 1; b < 20; b++) f["f" + b] = 111 + b; for (b in f) l[b] = !1; o(document, "keydown", i), o(document, "keyup", j), o(window, "focus", k), a.key = l, a.key.setScope = m, a.key.getScope = n, typeof module != "undefined" && (module.exports = key) })(this) -------------------------------------------------------------------------------- /NetBash/UI/script-js.js: -------------------------------------------------------------------------------- 1 |  2 | function NetBash($, window, opt) { 3 | 4 | var options = opt || {}; 5 | 6 | var self = this; 7 | var lastCommand; 8 | var storageKey = "NetBash-History"; 9 | var hiddenKey = "NetBash-Hidden"; 10 | var commandKey = "NetBash-LastCommand"; 11 | var isOpen = false; 12 | var isHidden = (options.isHidden === true); 13 | var showLoader; 14 | var existingHtml; 15 | 16 | var hasLocalStorage = function () { 17 | try { 18 | return 'localStorage' in window && window['localStorage'] !== null; 19 | } catch (e) { 20 | return false; 21 | } 22 | }; 23 | 24 | var save = function () { 25 | if (!hasLocalStorage()) { return; } 26 | localStorage[storageKey] = $("#console-result").html(); 27 | localStorage[hiddenKey] = isHidden; 28 | localStorage[commandKey] = lastCommand; 29 | }; 30 | 31 | var load = function () { 32 | if (!hasLocalStorage()) { return; } 33 | 34 | existingHtml = localStorage[storageKey]; 35 | 36 | var localStorageHidden = localStorage[hiddenKey]; 37 | if (localStorageHidden != null) 38 | isHidden = (localStorageHidden == 'true'); 39 | 40 | lastCommand = localStorage[commandKey]; 41 | }; 42 | 43 | var clearStorage = function () { 44 | if (!hasLocalStorage()) { return; } 45 | localStorage[storageKey] = null; 46 | }; 47 | 48 | this.setError = function (message) { 49 | $('
    ').html(message).appendTo('#console-result'); 50 | }; 51 | 52 | this.scrollBottom = function () { 53 | //finish loading 54 | clearTimeout(showLoader); 55 | $("#console-input").removeClass("loading"); 56 | 57 | $("#console-result").scrollTop($("#console-result")[0].scrollHeight); 58 | }; 59 | 60 | this.openConsole = function () { 61 | if (isOpen) 62 | return; 63 | 64 | $("#console-input input").focus(); 65 | 66 | $("#console-result").fadeIn("fast"); 67 | $("#netbash-wrap").animate({ 68 | height: '500px' 69 | }, 100, function () { 70 | isOpen = true; 71 | }); 72 | self.scrollBottom(); 73 | }; 74 | 75 | this.closeConsole = function () { 76 | if (!isOpen) 77 | return; 78 | 79 | $("#console-result").fadeOut("fast"); 80 | $("#netbash-wrap").animate({ 81 | height: '25px' 82 | }, 100, function () { 83 | isOpen = false; 84 | }); 85 | 86 | $("#console-input input").blur(); 87 | }; 88 | 89 | this.startLoader = function () { 90 | showLoader = setTimeout("$('#console-input').addClass('loading')", 300); 91 | }; 92 | 93 | this.sendCommand = function (text) { 94 | self.openConsole(); 95 | $("#console-input input").val(""); 96 | 97 | $('
    ').html(text).appendTo('#console-result'); 98 | self.scrollBottom(); 99 | 100 | //clear command 101 | if (text == "clear") { 102 | $("#console-result").html(""); 103 | clearStorage(); 104 | } else { 105 | self.startLoader(); 106 | 107 | //send command 108 | $.ajax({ 109 | url: options.routeBasePath + 'netbash', 110 | dataType: 'json', 111 | data: { Command: text }, 112 | 113 | success: function (data) { 114 | if (data.Success === true) { 115 | if (data.IsHtml) { 116 | //regs div bro 117 | $('
    ').html(data.Content).appendTo('#console-result'); 118 | } else { 119 | //pre that shit 120 | $('
    ' + data.Content + '
    ').appendTo('#console-result'); 121 | } 122 | } else { 123 | self.setError(data.Content); 124 | } 125 | 126 | self.scrollBottom(); 127 | save(); 128 | }, 129 | 130 | error: function (xhr, ajaxOptions, thrownError) { 131 | self.setError(thrownError.toString()); 132 | self.scrollBottom(); 133 | save(); 134 | } 135 | }); 136 | } 137 | }; 138 | 139 | this.initUI = function () { 140 | var container = null; 141 | 142 | if (isHidden) { 143 | container = $('