Posts

jQuery Numeric Plugin Update

Long time since I've posted, but have updated my jQuery numeric plugin for allowing only numbers in input boxes, fixing a couple of bugs and adding functionality (removing from input and allowing integers only). See code updates via GitHub , or download the latest stable version zipped . In the future might set it so you can restrict how many characters you can put after the decimal point (so could be useful for currency input).

Update: CSSCompact - WebHandler

Only a minor code update: CssCompact: A WebHandler for shrinking CSS files (ASP.NET) . Code I am developing will go on GitHub/SamWM at some point (already has my jQuery plugins and ASP code I wrote a while back).

Simple Slideshow System: S5

S5 has been around a few years now, but some may not be aware of it. S5 stands for 'Simple Standards-Based Slide Show System'. The XHTML code is simple to modify (adding / removing slides) and understand. Styling via CSS is also very simple to do. It gracefully degrades - so if JavaScript is disabled, you can still see the content. Slideshows are also printer friendly. Like a slideshow you would do in Microsoft Office PowerPoint or OpenOffice Impress, you have to make sure not too much content is added to a slide, since any overflow is hidden. The keyboard or mouse can be used to navigate the S5 slideshow (although there are no context menu options).

Microsoft.NET Framework directory locations

Since there are directories all over the place for the Microsoft.NET Framework, I have decided to compile a list of some of the key ones used. Compilers, GACUtil, ASP.NET Register IIS/SQL, Assemblies etc. .NET 1.0: C:\Windows\Microsoft.NET\Framework\v1.0.3705 .NET 1.1: C:\Windows\Microsoft.NET\Framework\v1.1.4322 .NET 2.0: C:\Windows\Microsoft.NET\Framework\v2.0.50727 After 2.0, more directories were added, the build number was also omitted from the directory name. Some key utilities (for Global Assembly Cache (GAC), ASP.NET, Code Access Security Policy Tool (caspol.exe)) weren't part of future versions, so, as a result, .NET 2.0 is required by them. .NET 3.0 uses .NET 2.0 compiler. New directories: C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation C:\Windows\Microsoft.NET\Framework\v3.0\Windows Workflow Foundation (only SQL scripts in here) C:\Windows\Microsoft.NET\Framework\v3.0\WPF (Windows Presentation Foundation) C:\Program Files\Reference A...

jQuery newsticker: SharePoint WebPart

It is possible to integrate the jQuery newsticker plugin into a SharePoint site using a WebPart: News Ticker Web Part . SmartTools is used to integrate jQuery into SharePoint, via the SmartTools.jQuery component. Anyone else integrated the newsticker plugin into a module / add-on for a Web CMS?

Visual Studio Macro: Wrap Selected Text in Tag

This simple macro allows you to wrap whatever text is selected in a tag - a feature that somehow is missing from Visual Studio 2008... Sub SurroundWithTag() Dim selectedText = DTE.ActiveDocument.Selection.Text Dim tag As String tag = InputBox("Enter tag name", "Tag", "strong") If (tag = "") Then MsgBox("No tag defined") Else ' no end tag needed as Visual Studio creates the end tag.. DTE.ActiveDocument.Selection.Text = String.Format("<{0}>{1}", tag, selectedText) End If End Sub Based on the answer to this question found on Stack Overflow: Macro to wrap selected text with tags in Visual Studio (which also details how you can create a macro)

jQuery Quick Tip: Extract CSS Background Image

jQuery allows you to get the background image of any element on a web page: $("#myelement").css("background-image"); However, this returns it in an undesirable format: url(http://example.com/images/image.jpg) or url("http://example.com/images/image.jpg") . With a bit of string replacement, you can get extract the URL: function extractUrl(input) { // remove quotes and wrapping url() return input.replace(/"/g,"").replace(/url\(|\)$/ig, ""); } So now you can just do this: extractUrl($("#myelement").css("background-image")) Which will return the URL on its own http://example.com/images/image.jpg .