Functions
admin_formats.js File Reference

This file will be optimized and embedded in the HTML that is returned for the formats edit form. It will control the JavaScript and AJAX used for the editor form. More...

Functions

function ToggleFormatsDiv ()
 This simply opens and closes the display of the format editor area.
function EnableFormatChangeButton (in_format_id)
 This is called to set the browser state of the "change" button for the given format to enabled, allowing the user to execute an AJAX call to set the changed data.
function DisableFormatChangeButton (in_format_id)
 This is the opposite of the above. It blurs the control, so an enabled control is not selected.
function ChangeFormat (in_format_id, in_lang_enum_enum)
 This gathers the current state of the format, and sends it to the server in an AJAX call.
function ChangeFormatCallback (in_text)
 This is the AJAX callback for the format change. It disables the "Change" button upon successful completion.
function DeleteFormat (in_format_id, in_lang_enum_enum, script_uri)
 This deletes the given format in an AJAX call.
function DeleteFormatCallback (in_text, script_uri)
 This is the AJAX callback for the format delete.
function CopyFormat (in_format_id, in_lang_enum_enum, in_new_lang_enum, script_uri)
 This copies a format from one language to another. If the original format is blank, the copy is not made.
function CopyFormatCallback (in_text, script_uri)
 This is the AJAX callback for the copy. If the copy is successful, the fieldset of the old format is replaced with a new fieldset in the new language.
function CreateNewFieldset (in_format_id, in_lang_enum_enum)
 This creates a new format editor fieldset dynamically.
function ReSortFormats (script_uri)
 This sorts the formats, and redisplays them.

Detailed Description

This file will be optimized and embedded in the HTML that is returned for the formats edit form. It will control the JavaScript and AJAX used for the editor form.

This file is part of the Basic Meeting List Toolbox (BMLT).

Find out more at: http://magshare.org/bmlt

BMLT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

BMLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this code. If not, see <http://www.gnu.org/licenses/>.


Function Documentation

function ChangeFormat (   in_format_id,
  in_lang_enum_enum 
)

This gathers the current state of the format, and sends it to the server in an AJAX call.

Parameters:
in_format_idAn integer. The ID of the format.
in_lang_enum_enumA string. The enum of the format language.

Referenced by CopyFormatCallback(), and DisplayFormatsForEdit().

function ChangeFormatCallback (   in_text)

This is the AJAX callback for the format change. It disables the "Change" button upon successful completion.

The input is a JSON object from the server. It may contain a failure report. If so, an alert is shown with the report, and the button is not disabled.

Parameters:
in_textA JSON object from the server.

Referenced by ChangeFormat().

function CopyFormat (   in_format_id,
  in_lang_enum_enum,
  in_new_lang_enum,
  script_uri 
)

This copies a format from one language to another. If the original format is blank, the copy is not made.

Parameters:
in_format_idAn integer. The ID of the format.
in_lang_enum_enumA string. The enum of the source format language.
in_new_lang_enumA string. The enum of the new format language.
script_uriThe URI of the script for a refresh (if a new format).

Referenced by DisplayFormatsForEdit().

function CopyFormatCallback (   in_text,
  script_uri 
)

This is the AJAX callback for the copy. If the copy is successful, the fieldset of the old format is replaced with a new fieldset in the new language.

Parameters:
in_textA JSON object from the server.
script_uriThe URI of the script for a refresh (if a new format).

Referenced by CopyFormat().

function CreateNewFieldset (   in_format_id,
  in_lang_enum_enum 
)

This creates a new format editor fieldset dynamically.

Parameters:
in_format_idAn integer. The ID of the format.
in_lang_enum_enumA string. The enum of the format language.
function DeleteFormat (   in_format_id,
  in_lang_enum_enum,
  script_uri 
)

This deletes the given format in an AJAX call.

Parameters:
in_format_idAn integer. The ID of the format.
in_lang_enum_enumA string. The enum of the format language.
script_uriThe URI of the script for a refresh (if a new format).

Referenced by DisplayFormatsForEdit().

function DeleteFormatCallback (   in_text,
  script_uri 
)

This is the AJAX callback for the format delete.

The input is a JSON object from the server. It may contain a failure report. If so, an alert is shown with the report. If successful, the line is removed from the form, and a report alert is displayed.

Parameters:
in_textA JSON object from the server.
script_uriThe URI of the script for a refresh (if a new format).

Referenced by DeleteFormat().

function DisableFormatChangeButton (   in_format_id)

This is the opposite of the above. It blurs the control, so an enabled control is not selected.

Parameters:
in_format_idAn integer. The ID of the format.

Referenced by ChangeFormatCallback().

function EnableFormatChangeButton (   in_format_id)

This is called to set the browser state of the "change" button for the given format to enabled, allowing the user to execute an AJAX call to set the changed data.

Parameters:
in_format_idAn integer. The ID of the format.

Referenced by DisplayFormatsForEdit().

function ReSortFormats (   script_uri)

This sorts the formats, and redisplays them.

Referenced by DisplayFormatsForEdit().

function ToggleFormatsDiv ( )

This simply opens and closes the display of the format editor area.

 All Classes Files Functions Variables Enumerations