How to use Authentic Authoring Client Event Functions

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  CMS Placeholder Control introduction > CMS Placeholder Control for Authentic Browser Edition >

How to use Authentic Authoring Client Event Functions

The properties of category "Authentic Authoring Client Event Functions" can be used to specify a function name, which is called when the relevant event of the Authentic Browser Plugin occurs.

 

The user is responsible for implementing that function in the client script code.

 

The Authentic CMS Placeholder Control automatically attaches all necessary callbacks to the plugin and calls the specified function on the client.

 

Example: How to customize the toolbar with a custom button

 

Add two functions in your aspx-file:

 

<script language="javascript">

 var bCheckBtn  = False; // helper To toggle the button state

 var pluginName = 'AuthenticPlaceholderControl1_AuthoringModeControlsContainer__ctl0_objPlugIn';

 

 Function MyOnInitBeforeStartEditing()

 {

         // Get Browser Plugin

         var oPlugin = document.getElementById( pluginName );

         var nBtns = oPlugin.ToolbarRows.Item(1).Buttons.Count;

         // Append a separator

         oPlugin.ToolbarRows.Item(1).Buttons.NewSeparator( nBtns + 1);

         // Append your custom button

         oPlugin.ToolbarRows.Item(1).Buttons.NewCustomButton(

                 nBtns + 2,

                 "YourFunction",

                 "Tooltip describing function",

                 "YourFunction.bmp");

 }

 Function MyOnDocEditCommand()

 {

         // Get the Browser Plugin

         var oPlugin = document.getElementById( pluginName );

         If ( oPlugin.event.type == 'update' ) // button state is retrieved

         {

                 If ( oPlugin.event.srcElement.Name == 'YourFunction' )

                 {

                         oPlugin.event.cancelBubble = True;

                         If ( bCheckBtn )

                                 oPlugin.event.returnValue  = 3; // enable And check button

                         Else

                                 oPlugin.event.returnValue  = 1; // enable button

                 }

         }

         Else If ( oPlugin.event.type == 'command' ) // button was pressed

         {        

                 If ( oPlugin.event.srcElement.Name == 'YourFunction' )

                 {

                         bCheckBtn = !bCheckBtn;

                         window.alert("Your function");

                 }

         }

 }

</script>

 

Specify your function names in the properties of the CMS Placeholder Control:

 

Prop_CustomizeToolbar

 

 


© 2019 Altova GmbH