Content Preview: rss
541 days ago
581 days ago
Debugging Gadgets can be a little frustrating, not only whilst coding; but also when trying to get useful feedback from users who've reported issues. The simplest way to achieve this, is to log debug entries out to a file. In the example below, we check to see if "debug.txt" exists in the Gadget folder and if it does write debugging information to it. The first step is to see if the file exists and open it. In the following code, we create a BOOLEAN variable "bDebug" which we can use later to output more detailed information, beyond simply errors: var bDebug = oFSO.FileExists(gadgetPath+" \\debug.txt"); try{ if (bDebug) var debugLogFile = oFSO.OpenTextFile(gadgetPath+" \\debug.txt", 2); } catch(err) {bDebug = false; debugLog("Open debug.txt error: "+err.name+" - "+err.message)} //log a debug entry function debugLog(str) { try{ System.Debug.outputString(str); if (bDebug) ...
581 days ago
Allowing drag/drop First, you need to set up the HTML events to allow drag/drop. By default they're disabled, so you need to allow them. You do this by cancelling two drag events on the <BODY> tag: <BODY ondragenter="java script:event.returnValue = false" ondragover="java script:event.returnValue = false" > The next thing you need to do, is set up a function to handle the drag/drop action. This is also done on the <BODY> tag with the ondrop event. In this example, the function is fileDragDropped(), so your final <BODY> tag should be: <BODY ondragenter="java script:event.returnValue = false" ondragover="java script:event.returnValue = false" ondrop="fileDragDropped" > Handling File drag/drop from Explorer Files are passed through event.dataTransfer as an object with a collection of items inside. To extract each entry you need to use ...
785 days ago
791 days ago



