Created
January 16, 2013 03:21
-
-
Save barnabyc/4544400 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Html; | |
using System.Runtime.CompilerServices; | |
using jQueryApi; | |
[Mixin("$.fn")] | |
public static class TextPreviewerjQueryPlugin | |
{ | |
public static jQueryObject TextPreviewerjQuery(TextPreviewerjQueryOptions options) | |
{ | |
return jQuery.Current.Each(delegate(int i, Element element) | |
{ | |
jQueryObject text = jQuery.FromElement(element); | |
jQueryObject previewer = jQuery.Select("#" + options.PreviewerId); | |
text.Keyup(delegate | |
{ | |
previewer.Html(text.GetValue()); | |
}); | |
}); | |
} | |
} | |
[Imported] | |
[ScriptName("Object")] | |
public sealed class TextPreviewerjQueryOptions | |
{ | |
public string PreviewerId; | |
public TextPreviewerjQueryOptions() | |
{ | |
} | |
public TextPreviewerjQueryOptions(string previewerId) | |
{ | |
PreviewerId = previewerId; | |
} | |
} | |
#region Script# Support | |
[Imported] | |
public sealed class TextPreviewerjQueryObject : jQueryObject | |
{ | |
public jQueryObject TextPreviewerjQuery(TextPreviewerjQueryOptions options) | |
{ | |
return null; | |
} | |
} | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment