Skip to content

Instantly share code, notes, and snippets.

View irobinson's full-sized avatar

Ian Robinson irobinson

View GitHub Profile
@irobinson
irobinson / gist:1990828
Created March 7, 2012 03:50
User File Manager Knockout View
<div id="dnnUserFileManager" class="dnnFileManager dnnClear">
<div class="fm-explorer-wrap dnnLeft">
<div class="fm-breadcrumb">
<p>
<span data-bind="foreach: currentBreadcrumbs">
<!-- ko if: id === $root.chosenFolderId() -->
<span data-bind="text: name"></span>
<!-- /ko -->
<!-- ko if: id !== $root.chosenFolderId() -->
<a href="#" data-bind="text: name, click: $root.goToFolder"></a> /
@irobinson
irobinson / dnnactions.debug.js
Created February 1, 2012 00:32
DNN Actions JS
(function ($, window) {
$.fn.dnnActionMenu = function (options) {
var opts = $.extend({},
$.fn.dnnActionMenu.defaultOptions, options),
$moduleWrap = this;
$moduleWrap.each(function () {
var $module = $(this);
@irobinson
irobinson / DNNCustomProviderManifest.xml
Created January 26, 2012 20:25
DotNetNuke Manifest section for installation of Custom Provider
<component type="Config">
<config>
<configFile>web.config</configFile>
<install>
<configuration>
<nodes>
<node path="/configuration/system.web/httpModules" action="update" key="name" collision="overwrite">
<add name="CustomProviderModule" type="DotNetNuke.Providers.CustomProvider.CustomProviderModule, DotNetNuke"/>
</node>
<node path="/configuration/system.webServer/modules" action="update" key="name" collision="overwrite">
@irobinson
irobinson / gist:1592999
Created January 11, 2012 04:23
Use the javascripts to replicate the interaction part of the facebook link preview thing.
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>test</title>
<body>
<p>Shit yeah, go on, type some shit!</p>
<textarea></textarea>
<div style="display:none;"></div>
<a href="#" style="display:none;">clear</a>
</body>
@irobinson
irobinson / gist:1510825
Created December 22, 2011 16:08
Quick example of using RestSharp to query the Untappd Brewery API
// UntappdApi.cs
// *************
using RestSharp;
public class UntappdApi
{
private const string BaseUrl = "http://api.untappd.com/v3/";
private readonly string apiKey;
@irobinson
irobinson / gist:1377662
Created November 18, 2011 20:29
Positioning of various elements in the DOM in DNN 6.1.1
<html>
<head>
<!-- New API CSS (e.g. ClientResourceManager.RegisterStyleSheet) -->
<asp:PlaceHolder runat="server" ID="ClientDependencyHeadCss"></asp:PlaceHolder>
<!-- New API JS (e.g. ClientResourceManager.RegisterScript)-->
<asp:PlaceHolder runat="server" ID="ClientDependencyHeadJs"></asp:PlaceHolder>
<!-- "Old API" CSS (e.g. styles skin object)-->
<asp:placeholder id="CSS" runat="server" />
@irobinson
irobinson / gist:1377658
Created November 18, 2011 20:28
How to wipe out jQuery UI by loading jQuery twice
<html>
<head></head>
<body>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript">
console.log('loaded jQuery and jQuery UI');
console.log('Draggable is a function: ' + $.isFunction($().draggable));
</script>
<ul class="dnnActionsMenu">
<li class="first last"><span>Manage</span><ul>
<li class="first"><span>Edit</span><ul>
<li class="first"><a href="javascript:dnnModal.show('http://core.dnndev.me/GettingStarted/tabid/55/ctl/Edit/mid/362/Default.aspx?popUp=true&SkinSrc=[G]Skins/_default/popUpSkin&ContainerSrc=[G]Containers/_default/popUpContainer',/*showReturn*/false,550,950)">Edit Content</a></li>
<li class=" last"><a href="javascript:dnnModal.show('http://core.dnndev.me/GettingStarted/tabid/55/ctl/MyWork/mid/362/Default.aspx?popUp=true&SkinSrc=[G]Skins/_default/popUpSkin&ContainerSrc=[G]Containers/_default/popUpContainer',/*showReturn*/false,550,950)">My Work</a></li>
</ul>
</li>
<li class=""><span>Admin</span><ul>
<li class="first"><a href="javascript:if(dnnModal.show('http://core.dnndev.me/GettingStarted/tabid/55/ctl/ExportModule/moduleid/362/Default.aspx?popUp=true&SkinSrc=[G]Skins/_default/popUpSkin&ContainerSrc=[G]Containers/_default/popUpContainer',/*
@irobinson
irobinson / gist:807131
Created February 2, 2011 02:19
Displays a hierarchical (indented) rendering of parent/child page list in DotNetNuke.
<asp:DropDownList runat="server" ID="PagesList" />
this.PagesList.DataSource = TabController.GetPortalTabs(this.PortalId, -1, true, Localization.GetString("DefaultPagesListItem.Text", this.LocalResourceFile), true, false, false, true, true);
this.PagesList.DataValueField = "TabID";
this.PagesList.DataTextField = "IndentedTabName";
this.PagesList.DataBind();
@irobinson
irobinson / xdomainajax.js
Created February 2, 2011 00:41
Example of using xdomainajax plug-in to parse results from search page.
var targetUrl = 'http://site.to.search.com/?query=' + encodeURIComponent(searchPhrase); // important to encode user input
$.get(targetUrl, function (res) { // relies on xdomainajax plugin
var totalResults = $(res.responseText).find('#parse .the-results .per-usual').html();
});
window.open(targetUrl);