The Toolkit for Online Communities
17320 Community Members, 0 members online, 1851 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Development : FYI: Added a file for basic javascript function library

Forum OpenACS Development: FYI: Added a file for basic javascript function library

Icon of envelope Request notifications

I've added a file at packages/acs-subsite/www/resources/core.js, which can be the starting point for our growing library of Javascript helper functions.

So far, we have:

1. acs_Focus, which is used to set focus on form elements in a safe way, without annoying browser errors if the element is not available.

2. acs_FormRefresh, which can be used with ad_form to make a form refresh when you change a value in a radio widget, say.

3. acs_CopyText, which can be used to copy text to the clipboard (works on IE, and on Mozilla, if you know how to configure your browser, which is very tricky). This also requires a special hidden textarea in the page to work, which is included in blank-master.adp.

The core.js file is automatically loaded by blank-master.

Feel free to add your own useful javascript functions to the library, so we can grow it a bit.