{"_id":"onboarding","_rev":"10-6bf5fefb63a20eeee7607bbec9ea4e24","name":"onboarding","description":"A simple frontend function chain for handeling onboarding","dist-tags":{"latest":"2.0.3"},"versions":{"1.0.0":{"name":"onboarding","version":"1.0.0","description":"A simple frontend function chain for handeling onboarding","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tyler-r-smith/q1s-onboarding.git"},"keywords":["Onboard","UX","UI"],"author":{"name":"tylerrsmith"},"license":"MIT","bugs":{"url":"https://github.com/tyler-r-smith/q1s-onboarding/issues"},"homepage":"https://github.com/tyler-r-smith/q1s-onboarding","_id":"onboarding@1.0.0","_shasum":"e935ee2aafc7c345546734d8bde98decfcd15fb3","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"tylerrsmith","email":"t@q1s.co"},"dist":{"shasum":"e935ee2aafc7c345546734d8bde98decfcd15fb3","tarball":"https://registry.npmjs.org/onboarding/-/onboarding-1.0.0.tgz","integrity":"sha512-XymKQ+Sh1SjUm2rloSTSmNLUfQq1OPINpvm0VcQCG7JYbhy7wkGsXW/mXxQfpvGHuMQxZZD9dwoAbM/uvSp2hg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHkVhHKvY3qpKbg8hNJTDa9E3TgnWTcG+kk5IB/o0feDAiBVLLmG1bG5cXcgvW8EsgSV8iYuZkY2zpB95AGtBjm53g=="}]},"maintainers":[{"name":"tylerrsmith","email":"t@q1s.co"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/onboarding-1.0.0.tgz_1459698904034_0.9678463584277779"},"directories":{}},"1.0.1":{"name":"onboarding","version":"1.0.1","description":"A simple frontend function chain for handeling onboarding","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tyler-r-smith/q1s-onboarding.git"},"keywords":["Onboard","UX","UI"],"author":{"name":"tylerrsmith"},"license":"MIT","bugs":{"url":"https://github.com/tyler-r-smith/q1s-onboarding/issues"},"homepage":"https://github.com/tyler-r-smith/q1s-onboarding","_id":"onboarding@1.0.1","_shasum":"db2eaa17538dc634c21e6487420f10cf9d3dea77","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"tylerrsmith","email":"t@q1s.co"},"dist":{"shasum":"db2eaa17538dc634c21e6487420f10cf9d3dea77","tarball":"https://registry.npmjs.org/onboarding/-/onboarding-1.0.1.tgz","integrity":"sha512-GI1Q/WlskMriYfCXqrMggtuOEbnIoc0VMOiG3ByUEFPf58Ha7C9/C3RfmweLxM4wKwk8FxXOjHqg5+QGifMcVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHsnp4y87BB6G1hS3E69xRjlH4ERbycMIFFhENxhkusYAiEAjkS6rrDCgMOIDWQEp05C80SGortidKkzBc0UANI9KfM="}]},"maintainers":[{"name":"tylerrsmith","email":"t@q1s.co"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/onboarding-1.0.1.tgz_1459698963202_0.7384639815427363"},"directories":{}},"1.0.2":{"name":"onboarding","version":"1.0.2","description":"A simple frontend function chain for handeling onboarding","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tyler-r-smith/q1s-onboarding.git"},"keywords":["Onboard","UX","UI"],"author":{"name":"tylerrsmith"},"license":"MIT","bugs":{"url":"https://github.com/tyler-r-smith/q1s-onboarding/issues"},"homepage":"https://github.com/tyler-r-smith/q1s-onboarding","_id":"onboarding@1.0.2","_shasum":"6ded2bab52a4cc2c051657e116faf59d89ff3665","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"tylerrsmith","email":"t@q1s.co"},"dist":{"shasum":"6ded2bab52a4cc2c051657e116faf59d89ff3665","tarball":"https://registry.npmjs.org/onboarding/-/onboarding-1.0.2.tgz","integrity":"sha512-v0qfzHg9g+gByYiFI/9Ms3QPRcW49qb9pkMYmGRdi/xPyZ9grw6NQa9W6VXB7ZwLfS6SRIBP3bPWTQshdIXPMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsk5dE/xCaOHC+U9FQ6nFaQxpDY/SluNDKj6yT7GolIgIgUsSZkTAzdW6blA1gnOuCIxyKGf6YvXF5Ues5VWACfXA="}]},"maintainers":[{"name":"tylerrsmith","email":"t@q1s.co"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/onboarding-1.0.2.tgz_1459701122079_0.7986223800107837"},"directories":{}},"1.0.3":{"name":"onboarding","version":"1.0.3","description":"A simple frontend function chain for handeling onboarding","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tyler-r-smith/q1s-onboarding.git"},"keywords":["Onboard","UX","UI"],"author":{"name":"tylerrsmith"},"license":"MIT","bugs":{"url":"https://github.com/tyler-r-smith/q1s-onboarding/issues"},"homepage":"https://github.com/tyler-r-smith/q1s-onboarding","_id":"onboarding@1.0.3","_shasum":"bfbceb83fa508e9afeda3f229cac129d36cecdc9","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"tylerrsmith","email":"t@q1s.co"},"dist":{"shasum":"bfbceb83fa508e9afeda3f229cac129d36cecdc9","tarball":"https://registry.npmjs.org/onboarding/-/onboarding-1.0.3.tgz","integrity":"sha512-kZNgIPabCYSuaky4SSJA9ZblpI0vtov3B45GVp244UFozb7FfI9KRJNZ0PzOSEqPw/HRUQz1uwqvOQilCwscWw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICBc73R4XJYXdEdcVTrKqo0ZwiBhGAOTsQTWCToXdkd8AiEA36BfVhMVw3MDXhBTVjefvh0p57uN75ZG8IRamIl49l0="}]},"maintainers":[{"name":"tylerrsmith","email":"t@q1s.co"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/onboarding-1.0.3.tgz_1459701893794_0.18800040055066347"},"directories":{}},"2.0.3":{"name":"onboarding","version":"2.0.3","description":"A simple frontend function chain for handeling onboarding","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tyler-r-smith/q1s-onboarding.git"},"keywords":["Onboard","UX","UI"],"author":{"name":"tylerrsmith"},"license":"MIT","bugs":{"url":"https://github.com/tyler-r-smith/q1s-onboarding/issues"},"homepage":"https://github.com/tyler-r-smith/q1s-onboarding","dependencies":{"random-id":"0.0.2"},"gitHead":"24d64488506e2fbe43d0ac3a7bdcf98e118770c6","_id":"onboarding@2.0.3","_shasum":"b4b3190798ad781c189bcf65e4ea2618eb92d5e0","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"tylerrsmith","email":"t@q1s.co"},"dist":{"shasum":"b4b3190798ad781c189bcf65e4ea2618eb92d5e0","tarball":"https://registry.npmjs.org/onboarding/-/onboarding-2.0.3.tgz","integrity":"sha512-njyTlkw0TxrAhuM7ixbfdxS5XBTyQFhNT17d6AmtO6CpsJeLzYci/N3x+t8MEd5yd7SOW4Ny7gNH1x7jrCdecQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiUjpF6ufvTqvYh8rfJoku4aNo19Jgy9XbfYZ9JY/UpwIhAPyagoxPrv9PsBjhER2xQnmdNbDs1339PChmrIZDQAzE"}]},"maintainers":[{"name":"tylerrsmith","email":"t@q1s.co"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/onboarding-2.0.3.tgz_1466617306206_0.4383116029202938"},"directories":{}}},"readme":"#Onboarding\n\nDefine some basic functions \nWrite a function to initialize the trigger\n```js\n//A trigger function which will start an emphasis if an element has not been clicked on within 5 seconds\nfunction _timed_trigger (element, emphasis) {\n    //Creates an array to allow for delayed checks on multiple elements.\n    this.check = this.check || {};\n    let elementID = element.getAttribute('id');\n    this.check[elementID] = this.check[elementID] || false;\n    \n    //If the triggered has already fired, we don't need to go further.\n    if (this.check[elementID])\n        return false;\n    \n    //Stop the trigger from triggering if the element is clicked on\n    //And call the remove emphasis if it has started\n    $(document).on('click', '#'+elementID, ()=> {\n        console.log(this);\n        //If the trigger is running, we want to stop the emphasis.\n        if (this.check[elementID] === \"started\")\n            this.remove_emphasis(elementID, emphasis);\n        \n        //The condition has been met, so we set this to true;\n        this.check[elementID] = true;\n    });\n\n    //Check after 5 Seconds if the element has been clicked\n    Meteor.setTimeout(() => {\n        if (!this.check[elementID]) {\n            //If the element has not been clicked run the callback for the trigger\n            //This will trigger the emphasis\n            this.start_emphasis(elementID, emphasis);\n\n            this.check[elementID] = 'started';\n        }\n    }, 5000);\n\n    //If a trigger function returns true it will start the emphasis immediately after running\n    //So we return false to stop the chain.\n    return false;\n}\n\nvar emphasis = {};\n//A simple emphasis that will pulse an element on start, and remove the pulse on stop\nemphasis._pluse = {\n    add: function (element) {\n        $(element).addClass('pulse animated infinite');\n    },\n    remove: function(element) {\n        $(element).removeClass('pulse animated infinite');\n    }\n};\n\n//The initialization function for the element,\n//this is how we tell the trigger to run.\nfunction initTrigger(){\n    Template.upload.rendered = () => {\n        this.run_trigger();\n    }\n}\n\n_onboard = new Onboarding();\n//We pass the name of the emphasis, this is how we will reference it in the element\n//Then we pass the emphasis start function, and then the emphasis  stop function\n_onboard.new_emphasis(\"emphasis_name\", emphasis._pluse.add, emphasis._pluse.remove);\n\n//We pass the trigger name, and then the trigger function,\n_onboard.new_trigger(\"trigger_name\", _timed_trigger);\n\n\nconst element = document.getElementById('Rectangle_6');\nconst title = document.getElementById('title');\n\n//We pass the id of the element, the trigger, and the emphasis.\n//Optionally we pass an initialization function (_element) to new element\n//This function must start the trigger other wise the trigger will never initialize.\n//If we leave this field empty the trigger will immediately initialize\n_onboard.new_element(element, \"trigger_name\", \"emphasis_name\", initTrigger);\n\n//Run the trigger function imedietly\n_onboard.new_element(title, \"trigger_name\", \"emphasis_name\");\n```\n","maintainers":[{"name":"tylerrsmith","email":"t@q1s.co"}],"time":{"modified":"2022-06-22T21:38:33.316Z","created":"2016-04-03T15:55:06.449Z","1.0.0":"2016-04-03T15:55:06.449Z","1.0.1":"2016-04-03T15:56:05.509Z","1.0.2":"2016-04-03T16:32:04.401Z","1.0.3":"2016-04-03T16:44:56.214Z","2.0.3":"2016-06-22T17:41:48.705Z"},"homepage":"https://github.com/tyler-r-smith/q1s-onboarding","keywords":["Onboard","UX","UI"],"repository":{"type":"git","url":"https://github.com/tyler-r-smith/q1s-onboarding.git"},"author":{"name":"tylerrsmith"},"bugs":{"url":"https://github.com/tyler-r-smith/q1s-onboarding/issues"},"license":"MIT","readmeFilename":"README.md","users":{}}