mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge
--HG-- branch : 1.x
This commit is contained in:
@@ -57,6 +57,12 @@ namespace Orchard.Startup {
|
|||||||
// Execute pending actions as the host is available
|
// Execute pending actions as the host is available
|
||||||
WarmupHttpModule.Signal();
|
WarmupHttpModule.Signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// initialize shells to speed up the first dynamic query
|
||||||
|
if (_host != null) {
|
||||||
|
_host.BeginRequest();
|
||||||
|
_host.EndRequest();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,15 +20,15 @@ var CodeMirror = (function() {
|
|||||||
// This mess creates the base DOM structure for the editor.
|
// This mess creates the base DOM structure for the editor.
|
||||||
wrapper.innerHTML =
|
wrapper.innerHTML =
|
||||||
'<div style="position: relative">' + // Set to the height of the text, causes scrolling
|
'<div style="position: relative">' + // Set to the height of the text, causes scrolling
|
||||||
'<pre style="position: absolute; visibility: hidden">' + // To measure line/char size
|
'<pre style="position: relative; height: 0; visibility: hidden; overflow: hidden;">' + // To measure line/char size
|
||||||
'<span>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span></pre>' +
|
'<span>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span></pre>' +
|
||||||
'<div style="position: absolute">' + // Moved around its parent to cover visible view
|
'<div style="position: relative">' + // Moved around its parent to cover visible view
|
||||||
'<div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div>' +
|
'<div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div>' +
|
||||||
'<div style="overflow: hidden; position: absolute; width: 0; left: 0">' + // Wraps and hides input textarea
|
'<div style="overflow: hidden; position: absolute; width: 0; left: 0">' + // Wraps and hides input textarea
|
||||||
'<textarea style="height: 1px; position: absolute;" wrap="off"></textarea></div>' +
|
'<textarea style="height: 1px; position: absolute; width: 1px;" wrap="off"></textarea></div>' +
|
||||||
// Provides positioning relative to (visible) text origin
|
// Provides positioning relative to (visible) text origin
|
||||||
'<div class="CodeMirror-lines"><div style="position: relative">' +
|
'<div class="CodeMirror-lines"><div style="position: relative">' +
|
||||||
'<pre class="CodeMirror-cursor"> </pre>' + // Absolutely positioned blinky cursor
|
'<pre class="CodeMirror-cursor"> </pre>' + // Absolutely positioned blinky cursor
|
||||||
'<div></div></div></div></div></div>'; // This DIV contains the actual code
|
'<div></div></div></div></div></div>'; // This DIV contains the actual code
|
||||||
if (place.appendChild) place.appendChild(wrapper); else place(wrapper);
|
if (place.appendChild) place.appendChild(wrapper); else place(wrapper);
|
||||||
// I've never seen more elegant code in my life.
|
// I've never seen more elegant code in my life.
|
||||||
@@ -59,9 +59,9 @@ var CodeMirror = (function() {
|
|||||||
var shiftSelecting, reducedSelection;
|
var shiftSelecting, reducedSelection;
|
||||||
// Variables used by startOperation/endOperation to track what
|
// Variables used by startOperation/endOperation to track what
|
||||||
// happened during the operation.
|
// 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).
|
// 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
|
// editing will hold an object describing the things we put in the
|
||||||
// textarea, to help figure out whether something changed.
|
// textarea, to help figure out whether something changed.
|
||||||
// bracketHighlighted is used to remember that a backet has been
|
// bracketHighlighted is used to remember that a backet has been
|
||||||
@@ -75,12 +75,16 @@ var CodeMirror = (function() {
|
|||||||
|
|
||||||
// Register our event handlers.
|
// Register our event handlers.
|
||||||
connect(wrapper, "mousedown", operation(onMouseDown));
|
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(code, "dblclick", operation(onDblClick));
|
||||||
connect(wrapper, "scroll", function() {updateDisplay(); if (options.onScroll) options.onScroll(instance);});
|
connect(wrapper, "scroll", function() {updateDisplay([]); if (options.onScroll) options.onScroll(instance);});
|
||||||
connect(window, "resize", updateDisplay);
|
connect(window, "resize", function() {updateDisplay(true);});
|
||||||
connect(input, "keyup", operation(onKeyUp));
|
connect(input, "keyup", operation(onKeyUp));
|
||||||
connect(input, "keydown", operation(onKeyDown));
|
connect(input, "keydown", operation(onKeyDown));
|
||||||
connect(input, "keypress", onKeyPress);
|
connect(input, "keypress", operation(onKeyPress));
|
||||||
connect(input, "focus", onFocus);
|
connect(input, "focus", onFocus);
|
||||||
connect(input, "blur", onBlur);
|
connect(input, "blur", onBlur);
|
||||||
|
|
||||||
@@ -89,6 +93,7 @@ var CodeMirror = (function() {
|
|||||||
connect(wrapper, "drop", operation(onDrop));
|
connect(wrapper, "drop", operation(onDrop));
|
||||||
connect(wrapper, "paste", function(){input.focus(); fastPoll();});
|
connect(wrapper, "paste", function(){input.focus(); fastPoll();});
|
||||||
connect(input, "paste", function(){fastPoll();});
|
connect(input, "paste", function(){fastPoll();});
|
||||||
|
connect(input, "cut", function(){fastPoll();});
|
||||||
|
|
||||||
if (document.activeElement == input) onFocus();
|
if (document.activeElement == input) onFocus();
|
||||||
else onBlur();
|
else onBlur();
|
||||||
@@ -125,15 +130,22 @@ var CodeMirror = (function() {
|
|||||||
return pageCoords(start ? sel.from : sel.to);
|
return pageCoords(start ? sel.from : sel.to);
|
||||||
},
|
},
|
||||||
charCoords: function(pos){return pageCoords(clipPos(pos));},
|
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);},
|
getSearchCursor: function(query, pos, caseFold) {return new SearchCursor(query, pos, caseFold);},
|
||||||
markText: operation(function(a, b, c){return operation(markText(a, b, c));}),
|
markText: operation(function(a, b, c){return operation(markText(a, b, c));}),
|
||||||
setMarker: addGutterMarker,
|
setMarker: addGutterMarker,
|
||||||
clearMarker: removeGutterMarker,
|
clearMarker: removeGutterMarker,
|
||||||
|
setLineClass: operation(setLineClass),
|
||||||
lineInfo: lineInfo,
|
lineInfo: lineInfo,
|
||||||
addWidget: function(pos, node, scroll) {
|
addWidget: function(pos, node, scroll) {
|
||||||
var pos = localCoords(clipPos(pos), true);
|
var pos = localCoords(clipPos(pos), true);
|
||||||
node.style.top = pos.yBot + "px"; node.style.left = pos.x + "px";
|
node.style.top = (showingFrom * lineHeight() + pos.yBot + paddingTop()) + "px";
|
||||||
lineSpace.appendChild(node);
|
node.style.left = (pos.x + paddingLeft()) + "px";
|
||||||
|
code.appendChild(node);
|
||||||
if (scroll)
|
if (scroll)
|
||||||
scrollIntoView(pos.x, pos.yBot, pos.x + node.offsetWidth, pos.yBot + node.offsetHeight);
|
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));},
|
getRange: function(from, to) {return getRange(clipPos(from), clipPos(to));},
|
||||||
|
|
||||||
operation: function(f){return operation(f)();},
|
operation: function(f){return operation(f)();},
|
||||||
refresh: function(){updateDisplay([{from: 0, to: lines.length}]);},
|
refresh: function(){updateDisplay(true);},
|
||||||
getInputField: function(){return input;},
|
getInputField: function(){return input;},
|
||||||
getWrapperElement: function(){return wrapper;}
|
getWrapperElement: function(){return wrapper;}
|
||||||
};
|
};
|
||||||
@@ -188,12 +200,13 @@ var CodeMirror = (function() {
|
|||||||
return e.stop();
|
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
|
// For button 1, if it was clicked inside the editor
|
||||||
// (posFromMouse returning non-null), we have to adjust the
|
// (posFromMouse returning non-null), we have to adjust the
|
||||||
// selection.
|
// selection.
|
||||||
var start = posFromMouse(e), last = start, going;
|
var start = posFromMouse(e), last = start, going;
|
||||||
if (!start) {if (e.target() == wrapper) e.stop(); return;}
|
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);
|
setCursor(start.line, start.ch, false);
|
||||||
|
|
||||||
if (!focused) onFocus();
|
if (!focused) onFocus();
|
||||||
@@ -221,7 +234,6 @@ var CodeMirror = (function() {
|
|||||||
var move = connect(document, "mousemove", operation(function(e) {
|
var move = connect(document, "mousemove", operation(function(e) {
|
||||||
clearTimeout(going);
|
clearTimeout(going);
|
||||||
e.stop();
|
e.stop();
|
||||||
if (!e.button()) {end(); return;}
|
|
||||||
extend(e);
|
extend(e);
|
||||||
}), true);
|
}), true);
|
||||||
var up = connect(document, "mouseup", operation(function(e) {
|
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 == 36 || code == 35)) {scrollEnd(code == 36); return e.stop();} // ctrl-home/end
|
||||||
if (mod && code == 65) {selectAll(); return e.stop();} // ctrl-a
|
if (mod && code == 65) {selectAll(); return e.stop();} // ctrl-a
|
||||||
if (!options.readOnly) {
|
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 (!anyMod && code == 9 && handleTab(e.e.shiftKey)) return e.stop(); // tab
|
||||||
if (mod && code == 90) {undo(); return e.stop();} // ctrl-z
|
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
|
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
|
// its start when it is inverted and a movement key is pressed
|
||||||
// (and later restore it again), shouldn't be used for
|
// (and later restore it again), shouldn't be used for
|
||||||
// non-movement keys.
|
// non-movement keys.
|
||||||
var id = (mod ? "c" : "") + code;
|
curKeyId = (mod ? "c" : "") + code;
|
||||||
if (sel.inverted && movementKeys.hasOwnProperty(id)) {
|
if (sel.inverted && movementKeys.hasOwnProperty(curKeyId)) {
|
||||||
var range = selRange(input);
|
var range = selRange(input);
|
||||||
if (range) {
|
if (range) {
|
||||||
reducedSelection = {anchor: range.start};
|
reducedSelection = {anchor: range.start};
|
||||||
setSelRange(input, range.start, range.start);
|
setSelRange(input, range.start, range.start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fastPoll(id);
|
fastPoll(curKeyId);
|
||||||
}
|
}
|
||||||
function onKeyUp(e) {
|
function onKeyUp(e) {
|
||||||
if (reducedSelection) {
|
if (reducedSelection) {
|
||||||
@@ -314,7 +326,9 @@ var CodeMirror = (function() {
|
|||||||
}
|
}
|
||||||
var code = e.e.keyCode;
|
var code = e.e.keyCode;
|
||||||
// Re-stop tab and enter. Necessary on some browsers.
|
// 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() {
|
function onFocus() {
|
||||||
@@ -453,7 +467,9 @@ var CodeMirror = (function() {
|
|||||||
return getRange(sel.from, sel.to);
|
return getRange(sel.from, sel.to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var pollingFast = false; // Ensures slowPoll doesn't cancel fastPoll
|
||||||
function slowPoll() {
|
function slowPoll() {
|
||||||
|
if (pollingFast) return;
|
||||||
poll.set(2000, function() {
|
poll.set(2000, function() {
|
||||||
startOperation();
|
startOperation();
|
||||||
readInput();
|
readInput();
|
||||||
@@ -462,14 +478,14 @@ var CodeMirror = (function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function fastPoll(keyId) {
|
function fastPoll(keyId) {
|
||||||
var misses = 0;
|
var missed = false;
|
||||||
|
pollingFast = true;
|
||||||
function p() {
|
function p() {
|
||||||
startOperation();
|
startOperation();
|
||||||
var changed = readInput();
|
var changed = readInput();
|
||||||
if (changed == "moved" && keyId) movementKeys[keyId] = true;
|
if (changed == "moved" && keyId) movementKeys[keyId] = true;
|
||||||
if (changed) {poll.set(80, p); misses = 0;}
|
if (!changed && !missed) {missed = true; poll.set(80, p);}
|
||||||
else if (misses++ < 5) {poll.set(80, p);}
|
else {pollingFast = false; slowPoll();}
|
||||||
else slowPoll();
|
|
||||||
endOperation();
|
endOperation();
|
||||||
}
|
}
|
||||||
poll.set(20, p);
|
poll.set(20, p);
|
||||||
@@ -589,18 +605,21 @@ var CodeMirror = (function() {
|
|||||||
|
|
||||||
function visibleLines() {
|
function visibleLines() {
|
||||||
var lh = lineHeight(), top = wrapper.scrollTop - paddingTop();
|
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))};
|
to: Math.min(lines.length, Math.ceil((top + wrapper.clientHeight) / lh))};
|
||||||
}
|
}
|
||||||
// Uses a set of changes plus the current scroll position to
|
// Uses a set of changes plus the current scroll position to
|
||||||
// determine which DOM updates have to be made, and makes the
|
// determine which DOM updates have to be made, and makes the
|
||||||
// updates.
|
// updates.
|
||||||
function updateDisplay(changes) {
|
function updateDisplay(changes) {
|
||||||
if (!wrapper.clientWidth) return;
|
if (!wrapper.clientWidth) {
|
||||||
|
showingFrom = showingTo = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
// First create a range of theoretically intact lines, and punch
|
// First create a range of theoretically intact lines, and punch
|
||||||
// holes in that using the change info.
|
// holes in that using the change info.
|
||||||
var intact = [{from: showingFrom, to: showingTo, domStart: 0}];
|
var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}];
|
||||||
for (var i = 0, l = changes ? changes.length : 0; i < l; ++i) {
|
for (var i = 0, l = changes.length || 0; i < l; ++i) {
|
||||||
var change = changes[i], intact2 = [], diff = change.diff || 0;
|
var change = changes[i], intact2 = [], diff = change.diff || 0;
|
||||||
for (var j = 0, l2 = intact.length; j < l2; ++j) {
|
for (var j = 0, l2 = intact.length; j < l2; ++j) {
|
||||||
var range = intact[j];
|
var range = intact[j];
|
||||||
@@ -655,10 +674,11 @@ var CodeMirror = (function() {
|
|||||||
|
|
||||||
// Position the mover div to align with the lines it's supposed
|
// Position the mover div to align with the lines it's supposed
|
||||||
// to be showing (which will cover the visible display)
|
// 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;
|
showingFrom = from; showingTo = to;
|
||||||
mover.style.top = (from * lineHeight()) + "px";
|
mover.style.top = (from * lineHeight()) + "px";
|
||||||
if (different) {
|
if (different) {
|
||||||
|
lastHeight = wrapper.clientHeight;
|
||||||
code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px";
|
code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px";
|
||||||
updateGutter();
|
updateGutter();
|
||||||
}
|
}
|
||||||
@@ -723,6 +743,7 @@ var CodeMirror = (function() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
node.innerHTML = lines[j].getHTML(ch1, ch2, false);
|
node.innerHTML = lines[j].getHTML(ch1, ch2, false);
|
||||||
|
node.className = lines[j].className || "";
|
||||||
node = node.nextSibling;
|
node = node.nextSibling;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -732,7 +753,8 @@ var CodeMirror = (function() {
|
|||||||
|
|
||||||
function updateGutter() {
|
function updateGutter() {
|
||||||
if (!options.gutter && !options.lineNumbers) return;
|
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 = [];
|
var html = [];
|
||||||
for (var i = showingFrom; i < showingTo; ++i) {
|
for (var i = showingFrom; i < showingTo; ++i) {
|
||||||
var marker = lines[i].gutterMarker;
|
var marker = lines[i].gutterMarker;
|
||||||
@@ -877,9 +899,10 @@ var CodeMirror = (function() {
|
|||||||
if (n) indentation = lines[n-1].indentation();
|
if (n) indentation = lines[n-1].indentation();
|
||||||
else indentation = 0;
|
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 == "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;
|
var diff = indentation - curSpace;
|
||||||
|
|
||||||
if (!diff) {
|
if (!diff) {
|
||||||
@@ -950,6 +973,20 @@ var CodeMirror = (function() {
|
|||||||
line.gutterMarker = null;
|
line.gutterMarker = null;
|
||||||
updateGutter();
|
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) {
|
function lineInfo(line) {
|
||||||
if (typeof line == "number") {
|
if (typeof line == "number") {
|
||||||
var n = line;
|
var n = line;
|
||||||
@@ -1007,7 +1044,7 @@ var CodeMirror = (function() {
|
|||||||
function lineHeight() {
|
function lineHeight() {
|
||||||
var nlines = lineDiv.childNodes.length;
|
var nlines = lineDiv.childNodes.length;
|
||||||
if (nlines) return lineDiv.offsetHeight / nlines;
|
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 charWidth() {return (measure.firstChild.offsetWidth || 320) / 40;}
|
||||||
function paddingTop() {return lineSpace.offsetTop;}
|
function paddingTop() {return lineSpace.offsetTop;}
|
||||||
@@ -1023,6 +1060,29 @@ var CodeMirror = (function() {
|
|||||||
var line = showingFrom + Math.floor(y / lineHeight());
|
var line = showingFrom + Math.floor(y / lineHeight());
|
||||||
return clipPos({line: line, ch: charFromX(clipLine(line), x)});
|
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
|
// Cursor-blinking
|
||||||
function restartBlink() {
|
function restartBlink() {
|
||||||
@@ -1153,7 +1213,7 @@ var CodeMirror = (function() {
|
|||||||
|
|
||||||
// updateInput can be set to a boolean value to force/prevent an
|
// updateInput can be set to a boolean value to force/prevent an
|
||||||
// update.
|
// update.
|
||||||
if (updateInput === true || (updateInput !== false && selectionChanged))
|
if (!leaveInputAlone && (updateInput === true || (updateInput !== false && selectionChanged)))
|
||||||
prepareInput();
|
prepareInput();
|
||||||
|
|
||||||
if (selectionChanged && options.onCursorActivity)
|
if (selectionChanged && options.onCursorActivity)
|
||||||
@@ -1332,6 +1392,18 @@ var CodeMirror = (function() {
|
|||||||
}
|
}
|
||||||
return mfactory(options, config);
|
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) {
|
CodeMirror.fromTextArea = function(textarea, options) {
|
||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
@@ -1452,7 +1524,7 @@ var CodeMirror = (function() {
|
|||||||
this.styles = styles || [text, null];
|
this.styles = styles || [text, null];
|
||||||
this.stateAfter = null;
|
this.stateAfter = null;
|
||||||
this.text = text;
|
this.text = text;
|
||||||
this.marked = null; this.gutterMarker = null;
|
this.marked = this.gutterMarker = this.className = null;
|
||||||
}
|
}
|
||||||
Line.prototype = {
|
Line.prototype = {
|
||||||
// Replace a piece of a line, keeping the styles around it intact.
|
// 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,
|
// Produces an HTML fragment for the line, taking selection,
|
||||||
// marking, and highlighting into account.
|
// marking, and highlighting into account.
|
||||||
getHTML: function(sfrom, sto, includePre) {
|
getHTML: function(sfrom, sto, includePre) {
|
||||||
var html = includePre ? ["<pre>"] : [];
|
var html = [];
|
||||||
|
if (includePre)
|
||||||
|
html.push(this.className ? '<pre class="' + this.className + '">': "<pre>");
|
||||||
function span(text, style) {
|
function span(text, style) {
|
||||||
if (!text) return;
|
if (!text) return;
|
||||||
if (style) html.push('<span class="', style, '">', htmlEscape(text), "</span>");
|
if (style) html.push('<span class="', style, '">', htmlEscape(text), "</span>");
|
||||||
@@ -1698,6 +1772,8 @@ var CodeMirror = (function() {
|
|||||||
pre.innerHTML = " "; return !pre.innerHTML;
|
pre.innerHTML = " "; return !pre.innerHTML;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
var gecko = /gecko\/\d{7}/i.test(navigator.userAgent);
|
||||||
|
|
||||||
var lineSep = "\n";
|
var lineSep = "\n";
|
||||||
// Feature-detect whether newlines in textareas are converted to \r\n
|
// Feature-detect whether newlines in textareas are converted to \r\n
|
||||||
(function () {
|
(function () {
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
function functiondef(type, value) {
|
function functiondef(type, value) {
|
||||||
if (type == "variable") {register(value); return cont(functiondef);}
|
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) {
|
function funarg(type, value) {
|
||||||
if (type == "variable") {register(value); return cont();}
|
if (type == "variable") {register(value); return cont();}
|
||||||
|
|||||||
@@ -60,7 +60,8 @@ namespace Orchard.DesignerTools.Services {
|
|||||||
&& context.ShapeType != "DocumentZone"
|
&& context.ShapeType != "DocumentZone"
|
||||||
&& context.ShapeType != "PlaceChildContent"
|
&& context.ShapeType != "PlaceChildContent"
|
||||||
&& context.ShapeType != "ContentZone"
|
&& context.ShapeType != "ContentZone"
|
||||||
&& context.ShapeType != "ShapeTracingMeta") {
|
&& context.ShapeType != "ShapeTracingMeta"
|
||||||
|
&& context.ShapeType != "DateTimeRelative") {
|
||||||
|
|
||||||
var shapeMetadata = (ShapeMetadata)context.Shape.Metadata;
|
var shapeMetadata = (ShapeMetadata)context.Shape.Metadata;
|
||||||
var currentTheme = _themeManager.GetRequestTheme(_workContext.HttpContext.Request.RequestContext);
|
var currentTheme = _themeManager.GetRequestTheme(_workContext.HttpContext.Request.RequestContext);
|
||||||
|
|||||||
@@ -1,50 +1,55 @@
|
|||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
line-height: 1em;
|
line-height: 1em;
|
||||||
font-family: Consolas, Monospace;
|
font-family: Consolas, Monospace;
|
||||||
font-size:10pt;
|
font-size:10pt;
|
||||||
_position: relative; /* IE6 hack */
|
_position: relative; /* IE6 hack */
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-gutter {
|
.CodeMirror-gutter {
|
||||||
position: absolute; left: 0; top: 0;
|
position: absolute; left: 0; top: 0;
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
border-right: 1px solid #eee;
|
border-right: 1px solid #eee;
|
||||||
min-width: 2em;
|
min-width: 2em;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.CodeMirror-gutter-text {
|
.CodeMirror-gutter-text {
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding: .4em .2em .4em .4em;
|
padding: .4em .2em .4em .4em;
|
||||||
}
|
}
|
||||||
.CodeMirror-lines {
|
.CodeMirror-lines {
|
||||||
padding: .4em;
|
padding: .4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror pre {
|
.CodeMirror pre
|
||||||
border-width: 0; margin: 0; padding: 0; background: transparent;
|
{
|
||||||
font-family: inherit;
|
-moz-border-radius: 0;
|
||||||
}
|
-webkit-border-radius: 0;
|
||||||
|
-o-border-radius: 0;
|
||||||
.CodeMirror-cursor {
|
border-radius: 0;
|
||||||
z-index: 10;
|
border-width: 0; margin: 0; padding: 0; background: transparent;
|
||||||
position: absolute;
|
font-family: inherit;
|
||||||
visibility: hidden;
|
}
|
||||||
border-left: 1px solid black !important;
|
|
||||||
}
|
.CodeMirror-cursor {
|
||||||
.CodeMirror-focused .CodeMirror-cursor {
|
z-index: 10;
|
||||||
visibility: visible;
|
position: absolute;
|
||||||
}
|
visibility: hidden;
|
||||||
|
border-left: 1px solid black !important;
|
||||||
span.CodeMirror-selected {
|
}
|
||||||
background: #ccc !important;
|
.CodeMirror-focused .CodeMirror-cursor {
|
||||||
color: HighlightText !important;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
.CodeMirror-focused span.CodeMirror-selected {
|
|
||||||
background: Highlight !important;
|
span.CodeMirror-selected {
|
||||||
}
|
background: #ccc !important;
|
||||||
|
color: HighlightText !important;
|
||||||
|
}
|
||||||
.CodeMirror-matchingbracket {color: #0f0 !important;}
|
.CodeMirror-focused span.CodeMirror-selected {
|
||||||
.CodeMirror-nonmatchingbracket {color: #f22 !important;}
|
background: Highlight !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.CodeMirror-matchingbracket {color: #0f0 !important;}
|
||||||
|
.CodeMirror-nonmatchingbracket {color: #f22 !important;}
|
||||||
|
|||||||
+4
-1
@@ -91,10 +91,13 @@ button.create-template, button.create-template:hover, background-image:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#shape-tracing-container .shape-tracing-meta-content {
|
#shape-tracing-container .shape-tracing-meta-content {
|
||||||
padding:8px 0 30px 0;
|
|
||||||
overflow:auto;
|
overflow:auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#shape-tracing-container .shape, #shape-tracing-container .model {
|
||||||
|
padding:8px 0 30px 0;
|
||||||
|
}
|
||||||
|
|
||||||
#shape-tracing-container .model, #shape-tracing-container .shape {
|
#shape-tracing-container .model, #shape-tracing-container .shape {
|
||||||
padding-left:30px;
|
padding-left:30px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
#main .features h3 {
|
#main .features h3 {
|
||||||
padding:0 3em 0 0;
|
padding:0 3em 0 0;
|
||||||
}
|
}
|
||||||
|
html.dyn #main ul.features button
|
||||||
|
{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
#otherActionsBar {
|
#otherActionsBar {
|
||||||
clear: both;
|
clear: both;
|
||||||
border-top-width: thin;
|
border-top-width: thin;
|
||||||
|
|||||||
@@ -178,12 +178,13 @@ margin-top:0;
|
|||||||
#widgets-layer-visibility li {
|
#widgets-layer-visibility li {
|
||||||
cursor:default;
|
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-image:url(images/eye.png);
|
||||||
background-position:5px 11px;
|
background-position:5px 11px;
|
||||||
background-repeat:no-repeat;
|
background-repeat:no-repeat;
|
||||||
cursor:pointer;
|
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 {
|
#widgets-layer-visibility .widgets-other-layer.off, #widgets-layer-visibility .widgets-other-layer.off:hover {
|
||||||
background-position:5px -17px;
|
background-position:5px -17px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,7 +201,7 @@
|
|||||||
<VisualStudio>
|
<VisualStudio>
|
||||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||||
<WebProjectProperties>
|
<WebProjectProperties>
|
||||||
<UseIIS>True</UseIIS>
|
<UseIIS>False</UseIIS>
|
||||||
<AutoAssignPort>False</AutoAssignPort>
|
<AutoAssignPort>False</AutoAssignPort>
|
||||||
<DevelopmentServerPort>30320</DevelopmentServerPort>
|
<DevelopmentServerPort>30320</DevelopmentServerPort>
|
||||||
<DevelopmentServerVPath>/OrchardLocal</DevelopmentServerVPath>
|
<DevelopmentServerVPath>/OrchardLocal</DevelopmentServerVPath>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -161,7 +161,7 @@ strong {font-weight:600;}
|
|||||||
float:right;
|
float:right;
|
||||||
margin-left:-240px;
|
margin-left:-240px;
|
||||||
width:100%;
|
width:100%;
|
||||||
padding:0 0 74px 0; /*Bottom padding set to footer height*/
|
padding:0 0 70px 0; /*Bottom padding set to footer height*/
|
||||||
}
|
}
|
||||||
#main {
|
#main {
|
||||||
margin-left:260px;
|
margin-left:260px;
|
||||||
@@ -179,9 +179,9 @@ strong {font-weight:600;}
|
|||||||
}
|
}
|
||||||
#footer {
|
#footer {
|
||||||
clear:both;
|
clear:both;
|
||||||
height:74px;
|
height:70px;
|
||||||
position:relative;
|
position:relative;
|
||||||
margin-top:-74px; /*Top margin set negative px of footer height*/
|
margin-top:-70px; /*Top margin set negative px of footer height*/
|
||||||
background:url(images/vinesBackgroundBottom.gif) no-repeat bottom left;
|
background:url(images/vinesBackgroundBottom.gif) no-repeat bottom left;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,18 +329,21 @@ form.link button:hover, button.link:hover {
|
|||||||
color:#aec3ce;
|
color:#aec3ce;
|
||||||
display:block;
|
display:block;
|
||||||
line-height:1.2em;
|
line-height:1.2em;
|
||||||
padding:6px 0 6px 20px;
|
padding:4px 0 6px 20px;
|
||||||
text-decoration:none;
|
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 {
|
#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;
|
color: #fff;
|
||||||
/*CSS3 properties*/
|
/*CSS3 properties*/
|
||||||
border-radius: 3px;
|
-webkit-border-radius: 2px;
|
||||||
-webkit-border-radius: 3px;
|
-moz-border-radius: 2px;
|
||||||
-moz-border-radius: 3px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
/*Tabs*/
|
#menu .menu-admin ul a:hover, #menu .menu-admin ul a:active {background-color:rgba(101,107,85,0.5);}
|
||||||
|
ul.menuItems {margin:6px 0 0 0;}
|
||||||
|
|
||||||
|
/******Tabs******/
|
||||||
#local-navigation {margin:8px 0 -8px 0;}
|
#local-navigation {margin:8px 0 -8px 0;}
|
||||||
|
|
||||||
.localmenu li {
|
.localmenu li {
|
||||||
@@ -375,9 +378,9 @@ form.link button:hover, button.link:hover {
|
|||||||
border: 1px solid #e4e5e6;
|
border: 1px solid #e4e5e6;
|
||||||
|
|
||||||
/*CSS3 properties*/
|
/*CSS3 properties*/
|
||||||
border-radius: 3px;
|
-webkit-border-radius: 2px;
|
||||||
-webkit-border-radius: 3px;
|
-moz-border-radius: 2px;
|
||||||
-moz-border-radius: 3px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
.section-dashboard, .section-new {
|
.section-dashboard, .section-new {
|
||||||
background:#2b2b2b;
|
background:#2b2b2b;
|
||||||
@@ -385,9 +388,9 @@ form.link button:hover, button.link:hover {
|
|||||||
padding:6px 0;
|
padding:6px 0;
|
||||||
|
|
||||||
/*CSS3 properties*/
|
/*CSS3 properties*/
|
||||||
border-radius: 3px;
|
-webkit-border-radius: 2px;
|
||||||
-webkit-border-radius: 3px;
|
-moz-border-radius: 2px;
|
||||||
-moz-border-radius: 3px;
|
border-radius: 2px;
|
||||||
box-shadow: inset 0px 0px 1px rgba(64, 64, 64, 1.0), 1px 1px 1px rgba(54, 54, 65, 1.0);
|
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);
|
-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);
|
-moz-box-shadow: inset 0px 0px 1px rgba(64, 64, 64, 1.0), 1px 1px 1px rgba(54, 54, 65, 1.0);
|
||||||
@@ -652,9 +655,9 @@ button.remove:focus::-moz-focus-inner, .remove.button:focus::-moz-focus-inner {
|
|||||||
color:#ababab;
|
color:#ababab;
|
||||||
cursor:default;
|
cursor:default;
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
box-shadow: none;
|
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
-moz-box-shadow: none;
|
-moz-box-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
.button.grey {
|
.button.grey {
|
||||||
color:#5d615d;
|
color:#5d615d;
|
||||||
@@ -671,7 +674,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)----*/
|
/*----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');
|
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: -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;
|
-webkit-border-radius: 2px;
|
||||||
-moz-border-radius: 2px;
|
-moz-border-radius: 2px;
|
||||||
@@ -708,6 +710,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: -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));
|
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;
|
-webkit-border-radius: 2px;
|
||||||
-moz-border-radius: 2px;
|
-moz-border-radius: 2px;
|
||||||
@@ -943,9 +948,6 @@ table.items th, table.items td {
|
|||||||
.contentItems .commentcount {
|
.contentItems .commentcount {
|
||||||
line-height:2em;
|
line-height:2em;
|
||||||
}
|
}
|
||||||
/*#main .contentItems p {
|
|
||||||
margin:1em 0 0;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
/* Pager
|
/* Pager
|
||||||
|
|||||||
Reference in New Issue
Block a user