Converted EditMacro.aspx over to use the correct webforms inheritance.

This commit is contained in:
Shannon Deminick
2013-01-01 03:28:09 +03:00
parent 72898dc154
commit a8f808f488
8 changed files with 298 additions and 418 deletions

View File

@@ -145,6 +145,7 @@
<Private>True</Private>
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Web">
<Name>System.Web</Name>
@@ -285,6 +286,13 @@
<Compile Include="Umbraco\Developer\Packages\StarterKits.aspx.designer.cs">
<DependentUpon>StarterKits.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Dialogs\EditMacro.aspx.cs">
<DependentUpon>EditMacro.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Dialogs\EditMacro.aspx.designer.cs">
<DependentUpon>EditMacro.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Masterpages\UmbracoDialog.master.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@@ -418,6 +426,7 @@
<Content Include="Umbraco\Developer\RelationTypes\RelationTypesWebService.asmx" />
<Content Include="Umbraco\Developer\RelationTypes\TreeMenu\ActionDeleteRelationType.js" />
<Content Include="Umbraco\Developer\RelationTypes\TreeMenu\ActionNewRelationType.js" />
<Content Include="Umbraco\Dialogs\EditMacro.aspx" />
<Content Include="Umbraco\Images\delete.gif" />
<Content Include="Umbraco\Images\delete.png" />
<Content Include="Umbraco\Images\download.png" />
@@ -1678,7 +1687,6 @@
<Content Include="Umbraco\Dialogs\AssignDomain.aspx" />
<Content Include="Umbraco\Dialogs\create.aspx" />
<Content Include="Umbraco\Dialogs\cruds.aspx" />
<Content Include="Umbraco\Dialogs\editMacro.aspx" />
<Content Include="Umbraco\Dialogs\emptyTrashcan.aspx" />
<Content Include="Umbraco\Dialogs\exportDocumenttype.aspx" />
<Content Include="Umbraco\Dialogs\imageViewer.aspx" />

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Umbraco.Web.UI.Umbraco.Dialogs
{
public partial class EditMacro : global::umbraco.dialogs.editMacro
{
}
}

View File

@@ -0,0 +1,15 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Umbraco.Web.UI.Umbraco.Dialogs {
public partial class EditMacro {
}
}

View File

@@ -1,99 +1,97 @@
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoPage.Master" ValidateRequest="false"
CodeBehind="editMacro.aspx.cs" AutoEventWireup="True" Inherits="umbraco.dialogs.editMacro"
Trace="false" %>
<%@ Page Language="C#" MasterPageFile="../MasterPages/UmbracoPage.Master" AutoEventWireup="true" CodeBehind="EditMacro.aspx.cs" Inherits="Umbraco.Web.UI.Umbraco.Dialogs.EditMacro" %>
<%@ Register TagPrefix="cc2" Namespace="umbraco.uicontrols" Assembly="controls" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
function saveTreepickerValue(appAlias, macroAlias) {
var treePicker = window.showModalDialog('treePicker.aspx?app=' + appAlias + '&treeType=' + appAlias, 'treePicker', 'dialogWidth=350px;dialogHeight=300px;scrollbars=no;center=yes;border=thin;help=no;status=no')
document.forms[0][macroAlias].value = treePicker;
document.getElementById("label" + macroAlias).innerHTML = "</b><i>updated with id: " + treePicker + "</i><b><br/>";
}
var macroAliases = new Array();
var macroAlias = '<%= _macroAlias %>';
function saveTreepickerValue(appAlias, macroAlias) {
var treePicker = window.showModalDialog('treePicker.aspx?app=' + appAlias + '&treeType=' + appAlias, 'treePicker', 'dialogWidth=350px;dialogHeight=300px;scrollbars=no;center=yes;border=thin;help=no;status=no')
document.forms[0][macroAlias].value = treePicker;
document.getElementById("label" + macroAlias).innerHTML = "</b><i>updated with id: " + treePicker + "</i><b><br/>";
}
var macroAliases = new Array();
var macroAlias = '<%= _macroAlias %>';
<%if (umbraco.UmbracoSettings.UseAspNetMasterPages) { %>
var macroElement = "umbraco:Macro";
var macroElement = "umbraco:Macro";
<%}else{ %>
var macroElement = "?UMBRACO_MACRO";
var macroElement = "?UMBRACO_MACRO";
<%}%>
function registerAlias(alias, pAlias) {
var macro = new Array();
macro[0] = alias;
macro[1] = pAlias;
macroAliases[macroAliases.length] = macro;
}
function registerAlias(alias, pAlias) {
var macro = new Array();
macro[0] = alias;
macro[1] = pAlias;
macroAliases[macroAliases.length] = macro;
}
function updateMacro() {
var macroString = '<' + macroElement + ' ';
for (i=0; i<macroAliases.length; i++) {
var controlId = macroAliases[i][0];
var propertyName = macroAliases[i][1];
var control = jQuery("#" + controlId);
function updateMacro() {
var macroString = '<' + macroElement + ' ';
for (i = 0; i < macroAliases.length; i++) {
var controlId = macroAliases[i][0];
var propertyName = macroAliases[i][1];
var control = jQuery("#" + controlId);
if (control == null || (!control.is('input') && !control.is('select') && !control.is('textarea'))) {
// hack for tree based macro parameter types
var picker = Umbraco.Controls.TreePicker.GetPickerById(controlId);
if (picker != undefined) {
macroString += propertyName + "=\"" + picker.GetValue() + "\" ";
macroString += propertyName + "=\"" + picker.GetValue() + "\" ";
}
} else {
if (control.is(':checkbox')) {
if (control.is(':checked'))
macroString += propertyName + "=\"1\" ";
else
macroString += propertyName + "=\"0\" ";
if (control.is(':checkbox')) {
if (control.is(':checked'))
macroString += propertyName + "=\"1\" ";
else
macroString += propertyName + "=\"0\" ";
} else if (control[0].tagName.toLowerCase() == 'select') {
var tempValue = '';
control.find(':selected').each(function(i, selected) {
tempValue += jQuery(this).attr('value') + ', ';
} else if (control[0].tagName.toLowerCase() == 'select') {
var tempValue = '';
control.find(':selected').each(function (i, selected) {
tempValue += jQuery(this).attr('value') + ', ';
});
/*
for (var j=0; j<document.forms[0][controlId].length;j++) {
if (document.forms[0][controlId][j].selected)
tempValue += document.forms[0][controlId][j].value + ', ';
}
*/
if (tempValue.length > 2)
tempValue = tempValue.substring(0, tempValue.length-2)
macroString += propertyName + "=\"" + tempValue + "\" ";
}else {
macroString += propertyName + "=\"" + pseudoHtmlEncode(document.forms[0][controlId].value) + "\" ";
}
/*
for (var j=0; j<document.forms[0][controlId].length;j++) {
if (document.forms[0][controlId][j].selected)
tempValue += document.forms[0][controlId][j].value + ', ';
}
*/
if (tempValue.length > 2)
tempValue = tempValue.substring(0, tempValue.length - 2)
macroString += propertyName + "=\"" + tempValue + "\" ";
} else {
macroString += propertyName + "=\"" + pseudoHtmlEncode(document.forms[0][controlId].value) + "\" ";
}
}
}
if (macroString.length > 1)
macroString = macroString.substr(0, macroString.length-1);
}
if (macroString.length > 1)
macroString = macroString.substr(0, macroString.length - 1);
<%if (!umbraco.UmbracoSettings.UseAspNetMasterPages){ %>
macroString += " macroAlias=\"" + macroAlias + "\"";
<%} %>
macroString += " macroAlias=\"" + macroAlias + "\"";
<%} %>
<%if (umbraco.UmbracoSettings.UseAspNetMasterPages){ %>
macroString += " Alias=\"" + macroAlias + "\" runat=\"server\"></" + macroElement + ">";
macroString += " Alias=\"" + macroAlias + "\" runat=\"server\"></" + macroElement + ">";
<%} else { %>
macroString += "></" + macroElement + ">";
macroString += "></" + macroElement + ">";
<%} %>
UmbClientMgr.contentFrame().focus();
UmbClientMgr.contentFrame().UmbEditor.Insert(macroString, '', '<%=umbraco.helper.Request("objectId")%>');
UmbClientMgr.closeModalWindow();
}
function pseudoHtmlEncode(text) {
return text.replace(/\"/gi,"&amp;quot;").replace(/\</gi,"&amp;lt;").replace(/\>/gi,"&amp;gt;");
}
UmbClientMgr.contentFrame().focus();
UmbClientMgr.contentFrame().UmbEditor.Insert(macroString, '', '<%=umbraco.helper.Request("objectId")%>');
UmbClientMgr.closeModalWindow();
}
function pseudoHtmlEncode(text) {
return text.replace(/\"/gi, "&amp;quot;").replace(/\</gi, "&amp;lt;").replace(/\>/gi, "&amp;gt;");
}
</script>
<style type="text/css">
.propertyItemheader
@@ -136,4 +134,4 @@
<div id="renderContent" style="display: none">
<asp:PlaceHolder ID="renderHolder" runat="server"></asp:PlaceHolder>
</div>
</asp:Content>
</asp:Content>