Skip to content

Commit

Permalink
Updated to 2013.02.a
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmcrty committed Jan 19, 2014
1 parent baca5e3 commit 7549284
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 36 deletions.
21 changes: 0 additions & 21 deletions jquery.SPServices-2013.02.min.js

This file was deleted.

35 changes: 20 additions & 15 deletions jquery.SPServices-2013.02.js → jquery.SPServices-2013.02a.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* SPServices - Work with SharePoint's Web Services using jQuery
* Version 2013.02
* Version 2013.02a
* @requires jQuery v1.8 or greater - jQuery 1.10.x recommended
*
* Copyright (c) 2009-2013 Sympraxis Consulting LLC
Expand All @@ -17,14 +17,14 @@
* @author Sympraxis Consulting LLC/[email protected]
*/
/* jshint undef: true */
/* global _spUserId, _spPageContextInfo, GipAddSelectedItems, GipRemoveSelectedItems, GipGetGroupData */
/* global L_Menu_BaseUrl, _spUserId, _spPageContextInfo, GipAddSelectedItems, GipRemoveSelectedItems, GipGetGroupData */

(function ($) {

"use strict";

// Version info
var VERSION = "2012.02"; // TODO: Update version
var VERSION = "2012.02a"; // TODO: Update version

// String constants
// General
Expand Down Expand Up @@ -416,12 +416,13 @@
// Build the URL for the Ajax call based on which operation we're calling
// If the webURL has been provided, then use it, else use the current site
var ajaxURL = "_vti_bin/" + WSops[opt.operation][0] + ".asmx";
var thisSite = $().SPServices.SPGetCurrentSite();
if(opt.webURL.charAt(opt.webURL.length - 1) === SLASH) {
ajaxURL = opt.webURL + ajaxURL;
} else if(opt.webURL.length > 0) {
ajaxURL = opt.webURL + SLASH + ajaxURL;
} else {
ajaxURL = $().SPServices.SPGetCurrentSite() + SLASH + ajaxURL;
ajaxURL = thisSite + ((thisSite.charAt(thisSite.length - 1) === SLASH) ? ajaxURL : (SLASH + ajaxURL));
}

SOAPEnvelope.payload = "";
Expand Down Expand Up @@ -536,7 +537,7 @@
addToPayload(opt, ["listName", "viewFields", "since", "contains"]);
break;
case "GetListItemChangesSinceToken":
addToPayload(opt, ["listName", "viewName", "query", "viewFields", "rowLimit", "queryOptions", "changeToken", "contains"]);
addToPayload(opt, ["listName", "viewName", ["query", "CAMLQuery"], ["viewFields", "CAMLViewFields"], ["rowLimit", "CAMLRowLimit"], ["queryOptions", "CAMLQueryOptions"], {name: "changeToken", sendNull: false}, {name: "contains", sendNull: false}]);
break;
case "GetVersionCollection":
addToPayload(opt, ["strlistID", "strlistItemID", "strFieldName"]);
Expand Down Expand Up @@ -1813,9 +1814,10 @@
// Get info about the related list
relatedListXML = $(xData.responseXML).find("List");
// Save the information about each column requested
for (i=0; i < opt.relatedColumns.length; i++) {
for(i=0; i < opt.relatedColumns.length; i++) {
relatedColumnsXML[opt.relatedColumns[i]] = $(xData.responseXML).find("Fields > Field[Name='" + opt.relatedColumns[i] + "']");
}
relatedColumnsXML[opt.relatedListColumn] = $(xData.responseXML).find("Fields > Field[Name='" + opt.relatedListColumn + "']");
}
});

Expand Down Expand Up @@ -1888,7 +1890,7 @@
camlQuery += "<Eq><FieldRef Name='" +
(opt.matchOnId ? "ID' /><Value Type='Counter'>" : opt.relatedListColumn + "'/><Value Type='Text'>") +
escapeColumnValue(columnSelectSelected[0]) + "</Value></Eq>";
};
}

if(opt.CAMLQuery.length > 0) {
camlQuery += opt.CAMLQuery + "</And>";
Expand Down Expand Up @@ -2709,7 +2711,7 @@
"width": "auto", // We want the clone to resize its width based on the contents
"height": 0, // Just to keep the page clean while we are using the clone
"visibility": "hidden" // And let's keep it hidden
})
});

// Add all the values to the cloned select. First the left (possible values) select...
$(thisMultiSelect.master.candidateControl).find("option").each(function() {
Expand Down Expand Up @@ -3254,7 +3256,7 @@
matches = rxQS.exec(args[i]);
if(rxQS.test(location.href)) {
if(matches !== null && matches.length > 2) {
queryStringVals[matches[1]] = unescape(matches[2]).replace(/\+/g,' ');
queryStringVals[matches[1]] = decodeURIComponent(matches[2]).replace(/\+/g,' ');
}
}
}
Expand Down Expand Up @@ -3365,7 +3367,7 @@
completefunc: function(xData) {
// If present, call completefunc when all else is done
if(opt.completefunc !== null) {
opt.completefunc(xData, Status);
opt.completefunc(xData);
}
}
});
Expand Down Expand Up @@ -3668,12 +3670,12 @@

// SharePoint 2010 gives us a context variable
if(typeof _spPageContextInfo !== "undefined") {
this.thisSite = _spPageContextInfo.webAbsoluteUrl;
this.thisSite = _spPageContextInfo.webServerRelativeUrl;
this.thisList = _spPageContextInfo.pageListId;
this.thisUserId = _spPageContextInfo.userId;
// In SharePoint 2007, we know the UserID only
} else {
this.thisSite = "";
this.thisSite = L_Menu_BaseUrl;
this.thisList = "";
this.thisUserId = (typeof _spUserId !== "undefined") ? _spUserId : undefined;
}
Expand Down Expand Up @@ -3947,17 +3949,21 @@
// paramArray = an array of option names to add to the payload
// "paramName" if the parameter name and the option name match
// ["paramName", "optionName"] if the parameter name and the option name are different (this handles early "wrappings" with inconsistent naming)
// {name: "paramName", sendNull: false} indicates the element is marked as "add to payload only if non-null"
function addToPayload(opt, paramArray) {

var i;

for (i=0; i < paramArray.length; i++) {
for(i=0; i < paramArray.length; i++) {
// the parameter name and the option name match
if(typeof paramArray[i] === "string") {
SOAPEnvelope.payload += wrapNode(paramArray[i], opt[paramArray[i]]);
// the parameter name and the option name are different
} else if(paramArray[i].length === 2) {
} else if($.isArray(paramArray[i]) && paramArray[i].length === 2) {
SOAPEnvelope.payload += wrapNode(paramArray[i][0], opt[paramArray[i][1]]);
// the element not a string or an array and is marked as "add to payload only if non-null"
} else if((typeof paramArray[i] === "object") && (paramArray[i].sendNull !== undefined)) {
SOAPEnvelope.payload += ((opt[paramArray[i].name] === undefined) || (opt[paramArray[i].name].length === 0)) ? "" : wrapNode(paramArray[i].name, opt[paramArray[i].name]);
// something isn't right, so report it
} else {
errBox(opt.operation, "paramArray[" + i + "]: " + paramArray[i], "Invalid paramArray element passed to addToPayload()");
Expand Down Expand Up @@ -4063,5 +4069,4 @@
this.value = spl[1];
}


})(jQuery);
21 changes: 21 additions & 0 deletions jquery.SPServices-2013.02a.min.js

Large diffs are not rendered by default.

0 comments on commit 7549284

Please sign in to comment.