bmgt 485 week 8

SCORM/Week 8/scormcontent/index.html

SCORM/Week 8/scormcontent/lib/lzwcompress.js
/*
* lzwCompress.js
*
* Copyright (c) 2012-2016 floydpink
* Licensed under the MIT license.
*
* The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the “Software”), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

‘use strict’;

(function () {
var root = this;

var lzwCompress = (function (Array, JSON, undefined) {
var _self = {},
_lzwLoggingEnabled = false,
_lzwLog = function (message) {
try {
console.log(‘lzwCompress: ‘ +
(new Date()).toISOString() + ‘ : ‘ + (typeof(message) === ‘object’ ? JSON.stringify(message) : message));
} catch (e) {
}
};

// KeyOptimize
// http://stackoverflow.com/questions/4433402/replace-keys-json-in-javascript
(function (self, Array, JSON) {

var _keys = [],
comparer = function (key) {
return function (e) {
return e === key;
};
},
inArray = function (array,comparer) {
for (var i = 0; i < array.length; i++) { if (comparer(array[i])) { return true; } } return false; }, pushNew = function (array,element, comparer) { if (!inArray(array,comparer)) { array.push(element); } }, _extractKeys = function (obj) { if (typeof obj === 'object') { for (var key in obj) { if (!Array.isArray(obj)) { pushNew(_keys,key, comparer(key)); } _extractKeys(obj[key]); } } }, _encode = function (obj) { if (typeof obj !== 'object') { return obj; } for (var prop in obj) { if (!Array.isArray(obj)) { if (obj.hasOwnProperty(prop)) { obj[_keys.indexOf(prop)] = _encode(obj[prop]); delete obj[prop]; } } else { obj[prop] = _encode(obj[prop]); } } return obj; }, _decode = function (obj) { if (typeof obj !== 'object') { return obj; } for (var prop in obj) { if (!Array.isArray(obj)) { if (obj.hasOwnProperty(prop) && _keys[prop]) { obj[_keys[prop]] = _decode(obj[prop]); delete obj[prop]; } } else { obj[prop] = _decode(obj[prop]); } } return obj; }, compress = function (json) { _keys = []; var jsonObj = JSON.parse(json); _extractKeys(jsonObj); _lzwLoggingEnabled && _lzwLog('keys length : ' + _keys.length); _lzwLoggingEnabled && _lzwLog('keys : ' + _keys); return JSON.stringify({ __k : _keys, __v : _encode(jsonObj) }); }, decompress = function (minifiedJson) { var obj = minifiedJson; if (typeof(obj) !== 'object') { return minifiedJson; } if (!obj.hasOwnProperty('__k')) { return JSON.stringify(obj); } _keys = obj.__k; return _decode(obj.__v); }; self.KeyOptimize = { pack : compress, unpack : decompress }; }(_self, Array, JSON)); // LZWCompress // http://stackoverflow.com/a/2252533/218882 // http://rosettacode.org/wiki/LZW_compression#JavaScript (function (self, Array) { var compress = function (uncompressed) { if (typeof(uncompressed) !== 'string') { return uncompressed; } var i, dictionary = {}, c, wc, w = '', result = [], dictSize = 256; for (i = 0; i < 256; i += 1) { dictionary[String.fromCharCode(i)] = i; } for (i = 0; i < uncompressed.length; i += 1) { c = uncompressed.charAt(i); wc = w + c; if (dictionary[wc]) { w = wc; } else { if (dictionary[w] === undefined) { return uncompressed; } result.push(dictionary[w]); dictionary[wc] = dictSize++; w = String(c); } } if (w !== '') { result.push(dictionary[w]); } return result; }, decompress = function (compressed) { if (!Array.isArray(compressed)) { return compressed; } var i, dictionary = [], w, result, k, entry = '', dictSize = 256; for (i = 0; i < 256; i += 1) { dictionary[i] = String.fromCharCode(i); } w = String.fromCharCode(compressed[0]); result = w; for (i = 1; i < compressed.length; i += 1) { k = compressed[i]; if (dictionary[k]) { entry = dictionary[k]; } else { if (k === dictSize) { entry = w + w.charAt(0); } else { return null; } } result += entry; dictionary[dictSize++] = w + entry.charAt(0); w = entry; } return result; }; self.LZWCompress = { pack : compress, unpack : decompress }; }(_self, Array)); var _compress = function (obj) { _lzwLoggingEnabled && _lzwLog('original (uncompressed) : ' + obj); if (!obj || obj === true || obj instanceof Date) { return obj; } var result = obj; if (typeof obj === 'object') { result = _self.KeyOptimize.pack(JSON.stringify(obj)); _lzwLoggingEnabled && _lzwLog('key optimized: ' + result); } var packedObj = _self.LZWCompress.pack(result); _lzwLoggingEnabled && _lzwLog('packed (compressed) : ' + packedObj); return packedObj; }, _decompress = function (compressedObj) { _lzwLoggingEnabled && _lzwLog('original (compressed) : ' + compressedObj); if (!compressedObj || compressedObj === true || compressedObj instanceof Date) { return compressedObj; } var probableJSON, result = _self.LZWCompress.unpack(compressedObj); try { probableJSON = JSON.parse(result); } catch (e) { _lzwLoggingEnabled && _lzwLog('unpacked (uncompressed) : ' + result); return result; } if (typeof probableJSON === 'object') { result = _self.KeyOptimize.unpack(probableJSON); } _lzwLoggingEnabled && _lzwLog('unpacked (uncompressed) : ' + result); return result; }, _enableLogging = function (enable) { _lzwLoggingEnabled = enable; }; return { pack : _compress, unpack : _decompress, enableLogging : _enableLogging }; })(Array, JSON); if (typeof module !== 'undefined' && module.exports) { module.exports = lzwCompress; } else { root.lzwCompress = lzwCompress; } }).call(this); SCORM/Week 8/scormcontent/lib/player-0.0.11.min.js !function(a,b){function c(a){return function(){var b={method:a},c=Array.prototype.slice.call(arguments);/^get/.test(a)?(d.assert(c.length>0,”Get methods require a callback.”),c.unshift(b)):(/^set/.test(a)&&(d.assert(0!==c.length,”Set methods require a value.”),b.value=c[0]),c=[b]),this.send.apply(this,c)}}var d={};d.DEBUG=!1,d.VERSION=”0.0.11″,d.CONTEXT=”player.js”,d.POST_MESSAGE=!!a.postMessage,d.origin=function(b){return”//”===b.substr(0,2)&&(b=a.location.protocol+b),b.split(“/”).slice(0,3).join(“/”)},d.addEvent=function(a,b,c){a&&(a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent(“on”+b,c):a[“on”+b]=c)},d.log=function(){d.log.history=d.log.history||[],d.log.history.push(arguments),a.console&&d.DEBUG&&a.console.log(Array.prototype.slice.call(arguments))},d.isString=function(a){return”[object String]”===Object.prototype.toString.call(a)},d.isObject=function(a){return”[object Object]”===Object.prototype.toString.call(a)},d.isArray=function(a){return”[object Array]”===Object.prototype.toString.call(a)},d.isNone=function(a){return null===a||void 0===a},d.has=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},d.indexOf=function(a,b){if(null==a)return-1;var c=0,d=a.length;if(Array.prototype.IndexOf&&a.indexOf===Array.prototype.IndexOf)return a.indexOf(b);for(;d>c;c++)if(a[c]===b)return c;return-1},d.assert=function(a,b){if(!a)throw b||”Player.js Assert Failed”},d.Keeper=function(){this.init()},d.Keeper.prototype.init=function(){this.data={}},d.Keeper.prototype.getUUID=function(){return”listener-xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx”.replace(/[xy]/g,function(a){var b=16*Math.random()|0,c=”x”===a?b:3&b|8;return c.toString(16)})},d.Keeper.prototype.has=function(a,b){if(!this.data.hasOwnProperty(a))return!1;if(d.isNone(b))return!0;for(var c=this.data[a],e=0;e-1?f.loaded=!0:this.elem.onload=function(){f.loaded=!0}},d.Player.prototype.send=function(a,b,c){if(a.context=d.CONTEXT,a.version=d.VERSION,b){var e=this.keeper.getUUID();a.listener=e,this.keeper.one(e,a.method,b,c)}return this.isReady||”ready”===a.value?(d.log(“Player.send”,a,this.origin),this.loaded===!0&&this.elem.contentWindow.postMessage(JSON.stringify(a),this.origin),!0):(d.log(“Player.queue”,a),this.queue.push(a),!1)},d.Player.prototype.receive=function(a){if(d.log(“Player.receive”,a),a.origin!==this.origin)return!1;var b;try{b=JSON.parse(a.data)}catch(c){return!1}return b.context!==d.CONTEXT?!1:(“ready”===b.event&&b.value&&b.value.src===this.elem.src&&this.ready(b),void(this.keeper.has(b.event,b.listener)&&this.keeper.execute(b.event,b.listener,b.value,this)))},d.Player.prototype.ready=function(a){if(this.isReady===!0)return!1;a.value.events&&(this.events=a.value.events),a.value.methods&&(this.methods=a.value.methods),this.isReady=!0,this.loaded=!0;for(var b=0;b0)for(var e in c)return this.send({method:”removeEventListener”,value:a,listener:c[e]}),!0;return!1},d.Player.prototype.supports=function(a,b){d.assert(d.indexOf([“method”,”event”],a)>-1,’evtOrMethod needs to be either “event” or “method” got ‘+a),b=d.isArray(b)?b:[b];for(var c=”event”===a?this.events:this.methods,e=0;ee;e++){var g=d.METHODS.all()[e];d.Player.prototype.hasOwnProperty(g)||(d.Player.prototype[g]=c(g))}a.playerjs=d,d.addEvent(a,”message”,function(a){var b;try{b=JSON.parse(a.data)}catch(c){return!1}return b.context!==d.CONTEXT?!1:void(“ready”===b.event&&b.value&&b.value.src&&d.READIED.push(b.value.src))}),d.Receiver=function(a,b){this.init(a,b)},d.Receiver.prototype.init=function(c,e){var f=this;this.isReady=!1,this.origin=d.origin(b.referrer),this.methods={},this.supported={events:c?c:d.EVENTS.all(),methods:e?e:d.METHODS.all()},this.eventListeners={},this.reject=!(a.self!==a.top&&d.POST_MESSAGE),this.reject||d.addEvent(a,”message”,function(a){f.receive(a)})},d.Receiver.prototype.receive=function(b){if(b.origin!==this.origin)return!1;var c={};if(d.isObject(b.data))c=b.data;else try{c=a.JSON.parse(b.data)}catch(e){d.log(“JSON Parse Error”,e)}if(d.log(“Receiver.receive”,b,c),!c.method)return!1;if(c.context!==d.CONTEXT)return!1;if(-1===d.indexOf(d.METHODS.all(),c.method))return this.emit(“error”,{code:2,msg:’Invalid Method “‘+c.method+'”‘}),!1;var f=d.isNone(c.listener)?null:c.listener;if(“addEventListener”===c.method)this.eventListeners.hasOwnProperty(c.value)?-1===d.indexOf(this.eventListeners[c.value],f)&&this.eventListeners[c.value].push(f):this.eventListeners[c.value]=[f],”ready”===c.value&&this.isReady&&this.ready();else if(“removeEventListener”===c.method){if(this.eventListeners.hasOwnProperty(c.value)){var g=d.indexOf(this.eventListeners[c.value],f);g>-1&&this.eventListeners[c.value].splice(g,1),0===this.eventListeners[c.value].length&&delete this.eventListeners[c.value]}}else this.get(c.method,c.value,f)},d.Receiver.prototype.get=function(a,b,c){var d=this;if(!this.methods.hasOwnProperty(a))return this.emit(“error”,{code:3,msg:’Method Not Supported”‘+a+'”‘}),!1;var e=this.methods[a];if(“get”===a.substr(0,3)){var f=function(b){d.send(a,b,c)};e.call(this,f)}else e.call(this,b)},d.Receiver.prototype.on=function(a,b){this.methods[a]=b},d.Receiver.prototype.send=function(b,c,e){if(d.log(“Receiver.send”,b,c,e),this.reject)return d.log(“Receiver.send.reject”,b,c,e),!1;var f={context:d.CONTEXT,version:d.VERSION,event:b};d.isNone(c)||(f.value=c),d.isNone(e)||(f.listener=e);var g=JSON.stringify(f);a.parent.postMessage(g,””===this.origin?”*”:this.origin)},d.Receiver.prototype.emit=function(a,b){if(!this.eventListeners.hasOwnProperty(a))return!1;d.log(“Instance.emit”,a,b,this.eventListeners[a]);for(var c=0;c.icon{font-size:.75rem;margin-left:.3rem}.browser-support__dismiss{position:absolute;top:50%;right:3rem;width:3.4rem;height:3.4rem;line-height:3.4rem;margin-top:-1.7rem;border-radius:50%;background-color:#fafafa;border:none;padding:0;cursor:pointer;text-align:center}.browser-support__dismiss-icon{display:inline-block;font-size:3rem;line-height:normal!important;margin-top:-.25rem}.curtain{margin:2.9rem …

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 929 473-0077

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 20% with the discount code GURUH