Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

Commit

Permalink
Updated for 1.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
GitBrent authored and GitBrent committed Feb 17, 2018
1 parent 5286479 commit fb1064c
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 70 deletions.
24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Change Log

## [v1.5.0](https://github.com/gitbrent/sprestlib/tree/v1.5.0) (2018-02-??)
## [v1.5.0](https://github.com/gitbrent/sprestlib/tree/v1.5.0) (2018-02-16)
[Full Changelog](https://github.com/gitbrent/sprestlib/compare/v1.4.0...v1.5.0)

**Implemented Enhancements:**
- Form binding/population spun off into separate `sprestlib-ui.js` library
- Added new dist file - minified library: `sprestlib.min.js`
- Created a separate demo page for `sprestlib-ui.js` library
- Added new dist file (minified library): `sprestlib.min.js`

**Fixed Bugs:**
- Selecting the same field name twice results in undefined [\#15](https://github.com/gitbrent/sprestlib/issues/15) ([gitbrent](https://github.com/gitbrent))
- Fixed a null-check defect in REST result parsing




Expand All @@ -25,6 +28,7 @@




## [v1.3.0](https://github.com/gitbrent/sprestlib/tree/v1.3.0) (2017-11-27)
[Full Changelog](https://github.com/gitbrent/sprestlib/compare/v1.2.1...v1.3.0)

Expand All @@ -37,6 +41,7 @@




## [v1.2.1](https://github.com/gitbrent/sprestlib/tree/v1.2.1) (2017-10-12)
[Full Changelog](https://github.com/gitbrent/sprestlib/compare/v1.2.0...v1.2.1)

Expand All @@ -46,6 +51,7 @@




## [v1.2.0](https://github.com/gitbrent/sprestlib/tree/v1.2.0) (2017-10-05)
[Full Changelog](https://github.com/gitbrent/sprestlib/compare/v1.1.0...v1.2.0)

Expand All @@ -58,6 +64,7 @@




## [v1.1.0](https://github.com/gitbrent/sprestlib/tree/v1.1.0) (2017-09-07)
[Full Changelog](https://github.com/gitbrent/sprestlib/compare/v1.0.0...v1.1.0)

Expand All @@ -68,6 +75,7 @@




## [v1.0.0](https://github.com/gitbrent/sprestlib/tree/v1.0.0) (2017-08-08)
[Full Changelog](https://github.com/gitbrent/sprestlib/compare/v0.12.0...v1.0.0)

Expand All @@ -76,12 +84,18 @@
- Node connectivity to SharePoint (Office 365) works now
- Last bit of cleanup work to arrive at v1.0.0




## [v0.12.0](https://github.com/gitbrent/sprestlib/tree/v0.12.0) (2017-07-05)
[Full Changelog](https://github.com/gitbrent/sprestlib/compare/v0.11.0...v0.12.0)

**Fixed Bugs:**
- Lots of code cleanup and bug fixes




## [v0.11.0](https://github.com/gitbrent/sprestlib/tree/v0.11.0) (2017-06-25)
[Full Changelog](https://github.com/gitbrent/sprestlib/compare/v0.10.0...v0.11.0)

Expand All @@ -96,11 +110,17 @@
- Added sprestlib.bundle.js file (using gulp)
- Added bower support




## [v0.10.0](https://github.com/gitbrent/sprestlib/tree/v1.0.0) (2017-05-11)

**Code Cleanup**
**New Features**




## [v0.9.0](https://github.com/gitbrent/sprestlib/tree/v1.0.0) (2017-01-31)

**Initial Release**
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,13 @@ to load the SpRestLib bundle script dynamically:
```javascript
// 1: Load SpRestLib via CDN
var script = document.createElement('script');
script.src = "https://cdn.rawgit.com/gitbrent/SpRestLib/v1.4.0/dist/sprestlib.bundle.js";
script.src = "https://cdn.rawgit.com/gitbrent/SpRestLib/v1.5.0/dist/sprestlib.bundle.js";
document.getElementsByTagName('head')[0].appendChild(script);

// 2: Try some library methods
// 2: Test drive some library methods
// Show current user info
sprLib.user().info().then( objUser => (console.table ? console.table([objUser]) : console.log(objUser)) );
// Show all Lists/Libraries on the current Site
sprLib.site().lists().then( arrLists => (console.table ? console.table(arrLists) : console.log(arrLists)) );
```

Expand Down
2 changes: 1 addition & 1 deletion dist/sprestlib-ui.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sprestlib-ui.bundle.js.map

Large diffs are not rendered by default.

103 changes: 51 additions & 52 deletions dist/sprestlib-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

(function(){
// APP VERSION/BUILD
var APP_VER = "1.0.0-beta";
var APP_BLD = "20180114";
var APP_VER = "1.0.0";
var APP_BLD = "20180216";
var SPRLIB_REQ = "1.4.0+";
var DEBUG = false; // (verbose mode/lots of logging)
// APP MESSAGE STRINGS (Internationalization)
Expand Down Expand Up @@ -163,9 +163,8 @@
==================================================================================================
*/

// TODO: Unimplemented/undocumented/undemoed
// TODO: Unimplemented/undocumented/undemoed... need to: Validate/Update/Document
function doParseFormIntoJson(inModel, inEleId) {
// TODO: Validate/Update/Document for post-1.0.0
var objReturn = {
jsonSpData: {},
jsonFormat: {}
Expand Down Expand Up @@ -195,49 +194,49 @@
var dataName = ( inModel.listCols[strCol] ? inModel.listCols[strCol].dataName : strCol );

// C: Handle various element types
// TODO: add new HTML5 tags

// CASE: <checkbox>
if ( $(this).is(':checkbox') ) {
objReturn.jsonSpData[dataName] = $(this).prop('checked');
objReturn.jsonFormat[strCol] = APP_STRINGS[APP_OPTS.language][$(this).prop('checked').toString()];
}
// CASE: <jquery-ui datepicker>
else if ( $(this).val() && $(this).hasClass('hasDatepicker') ) {
objReturn.jsonSpData[dataName] = $(this).datepicker('getDate').toISOString();
objReturn.jsonFormat[strCol] = ( inModel.listCols[strCol].dateFormat ? bdeLib.localDateStrFromSP(null,$(this).datepicker('getDate'),inModel.listCols[strCol].dateFormat) : $(this).datepicker('getDate').toISOString() );
}
// CASE: <select:single>
else if ( $(this).val() && $(this).prop('type') == 'select-one' ) {
objReturn.jsonSpData[dataName] = ($(this).data('type') && ($(this).data('type') == 'num' || $(this).data('type') == 'pct')) ? Number($(this).val()) : $(this).val().toString();
objReturn.jsonFormat[strCol] = objReturn.jsonSpData[dataName];
}
// CASE: <select:multiple>
else if ( $(this).val() && $(this).prop('type') == 'select-multiple' ) {
// TODO: This is for multi-lookup! Multi-choice w/b different - add code!
// EX: (SP2013/16): { "SkillsId": { "__metadata":{"type":"Collection(Edm.Int32)"}, "results":[1,2,3] } }
var arrIds = [];
$.each($(this).val(), function(i,val){ arrIds.push( Number(val) ); });
objReturn.jsonSpData[dataName] = { "__metadata":{"type":"Collection(Edm.Int32)"}, "results":arrIds };
objReturn.jsonFormat[strCol] = arrIds.toString();
}
// CASE: <radiobutton>
else if ( $(this).val() && $(this).is(':radio') ) {
// TODO: FUTURE: Add radiobutton, get value by name or whatever
}
// CASE: <textarea>
else if ( $(this).text() && $(this).prop('tagName').toUpperCase() == 'TEXTAREA' ) {
objReturn.jsonSpData[dataName] = $(this).text();
objReturn.jsonFormat[strCol] = $(this).text();
}
// CASE: (everything else - excluding buttons)
else if ( $(this).val() && $(this).prop('type') != 'submit' && $(this).prop('type') != 'reset' && $(this).prop('type') != 'button' ) {
objReturn.jsonSpData[dataName] = $(this).val();
objReturn.jsonFormat[strCol] = $(this).val();
}
// CASE: No value
else {
objReturn.jsonFormat[strCol] = '';
{
// CASE: <checkbox>
if ( $(this).is(':checkbox') ) {
objReturn.jsonSpData[dataName] = $(this).prop('checked');
objReturn.jsonFormat[strCol] = APP_STRINGS[APP_OPTS.language][$(this).prop('checked').toString()];
}
// CASE: <jquery-ui datepicker>
else if ( $(this).val() && $(this).hasClass('hasDatepicker') ) {
objReturn.jsonSpData[dataName] = $(this).datepicker('getDate').toISOString();
objReturn.jsonFormat[strCol] = ( inModel.listCols[strCol].dateFormat ? bdeLib.localDateStrFromSP(null,$(this).datepicker('getDate'),inModel.listCols[strCol].dateFormat) : $(this).datepicker('getDate').toISOString() );
}
// CASE: <select:single>
else if ( $(this).val() && $(this).prop('type') == 'select-one' ) {
objReturn.jsonSpData[dataName] = ($(this).data('type') && ($(this).data('type') == 'num' || $(this).data('type') == 'pct')) ? Number($(this).val()) : $(this).val().toString();
objReturn.jsonFormat[strCol] = objReturn.jsonSpData[dataName];
}
// CASE: <select:multiple>
else if ( $(this).val() && $(this).prop('type') == 'select-multiple' ) {
// TODO: This is for multi-lookup! Multi-choice w/b different - add code!
// EX: (SP2013/16): { "SkillsId": { "__metadata":{"type":"Collection(Edm.Int32)"}, "results":[1,2,3] } }
var arrIds = [];
$.each($(this).val(), function(i,val){ arrIds.push( Number(val) ); });
objReturn.jsonSpData[dataName] = { "__metadata":{"type":"Collection(Edm.Int32)"}, "results":arrIds };
objReturn.jsonFormat[strCol] = arrIds.toString();
}
// CASE: <radiobutton>
else if ( $(this).val() && $(this).is(':radio') ) {
// TODO: FUTURE: Add radiobutton, get value by name or whatever
}
// CASE: <textarea>
else if ( $(this).text() && $(this).prop('tagName').toUpperCase() == 'TEXTAREA' ) {
objReturn.jsonSpData[dataName] = $(this).text();
objReturn.jsonFormat[strCol] = $(this).text();
}
// CASE: (everything else - excluding buttons)
else if ( $(this).val() && $(this).prop('type') != 'submit' && $(this).prop('type') != 'reset' && $(this).prop('type') != 'button' ) {
objReturn.jsonSpData[dataName] = $(this).val();
objReturn.jsonFormat[strCol] = $(this).val();
}
// CASE: No value
else {
objReturn.jsonFormat[strCol] = '';
}
}

// D: Special Cases:
Expand Down Expand Up @@ -327,11 +326,10 @@
}
});
}

// 2: If a column is in a [select] text/value, then add it to cols!
if ( objTagData.text && objTagData.cols.indexOf(objTagData.text) == -1 ) arrColNames.push(objTagData.text);
if ( objTagData.value && objTagData.cols.indexOf(objTagData.value) == -1 ) arrColNames.push(objTagData.value);
}
// If a column is in a [select] text/value, then those 2 are the query cols
if ( objTagData.text ) arrColNames.push(objTagData.text);
if ( objTagData.value ) arrColNames.push(objTagData.value);

if ( objTagData.filter ) {
// A: Param Check (NOTE: Dont use "!$(tag).filter.val" as actual value may be [false] or ""!)
Expand Down Expand Up @@ -369,6 +367,7 @@
}

$.each(objTagData.data, function(i,data){
console.log(data);
$(tag).append('<option value="'+ data[objTagData.value] +'">'+ data[objTagData.text] +'</option>');
});
}
Expand Down Expand Up @@ -493,7 +492,7 @@
+ strErr +'</td></tr>'
);
}
// TODO: show error in tag
// TODO: show error in tags other than table
console.error(strErr);
});
});
Expand Down
2 changes: 1 addition & 1 deletion dist/sprestlib.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sprestlib.bundle.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/sprestlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ var NODEJS = ( typeof module !== 'undefined' && module.exports );

(function(){
// APP VERSION/BUILD
var APP_VER = "1.5.0-beta";
var APP_BLD = "20180211";
var APP_VER = "1.5.0";
var APP_BLD = "20180216";
var DEBUG = false; // (verbose mode/lots of logging)
// ENUMERATIONS
var ENUM_PRINCIPALTYPES = {
Expand Down
2 changes: 1 addition & 1 deletion dist/sprestlib.min.js

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions lib/jquery.min.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sprestlib",
"version": "1.5.0-beta",
"version": "1.5.0",
"author": {
"name": "Brent Ely",
"url": "https://github.com/gitbrent/"
Expand All @@ -25,12 +25,11 @@
"url": "git+https://github.com/gitbrent/sprestlib.git"
},
"keywords": [
"sharepoint-group-library",
"javascript-odata",
"javascript-odata-library",
"javascript-rest-library",
"javascript-sp-web-services",
"sharepoint-javascript",
"sharepoint-javascript-app",
"sharepoint-javascript-framework",
"sharepoint-javascript-library",
"sharepoint-javascript-rest",
Expand All @@ -44,7 +43,9 @@
"sharepoint-rest",
"sharepoint-rest-api",
"sharepoint-rest-library",
"sharepoint-site",
"sharepoint-user-library",
"sharepoint-users",
"sharepoint-web-services",
"sharepoint-web-services-library",
"sp2013",
Expand Down

0 comments on commit fb1064c

Please sign in to comment.