Move css, javascript and web images to data so that they can be found by webapp

svn: r22927
This commit is contained in:
Doug Blank
2013-08-28 23:51:42 +00:00
parent 322185b339
commit 92ef108c94
55 changed files with 4 additions and 4 deletions

View File

@@ -0,0 +1,365 @@
/*
* This file has been commented to support Visual Studio Intellisense.
* You should not use this file at runtime inside the browser--it is only
* intended to be used only for design-time IntelliSense. Please use the
* standard jHtmlArea library for all production use.
*/
/*
* jHtmlArea 0.7.0 - WYSIWYG Html Editor jQuery Plugin
* Copyright (c) 2009 Chris Pietschmann
* http://jhtmlarea.codeplex.com
* Licensed under the Microsoft Reciprocal License (Ms-RL)
* http://jhtmlarea.codeplex.com/license
*/
(function($) {
$.fn.htmlarea = function(options) {
/// <summary>
/// 1: (options) - Convert all TextArea DOM Elements to be displayed as jHtmlArea WYSIWYG Editors.
/// 2: (string, arguments) - This function accepts a string containing the method name that you want to execute against the jHtmlArea object.
/// </summary>
/// <param name="options" type="Object">
/// 1: options - The custom options you want applied to the jHtmlArea's that are created.
/// 2: string - The name of the jHtmlArea object method to be executed. The results of the method call are then returned instead of the jQuery object.
/// </param>
};
var jHtmlArea = window.jHtmlArea = function(elem, options) {
/// <summary>
/// Converts the passed in TextArea DOM Element to a jHtmlArea WYSIWYG Editor.
/// </summary>
/// <param name="elem" type="TextArea DOM Element">
/// The TextArea DOM Element to be converted to a jHtmlArea WYSIWYG Editor. Required.
/// </param>
/// <param name="options" type="Object">
/// The custom options you want applied to the jHtmlArea that is created. Optional.
/// </param>
/// <field name="defaultOptions" Type="Object">
/// The Default Options that are used for configuring the jHtmlArea WYSIWYG Editor upon creation.
/// </field>
/// <returns type="jHtmlArea" />
};
jHtmlArea.fn = jHtmlArea.prototype = {
// The current version of jHtmlArea being used
jhtmlarea: "0.7.0",
init: function(elem, options) {
/// <summary>
/// Converts the passed in TextArea DOM Element to a jHtmlArea WYSIWYG Editor.
/// </summary>
/// <param name="elem" type="TextArea DOM Element">
/// Required. The TextArea DOM Element to be converted to a jHtmlArea WYSIWYG Editor.
/// </param>
/// <param name="options" type="Object">
/// Optional. The custom options you want applied to the jHtmlArea that is created.
/// </param>
/// <returns type="jHtmlArea" />
},
execCommand: function(a, b, c) {
/// <summary>
/// Executes a command on the current document, current selection, or the given range.
/// </summary>
/// <param name="a" type="String">
/// Required. String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
/// </param>
/// <param name="b" type="Boolean">
/// Optional. Boolean that specifies one of the following values:
/// "false" = Default. Do not display a user interface. Must be combined with vValue, if the command requires a value.
/// "true" = Display a user interface if the command supports one.
/// </param>
/// <param name="c" type="Object">
/// Optional. Variant that specifies the string, number, or other value to assign. Possible values depend on the command.
/// </param>
},
ec: function(a, b, c) {
/// <summary>
/// Executes a command on the current document, current selection, or the given range. An alias for the "execCommand" method.
/// </summary>
/// <param name="a" type="String">
/// Required. String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
/// </param>
/// <param name="b" type="Boolean">
/// Optional. Boolean that specifies one of the following values:
/// "false" = Default. Do not display a user interface. Must be combined with vValue, if the command requires a value.
/// "true" = Display a user interface if the command supports one.
/// </param>
/// <param name="c" type="Object">
/// Optional. Variant that specifies the string, number, or other value to assign. Possible values depend on the command.
/// </param>
},
queryCommandValue: function(a) {
/// <summary>
/// Returns the current value of the document, range, or current selection for the given command.
/// </summary>
/// <param name="a" type="String">
/// Required. String that specifies a command identifier.
/// </param>
/// <returns type="Variant" />
},
qc: function(a) {
/// <summary>
/// Returns the current value of the document, range, or current selection for the given command. An alias for the "queryCommandValue" method.
/// </summary>
/// <param name="a" type="String">
/// Required. String that specifies a command identifier.
/// </param>
/// <returns type="Variant" />
},
getSelectedHTML: function() {
/// <summary>
/// Returns the HTML that is currently selected within the editor.
/// </summary>
/// <returns type="String" />
},
getSelection: function() {
/// <summary>
/// Returns the Browser Selection object that represents the currently selected region of the editor.
/// </summary>
/// <returns type="Object" />
},
getRange: function() {
/// <summary>
/// Returns the Browser Range object that represents the currently selected region of the editor. (This uses the "getSelection" method internally.)
/// </summary>
/// <returns type="Object" />
},
html: function(v) {
/// <summary>
/// 1: () Returns the HTML text value contained within the editor. 2: (v) Sets the editors value to the HTML text passed in.
/// </summary>
/// <param name="v" type="String">
/// The HTML text to set the editors value to.
/// </param>
},
pasteHTML: function(html) {
/// <summary>
/// Pastes HTML text into the editor, replacing any currently selected text and HTML elements.
/// </summary>
/// <param name="html" type="String">
/// The HTML text to paste/insert.
/// </param>
},
cut: function() {
/// <summary>
/// Copies the current selection to the clipboard and then deletes it.
/// </summary>
},
copy: function() {
/// <summary>
/// Copies the current selection to the clipboard.
/// </summary>
},
paste: function() {
/// <summary>
/// Overwrites the contents of the clipboard on the current selection.
/// </summary>
},
bold: function() {
/// <summary>
/// Toggles the current selection between bold and nonbold.
/// </summary>
},
italic: function() {
/// <summary>
/// Toggles the current selection between italic and nonitalic.
/// </summary>
},
underline: function() {
/// <summary>
/// Toggles the current selection between underlined and not underlined.
/// </summary>
},
strikeThrough: function() {
/// <summary>
/// If there is a selection and all of the characters are already striked, the strikethrough will be removed. Otherwise, all selected characters will have a line drawn through them.
/// </summary>
},
image: function(url) {
/// <summary>
/// This command will insert an image (referenced by url) at the insertion point.
/// If no URL is specified, a prompt will be displayed to the user.
/// </summary>
/// <param name="url" type="String">
/// The URL to the Image to be inserted. If no URL is specified, a prompt will be shown.
/// </param>
},
removeFormat: function() {
/// <summary>
/// Removes the formatting tags from the current selection.
/// </summary>
},
link: function() {
/// <summary>
/// Inserts a hyperlink on the current selection, or displays a dialog box enabling the user to specify a URL to insert as a hyperlink on the current selection.
/// </summary>
},
unlink: function() {
/// <summary>
/// Removes any hyperlink from the current selection.
/// </summary>
},
orderedList: function() {
/// <summary>
/// Converts the text selection into an ordered list.
/// </summary>
},
unorderedList: function() {
/// <summary>
/// Converts the text selection into an unordered list.
/// </summary>
},
superscript: function() {
/// <summary>
/// If there is a selection and all of the characters are already superscripted, the superscript will be removed. Otherwise, all selected characters will be drawn slightly higher than normal text.
/// </summary>
},
subscript: function() {
/// <summary>
/// If there is a selection and all of the characters are already subscripted, the subscript will be removed. Otherwise, all selected characters will be drawn slightly lower than normal text.
/// </summary>
},
p: function() {
/// <summary>
/// Sets the current block format tag to <P>.
/// </summary>
},
h1: function() {
/// <summary>
/// Sets the current block format tag to <H1>.
/// </summary>
},
h2: function() {
/// <summary>
/// Sets the current block format tag to <H2>.
/// </summary>
},
h3: function() {
/// <summary>
/// Sets the current block format tag to <H3>.
/// </summary>
},
h4: function() {
/// <summary>
/// Sets the current block format tag to <H4>.
/// </summary>
},
h5: function() {
/// <summary>
/// Sets the current block format tag to <H5>.
/// </summary>
},
h6: function() {
/// <summary>
/// Sets the current block format tag to <H6>.
/// </summary>
},
heading: function(h) {
/// <summary>
/// Sets the current block format tag to <H?> tag.
/// Example: Calling jHtmlArea.heading(2) will be the same as calling jHtmlArea.h2()
/// </summary>
/// <param name="h" type="Number">
/// The Number of Header (<H?>) tag to format the current block with.
/// For Example: Passing a 2 or "2" will cause the current block to be formatted with a <H2> tag.
/// </param>
},
indent: function() {
/// <summary>
/// Indents the selection or insertion point.
/// </summary>
},
outdent: function() {
/// <summary>
/// Outdents the selection or insertion point.
/// </summary>
},
insertHorizontalRule: function() {
/// <summary>
/// Inserts a horizontal rule at the insertion point (deletes selection).
/// </summary>
},
justifyLeft: function() {
/// <summary>
/// Justifies the selection or insertion point to the left.
/// </summary>
},
justifyCenter: function() {
/// <summary>
/// Centers the selection or insertion point.
/// </summary>
},
justifyRight: function() {
/// <summary>
/// Right-justifies the selection or the insertion point.
/// </summary>
},
increaseFontSize: function() {
/// <summary>
/// Increases the Font Size around the selection or at the insertion point.
/// </summary>
},
decreaseFontSize: function() {
/// <summary>
/// Decreases the Font Size around the selection or at the insertion point.
/// </summary>
},
forecolor: function(c) {
/// <summary>
/// Changes a font color for the selection or at the insertion point. Requires a color value string to be passed in as a value argument.
/// </summary>
},
formatBlock: function(v) {
/// <summary>
/// Sets the current block format tag.
/// </summary>
},
showHTMLView: function() {
/// <summary>
/// Shows the HTML/Source View (TextArea DOM Element) within the Editor and hides the WYSIWYG interface.
/// </summary>
},
hideHTMLView: function() {
/// <summary>
/// Hides the HTML/Source View (TextArea DOM Element) within the Editor and displays the WYSIWYG interface.
/// </summary>
},
toggleHTMLView: function() {
/// <summary>
/// Toggles between HTML/Source View (TextArea DOM Element) and the WYSIWYG interface within the Editor.
/// </summary>
},
toHtmlString: function() {
/// <summary>
/// Returns the HTML text contained within the editor.
/// </summary>
/// <returns type="String" />
},
toString: function() {
/// <summary>
/// Return the Text contained within the editor, with all HTML tags removed.
/// </summary>
/// <returns type="String" />
},
updateTextArea: function() {
/// <summary>
/// Forces the TextArea DOM Element to by sync'd with the contents of the HTML WYSIWYG Editor.
/// </summary>
},
updateHtmlArea: function() {
/// <summary>
/// Forces the HTML WYSIWYG Editor to be sync'd with the contents of the TextArea DOM Element.
/// </summary>
}
};
jHtmlArea.fn.init.prototype = jHtmlArea.fn;
})(jQuery);

View File

@@ -0,0 +1,403 @@
/*
* jHtmlArea 0.7.0 - WYSIWYG Html Editor jQuery Plugin
* Copyright (c) 2009 Chris Pietschmann
* http://jhtmlarea.codeplex.com
* Licensed under the Microsoft Reciprocal License (Ms-RL)
* http://jhtmlarea.codeplex.com/license
*/
(function($) {
$.fn.htmlarea = function(opts) {
if (opts && typeof (opts) === "string") {
var args = [];
for (var i = 1; i < arguments.length; i++) { args.push(arguments[i]); }
var htmlarea = jHtmlArea(this[0]);
var f = htmlarea[opts];
if (f) { return f.apply(htmlarea, args); }
}
return this.each(function() { jHtmlArea(this, opts); });
};
var jHtmlArea = window.jHtmlArea = function(elem, options) {
if (elem.jquery) {
return jHtmlArea(elem[0]);
}
if (elem.jhtmlareaObject) {
return elem.jhtmlareaObject;
} else {
return new jHtmlArea.fn.init(elem, options);
}
};
jHtmlArea.fn = jHtmlArea.prototype = {
// The current version of jHtmlArea being used
jhtmlarea: "0.7.0",
init: function(elem, options) {
if (elem.nodeName.toLowerCase() === "textarea") {
var opts = $.extend({}, jHtmlArea.defaultOptions, options);
elem.jhtmlareaObject = this;
var textarea = this.textarea = $(elem);
var container = this.container = $("<div/>").addClass("jHtmlArea").width(textarea.width()).insertAfter(textarea);
var toolbar = this.toolbar = $("<div/>").addClass("ToolBar").appendTo(container);
priv.initToolBar.call(this, opts);
var iframe = this.iframe = $("<iframe/>").height(textarea.height());
iframe.width(textarea.width() - ($.browser.msie ? 0 : 4));
var htmlarea = this.htmlarea = $("<div/>").append(iframe);
container.append(htmlarea).append(textarea.hide());
priv.initEditor.call(this, opts);
priv.attachEditorEvents.call(this);
// Fix total height to match TextArea
iframe.height(iframe.height() - toolbar.height());
toolbar.width(textarea.width() - 2);
if (opts.loaded) { opts.loaded.call(this); }
}
},
dispose: function() {
this.textarea.show().insertAfter(this.container);
this.container.remove();
this.textarea[0].jhtmlareaObject = null;
},
execCommand: function(a, b, c) {
this.iframe[0].contentWindow.focus();
this.editor.execCommand(a, b || false, c || null);
this.updateTextArea();
},
ec: function(a, b, c) {
this.execCommand(a, b, c);
},
queryCommandValue: function(a) {
this.iframe[0].contentWindow.focus();
return this.editor.queryCommandValue(a);
},
qc: function(a) {
return this.queryCommandValue(a);
},
getSelectedHTML: function() {
if ($.browser.msie) {
return this.getRange().htmlText;
} else {
var elem = this.getRange().cloneContents();
return $("<p/>").append($(elem)).html();
}
},
getSelection: function() {
if ($.browser.msie) {
//return (this.editor.parentWindow.getSelection) ? this.editor.parentWindow.getSelection() : this.editor.selection;
return this.editor.selection;
} else {
return this.iframe[0].contentDocument.defaultView.getSelection();
}
},
getRange: function() {
var s = this.getSelection();
if (!s) { return null; }
//return (s.rangeCount > 0) ? s.getRangeAt(0) : s.createRange();
return (s.getRangeAt) ? s.getRangeAt(0) : s.createRange();
},
html: function(v) {
if (v) {
this.pastHTML(v);
} else {
return toHtmlString();
}
},
pasteHTML: function(html) {
this.iframe[0].contentWindow.focus();
var r = this.getRange();
if ($.browser.msie) {
r.pasteHTML(html);
} else if ($.browser.mozilla) {
r.deleteContents();
r.insertNode($((html.indexOf("<") != 0) ? $("<span/>").append(html) : html)[0]);
} else { // Safari
r.deleteContents();
r.insertNode($(this.iframe[0].contentWindow.document.createElement("span")).append($((html.indexOf("<") != 0) ? "<span>" + html + "</span>" : html))[0]);
}
r.collapse(false);
r.select();
},
cut: function() {
this.ec("cut");
},
copy: function() {
this.ec("copy");
},
paste: function() {
this.ec("paste");
},
bold: function() { this.ec("bold"); },
italic: function() { this.ec("italic"); },
underline: function() { this.ec("underline"); },
strikeThrough: function() { this.ec("strikethrough"); },
image: function(url) {
if ($.browser.msie && !url) {
this.ec("insertImage", true);
} else {
this.ec("insertImage", false, (url || prompt("Image URL:", "http://")));
}
},
removeFormat: function() {
this.ec("removeFormat", false, []);
this.unlink();
},
link: function() {
if ($.browser.msie) {
this.ec("createLink", true);
} else {
this.ec("createLink", false, prompt("Link URL:", "http://"));
}
},
unlink: function() { this.ec("unlink", false, []); },
orderedList: function() { this.ec("insertorderedlist"); },
unorderedList: function() { this.ec("insertunorderedlist"); },
superscript: function() { this.ec("superscript"); },
subscript: function() { this.ec("subscript"); },
p: function() {
this.formatBlock("<p>");
},
h1: function() {
this.heading(1);
},
h2: function() {
this.heading(2);
},
h3: function() {
this.heading(3);
},
h4: function() {
this.heading(4);
},
h5: function() {
this.heading(5);
},
h6: function() {
this.heading(6);
},
heading: function(h) {
this.formatBlock($.browser.msie ? "Heading " + h : "h" + h);
},
indent: function() {
this.ec("indent");
},
outdent: function() {
this.ec("outdent");
},
insertHorizontalRule: function() {
this.ec("insertHorizontalRule", false, "ht");
},
justifyLeft: function() {
this.ec("justifyLeft");
},
justifyCenter: function() {
this.ec("justifyCenter");
},
justifyRight: function() {
this.ec("justifyRight");
},
increaseFontSize: function() {
if ($.browser.msie) {
this.ec("fontSize", false, this.qc("fontSize") + 1);
} else if ($.browser.safari) {
this.getRange().surroundContents($(this.iframe[0].contentWindow.document.createElement("span")).css("font-size", "larger")[0]);
} else {
this.ec("increaseFontSize", false, "big");
}
},
decreaseFontSize: function() {
if ($.browser.msie) {
this.ec("fontSize", false, this.qc("fontSize") - 1);
} else if ($.browser.safari) {
this.getRange().surroundContents($(this.iframe[0].contentWindow.document.createElement("span")).css("font-size", "smaller")[0]);
} else {
this.ec("decreaseFontSize", false, "small");
}
},
forecolor: function(c) {
this.ec("foreColor", false, c || prompt("Enter HTML Color:", "#"));
},
formatBlock: function(v) {
this.ec("formatblock", false, v || null);
},
showHTMLView: function() {
this.updateTextArea();
this.textarea.show();
this.htmlarea.hide();
$("ul li:not(li:has(a.html))", this.toolbar).hide();
$("ul:not(:has(:visible))", this.toolbar).hide();
$("ul li a.html", this.toolbar).addClass("highlighted");
},
hideHTMLView: function() {
this.updateHtmlArea();
this.textarea.hide();
this.htmlarea.show();
$("ul", this.toolbar).show();
$("ul li", this.toolbar).show().find("a.html").removeClass("highlighted");
},
toggleHTMLView: function() {
(this.textarea.is(":hidden")) ? this.showHTMLView() : this.hideHTMLView();
},
toHtmlString: function() {
return this.editor.body.innerHTML;
},
toString: function() {
return this.editor.body.innerText;
},
updateTextArea: function() {
this.textarea.val(this.toHtmlString());
},
updateHtmlArea: function() {
this.editor.body.innerHTML = this.textarea.val();
}
};
jHtmlArea.fn.init.prototype = jHtmlArea.fn;
jHtmlArea.defaultOptions = {
toolbar: [
["html"], ["bold", "italic", "underline", "strikethrough", "|", "subscript", "superscript"],
["increasefontsize", "decreasefontsize"],
["orderedlist", "unorderedlist"],
["indent", "outdent"],
["justifyleft", "justifycenter", "justifyright"],
["link", "unlink", "image", "horizontalrule"],
["p", "h1", "h2", "h3", "h4", "h5", "h6"],
["cut", "copy", "paste"]
],
css: null,
toolbarText: {
bold: "Bold", italic: "Italic", underline: "Underline", strikethrough: "Strike-Through",
cut: "Cut", copy: "Copy", paste: "Paste",
h1: "Heading 1", h2: "Heading 2", h3: "Heading 3", h4: "Heading 4", h5: "Heading 5", h6: "Heading 6", p: "Paragraph",
indent: "Indent", outdent: "Outdent", horizontalrule: "Insert Horizontal Rule",
justifyleft: "Left Justify", justifycenter: "Center Justify", justifyright: "Right Justify",
increasefontsize: "Increase Font Size", decreasefontsize: "Decrease Font Size", forecolor: "Text Color",
link: "Insert Link", unlink: "Remove Link", image: "Insert Image",
orderedlist: "Insert Ordered List", unorderedlist: "Insert Unordered List",
subscript: "Subscript", superscript: "Superscript",
html: "Show/Hide HTML Source View"
}
};
var priv = {
toolbarButtons: {
strikethrough: "strikeThrough", orderedlist: "orderedList", unorderedlist: "unorderedList",
horizontalrule: "insertHorizontalRule",
justifyleft: "justifyLeft", justifycenter: "justifyCenter", justifyright: "justifyRight",
increasefontsize: "increaseFontSize", decreasefontsize: "decreaseFontSize",
html: function(btn) {
this.toggleHTMLView();
}
},
initEditor: function(options) {
var edit = this.editor = this.iframe[0].contentWindow.document;
edit.designMode = 'on';
edit.open();
edit.write(this.textarea.val());
edit.close();
if (options.css) {
var e = edit.createElement('link'); e.rel = 'stylesheet'; e.type = 'text/css'; e.href = options.css; edit.getElementsByTagName('head')[0].appendChild(e);
}
},
initToolBar: function(options) {
var that = this;
var menuItem = function(className, altText, action) {
return $("<li/>").append($("<a href='javascript:void(0);'/>").addClass(className).attr("title", altText).click(function() { action.call(that, $(this)); }));
};
function addButtons(arr) {
var ul = $("<ul/>").appendTo(that.toolbar);
for (var i = 0; i < arr.length; i++) {
var e = arr[i];
if ((typeof (e)).toLowerCase() === "string") {
if (e === "|") {
ul.append($('<li class="separator"/>'));
} else {
var f = (function(e) {
// If button name exists in priv.toolbarButtons then call the "method" defined there, otherwise call the method with the same name
var m = priv.toolbarButtons[e] || e;
if ((typeof (m)).toLowerCase() === "function") {
return function(btn) { m.call(this, btn); };
} else {
return function() { this[m](); this.editor.body.focus(); };
}
})(e.toLowerCase());
var t = options.toolbarText[e.toLowerCase()];
ul.append(menuItem(e.toLowerCase(), t || e, f));
}
} else {
ul.append(menuItem(e.css, e.text, e.action));
}
}
};
if (options.toolbar.length !== 0 && priv.isArray(options.toolbar[0])) {
for (var i = 0; i < options.toolbar.length; i++) {
addButtons(options.toolbar[i]);
}
} else {
addButtons(options.toolbar);
}
},
attachEditorEvents: function() {
var t = this;
var fnHA = function() {
t.updateHtmlArea();
};
this.textarea.click(fnHA).
keyup(fnHA).
keydown(fnHA).
mousedown(fnHA).
blur(fnHA);
var fnTA = function() {
t.updateTextArea();
};
$(this.editor.body).click(fnTA).
keyup(fnTA).
keydown(fnTA).
mousedown(fnTA).
blur(fnTA);
$('form').submit(function() { t.toggleHTMLView(); t.toggleHTMLView(); });
//$(this.textarea[0].form).submit(function() { //this.textarea.closest("form").submit(function() {
// Fix for ASP.NET Postback Model
if (window.__doPostBack) {
var old__doPostBack = __doPostBack;
window.__doPostBack = function() {
if (t) {
if (t.toggleHTMLView) {
t.toggleHTMLView();
t.toggleHTMLView();
}
}
return old__doPostBack.apply(window, arguments);
};
}
},
isArray: function(v) {
return v && typeof v === 'object' && typeof v.length === 'number' && typeof v.splice === 'function' && !(v.propertyIsEnumerable('length'));
}
};
})(jQuery);

View File

@@ -0,0 +1,357 @@
/*
* This file has been commented to support Visual Studio Intellisense.
* You should not use this file at runtime inside the browser--it is only
* intended to be used only for design-time IntelliSense. Please use the
* standard jHtmlArea library for all production use.
*/
/*
* jHtmlArea 0.7.0 - WYSIWYG Html Editor jQuery Plugin
* Copyright (c) 2009 Chris Pietschmann
* http://jhtmlarea.codeplex.com
* Licensed under the Microsoft Reciprocal License (Ms-RL)
* http://jhtmlarea.codeplex.com/license
*/
(function($) {
$.fn.htmlarea = function(options) {
/// <summary>
/// 1: (options) - Convert all TextArea DOM Elements to be displayed as jHtmlArea WYSIWYG Editors.
/// 2: (string, arguments) - This function accepts a string containing the method name that you want to execute against the jHtmlArea object.
/// </summary>
/// <param name="options" type="Object">
/// 1: options - The custom options you want applied to the jHtmlArea's that are created.
/// 2: string - The name of the jHtmlArea object method to be executed. The results of the method call are then returned instead of the jQuery object.
/// </param>
};
var jHtmlArea = window.jHtmlArea = function(elem, options) {
/// <summary>
/// Converts the passed in TextArea DOM Element to a jHtmlArea WYSIWYG Editor.
/// </summary>
/// <param name="elem" type="TextArea DOM Element">
/// The TextArea DOM Element to be converted to a jHtmlArea WYSIWYG Editor. Required.
/// </param>
/// <param name="options" type="Object">
/// The custom options you want applied to the jHtmlArea that is created. Optional.
/// </param>
/// <field name="defaultOptions" Type="Object">
/// The Default Options that are used for configuring the jHtmlArea WYSIWYG Editor upon creation.
/// </field>
/// <returns type="jHtmlArea" />
};
jHtmlArea.fn = jHtmlArea.prototype = {
// The current version of jHtmlArea being used
jhtmlarea: "0.7.0",
init: function(elem, options) {
/// <summary>
/// Converts the passed in TextArea DOM Element to a jHtmlArea WYSIWYG Editor.
/// </summary>
/// <param name="elem" type="TextArea DOM Element">
/// Required. The TextArea DOM Element to be converted to a jHtmlArea WYSIWYG Editor.
/// </param>
/// <param name="options" type="Object">
/// Optional. The custom options you want applied to the jHtmlArea that is created.
/// </param>
/// <returns type="jHtmlArea" />
},
execCommand: function(a, b, c) {
/// <summary>
/// Executes a command on the current document, current selection, or the given range.
/// </summary>
/// <param name="a" type="String">
/// Required. String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
/// </param>
/// <param name="b" type="Boolean">
/// Optional. Boolean that specifies one of the following values:
/// "false" = Default. Do not display a user interface. Must be combined with vValue, if the command requires a value.
/// "true" = Display a user interface if the command supports one.
/// </param>
/// <param name="c" type="Object">
/// Optional. Variant that specifies the string, number, or other value to assign. Possible values depend on the command.
/// </param>
},
ec: function(a, b, c) {
/// <summary>
/// Executes a command on the current document, current selection, or the given range. An alias for the "execCommand" method.
/// </summary>
/// <param name="a" type="String">
/// Required. String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
/// </param>
/// <param name="b" type="Boolean">
/// Optional. Boolean that specifies one of the following values:
/// "false" = Default. Do not display a user interface. Must be combined with vValue, if the command requires a value.
/// "true" = Display a user interface if the command supports one.
/// </param>
/// <param name="c" type="Object">
/// Optional. Variant that specifies the string, number, or other value to assign. Possible values depend on the command.
/// </param>
},
queryCommandValue: function(a) {
/// <summary>
/// Returns the current value of the document, range, or current selection for the given command.
/// </summary>
/// <param name="a" type="String">
/// Required. String that specifies a command identifier.
/// </param>
/// <returns type="Variant" />
},
qc: function(a) {
/// <summary>
/// Returns the current value of the document, range, or current selection for the given command. An alias for the "queryCommandValue" method.
/// </summary>
/// <param name="a" type="String">
/// Required. String that specifies a command identifier.
/// </param>
/// <returns type="Variant" />
},
getSelectedHTML: function() {
/// <summary>
/// Returns the HTML that is currently selected within the editor.
/// </summary>
/// <returns type="String" />
},
getSelection: function() {
/// <summary>
/// Returns the Browser Selection object that represents the currently selected region of the editor.
/// </summary>
/// <returns type="Object" />
},
getRange: function() {
/// <summary>
/// Returns the Browser Range object that represents the currently selected region of the editor. (This uses the "getSelection" method internally.)
/// </summary>
/// <returns type="Object" />
},
pasteHTML: function(html) {
/// <summary>
/// Pastes HTML text into the editor, replacing any currently selected text and HTML elements.
/// </summary>
/// <param name="html" type="String">
/// The HTML text to paste/insert.
/// </param>
},
cut: function() {
/// <summary>
/// Copies the current selection to the clipboard and then deletes it.
/// </summary>
},
copy: function() {
/// <summary>
/// Copies the current selection to the clipboard.
/// </summary>
},
paste: function() {
/// <summary>
/// Overwrites the contents of the clipboard on the current selection.
/// </summary>
},
bold: function() {
/// <summary>
/// Toggles the current selection between bold and nonbold.
/// </summary>
},
italic: function() {
/// <summary>
/// Toggles the current selection between italic and nonitalic.
/// </summary>
},
underline: function() {
/// <summary>
/// Toggles the current selection between underlined and not underlined.
/// </summary>
},
strikeThrough: function() {
/// <summary>
/// If there is a selection and all of the characters are already striked, the strikethrough will be removed. Otherwise, all selected characters will have a line drawn through them.
/// </summary>
},
image: function(url) {
/// <summary>
/// This command will insert an image (referenced by url) at the insertion point.
/// If no URL is specified, a prompt will be displayed to the user.
/// </summary>
/// <param name="url" type="String">
/// The URL to the Image to be inserted. If no URL is specified, a prompt will be shown.
/// </param>
},
removeFormat: function() {
/// <summary>
/// Removes the formatting tags from the current selection.
/// </summary>
},
link: function() {
/// <summary>
/// Inserts a hyperlink on the current selection, or displays a dialog box enabling the user to specify a URL to insert as a hyperlink on the current selection.
/// </summary>
},
unlink: function() {
/// <summary>
/// Removes any hyperlink from the current selection.
/// </summary>
},
orderedList: function() {
/// <summary>
/// Converts the text selection into an ordered list.
/// </summary>
},
unorderedList: function() {
/// <summary>
/// Converts the text selection into an unordered list.
/// </summary>
},
superscript: function() {
/// <summary>
/// If there is a selection and all of the characters are already superscripted, the superscript will be removed. Otherwise, all selected characters will be drawn slightly higher than normal text.
/// </summary>
},
subscript: function() {
/// <summary>
/// If there is a selection and all of the characters are already subscripted, the subscript will be removed. Otherwise, all selected characters will be drawn slightly lower than normal text.
/// </summary>
},
p: function() {
/// <summary>
/// Sets the current block format tag to <P>.
/// </summary>
},
h1: function() {
/// <summary>
/// Sets the current block format tag to <H1>.
/// </summary>
},
h2: function() {
/// <summary>
/// Sets the current block format tag to <H2>.
/// </summary>
},
h3: function() {
/// <summary>
/// Sets the current block format tag to <H3>.
/// </summary>
},
h4: function() {
/// <summary>
/// Sets the current block format tag to <H4>.
/// </summary>
},
h5: function() {
/// <summary>
/// Sets the current block format tag to <H5>.
/// </summary>
},
h6: function() {
/// <summary>
/// Sets the current block format tag to <H6>.
/// </summary>
},
heading: function(h) {
/// <summary>
/// Sets the current block format tag to <H?> tag.
/// Example: Calling jHtmlArea.heading(2) will be the same as calling jHtmlArea.h2()
/// </summary>
/// <param name="h" type="Number">
/// The Number of Header (<H?>) tag to format the current block with.
/// For Example: Passing a 2 or "2" will cause the current block to be formatted with a <H2> tag.
/// </param>
},
indent: function() {
/// <summary>
/// Indents the selection or insertion point.
/// </summary>
},
outdent: function() {
/// <summary>
/// Outdents the selection or insertion point.
/// </summary>
},
insertHorizontalRule: function() {
/// <summary>
/// Inserts a horizontal rule at the insertion point (deletes selection).
/// </summary>
},
justifyLeft: function() {
/// <summary>
/// Justifies the selection or insertion point to the left.
/// </summary>
},
justifyCenter: function() {
/// <summary>
/// Centers the selection or insertion point.
/// </summary>
},
justifyRight: function() {
/// <summary>
/// Right-justifies the selection or the insertion point.
/// </summary>
},
increaseFontSize: function() {
/// <summary>
/// Increases the Font Size around the selection or at the insertion point.
/// </summary>
},
decreaseFontSize: function() {
/// <summary>
/// Decreases the Font Size around the selection or at the insertion point.
/// </summary>
},
forecolor: function(c) {
/// <summary>
/// Changes a font color for the selection or at the insertion point. Requires a color value string to be passed in as a value argument.
/// </summary>
},
formatBlock: function(v) {
/// <summary>
/// Sets the current block format tag.
/// </summary>
},
showHTMLView: function() {
/// <summary>
/// Shows the HTML/Source View (TextArea DOM Element) within the Editor and hides the WYSIWYG interface.
/// </summary>
},
hideHTMLView: function() {
/// <summary>
/// Hides the HTML/Source View (TextArea DOM Element) within the Editor and displays the WYSIWYG interface.
/// </summary>
},
toggleHTMLView: function() {
/// <summary>
/// Toggles between HTML/Source View (TextArea DOM Element) and the WYSIWYG interface within the Editor.
/// </summary>
},
toHtmlString: function() {
/// <summary>
/// Returns the HTML text contained within the editor.
/// </summary>
/// <returns type="String" />
},
toString: function() {
/// <summary>
/// Return the Text contained within the editor, with all HTML tags removed.
/// </summary>
/// <returns type="String" />
},
updateTextArea: function() {
/// <summary>
/// Forces the TextArea DOM Element to by sync'd with the contents of the HTML WYSIWYG Editor.
/// </summary>
},
updateHtmlArea: function() {
/// <summary>
/// Forces the HTML WYSIWYG Editor to be sync'd with the contents of the TextArea DOM Element.
/// </summary>
}
};
jHtmlArea.fn.init.prototype = jHtmlArea.fn;
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,189 @@
/*
* jHtmlAreaColorPickerMenu 0.7.0 - A Color Picker Extension to jHtmlArea
* Part of the jHtmlArea Project
* Copyright (c) 2009 Chris Pietschmann
* http://jhtmlarea.codeplex.com
* Licensed under the Microsoft Reciprocal License (Ms-RL)
* http://jhtmlarea.codeplex.com/license
*/
(function($) {
if (jHtmlArea) {
var oldForecolor = jHtmlArea.fn.forecolor;
jHtmlArea.fn.forecolor = function(c) {
if (c) {
// If color is specified, then use the "default" method functionality
oldForecolor.call(this, c);
} else {
// If no color is specified, then display color picker ui
var that = this;
var rng = this.getRange();
jHtmlAreaColorPickerMenu($(".forecolor", this.toolbar), {
colorChosen: function(color) {
if ($.browser.msie) {
rng.execCommand("ForeColor", false, color);
} else {
that.forecolor(color);
}
}
});
}
};
}
var menu = window.jHtmlAreaColorPickerMenu = function(ownerElement, options) {
return new jHtmlAreaColorPickerMenu.fn.init(ownerElement, options);
};
menu.fn = menu.prototype = {
jhtmlareacolorpickermenu: "0.7.0",
init: function(ownerElement, options) {
var opts = $.extend({}, menu.defaultOptions, options);
var that = this;
var owner = this.owner = $(ownerElement);
var position = owner.position();
if (menu.instance) {
menu.instance.hide();
}
jHtmlAreaColorPickerMenu.instance = this;
var picker = this.picker = $("<div/>").css({
position: "absolute",
left: position.left + opts.offsetLeft,
top: position.top + owner.height() + opts.offsetTop,
"z-index": opts["z-index"]
}).addClass("jHtmlAreaColorPickerMenu");
for (var i = 0; i < opts.colors.length; i++) {
var c = opts.colors[i];
$("<div/>").css("background-color", c).appendTo(picker).click(
(function(color) {
return function() {
if (opts.colorChosen) {
opts.colorChosen.call(this, color);
}
that.hide();
};
})(c)
);
}
$("<div/>").html("<div></div>Automatic").addClass("automatic").appendTo(picker).click(
function() {
if (opts.colorChosen) {
opts.colorChosen.call(this, null);
}
that.hide();
}
);
var autoHide = false;
picker.appendTo(owner.parent()).
show().
mouseout(function() {
autoHide = true;
that.currentTimeout = window.setTimeout(function() { if (autoHide === true) { that.hide(); } }, 1000);
}).
mouseover(function() {
if (that.currentTimeout) {
window.clearTimeout(that.currentTimeout);
that.currentTimeout = null;
}
autoHide = false;
});
},
hide: function() {
this.picker.hide();
this.picker.remove();
}
};
menu.fn.init.prototype = menu.fn;
menu.defaultOptions = {
"z-index": 0,
offsetTop: 0,
offsetLeft: 0,
colors: [
"#ffffff",
"#cccccc",
"#c0c0c0",
"#999999",
"#666666",
"#333333",
"#000000",
"#ffcccc",
"#ff6666",
"#ff0000",
"#cc0000",
"#990000",
"#660000",
"#330000",
"#ffcc99",
"#ff9966",
"#ff9900",
"#ff6600",
"#cc6600",
"#993300",
"#663300",
"#ffff99",
"#ffff66",
"#ffcc66",
"#ffcc33",
"#cc9933",
"#996633",
"#663333",
"#ffffcc",
"#ffff33",
"#ffff00",
"#ffcc00",
"#999900",
"#666600",
"#333300",
"#99ff99",
"#66ff99",
"#33ff33",
"#33cc00",
"#009900",
"#006600",
"#003300",
"#99FFFF",
"#33FFFF",
"#66CCCC",
"#00CCCC",
"#339999",
"#336666",
"#003333",
"#CCFFFF",
"#66FFFF",
"#33CCFF",
"#3366FF",
"#3333FF",
"#000099",
"#000066",
"#CCCCFF",
"#9999FF",
"#6666CC",
"#6633FF",
"#6600CC",
"#333399",
"#330099",
"#FFCCFF",
"#FF99FF",
"#CC66CC",
"#CC33CC",
"#993399",
"#663366",
"#330033"
],
colorChosen: null
};
})(jQuery);

View File

@@ -0,0 +1,8 @@
// jHtmlArea - http://jhtmlarea.codeplex.com - (c)2009 Chris Pietschmann
(function($){if(jHtmlArea){var oldForecolor=jHtmlArea.fn.forecolor;jHtmlArea.fn.forecolor=function(c){if(c){oldForecolor.call(this,c);}else{var that=this;var rng=this.getRange();jHtmlAreaColorPickerMenu($(".forecolor",this.toolbar),{colorChosen:function(color){if($.browser.msie){rng.execCommand("ForeColor",false,color);}else{that.forecolor(color);}}});}};}
var menu=window.jHtmlAreaColorPickerMenu=function(ownerElement,options){return new jHtmlAreaColorPickerMenu.fn.init(ownerElement,options);};menu.fn=menu.prototype={jhtmlareacolorpickermenu:"0.7.0",init:function(ownerElement,options){var opts=$.extend({},menu.defaultOptions,options);var that=this;var owner=this.owner=$(ownerElement);var position=owner.position();if(menu.instance){menu.instance.hide();}
jHtmlAreaColorPickerMenu.instance=this;var picker=this.picker=$("<div/>").css({position:"absolute",left:position.left+opts.offsetLeft,top:position.top+owner.height()+opts.offsetTop,"z-index":opts["z-index"]}).addClass("jHtmlAreaColorPickerMenu");for(var i=0;i<opts.colors.length;i++){var c=opts.colors[i];$("<div/>").css("background-color",c).appendTo(picker).click((function(color){return function(){if(opts.colorChosen){opts.colorChosen.call(this,color);}
that.hide();};})(c));}
$("<div/>").html("<div></div>Automatic").addClass("automatic").appendTo(picker).click(function(){if(opts.colorChosen){opts.colorChosen.call(this,null);}
that.hide();});var autoHide=false;picker.appendTo(owner.parent()).show().mouseout(function(){autoHide=true;that.currentTimeout=window.setTimeout(function(){if(autoHide===true){that.hide();}},1000);}).mouseover(function(){if(that.currentTimeout){window.clearTimeout(that.currentTimeout);that.currentTimeout=null;}
autoHide=false;});},hide:function(){this.picker.hide();this.picker.remove();}};menu.fn.init.prototype=menu.fn;menu.defaultOptions={"z-index":0,offsetTop:0,offsetLeft:0,colors:["#ffffff","#cccccc","#c0c0c0","#999999","#666666","#333333","#000000","#ffcccc","#ff6666","#ff0000","#cc0000","#990000","#660000","#330000","#ffcc99","#ff9966","#ff9900","#ff6600","#cc6600","#993300","#663300","#ffff99","#ffff66","#ffcc66","#ffcc33","#cc9933","#996633","#663333","#ffffcc","#ffff33","#ffff00","#ffcc00","#999900","#666600","#333300","#99ff99","#66ff99","#33ff33","#33cc00","#009900","#006600","#003300","#99FFFF","#33FFFF","#66CCCC","#00CCCC","#339999","#336666","#003333","#CCFFFF","#66FFFF","#33CCFF","#3366FF","#3333FF","#000099","#000066","#CCCCFF","#9999FF","#6666CC","#6633FF","#6600CC","#333399","#330099","#FFCCFF","#FF99FF","#CC66CC","#CC33CC","#993399","#663366","#330033"],colorChosen:null};})(jQuery);

File diff suppressed because it is too large Load Diff

4410
data/jhtmlarea/scripts/jquery-1.3.2.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long