From b156300f392df773f40e146be7311505ef3d924c Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Tue, 29 Mar 2011 10:19:17 -0700 Subject: [PATCH 01/10] Reverting UseIIS alteration --HG-- branch : 1.x --- src/Orchard.Web/Orchard.Web.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orchard.Web/Orchard.Web.csproj b/src/Orchard.Web/Orchard.Web.csproj index 0316a04a7..b04239903 100644 --- a/src/Orchard.Web/Orchard.Web.csproj +++ b/src/Orchard.Web/Orchard.Web.csproj @@ -201,7 +201,7 @@ - True + False False 30320 /OrchardLocal From dd736ece9c596592008729c3c2488fed2482fa4d Mon Sep 17 00:00:00 2001 From: jowall Date: Tue, 29 Mar 2011 10:36:39 -0700 Subject: [PATCH 02/10] Some updates to the admin CSS. --HG-- branch : 1.x --- .../Themes/TheAdmin/Styles/site.css | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css index 544c68f12..1d2a3a425 100644 --- a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css +++ b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css @@ -332,14 +332,16 @@ form.link button:hover, button.link:hover { padding:6px 0 6px 20px; text-decoration:none; } + #menu .menu-admin ul a:hover, #menu .menu-admin ul a:active, #menu .menu-admin ul a:focus, #menu .menu-admin ul .selected a { - background-color:#656b55; + background-color:rgba(101,107,85,1.0); /*#656b55 at 100%*/ color: #fff; /*CSS3 properties*/ - border-radius: 3px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; } +#menu .menu-admin ul a:hover, #menu .menu-admin ul a:active {background-color:rgba(101,107,85,0.5);} /*Tabs*/ #local-navigation {margin:8px 0 -8px 0;} @@ -375,9 +377,9 @@ form.link button:hover, button.link:hover { border: 1px solid #e4e5e6; /*CSS3 properties*/ - border-radius: 3px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; } .section-dashboard, .section-new { background:#2b2b2b; @@ -385,9 +387,9 @@ form.link button:hover, button.link:hover { padding:6px 0; /*CSS3 properties*/ - border-radius: 3px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; box-shadow: inset 0px 0px 1px rgba(64, 64, 64, 1.0), 1px 1px 1px rgba(54, 54, 65, 1.0); -webkit-box-shadow: inset 0px 0px 1px rgba(64, 64, 64, 1.0), 1px 1px 1px rgba(54, 54, 65, 1.0); -moz-box-shadow: inset 0px 0px 1px rgba(64, 64, 64, 1.0), 1px 1px 1px rgba(54, 54, 65, 1.0); @@ -652,9 +654,9 @@ button.remove:focus::-moz-focus-inner, .remove.button:focus::-moz-focus-inner { color:#ababab; cursor:default; text-shadow: none; - box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none; + box-shadow: none; } .button.grey { color:#5d615d; @@ -671,7 +673,6 @@ button.remove:focus::-moz-focus-inner, .remove.button:focus::-moz-focus-inner { /*----In ie the first couplet sets the alpha value so 00=transparent and ff=opaque)----*/ filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr='#fff5f5f5', endColorstr='#ffd9d9d9'); background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(245, 245, 245, 1.0)), to(rgba(217, 217, 217, 1.0))); - background: -moz-linear-gradient(top, rgba(245, 245, 245, 1.0), rgba(217, 217, 217, 1.0)); -webkit-border-radius: 2px; -moz-border-radius: 2px; @@ -708,6 +709,9 @@ button, .button, a.button { background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(155, 179, 108, 1.0)), to(rgba(128, 159, 67, 1.0))); background: -moz-linear-gradient(top, rgba(155, 179, 108, 1.0), rgba(128, 159, 67, 1.0)); + /*test - base green in pallet is 155,179,108*/ + background: -moz-linear-gradient(top, rgba(166, 192, 116, 1.0), rgba(155, 179, 108, 1.0)); + background: -moz-linear-gradient(top, rgba(155, 179, 108, 1.0), rgba(133, 154, 93, 1.0)); -webkit-border-radius: 2px; -moz-border-radius: 2px; From ce09e610307e28121b9876fb9038aea9f2fa7c0f Mon Sep 17 00:00:00 2001 From: jowall Date: Tue, 29 Mar 2011 10:46:42 -0700 Subject: [PATCH 03/10] Some margin and padding cleanup in side navigation. --HG-- branch : 1.x --- src/Orchard.Web/Themes/TheAdmin/Styles/site.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css index 1d2a3a425..e05a4ccac 100644 --- a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css +++ b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css @@ -329,10 +329,9 @@ form.link button:hover, button.link:hover { color:#aec3ce; display:block; line-height:1.2em; - padding:6px 0 6px 20px; + padding:4px 0 6px 20px; text-decoration:none; } - #menu .menu-admin ul a:hover, #menu .menu-admin ul a:active, #menu .menu-admin ul a:focus, #menu .menu-admin ul .selected a { background-color:rgba(101,107,85,1.0); /*#656b55 at 100%*/ color: #fff; @@ -342,7 +341,9 @@ form.link button:hover, button.link:hover { border-radius: 2px; } #menu .menu-admin ul a:hover, #menu .menu-admin ul a:active {background-color:rgba(101,107,85,0.5);} -/*Tabs*/ +ul.menuItems {margin:4px 0 0 0;} + +/******Tabs******/ #local-navigation {margin:8px 0 -8px 0;} .localmenu li { From 7b8f95d50e3e3e1fd07e3eb1f1fc1f45b91c461e Mon Sep 17 00:00:00 2001 From: jowall Date: Tue, 29 Mar 2011 11:10:31 -0700 Subject: [PATCH 04/10] Updated footer background image. --HG-- branch : 1.x --- .../Styles/images/vinesBackgroundBottom.gif | Bin 2743 -> 2237 bytes .../Themes/TheAdmin/Styles/site.css | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/images/vinesBackgroundBottom.gif b/src/Orchard.Web/Themes/TheAdmin/Styles/images/vinesBackgroundBottom.gif index f1e6f46b797154d6f91c55352954f11aa050f0a7..493e91c556224dfbbeacc279fb101d2c7b71ae4c 100644 GIT binary patch literal 2237 zcmWlUXDb;F~R4P>}BekeD zGE#x+(C~1vOeRw(ULU0shl>q{C|QI|Dw8S{3bjV9R4G+zr6D>hToNvk zO6Ja;tJkAZpG&dW|04_mpalZ(nZKU^aoX8zj1~CQ^c^a^vOcoe)ln4Rwe+XEoyFJQ zY&}2X*pe`3|7r7N$@LA4+d!8#(*59EA*Mgn_-GnSHsWYhx_4obsiHEbgu)7e$s`si zsA{aVguw(no=B(cYdXBSP{d$2Ll7R``$PMQY%7D*)!kD5^U3ooOQhf9yDt$qzP~#A za{$eoeDTs5IJn{Zy~NzL@eKm__P|eMxZ%6|FAc_qH$%~dZtPo6FSUxUjo-&nB)FMw zv8SU#FYEF657kvy+iMyRP>JpdTWkSk5sL6i>5X^Sx`Q*=`Cx+aDUqIp1mQ^ zMmJc_!#0nbss42B$_Q8G0d|$r(>P)JX?RgedTC$hJu8<^5{`zwPJmJ`GpCY~HBO9f zDqI$R8gA(^5rg4dH&_f<-Q)ooWO3+43tecT#_W0i?kgPKZ}j(vW2~JnH!7Doaf?V} z`qnWHMt!?YMI!6EI)%7wAqXnp^oPiu{DDRwx(C;lTJu87xIqa!X9}oy+N1ph69)F8 z=l!A6fFf5-V32PTzzA>UQ+7XAz=wU?^ZWM>&#-o&33|t3&Mu{|KzJpy#$N~#LeIjP z>k4_U0O@#RtgAHX6SRXndveVT-ken~e=w_aB>gK5bP`aAGV;#GRYAvtmXBrqQB7tD z8~|oyxK?C$rytiHs4cx!yVaj}3e8{qOE3pw*CD;Tml>b7?5K+0wL;&z-VG2*TxO8X zojZY=ZM_?Sf+sG6Tk?Tx*vp) zpG`kG#h^_Ty!I7=G`>Sv)BShT6_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Subject: [PATCH 05/10] Updating CodeMirror to version 2.0 --HG-- branch : 1.x --- .../Scripts/CodeMirror/codemirror.js | 146 +++++++++++++----- .../Scripts/CodeMirror/javascript.js | 2 +- .../Styles/CodeMirror/codemirror.css | 105 +++++++------ 3 files changed, 167 insertions(+), 86 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/CodeMirror/codemirror.js b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/CodeMirror/codemirror.js index 640f07ff1..390e68c1f 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/CodeMirror/codemirror.js +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/CodeMirror/codemirror.js @@ -20,15 +20,15 @@ var CodeMirror = (function() { // This mess creates the base DOM structure for the editor. wrapper.innerHTML = '
' + // Set to the height of the text, causes scrolling - '
' + // To measure line/char size
+        '
' + // To measure line/char size
            'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
' + - '
' + // Moved around its parent to cover visible view + '
' + // Moved around its parent to cover visible view '
' + '
' + // Wraps and hides input textarea - '
' + + '
' + // Provides positioning relative to (visible) text origin '
' + - '
 
' + // Absolutely positioned blinky cursor + '
 
' + // Absolutely positioned blinky cursor '
'; // This DIV contains the actual code if (place.appendChild) place.appendChild(wrapper); else place(wrapper); // I've never seen more elegant code in my life. @@ -59,9 +59,9 @@ var CodeMirror = (function() { var shiftSelecting, reducedSelection; // Variables used by startOperation/endOperation to track what // happened during the operation. - var updateInput, changes, textChanged, selectionChanged; + var updateInput, changes, textChanged, selectionChanged, leaveInputAlone; // Current visible range (may be bigger than the view window). - var showingFrom = 0, showingTo = 0; + var showingFrom = 0, showingTo = 0, lastHeight = 0, curKeyId = null; // editing will hold an object describing the things we put in the // textarea, to help figure out whether something changed. // bracketHighlighted is used to remember that a backet has been @@ -75,12 +75,16 @@ var CodeMirror = (function() { // Register our event handlers. connect(wrapper, "mousedown", operation(onMouseDown)); + // Gecko browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for Gecko. + if (!gecko) connect(wrapper, "contextmenu", operation(onContextMenu)); connect(code, "dblclick", operation(onDblClick)); - connect(wrapper, "scroll", function() {updateDisplay(); if (options.onScroll) options.onScroll(instance);}); - connect(window, "resize", updateDisplay); + connect(wrapper, "scroll", function() {updateDisplay([]); if (options.onScroll) options.onScroll(instance);}); + connect(window, "resize", function() {updateDisplay(true);}); connect(input, "keyup", operation(onKeyUp)); connect(input, "keydown", operation(onKeyDown)); - connect(input, "keypress", onKeyPress); + connect(input, "keypress", operation(onKeyPress)); connect(input, "focus", onFocus); connect(input, "blur", onBlur); @@ -89,6 +93,7 @@ var CodeMirror = (function() { connect(wrapper, "drop", operation(onDrop)); connect(wrapper, "paste", function(){input.focus(); fastPoll();}); connect(input, "paste", function(){fastPoll();}); + connect(input, "cut", function(){fastPoll();}); if (document.activeElement == input) onFocus(); else onBlur(); @@ -125,15 +130,22 @@ var CodeMirror = (function() { return pageCoords(start ? sel.from : sel.to); }, charCoords: function(pos){return pageCoords(clipPos(pos));}, + coordsChar: function(coords) { + var off = eltOffset(lineSpace); + var line = Math.min(showingTo - 1, showingFrom + Math.floor(coords.y / lineHeight())); + return clipPos({line: line, ch: charFromX(clipLine(line), coords.x)}); + }, getSearchCursor: function(query, pos, caseFold) {return new SearchCursor(query, pos, caseFold);}, markText: operation(function(a, b, c){return operation(markText(a, b, c));}), setMarker: addGutterMarker, clearMarker: removeGutterMarker, + setLineClass: operation(setLineClass), lineInfo: lineInfo, addWidget: function(pos, node, scroll) { var pos = localCoords(clipPos(pos), true); - node.style.top = pos.yBot + "px"; node.style.left = pos.x + "px"; - lineSpace.appendChild(node); + node.style.top = (showingFrom * lineHeight() + pos.yBot + paddingTop()) + "px"; + node.style.left = (pos.x + paddingLeft()) + "px"; + code.appendChild(node); if (scroll) scrollIntoView(pos.x, pos.yBot, pos.x + node.offsetWidth, pos.yBot + node.offsetHeight); }, @@ -160,7 +172,7 @@ var CodeMirror = (function() { getRange: function(from, to) {return getRange(clipPos(from), clipPos(to));}, operation: function(f){return operation(f)();}, - refresh: function(){updateDisplay([{from: 0, to: lines.length}]);}, + refresh: function(){updateDisplay(true);}, getInputField: function(){return input;}, getWrapperElement: function(){return wrapper;} }; @@ -188,12 +200,13 @@ var CodeMirror = (function() { return e.stop(); } + if (gecko && e.button() == 3) onContextMenu(e); + if (e.button() != 1) return; // For button 1, if it was clicked inside the editor // (posFromMouse returning non-null), we have to adjust the // selection. var start = posFromMouse(e), last = start, going; if (!start) {if (e.target() == wrapper) e.stop(); return;} - if (e.button() != 1) return; // TODO can we make copy/cut context menu work? setCursor(start.line, start.ch, false); if (!focused) onFocus(); @@ -221,7 +234,6 @@ var CodeMirror = (function() { var move = connect(document, "mousemove", operation(function(e) { clearTimeout(going); e.stop(); - if (!e.button()) {end(); return;} extend(e); }), true); var up = connect(document, "mouseup", operation(function(e) { @@ -276,7 +288,7 @@ var CodeMirror = (function() { if (mod && (code == 36 || code == 35)) {scrollEnd(code == 36); return e.stop();} // ctrl-home/end if (mod && code == 65) {selectAll(); return e.stop();} // ctrl-a if (!options.readOnly) { - if (!anyMod && code == 13) {handleEnter(); return e.stop();} // enter + if (!anyMod && code == 13) {return;} // enter if (!anyMod && code == 9 && handleTab(e.e.shiftKey)) return e.stop(); // tab if (mod && code == 90) {undo(); return e.stop();} // ctrl-z if (mod && ((e.e.shiftKey && code == 90) || code == 89)) {redo(); return e.stop();} // ctrl-shift-z, ctrl-y @@ -288,15 +300,15 @@ var CodeMirror = (function() { // its start when it is inverted and a movement key is pressed // (and later restore it again), shouldn't be used for // non-movement keys. - var id = (mod ? "c" : "") + code; - if (sel.inverted && movementKeys.hasOwnProperty(id)) { + curKeyId = (mod ? "c" : "") + code; + if (sel.inverted && movementKeys.hasOwnProperty(curKeyId)) { var range = selRange(input); if (range) { reducedSelection = {anchor: range.start}; setSelRange(input, range.start, range.start); } } - fastPoll(id); + fastPoll(curKeyId); } function onKeyUp(e) { if (reducedSelection) { @@ -314,7 +326,9 @@ var CodeMirror = (function() { } var code = e.e.keyCode; // Re-stop tab and enter. Necessary on some browsers. - if (code == 13 || (code == 9 && options.tabMode != "default")) e.stop(); + if (code == 13) {handleEnter(); e.stop();} + else if (code == 9 && options.tabMode != "default") e.stop(); + else fastPoll(curKeyId); } function onFocus() { @@ -453,7 +467,9 @@ var CodeMirror = (function() { return getRange(sel.from, sel.to); } + var pollingFast = false; // Ensures slowPoll doesn't cancel fastPoll function slowPoll() { + if (pollingFast) return; poll.set(2000, function() { startOperation(); readInput(); @@ -462,14 +478,14 @@ var CodeMirror = (function() { }); } function fastPoll(keyId) { - var misses = 0; + var missed = false; + pollingFast = true; function p() { startOperation(); var changed = readInput(); if (changed == "moved" && keyId) movementKeys[keyId] = true; - if (changed) {poll.set(80, p); misses = 0;} - else if (misses++ < 5) {poll.set(80, p);} - else slowPoll(); + if (!changed && !missed) {missed = true; poll.set(80, p);} + else {pollingFast = false; slowPoll();} endOperation(); } poll.set(20, p); @@ -589,18 +605,21 @@ var CodeMirror = (function() { function visibleLines() { var lh = lineHeight(), top = wrapper.scrollTop - paddingTop(); - return {from: Math.max(0, Math.floor(top / lh)), + return {from: Math.min(lines.length, Math.max(0, Math.floor(top / lh))), to: Math.min(lines.length, Math.ceil((top + wrapper.clientHeight) / lh))}; } // Uses a set of changes plus the current scroll position to // determine which DOM updates have to be made, and makes the // updates. function updateDisplay(changes) { - if (!wrapper.clientWidth) return; + if (!wrapper.clientWidth) { + showingFrom = showingTo = 0; + return; + } // First create a range of theoretically intact lines, and punch // holes in that using the change info. - var intact = [{from: showingFrom, to: showingTo, domStart: 0}]; - for (var i = 0, l = changes ? changes.length : 0; i < l; ++i) { + var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}]; + for (var i = 0, l = changes.length || 0; i < l; ++i) { var change = changes[i], intact2 = [], diff = change.diff || 0; for (var j = 0, l2 = intact.length; j < l2; ++j) { var range = intact[j]; @@ -655,10 +674,11 @@ var CodeMirror = (function() { // Position the mover div to align with the lines it's supposed // to be showing (which will cover the visible display) - var different = from != showingFrom || to != showingTo; + var different = from != showingFrom || to != showingTo || lastHeight != wrapper.clientHeight; showingFrom = from; showingTo = to; mover.style.top = (from * lineHeight()) + "px"; if (different) { + lastHeight = wrapper.clientHeight; code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px"; updateGutter(); } @@ -723,6 +743,7 @@ var CodeMirror = (function() { } else { node.innerHTML = lines[j].getHTML(ch1, ch2, false); + node.className = lines[j].className || ""; node = node.nextSibling; } } @@ -732,7 +753,8 @@ var CodeMirror = (function() { function updateGutter() { if (!options.gutter && !options.lineNumbers) return; - gutter.style.height = Math.max(mover.offsetHeight, wrapper.clientHeight) + "px"; + var hText = mover.offsetHeight, hEditor = wrapper.clientHeight; + gutter.style.height = (hText - hEditor < 2 ? hEditor : hText) + "px"; var html = []; for (var i = showingFrom; i < showingTo; ++i) { var marker = lines[i].gutterMarker; @@ -877,9 +899,10 @@ var CodeMirror = (function() { if (n) indentation = lines[n-1].indentation(); else indentation = 0; } - else if (how == "smart") indentation = mode.indent(state, line.text.slice(curSpace)); + else if (how == "smart") indentation = mode.indent(state, line.text.slice(curSpaceString.length)); else if (how == "add") indentation = curSpace + options.indentUnit; - else if (how == "subtract") indentation = Math.max(0, curSpace - options.indentUnit); + else if (how == "subtract") indentation = curSpace - options.indentUnit; + indentation = Math.max(0, indentation); var diff = indentation - curSpace; if (!diff) { @@ -950,6 +973,20 @@ var CodeMirror = (function() { line.gutterMarker = null; updateGutter(); } + function setLineClass(line, className) { + if (typeof line == "number") { + var no = line; + line = lines[clipLine(line)]; + } + else { + var no = indexOf(lines, line); + if (no == -1) return null; + } + line.className = className; + changes.push({from: no, to: no + 1}); + return line; + } + function lineInfo(line) { if (typeof line == "number") { var n = line; @@ -1007,7 +1044,7 @@ var CodeMirror = (function() { function lineHeight() { var nlines = lineDiv.childNodes.length; if (nlines) return lineDiv.offsetHeight / nlines; - else return measure.offsetHeight || 1; + else return measure.firstChild.offsetHeight || 1; } function charWidth() {return (measure.firstChild.offsetWidth || 320) / 40;} function paddingTop() {return lineSpace.offsetTop;} @@ -1023,6 +1060,29 @@ var CodeMirror = (function() { var line = showingFrom + Math.floor(y / lineHeight()); return clipPos({line: line, ch: charFromX(clipLine(line), x)}); } + function onContextMenu(e) { + var pos = posFromMouse(e); + if (!pos || window.opera) return; // Opera is difficult. + if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)) + setCursor(pos.line, pos.ch); + + var oldCSS = input.style.cssText; + input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.pageY() - 1) + + "px; left: " + (e.pageX() - 1) + "px; z-index: 1000; background: white; " + + "border-width: 0; outline: none; overflow: hidden;"; + var val = input.value = getSelection(); + input.focus(); + setSelRange(input, 0, val.length); + if (gecko) e.stop(); + leaveInputAlone = true; + setTimeout(function() { + if (input.value != val) operation(replaceSelection)(input.value, "end"); + input.style.cssText = oldCSS; + leaveInputAlone = false; + prepareInput(); + slowPoll(); + }, 50); + } // Cursor-blinking function restartBlink() { @@ -1153,7 +1213,7 @@ var CodeMirror = (function() { // updateInput can be set to a boolean value to force/prevent an // update. - if (updateInput === true || (updateInput !== false && selectionChanged)) + if (!leaveInputAlone && (updateInput === true || (updateInput !== false && selectionChanged))) prepareInput(); if (selectionChanged && options.onCursorActivity) @@ -1332,6 +1392,18 @@ var CodeMirror = (function() { } return mfactory(options, config); } + CodeMirror.listModes = function() { + var list = []; + for (var m in modes) + if (modes.propertyIsEnumerable(m)) list.push(m); + return list; + }; + CodeMirror.listMIMEs = function() { + var list = []; + for (var m in mimeModes) + if (mimeModes.propertyIsEnumerable(m)) list.push(m); + return list; + }; CodeMirror.fromTextArea = function(textarea, options) { if (!options) options = {}; @@ -1452,7 +1524,7 @@ var CodeMirror = (function() { this.styles = styles || [text, null]; this.stateAfter = null; this.text = text; - this.marked = null; this.gutterMarker = null; + this.marked = this.gutterMarker = this.className = null; } Line.prototype = { // Replace a piece of a line, keeping the styles around it intact. @@ -1536,7 +1608,9 @@ var CodeMirror = (function() { // Produces an HTML fragment for the line, taking selection, // marking, and highlighting into account. getHTML: function(sfrom, sto, includePre) { - var html = includePre ? ["
"] : [];
+      var html = [];
+      if (includePre)
+        html.push(this.className ? '
': "
");
       function span(text, style) {
         if (!text) return;
         if (style) html.push('', htmlEscape(text), "");
@@ -1698,6 +1772,8 @@ var CodeMirror = (function() {
     pre.innerHTML = " "; return !pre.innerHTML;
   })();
 
+  var gecko = /gecko\/\d{7}/i.test(navigator.userAgent);
+
   var lineSep = "\n";
   // Feature-detect whether newlines in textareas are converted to \r\n
   (function () {
diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/CodeMirror/javascript.js b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/CodeMirror/javascript.js
index e089b0389..065216591 100644
--- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/CodeMirror/javascript.js
+++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/CodeMirror/javascript.js
@@ -293,7 +293,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
   }
   function functiondef(type, value) {
     if (type == "variable") {register(value); return cont(functiondef);}
-    if (type == "(") return cont(pushcontext, commasep(funarg, ")"), statement, popcontext);
+    if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext);
   }
   function funarg(type, value) {
     if (type == "variable") {register(value); return cont();}
diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/CodeMirror/codemirror.css b/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/CodeMirror/codemirror.css
index cca859481..83bae5a70 100644
--- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/CodeMirror/codemirror.css
+++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/CodeMirror/codemirror.css
@@ -1,50 +1,55 @@
-.CodeMirror {
-  overflow: auto;
-  line-height: 1em;
-  font-family: Consolas, Monospace;
-  font-size:10pt;
-  _position: relative; /* IE6 hack */
-}
-
-.CodeMirror-gutter {
-  position: absolute; left: 0; top: 0;
-  background-color: #f7f7f7;
-  border-right: 1px solid #eee;
-  min-width: 2em;
-  height: 100%;
-}
-.CodeMirror-gutter-text {
-  color: #aaa;
-  text-align: right;
-  padding: .4em .2em .4em .4em;
-}
-.CodeMirror-lines {
-  padding: .4em;
-}
-
-.CodeMirror pre {
-  border-width: 0; margin: 0; padding: 0; background: transparent;
-  font-family: inherit;
-}
-
-.CodeMirror-cursor {
-  z-index: 10;
-  position: absolute;
-  visibility: hidden;
-  border-left: 1px solid black !important;
-}
-.CodeMirror-focused .CodeMirror-cursor {
-  visibility: visible;
-}
-
-span.CodeMirror-selected {
-  background: #ccc !important;
-  color: HighlightText !important;
-}
-.CodeMirror-focused span.CodeMirror-selected {
-  background: Highlight !important;
-}
-
-
-.CodeMirror-matchingbracket {color: #0f0 !important;}
-.CodeMirror-nonmatchingbracket {color: #f22 !important;}
+.CodeMirror {
+  overflow: auto;
+  line-height: 1em;
+  font-family: Consolas, Monospace;
+  font-size:10pt;
+  _position: relative; /* IE6 hack */
+}
+
+.CodeMirror-gutter {
+  position: absolute; left: 0; top: 0;
+  background-color: #f7f7f7;
+  border-right: 1px solid #eee;
+  min-width: 2em;
+  height: 100%;
+}
+.CodeMirror-gutter-text {
+  color: #aaa;
+  text-align: right;
+  padding: .4em .2em .4em .4em;
+}
+.CodeMirror-lines {
+  padding: .4em;
+}
+
+.CodeMirror pre 
+{
+  -moz-border-radius: 0;
+  -webkit-border-radius: 0;
+  -o-border-radius: 0;
+  border-radius: 0;
+  border-width: 0; margin: 0; padding: 0; background: transparent;
+  font-family: inherit;
+}
+
+.CodeMirror-cursor {
+  z-index: 10;
+  position: absolute;
+  visibility: hidden;
+  border-left: 1px solid black !important;
+}
+.CodeMirror-focused .CodeMirror-cursor {
+  visibility: visible;
+}
+
+span.CodeMirror-selected {
+  background: #ccc !important;
+  color: HighlightText !important;
+}
+.CodeMirror-focused span.CodeMirror-selected {
+  background: Highlight !important;
+}
+
+
+.CodeMirror-matchingbracket {color: #0f0 !important;}
+.CodeMirror-nonmatchingbracket {color: #f22 !important;}

From be4f208222e89f32c61b894d3c893109b18c9b39 Mon Sep 17 00:00:00 2001
From: Sebastien Ros 
Date: Tue, 29 Mar 2011 11:27:18 -0700
Subject: [PATCH 06/10] Removing margin in html code editor

--HG--
branch : 1.x
---
 .../Styles/orchard-designertools-shapetracing.css            | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/orchard-designertools-shapetracing.css b/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/orchard-designertools-shapetracing.css
index f16562be5..d863127b1 100644
--- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/orchard-designertools-shapetracing.css
+++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/orchard-designertools-shapetracing.css
@@ -91,10 +91,13 @@ button.create-template, button.create-template:hover, background-image:hover {
 }
 
 #shape-tracing-container .shape-tracing-meta-content {
-    padding:8px 0 30px 0;
     overflow:auto;
 }
 
+#shape-tracing-container .shape, #shape-tracing-container .model {
+    padding:8px 0 30px 0;
+}
+
 #shape-tracing-container .model, #shape-tracing-container .shape {
     padding-left:30px;
 }

From 200f44fb699c7cc0b6da492638dd134cb1bdb8d2 Mon Sep 17 00:00:00 2001
From: jowall 
Date: Tue, 29 Mar 2011 11:44:39 -0700
Subject: [PATCH 07/10] Added visibility icon to .widgets-this-layer class on
 widgets screen.

--HG--
branch : 1.x
---
 .../Modules/Orchard.Widgets/Styles/orchard-widgets-admin.css   | 3 ++-
 src/Orchard.Web/Themes/TheAdmin/Styles/site.css                | 3 ---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Styles/orchard-widgets-admin.css b/src/Orchard.Web/Modules/Orchard.Widgets/Styles/orchard-widgets-admin.css
index e2be5e593..79cf0e45c 100644
--- a/src/Orchard.Web/Modules/Orchard.Widgets/Styles/orchard-widgets-admin.css
+++ b/src/Orchard.Web/Modules/Orchard.Widgets/Styles/orchard-widgets-admin.css
@@ -178,12 +178,13 @@ margin-top:0;
 #widgets-layer-visibility li {
 cursor:default;
 }
-#widgets-layer-visibility .widgets-other-layer {
+#widgets-layer-visibility .widgets-other-layer, #widgets-layer-visibility .widgets-this-layer  {
 background-image:url(images/eye.png);
 background-position:5px 11px;
 background-repeat:no-repeat;
 cursor:pointer;
 }
+#widgets-layer-visibility .widgets-this-layer {cursor:default;}
 #widgets-layer-visibility .widgets-other-layer.off, #widgets-layer-visibility .widgets-other-layer.off:hover {
 background-position:5px -17px;
 }
diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css
index 3e6202be9..c337844ce 100644
--- a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css
+++ b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css
@@ -948,9 +948,6 @@ table.items th, table.items td {
 .contentItems .commentcount {
     line-height:2em;
 }
-/*#main .contentItems p {
-    margin:1em 0 0;
-}*/
 
 
 /* Pager

From 06f47d44ddcf824628de7d1ea48612b14711b8be Mon Sep 17 00:00:00 2001
From: Sebastien Ros 
Date: Tue, 29 Mar 2011 12:14:41 -0700
Subject: [PATCH 08/10] Initializing shells in warmup to speed up the first
 dynamic query

--HG--
branch : 1.x
---
 src/Orchard.Startup/Starter.cs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/Orchard.Startup/Starter.cs b/src/Orchard.Startup/Starter.cs
index 3c090bc3f..cb8b4b3bc 100644
--- a/src/Orchard.Startup/Starter.cs
+++ b/src/Orchard.Startup/Starter.cs
@@ -57,6 +57,12 @@ namespace Orchard.Startup {
                         // Execute pending actions as the host is available
                         WarmupHttpModule.Signal();
                     }
+
+                    // initialize shells to speed up the first dynamic query
+                    if (_host != null) {
+                        _host.BeginRequest();
+                        _host.EndRequest();
+                    }
                 });
         }
     }

From 8e61b21a63eb5e97b5396fb8cc4b3cf0892148ce Mon Sep 17 00:00:00 2001
From: jowall 
Date: Tue, 29 Mar 2011 12:28:20 -0700
Subject: [PATCH 09/10] Removed "green flash" from features screen.

--HG--
branch : 1.x
---
 .../Modules/Orchard.Modules/styles/orchard-modules-admin.css  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/Orchard.Web/Modules/Orchard.Modules/styles/orchard-modules-admin.css b/src/Orchard.Web/Modules/Orchard.Modules/styles/orchard-modules-admin.css
index 0f96d0946..11bbc116d 100644
--- a/src/Orchard.Web/Modules/Orchard.Modules/styles/orchard-modules-admin.css
+++ b/src/Orchard.Web/Modules/Orchard.Modules/styles/orchard-modules-admin.css
@@ -4,6 +4,10 @@
 #main .features h3 {
     padding:0 3em 0 0;
 }
+html.dyn #main ul.features button 
+{
+    display:none;
+}
 #otherActionsBar {
     clear: both;
     border-top-width: thin;

From f966a2d369306a849f3381217ae44deb87b95be5 Mon Sep 17 00:00:00 2001
From: Sebastien Ros 
Date: Tue, 29 Mar 2011 12:34:19 -0700
Subject: [PATCH 10/10] #17597: Fixing shape tracing conflict with
 DateTimeRelative shape Work Items:17597

--HG--
branch : 1.x
---
 .../Orchard.DesignerTools/Services/ShapeTracingFactory.cs      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs b/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs
index 19e3b4f25..e7ef2cec3 100644
--- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs
+++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs
@@ -60,7 +60,8 @@ namespace Orchard.DesignerTools.Services {
                 && context.ShapeType != "DocumentZone"
                 && context.ShapeType != "PlaceChildContent"
                 && context.ShapeType != "ContentZone"
-                && context.ShapeType != "ShapeTracingMeta") {
+                && context.ShapeType != "ShapeTracingMeta"
+                && context.ShapeType != "DateTimeRelative") {
 
                 var shapeMetadata = (ShapeMetadata)context.Shape.Metadata;
                 var currentTheme = _themeManager.GetRequestTheme(_workContext.HttpContext.Request.RequestContext);