--HG--
branch : autoroute
This commit is contained in:
randompete
2012-02-03 13:01:55 +00:00
29 changed files with 1009 additions and 736 deletions

View File

@@ -0,0 +1,36 @@
using System.Net;
using System.Web.Mvc;
using Orchard.Mvc;
using Orchard.Themes;
namespace Orchard.Core.Common.Controllers {
[Themed]
public class ErrorController : Controller {
private readonly IOrchardServices _orchardServices;
public ErrorController(IOrchardServices orchardServices) {
_orchardServices = orchardServices;
}
public ActionResult NotFound(string url) {
Response.StatusCode = (int)HttpStatusCode.NotFound;
var model = _orchardServices.New.NotFound();
if(url == null) {
url = Request.Url.OriginalString;
}
// If the url is relative then replace with Requested path
model.RequestedUrl = Request.Url.OriginalString.Contains(url) & Request.Url.OriginalString != url ?
Request.Url.OriginalString : url;
// Dont get the user stuck in a 'retry loop' by
// allowing the Referrer to be the same as the Request
model.ReferrerUrl = Request.UrlReferrer != null &&
Request.UrlReferrer.OriginalString != model.RequestedUrl ?
Request.UrlReferrer.OriginalString : null;
return new ShapeResult(this, model);
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.Mvc.Routes;
namespace Orchard.Core.Common {
public class Routes : IRouteProvider {
public void GetRoutes(ICollection<RouteDescriptor> routes) {
foreach (var routeDescriptor in GetRoutes())
routes.Add(routeDescriptor);
}
public IEnumerable<RouteDescriptor> GetRoutes() {
return new[] {
new RouteDescriptor {
Priority = -9999,
Route = new Route(
"{*path}",
new RouteValueDictionary {
{"area", "Common"},
{"controller", "Error"},
{"action", "NotFound"}
},
new RouteValueDictionary {
},
new RouteValueDictionary {
{"area", "Common"}
},
new MvcRouteHandler())
}
};
}
}
}

View File

@@ -65,6 +65,7 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="Common\Controllers\ErrorController.cs" />
<Compile Include="Common\DateEditor\DateEditorSettings.cs" />
<Compile Include="Common\OwnerEditor\OwnerEditorSettings.cs" />
<Compile Include="Common\OwnerEditor\OwnerEditorDriver.cs" />
@@ -76,6 +77,7 @@
<Compile Include="Common\Models\IdentityPartRecord.cs" />
<Compile Include="Common\Models\IdentityPart.cs" />
<Compile Include="Common\ResourceManifest.cs" />
<Compile Include="Common\Routes.cs" />
<Compile Include="Common\Services\XmlRpcHandler.cs" />
<Compile Include="Common\DateEditor\DateEditorViewModel.cs" />
<Compile Include="Common\Settings\TextFieldSettingsEvents.cs" />

View File

@@ -1,3 +1,8 @@
@model dynamic
@*
@Model.RequestedUrl
@Model.ReferrerUrl
*@
<h1>@Html.TitleForPage(T("Not found").ToString())</h1>
<p>@T("The page you are looking for does not exist.")</p>

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@
theme: "advanced",
mode: "specific_textareas",
editor_selector: "tinymce",
plugins: "fullscreen,searchreplace,mediapicker",
plugins: "fullscreen,autoresize,searchreplace,mediapicker",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_buttons1: "search,replace,|,cut,copy,paste,|,undo,redo,|,mediapicker,|,link,unlink,charmap,emoticon,codeblock,|,bold,italic,|,numlist,bullist,formatselect,|,code,fullscreen",

View File

@@ -1 +1 @@
(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var i=a.getDoc(),f=i.body,k=i.documentElement,h=tinymce.DOM,j=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:i.body.offsetHeight;if(g>d.autoresize_min_height){j=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){j=d.autoresize_max_height;a.getBody().style.overflowY="auto"}else{a.getBody().style.overflowY="hidden"}if(j!==e){h.setStyle(h.get(a.id+"_ifr"),"height",j+"px");e=j}if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onInit.add(function(g,f){g.setProgressState(true);d.throbbing=true;g.getBody().style.overflowY="hidden"});a.onLoadContent.add(function(g,f){b();setTimeout(function(){b();g.setProgressState(false);d.throbbing=false},1250)})}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var j,i=a.getDoc(),f=i.body,l=i.documentElement,h=tinymce.DOM,k=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:(tinymce.isWebKit&&f.clientHeight==0?0:f.offsetHeight);if(g>d.autoresize_min_height){k=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){k=d.autoresize_max_height;f.style.overflowY="auto";l.style.overflowY="auto"}else{f.style.overflowY="hidden";l.style.overflowY="hidden";f.scrollTop=0}if(k!==e){j=k-e;h.setStyle(h.get(a.id+"_ifr"),"height",k+"px");e=k;if(tinymce.isWebKit&&j<0){b()}}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onLoad.add(b);a.onLoadContent.add(b)}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();

View File

@@ -11,7 +11,7 @@
(function() {
/**
* Auto Resize
*
*
* This plugin automatically resizes the content area to fit its content height.
* It will retain a minimum height, which is the height of the content area when
* it's initialized.
@@ -35,10 +35,10 @@
* This method gets executed each time the editor needs to resize.
*/
function resize() {
var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
// Get height differently depending on the browser used
myHeight = tinymce.isIE ? b.scrollHeight : d.body.offsetHeight;
myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
// Don't make it smaller than the minimum height
if (myHeight > t.autoresize_min_height)
@@ -47,30 +47,34 @@
// If a maximum height has been defined don't exceed this height
if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
resizeHeight = t.autoresize_max_height;
ed.getBody().style.overflowY = "auto";
} else
ed.getBody().style.overflowY = "hidden";
body.style.overflowY = "auto";
de.style.overflowY = "auto"; // Old IE
} else {
body.style.overflowY = "hidden";
de.style.overflowY = "hidden"; // Old IE
body.scrollTop = 0;
}
// Resize content element
if (resizeHeight !== oldSize) {
deltaSize = resizeHeight - oldSize;
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
oldSize = resizeHeight;
}
// if we're throbbing, we'll re-throb to match the new size
if (t.throbbing) {
ed.setProgressState(false);
ed.setProgressState(true);
// WebKit doesn't decrease the size of the body element until the iframe gets resized
// So we need to continue to resize the iframe down until the size gets fixed
if (tinymce.isWebKit && deltaSize < 0)
resize();
}
};
t.editor = ed;
// Define minimum height
t.autoresize_min_height = parseInt( ed.getParam('autoresize_min_height', ed.getElement().offsetHeight) );
t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
// Define maximum height
t.autoresize_max_height = parseInt( ed.getParam('autoresize_max_height', 0) );
// Define maximum height
t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
// Add padding at the bottom for better UX
ed.onInit.add(function(ed){
@@ -85,30 +89,8 @@
ed.onPostRender.add(resize);
if (ed.getParam('autoresize_on_init', true)) {
// Things to do when the editor is ready
ed.onInit.add(function(ed, l) {
// Show throbber until content area is resized properly
ed.setProgressState(true);
t.throbbing = true;
// Hide scrollbars
ed.getBody().style.overflowY = "hidden";
});
ed.onLoadContent.add(function(ed, l) {
resize();
// Because the content area resizes when its content CSS loads,
// and we can't easily add a listener to its onload event,
// we'll just trigger a resize after a short loading period
setTimeout(function() {
resize();
// Disable throbber
ed.setProgressState(false);
t.throbbing = false;
}, 1250);
});
ed.onLoad.add(resize);
ed.onLoadContent.add(resize);
}
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');

View File

@@ -5,7 +5,7 @@
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/charmap.js"></script>
</head>
<body id="charmap" style="display:none">
<body id="charmap" style="display:none" role="application">
<table align="center" border="0" cellspacing="0" cellpadding="2" role="presentation">
<tr>
<td colspan="2" class="title" ><label for="charmapView" id="charmap_label">{#advanced_dlg.charmap_title}</label></td>
@@ -46,6 +46,10 @@
</table>
</td>
</tr>
<tr>
<td colspan="2" id="charmap_usage">{#advanced_dlg.charmap_usage}</td>
</tr>
</table>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -386,7 +386,7 @@
return v == sv;
});
if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] == v['class'])) {
if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) {
c.select(null);
}
@@ -593,7 +593,11 @@
if (evt.altKey) {
if (evt.keyCode === DOM_VK_F10) {
window.focus();
// Make sure focus is given to toolbar in Safari.
// We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame
if (tinymce.isWebKit) {
window.focus();
}
t.toolbarGroup.focus();
return Event.cancel(evt);
} else if (evt.keyCode === DOM_VK_F11) {
@@ -1221,7 +1225,7 @@
ed.windowManager.open({
url : this.url + '/charmap.htm',
width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
inline : true
}, {
theme_url : this.url

View File

@@ -30,9 +30,10 @@ var AnchorDialog = {
ed.selection.collapse(1);
elm = ed.dom.getParent(ed.selection.getNode(), 'A');
if (elm)
if (elm) {
elm.setAttribute('name', name);
elm.name = name;
else
} else
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));
tinyMCEPopup.close();

View File

@@ -281,13 +281,21 @@ tinyMCEPopup.onInit.add(function() {
function addKeyboardNavigation(){
var tableElm, cells, settings;
cells = tinyMCEPopup.dom.select(".charmaplink", "charmapgroup");
cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup");
settings ={
root: "charmapgroup",
items: cells
};
cells[0].tabindex=0;
tinyMCEPopup.dom.addClass(cells[0], "mceFocus");
if (tinymce.isGecko) {
cells[0].focus();
} else {
setTimeout(function(){
cells[0].focus();
}, 100);
}
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);
}
@@ -306,7 +314,7 @@ function renderCharMapHTML() {
previewCharFn = 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');';
html += ''
+ '<td class="charmap">'
+ '<a class="charmaplink" role="button" onmouseover="'+previewCharFn+'" onfocus="'+previewCharFn+'" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
+ '<a class="charmaplink" role="button" onmouseover="'+previewCharFn+'" onfocus="'+previewCharFn+'" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + ' '+ tinyMCEPopup.editor.translate("advanced_dlg.charmap_usage")+'">'
+ charmap[i][1]
+ '</a></td>';
if ((cols+1) % charsPerRow == 0)

View File

@@ -1,6 +1,6 @@
tinyMCEPopup.requireLangPack();
var detail = 50, strhex = "0123456789ABCDEF", i, isMouseDown = false, isMouseOver = false;
var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
var colors = [
"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
@@ -266,10 +266,10 @@ function dechex(n) {
}
function computeColor(e) {
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
partWidth = document.getElementById('colors').width / 6;
partDetail = detail / 2;

View File

@@ -1 +1 @@
tinyMCE.addI18n('en.advanced_dlg',{"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage"});
tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","":""});

View File

@@ -13,7 +13,7 @@ a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-mod
span.mceItemNbsp {background: #DDD}
td.mceSelected, th.mceSelected {background-color:#3399ff !important}
img {border:0;}
table {cursor:default}
table, img, hr, .mceItemAnchor {cursor:default}
table td, table th {cursor:text}
ins {border-bottom:1px solid green; text-decoration: none; color:green}
del {color:red; text-decoration:line-through}
@@ -45,5 +45,6 @@ font[face=mceinline] {font-family:inherit !important}
.mceItemRealMedia {background-image:url(../../img/realmedia.gif)}
.mceItemVideo {background-image:url(../../img/video.gif)}
.mceItemAudio {background-image:url(../../img/video.gif)}
.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)}
.mceItemIframe {background-image:url(../../img/iframe.gif)}
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}

View File

@@ -11,7 +11,7 @@ a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !impo
span.mceItemNbsp {background: #DDD}
td.mceSelected, th.mceSelected {background-color:#3399ff !important}
img {border:0;}
table {cursor:default}
table, img, hr, .mceItemAnchor {cursor:default}
table td, table th {cursor:text}
ins {border-bottom:1px solid green; text-decoration: none; color:green}
del {color:red; text-decoration:line-through}

View File

@@ -12,7 +12,7 @@ a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !impo
span.mceItemNbsp {background: #DDD}
td.mceSelected, th.mceSelected {background-color:#3399ff !important}
img {border:0;}
table {cursor:default}
table, img, hr, .mceItemAnchor {cursor:default}
table td, table th {cursor:text}
ins {border-bottom:1px solid green; text-decoration: none; color:green}
del {color:red; text-decoration:line-through}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -18,6 +18,7 @@
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<TargetFrameworkProfile />
<UseIISExpress>false</UseIISExpress>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -67,7 +68,16 @@
<Content Include="Scripts\themes\advanced\editor_template_src.js" />
<Content Include="Scripts\themes\advanced\image.htm" />
<Content Include="Scripts\themes\advanced\img\colorpicker.jpg" />
<Content Include="Scripts\themes\advanced\img\flash.gif" />
<Content Include="Scripts\themes\advanced\img\icons.gif" />
<Content Include="Scripts\themes\advanced\img\iframe.gif" />
<Content Include="Scripts\themes\advanced\img\pagebreak.gif" />
<Content Include="Scripts\themes\advanced\img\quicktime.gif" />
<Content Include="Scripts\themes\advanced\img\realmedia.gif" />
<Content Include="Scripts\themes\advanced\img\shockwave.gif" />
<Content Include="Scripts\themes\advanced\img\trans.gif" />
<Content Include="Scripts\themes\advanced\img\video.gif" />
<Content Include="Scripts\themes\advanced\img\windowsmedia.gif" />
<Content Include="Scripts\themes\advanced\js\about.js" />
<Content Include="Scripts\themes\advanced\js\anchor.js" />
<Content Include="Scripts\themes\advanced\js\charmap.js" />
@@ -78,6 +88,7 @@
<Content Include="Scripts\themes\advanced\langs\en.js" />
<Content Include="Scripts\themes\advanced\langs\en_dlg.js" />
<Content Include="Scripts\themes\advanced\link.htm" />
<Content Include="Scripts\themes\advanced\shortcuts.htm" />
<Content Include="Scripts\themes\advanced\skins\default\content.css" />
<Content Include="Scripts\themes\advanced\skins\default\dialog.css" />
<Content Include="Scripts\themes\advanced\skins\default\img\buttons.png" />
@@ -87,6 +98,9 @@
<Content Include="Scripts\themes\advanced\skins\default\img\progress.gif" />
<Content Include="Scripts\themes\advanced\skins\default\img\tabs.gif" />
<Content Include="Scripts\themes\advanced\skins\default\ui.css" />
<Content Include="Scripts\themes\advanced\skins\highcontrast\content.css" />
<Content Include="Scripts\themes\advanced\skins\highcontrast\dialog.css" />
<Content Include="Scripts\themes\advanced\skins\highcontrast\ui.css" />
<Content Include="Scripts\themes\advanced\skins\o2k7\content.css" />
<Content Include="Scripts\themes\advanced\skins\o2k7\dialog.css" />
<Content Include="Scripts\themes\advanced\skins\o2k7\img\button_bg.png" />

View File

@@ -5,5 +5,6 @@
new Dictionary<string,object> {
{"class", "html tinymce"},
{"data-mediapicker-uploadpath",Model.AddMediaPath},
{"data-mediapicker-title",T("Insert/Update Media")}
{"data-mediapicker-title",T("Insert/Update Media")},
{"style", "width:100%"}
})

View File

@@ -536,6 +536,12 @@ namespace Orchard.ContentManagement {
return result;
}
public void Clear() {
var session = _sessionLocator.Value.For(typeof(ContentItemRecord));
session.Clear();
_contentManagerSession().Clear();
}
public IContentQuery<ContentItem> Query() {
var query = _context.Resolve<IContentQuery>(TypedParameter.From<IContentManager>(this));
return query.ForPart<ContentItem>();

View File

@@ -21,5 +21,10 @@ namespace Orchard.ContentManagement {
public bool RecallContentRecordId(int id, out ContentItem item) {
return _publishedItemsByContentRecordId.TryGetValue(id, out item);
}
public void Clear() {
_itemByVersionRecordId.Clear();
_publishedItemsByContentRecordId.Clear();
}
}
}

View File

@@ -77,6 +77,11 @@ namespace Orchard.ContentManagement {
/// Flushes all pending content items to the persistance layer
/// </summary>
void Flush();
/// <summary>
/// Clears the current referenced content items
/// </summary>
void Clear();
/// <summary>
/// Query for arbitrary content items

View File

@@ -3,5 +3,7 @@
void Store(ContentItem item);
bool RecallVersionRecordId(int id, out ContentItem item);
bool RecallContentRecordId(int id, out ContentItem item);
void Clear();
}
}

View File

@@ -66,12 +66,12 @@ namespace Orchard.DisplayManagement.Implementation {
ShapeBinding shapeBinding;
if (TryGetDescriptorBinding(shapeMetadata.Type, Enumerable.Empty<string>(), shapeTable, out shapeBinding)) {
shapeBinding.ShapeDescriptor.Displaying.Invoke(action => action(displayingContext), Logger);
}
// copy all binding sources (all templates for this shape) in order to use them as Localization scopes
shapeMetadata.BindingSources = shapeBinding.ShapeDescriptor.BindingSources.Where(x => x != null).ToList();
if (!shapeMetadata.BindingSources.Any()) {
shapeMetadata.BindingSources.Add(shapeBinding.ShapeDescriptor.BindingSource);
// copy all binding sources (all templates for this shape) in order to use them as Localization scopes
shapeMetadata.BindingSources = shapeBinding.ShapeDescriptor.BindingSources.Where(x => x != null).ToList();
if (!shapeMetadata.BindingSources.Any()) {
shapeMetadata.BindingSources.Add(shapeBinding.ShapeDescriptor.BindingSource);
}
}
// invoking ShapeMetadata displaying events

View File

@@ -47,7 +47,7 @@ namespace Orchard.Environment {
return result;
// Try resolving the short name to a full name
var resolvedName = _assemblyNameResolvers.Select(r => r.Resolve(shortName)).Where(f => f != null).FirstOrDefault();
var resolvedName = _assemblyNameResolvers.Select(r => r.Resolve(shortName)).FirstOrDefault(f => f != null);
if (resolvedName != null) {
return Assembly.Load(resolvedName);
}

View File

@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Web;
using System.Web.Mvc;
using Orchard.Logging;
using Orchard.Mvc;
@@ -56,6 +58,25 @@ namespace Orchard.Exceptions.Filters {
}
}
}
if (filterContext.Result is HttpNotFoundResult) {
var model = _orchardServices.New.NotFound();
var request = filterContext.RequestContext.HttpContext.Request;
var url = request.RawUrl;
// If the url is relative then replace with Requested path
model.RequestedUrl = request.Url.OriginalString.Contains(url) & request.Url.OriginalString != url ?
request.Url.OriginalString : url;
// Dont get the user stuck in a 'retry loop' by
// allowing the Referrer to be the same as the Request
model.ReferrerUrl = request.UrlReferrer != null &&
request.UrlReferrer.OriginalString != model.RequestedUrl ?
request.UrlReferrer.OriginalString : null;
filterContext.Result = new ShapeResult(filterContext.Controller, model);
filterContext.RequestContext.HttpContext.Response.StatusCode = (int)HttpStatusCode.NotFound;
}
}
}
}