Config share functions

The java script share functions can be called in following case:

You can also select a workspace file or input the java script in the panel. To clean the file, open the dialog and click cancel button.

Config java script library for JSDT

The JSDT (come with WTP 3.x) could help to develop the share functions. Here are the steps:

  1. Download java script API, extract and copy xmlnode.js to a Dynamic/Static Web Project.
  2. Open project properties and select Project Facets in left tree. Ensure JavaScript Toolkit are checked.
  3. Select JavaScript -> Libraries in left tree. Click Add a Library Folder... and select the folder contain xmlnode.js.
Create or open a .js file in the project, set variable to new XMLNode() temporary like following one:
Sample script:
function removeNextSiblingIfBlank(node) {
  node = new XMLNode();//This line could let JSDT identify the object type - must remove before save file
  var nodeNext = node.getNextSibling();
  if (nodeNext != null && nodeNext.getNodeType() == 3) {
    if (nodeNext.getOuterHTML().trim().length == 0) {
      nodeNext.remove();
    }
  }
}
The content assist will display the JSDoc of XMLNode. Just remember to comment/remove the 2nd line before save the file.

www.000webhost.com