@ -1,75 +0,0 @@
|
|||||||
using Cassette;
|
|
||||||
using Cassette.Scripts;
|
|
||||||
using Cassette.Stylesheets;
|
|
||||||
|
|
||||||
namespace NzbDrone.Web
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Configures the Cassette asset bundles for the web application.
|
|
||||||
/// </summary>
|
|
||||||
public class CassetteBundleConfiguration : IConfiguration<BundleCollection>
|
|
||||||
{
|
|
||||||
public const string BASE_STYLE = "BASE_STYLE";
|
|
||||||
public const string BASE_SCRIPT = "BASE_SCRIPT";
|
|
||||||
public const string BACKBONE = "BACKBONE";
|
|
||||||
public const string FONTS = "FONTS";
|
|
||||||
public const string VALIDATION_SCRIPTS = "VALIDATION_SCRIPTS";
|
|
||||||
public const string FILEBROWSER_SCRIPT = "FILEBROWSER_SCRIPT";
|
|
||||||
public const string FILEBROWSER_STYLE = "FILEBROWSER_STYLE";
|
|
||||||
|
|
||||||
public void Configure(BundleCollection bundles)
|
|
||||||
{
|
|
||||||
bundles.AddUrlWithAlias<StylesheetBundle>("//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,600,300'", FONTS);
|
|
||||||
|
|
||||||
|
|
||||||
bundles.Add<StylesheetBundle>(BASE_STYLE, new[]{
|
|
||||||
"content2\\Bootstrap\\bootstrap.less",
|
|
||||||
//"content2\\Bootstrap\\responsive.less",
|
|
||||||
//"content2\\bootstrap-metro.css",
|
|
||||||
"content2\\base.css",
|
|
||||||
"content2\\menu.css",
|
|
||||||
"content2\\bootstrap-overrides.css"},
|
|
||||||
bundle => bundle.AddReference("/" + FONTS));
|
|
||||||
|
|
||||||
bundles.Add<ScriptBundle>(BASE_SCRIPT, new[]{
|
|
||||||
"scripts2\\jquery-1.8.2.js",
|
|
||||||
"scripts2\\jquery.livequery.js",
|
|
||||||
"scripts2\\bootstrap-mvc.js",
|
|
||||||
"scripts2\\bootstrap.js",
|
|
||||||
"scripts2\\metro\\jquery.metro.js"});
|
|
||||||
|
|
||||||
bundles.Add<ScriptBundle>(BACKBONE, new[]{
|
|
||||||
"JsLibraries\\underscore.js",
|
|
||||||
"JsLibraries\\backbone.js",
|
|
||||||
"JsLibraries\\backbone.marionette.js",
|
|
||||||
|
|
||||||
"app.js",
|
|
||||||
"AddSeries\\Views\\addSeriesView.js"},
|
|
||||||
bundle => bundle.AddReference("/" + BASE_SCRIPT));
|
|
||||||
|
|
||||||
|
|
||||||
bundles.AddPerSubDirectory<StylesheetBundle>("AddSeries", bundle => bundle.AddReference("/" + BASE_STYLE));
|
|
||||||
|
|
||||||
|
|
||||||
bundles.Add<StylesheetBundle>(FILEBROWSER_STYLE, new[]{
|
|
||||||
"content2\\stats.css",
|
|
||||||
"content2\\file-browser.css",
|
|
||||||
"content2\\FancyBox\\jquery.fancybox.css"},
|
|
||||||
bundle => bundle.AddReference("/" + BASE_STYLE));
|
|
||||||
|
|
||||||
bundles.Add<ScriptBundle>(FILEBROWSER_SCRIPT, new[]{
|
|
||||||
"content2\\FancyBox\\jquery.fancybox.js"},
|
|
||||||
bundle => bundle.AddReference("/" + BASE_SCRIPT));
|
|
||||||
|
|
||||||
bundles.Add<ScriptBundle>(VALIDATION_SCRIPTS, new[]{
|
|
||||||
"scripts2\\jquery.livequery.js",
|
|
||||||
"scripts2\\jquery.validate.js",
|
|
||||||
"scripts2\\jquery.validate.unobtrusive.js",
|
|
||||||
"scripts2\\bootstrap-mvc.js"},
|
|
||||||
bundle => bundle.AddReference("/" + BASE_SCRIPT));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,246 +0,0 @@
|
|||||||
/*! fancyBox v2.1.0 fancyapps.com | fancyapps.com/fancybox/#license */
|
|
||||||
.fancybox-wrap,
|
|
||||||
.fancybox-skin,
|
|
||||||
.fancybox-outer,
|
|
||||||
.fancybox-inner,
|
|
||||||
.fancybox-image,
|
|
||||||
.fancybox-wrap iframe,
|
|
||||||
.fancybox-wrap object,
|
|
||||||
.fancybox-nav,
|
|
||||||
.fancybox-nav span,
|
|
||||||
.fancybox-tmp
|
|
||||||
{
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
border: 0;
|
|
||||||
outline: none;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-wrap {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 8020;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-skin {
|
|
||||||
position: relative;
|
|
||||||
background: #f9f9f9;
|
|
||||||
color: #444;
|
|
||||||
text-shadow: none;
|
|
||||||
-webkit-border-radius: 4px;
|
|
||||||
-moz-border-radius: 4px;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-opened {
|
|
||||||
z-index: 8030;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-opened .fancybox-skin {
|
|
||||||
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
|
||||||
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
|
||||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-outer, .fancybox-inner {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-inner {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-type-iframe .fancybox-inner {
|
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-error {
|
|
||||||
color: #444;
|
|
||||||
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
|
||||||
margin: 0;
|
|
||||||
padding: 15px;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-image, .fancybox-iframe {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-image {
|
|
||||||
max-width: 100%;
|
|
||||||
max-height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
|
|
||||||
background-image: url('fancybox_sprite.png');
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-loading {
|
|
||||||
position: fixed;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
margin-top: -22px;
|
|
||||||
margin-left: -22px;
|
|
||||||
background-position: 0 -108px;
|
|
||||||
opacity: 0.8;
|
|
||||||
cursor: pointer;
|
|
||||||
z-index: 8060;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-loading div {
|
|
||||||
width: 44px;
|
|
||||||
height: 44px;
|
|
||||||
background: url('fancybox_loading.gif') center center no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-close {
|
|
||||||
position: absolute;
|
|
||||||
top: -18px;
|
|
||||||
right: -18px;
|
|
||||||
width: 36px;
|
|
||||||
height: 36px;
|
|
||||||
cursor: pointer;
|
|
||||||
z-index: 8040;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-nav {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
width: 40%;
|
|
||||||
height: 100%;
|
|
||||||
cursor: pointer;
|
|
||||||
text-decoration: none;
|
|
||||||
background: transparent url('blank.gif'); /* helps IE */
|
|
||||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
||||||
z-index: 8040;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-prev {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-next {
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-nav span {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
width: 36px;
|
|
||||||
height: 34px;
|
|
||||||
margin-top: -18px;
|
|
||||||
cursor: pointer;
|
|
||||||
z-index: 8040;
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-prev span {
|
|
||||||
left: 10px;
|
|
||||||
background-position: 0 -36px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-next span {
|
|
||||||
right: 10px;
|
|
||||||
background-position: 0 -72px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-nav:hover span {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-tmp {
|
|
||||||
position: absolute;
|
|
||||||
top: -9999px;
|
|
||||||
left: -9999px;
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Overlay helper */
|
|
||||||
|
|
||||||
.fancybox-lock {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-overlay {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
display: none;
|
|
||||||
z-index: 8010;
|
|
||||||
background: url('fancybox_overlay.png');
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-overlay-fixed {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-lock .fancybox-overlay {
|
|
||||||
overflow: auto;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Title helper */
|
|
||||||
|
|
||||||
.fancybox-title {
|
|
||||||
visibility: hidden;
|
|
||||||
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
|
||||||
position: relative;
|
|
||||||
text-shadow: none;
|
|
||||||
z-index: 8050;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-opened .fancybox-title {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-title-float-wrap {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
right: 50%;
|
|
||||||
margin-bottom: -35px;
|
|
||||||
z-index: 8050;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-title-float-wrap .child {
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: -100%;
|
|
||||||
padding: 2px 20px;
|
|
||||||
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
|
|
||||||
background: rgba(0, 0, 0, 0.8);
|
|
||||||
-webkit-border-radius: 15px;
|
|
||||||
-moz-border-radius: 15px;
|
|
||||||
border-radius: 15px;
|
|
||||||
text-shadow: 0 1px 2px #222;
|
|
||||||
color: #FFF;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 24px;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-title-outside-wrap {
|
|
||||||
position: relative;
|
|
||||||
margin-top: 10px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-title-inside-wrap {
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-title-over-wrap {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
color: #fff;
|
|
||||||
padding: 10px;
|
|
||||||
background: #000;
|
|
||||||
background: rgba(0, 0, 0, .8);
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
Base off Tim Holman's tile tilt: http://tholman.com/experiments/css3/metro-tiles/
|
|
||||||
*/
|
|
||||||
|
|
||||||
function addTileTilt()
|
|
||||||
{
|
|
||||||
var tile = this;
|
|
||||||
var mouse = {x: 0, y: 0, down: false};
|
|
||||||
var maxRotation = 16;
|
|
||||||
|
|
||||||
var setRotation = function(){
|
|
||||||
var width = tile.offsetWidth;
|
|
||||||
var height = tile.offsetHeight;
|
|
||||||
//Rotations as percentages
|
|
||||||
var yRotation = (mouse.x - (width / 2)) / (width / 2);
|
|
||||||
var xRotation = (mouse.y - (height / 2)) / (height / 2);
|
|
||||||
|
|
||||||
tile.style.webkitTransform = "rotateX(" + -xRotation * maxRotation + "deg)" +
|
|
||||||
" rotateY(" + yRotation * maxRotation + "deg)";
|
|
||||||
|
|
||||||
tile.style.mozTransform = "rotateX(" + -xRotation * maxRotation + "deg)" +
|
|
||||||
" rotateY(" + yRotation * maxRotation + "deg)";
|
|
||||||
|
|
||||||
tile.style.transform = "rotateX(" + -xRotation * maxRotation + "deg)" +
|
|
||||||
" rotateY(" + yRotation * maxRotation + "deg)";
|
|
||||||
}
|
|
||||||
|
|
||||||
var MouseDown = function(e){
|
|
||||||
mouse.x = e.offsetX;
|
|
||||||
mouse.y = e.offsetY;
|
|
||||||
mouse.down = true;
|
|
||||||
setRotation();
|
|
||||||
}
|
|
||||||
|
|
||||||
var MouseUp = function(e){
|
|
||||||
mouse.down = false;
|
|
||||||
tile.style.webkitTransform = "rotateX(0deg)" +
|
|
||||||
" rotateY(0deg)";
|
|
||||||
|
|
||||||
tile.style.mozTransform = "rotateX(0deg)" +
|
|
||||||
" rotateY(0deg)";
|
|
||||||
|
|
||||||
tile.style.transform = "rotateX(0deg)" +
|
|
||||||
" rotateY(0deg)";
|
|
||||||
}
|
|
||||||
|
|
||||||
var MouseMove = function(e){
|
|
||||||
mouse.x = e.offsetX;
|
|
||||||
mouse.y = e.offsetY;
|
|
||||||
if (mouse.down == true){
|
|
||||||
setRotation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tile.addEventListener('mousemove', MouseMove, false);
|
|
||||||
tile.addEventListener('mousedown', MouseDown, false);
|
|
||||||
tile.addEventListener('mouseup', MouseUp, false);
|
|
||||||
tile.addEventListener('mouseout', MouseUp, false);
|
|
||||||
}
|
|
@ -1,408 +0,0 @@
|
|||||||
//!----------------------------------------------------------
|
|
||||||
//! Copyright (C) Microsoft Corporation. All rights reserved.
|
|
||||||
//!----------------------------------------------------------
|
|
||||||
//! MicrosoftMvcAjax.js
|
|
||||||
|
|
||||||
Type.registerNamespace('Sys.Mvc');
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.AjaxOptions
|
|
||||||
|
|
||||||
Sys.Mvc.$create_AjaxOptions = function Sys_Mvc_AjaxOptions() { return {}; }
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.InsertionMode
|
|
||||||
|
|
||||||
Sys.Mvc.InsertionMode = function() {
|
|
||||||
/// <field name="replace" type="Number" integer="true" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="insertBefore" type="Number" integer="true" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="insertAfter" type="Number" integer="true" static="true">
|
|
||||||
/// </field>
|
|
||||||
};
|
|
||||||
Sys.Mvc.InsertionMode.prototype = {
|
|
||||||
replace: 0,
|
|
||||||
insertBefore: 1,
|
|
||||||
insertAfter: 2
|
|
||||||
}
|
|
||||||
Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode', false);
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.AjaxContext
|
|
||||||
|
|
||||||
Sys.Mvc.AjaxContext = function Sys_Mvc_AjaxContext(request, updateTarget, loadingElement, insertionMode) {
|
|
||||||
/// <param name="request" type="Sys.Net.WebRequest">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="updateTarget" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="loadingElement" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="insertionMode" type="Sys.Mvc.InsertionMode">
|
|
||||||
/// </param>
|
|
||||||
/// <field name="_insertionMode" type="Sys.Mvc.InsertionMode">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_loadingElement" type="Object" domElement="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_response" type="Sys.Net.WebRequestExecutor">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_request" type="Sys.Net.WebRequest">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_updateTarget" type="Object" domElement="true">
|
|
||||||
/// </field>
|
|
||||||
this._request = request;
|
|
||||||
this._updateTarget = updateTarget;
|
|
||||||
this._loadingElement = loadingElement;
|
|
||||||
this._insertionMode = insertionMode;
|
|
||||||
}
|
|
||||||
Sys.Mvc.AjaxContext.prototype = {
|
|
||||||
_insertionMode: 0,
|
|
||||||
_loadingElement: null,
|
|
||||||
_response: null,
|
|
||||||
_request: null,
|
|
||||||
_updateTarget: null,
|
|
||||||
|
|
||||||
get_data: function Sys_Mvc_AjaxContext$get_data() {
|
|
||||||
/// <value type="String"></value>
|
|
||||||
if (this._response) {
|
|
||||||
return this._response.get_responseData();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
get_insertionMode: function Sys_Mvc_AjaxContext$get_insertionMode() {
|
|
||||||
/// <value type="Sys.Mvc.InsertionMode"></value>
|
|
||||||
return this._insertionMode;
|
|
||||||
},
|
|
||||||
|
|
||||||
get_loadingElement: function Sys_Mvc_AjaxContext$get_loadingElement() {
|
|
||||||
/// <value type="Object" domElement="true"></value>
|
|
||||||
return this._loadingElement;
|
|
||||||
},
|
|
||||||
|
|
||||||
get_object: function Sys_Mvc_AjaxContext$get_object() {
|
|
||||||
/// <value type="Object"></value>
|
|
||||||
var executor = this.get_response();
|
|
||||||
return (executor) ? executor.get_object() : null;
|
|
||||||
},
|
|
||||||
|
|
||||||
get_response: function Sys_Mvc_AjaxContext$get_response() {
|
|
||||||
/// <value type="Sys.Net.WebRequestExecutor"></value>
|
|
||||||
return this._response;
|
|
||||||
},
|
|
||||||
set_response: function Sys_Mvc_AjaxContext$set_response(value) {
|
|
||||||
/// <value type="Sys.Net.WebRequestExecutor"></value>
|
|
||||||
this._response = value;
|
|
||||||
return value;
|
|
||||||
},
|
|
||||||
|
|
||||||
get_request: function Sys_Mvc_AjaxContext$get_request() {
|
|
||||||
/// <value type="Sys.Net.WebRequest"></value>
|
|
||||||
return this._request;
|
|
||||||
},
|
|
||||||
|
|
||||||
get_updateTarget: function Sys_Mvc_AjaxContext$get_updateTarget() {
|
|
||||||
/// <value type="Object" domElement="true"></value>
|
|
||||||
return this._updateTarget;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.AsyncHyperlink
|
|
||||||
|
|
||||||
Sys.Mvc.AsyncHyperlink = function Sys_Mvc_AsyncHyperlink() {
|
|
||||||
}
|
|
||||||
Sys.Mvc.AsyncHyperlink.handleClick = function Sys_Mvc_AsyncHyperlink$handleClick(anchor, evt, ajaxOptions) {
|
|
||||||
/// <param name="anchor" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="evt" type="Sys.UI.DomEvent">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
|
|
||||||
/// </param>
|
|
||||||
evt.preventDefault();
|
|
||||||
Sys.Mvc.MvcHelpers._asyncRequest(anchor.href, 'post', '', anchor, ajaxOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.MvcHelpers
|
|
||||||
|
|
||||||
Sys.Mvc.MvcHelpers = function Sys_Mvc_MvcHelpers() {
|
|
||||||
}
|
|
||||||
Sys.Mvc.MvcHelpers._serializeSubmitButton = function Sys_Mvc_MvcHelpers$_serializeSubmitButton(element, offsetX, offsetY) {
|
|
||||||
/// <param name="element" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="offsetX" type="Number" integer="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="offsetY" type="Number" integer="true">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="String"></returns>
|
|
||||||
if (element.disabled) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
var name = element.name;
|
|
||||||
if (name) {
|
|
||||||
var tagName = element.tagName.toUpperCase();
|
|
||||||
var encodedName = encodeURIComponent(name);
|
|
||||||
var inputElement = element;
|
|
||||||
if (tagName === 'INPUT') {
|
|
||||||
var type = inputElement.type;
|
|
||||||
if (type === 'submit') {
|
|
||||||
return encodedName + '=' + encodeURIComponent(inputElement.value);
|
|
||||||
}
|
|
||||||
else if (type === 'image') {
|
|
||||||
return encodedName + '.x=' + offsetX + '&' + encodedName + '.y=' + offsetY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ((tagName === 'BUTTON') && (name.length) && (inputElement.type === 'submit')) {
|
|
||||||
return encodedName + '=' + encodeURIComponent(inputElement.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Sys.Mvc.MvcHelpers._serializeForm = function Sys_Mvc_MvcHelpers$_serializeForm(form) {
|
|
||||||
/// <param name="form" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="String"></returns>
|
|
||||||
var formElements = form.elements;
|
|
||||||
var formBody = new Sys.StringBuilder();
|
|
||||||
var count = formElements.length;
|
|
||||||
for (var i = 0; i < count; i++) {
|
|
||||||
var element = formElements[i];
|
|
||||||
var name = element.name;
|
|
||||||
if (!name || !name.length) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var tagName = element.tagName.toUpperCase();
|
|
||||||
if (tagName === 'INPUT') {
|
|
||||||
var inputElement = element;
|
|
||||||
var type = inputElement.type;
|
|
||||||
if ((type === 'text') || (type === 'password') || (type === 'hidden') || (((type === 'checkbox') || (type === 'radio')) && element.checked)) {
|
|
||||||
formBody.append(encodeURIComponent(name));
|
|
||||||
formBody.append('=');
|
|
||||||
formBody.append(encodeURIComponent(inputElement.value));
|
|
||||||
formBody.append('&');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (tagName === 'SELECT') {
|
|
||||||
var selectElement = element;
|
|
||||||
var optionCount = selectElement.options.length;
|
|
||||||
for (var j = 0; j < optionCount; j++) {
|
|
||||||
var optionElement = selectElement.options[j];
|
|
||||||
if (optionElement.selected) {
|
|
||||||
formBody.append(encodeURIComponent(name));
|
|
||||||
formBody.append('=');
|
|
||||||
formBody.append(encodeURIComponent(optionElement.value));
|
|
||||||
formBody.append('&');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (tagName === 'TEXTAREA') {
|
|
||||||
formBody.append(encodeURIComponent(name));
|
|
||||||
formBody.append('=');
|
|
||||||
formBody.append(encodeURIComponent((element.value)));
|
|
||||||
formBody.append('&');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var additionalInput = form._additionalInput;
|
|
||||||
if (additionalInput) {
|
|
||||||
formBody.append(additionalInput);
|
|
||||||
formBody.append('&');
|
|
||||||
}
|
|
||||||
return formBody.toString();
|
|
||||||
}
|
|
||||||
Sys.Mvc.MvcHelpers._asyncRequest = function Sys_Mvc_MvcHelpers$_asyncRequest(url, verb, body, triggerElement, ajaxOptions) {
|
|
||||||
/// <param name="url" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="verb" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="body" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="triggerElement" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
|
|
||||||
/// </param>
|
|
||||||
if (ajaxOptions.confirm) {
|
|
||||||
if (!confirm(ajaxOptions.confirm)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ajaxOptions.url) {
|
|
||||||
url = ajaxOptions.url;
|
|
||||||
}
|
|
||||||
if (ajaxOptions.httpMethod) {
|
|
||||||
verb = ajaxOptions.httpMethod;
|
|
||||||
}
|
|
||||||
if (body.length > 0 && !body.endsWith('&')) {
|
|
||||||
body += '&';
|
|
||||||
}
|
|
||||||
body += 'X-Requested-With=XMLHttpRequest';
|
|
||||||
var upperCaseVerb = verb.toUpperCase();
|
|
||||||
var isGetOrPost = (upperCaseVerb === 'GET' || upperCaseVerb === 'POST');
|
|
||||||
if (!isGetOrPost) {
|
|
||||||
body += '&';
|
|
||||||
body += 'X-HTTP-Method-Override=' + upperCaseVerb;
|
|
||||||
}
|
|
||||||
var requestBody = '';
|
|
||||||
if (upperCaseVerb === 'GET' || upperCaseVerb === 'DELETE') {
|
|
||||||
if (url.indexOf('?') > -1) {
|
|
||||||
if (!url.endsWith('&')) {
|
|
||||||
url += '&';
|
|
||||||
}
|
|
||||||
url += body;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
url += '?';
|
|
||||||
url += body;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
requestBody = body;
|
|
||||||
}
|
|
||||||
var request = new Sys.Net.WebRequest();
|
|
||||||
request.set_url(url);
|
|
||||||
if (isGetOrPost) {
|
|
||||||
request.set_httpVerb(verb);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
request.set_httpVerb('POST');
|
|
||||||
request.get_headers()['X-HTTP-Method-Override'] = upperCaseVerb;
|
|
||||||
}
|
|
||||||
request.set_body(requestBody);
|
|
||||||
if (verb.toUpperCase() === 'PUT') {
|
|
||||||
request.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded;';
|
|
||||||
}
|
|
||||||
request.get_headers()['X-Requested-With'] = 'XMLHttpRequest';
|
|
||||||
var updateElement = null;
|
|
||||||
if (ajaxOptions.updateTargetId) {
|
|
||||||
updateElement = $get(ajaxOptions.updateTargetId);
|
|
||||||
}
|
|
||||||
var loadingElement = null;
|
|
||||||
if (ajaxOptions.loadingElementId) {
|
|
||||||
loadingElement = $get(ajaxOptions.loadingElementId);
|
|
||||||
}
|
|
||||||
var ajaxContext = new Sys.Mvc.AjaxContext(request, updateElement, loadingElement, ajaxOptions.insertionMode);
|
|
||||||
var continueRequest = true;
|
|
||||||
if (ajaxOptions.onBegin) {
|
|
||||||
continueRequest = ajaxOptions.onBegin(ajaxContext) !== false;
|
|
||||||
}
|
|
||||||
if (loadingElement) {
|
|
||||||
Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), true);
|
|
||||||
}
|
|
||||||
if (continueRequest) {
|
|
||||||
request.add_completed(Function.createDelegate(null, function(executor) {
|
|
||||||
Sys.Mvc.MvcHelpers._onComplete(request, ajaxOptions, ajaxContext);
|
|
||||||
}));
|
|
||||||
request.invoke();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request, ajaxOptions, ajaxContext) {
|
|
||||||
/// <param name="request" type="Sys.Net.WebRequest">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="ajaxContext" type="Sys.Mvc.AjaxContext">
|
|
||||||
/// </param>
|
|
||||||
ajaxContext.set_response(request.get_executor());
|
|
||||||
if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var statusCode = ajaxContext.get_response().get_statusCode();
|
|
||||||
if ((statusCode >= 200 && statusCode < 300) || statusCode === 304 || statusCode === 1223) {
|
|
||||||
if (statusCode !== 204 && statusCode !== 304 && statusCode !== 1223) {
|
|
||||||
var contentType = ajaxContext.get_response().getResponseHeader('Content-Type');
|
|
||||||
if ((contentType) && (contentType.indexOf('application/x-javascript') !== -1)) {
|
|
||||||
eval(ajaxContext.get_data());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Sys.Mvc.MvcHelpers.updateDomElement(ajaxContext.get_updateTarget(), ajaxContext.get_insertionMode(), ajaxContext.get_data());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ajaxOptions.onSuccess) {
|
|
||||||
ajaxOptions.onSuccess(ajaxContext);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (ajaxOptions.onFailure) {
|
|
||||||
ajaxOptions.onFailure(ajaxContext);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ajaxContext.get_loadingElement()) {
|
|
||||||
Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Sys.Mvc.MvcHelpers.updateDomElement = function Sys_Mvc_MvcHelpers$updateDomElement(target, insertionMode, content) {
|
|
||||||
/// <param name="target" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="insertionMode" type="Sys.Mvc.InsertionMode">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="content" type="String">
|
|
||||||
/// </param>
|
|
||||||
if (target) {
|
|
||||||
switch (insertionMode) {
|
|
||||||
case Sys.Mvc.InsertionMode.replace:
|
|
||||||
target.innerHTML = content;
|
|
||||||
break;
|
|
||||||
case Sys.Mvc.InsertionMode.insertBefore:
|
|
||||||
if (content && content.length > 0) {
|
|
||||||
target.innerHTML = content + target.innerHTML.trimStart();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Sys.Mvc.InsertionMode.insertAfter:
|
|
||||||
if (content && content.length > 0) {
|
|
||||||
target.innerHTML = target.innerHTML.trimEnd() + content;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.AsyncForm
|
|
||||||
|
|
||||||
Sys.Mvc.AsyncForm = function Sys_Mvc_AsyncForm() {
|
|
||||||
}
|
|
||||||
Sys.Mvc.AsyncForm.handleClick = function Sys_Mvc_AsyncForm$handleClick(form, evt) {
|
|
||||||
/// <param name="form" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="evt" type="Sys.UI.DomEvent">
|
|
||||||
/// </param>
|
|
||||||
var additionalInput = Sys.Mvc.MvcHelpers._serializeSubmitButton(evt.target, evt.offsetX, evt.offsetY);
|
|
||||||
form._additionalInput = additionalInput;
|
|
||||||
}
|
|
||||||
Sys.Mvc.AsyncForm.handleSubmit = function Sys_Mvc_AsyncForm$handleSubmit(form, evt, ajaxOptions) {
|
|
||||||
/// <param name="form" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="evt" type="Sys.UI.DomEvent">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
|
|
||||||
/// </param>
|
|
||||||
evt.preventDefault();
|
|
||||||
var validationCallbacks = form.validationCallbacks;
|
|
||||||
if (validationCallbacks) {
|
|
||||||
for (var i = 0; i < validationCallbacks.length; i++) {
|
|
||||||
var callback = validationCallbacks[i];
|
|
||||||
if (!callback()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var body = Sys.Mvc.MvcHelpers._serializeForm(form);
|
|
||||||
Sys.Mvc.MvcHelpers._asyncRequest(form.action, form.method || 'post', body, form, ajaxOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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');
|
|
||||||
|
|
||||||
// ---- Do not remove this footer ----
|
|
||||||
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
|
|
||||||
// -----------------------------------
|
|
@ -1,25 +0,0 @@
|
|||||||
//----------------------------------------------------------
|
|
||||||
// Copyright (C) Microsoft Corporation. All rights reserved.
|
|
||||||
//----------------------------------------------------------
|
|
||||||
// MicrosoftMvcAjax.js
|
|
||||||
|
|
||||||
Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_AjaxOptions=function(){return {};}
|
|
||||||
Sys.Mvc.InsertionMode=function(){};Sys.Mvc.InsertionMode.prototype = {replace:0,insertBefore:1,insertAfter:2}
|
|
||||||
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;}
|
|
||||||
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;}}
|
|
||||||
Sys.Mvc.AsyncHyperlink=function(){}
|
|
||||||
Sys.Mvc.AsyncHyperlink.handleClick=function(anchor,evt,ajaxOptions){evt.preventDefault();Sys.Mvc.MvcHelpers.$2(anchor.href,'post','',anchor,ajaxOptions);}
|
|
||||||
Sys.Mvc.MvcHelpers=function(){}
|
|
||||||
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;}
|
|
||||||
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();}
|
|
||||||
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){
|
|
||||||
Sys.Mvc.MvcHelpers.$3($3,$p4,$6);}));$3.invoke();}}
|
|
||||||
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);}}
|
|
||||||
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;}}}
|
|
||||||
Sys.Mvc.AsyncForm=function(){}
|
|
||||||
Sys.Mvc.AsyncForm.handleClick=function(form,evt){var $0=Sys.Mvc.MvcHelpers.$0(evt.target,evt.offsetX,evt.offsetY);form._additionalInput = $0;}
|
|
||||||
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);}
|
|
||||||
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');
|
|
||||||
// ---- Do not remove this footer ----
|
|
||||||
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
|
|
||||||
// -----------------------------------
|
|
@ -1,883 +0,0 @@
|
|||||||
//!----------------------------------------------------------
|
|
||||||
//! Copyright (C) Microsoft Corporation. All rights reserved.
|
|
||||||
//!----------------------------------------------------------
|
|
||||||
//! MicrosoftMvcValidation.js
|
|
||||||
|
|
||||||
|
|
||||||
Type.registerNamespace('Sys.Mvc');
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.Validation
|
|
||||||
|
|
||||||
Sys.Mvc.$create_Validation = function Sys_Mvc_Validation() { return {}; }
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.JsonValidationField
|
|
||||||
|
|
||||||
Sys.Mvc.$create_JsonValidationField = function Sys_Mvc_JsonValidationField() { return {}; }
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.JsonValidationOptions
|
|
||||||
|
|
||||||
Sys.Mvc.$create_JsonValidationOptions = function Sys_Mvc_JsonValidationOptions() { return {}; }
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.JsonValidationRule
|
|
||||||
|
|
||||||
Sys.Mvc.$create_JsonValidationRule = function Sys_Mvc_JsonValidationRule() { return {}; }
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.ValidationContext
|
|
||||||
|
|
||||||
Sys.Mvc.$create_ValidationContext = function Sys_Mvc_ValidationContext() { return {}; }
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.NumberValidator
|
|
||||||
|
|
||||||
Sys.Mvc.NumberValidator = function Sys_Mvc_NumberValidator() {
|
|
||||||
}
|
|
||||||
Sys.Mvc.NumberValidator.create = function Sys_Mvc_NumberValidator$create(rule) {
|
|
||||||
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Sys.Mvc.Validator"></returns>
|
|
||||||
return Function.createDelegate(new Sys.Mvc.NumberValidator(), new Sys.Mvc.NumberValidator().validate);
|
|
||||||
}
|
|
||||||
Sys.Mvc.NumberValidator.prototype = {
|
|
||||||
|
|
||||||
validate: function Sys_Mvc_NumberValidator$validate(value, context) {
|
|
||||||
/// <param name="value" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="context" type="Sys.Mvc.ValidationContext">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Object"></returns>
|
|
||||||
if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
var n = Number.parseLocale(value);
|
|
||||||
return (!isNaN(n));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.FormContext
|
|
||||||
|
|
||||||
Sys.Mvc.FormContext = function Sys_Mvc_FormContext(formElement, validationSummaryElement) {
|
|
||||||
/// <param name="formElement" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="validationSummaryElement" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <field name="_validationSummaryErrorCss" type="String" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_validationSummaryValidCss" type="String" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_formValidationTag" type="String" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_onClickHandler" type="Sys.UI.DomEventHandler">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_onSubmitHandler" type="Sys.UI.DomEventHandler">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_errors" type="Array">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_submitButtonClicked" type="Object" domElement="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_validationSummaryElement" type="Object" domElement="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_validationSummaryULElement" type="Object" domElement="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="fields" type="Array" elementType="FieldContext">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_formElement" type="Object" domElement="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="replaceValidationSummary" type="Boolean">
|
|
||||||
/// </field>
|
|
||||||
this._errors = [];
|
|
||||||
this.fields = new Array(0);
|
|
||||||
this._formElement = formElement;
|
|
||||||
this._validationSummaryElement = validationSummaryElement;
|
|
||||||
formElement[Sys.Mvc.FormContext._formValidationTag] = this;
|
|
||||||
if (validationSummaryElement) {
|
|
||||||
var ulElements = validationSummaryElement.getElementsByTagName('ul');
|
|
||||||
if (ulElements.length > 0) {
|
|
||||||
this._validationSummaryULElement = ulElements[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this._onClickHandler = Function.createDelegate(this, this._form_OnClick);
|
|
||||||
this._onSubmitHandler = Function.createDelegate(this, this._form_OnSubmit);
|
|
||||||
}
|
|
||||||
Sys.Mvc.FormContext._Application_Load = function Sys_Mvc_FormContext$_Application_Load() {
|
|
||||||
var allFormOptions = window.mvcClientValidationMetadata;
|
|
||||||
if (allFormOptions) {
|
|
||||||
while (allFormOptions.length > 0) {
|
|
||||||
var thisFormOptions = allFormOptions.pop();
|
|
||||||
Sys.Mvc.FormContext._parseJsonOptions(thisFormOptions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Sys.Mvc.FormContext._getFormElementsWithName = function Sys_Mvc_FormContext$_getFormElementsWithName(formElement, name) {
|
|
||||||
/// <param name="formElement" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="name" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Array" elementType="Object" elementDomElement="true"></returns>
|
|
||||||
var allElementsWithNameInForm = [];
|
|
||||||
var allElementsWithName = document.getElementsByName(name);
|
|
||||||
for (var i = 0; i < allElementsWithName.length; i++) {
|
|
||||||
var thisElement = allElementsWithName[i];
|
|
||||||
if (Sys.Mvc.FormContext._isElementInHierarchy(formElement, thisElement)) {
|
|
||||||
Array.add(allElementsWithNameInForm, thisElement);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return allElementsWithNameInForm;
|
|
||||||
}
|
|
||||||
Sys.Mvc.FormContext.getValidationForForm = function Sys_Mvc_FormContext$getValidationForForm(formElement) {
|
|
||||||
/// <param name="formElement" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Sys.Mvc.FormContext"></returns>
|
|
||||||
return formElement[Sys.Mvc.FormContext._formValidationTag];
|
|
||||||
}
|
|
||||||
Sys.Mvc.FormContext._isElementInHierarchy = function Sys_Mvc_FormContext$_isElementInHierarchy(parent, child) {
|
|
||||||
/// <param name="parent" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="child" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Boolean"></returns>
|
|
||||||
while (child) {
|
|
||||||
if (parent === child) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
child = child.parentNode;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Sys.Mvc.FormContext._parseJsonOptions = function Sys_Mvc_FormContext$_parseJsonOptions(options) {
|
|
||||||
/// <param name="options" type="Sys.Mvc.JsonValidationOptions">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Sys.Mvc.FormContext"></returns>
|
|
||||||
var formElement = $get(options.FormId);
|
|
||||||
var validationSummaryElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(options.ValidationSummaryId)) ? $get(options.ValidationSummaryId) : null;
|
|
||||||
var formContext = new Sys.Mvc.FormContext(formElement, validationSummaryElement);
|
|
||||||
formContext.enableDynamicValidation();
|
|
||||||
formContext.replaceValidationSummary = options.ReplaceValidationSummary;
|
|
||||||
for (var i = 0; i < options.Fields.length; i++) {
|
|
||||||
var field = options.Fields[i];
|
|
||||||
var fieldElements = Sys.Mvc.FormContext._getFormElementsWithName(formElement, field.FieldName);
|
|
||||||
var validationMessageElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(field.ValidationMessageId)) ? $get(field.ValidationMessageId) : null;
|
|
||||||
var fieldContext = new Sys.Mvc.FieldContext(formContext);
|
|
||||||
Array.addRange(fieldContext.elements, fieldElements);
|
|
||||||
fieldContext.validationMessageElement = validationMessageElement;
|
|
||||||
fieldContext.replaceValidationMessageContents = field.ReplaceValidationMessageContents;
|
|
||||||
for (var j = 0; j < field.ValidationRules.length; j++) {
|
|
||||||
var rule = field.ValidationRules[j];
|
|
||||||
var validator = Sys.Mvc.ValidatorRegistry.getValidator(rule);
|
|
||||||
if (validator) {
|
|
||||||
var validation = Sys.Mvc.$create_Validation();
|
|
||||||
validation.fieldErrorMessage = rule.ErrorMessage;
|
|
||||||
validation.validator = validator;
|
|
||||||
Array.add(fieldContext.validations, validation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldContext.enableDynamicValidation();
|
|
||||||
Array.add(formContext.fields, fieldContext);
|
|
||||||
}
|
|
||||||
var registeredValidatorCallbacks = formElement.validationCallbacks;
|
|
||||||
if (!registeredValidatorCallbacks) {
|
|
||||||
registeredValidatorCallbacks = [];
|
|
||||||
formElement.validationCallbacks = registeredValidatorCallbacks;
|
|
||||||
}
|
|
||||||
registeredValidatorCallbacks.push(Function.createDelegate(null, function() {
|
|
||||||
return Sys.Mvc._validationUtil.arrayIsNullOrEmpty(formContext.validate('submit'));
|
|
||||||
}));
|
|
||||||
return formContext;
|
|
||||||
}
|
|
||||||
Sys.Mvc.FormContext.prototype = {
|
|
||||||
_onClickHandler: null,
|
|
||||||
_onSubmitHandler: null,
|
|
||||||
_submitButtonClicked: null,
|
|
||||||
_validationSummaryElement: null,
|
|
||||||
_validationSummaryULElement: null,
|
|
||||||
_formElement: null,
|
|
||||||
replaceValidationSummary: false,
|
|
||||||
|
|
||||||
addError: function Sys_Mvc_FormContext$addError(message) {
|
|
||||||
/// <param name="message" type="String">
|
|
||||||
/// </param>
|
|
||||||
this.addErrors([ message ]);
|
|
||||||
},
|
|
||||||
|
|
||||||
addErrors: function Sys_Mvc_FormContext$addErrors(messages) {
|
|
||||||
/// <param name="messages" type="Array" elementType="String">
|
|
||||||
/// </param>
|
|
||||||
if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) {
|
|
||||||
Array.addRange(this._errors, messages);
|
|
||||||
this._onErrorCountChanged();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
clearErrors: function Sys_Mvc_FormContext$clearErrors() {
|
|
||||||
Array.clear(this._errors);
|
|
||||||
this._onErrorCountChanged();
|
|
||||||
},
|
|
||||||
|
|
||||||
_displayError: function Sys_Mvc_FormContext$_displayError() {
|
|
||||||
if (this._validationSummaryElement) {
|
|
||||||
if (this._validationSummaryULElement) {
|
|
||||||
Sys.Mvc._validationUtil.removeAllChildren(this._validationSummaryULElement);
|
|
||||||
for (var i = 0; i < this._errors.length; i++) {
|
|
||||||
var liElement = document.createElement('li');
|
|
||||||
Sys.Mvc._validationUtil.setInnerText(liElement, this._errors[i]);
|
|
||||||
this._validationSummaryULElement.appendChild(liElement);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Sys.UI.DomElement.removeCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss);
|
|
||||||
Sys.UI.DomElement.addCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_displaySuccess: function Sys_Mvc_FormContext$_displaySuccess() {
|
|
||||||
var validationSummaryElement = this._validationSummaryElement;
|
|
||||||
if (validationSummaryElement) {
|
|
||||||
var validationSummaryULElement = this._validationSummaryULElement;
|
|
||||||
if (validationSummaryULElement) {
|
|
||||||
validationSummaryULElement.innerHTML = '';
|
|
||||||
}
|
|
||||||
Sys.UI.DomElement.removeCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss);
|
|
||||||
Sys.UI.DomElement.addCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
enableDynamicValidation: function Sys_Mvc_FormContext$enableDynamicValidation() {
|
|
||||||
Sys.UI.DomEvent.addHandler(this._formElement, 'click', this._onClickHandler);
|
|
||||||
Sys.UI.DomEvent.addHandler(this._formElement, 'submit', this._onSubmitHandler);
|
|
||||||
},
|
|
||||||
|
|
||||||
_findSubmitButton: function Sys_Mvc_FormContext$_findSubmitButton(element) {
|
|
||||||
/// <param name="element" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Object" domElement="true"></returns>
|
|
||||||
if (element.disabled) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
var tagName = element.tagName.toUpperCase();
|
|
||||||
var inputElement = element;
|
|
||||||
if (tagName === 'INPUT') {
|
|
||||||
var type = inputElement.type;
|
|
||||||
if (type === 'submit' || type === 'image') {
|
|
||||||
return inputElement;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ((tagName === 'BUTTON') && (inputElement.type === 'submit')) {
|
|
||||||
return inputElement;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
|
|
||||||
_form_OnClick: function Sys_Mvc_FormContext$_form_OnClick(e) {
|
|
||||||
/// <param name="e" type="Sys.UI.DomEvent">
|
|
||||||
/// </param>
|
|
||||||
this._submitButtonClicked = this._findSubmitButton(e.target);
|
|
||||||
},
|
|
||||||
|
|
||||||
_form_OnSubmit: function Sys_Mvc_FormContext$_form_OnSubmit(e) {
|
|
||||||
/// <param name="e" type="Sys.UI.DomEvent">
|
|
||||||
/// </param>
|
|
||||||
var form = e.target;
|
|
||||||
var submitButton = this._submitButtonClicked;
|
|
||||||
if (submitButton && submitButton.disableValidation) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var errorMessages = this.validate('submit');
|
|
||||||
if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(errorMessages)) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_onErrorCountChanged: function Sys_Mvc_FormContext$_onErrorCountChanged() {
|
|
||||||
if (!this._errors.length) {
|
|
||||||
this._displaySuccess();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this._displayError();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
validate: function Sys_Mvc_FormContext$validate(eventName) {
|
|
||||||
/// <param name="eventName" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Array" elementType="String"></returns>
|
|
||||||
var fields = this.fields;
|
|
||||||
var errors = [];
|
|
||||||
for (var i = 0; i < fields.length; i++) {
|
|
||||||
var field = fields[i];
|
|
||||||
if (!field.elements[0].disabled) {
|
|
||||||
var thisErrors = field.validate(eventName);
|
|
||||||
if (thisErrors) {
|
|
||||||
Array.addRange(errors, thisErrors);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.replaceValidationSummary) {
|
|
||||||
this.clearErrors();
|
|
||||||
this.addErrors(errors);
|
|
||||||
}
|
|
||||||
return errors;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.FieldContext
|
|
||||||
|
|
||||||
Sys.Mvc.FieldContext = function Sys_Mvc_FieldContext(formContext) {
|
|
||||||
/// <param name="formContext" type="Sys.Mvc.FormContext">
|
|
||||||
/// </param>
|
|
||||||
/// <field name="_hasTextChangedTag" type="String" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_hasValidationFiredTag" type="String" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_inputElementErrorCss" type="String" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_inputElementValidCss" type="String" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_validationMessageErrorCss" type="String" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_validationMessageValidCss" type="String" static="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_onBlurHandler" type="Sys.UI.DomEventHandler">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_onChangeHandler" type="Sys.UI.DomEventHandler">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_onInputHandler" type="Sys.UI.DomEventHandler">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_onPropertyChangeHandler" type="Sys.UI.DomEventHandler">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_errors" type="Array">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="defaultErrorMessage" type="String">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="elements" type="Array" elementType="Object" elementDomElement="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="formContext" type="Sys.Mvc.FormContext">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="replaceValidationMessageContents" type="Boolean">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="validationMessageElement" type="Object" domElement="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="validations" type="Array" elementType="Validation">
|
|
||||||
/// </field>
|
|
||||||
this._errors = [];
|
|
||||||
this.elements = new Array(0);
|
|
||||||
this.validations = new Array(0);
|
|
||||||
this.formContext = formContext;
|
|
||||||
this._onBlurHandler = Function.createDelegate(this, this._element_OnBlur);
|
|
||||||
this._onChangeHandler = Function.createDelegate(this, this._element_OnChange);
|
|
||||||
this._onInputHandler = Function.createDelegate(this, this._element_OnInput);
|
|
||||||
this._onPropertyChangeHandler = Function.createDelegate(this, this._element_OnPropertyChange);
|
|
||||||
}
|
|
||||||
Sys.Mvc.FieldContext.prototype = {
|
|
||||||
_onBlurHandler: null,
|
|
||||||
_onChangeHandler: null,
|
|
||||||
_onInputHandler: null,
|
|
||||||
_onPropertyChangeHandler: null,
|
|
||||||
defaultErrorMessage: null,
|
|
||||||
formContext: null,
|
|
||||||
replaceValidationMessageContents: false,
|
|
||||||
validationMessageElement: null,
|
|
||||||
|
|
||||||
addError: function Sys_Mvc_FieldContext$addError(message) {
|
|
||||||
/// <param name="message" type="String">
|
|
||||||
/// </param>
|
|
||||||
this.addErrors([ message ]);
|
|
||||||
},
|
|
||||||
|
|
||||||
addErrors: function Sys_Mvc_FieldContext$addErrors(messages) {
|
|
||||||
/// <param name="messages" type="Array" elementType="String">
|
|
||||||
/// </param>
|
|
||||||
if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) {
|
|
||||||
Array.addRange(this._errors, messages);
|
|
||||||
this._onErrorCountChanged();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
clearErrors: function Sys_Mvc_FieldContext$clearErrors() {
|
|
||||||
Array.clear(this._errors);
|
|
||||||
this._onErrorCountChanged();
|
|
||||||
},
|
|
||||||
|
|
||||||
_displayError: function Sys_Mvc_FieldContext$_displayError() {
|
|
||||||
var validationMessageElement = this.validationMessageElement;
|
|
||||||
if (validationMessageElement) {
|
|
||||||
if (this.replaceValidationMessageContents) {
|
|
||||||
Sys.Mvc._validationUtil.setInnerText(validationMessageElement, this._errors[0]);
|
|
||||||
}
|
|
||||||
Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss);
|
|
||||||
Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss);
|
|
||||||
}
|
|
||||||
var elements = this.elements;
|
|
||||||
for (var i = 0; i < elements.length; i++) {
|
|
||||||
var element = elements[i];
|
|
||||||
Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss);
|
|
||||||
Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_displaySuccess: function Sys_Mvc_FieldContext$_displaySuccess() {
|
|
||||||
var validationMessageElement = this.validationMessageElement;
|
|
||||||
if (validationMessageElement) {
|
|
||||||
if (this.replaceValidationMessageContents) {
|
|
||||||
Sys.Mvc._validationUtil.setInnerText(validationMessageElement, '');
|
|
||||||
}
|
|
||||||
Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss);
|
|
||||||
Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss);
|
|
||||||
}
|
|
||||||
var elements = this.elements;
|
|
||||||
for (var i = 0; i < elements.length; i++) {
|
|
||||||
var element = elements[i];
|
|
||||||
Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss);
|
|
||||||
Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_element_OnBlur: function Sys_Mvc_FieldContext$_element_OnBlur(e) {
|
|
||||||
/// <param name="e" type="Sys.UI.DomEvent">
|
|
||||||
/// </param>
|
|
||||||
if (e.target[Sys.Mvc.FieldContext._hasTextChangedTag] || e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) {
|
|
||||||
this.validate('blur');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_element_OnChange: function Sys_Mvc_FieldContext$_element_OnChange(e) {
|
|
||||||
/// <param name="e" type="Sys.UI.DomEvent">
|
|
||||||
/// </param>
|
|
||||||
e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
_element_OnInput: function Sys_Mvc_FieldContext$_element_OnInput(e) {
|
|
||||||
/// <param name="e" type="Sys.UI.DomEvent">
|
|
||||||
/// </param>
|
|
||||||
e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true;
|
|
||||||
if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) {
|
|
||||||
this.validate('input');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_element_OnPropertyChange: function Sys_Mvc_FieldContext$_element_OnPropertyChange(e) {
|
|
||||||
/// <param name="e" type="Sys.UI.DomEvent">
|
|
||||||
/// </param>
|
|
||||||
if (e.rawEvent.propertyName === 'value') {
|
|
||||||
e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true;
|
|
||||||
if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) {
|
|
||||||
this.validate('input');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
enableDynamicValidation: function Sys_Mvc_FieldContext$enableDynamicValidation() {
|
|
||||||
var elements = this.elements;
|
|
||||||
for (var i = 0; i < elements.length; i++) {
|
|
||||||
var element = elements[i];
|
|
||||||
if (Sys.Mvc._validationUtil.elementSupportsEvent(element, 'onpropertychange')) {
|
|
||||||
var compatMode = document.documentMode;
|
|
||||||
if (compatMode && compatMode >= 8) {
|
|
||||||
Sys.UI.DomEvent.addHandler(element, 'propertychange', this._onPropertyChangeHandler);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Sys.UI.DomEvent.addHandler(element, 'input', this._onInputHandler);
|
|
||||||
}
|
|
||||||
Sys.UI.DomEvent.addHandler(element, 'change', this._onChangeHandler);
|
|
||||||
Sys.UI.DomEvent.addHandler(element, 'blur', this._onBlurHandler);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_getErrorString: function Sys_Mvc_FieldContext$_getErrorString(validatorReturnValue, fieldErrorMessage) {
|
|
||||||
/// <param name="validatorReturnValue" type="Object">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="fieldErrorMessage" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="String"></returns>
|
|
||||||
var fallbackErrorMessage = fieldErrorMessage || this.defaultErrorMessage;
|
|
||||||
if (Boolean.isInstanceOfType(validatorReturnValue)) {
|
|
||||||
return (validatorReturnValue) ? null : fallbackErrorMessage;
|
|
||||||
}
|
|
||||||
if (String.isInstanceOfType(validatorReturnValue)) {
|
|
||||||
return ((validatorReturnValue).length) ? validatorReturnValue : fallbackErrorMessage;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
|
|
||||||
_getStringValue: function Sys_Mvc_FieldContext$_getStringValue() {
|
|
||||||
/// <returns type="String"></returns>
|
|
||||||
var elements = this.elements;
|
|
||||||
return (elements.length > 0) ? elements[0].value : null;
|
|
||||||
},
|
|
||||||
|
|
||||||
_markValidationFired: function Sys_Mvc_FieldContext$_markValidationFired() {
|
|
||||||
var elements = this.elements;
|
|
||||||
for (var i = 0; i < elements.length; i++) {
|
|
||||||
var element = elements[i];
|
|
||||||
element[Sys.Mvc.FieldContext._hasValidationFiredTag] = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_onErrorCountChanged: function Sys_Mvc_FieldContext$_onErrorCountChanged() {
|
|
||||||
if (!this._errors.length) {
|
|
||||||
this._displaySuccess();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this._displayError();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
validate: function Sys_Mvc_FieldContext$validate(eventName) {
|
|
||||||
/// <param name="eventName" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Array" elementType="String"></returns>
|
|
||||||
var validations = this.validations;
|
|
||||||
var errors = [];
|
|
||||||
var value = this._getStringValue();
|
|
||||||
for (var i = 0; i < validations.length; i++) {
|
|
||||||
var validation = validations[i];
|
|
||||||
var context = Sys.Mvc.$create_ValidationContext();
|
|
||||||
context.eventName = eventName;
|
|
||||||
context.fieldContext = this;
|
|
||||||
context.validation = validation;
|
|
||||||
var retVal = validation.validator(value, context);
|
|
||||||
var errorMessage = this._getErrorString(retVal, validation.fieldErrorMessage);
|
|
||||||
if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(errorMessage)) {
|
|
||||||
Array.add(errors, errorMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this._markValidationFired();
|
|
||||||
this.clearErrors();
|
|
||||||
this.addErrors(errors);
|
|
||||||
return errors;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.RangeValidator
|
|
||||||
|
|
||||||
Sys.Mvc.RangeValidator = function Sys_Mvc_RangeValidator(minimum, maximum) {
|
|
||||||
/// <param name="minimum" type="Number">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="maximum" type="Number">
|
|
||||||
/// </param>
|
|
||||||
/// <field name="_minimum" type="Number">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_maximum" type="Number">
|
|
||||||
/// </field>
|
|
||||||
this._minimum = minimum;
|
|
||||||
this._maximum = maximum;
|
|
||||||
}
|
|
||||||
Sys.Mvc.RangeValidator.create = function Sys_Mvc_RangeValidator$create(rule) {
|
|
||||||
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Sys.Mvc.Validator"></returns>
|
|
||||||
var min = rule.ValidationParameters['min'];
|
|
||||||
var max = rule.ValidationParameters['max'];
|
|
||||||
return Function.createDelegate(new Sys.Mvc.RangeValidator(min, max), new Sys.Mvc.RangeValidator(min, max).validate);
|
|
||||||
}
|
|
||||||
Sys.Mvc.RangeValidator.prototype = {
|
|
||||||
_minimum: null,
|
|
||||||
_maximum: null,
|
|
||||||
|
|
||||||
validate: function Sys_Mvc_RangeValidator$validate(value, context) {
|
|
||||||
/// <param name="value" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="context" type="Sys.Mvc.ValidationContext">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Object"></returns>
|
|
||||||
if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
var n = Number.parseLocale(value);
|
|
||||||
return (!isNaN(n) && this._minimum <= n && n <= this._maximum);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.RegularExpressionValidator
|
|
||||||
|
|
||||||
Sys.Mvc.RegularExpressionValidator = function Sys_Mvc_RegularExpressionValidator(pattern) {
|
|
||||||
/// <param name="pattern" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <field name="_pattern" type="String">
|
|
||||||
/// </field>
|
|
||||||
this._pattern = pattern;
|
|
||||||
}
|
|
||||||
Sys.Mvc.RegularExpressionValidator.create = function Sys_Mvc_RegularExpressionValidator$create(rule) {
|
|
||||||
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Sys.Mvc.Validator"></returns>
|
|
||||||
var pattern = rule.ValidationParameters['pattern'];
|
|
||||||
return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator(pattern), new Sys.Mvc.RegularExpressionValidator(pattern).validate);
|
|
||||||
}
|
|
||||||
Sys.Mvc.RegularExpressionValidator.prototype = {
|
|
||||||
_pattern: null,
|
|
||||||
|
|
||||||
validate: function Sys_Mvc_RegularExpressionValidator$validate(value, context) {
|
|
||||||
/// <param name="value" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="context" type="Sys.Mvc.ValidationContext">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Object"></returns>
|
|
||||||
if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
var regExp = new RegExp(this._pattern);
|
|
||||||
var matches = regExp.exec(value);
|
|
||||||
return (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(matches) && matches[0].length === value.length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.RequiredValidator
|
|
||||||
|
|
||||||
Sys.Mvc.RequiredValidator = function Sys_Mvc_RequiredValidator() {
|
|
||||||
}
|
|
||||||
Sys.Mvc.RequiredValidator.create = function Sys_Mvc_RequiredValidator$create(rule) {
|
|
||||||
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Sys.Mvc.Validator"></returns>
|
|
||||||
return Function.createDelegate(new Sys.Mvc.RequiredValidator(), new Sys.Mvc.RequiredValidator().validate);
|
|
||||||
}
|
|
||||||
Sys.Mvc.RequiredValidator._isRadioInputElement = function Sys_Mvc_RequiredValidator$_isRadioInputElement(element) {
|
|
||||||
/// <param name="element" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Boolean"></returns>
|
|
||||||
if (element.tagName.toUpperCase() === 'INPUT') {
|
|
||||||
var inputType = (element.type).toUpperCase();
|
|
||||||
if (inputType === 'RADIO') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Sys.Mvc.RequiredValidator._isSelectInputElement = function Sys_Mvc_RequiredValidator$_isSelectInputElement(element) {
|
|
||||||
/// <param name="element" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Boolean"></returns>
|
|
||||||
if (element.tagName.toUpperCase() === 'SELECT') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Sys.Mvc.RequiredValidator._isTextualInputElement = function Sys_Mvc_RequiredValidator$_isTextualInputElement(element) {
|
|
||||||
/// <param name="element" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Boolean"></returns>
|
|
||||||
if (element.tagName.toUpperCase() === 'INPUT') {
|
|
||||||
var inputType = (element.type).toUpperCase();
|
|
||||||
switch (inputType) {
|
|
||||||
case 'TEXT':
|
|
||||||
case 'PASSWORD':
|
|
||||||
case 'FILE':
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (element.tagName.toUpperCase() === 'TEXTAREA') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Sys.Mvc.RequiredValidator._validateRadioInput = function Sys_Mvc_RequiredValidator$_validateRadioInput(elements) {
|
|
||||||
/// <param name="elements" type="Array" elementType="Object" elementDomElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Object"></returns>
|
|
||||||
for (var i = 0; i < elements.length; i++) {
|
|
||||||
var element = elements[i];
|
|
||||||
if (element.checked) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Sys.Mvc.RequiredValidator._validateSelectInput = function Sys_Mvc_RequiredValidator$_validateSelectInput(optionElements) {
|
|
||||||
/// <param name="optionElements" type="DOMElementCollection">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Object"></returns>
|
|
||||||
for (var i = 0; i < optionElements.length; i++) {
|
|
||||||
var element = optionElements[i];
|
|
||||||
if (element.selected) {
|
|
||||||
if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Sys.Mvc.RequiredValidator._validateTextualInput = function Sys_Mvc_RequiredValidator$_validateTextualInput(element) {
|
|
||||||
/// <param name="element" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Object"></returns>
|
|
||||||
return (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value));
|
|
||||||
}
|
|
||||||
Sys.Mvc.RequiredValidator.prototype = {
|
|
||||||
|
|
||||||
validate: function Sys_Mvc_RequiredValidator$validate(value, context) {
|
|
||||||
/// <param name="value" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="context" type="Sys.Mvc.ValidationContext">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Object"></returns>
|
|
||||||
var elements = context.fieldContext.elements;
|
|
||||||
if (!elements.length) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
var sampleElement = elements[0];
|
|
||||||
if (Sys.Mvc.RequiredValidator._isTextualInputElement(sampleElement)) {
|
|
||||||
return Sys.Mvc.RequiredValidator._validateTextualInput(sampleElement);
|
|
||||||
}
|
|
||||||
if (Sys.Mvc.RequiredValidator._isRadioInputElement(sampleElement)) {
|
|
||||||
return Sys.Mvc.RequiredValidator._validateRadioInput(elements);
|
|
||||||
}
|
|
||||||
if (Sys.Mvc.RequiredValidator._isSelectInputElement(sampleElement)) {
|
|
||||||
return Sys.Mvc.RequiredValidator._validateSelectInput((sampleElement).options);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.StringLengthValidator
|
|
||||||
|
|
||||||
Sys.Mvc.StringLengthValidator = function Sys_Mvc_StringLengthValidator(minLength, maxLength) {
|
|
||||||
/// <param name="minLength" type="Number" integer="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="maxLength" type="Number" integer="true">
|
|
||||||
/// </param>
|
|
||||||
/// <field name="_maxLength" type="Number" integer="true">
|
|
||||||
/// </field>
|
|
||||||
/// <field name="_minLength" type="Number" integer="true">
|
|
||||||
/// </field>
|
|
||||||
this._minLength = minLength;
|
|
||||||
this._maxLength = maxLength;
|
|
||||||
}
|
|
||||||
Sys.Mvc.StringLengthValidator.create = function Sys_Mvc_StringLengthValidator$create(rule) {
|
|
||||||
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Sys.Mvc.Validator"></returns>
|
|
||||||
var minLength = (rule.ValidationParameters['min'] || 0);
|
|
||||||
var maxLength = (rule.ValidationParameters['max'] || Number.MAX_VALUE);
|
|
||||||
return Function.createDelegate(new Sys.Mvc.StringLengthValidator(minLength, maxLength), new Sys.Mvc.StringLengthValidator(minLength, maxLength).validate);
|
|
||||||
}
|
|
||||||
Sys.Mvc.StringLengthValidator.prototype = {
|
|
||||||
_maxLength: 0,
|
|
||||||
_minLength: 0,
|
|
||||||
|
|
||||||
validate: function Sys_Mvc_StringLengthValidator$validate(value, context) {
|
|
||||||
/// <param name="value" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="context" type="Sys.Mvc.ValidationContext">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Object"></returns>
|
|
||||||
if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return (this._minLength <= value.length && value.length <= this._maxLength);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc._validationUtil
|
|
||||||
|
|
||||||
Sys.Mvc._validationUtil = function Sys_Mvc__validationUtil() {
|
|
||||||
}
|
|
||||||
Sys.Mvc._validationUtil.arrayIsNullOrEmpty = function Sys_Mvc__validationUtil$arrayIsNullOrEmpty(array) {
|
|
||||||
/// <param name="array" type="Array" elementType="Object">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Boolean"></returns>
|
|
||||||
return (!array || !array.length);
|
|
||||||
}
|
|
||||||
Sys.Mvc._validationUtil.stringIsNullOrEmpty = function Sys_Mvc__validationUtil$stringIsNullOrEmpty(value) {
|
|
||||||
/// <param name="value" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Boolean"></returns>
|
|
||||||
return (!value || !value.length);
|
|
||||||
}
|
|
||||||
Sys.Mvc._validationUtil.elementSupportsEvent = function Sys_Mvc__validationUtil$elementSupportsEvent(element, eventAttributeName) {
|
|
||||||
/// <param name="element" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="eventAttributeName" type="String">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Boolean"></returns>
|
|
||||||
return (eventAttributeName in element);
|
|
||||||
}
|
|
||||||
Sys.Mvc._validationUtil.removeAllChildren = function Sys_Mvc__validationUtil$removeAllChildren(element) {
|
|
||||||
/// <param name="element" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
while (element.firstChild) {
|
|
||||||
element.removeChild(element.firstChild);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Sys.Mvc._validationUtil.setInnerText = function Sys_Mvc__validationUtil$setInnerText(element, innerText) {
|
|
||||||
/// <param name="element" type="Object" domElement="true">
|
|
||||||
/// </param>
|
|
||||||
/// <param name="innerText" type="String">
|
|
||||||
/// </param>
|
|
||||||
var textNode = document.createTextNode(innerText);
|
|
||||||
Sys.Mvc._validationUtil.removeAllChildren(element);
|
|
||||||
element.appendChild(textNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Sys.Mvc.ValidatorRegistry
|
|
||||||
|
|
||||||
Sys.Mvc.ValidatorRegistry = function Sys_Mvc_ValidatorRegistry() {
|
|
||||||
/// <field name="validators" type="Object" static="true">
|
|
||||||
/// </field>
|
|
||||||
}
|
|
||||||
Sys.Mvc.ValidatorRegistry.getValidator = function Sys_Mvc_ValidatorRegistry$getValidator(rule) {
|
|
||||||
/// <param name="rule" type="Sys.Mvc.JsonValidationRule">
|
|
||||||
/// </param>
|
|
||||||
/// <returns type="Sys.Mvc.Validator"></returns>
|
|
||||||
var creator = Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType];
|
|
||||||
return (creator) ? creator(rule) : null;
|
|
||||||
}
|
|
||||||
Sys.Mvc.ValidatorRegistry._getDefaultValidators = function Sys_Mvc_ValidatorRegistry$_getDefaultValidators() {
|
|
||||||
/// <returns type="Object"></returns>
|
|
||||||
return { required: Function.createDelegate(null, Sys.Mvc.RequiredValidator.create), length: Function.createDelegate(null, Sys.Mvc.StringLengthValidator.create), regex: Function.createDelegate(null, Sys.Mvc.RegularExpressionValidator.create), range: Function.createDelegate(null, Sys.Mvc.RangeValidator.create), number: Function.createDelegate(null, Sys.Mvc.NumberValidator.create) };
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator');
|
|
||||||
Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext');
|
|
||||||
Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext');
|
|
||||||
Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator');
|
|
||||||
Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator');
|
|
||||||
Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator');
|
|
||||||
Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator');
|
|
||||||
Sys.Mvc._validationUtil.registerClass('Sys.Mvc._validationUtil');
|
|
||||||
Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry');
|
|
||||||
Sys.Mvc.FormContext._validationSummaryErrorCss = 'validation-summary-errors';
|
|
||||||
Sys.Mvc.FormContext._validationSummaryValidCss = 'validation-summary-valid';
|
|
||||||
Sys.Mvc.FormContext._formValidationTag = '__MVC_FormValidation';
|
|
||||||
Sys.Mvc.FieldContext._hasTextChangedTag = '__MVC_HasTextChanged';
|
|
||||||
Sys.Mvc.FieldContext._hasValidationFiredTag = '__MVC_HasValidationFired';
|
|
||||||
Sys.Mvc.FieldContext._inputElementErrorCss = 'input-validation-error';
|
|
||||||
Sys.Mvc.FieldContext._inputElementValidCss = 'input-validation-valid';
|
|
||||||
Sys.Mvc.FieldContext._validationMessageErrorCss = 'field-validation-error';
|
|
||||||
Sys.Mvc.FieldContext._validationMessageValidCss = 'field-validation-valid';
|
|
||||||
Sys.Mvc.ValidatorRegistry.validators = Sys.Mvc.ValidatorRegistry._getDefaultValidators();
|
|
||||||
|
|
||||||
// ---- Do not remove this footer ----
|
|
||||||
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
|
|
||||||
// -----------------------------------
|
|
||||||
|
|
||||||
// register validation
|
|
||||||
Sys.Application.add_load(function() {
|
|
||||||
Sys.Application.remove_load(arguments.callee);
|
|
||||||
Sys.Mvc.FormContext._Application_Load();
|
|
||||||
});
|
|
@ -1,55 +0,0 @@
|
|||||||
//----------------------------------------------------------
|
|
||||||
// Copyright (C) Microsoft Corporation. All rights reserved.
|
|
||||||
//----------------------------------------------------------
|
|
||||||
// MicrosoftMvcValidation.js
|
|
||||||
|
|
||||||
Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_Validation=function(){return {};}
|
|
||||||
Sys.Mvc.$create_JsonValidationField=function(){return {};}
|
|
||||||
Sys.Mvc.$create_JsonValidationOptions=function(){return {};}
|
|
||||||
Sys.Mvc.$create_JsonValidationRule=function(){return {};}
|
|
||||||
Sys.Mvc.$create_ValidationContext=function(){return {};}
|
|
||||||
Sys.Mvc.NumberValidator=function(){}
|
|
||||||
Sys.Mvc.NumberValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.NumberValidator(),new Sys.Mvc.NumberValidator().validate);}
|
|
||||||
Sys.Mvc.NumberValidator.prototype={validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0));}}
|
|
||||||
Sys.Mvc.FormContext=function(formElement,validationSummaryElement){this.$5=[];this.fields=new Array(0);this.$9=formElement;this.$7=validationSummaryElement;formElement['__MVC_FormValidation'] = this;if(validationSummaryElement){var $0=validationSummaryElement.getElementsByTagName('ul');if($0.length>0){this.$8=$0[0];}}this.$3=Function.createDelegate(this,this.$D);this.$4=Function.createDelegate(this,this.$E);}
|
|
||||||
Sys.Mvc.FormContext._Application_Load=function(){var $0=window.mvcClientValidationMetadata;if($0){while($0.length>0){var $1=$0.pop();Sys.Mvc.FormContext.$12($1);}}}
|
|
||||||
Sys.Mvc.FormContext.$F=function($p0,$p1){var $0=[];var $1=document.getElementsByName($p1);for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];if(Sys.Mvc.FormContext.$10($p0,$3)){Array.add($0,$3);}}return $0;}
|
|
||||||
Sys.Mvc.FormContext.getValidationForForm=function(formElement){return formElement['__MVC_FormValidation'];}
|
|
||||||
Sys.Mvc.FormContext.$10=function($p0,$p1){while($p1){if($p0===$p1){return true;}$p1=$p1.parentNode;}return false;}
|
|
||||||
Sys.Mvc.FormContext.$12=function($p0){var $0=$get($p0.FormId);var $1=(!Sys.Mvc._ValidationUtil.$1($p0.ValidationSummaryId))?$get($p0.ValidationSummaryId):null;var $2=new Sys.Mvc.FormContext($0,$1);$2.enableDynamicValidation();$2.replaceValidationSummary=$p0.ReplaceValidationSummary;for(var $4=0;$4<$p0.Fields.length;$4++){var $5=$p0.Fields[$4];var $6=Sys.Mvc.FormContext.$F($0,$5.FieldName);var $7=(!Sys.Mvc._ValidationUtil.$1($5.ValidationMessageId))?$get($5.ValidationMessageId):null;var $8=new Sys.Mvc.FieldContext($2);Array.addRange($8.elements,$6);$8.validationMessageElement=$7;$8.replaceValidationMessageContents=$5.ReplaceValidationMessageContents;for(var $9=0;$9<$5.ValidationRules.length;$9++){var $A=$5.ValidationRules[$9];var $B=Sys.Mvc.ValidatorRegistry.getValidator($A);if($B){var $C=Sys.Mvc.$create_Validation();$C.fieldErrorMessage=$A.ErrorMessage;$C.validator=$B;Array.add($8.validations,$C);}}$8.enableDynamicValidation();Array.add($2.fields,$8);}var $3=$0.validationCallbacks;if(!$3){$3=[];$0.validationCallbacks = $3;}$3.push(Function.createDelegate(null,function(){
|
|
||||||
return Sys.Mvc._ValidationUtil.$0($2.validate('submit'));}));return $2;}
|
|
||||||
Sys.Mvc.FormContext.prototype={$3:null,$4:null,$6:null,$7:null,$8:null,$9:null,replaceValidationSummary:false,addError:function(message){this.addErrors([message]);},addErrors:function(messages){if(!Sys.Mvc._ValidationUtil.$0(messages)){Array.addRange(this.$5,messages);this.$11();}},clearErrors:function(){Array.clear(this.$5);this.$11();},$A:function(){if(this.$7){if(this.$8){Sys.Mvc._ValidationUtil.$3(this.$8);for(var $0=0;$0<this.$5.length;$0++){var $1=document.createElement('li');Sys.Mvc._ValidationUtil.$4($1,this.$5[$0]);this.$8.appendChild($1);}}Sys.UI.DomElement.removeCssClass(this.$7,'validation-summary-valid');Sys.UI.DomElement.addCssClass(this.$7,'validation-summary-errors');}},$B:function(){var $0=this.$7;if($0){var $1=this.$8;if($1){$1.innerHTML='';}Sys.UI.DomElement.removeCssClass($0,'validation-summary-errors');Sys.UI.DomElement.addCssClass($0,'validation-summary-valid');}},enableDynamicValidation:function(){Sys.UI.DomEvent.addHandler(this.$9,'click',this.$3);Sys.UI.DomEvent.addHandler(this.$9,'submit',this.$4);},$C:function($p0){if($p0.disabled){return null;}var $0=$p0.tagName.toUpperCase();var $1=$p0;if($0==='INPUT'){var $2=$1.type;if($2==='submit'||$2==='image'){return $1;}}else if(($0==='BUTTON')&&($1.type==='submit')){return $1;}return null;},$D:function($p0){this.$6=this.$C($p0.target);},$E:function($p0){var $0=$p0.target;var $1=this.$6;if($1&&$1.disableValidation){return;}var $2=this.validate('submit');if(!Sys.Mvc._ValidationUtil.$0($2)){$p0.preventDefault();}},$11:function(){if(!this.$5.length){this.$B();}else{this.$A();}},validate:function(eventName){var $0=this.fields;var $1=[];for(var $2=0;$2<$0.length;$2++){var $3=$0[$2];if(!$3.elements[0].disabled){var $4=$3.validate(eventName);if($4){Array.addRange($1,$4);}}}if(this.replaceValidationSummary){this.clearErrors();this.addErrors($1);}return $1;}}
|
|
||||||
Sys.Mvc.FieldContext=function(formContext){this.$A=[];this.elements=new Array(0);this.validations=new Array(0);this.formContext=formContext;this.$6=Function.createDelegate(this,this.$D);this.$7=Function.createDelegate(this,this.$E);this.$8=Function.createDelegate(this,this.$F);this.$9=Function.createDelegate(this,this.$10);}
|
|
||||||
Sys.Mvc.FieldContext.prototype={$6:null,$7:null,$8:null,$9:null,defaultErrorMessage:null,formContext:null,replaceValidationMessageContents:false,validationMessageElement:null,addError:function(message){this.addErrors([message]);},addErrors:function(messages){if(!Sys.Mvc._ValidationUtil.$0(messages)){Array.addRange(this.$A,messages);this.$14();}},clearErrors:function(){Array.clear(this.$A);this.$14();},$B:function(){var $0=this.validationMessageElement;if($0){if(this.replaceValidationMessageContents){Sys.Mvc._ValidationUtil.$4($0,this.$A[0]);}Sys.UI.DomElement.removeCssClass($0,'field-validation-valid');Sys.UI.DomElement.addCssClass($0,'field-validation-error');}var $1=this.elements;for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];Sys.UI.DomElement.removeCssClass($3,'input-validation-valid');Sys.UI.DomElement.addCssClass($3,'input-validation-error');}},$C:function(){var $0=this.validationMessageElement;if($0){if(this.replaceValidationMessageContents){Sys.Mvc._ValidationUtil.$4($0,'');}Sys.UI.DomElement.removeCssClass($0,'field-validation-error');Sys.UI.DomElement.addCssClass($0,'field-validation-valid');}var $1=this.elements;for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];Sys.UI.DomElement.removeCssClass($3,'input-validation-error');Sys.UI.DomElement.addCssClass($3,'input-validation-valid');}},$D:function($p0){if($p0.target['__MVC_HasTextChanged']||$p0.target['__MVC_HasValidationFired']){this.validate('blur');}},$E:function($p0){$p0.target['__MVC_HasTextChanged'] = true;},$F:function($p0){$p0.target['__MVC_HasTextChanged'] = true;if($p0.target['__MVC_HasValidationFired']){this.validate('input');}},$10:function($p0){if($p0.rawEvent.propertyName==='value'){$p0.target['__MVC_HasTextChanged'] = true;if($p0.target['__MVC_HasValidationFired']){this.validate('input');}}},enableDynamicValidation:function(){var $0=this.elements;for(var $1=0;$1<$0.length;$1++){var $2=$0[$1];if(Sys.Mvc._ValidationUtil.$2($2,'onpropertychange')){var $3=document.documentMode;if($3&&$3>=8){Sys.UI.DomEvent.addHandler($2,'propertychange',this.$9);}}else{Sys.UI.DomEvent.addHandler($2,'input',this.$8);}Sys.UI.DomEvent.addHandler($2,'change',this.$7);Sys.UI.DomEvent.addHandler($2,'blur',this.$6);}},$11:function($p0,$p1){var $0=$p1||this.defaultErrorMessage;if(Boolean.isInstanceOfType($p0)){return ($p0)?null:$0;}if(String.isInstanceOfType($p0)){return (($p0).length)?$p0:$0;}return null;},$12:function(){var $0=this.elements;return ($0.length>0)?$0[0].value:null;},$13:function(){var $0=this.elements;for(var $1=0;$1<$0.length;$1++){var $2=$0[$1];$2['__MVC_HasValidationFired'] = true;}},$14:function(){if(!this.$A.length){this.$C();}else{this.$B();}},validate:function(eventName){var $0=this.validations;var $1=[];var $2=this.$12();for(var $3=0;$3<$0.length;$3++){var $4=$0[$3];var $5=Sys.Mvc.$create_ValidationContext();$5.eventName=eventName;$5.fieldContext=this;$5.validation=$4;var $6=$4.validator($2,$5);var $7=this.$11($6,$4.fieldErrorMessage);if(!Sys.Mvc._ValidationUtil.$1($7)){Array.add($1,$7);}}this.$13();this.clearErrors();this.addErrors($1);return $1;}}
|
|
||||||
Sys.Mvc.RangeValidator=function(minimum,maximum){this.$0=minimum;this.$1=maximum;}
|
|
||||||
Sys.Mvc.RangeValidator.create=function(rule){var $0=rule.ValidationParameters['min'];var $1=rule.ValidationParameters['max'];return Function.createDelegate(new Sys.Mvc.RangeValidator($0,$1),new Sys.Mvc.RangeValidator($0,$1).validate);}
|
|
||||||
Sys.Mvc.RangeValidator.prototype={$0:null,$1:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0)&&this.$0<=$0&&$0<=this.$1);}}
|
|
||||||
Sys.Mvc.RegularExpressionValidator=function(pattern){this.$0=pattern;}
|
|
||||||
Sys.Mvc.RegularExpressionValidator.create=function(rule){var $0=rule.ValidationParameters['pattern'];return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator($0),new Sys.Mvc.RegularExpressionValidator($0).validate);}
|
|
||||||
Sys.Mvc.RegularExpressionValidator.prototype={$0:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=new RegExp(this.$0);var $1=$0.exec(value);return (!Sys.Mvc._ValidationUtil.$0($1)&&$1[0].length===value.length);}}
|
|
||||||
Sys.Mvc.RequiredValidator=function(){}
|
|
||||||
Sys.Mvc.RequiredValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.RequiredValidator(),new Sys.Mvc.RequiredValidator().validate);}
|
|
||||||
Sys.Mvc.RequiredValidator.$0=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();if($0==='RADIO'){return true;}}return false;}
|
|
||||||
Sys.Mvc.RequiredValidator.$1=function($p0){if($p0.tagName.toUpperCase()==='SELECT'){return true;}return false;}
|
|
||||||
Sys.Mvc.RequiredValidator.$2=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();switch($0){case 'TEXT':case 'PASSWORD':case 'FILE':return true;}}if($p0.tagName.toUpperCase()==='TEXTAREA'){return true;}return false;}
|
|
||||||
Sys.Mvc.RequiredValidator.$3=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.checked){return true;}}return false;}
|
|
||||||
Sys.Mvc.RequiredValidator.$4=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.selected){if(!Sys.Mvc._ValidationUtil.$1($1.value)){return true;}}}return false;}
|
|
||||||
Sys.Mvc.RequiredValidator.$5=function($p0){return (!Sys.Mvc._ValidationUtil.$1($p0.value));}
|
|
||||||
Sys.Mvc.RequiredValidator.prototype={validate:function(value,context){var $0=context.fieldContext.elements;if(!$0.length){return true;}var $1=$0[0];if(Sys.Mvc.RequiredValidator.$2($1)){return Sys.Mvc.RequiredValidator.$5($1);}if(Sys.Mvc.RequiredValidator.$0($1)){return Sys.Mvc.RequiredValidator.$3($0);}if(Sys.Mvc.RequiredValidator.$1($1)){return Sys.Mvc.RequiredValidator.$4(($1).options);}return true;}}
|
|
||||||
Sys.Mvc.StringLengthValidator=function(minLength,maxLength){this.$1=minLength;this.$0=maxLength;}
|
|
||||||
Sys.Mvc.StringLengthValidator.create=function(rule){var $0=(rule.ValidationParameters['min']||0);var $1=(rule.ValidationParameters['max']||Number.MAX_VALUE);return Function.createDelegate(new Sys.Mvc.StringLengthValidator($0,$1),new Sys.Mvc.StringLengthValidator($0,$1).validate);}
|
|
||||||
Sys.Mvc.StringLengthValidator.prototype={$0:0,$1:0,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}return (this.$1<=value.length&&value.length<=this.$0);}}
|
|
||||||
Sys.Mvc._ValidationUtil=function(){}
|
|
||||||
Sys.Mvc._ValidationUtil.$0=function($p0){return (!$p0||!$p0.length);}
|
|
||||||
Sys.Mvc._ValidationUtil.$1=function($p0){return (!$p0||!$p0.length);}
|
|
||||||
Sys.Mvc._ValidationUtil.$2=function($p0,$p1){return ($p1 in $p0);}
|
|
||||||
Sys.Mvc._ValidationUtil.$3=function($p0){while($p0.firstChild){$p0.removeChild($p0.firstChild);}}
|
|
||||||
Sys.Mvc._ValidationUtil.$4=function($p0,$p1){var $0=document.createTextNode($p1);Sys.Mvc._ValidationUtil.$3($p0);$p0.appendChild($0);}
|
|
||||||
Sys.Mvc.ValidatorRegistry=function(){}
|
|
||||||
Sys.Mvc.ValidatorRegistry.getValidator=function(rule){var $0=Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType];return ($0)?$0(rule):null;}
|
|
||||||
Sys.Mvc.ValidatorRegistry.$0=function(){return {required:Function.createDelegate(null,Sys.Mvc.RequiredValidator.create),length:Function.createDelegate(null,Sys.Mvc.StringLengthValidator.create),regex:Function.createDelegate(null,Sys.Mvc.RegularExpressionValidator.create),range:Function.createDelegate(null,Sys.Mvc.RangeValidator.create),number:Function.createDelegate(null,Sys.Mvc.NumberValidator.create)};}
|
|
||||||
Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator');Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext');Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext');Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator');Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator');Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator');Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator');Sys.Mvc._ValidationUtil.registerClass('Sys.Mvc._ValidationUtil');Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry');Sys.Mvc.ValidatorRegistry.validators=Sys.Mvc.ValidatorRegistry.$0();
|
|
||||||
// ---- Do not remove this footer ----
|
|
||||||
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
|
|
||||||
// -----------------------------------
|
|
||||||
Sys.Application.add_load(function(){Sys.Application.remove_load(arguments.callee);Sys.Mvc.FormContext._Application_Load();});
|
|
@ -0,0 +1,70 @@
|
|||||||
|
@{
|
||||||
|
Layout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@using Cassette.Scripts
|
||||||
|
@using Cassette.Stylesheets
|
||||||
|
@using NzbDrone.Web
|
||||||
|
@using NzbDrone.Web.Backbone.NzbDrone
|
||||||
|
@using NzbDrone.Web.Helpers
|
||||||
|
@{
|
||||||
|
Bundles.Reference<StylesheetBundle>(CassetteBundleConfiguration.BASE_STYLE);
|
||||||
|
Bundles.Reference<ScriptBundle>(CassetteBundleConfiguration.NZBDRONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title>@ViewBag.Title - NzbDrone</title>
|
||||||
|
<link rel="SHORTCUT ICON" href="../../favicon.ico" />
|
||||||
|
<link rel="apple-touch-icon" sizes="57x57" href="../../Content/Images/apple-touch-icon-114.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="114x114" href="../../Content/Images/apple-touch-icon-114.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="72x72" href="../../Content/Images/apple-touch-icon-144.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="../../Content/Images/apple-touch-icon-144.png" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
|
||||||
|
@Bundles.RenderStylesheets()
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div id="menu" class="row">
|
||||||
|
<div class="span20">
|
||||||
|
<ul>
|
||||||
|
@MvcHtmlString.Create(Html.CurrentControllerLink("Series", "Index", "Series"))
|
||||||
|
@MvcHtmlString.Create(Html.CurrentControllerLink("Upcoming", "Index", "Upcoming"))
|
||||||
|
@MvcHtmlString.Create(Html.CurrentControllerLink("History", "Index", "History"))
|
||||||
|
@MvcHtmlString.Create(Html.CurrentControllerLink("Missing", "Index", "Missing"))
|
||||||
|
@MvcHtmlString.Create(Html.CurrentControllerLink("Settings", "Index", "Settings"))
|
||||||
|
@MvcHtmlString.Create(Html.CurrentControllerLink("System", "Index", "System"))
|
||||||
|
<li id="donate" title="Donate to support the development of NzbDrone">
|
||||||
|
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KRTE52U3XJDSQ" target="_blank">Donate</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<input id="localSeriesLookup" type="text" class="pull-right" placeholder="Search..." />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="logo" class="row">
|
||||||
|
<div class="span18 offset2">
|
||||||
|
Single page
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="content" class="row">
|
||||||
|
<div class="span20">
|
||||||
|
<div id="sub-menu-region" class="row">
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div id="main-region" class="span20 nz-center">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="footer" class="row nz-center">
|
||||||
|
<div id="footer-region" class="span20"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@Bundles.RenderScripts()
|
||||||
|
<script type="text/javascript">
|
||||||
|
NzbDrone.start();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,47 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Cassette;
|
||||||
|
using Cassette.Scripts;
|
||||||
|
using Cassette.Stylesheets;
|
||||||
|
|
||||||
|
namespace NzbDrone.Web.Backbone.NzbDrone
|
||||||
|
{
|
||||||
|
public class CassetteBundleConfiguration : IConfiguration<BundleCollection>
|
||||||
|
{
|
||||||
|
public const string BASE_STYLE = "BASE_STYLE";
|
||||||
|
public const string BACKBONE = "BACKBONE";
|
||||||
|
public const string NZBDRONE = "NZBDRONE";
|
||||||
|
internal const string FONTS = "FONTS";
|
||||||
|
|
||||||
|
private const string APP_PATH = "_backboneApp";
|
||||||
|
|
||||||
|
public void Configure(BundleCollection bundles)
|
||||||
|
{
|
||||||
|
bundles.AddUrlWithAlias<StylesheetBundle>("//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,600,300'", FONTS);
|
||||||
|
|
||||||
|
//bundles.AddPerSubDirectory<StylesheetBundle>("Backbone.NzbDrone");
|
||||||
|
|
||||||
|
bundles.Add<StylesheetBundle>(BASE_STYLE, new[]{
|
||||||
|
APP_PATH + "\\Content\\Bootstrap\\bootstrap.less",
|
||||||
|
APP_PATH + "\\Content\\base.css",
|
||||||
|
APP_PATH + "\\Content\\menu.css",
|
||||||
|
APP_PATH + "\\AddSeries\\addSeries.css"
|
||||||
|
},
|
||||||
|
bundle => bundle.AddReference("/" + FONTS));
|
||||||
|
|
||||||
|
bundles.Add<ScriptBundle>(BACKBONE, new[]{
|
||||||
|
APP_PATH + "\\JsLibraries\\jquery-1.8.2.js",
|
||||||
|
APP_PATH + "\\JsLibraries\\bootstrap.js",
|
||||||
|
APP_PATH + "\\JsLibraries\\underscore.js",
|
||||||
|
APP_PATH + "\\JsLibraries\\backbone.js",
|
||||||
|
APP_PATH + "\\JsLibraries\\backbone.marionette.js",
|
||||||
|
APP_PATH + "\\JsLibraries\\backbone.marionette.extend.js",
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
bundles.Add<ScriptBundle>(NZBDRONE, new[]{
|
||||||
|
APP_PATH + "\\app.js",
|
||||||
|
APP_PATH + "\\AddSeries\\addSeriesView.js"},
|
||||||
|
bundle => bundle.AddReference("/" + BACKBONE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 172 B After Width: | Height: | Size: 172 B |
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 136 B |
Before Width: | Height: | Size: 603 B After Width: | Height: | Size: 603 B |
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 816 B After Width: | Height: | Size: 816 B |
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 385 B |
Before Width: | Height: | Size: 665 B After Width: | Height: | Size: 665 B |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 491 B |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |