diff --git a/foreign dlls/Our.Umbraco.uGoLive.47x.dll b/foreign dlls/Our.Umbraco.uGoLive.47x.dll
index 0afa00e504..eeb3afec20 100644
Binary files a/foreign dlls/Our.Umbraco.uGoLive.47x.dll and b/foreign dlls/Our.Umbraco.uGoLive.47x.dll differ
diff --git a/foreign dlls/Our.Umbraco.uGoLive.Checks.dll b/foreign dlls/Our.Umbraco.uGoLive.Checks.dll
index c5dd4e20a7..ec4900edec 100644
Binary files a/foreign dlls/Our.Umbraco.uGoLive.Checks.dll and b/foreign dlls/Our.Umbraco.uGoLive.Checks.dll differ
diff --git a/foreign dlls/Our.Umbraco.uGoLive.dll b/foreign dlls/Our.Umbraco.uGoLive.dll
index 43f567e8c4..b56b662695 100644
Binary files a/foreign dlls/Our.Umbraco.uGoLive.dll and b/foreign dlls/Our.Umbraco.uGoLive.dll differ
diff --git a/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.ascx b/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.ascx
index 5610a65c81..973bdc1028 100644
--- a/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.ascx
+++ b/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.ascx
@@ -1,27 +1,21 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Dashboard.ascx.cs" Inherits="Our.Umbraco.uGoLive.Web.Umbraco.Plugins.uGoLive.Dashboard" %>
<%@ Import Namespace="umbraco.IO" %>
-
-
+<%@ Import Namespace="Our.Umbraco.uGoLive.Web" %>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.css b/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.css
new file mode 100644
index 0000000000..cf2ff8d914
--- /dev/null
+++ b/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.css
@@ -0,0 +1,16 @@
+.uGoLive .propertyItemContent img { vertical-align: middle; margin-right: 5px; }
+.uGoLive .propertypane .propertypane { padding: 10px 10px 0px; }
+.uGoLive .dashboardWrapper { padding: 5px 5px 5px 5px; overflow: hidden; color: #333; }
+.uGoLive .dashboardWrapper h2 { margin-top: 0; padding-bottom: 10px; border-bottom: 1px solid #CCC; padding-left: 37px; line-height: 32px; }
+.uGoLive .dashboardWrapper .dashboardIcon { position: absolute; top: 10px; left: 10px; }
+.uGoLive .dashboardWrapper h3 { margin-bottom: 10px; }
+.uGoLive .dashboardWrapper p { line-height: 1.4em; font-size: 1.1em; margin-top: 0; }
+.uGoLive #btnRunChecks { color: #fff; background: #f26e20; padding: 10px; border: 0; font-weight: bold; cursor: pointer; outline: 0; }
+.uGoLive #btnRunChecks.disabled { background: #f9b790; }
+.uGoLive a.disabled { cursor: default; opacity:0.3; filter:alpha(opacity=30); }
+.uGoLive span.status { padding-left: 20px; background-position: left center; background-repeat: no-repeat; line-height: 16px; }
+.uGoLive span.status.uglUnchecked { background-image: url('help.png') }
+.uGoLive span.status.uglChecking, .uGoLive span.status.uglQueued { background-image: url('throbber.gif') }
+.uGoLive span.status.uglPassed, .uGoLive span.status.uglSuccess { background-image: url('tick.png') }
+.uGoLive span.status.uglFailed { background-image: url('cross.png') }
+.uGoLive span.status.uglIndeterminate { background-image: url('error.png') }
\ No newline at end of file
diff --git a/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.js b/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.js
index fb64a2f9c8..25980c1ffe 100644
--- a/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.js
+++ b/umbraco/presentation/umbraco/plugins/uGoLive/Dashboard.js
@@ -4,134 +4,140 @@ Our.Umbraco.uGoLive = Our.Umbraco.uGoLive || {};
(function ($) {
+ // Class representing a check group
+ Our.Umbraco.uGoLive.CheckGroup = function(name, checks, opts) {
+ var me = {
+ name: name,
+ checks: ko.observableArray([])
+ };
+
+ for(var i = 0; i < checks.length; i++) {
+ me.checks.push(new Our.Umbraco.uGoLive.Check(checks[i], opts));
+ }
+
+ return me;
+ };
+
+ // Class representing a check
+ Our.Umbraco.uGoLive.Check = function(check, opts) {
+ var me = {
+ id: check.Id,
+ name: check.Name,
+ description: check.Description,
+ canRectify: check.CanRectify,
+ status: ko.observable("Unchecked"),
+ message: ko.observable("Unchecked"),
+ check: function (e, doneCallback) {
+ var _this = this;
+
+ // Set status / message
+ _this.status("Checking");
+ _this.message("Checking...");
+
+ // Perform check
+ $.getJSON(opts.basePath + '/uGoLive/Check/' + this.id + '.aspx', function(data) {
+
+ // Set status / message
+ _this.status(data.Status.Value);
+ _this.message(data.Message);
+
+ // Trigger done callback
+ if(doneCallback != undefined)
+ doneCallback(data);
+ });
+ },
+ rectify: function (e, doneCallback) {
+ var _this = this;
+
+ // Set status / message
+ _this.status("Checking");
+ _this.message("Rectifying...");
+
+ // Perform check
+ $.getJSON(opts.basePath + '/uGoLive/Rectify/' + this.id + '.aspx', function(data) {
+
+ // Set status / message
+ _this.status(data.Status.Value);
+ _this.message(data.Message);
+
+ // Trigger done callback
+ if(doneCallback != undefined)
+ doneCallback(data);
+ });
+ }
+ };
+
+ return me;
+ };
+
Our.Umbraco.uGoLive.Dashboard = (function() {
- var checks = [];
- var currentCheckIndex = -1;
- var opts = {
- basePath: "/base",
- umbracoPath: "/umbraco"
- };
-
- function performNextCheck() {
-
- // Get the current check id
- var checkId = checks[currentCheckIndex];
-
- // Trigger check
- performCheck(checkId, function(data) {
-
- // Trigger next check, or finish
- if(currentCheckIndex + 1 == checks.length) {
-
- // Re-enable the "Run All Checks" button
- var $btn = $("#btnRunChecks");
- $btn.text("Re-Run All Checks");
- $btn.removeClass("disabled");
-
+ var opts = {
+ checkDefs: [],
+ basePath: "/base",
+ umbracoPath: "/umbraco"
+ };
+
+ var viewModel = {
+ checkGroups: ko.observableArray([]),
+ checkAllText: ko.observable("Run All Checks"),
+ checkAll: function() {
+ var _this = this;
+
+ // Set button text
+ _this.checkAllText("Running...");
+
+ // Queue checks
+ ko.utils.arrayForEach(_this.allChecks(), function(check) {
+ check.status("Queued");
+ check.message("Queued...");
+ });
+
+ // Trigger checks
+ _this.checkNext(function () {
+
+ // Reset button text
+ _this.checkAllText("Re-Run All Checks");
+ });
+ },
+ checkNext: function (doneCallback) {
+ var _this = this;
+
+ // Check for any queued checks
+ if(_this.queuedChecks().length > 0) {
+
+ // Trigger first queued check
+ _this.queuedChecks()[0].check(null, function() {
+
+ // Trigger the next check
+ _this.checkNext(doneCallback);
+ });
} else {
-
- // Run the next check
- currentCheckIndex++;
- performNextCheck();
-
+
+ // Call done callback
+ if(doneCallback != undefined)
+ doneCallback();
}
- });
- }
+ }
+ };
- function performCheck(checkId, callBack) {
-
- // Get references
- var $checkEl = $("span.status[data-check-id=" + checkId + "]");
- var $checkButton = $("a.check[data-check-id=" + checkId + "]");
- var $rectifyButton = $("a.rectify[data-check-id=" + checkId + "][data-check-can-rectify='true']");
-
- // Disable buttons
- $checkButton.addClass("disabled");
- $rectifyButton.addClass("disabled");
-
- // Display throbber
- $checkEl.html("
Checking...");
-
- // Perform check
- $.getJSON(opts.basePath + '/uGoLive/Check/'+ checkId +'.aspx', function(data) {
-
- // Remove throbber
- $checkEl.empty();
-
- // Display icon & enable / disable rectify button
- switch(data.Status.Value) {
- case "Passed":
- $checkEl.append("
");
- $rectifyButton.addClass("disabled");
- break;
- case "Indeterminate":
- $checkEl.append("
");
- $rectifyButton.removeClass("disabled");
- break;
- case "Failed":
- $checkEl.append("
");
- $rectifyButton.removeClass("disabled");
- break;
- }
-
- // Display message
- if($.trim(data.Message) != "")
- $checkEl.append(data.Message);
-
- // Re-enable check button
- $checkButton.removeClass("disabled");
-
- // Execute callback
- if(callBack != undefined)
- callBack(data);
+ // Helper list of all checks
+ viewModel.allChecks = ko.dependentObservable(function() {
+ var all = [];
+ ko.utils.arrayForEach(this.checkGroups(), function(group) {
+ ko.utils.arrayForEach(group.checks(), function(check) {
+ all.push(check);
+ });
});
- }
-
- function performRectify(checkId, callBack) {
-
- // Get references
- var $checkEl = $("span.status[data-check-id=" + checkId + "]");
- var $checkButton = $("a.check[data-check-id=" + checkId + "]");
- var $rectifyButton = $("a.rectify[data-check-id=" + checkId + "][data-check-can-rectify='true']");
+ return all;
+ }, viewModel);
- // Disable buttons
- $checkButton.addClass("disabled");
- $rectifyButton.addClass("disabled");
-
- // Display throbber
- $checkEl.html("
Rectifying...");
-
- // Perform rectify
- $.getJSON(opts.basePath + '/uGoLive/Rectify/'+ checkId +'.aspx', function(data) {
-
- // Remove throbber
- $checkEl.empty();
-
- // Display icon & enable / disable rectify button
- switch(data.Status.Value) {
- case "Success":
- $checkEl.append("
");
- $rectifyButton.addClass("disabled");
- break;
- case "Failed":
- $checkEl.append("
");
- $rectifyButton.removeClass("disabled");
- break;
- }
-
- // Display message
- if($.trim(data.Message) != "")
- $checkEl.append(data.Message);
-
- // Re-enable check button
- $checkButton.removeClass("disabled");
-
- // Execute callback
- if(callBack != undefined)
- callBack(data);
+ // Helper list of queued checks
+ viewModel.queuedChecks = ko.dependentObservable(function() {
+ return ko.utils.arrayFilter(this.allChecks(), function(check) {
+ return check.status() == "Queued";
});
- }
+ }, viewModel);
return {
@@ -139,62 +145,17 @@ Our.Umbraco.uGoLive = Our.Umbraco.uGoLive || {};
// Merge options
opts = $.extend(opts, o);
-
+
// Parse all checks
- $("span.status").each(function (idx, el) {
- checks.push($(el).attr("data-check-id"));
- });
-
- // Hookup run all check button
- $("#btnRunChecks").click(function(e) {
-
- e.preventDefault();
-
- var $this = $(this);
-
- if(!$this.hasClass("disabled")) {
-
- // Clear out previous checks
- $("span.status").empty();
-
- // Disable check/rectify buttons
- $("a.check").addClass("disabled");
- $("a.rectify").addClass("disabled");
-
- // Update run checks button
- $this.text("Running checks...");
- $this.addClass("disabled");
-
- // Start checks
- currentCheckIndex = 0;
- performNextCheck();
-
+ for(var i = 0; i < opts.checkDefs.length; i++) {
+ var groupChecks = opts.checkDefs[i];
+ if(groupChecks.length > 0) {
+ viewModel.checkGroups.push(new Our.Umbraco.uGoLive.CheckGroup(groupChecks[0].Group, groupChecks, opts));
}
- });
-
- // Hookup individual check buttons
- $("a.check").click(function(e) {
+ }
- e.preventDefault();
-
- var $this = $(this);
-
- if(!$this.hasClass("disabled")) {
- performCheck($this.attr("data-check-id"));
- }
- });
-
- // Hookup individual rectify buttons
- $("a.rectify").click(function(e) {
-
- e.preventDefault();
-
- var $this = $(this);
-
- if(!$this.hasClass("disabled")) {
- performRectify($this.attr("data-check-id"));
- }
- });
+ // Bind view model
+ ko.applyBindings(viewModel, $("#uGoLive").get(0));
}
};
diff --git a/umbraco/presentation/umbraco/plugins/uGoLive/jquery.tmpl.js b/umbraco/presentation/umbraco/plugins/uGoLive/jquery.tmpl.js
new file mode 100644
index 0000000000..386994e902
--- /dev/null
+++ b/umbraco/presentation/umbraco/plugins/uGoLive/jquery.tmpl.js
@@ -0,0 +1,484 @@
+/*!
+ * jQuery Templates Plugin 1.0.0pre
+ * http://github.com/jquery/jquery-tmpl
+ * Requires jQuery 1.4.2
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ */
+(function( jQuery, undefined ){
+ var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,
+ newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = { key: 0, data: {} }, itemKey = 0, cloneIndex = 0, stack = [];
+
+ function newTmplItem( options, parentItem, fn, data ) {
+ // Returns a template item data structure for a new rendered instance of a template (a 'template item').
+ // The content field is a hierarchical array of strings and nested items (to be
+ // removed and replaced by nodes field of dom elements, once inserted in DOM).
+ var newItem = {
+ data: data || (data === 0 || data === false) ? data : (parentItem ? parentItem.data : {}),
+ _wrap: parentItem ? parentItem._wrap : null,
+ tmpl: null,
+ parent: parentItem || null,
+ nodes: [],
+ calls: tiCalls,
+ nest: tiNest,
+ wrap: tiWrap,
+ html: tiHtml,
+ update: tiUpdate
+ };
+ if ( options ) {
+ jQuery.extend( newItem, options, { nodes: [], parent: parentItem });
+ }
+ if ( fn ) {
+ // Build the hierarchical content to be used during insertion into DOM
+ newItem.tmpl = fn;
+ newItem._ctnt = newItem._ctnt || newItem.tmpl( jQuery, newItem );
+ newItem.key = ++itemKey;
+ // Keep track of new template item, until it is stored as jQuery Data on DOM element
+ (stack.length ? wrappedItems : newTmplItems)[itemKey] = newItem;
+ }
+ return newItem;
+ }
+
+ // Override appendTo etc., in order to provide support for targeting multiple elements. (This code would disappear if integrated in jquery core).
+ jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+ }, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [], insert = jQuery( selector ), elems, i, l, tmplItems,
+ parent = this.length === 1 && this[0].parentNode;
+
+ appendToTmplItems = newTmplItems || {};
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ ret = this;
+ } else {
+ for ( i = 0, l = insert.length; i < l; i++ ) {
+ cloneIndex = i;
+ elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery( insert[i] )[ original ]( elems );
+ ret = ret.concat( elems );
+ }
+ cloneIndex = 0;
+ ret = this.pushStack( ret, name, insert.selector );
+ }
+ tmplItems = appendToTmplItems;
+ appendToTmplItems = null;
+ jQuery.tmpl.complete( tmplItems );
+ return ret;
+ };
+ });
+
+ jQuery.fn.extend({
+ // Use first wrapped element as template markup.
+ // Return wrapped set of template items, obtained by rendering template against data.
+ tmpl: function( data, options, parentItem ) {
+ return jQuery.tmpl( this[0], data, options, parentItem );
+ },
+
+ // Find which rendered template item the first wrapped DOM element belongs to
+ tmplItem: function() {
+ return jQuery.tmplItem( this[0] );
+ },
+
+ // Consider the first wrapped element as a template declaration, and get the compiled template or store it as a named template.
+ template: function( name ) {
+ return jQuery.template( name, this[0] );
+ },
+
+ domManip: function( args, table, callback, options ) {
+ if ( args[0] && jQuery.isArray( args[0] )) {
+ var dmArgs = jQuery.makeArray( arguments ), elems = args[0], elemsLength = elems.length, i = 0, tmplItem;
+ while ( i < elemsLength && !(tmplItem = jQuery.data( elems[i++], "tmplItem" ))) {}
+ if ( tmplItem && cloneIndex ) {
+ dmArgs[2] = function( fragClone ) {
+ // Handler called by oldManip when rendered template has been inserted into DOM.
+ jQuery.tmpl.afterManip( this, fragClone, callback );
+ };
+ }
+ oldManip.apply( this, dmArgs );
+ } else {
+ oldManip.apply( this, arguments );
+ }
+ cloneIndex = 0;
+ if ( !appendToTmplItems ) {
+ jQuery.tmpl.complete( newTmplItems );
+ }
+ return this;
+ }
+ });
+
+ jQuery.extend({
+ // Return wrapped set of template items, obtained by rendering template against data.
+ tmpl: function( tmpl, data, options, parentItem ) {
+ var ret, topLevel = !parentItem;
+ if ( topLevel ) {
+ // This is a top-level tmpl call (not from a nested template using {{tmpl}})
+ parentItem = topTmplItem;
+ tmpl = jQuery.template[tmpl] || jQuery.template( null, tmpl );
+ wrappedItems = {}; // Any wrapped items will be rebuilt, since this is top level
+ } else if ( !tmpl ) {
+ // The template item is already associated with DOM - this is a refresh.
+ // Re-evaluate rendered template for the parentItem
+ tmpl = parentItem.tmpl;
+ newTmplItems[parentItem.key] = parentItem;
+ parentItem.nodes = [];
+ if ( parentItem.wrapped ) {
+ updateWrapped( parentItem, parentItem.wrapped );
+ }
+ // Rebuild, without creating a new template item
+ return jQuery( build( parentItem, null, parentItem.tmpl( jQuery, parentItem ) ));
+ }
+ if ( !tmpl ) {
+ return []; // Could throw...
+ }
+ if ( typeof data === "function" ) {
+ data = data.call( parentItem || {} );
+ }
+ if ( options && options.wrapped ) {
+ updateWrapped( options, options.wrapped );
+ }
+ ret = jQuery.isArray( data ) ?
+ jQuery.map( data, function( dataItem ) {
+ return dataItem ? newTmplItem( options, parentItem, tmpl, dataItem ) : null;
+ }) :
+ [ newTmplItem( options, parentItem, tmpl, data ) ];
+ return topLevel ? jQuery( build( parentItem, null, ret ) ) : ret;
+ },
+
+ // Return rendered template item for an element.
+ tmplItem: function( elem ) {
+ var tmplItem;
+ if ( elem instanceof jQuery ) {
+ elem = elem[0];
+ }
+ while ( elem && elem.nodeType === 1 && !(tmplItem = jQuery.data( elem, "tmplItem" )) && (elem = elem.parentNode) ) {}
+ return tmplItem || topTmplItem;
+ },
+
+ // Set:
+ // Use $.template( name, tmpl ) to cache a named template,
+ // where tmpl is a template string, a script element or a jQuery instance wrapping a script element, etc.
+ // Use $( "selector" ).template( name ) to provide access by name to a script block template declaration.
+
+ // Get:
+ // Use $.template( name ) to access a cached template.
+ // Also $( selectorToScriptBlock ).template(), or $.template( null, templateString )
+ // will return the compiled template, without adding a name reference.
+ // If templateString includes at least one HTML tag, $.template( templateString ) is equivalent
+ // to $.template( null, templateString )
+ template: function( name, tmpl ) {
+ if (tmpl) {
+ // Compile template and associate with name
+ if ( typeof tmpl === "string" ) {
+ // This is an HTML string being passed directly in.
+ tmpl = buildTmplFn( tmpl );
+ } else if ( tmpl instanceof jQuery ) {
+ tmpl = tmpl[0] || {};
+ }
+ if ( tmpl.nodeType ) {
+ // If this is a template block, use cached copy, or generate tmpl function and cache.
+ tmpl = jQuery.data( tmpl, "tmpl" ) || jQuery.data( tmpl, "tmpl", buildTmplFn( tmpl.innerHTML ));
+ // Issue: In IE, if the container element is not a script block, the innerHTML will remove quotes from attribute values whenever the value does not include white space.
+ // This means that foo="${x}" will not work if the value of x includes white space: foo="${x}" -> foo=value of x.
+ // To correct this, include space in tag: foo="${ x }" -> foo="value of x"
+ }
+ return typeof name === "string" ? (jQuery.template[name] = tmpl) : tmpl;
+ }
+ // Return named compiled template
+ return name ? (typeof name !== "string" ? jQuery.template( null, name ):
+ (jQuery.template[name] ||
+ // If not in map, and not containing at least on HTML tag, treat as a selector.
+ // (If integrated with core, use quickExpr.exec)
+ jQuery.template( null, htmlExpr.test( name ) ? name : jQuery( name )))) : null;
+ },
+
+ encode: function( text ) {
+ // Do HTML encoding replacing < > & and ' and " by corresponding entities.
+ return ("" + text).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'");
+ }
+ });
+
+ jQuery.extend( jQuery.tmpl, {
+ tag: {
+ "tmpl": {
+ _default: { $2: "null" },
+ open: "if($notnull_1){__=__.concat($item.nest($1,$2));}"
+ // tmpl target parameter can be of type function, so use $1, not $1a (so not auto detection of functions)
+ // This means that {{tmpl foo}} treats foo as a template (which IS a function).
+ // Explicit parens can be used if foo is a function that returns a template: {{tmpl foo()}}.
+ },
+ "wrap": {
+ _default: { $2: "null" },
+ open: "$item.calls(__,$1,$2);__=[];",
+ close: "call=$item.calls();__=call._.concat($item.wrap(call,__));"
+ },
+ "each": {
+ _default: { $2: "$index, $value" },
+ open: "if($notnull_1){$.each($1a,function($2){with(this){",
+ close: "}});}"
+ },
+ "if": {
+ open: "if(($notnull_1) && $1a){",
+ close: "}"
+ },
+ "else": {
+ _default: { $1: "true" },
+ open: "}else if(($notnull_1) && $1a){"
+ },
+ "html": {
+ // Unecoded expression evaluation.
+ open: "if($notnull_1){__.push($1a);}"
+ },
+ "=": {
+ // Encoded expression evaluation. Abbreviated form is ${}.
+ _default: { $1: "$data" },
+ open: "if($notnull_1){__.push($.encode($1a));}"
+ },
+ "!": {
+ // Comment tag. Skipped by parser
+ open: ""
+ }
+ },
+
+ // This stub can be overridden, e.g. in jquery.tmplPlus for providing rendered events
+ complete: function( items ) {
+ newTmplItems = {};
+ },
+
+ // Call this from code which overrides domManip, or equivalent
+ // Manage cloning/storing template items etc.
+ afterManip: function afterManip( elem, fragClone, callback ) {
+ // Provides cloned fragment ready for fixup prior to and after insertion into DOM
+ var content = fragClone.nodeType === 11 ?
+ jQuery.makeArray(fragClone.childNodes) :
+ fragClone.nodeType === 1 ? [fragClone] : [];
+
+ // Return fragment to original caller (e.g. append) for DOM insertion
+ callback.call( elem, fragClone );
+
+ // Fragment has been inserted:- Add inserted nodes to tmplItem data structure. Replace inserted element annotations by jQuery.data.
+ storeTmplItems( content );
+ cloneIndex++;
+ }
+ });
+
+ //========================== Private helper functions, used by code above ==========================
+
+ function build( tmplItem, nested, content ) {
+ // Convert hierarchical content into flat string array
+ // and finally return array of fragments ready for DOM insertion
+ var frag, ret = content ? jQuery.map( content, function( item ) {
+ return (typeof item === "string") ?
+ // Insert template item annotations, to be converted to jQuery.data( "tmplItem" ) when elems are inserted into DOM.
+ (tmplItem.key ? item.replace( /(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, "$1 " + tmplItmAtt + "=\"" + tmplItem.key + "\" $2" ) : item) :
+ // This is a child template item. Build nested template.
+ build( item, tmplItem, item._ctnt );
+ }) :
+ // If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}.
+ tmplItem;
+ if ( nested ) {
+ return ret;
+ }
+
+ // top-level template
+ ret = ret.join("");
+
+ // Support templates which have initial or final text nodes, or consist only of text
+ // Also support HTML entities within the HTML markup.
+ ret.replace( /^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/, function( all, before, middle, after) {
+ frag = jQuery( middle ).get();
+
+ storeTmplItems( frag );
+ if ( before ) {
+ frag = unencode( before ).concat(frag);
+ }
+ if ( after ) {
+ frag = frag.concat(unencode( after ));
+ }
+ });
+ return frag ? frag : unencode( ret );
+ }
+
+ function unencode( text ) {
+ // Use createElement, since createTextNode will not render HTML entities correctly
+ var el = document.createElement( "div" );
+ el.innerHTML = text;
+ return jQuery.makeArray(el.childNodes);
+ }
+
+ // Generate a reusable function that will serve to render a template against data
+ function buildTmplFn( markup ) {
+ return new Function("jQuery","$item",
+ // Use the variable __ to hold a string array while building the compiled template. (See https://github.com/jquery/jquery-tmpl/issues#issue/10).
+ "var $=jQuery,call,__=[],$data=$item.data;" +
+
+ // Introduce the data as local variables using with(){}
+ "with($data){__.push('" +
+
+ // Convert the template into pure JavaScript
+ jQuery.trim(markup)
+ .replace( /([\\'])/g, "\\$1" )
+ .replace( /[\r\t\n]/g, " " )
+ .replace( /\$\{([^\}]*)\}/g, "{{= $1}}" )
+ .replace( /\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
+ function( all, slash, type, fnargs, target, parens, args ) {
+ var tag = jQuery.tmpl.tag[ type ], def, expr, exprAutoFnDetect;
+ if ( !tag ) {
+ throw "Unknown template tag: " + type;
+ }
+ def = tag._default || [];
+ if ( parens && !/\w$/.test(target)) {
+ target += parens;
+ parens = "";
+ }
+ if ( target ) {
+ target = unescape( target );
+ args = args ? ("," + unescape( args ) + ")") : (parens ? ")" : "");
+ // Support for target being things like a.toLowerCase();
+ // In that case don't call with template item as 'this' pointer. Just evaluate...
+ expr = parens ? (target.indexOf(".") > -1 ? target + unescape( parens ) : ("(" + target + ").call($item" + args)) : target;
+ exprAutoFnDetect = parens ? expr : "(typeof(" + target + ")==='function'?(" + target + ").call($item):(" + target + "))";
+ } else {
+ exprAutoFnDetect = expr = def.$1 || "null";
+ }
+ fnargs = unescape( fnargs );
+ return "');" +
+ tag[ slash ? "close" : "open" ]
+ .split( "$notnull_1" ).join( target ? "typeof(" + target + ")!=='undefined' && (" + target + ")!=null" : "true" )
+ .split( "$1a" ).join( exprAutoFnDetect )
+ .split( "$1" ).join( expr )
+ .split( "$2" ).join( fnargs || def.$2 || "" ) +
+ "__.push('";
+ }) +
+ "');}return __;"
+ );
+ }
+ function updateWrapped( options, wrapped ) {
+ // Build the wrapped content.
+ options._wrap = build( options, true,
+ // Suport imperative scenario in which options.wrapped can be set to a selector or an HTML string.
+ jQuery.isArray( wrapped ) ? wrapped : [htmlExpr.test( wrapped ) ? wrapped : jQuery( wrapped ).html()]
+ ).join("");
+ }
+
+ function unescape( args ) {
+ return args ? args.replace( /\\'/g, "'").replace(/\\\\/g, "\\" ) : null;
+ }
+ function outerHtml( elem ) {
+ var div = document.createElement("div");
+ div.appendChild( elem.cloneNode(true) );
+ return div.innerHTML;
+ }
+
+ // Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance.
+ function storeTmplItems( content ) {
+ var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m;
+ for ( i = 0, l = content.length; i < l; i++ ) {
+ if ( (elem = content[i]).nodeType !== 1 ) {
+ continue;
+ }
+ elems = elem.getElementsByTagName("*");
+ for ( m = elems.length - 1; m >= 0; m-- ) {
+ processItemKey( elems[m] );
+ }
+ processItemKey( elem );
+ }
+ function processItemKey( el ) {
+ var pntKey, pntNode = el, pntItem, tmplItem, key;
+ // Ensure that each rendered template inserted into the DOM has its own template item,
+ if ( (key = el.getAttribute( tmplItmAtt ))) {
+ while ( pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute( tmplItmAtt ))) { }
+ if ( pntKey !== key ) {
+ // The next ancestor with a _tmplitem expando is on a different key than this one.
+ // So this is a top-level element within this template item
+ // Set pntNode to the key of the parentNode, or to 0 if pntNode.parentNode is null, or pntNode is a fragment.
+ pntNode = pntNode.parentNode ? (pntNode.nodeType === 11 ? 0 : (pntNode.getAttribute( tmplItmAtt ) || 0)) : 0;
+ if ( !(tmplItem = newTmplItems[key]) ) {
+ // The item is for wrapped content, and was copied from the temporary parent wrappedItem.
+ tmplItem = wrappedItems[key];
+ tmplItem = newTmplItem( tmplItem, newTmplItems[pntNode]||wrappedItems[pntNode] );
+ tmplItem.key = ++itemKey;
+ newTmplItems[itemKey] = tmplItem;
+ }
+ if ( cloneIndex ) {
+ cloneTmplItem( key );
+ }
+ }
+ el.removeAttribute( tmplItmAtt );
+ } else if ( cloneIndex && (tmplItem = jQuery.data( el, "tmplItem" )) ) {
+ // This was a rendered element, cloned during append or appendTo etc.
+ // TmplItem stored in jQuery data has already been cloned in cloneCopyEvent. We must replace it with a fresh cloned tmplItem.
+ cloneTmplItem( tmplItem.key );
+ newTmplItems[tmplItem.key] = tmplItem;
+ pntNode = jQuery.data( el.parentNode, "tmplItem" );
+ pntNode = pntNode ? pntNode.key : 0;
+ }
+ if ( tmplItem ) {
+ pntItem = tmplItem;
+ // Find the template item of the parent element.
+ // (Using !=, not !==, since pntItem.key is number, and pntNode may be a string)
+ while ( pntItem && pntItem.key != pntNode ) {
+ // Add this element as a top-level node for this rendered template item, as well as for any
+ // ancestor items between this item and the item of its parent element
+ pntItem.nodes.push( el );
+ pntItem = pntItem.parent;
+ }
+ // Delete content built during rendering - reduce API surface area and memory use, and avoid exposing of stale data after rendering...
+ delete tmplItem._ctnt;
+ delete tmplItem._wrap;
+ // Store template item as jQuery data on the element
+ jQuery.data( el, "tmplItem", tmplItem );
+ }
+ function cloneTmplItem( key ) {
+ key = key + keySuffix;
+ tmplItem = newClonedItems[key] =
+ (newClonedItems[key] || newTmplItem( tmplItem, newTmplItems[tmplItem.parent.key + keySuffix] || tmplItem.parent ));
+ }
+ }
+ }
+
+ //---- Helper functions for template item ----
+
+ function tiCalls( content, tmpl, data, options ) {
+ if ( !content ) {
+ return stack.pop();
+ }
+ stack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });
+ }
+
+ function tiNest( tmpl, data, options ) {
+ // nested template, using {{tmpl}} tag
+ return jQuery.tmpl( jQuery.template( tmpl ), data, options, this );
+ }
+
+ function tiWrap( call, wrapped ) {
+ // nested template, using {{wrap}} tag
+ var options = call.options || {};
+ options.wrapped = wrapped;
+ // Apply the template, which may incorporate wrapped content,
+ return jQuery.tmpl( jQuery.template( call.tmpl ), call.data, options, call.item );
+ }
+
+ function tiHtml( filter, textOnly ) {
+ var wrapped = this._wrap;
+ return jQuery.map(
+ jQuery( jQuery.isArray( wrapped ) ? wrapped.join("") : wrapped ).filter( filter || "*" ),
+ function(e) {
+ return textOnly ?
+ e.innerText || e.textContent :
+ e.outerHTML || outerHtml(e);
+ });
+ }
+
+ function tiUpdate() {
+ var coll = this.nodes;
+ jQuery.tmpl( null, null, null, this).insertBefore( coll[0] );
+ jQuery( coll ).remove();
+ }
+})( jQuery );
\ No newline at end of file
diff --git a/umbraco/presentation/umbraco/plugins/uGoLive/knockout-1.2.1.js b/umbraco/presentation/umbraco/plugins/uGoLive/knockout-1.2.1.js
new file mode 100644
index 0000000000..225d7de7a7
--- /dev/null
+++ b/umbraco/presentation/umbraco/plugins/uGoLive/knockout-1.2.1.js
@@ -0,0 +1,194 @@
+// Knockout JavaScript library v1.2.1
+// (c) Steven Sanderson - http://knockoutjs.com/
+// License: MIT (http://www.opensource.org/licenses/mit-license.php)
+
+(function (window, undefined) {
+ function c(e) { throw e; } var m = void 0, o = null, p = window.ko = {}; p.b = function (e, d) { for (var b = e.split("."), a = window, f = 0; f < b.length - 1; f++) a = a[b[f]]; a[b[b.length - 1]] = d }; p.i = function (e, d, b) { e[d] = b };
+ p.a = new function () {
+ function e(a, b) { if (a.tagName != "INPUT" || !a.type) return !1; if (b.toLowerCase() != "click") return !1; var d = a.type.toLowerCase(); return d == "checkbox" || d == "radio" } var d = /^(\s|\u00A0)+|(\s|\u00A0)+$/g, b = /MSIE 6/i.test(navigator.userAgent), a = /MSIE 7/i.test(navigator.userAgent), f = {}, h = {}; f[/Firefox\/2/i.test(navigator.userAgent) ? "KeyboardEvent" : "UIEvents"] = ["keyup", "keydown", "keypress"]; f.MouseEvents = ["click", "dblclick", "mousedown", "mouseup", "mousemove", "mouseover", "mouseout", "mouseenter", "mouseleave"];
+ for (var g in f) { var i = f[g]; if (i.length) for (var k = 0, j = i.length; k < j; k++) h[i[k]] = g } return { ca: ["authenticity_token", /^__RequestVerificationToken(_.*)?$/], g: function (a, b) { for (var d = 0, e = a.length; d < e; d++) b(a[d]) }, h: function (a, b) { if (typeof a.indexOf == "function") return a.indexOf(b); for (var d = 0, e = a.length; d < e; d++) if (a[d] === b) return d; return -1 }, xa: function (a, b, d) { for (var e = 0, f = a.length; e < f; e++) if (b.call(d, a[e])) return a[e]; return o }, N: function (a, b) { var d = p.a.h(a, b); d >= 0 && a.splice(d, 1) }, L: function (a) {
+ for (var a =
+a || [], b = [], d = 0, e = a.length; d < e; d++) p.a.h(b, a[d]) < 0 && b.push(a[d]); return b
+ }, M: function (a, b) { for (var a = a || [], d = [], e = 0, f = a.length; e < f; e++) d.push(b(a[e])); return d }, K: function (a, b) { for (var a = a || [], d = [], e = 0, f = a.length; e < f; e++) b(a[e]) && d.push(a[e]); return d }, u: function (a, b) { for (var d = 0, e = b.length; d < e; d++) a.push(b[d]) }, Q: function (a) { for (; a.firstChild; ) p.removeNode(a.firstChild) }, Xa: function (a, b) { p.a.Q(a); b && p.a.g(b, function (b) { a.appendChild(b) }) }, ka: function (a, b) {
+ var d = a.nodeType ? [a] : a; if (d.length > 0) {
+ for (var e =
+d[0], f = e.parentNode, h = 0, g = b.length; h < g; h++) f.insertBefore(b[h], e); h = 0; for (g = d.length; h < g; h++) p.removeNode(d[h])
+ }
+ }, ma: function (a, b) { navigator.userAgent.indexOf("MSIE 6") >= 0 ? a.setAttribute("selected", b) : a.selected = b }, da: function (a, b) { if (!a || a.nodeType != 1) return []; var d = []; a.getAttribute(b) !== o && d.push(a); for (var e = a.getElementsByTagName("*"), f = 0, h = e.length; f < h; f++) e[f].getAttribute(b) !== o && d.push(e[f]); return d }, k: function (a) { return (a || "").replace(d, "") }, ab: function (a, b) {
+ for (var d = [], e = (a || "").split(b),
+f = 0, h = e.length; f < h; f++) { var g = p.a.k(e[f]); g !== "" && d.push(g) } return d
+ }, Za: function (a, b) { a = a || ""; if (b.length > a.length) return !1; return a.substring(0, b.length) === b }, Ha: function (a, b) { if (b === m) return (new Function("return " + a))(); return (new Function("sc", "with(sc) { return (" + a + ") }"))(b) }, Fa: function (a, b) { if (b.compareDocumentPosition) return (b.compareDocumentPosition(a) & 16) == 16; for (; a != o; ) { if (a == b) return !0; a = a.parentNode } return !1 }, P: function (a) { return p.a.Fa(a, document) }, t: function (a, b, d) {
+ if (typeof jQuery !=
+"undefined") { if (e(a, b)) var f = d, d = function (a, b) { var d = this.checked; if (b) this.checked = b.Aa !== !0; f.call(this, a); this.checked = d }; jQuery(a).bind(b, d) } else typeof a.addEventListener == "function" ? a.addEventListener(b, d, !1) : typeof a.attachEvent != "undefined" ? a.attachEvent("on" + b, function (b) { d.call(a, b) }) : c(Error("Browser doesn't support addEventListener or attachEvent"))
+ }, qa: function (a, b) {
+ (!a || !a.nodeType) && c(Error("element must be a DOM node when calling triggerEvent")); if (typeof jQuery != "undefined") {
+ var d =
+[]; e(a, b) && d.push({ Aa: a.checked }); jQuery(a).trigger(b, d)
+ } else if (typeof document.createEvent == "function") typeof a.dispatchEvent == "function" ? (d = document.createEvent(h[b] || "HTMLEvents"), d.initEvent(b, !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, a), a.dispatchEvent(d)) : c(Error("The supplied element doesn't support dispatchEvent")); else if (typeof a.fireEvent != "undefined") {
+ if (b == "click" && a.tagName == "INPUT" && (a.type.toLowerCase() == "checkbox" || a.type.toLowerCase() == "radio")) a.checked = a.checked !== !0; a.fireEvent("on" +
+b)
+ } else c(Error("Browser doesn't support triggering events"))
+ }, d: function (a) { return p.C(a) ? a() : a }, Ea: function (a, b) { return p.a.h((a.className || "").split(/\s+/), b) >= 0 }, pa: function (a, b, d) { var e = p.a.Ea(a, b); if (d && !e) a.className = (a.className || "") + " " + b; else if (e && !d) { for (var d = (a.className || "").split(/\s+/), e = "", f = 0; f < d.length; f++) d[f] != b && (e += d[f] + " "); a.className = p.a.k(e) } }, Ua: function (a, b) { for (var a = p.a.d(a), b = p.a.d(b), d = [], e = a; e <= b; e++) d.push(e); return d }, U: function (a) {
+ for (var b = [], d = 0, e = a.length; d <
+e; d++) b.push(a[d]); return b
+ }, S: b, Ma: a, ea: function (a, b) { for (var d = p.a.U(a.getElementsByTagName("INPUT")).concat(p.a.U(a.getElementsByTagName("TEXTAREA"))), e = typeof b == "string" ? function (a) { return a.name === b } : function (a) { return b.test(a.name) }, f = [], h = d.length - 1; h >= 0; h--) e(d[h]) && f.push(d[h]); return f }, F: function (a) { if (typeof a == "string" && (a = p.a.k(a))) { if (window.JSON && window.JSON.parse) return window.JSON.parse(a); return (new Function("return " + a))() } return o }, Y: function (a) {
+ (typeof JSON == "undefined" || typeof JSON.stringify ==
+"undefined") && c(Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js")); return JSON.stringify(p.a.d(a))
+ }, Ta: function (a, b, d) {
+ var d = d || {}, e = d.params || {}, f = d.includeFields || this.ca, h = a; if (typeof a == "object" && a.tagName == "FORM") for (var h = a.action, g = f.length - 1; g >= 0; g--) for (var i = p.a.ea(a, f[g]), k = i.length - 1; k >= 0; k--) e[i[k].name] = i[k].value; var b = p.a.d(b),
+j = document.createElement("FORM"); j.style.display = "none"; j.action = h; j.method = "post"; for (var u in b) a = document.createElement("INPUT"), a.name = u, a.value = p.a.Y(p.a.d(b[u])), j.appendChild(a); for (u in e) a = document.createElement("INPUT"), a.name = u, a.value = e[u], j.appendChild(a); document.body.appendChild(j); d.submitter ? d.submitter(j) : j.submit(); setTimeout(function () { j.parentNode.removeChild(j) }, 0)
+ }
+ }
+ }; p.b("ko.utils", p.a); p.b("ko.utils.arrayForEach", p.a.g); p.b("ko.utils.arrayFirst", p.a.xa);
+ p.b("ko.utils.arrayFilter", p.a.K); p.b("ko.utils.arrayGetDistinctValues", p.a.L); p.b("ko.utils.arrayIndexOf", p.a.h); p.b("ko.utils.arrayMap", p.a.M); p.b("ko.utils.arrayPushAll", p.a.u); p.b("ko.utils.arrayRemoveItem", p.a.N); p.b("ko.utils.fieldsIncludedWithJsonPost", p.a.ca); p.b("ko.utils.getElementsHavingAttribute", p.a.da); p.b("ko.utils.getFormFields", p.a.ea); p.b("ko.utils.postJson", p.a.Ta); p.b("ko.utils.parseJson", p.a.F); p.b("ko.utils.registerEventHandler", p.a.t); p.b("ko.utils.stringifyJson", p.a.Y);
+ p.b("ko.utils.range", p.a.Ua); p.b("ko.utils.toggleDomNodeCssClass", p.a.pa); p.b("ko.utils.triggerEvent", p.a.qa); p.b("ko.utils.unwrapObservable", p.a.d); Function.prototype.bind || (Function.prototype.bind = function (e) { var d = this, b = Array.prototype.slice.call(arguments), e = b.shift(); return function () { return d.apply(e, b.concat(Array.prototype.slice.call(arguments))) } });
+ p.a.e = new function () { var e = 0, d = "__ko__" + (new Date).getTime(), b = {}; return { get: function (a, b) { var d = p.a.e.getAll(a, !1); return d === m ? m : d[b] }, set: function (a, b, d) { d === m && p.a.e.getAll(a, !1) === m || (p.a.e.getAll(a, !0)[b] = d) }, getAll: function (a, f) { var h = a[d]; if (!h) { if (!f) return; h = a[d] = "ko" + e++; b[h] = {} } return b[h] }, clear: function (a) { var e = a[d]; e && (delete b[e], a[d] = o) } } };
+ p.a.p = new function () {
+ function e(a, d) { var e = p.a.e.get(a, b); e === m && d && (e = [], p.a.e.set(a, b, e)); return e } function d(a) { var b = e(a, !1); if (b) for (var b = b.slice(0), d = 0; d < b.length; d++) b[d](a); p.a.e.clear(a); typeof jQuery == "function" && typeof jQuery.cleanData == "function" && jQuery.cleanData([a]) } var b = "__ko_domNodeDisposal__" + (new Date).getTime(); return { ba: function (a, b) { typeof b != "function" && c(Error("Callback must be a function")); e(a, !0).push(b) }, ja: function (a, d) {
+ var h = e(a, !1); h && (p.a.N(h, d), h.length == 0 && p.a.e.set(a,
+b, m))
+ }, v: function (a) { if (!(a.nodeType != 1 && a.nodeType != 9)) { d(a); var b = []; p.a.u(b, a.getElementsByTagName("*")); for (var a = 0, e = b.length; a < e; a++) d(b[a]) } }, removeNode: function (a) { p.v(a); a.parentNode && a.parentNode.removeChild(a) }
+ }
+ }; p.v = p.a.p.v; p.removeNode = p.a.p.removeNode; p.b("ko.cleanNode", p.v); p.b("ko.removeNode", p.removeNode); p.b("ko.utils.domNodeDisposal", p.a.p); p.b("ko.utils.domNodeDisposal.addDisposeCallback", p.a.p.ba); p.b("ko.utils.domNodeDisposal.removeDisposeCallback", p.a.p.ja);
+ p.a.Sa = function (e) { if (typeof jQuery != "undefined") e = jQuery.clean([e]); else { var d = p.a.k(e).toLowerCase(), b = document.createElement("div"), d = d.match(/^<(thead|tbody|tfoot)/) && [1, "