CodeMaid clean-up

This commit is contained in:
2016-12-21 07:27:25 +01:00
parent 577e8b4127
commit bc5c2bca6d
34 changed files with 152 additions and 175 deletions

View File

@@ -12,7 +12,7 @@ namespace VAR.Focus.Web.Code
private string _path = null; private string _path = null;
private List<string> _files = null; private List<string> _files = null;
#endregion #endregion Declarations
#region Properties #region Properties
@@ -29,7 +29,7 @@ namespace VAR.Focus.Web.Code
} }
} }
#endregion #endregion Properties
#region Creator #region Creator
@@ -38,7 +38,7 @@ namespace VAR.Focus.Web.Code
_path = path; _path = path;
} }
#endregion #endregion Creator
#region Public methods #region Public methods
@@ -58,6 +58,6 @@ namespace VAR.Focus.Web.Code
} }
} }
#endregion #endregion Public methods
} }
} }

View File

@@ -27,7 +27,6 @@ namespace VAR.Focus.Web.Code
context.Response.Write(strObject); context.Response.Write(strObject);
} }
#endregion #endregion HttpContext
} }
} }

View File

@@ -40,7 +40,7 @@ namespace VAR.Focus.Web.Code
context.Response.Write(sbOutput.ToString()); context.Response.Write(sbOutput.ToString());
} }
#endregion #endregion Private methods
#region Public methods #region Public methods
@@ -59,6 +59,6 @@ namespace VAR.Focus.Web.Code
} }
} }
#endregion #endregion Public methods
} }
} }

View File

@@ -15,6 +15,6 @@ namespace VAR.Focus.Web.Code
bundler.WriteResponse(context.Response.OutputStream); bundler.WriteResponse(context.Response.OutputStream);
} }
#endregion #endregion IHttpHandler
} }
} }

View File

@@ -15,6 +15,6 @@ namespace VAR.Focus.Web.Code
bundler.WriteResponse(context.Response.OutputStream); bundler.WriteResponse(context.Response.OutputStream);
} }
#endregion #endregion IHttpHandler
} }
} }

View File

@@ -1,6 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Web; using System.Web;
using VAR.Focus.BusinessLogic; using VAR.Focus.BusinessLogic;
using VAR.Focus.BusinessLogic.Entities; using VAR.Focus.BusinessLogic.Entities;
@@ -16,7 +14,7 @@ namespace VAR.Focus.Web.Code
private string _cookieName = "FocusSID"; private string _cookieName = "FocusSID";
private int _cookieExpirationDays = 30; private int _cookieExpirationDays = 30;
#endregion #endregion Declarations
#region Properties #region Properties
@@ -45,7 +43,7 @@ namespace VAR.Focus.Web.Code
set { _cookieExpirationDays = value; } set { _cookieExpirationDays = value; }
} }
#endregion #endregion Properties
#region Public methods #region Public methods
@@ -86,7 +84,6 @@ namespace VAR.Focus.Web.Code
return true; return true;
} }
#endregion #endregion Public methods
} }
} }

View File

@@ -9,7 +9,7 @@ namespace VAR.Focus.Web.Controls
private string _tagName = "span"; private string _tagName = "span";
#endregion #endregion Declarations
#region Properties #region Properties
@@ -19,7 +19,7 @@ namespace VAR.Focus.Web.Controls
set { _tagName = value; } set { _tagName = value; }
} }
#endregion #endregion Properties
#region Life cycle #region Life cycle
@@ -36,6 +36,6 @@ namespace VAR.Focus.Web.Controls
} }
} }
#endregion #endregion Life cycle
} }
} }

View File

@@ -19,7 +19,7 @@ namespace VAR.Focus.Web.Controls
private Control _nextFocusOnEnter = null; private Control _nextFocusOnEnter = null;
#endregion #endregion Declarations
#region Properties #region Properties
@@ -53,7 +53,7 @@ namespace VAR.Focus.Web.Controls
set { _nextFocusOnEnter = value; } set { _nextFocusOnEnter = value; }
} }
#endregion #endregion Properties
#region Control life cycle #region Control life cycle
@@ -62,7 +62,7 @@ namespace VAR.Focus.Web.Controls
PreRender += CTextbox_PreRender; PreRender += CTextbox_PreRender;
} }
void CTextbox_PreRender(object sender, EventArgs e) private void CTextbox_PreRender(object sender, EventArgs e)
{ {
CssClass = CssClassBase; CssClass = CssClassBase;
if (string.IsNullOrEmpty(_cssClassExtra) == false) if (string.IsNullOrEmpty(_cssClassExtra) == false)
@@ -80,14 +80,13 @@ namespace VAR.Focus.Web.Controls
Attributes.Add("placeholder", _placeHolder); Attributes.Add("placeholder", _placeHolder);
} }
if (_nextFocusOnEnter!=null) if (_nextFocusOnEnter != null)
{ {
this.Attributes.Add("onkeydown", String.Format( this.Attributes.Add("onkeydown", String.Format(
"if(event.keyCode==13){{document.getElementById('{0}').focus(); return false;}}", "if(event.keyCode==13){{document.getElementById('{0}').focus(); return false;}}",
_nextFocusOnEnter.ClientID)); _nextFocusOnEnter.ClientID));
} }
// FIX: The framework deletes textbox values on password mode // FIX: The framework deletes textbox values on password mode
if (TextMode == TextBoxMode.Password) if (TextMode == TextBoxMode.Password)
{ {
@@ -95,7 +94,7 @@ namespace VAR.Focus.Web.Controls
} }
} }
#endregion #endregion Control life cycle
#region Public methods #region Public methods
@@ -109,7 +108,6 @@ namespace VAR.Focus.Web.Controls
return _allowEmpty || (string.IsNullOrEmpty(Text) == false); return _allowEmpty || (string.IsNullOrEmpty(Text) == false);
} }
#endregion #endregion Public methods
} }
} }

View File

@@ -25,7 +25,7 @@ namespace VAR.Focus.Web.Controls
private int _timeMoveAnimation = 500; private int _timeMoveAnimation = 500;
#endregion #endregion Declarations
#region Properties #region Properties
@@ -71,8 +71,8 @@ namespace VAR.Focus.Web.Controls
set { _timeMoveAnimation = value; } set { _timeMoveAnimation = value; }
} }
#endregion #endregion Properties
#region Control Life cycle #region Control Life cycle
public CardBoardControl() public CardBoardControl()
@@ -80,12 +80,12 @@ namespace VAR.Focus.Web.Controls
Init += ChatControl_Init; Init += ChatControl_Init;
} }
void ChatControl_Init(object sender, EventArgs e) private void ChatControl_Init(object sender, EventArgs e)
{ {
InitializeControls(); InitializeControls();
} }
#endregion #endregion Control Life cycle
#region Private methods #region Private methods
@@ -124,6 +124,6 @@ namespace VAR.Focus.Web.Controls
Controls.Add(liScript); Controls.Add(liScript);
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -15,7 +15,7 @@ namespace VAR.Focus.Web.Controls
private static object _monitor = new object(); private static object _monitor = new object();
private static Dictionary<int, CardBoard> _cardBoards = new Dictionary<int, CardBoard>(); private static Dictionary<int, CardBoard> _cardBoards = new Dictionary<int, CardBoard>();
#endregion #endregion Declarations
#region IHttpHandler #region IHttpHandler
@@ -50,7 +50,7 @@ namespace VAR.Focus.Web.Controls
} }
} }
#endregion #endregion IHttpHandler
#region Private methods #region Private methods
@@ -195,6 +195,6 @@ namespace VAR.Focus.Web.Controls
lock (_monitor) { Monitor.PulseAll(_monitor); } lock (_monitor) { Monitor.PulseAll(_monitor); }
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -26,7 +26,7 @@ namespace VAR.Focus.Web.Controls
private Panel _divChatContainer = null; private Panel _divChatContainer = null;
private Panel _divChatTitleBar = null; private Panel _divChatTitleBar = null;
#endregion #endregion Declarations
#region Properties #region Properties
@@ -80,7 +80,7 @@ namespace VAR.Focus.Web.Controls
} }
} }
#endregion #endregion Properties
#region Control Life cycle #region Control Life cycle
@@ -89,12 +89,12 @@ namespace VAR.Focus.Web.Controls
Init += ChatControl_Init; Init += ChatControl_Init;
} }
void ChatControl_Init(object sender, EventArgs e) private void ChatControl_Init(object sender, EventArgs e)
{ {
InitializeControls(); InitializeControls();
} }
#endregion #endregion Control Life cycle
#region Private methods #region Private methods
@@ -131,7 +131,7 @@ namespace VAR.Focus.Web.Controls
var btnSend = new Button { ID = "btnSend", Text = "Send", CssClass = "chatButton" }; var btnSend = new Button { ID = "btnSend", Text = "Send", CssClass = "chatButton" };
divChatControls.Controls.Add(btnSend); divChatControls.Controls.Add(btnSend);
btnSend.Attributes.Add("onclick", string.Format("SendChat({0}); return false;", strCfgName)); btnSend.Attributes.Add("onclick", string.Format("SendChat({0}); return false;", strCfgName));
Dictionary<string, object> cfg = new Dictionary<string, object> Dictionary<string, object> cfg = new Dictionary<string, object>
{ {
{"divChatWindow", _divChatWindow.ClientID}, {"divChatWindow", _divChatWindow.ClientID},
@@ -165,6 +165,6 @@ namespace VAR.Focus.Web.Controls
Controls.Add(liScript); Controls.Add(liScript);
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -15,7 +15,7 @@ namespace VAR.Focus.Web.Controls
private static object _monitor = new object(); private static object _monitor = new object();
private static Dictionary<string, MessageBoard> _chatBoards = new Dictionary<string, MessageBoard>(); private static Dictionary<string, MessageBoard> _chatBoards = new Dictionary<string, MessageBoard>();
#endregion #endregion Declarations
#region IHttpHandler #region IHttpHandler
@@ -43,7 +43,7 @@ namespace VAR.Focus.Web.Controls
} }
} }
#endregion #endregion IHttpHandler
#region Private methods #region Private methods
@@ -120,6 +120,6 @@ namespace VAR.Focus.Web.Controls
context.ResponseObject(new OperationStatus { IsOK = true, Message = "Message sent" }); context.ResponseObject(new OperationStatus { IsOK = true, Message = "Message sent" });
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -1,8 +1,7 @@
namespace VAR.Focus.Web.Controls
namespace VAR.Focus.Web.Controls
{ {
public interface IValidableControl public interface IValidableControl
{ {
bool IsValid(); bool IsValid();
} }
} }

View File

@@ -78,7 +78,7 @@ namespace VAR.Focus.Web
return null; return null;
} }
#endregion #endregion Handlers
#region IHttpHandler #region IHttpHandler
@@ -95,7 +95,7 @@ namespace VAR.Focus.Web
} }
catch (Exception ex) catch (Exception ex)
{ {
if(ex is ThreadAbortException) if (ex is ThreadAbortException)
{ {
return; return;
} }
@@ -103,7 +103,7 @@ namespace VAR.Focus.Web
} }
} }
#endregion #endregion IHttpHandler
#region Private methods #region Private methods
@@ -117,7 +117,7 @@ namespace VAR.Focus.Web
// Pass allowed extensions requests // Pass allowed extensions requests
string extension = Path.GetExtension(context.Request.FilePath).ToLower(); string extension = Path.GetExtension(context.Request.FilePath).ToLower();
if(Globals.AllowedExtensions.Contains(extension)) if (Globals.AllowedExtensions.Contains(extension))
{ {
string filePath = context.Server.MapPath(string.Format("~/{0}", context.Request.FilePath)); string filePath = context.Server.MapPath(string.Format("~/{0}", context.Request.FilePath));
if (File.Exists(filePath)) if (File.Exists(filePath))
@@ -130,7 +130,7 @@ namespace VAR.Focus.Web
return; return;
} }
} }
IHttpHandler handler = GetHandler(file); IHttpHandler handler = GetHandler(file);
if (handler == null) if (handler == null)
{ {
@@ -144,6 +144,6 @@ namespace VAR.Focus.Web
handler.ProcessRequest(context); handler.ProcessRequest(context);
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace VAR.Focus.Web namespace VAR.Focus.Web
{ {
@@ -8,8 +7,8 @@ namespace VAR.Focus.Web
public const string Title = "Focus"; public const string Title = "Focus";
public const string TitleSeparator = " :: "; public const string TitleSeparator = " :: ";
public const string Author = "Valeriano Alfonso Rodriguez"; public const string Author = "Valeriano Alfonso Rodriguez";
public const string Copyright = "Copyright (c) 2015 by Valeriano Alfonso, All Right Reserved"; public const string Copyright = "Copyright (c) 2015-2017 by Valeriano Alfonso, All Right Reserved";
public const string DefaultHandler = "FrmBoard"; public const string DefaultHandler = "FrmBoard";
public static List<string> AllowedExtensions = new List<string>{ ".png", ".jpg", ".jpeg", ".gif", ".ico", ".wav", ".mp3", ".ogg", ".mp4", ".webm", ".webp" }; public static List<string> AllowedExtensions = new List<string> { ".png", ".jpg", ".jpeg", ".gif", ".ico", ".wav", ".mp3", ".ogg", ".mp4", ".webm", ".webp", ".mkv", ".avi" };
} }
} }

View File

@@ -62,7 +62,8 @@ namespace VAR.Focus.Web.Pages
return true; return true;
} }
public static bool Controls_AreValid(ControlCollection controls) { public static bool Controls_AreValid(ControlCollection controls)
{
bool valid = true; bool valid = true;
foreach (Control control in controls) foreach (Control control in controls)
{ {

View File

@@ -14,10 +14,10 @@ namespace VAR.Focus.Web.Pages
private int _idBoard = 0; private int _idBoard = 0;
private CTextBox _txtTitle = new CTextBox { ID = "txtTitle", CssClassExtra="width100pc", AllowEmpty = false }; private CTextBox _txtTitle = new CTextBox { ID = "txtTitle", CssClassExtra = "width100pc", AllowEmpty = false };
private CTextBox _txtDescription = new CTextBox { ID = "txtDescription", CssClassExtra = "width100pc", TextMode = TextBoxMode.MultiLine }; private CTextBox _txtDescription = new CTextBox { ID = "txtDescription", CssClassExtra = "width100pc", TextMode = TextBoxMode.MultiLine };
#endregion #endregion Declarations
#region Life cycle #region Life cycle
@@ -26,7 +26,7 @@ namespace VAR.Focus.Web.Pages
Init += FrmBoard_Init; Init += FrmBoard_Init;
} }
void FrmBoard_Init(object sender, EventArgs e) private void FrmBoard_Init(object sender, EventArgs e)
{ {
string strIDBoard = Context.GetRequestParm("idBoard"); string strIDBoard = Context.GetRequestParm("idBoard");
if (String.IsNullOrEmpty(strIDBoard) == false) if (String.IsNullOrEmpty(strIDBoard) == false)
@@ -43,19 +43,19 @@ namespace VAR.Focus.Web.Pages
} }
} }
#endregion #endregion Life cycle
#region UI Events #region UI Events
void btnAddBoard_Click(object sender, EventArgs e) private void btnAddBoard_Click(object sender, EventArgs e)
{ {
if (FormUtils.Controls_AreValid(Controls) == false) { return; } if (FormUtils.Controls_AreValid(Controls) == false) { return; }
Board board = Boards.Current.Boards_SetBoard(0, _txtTitle.Text, _txtDescription.Text, CurrentUser.Name); Board board = Boards.Current.Boards_SetBoard(0, _txtTitle.Text, _txtDescription.Text, CurrentUser.Name);
_idBoard = board.IDBoard; _idBoard = board.IDBoard;
Response.Redirect(string.Format("{0}?idBoard={1}", Response.Redirect(string.Format("{0}?idBoard={1}",
typeof(FrmBoard).Name, typeof(FrmBoard).Name,
_idBoard)); _idBoard));
} }
@@ -72,8 +72,8 @@ namespace VAR.Focus.Web.Pages
{ {
CButton btnEdit = (CButton)sender; CButton btnEdit = (CButton)sender;
int idBoard = Convert.ToInt32(btnEdit.CommandArgument); int idBoard = Convert.ToInt32(btnEdit.CommandArgument);
Response.Redirect(string.Format("{0}?idBoard={1}&returnUrl={2}", Response.Redirect(string.Format("{0}?idBoard={1}&returnUrl={2}",
typeof(FrmBoardEdit).Name, typeof(FrmBoardEdit).Name,
idBoard, idBoard,
typeof(FrmBoard).Name)); typeof(FrmBoard).Name));
} }
@@ -90,7 +90,7 @@ namespace VAR.Focus.Web.Pages
} }
} }
#endregion #endregion UI Events
#region Private methods #region Private methods
@@ -169,7 +169,6 @@ namespace VAR.Focus.Web.Pages
_txtDescription.PlaceHolder = "Description"; _txtDescription.PlaceHolder = "Description";
pnlBoardAdd.Controls.Add(FormUtils.CreatePanel("formRow", btnAddBoard)); pnlBoardAdd.Controls.Add(FormUtils.CreatePanel("formRow", btnAddBoard));
Controls.Add(pnlBoardAdd); Controls.Add(pnlBoardAdd);
} }
private void FrmBoard_InitBoard() private void FrmBoard_InitBoard()
@@ -194,7 +193,7 @@ namespace VAR.Focus.Web.Pages
}; };
Controls.Add(chatControl); Controls.Add(chatControl);
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -18,7 +18,7 @@ namespace VAR.Focus.Web.Pages
private CButton _btnSave = new CButton { ID = "btnSave" }; private CButton _btnSave = new CButton { ID = "btnSave" };
private CButton _btnExit = new CButton { ID = "btnExit" }; private CButton _btnExit = new CButton { ID = "btnExit" };
#endregion #endregion Declarations
#region Page life cycle #region Page life cycle
@@ -36,7 +36,7 @@ namespace VAR.Focus.Web.Pages
} }
} }
void FrmBoardEdit_Init(object sender, EventArgs e) private void FrmBoardEdit_Init(object sender, EventArgs e)
{ {
string strIDBoard = Context.GetRequestParm("idBoard"); string strIDBoard = Context.GetRequestParm("idBoard");
if (String.IsNullOrEmpty(strIDBoard) == false) if (String.IsNullOrEmpty(strIDBoard) == false)
@@ -50,7 +50,7 @@ namespace VAR.Focus.Web.Pages
InitializeComponents(); InitializeComponents();
} }
#endregion #endregion Page life cycle
#region UI Events #region UI Events
@@ -76,7 +76,7 @@ namespace VAR.Focus.Web.Pages
} }
} }
#endregion #endregion UI Events
#region Private methods #region Private methods
@@ -85,7 +85,7 @@ namespace VAR.Focus.Web.Pages
Title = "Register"; Title = "Register";
var lblTitle = new CLabel { Text = "Register", Tag = "h2" }; var lblTitle = new CLabel { Text = "Register", Tag = "h2" };
Controls.Add(lblTitle); Controls.Add(lblTitle);
Controls.Add(FormUtils.CreateField("Title", _txtTitle)); Controls.Add(FormUtils.CreateField("Title", _txtTitle));
_txtTitle.NextFocusOnEnter = _txtTitle; _txtTitle.NextFocusOnEnter = _txtTitle;
_txtTitle.PlaceHolder = "Title"; _txtTitle.PlaceHolder = "Title";
@@ -113,7 +113,6 @@ namespace VAR.Focus.Web.Pages
_txtDescription.Text = board.Description; _txtDescription.Text = board.Description;
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -20,6 +20,6 @@ namespace VAR.Focus.Web.Pages
context.Response.Write("</code></pre>"); context.Response.Write("</code></pre>");
} }
#endregion #endregion IHttpHandler
} }
} }

View File

@@ -10,9 +10,9 @@ namespace VAR.Focus.Web.Pages
{ {
#region Declarations #region Declarations
Exception _ex = null; private Exception _ex = null;
#endregion #endregion Declarations
#region Page life cycle #region Page life cycle
@@ -22,12 +22,12 @@ namespace VAR.Focus.Web.Pages
Init += FrmError_Init; Init += FrmError_Init;
} }
void FrmError_Init(object sender, EventArgs e) private void FrmError_Init(object sender, EventArgs e)
{ {
InitializeControls(); InitializeControls();
} }
#endregion #endregion Page life cycle
#region Private methods #region Private methods
@@ -60,6 +60,6 @@ namespace VAR.Focus.Web.Pages
} }
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -12,9 +12,9 @@ namespace VAR.Focus.Web.Pages
private CTextBox _txtNameEmail = new CTextBox { ID = "txtNameEmail", CssClassExtra = "width150px", AllowEmpty = false }; private CTextBox _txtNameEmail = new CTextBox { ID = "txtNameEmail", CssClassExtra = "width150px", AllowEmpty = false };
private CTextBox _txtPassword = new CTextBox { ID = "txtPassword", CssClassExtra = "width150px", AllowEmpty = false, TextMode = TextBoxMode.Password }; private CTextBox _txtPassword = new CTextBox { ID = "txtPassword", CssClassExtra = "width150px", AllowEmpty = false, TextMode = TextBoxMode.Password };
private CButton _btnLogin = new CButton { ID = "btnLogin"}; private CButton _btnLogin = new CButton { ID = "btnLogin" };
#endregion #endregion Declarations
#region Page life cycle #region Page life cycle
@@ -29,7 +29,7 @@ namespace VAR.Focus.Web.Pages
InitializeControls(); InitializeControls();
} }
#endregion #endregion Page life cycle
#region UI Events #region UI Events
@@ -47,7 +47,7 @@ namespace VAR.Focus.Web.Pages
Response.Redirect(Globals.DefaultHandler); Response.Redirect(Globals.DefaultHandler);
} }
#endregion #endregion UI Events
#region Private methods #region Private methods
@@ -72,6 +72,6 @@ namespace VAR.Focus.Web.Pages
Controls.Add(FormUtils.CreateField(String.Empty, new HyperLink { Text = "Register user", NavigateUrl = "FrmRegister" })); Controls.Add(FormUtils.CreateField(String.Empty, new HyperLink { Text = "Register user", NavigateUrl = "FrmRegister" }));
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -21,7 +21,7 @@ namespace VAR.Focus.Web.Pages
private CLabel _lblSuccess = new CLabel { ID = "lblSuccess" }; private CLabel _lblSuccess = new CLabel { ID = "lblSuccess" };
private CButton _btnExitSuccess = new CButton { ID = "btnExitSuccess" }; private CButton _btnExitSuccess = new CButton { ID = "btnExitSuccess" };
#endregion #endregion Declarations
#region Page life cycle #region Page life cycle
@@ -31,16 +31,16 @@ namespace VAR.Focus.Web.Pages
Init += FrmRegister_Init; Init += FrmRegister_Init;
} }
void FrmRegister_Init(object sender, EventArgs e) private void FrmRegister_Init(object sender, EventArgs e)
{ {
InitializeComponents(); InitializeComponents();
} }
#endregion #endregion Page life cycle
#region UI Events #region UI Events
void btnRegister_Click(object sender, EventArgs e) private void btnRegister_Click(object sender, EventArgs e)
{ {
if (FormUtils.Controls_AreValid(Controls) == false) { return; } if (FormUtils.Controls_AreValid(Controls) == false) { return; }
@@ -63,12 +63,12 @@ namespace VAR.Focus.Web.Pages
_lblSuccess.Text = String.Format("User {0} created sucessfully", user.Name); _lblSuccess.Text = String.Format("User {0} created sucessfully", user.Name);
} }
void btnExit_Click(object sender, EventArgs e) private void btnExit_Click(object sender, EventArgs e)
{ {
Response.Redirect(Globals.DefaultHandler); Response.Redirect(Globals.DefaultHandler);
} }
#endregion #endregion UI Events
#region Private methods #region Private methods
@@ -102,11 +102,11 @@ namespace VAR.Focus.Web.Pages
_btnExit.Text = "Exit"; _btnExit.Text = "Exit";
_btnExit.Click += btnExit_Click; _btnExit.Click += btnExit_Click;
Panel pnlButtons=new Panel(); Panel pnlButtons = new Panel();
pnlButtons.Controls.Add(_btnRegister); pnlButtons.Controls.Add(_btnRegister);
pnlButtons.Controls.Add(_btnExit); pnlButtons.Controls.Add(_btnExit);
_pnlRegister.Controls.Add(FormUtils.CreateField(String.Empty, pnlButtons)); _pnlRegister.Controls.Add(FormUtils.CreateField(String.Empty, pnlButtons));
Controls.Add(_pnlSuccess); Controls.Add(_pnlSuccess);
_pnlSuccess.Visible = false; _pnlSuccess.Visible = false;
@@ -115,10 +115,8 @@ namespace VAR.Focus.Web.Pages
_btnExitSuccess.Text = "Exit"; _btnExitSuccess.Text = "Exit";
_btnExitSuccess.Click += btnExit_Click; _btnExitSuccess.Click += btnExit_Click;
_pnlSuccess.Controls.Add(FormUtils.CreateField(String.Empty, _btnExitSuccess)); _pnlSuccess.Controls.Add(FormUtils.CreateField(String.Empty, _btnExitSuccess));
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -25,7 +25,7 @@ namespace VAR.Focus.Web.Pages
private bool _mustBeAutenticated = true; private bool _mustBeAutenticated = true;
private User _currentUser = null; private User _currentUser = null;
#endregion #endregion Declarations
#region Properties #region Properties
@@ -45,7 +45,7 @@ namespace VAR.Focus.Web.Pages
get { return _currentUser; } get { return _currentUser; }
} }
#endregion #endregion Properties
#region Life cycle #region Life cycle
@@ -56,7 +56,7 @@ namespace VAR.Focus.Web.Pages
PreRender += PageCommon_PreRender; PreRender += PageCommon_PreRender;
} }
void PageCommon_PreInit(object sender, EventArgs e) private void PageCommon_PreInit(object sender, EventArgs e)
{ {
Session session = WebSessions.Current.Session_GetCurrent(Context); Session session = WebSessions.Current.Session_GetCurrent(Context);
if (session != null) if (session != null)
@@ -73,22 +73,22 @@ namespace VAR.Focus.Web.Pages
} }
} }
void PageCommon_Init(object sender, EventArgs e) private void PageCommon_Init(object sender, EventArgs e)
{ {
CreateControls(); CreateControls();
} }
void PageCommon_PreRender(object sender, EventArgs e) private void PageCommon_PreRender(object sender, EventArgs e)
{ {
_head.Title = string.IsNullOrEmpty(Title) ? Globals.Title : String.Format("{0}{1}{2}", Title, Globals.TitleSeparator, Globals.Title); _head.Title = string.IsNullOrEmpty(Title) ? Globals.Title : String.Format("{0}{1}{2}", Title, Globals.TitleSeparator, Globals.Title);
_btnLogout.Visible = (_currentUser != null); _btnLogout.Visible = (_currentUser != null);
} }
#endregion #endregion Life cycle
#region UI Events #region UI Events
void btnLogout_Click(object sender, EventArgs e) private void btnLogout_Click(object sender, EventArgs e)
{ {
WebSessions.Current.Session_FinalizeCurrent(Context); WebSessions.Current.Session_FinalizeCurrent(Context);
_currentUser = null; _currentUser = null;
@@ -98,7 +98,7 @@ namespace VAR.Focus.Web.Pages
} }
} }
#endregion #endregion UI Events
#region Private methods #region Private methods
@@ -125,7 +125,6 @@ namespace VAR.Focus.Web.Pages
_head.Controls.Add(new LiteralControl(String.Format("<script type=\"text/javascript\" src=\"ScriptsBundler?v={0}\"></script>\n", version))); _head.Controls.Add(new LiteralControl(String.Format("<script type=\"text/javascript\" src=\"ScriptsBundler?v={0}\"></script>\n", version)));
_head.Controls.Add(new LiteralControl(String.Format("<link href=\"StylesBundler?v={0}\" type=\"text/css\" rel=\"stylesheet\"/>\n", version))); _head.Controls.Add(new LiteralControl(String.Format("<link href=\"StylesBundler?v={0}\" type=\"text/css\" rel=\"stylesheet\"/>\n", version)));
_body = new HtmlGenericControl("body"); _body = new HtmlGenericControl("body");
html.Controls.Add(_body); html.Controls.Add(_body);
_form = new HtmlForm { ID = "formMain" }; _form = new HtmlForm { ID = "formMain" };
@@ -159,6 +158,6 @@ namespace VAR.Focus.Web.Pages
_form.Controls.Add(_pnlContainer); _form.Controls.Add(_pnlContainer);
} }
#endregion #endregion Private methods
} }
} }

View File

@@ -1,7 +1,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("VAR.Focus")] [assembly: AssemblyTitle("VAR.Focus")]
@@ -13,8 +13,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
@@ -24,10 +24,10 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.*")]

View File

@@ -1,5 +1,4 @@
////////////////////////
////////////////////////
// GetElement // GetElement
// //
function GetElement(element) { function GetElement(element) {
@@ -53,7 +52,6 @@ function ElementToggleClass(element, className) {
} }
} }
function escapeHTML(s) { function escapeHTML(s) {
return s.replace(/&/g, '&amp;') return s.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;') .replace(/"/g, '&quot;')
@@ -67,7 +65,6 @@ function fixedEncodeURIComponent(str) {
}); });
} }
//////////////////////// ////////////////////////
// localStorage polyfill // localStorage polyfill
// //
@@ -94,4 +91,4 @@ if (!window.localStorage) {
hasOwnProperty: function (sKey) { return (new RegExp("(?:^|;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie); } hasOwnProperty: function (sKey) { return (new RegExp("(?:^|;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie); }
}; };
window.localStorage.length = (document.cookie.match(/\=/g) || window.localStorage).length; window.localStorage.length = (document.cookie.match(/\=/g) || window.localStorage).length;
} }

View File

@@ -1,5 +1,4 @@
function SendRequest(url, data, onData, onError) {
function SendRequest(url, data, onData, onError) {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
if (data) { if (data) {
url += "?" + GetDataQueryString(data); url += "?" + GetDataQueryString(data);
@@ -122,4 +121,4 @@ function SendForm(url, idForm, onData, onError) {
xhr.setRequestHeader('Content-Type', xhr.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded'); 'application/x-www-form-urlencoded');
xhr.send(GetFormQueryString(idForm)); xhr.send(GetFormQueryString(idForm));
} }

View File

@@ -1,5 +1,4 @@
var CosineInterpolation = function (f) {
var CosineInterpolation = function (f) {
return 1.0 - (Math.cos(f * Math.PI) + 1.0) / 2.0; return 1.0 - (Math.cos(f * Math.PI) + 1.0) / 2.0;
}; };
@@ -84,7 +83,7 @@ Toolbox.prototype = {
this.divToolbox.style.left = x + "px"; this.divToolbox.style.left = x + "px";
this.divToolbox.style.top = y + "px"; this.divToolbox.style.top = y + "px";
}, },
SavePosition: function(){ SavePosition: function () {
var pos = { X: this.X, Y: this.Y }; var pos = { X: this.X, Y: this.Y };
window.localStorage.setItem(this.StrKeyPosition, JSON.stringify(pos)); window.localStorage.setItem(this.StrKeyPosition, JSON.stringify(pos));
}, },
@@ -242,7 +241,7 @@ Card.prototype = {
this.container.appendChild(this.divCard); this.container.appendChild(this.divCard);
this.cfg.Toolbox.ReInsertOnContainer(); this.cfg.Toolbox.ReInsertOnContainer();
}, },
RemoveFromContainer: function(){ RemoveFromContainer: function () {
this.container.removeChild(this.divCard); this.container.removeChild(this.divCard);
}, },
MoveFrame: function () { MoveFrame: function () {
@@ -537,11 +536,11 @@ Card.prototype = {
document.removeEventListener("touchcancel", this.bindedTouchEnd, false); document.removeEventListener("touchcancel", this.bindedTouchEnd, false);
document.removeEventListener("touchmove", this.bindedTouchMove, false); document.removeEventListener("touchmove", this.bindedTouchMove, false);
this.OnMove(); this.OnMove();
return false; return false;
}, },
EnterEditionMode: function(){ EnterEditionMode: function () {
this.divTitle.innerHTML = ""; this.divTitle.innerHTML = "";
this.txtTitle.value = this.Title; this.txtTitle.value = this.Title;
this.divTitle.appendChild(this.txtTitle); this.divTitle.appendChild(this.txtTitle);
@@ -556,7 +555,7 @@ Card.prototype = {
this.divOverlay.style.display = "none"; this.divOverlay.style.display = "none";
this.Editing = true; this.Editing = true;
}, },
ExitEditionMode: function(){ ExitEditionMode: function () {
this.divTitle.removeChild(this.txtTitle); this.divTitle.removeChild(this.txtTitle);
this.divBody.removeChild(this.txtBody); this.divBody.removeChild(this.txtBody);
this.divBody.removeChild(this.btnAcceptEdit); this.divBody.removeChild(this.btnAcceptEdit);
@@ -601,7 +600,7 @@ Card.prototype = {
}, },
btnDelete_Click: function (evt) { btnDelete_Click: function (evt) {
evt.preventDefault(); evt.preventDefault();
if (this.IDCard==0 || confirm(this.cfg.Texts.ConfirmDelete)) { if (this.IDCard == 0 || confirm(this.cfg.Texts.ConfirmDelete)) {
this.OnDelete(); this.OnDelete();
} }
return false; return false;
@@ -636,7 +635,7 @@ function RunCardBoard(cfg) {
return false; return false;
} }
var ProcessCardCreateEvent = function(cardEvent){ var ProcessCardCreateEvent = function (cardEvent) {
var card = new Card(cfg, cardEvent.IDCard, cardEvent.Title, cardEvent.Body, cardEvent.X, cardEvent.Y); var card = new Card(cfg, cardEvent.IDCard, cardEvent.Title, cardEvent.Body, cardEvent.X, cardEvent.Y);
}; };
@@ -661,7 +660,7 @@ function RunCardBoard(cfg) {
var RequestCardEventData = function () { var RequestCardEventData = function () {
var ReciveCardEventData = function (responseText) { var ReciveCardEventData = function (responseText) {
cfg.Connected = true; cfg.Connected = true;
var recvData = JSON.parse(responseText); var recvData = JSON.parse(responseText);
if (recvData && recvData instanceof Array) { if (recvData && recvData instanceof Array) {
for (var i = 0, n = recvData.length; i < n; i++) { for (var i = 0, n = recvData.length; i < n; i++) {
@@ -708,4 +707,4 @@ function RunCardBoard(cfg) {
SendRequest(cfg.ServiceUrl, data, ReciveCardEventData, ErrorCardEventData); SendRequest(cfg.ServiceUrl, data, ReciveCardEventData, ErrorCardEventData);
}; };
RequestCardEventData(); RequestCardEventData();
} }

View File

@@ -81,7 +81,6 @@
var RequestChatData = function () { var RequestChatData = function () {
var ReciveChatData = function (responseText) { var ReciveChatData = function (responseText) {
// Mark as connected // Mark as connected
if (cfg.Connected == false) { if (cfg.Connected == false) {
if (cfg.Minimized) { if (cfg.Minimized) {
@@ -134,7 +133,6 @@
}, 20); }, 20);
}; };
var ErrorChatData = function () { var ErrorChatData = function () {
// Mark as disconnected // Mark as disconnected
cfg.lblTitle.innerHTML = cfg.Texts.Disconnected; cfg.lblTitle.innerHTML = cfg.Texts.Disconnected;
cfg.lblTitle.className = "titleChatDisconnected"; cfg.lblTitle.className = "titleChatDisconnected";
@@ -180,4 +178,4 @@ function SendChat(cfg) {
cfg.txtText.value = ""; cfg.txtText.value = "";
cfg.txtText.focus(); cfg.txtText.focus();
} }

View File

@@ -1,5 +1,4 @@
/* Reset */
/* Reset */
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
@@ -13,5 +12,4 @@ input[type="submit"]::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner { input[type="reset"]::-moz-focus-inner {
padding: 0 !important; padding: 0 !important;
border: 0 none !important; border: 0 none !important;
} }

View File

@@ -1,5 +1,4 @@
html {
html {
height: 100%; height: 100%;
} }
@@ -84,7 +83,6 @@ h3 {
box-shadow: 0 0 10px rgb(0,0,0); box-shadow: 0 0 10px rgb(0,0,0);
} }
.formColumn { .formColumn {
display: inline-block; display: inline-block;
font-size: 0; font-size: 0;
@@ -101,6 +99,9 @@ h3 {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 12px; font-size: 12px;
text-shadow: 0 1px 1px rgba(255,255,255,0.5); text-shadow: 0 1px 1px rgba(255,255,255,0.5);
text-align: right;
padding-right: 20px;
vertical-align: top;
} }
.formLabel span:last-child::after { .formLabel span:last-child::after {
@@ -144,7 +145,6 @@ textarea.textbox {
border: solid 1px black; border: solid 1px black;
} }
.button { .button {
padding: 5px; padding: 5px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,1), inset 0 -2px 5px rgba(128,128,128,1); box-shadow: 0px 0px 10px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,1), inset 0 -2px 5px rgba(128,128,128,1);
@@ -212,4 +212,4 @@ textarea.textbox {
.width300px { .width300px {
width: 300px !important; width: 300px !important;
max-width: 100% !important; max-width: 100% !important;
} }

View File

@@ -36,4 +36,4 @@
.boardBanner .formRow:first-child { .boardBanner .formRow:first-child {
margin: 0; margin: 0;
} }

View File

@@ -57,12 +57,11 @@
color: rgb(127,127,255); color: rgb(127,127,255);
background-color: rgb(0,0,128); background-color: rgb(0,0,128);
} }
.divToolbox .btnToolbox:active { .divToolbox .btnToolbox:active {
box-shadow: 0 2px 4px rgba(0,0,0,0.4) inset, 0 -2px 3px rgba(255,255,255,1) inset; box-shadow: 0 2px 4px rgba(0,0,0,0.4) inset, 0 -2px 3px rgba(255,255,255,1) inset;
} }
.divCard { .divCard {
position: absolute; position: absolute;
background-color: rgb(255,255,0); background-color: rgb(255,255,0);
@@ -162,4 +161,4 @@
border-radius: 3px; border-radius: 3px;
box-shadow: 0 2px 4px rgba(0,0,0,0.4) inset, 0 -2px 3px rgba(255,255,255,1) inset; box-shadow: 0 2px 4px rgba(0,0,0,0.4) inset, 0 -2px 3px rgba(255,255,255,1) inset;
padding: 2px; padding: 2px;
} }

View File

@@ -141,7 +141,6 @@
text-align: left; text-align: left;
} }
.chatButton { .chatButton {
box-sizing: border-box; box-sizing: border-box;
padding: 5px; padding: 5px;
@@ -165,4 +164,4 @@
.chatButton:active { .chatButton:active {
background-color: rgb(220,220,220); background-color: rgb(220,220,220);
box-shadow: inset 0px 2px 5px rgba(255,255,255,1), inset 0px -2px 5px rgba(128,128,128,1); box-shadow: inset 0px 2px 5px rgba(255,255,255,1), inset 0px -2px 5px rgba(128,128,128,1);
} }

View File

@@ -3,19 +3,19 @@
<system.web> <system.web>
<compilation debug="true"> <compilation debug="true">
<assemblies> <assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies> </assemblies>
</compilation> </compilation>
<httpHandlers> <httpHandlers>
<clear/> <clear />
<add path="*" verb="*" type="VAR.Focus.Web.GlobalRouter"/> <add path="*" verb="*" type="VAR.Focus.Web.GlobalRouter" />
</httpHandlers> </httpHandlers>
</system.web> </system.web>
<system.webServer> <system.webServer>
<handlers> <handlers>
<clear/> <clear />
<add name="GlobalRouter" path="*" verb="*" type="VAR.Focus.Web.GlobalRouter"/> <add name="GlobalRouter" path="*" verb="*" type="VAR.Focus.Web.GlobalRouter" />
</handlers> </handlers>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false" />
</system.webServer> </system.webServer>
</configuration> </configuration>