This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Get join data and send HTTP request | |
| */ | |
| function submitForm () { | |
| // Get join values | |
| CF.getJoins(["s1", "s2", "s3", "s4"], function(joins) { | |
| // Create POST data | |
| var postFields = { | |
| z_name: joins["s1"].value, //Join S1 Name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Convert 0-255 to hex byte: | |
| String.fromCharCode(id) | |
| // Convert 01-FF to hex byte: | |
| String.fromCharCode(parseInt(id, 16)) | |
| // Convert hex byte to 0-ff: | |
| id.charCodeAt(0).toString(16); | |
| // Convert hex byte to 00-FF: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is a quick example on how to set a button active and inactive based on slider join value reaching extremities. | |
| // http://www.commandfusion.com/docs/scripting/startup.html#script_execution_and_lifetime | |
| CF.userMain = function() { | |
| // Setup a watch on the specific analog join you want to use, in our case analog join 10 | |
| // http://www.commandfusion.com/docs/scripting/gui.html#cF.JoinChangeEvent | |
| CF.watch(CF.JoinChangeEvent, "a10", function (join, value) { | |
| // This callback is run whenever the analog join 10 changes value | |
| // join = "a10" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is a quick example on how to scroll a list to a specific pixel position | |
| // defined by the value of an analog join. | |
| // http://www.commandfusion.com/docs/scripting/startup.html#script_execution_and_lifetime | |
| CF.userMain = function() { | |
| // Setup a watch on the specific analog join you want to use for the list scroll position | |
| // http://www.commandfusion.com/docs/scripting/gui.html#cF.JoinChangeEvent | |
| CF.watch(CF.JoinChangeEvent, "a10", function (join, value) { | |
| // This callback is run whenever the analog join 10 changes value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Quick example of watching data in a COM4 module | |
| var devices = CFLink.getDevices({ | |
| lanbridge: { | |
| id: "02", | |
| type: CFLink.model.LANBridge | |
| }, | |
| dinmod4: { | |
| id: "2B", | |
| type: CFLink.model.DINMOD4, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var parser = new DOMParser(); | |
| var xmlDoc = parser.parseFromString(body, 'text/xml'); | |
| // Get the data from XML | |
| var results = xmlDoc.evaluate("//Item", xmlDoc, null, XPathResult.ANY_TYPE, null); | |
| var infoItem = results.iterateNext(); | |
| while (infoItem) { | |
| CF.log("Name Attribute: " + infoItem.getAttribute("Name")); | |
| CF.log("Node Value: " + infoItem.childNodes[0].nodeValue); | |
| infoItem = results.iterateNext(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Color Picker module for CommandFusion | |
| =============================================================================== | |
| AUTHOR: Sergey Klenov, Jarrod Bell, Florent Pillet, CommandFusion | |
| CONTACT: support@commandfusion.com | |
| URL: https://github.com/CommandFusion/ | |
| VERSION: v1.0.2 | |
| LAST MOD: Thursday, 17 November 2011 | |
| ========================================================================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Push the modules into the startup process | |
| CF.modules.push({name: "Color Picker", object: ColorPicker}); | |
| var myColorPicker; | |
| // Only one CF.userMain function in all scripts is allowed! | |
| // If you have one already in your project, consolidate all their contents into one CF.userMain function | |
| CF.userMain = function () { | |
| myColorPicker = new ColorPicker("colorpicker.png", "s1", 750, function(r, g, b, x, y) { | |
| // This code will be run everytime the pixel color is obtained, along with the pixel data as parameters | |
| CF.send("AppleKNX", "\x06\x20\xF0\x80\x00\x15\x04\x00\x00\x00\xF0\x06\x01\x32\x00\x01\x01\x32\x03\x01" + String.fromCharCode(r) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function addLog (data) { | |
| CF.listAdd("l10", [{"s1": data, "s2": new Date().toTimeString()}]); | |
| // Automatically scroll to the bottom of the log | |
| CF.listInfo("l10", function (list, count) { | |
| CF.listScroll("l10", count, CF.BottomPosition, true); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [UTC-12] Niue Time | |
| [UTC-12] Samoa Standard Time | |
| [UTC-11] Hawaii-Aleutian Standard Time | |
| [UTC-11] Cook Island Time | |
| [UTC-9:30] Marquesas Islands Time | |
| [UTC-9] Alaska Standard Time | |
| [UTC-9] Gambier Island Time | |
| [UTC-8] Pacific Standard Time | |
| [UTC-7] Mountain Standard Time |