function sakaiRegisterButtons(config)
{

  // register custom button for smiling face
  config.registerButton("smile", //button ID,
   "Insert Smiling Face", //tooltip,
   inputRichTextDir + "/images/regular_smile.gif", // image
   false, // textMode,

   function(editor, id)
   {
     editor._insertSmile( inputRichTextDir + "/images/regular_smile.gif","Insert Smiling Face");
   }
  );

  // register custom button for sad face
  config.registerButton("sad", //button ID,
   "Insert Sad Face", //tooltip,
   inputRichTextDir + "/images/sad_smile.gif", // image
   false, // textMode,

   function(editor, id)
   {
     editor._insertSmile( inputRichTextDir + "/images/sad_smile.gif","Insert Sad Face");
   }
  );

  // register custom button for audio recording
  config.registerButton("recordresponse", //button ID,
   "Record audio response", //tooltip,
   inputRichTextDir + "/images/recordresponse.gif", // image
   true, // textMode,

   // this function is a little long because we are looking for global varibles
   // to be set in the calling page, if they are not there we provide defaults
   //before the rest of the work can be done.
   function(editor, id)
   {
      currentEditorForPopup = editor;
      var filename, limit, seconds, app, dir, imageUrl;
      // first we need to look for global settings and if they don't exist
      // we use defaults, mostly OK, so we can comment out the debug alerts
      // SHOULD have unique filename, dir-- should leave in those 2 alerts

      // first, we look for file name
      if (typeof audioFileName != "undefined" &&
          typeof audioFileExtension != "undefined")
      {
        // we make each call to this function use a different random offset
        random_offset = Math.floor(Math.random()*1000000001);
        filename = audioFileName + "_" + random_offset + "." + audioFileExtension;
      }
      else
      {
        alert ("filename is undefined, defaulting to test.au!");
        filename = "test.au";
      }


      // limit on retries (0 is unlimited)
      if (typeof audioLimit != "undefined")
      {
        limit = audioLimit;
      }
      else
      {
        alert ("limit is undefined, defaulting to 0");
        limit = 0;
      }

      // maximum seconds to record
      if (typeof audioSeconds != "undefined")
      {
        seconds = audioSeconds;
      }
      else
      {
        alert ("seconds is undefined, defaulting to 30");
        seconds = 30;
      }

      // user facing application name
      if (typeof audioAppName != "undefined")
      {
        app = audioAppName;
      }
      else
      {
        alert ("app is undefined, defaulting to 'Audio Recording'");
        app = "Audio Recording";
      }

      // next, we look for directory for uploads, or use tmp as a default
      // this may work OK, but we shouldn't assume that this is a UNIX server
      if (typeof audioDir != "undefined")
      {
        dir = audioDir;
      }
      else
      {
        alert ("dir is undefined, defaulting to temporary directory!");
        dir = "/tmp";
        //dir = "c:\\tmp";
      }

      if (typeof audioImageURL != "undefined")
      {
        imageUrl = audioImageURL;
      }
      else
      {
        alert ("imageUrl is undefined, setting a default location");
        imageUrl = inputRichTextDir + "/images/";
      }

      // gets called when the button is clicked
      window.open(
      inputRichTextDir + "/sakai-popups/recordSound.faces" +
        "?" + "filename=" + filename +
        "&" + "seconds=" + seconds +
        "&" + "limit=" + limit +
        "&" + "app=" + app +
        "&" + "dir=" + dir +
        "&" + "imageUrl=" + imageUrl,
      "_sakai_wysiwyg_popup",
      "toolbar=no,menubar=no,personalbar=no,width=430,height=330," +
      "scrollbars=no,resizable=no");
   }
  );

  // register custom button for image insertion, adds functionality over the basic
  // dialog code in popups/insert_image.html
  config.registerButton("sakai_insertimage", //button ID,
   "Insert Image", //tooltip,
   inputRichTextDir + "/images/ed_image.gif", // image
   true, // textMode,

   function(editor, id)
   {
      currentEditorForPopup = editor;
      // gets called when the button is clicked
      var results = window.open( root +"sakai_popups/insertImage.faces",
      "_sakai_wysiwyg_popup", "toolbar=no,menubar=no,personalbar=no,width=650,height=500," +
      "scrollbars=no,resizable=yes");
   }
  );

  // register custom button for link insertion, adds functionality over the basic
  // dialog code in popups/insert_link.html

  config.registerButton(
   "sakai_createlink", //button ID,
   "File Upload and Link", //tooltip,
   inputRichTextDir + "/images/ed_link.gif", // image
   true, // textMode,

   function(editor, id)
   {
     currentEditorForPopup = editor;
     // gets called when the button is clicked
     var results = window.open( root + "/sakai_popups/insertLink.faces",
      "_sakai_wysiwyg_popup", "toolbar=no,menubar=no,personalbar=no,width=650,height=380," +
      "scrollbars=no,resizable=yes");
   }
  );

}
/*
* Configure custom command buttons for configuration.
*
* Registration parameters:
*
* - editor button id
* - tooltip text
* - image icon
* - supported in HTMLArea textmode true/false
* - command handler function
*/
Configure custom command buttons for configuration.
Registration parameters.

editor button id
tooltip text
image icon
supported in HTMLArea textmode true/false
command handler function
Configure custom command buttons for configuration . Registration parameters . editor button id tooltip text image icon supported in HTMLArea textmode true / false command handler function
function sakaiRegisterButtons(config)
{
  config.registerButton("smile", 
   "Insert Smiling Face", 
   inputRichTextDir + "/images/regular_smile.gif", 
   false, 
   function(editor, id)
   {
     editor._insertSmile( inputRichTextDir + "/images/regular_smile.gif","Insert Smiling Face");
   }
  );
  config.registerButton("sad", 
   "Insert Sad Face", 
   inputRichTextDir + "/images/sad_smile.gif", 
   false, 
   function(editor, id)
   {
     editor._insertSmile( inputRichTextDir + "/images/sad_smile.gif","Insert Sad Face");
   }
  );
  config.registerButton("recordresponse", 
   "Record audio response", 
   inputRichTextDir + "/images/recordresponse.gif", 
   true, 
   function(editor, id)
   {
      currentEditorForPopup = editor;
      var filename, limit, seconds, app, dir, imageUrl;
      if (typeof audioFileName != "undefined" &&
          typeof audioFileExtension != "undefined")
      {
        random_offset = Math.floor(Math.random()*1000000001);
        filename = audioFileName + "_" + random_offset + "." + audioFileExtension;
      }
      else
      {
        alert ("filename is undefined, defaulting to test.au!");
        filename = "test.au";
      }
      if (typeof audioLimit != "undefined")
      {
        limit = audioLimit;
      }
      else
      {
        alert ("limit is undefined, defaulting to 0");
        limit = 0;
      }
      if (typeof audioSeconds != "undefined")
      {
        seconds = audioSeconds;
      }
      else
      {
        alert ("seconds is undefined, defaulting to 30");
        seconds = 30;
      }
      if (typeof audioAppName != "undefined")
      {
        app = audioAppName;
      }
      else
      {
        alert ("app is undefined, defaulting to 'Audio Recording'");
        app = "Audio Recording";
      }
      if (typeof audioDir != "undefined")
      {
        dir = audioDir;
      }
      else
      {
        alert ("dir is undefined, defaulting to temporary directory!");
        dir = "/tmp";
      }
      if (typeof audioImageURL != "undefined")
      {
        imageUrl = audioImageURL;
      }
      else
      {
        alert ("imageUrl is undefined, setting a default location");
        imageUrl = inputRichTextDir + "/images/";
      }
      window.open(
      inputRichTextDir + "/sakai-popups/recordSound.faces" +
        "?" + "filename=" + filename +
        "&" + "seconds=" + seconds +
        "&" + "limit=" + limit +
        "&" + "app=" + app +
        "&" + "dir=" + dir +
        "&" + "imageUrl=" + imageUrl,
      "_sakai_wysiwyg_popup",
      "toolbar=no,menubar=no,personalbar=no,width=430,height=330," +
      "scrollbars=no,resizable=no");
   }
  );
  config.registerButton("sakai_insertimage", 
   "Insert Image", 
   inputRichTextDir + "/images/ed_image.gif", 
   true, 
   function(editor, id)
   {
      currentEditorForPopup = editor;
      var results = window.open( root +"sakai_popups/insertImage.faces",
      "_sakai_wysiwyg_popup", "toolbar=no,menubar=no,personalbar=no,width=650,height=500," +
      "scrollbars=no,resizable=yes");
   }
  );
  config.registerButton(
   "sakai_createlink", 
   "File Upload and Link", 
   inputRichTextDir + "/images/ed_link.gif", 
   true, 
   function(editor, id)
   {
     currentEditorForPopup = editor;
     var results = window.open( root + "/sakai_popups/insertLink.faces",
      "_sakai_wysiwyg_popup", "toolbar=no,menubar=no,personalbar=no,width=650,height=380," +
      "scrollbars=no,resizable=yes");
   }
  );
}
function sakaiRegisterButtons ( config ) { config . registerButton ( "smile" , "Insert Smiling Face" , inputRichTextDir + "/images/regular_smile.gif" , false , function ( editor , id ) { editor . _insertSmile ( inputRichTextDir + "/images/regular_smile.gif" , "Insert Smiling Face" ) ; } ) ; config . registerButton ( "sad" , "Insert Sad Face" , inputRichTextDir + "/images/sad_smile.gif" , false , function ( editor , id ) { editor . _insertSmile ( inputRichTextDir + "/images/sad_smile.gif" , "Insert Sad Face" ) ; } ) ; config . registerButton ( "recordresponse" , "Record audio response" , inputRichTextDir + "/images/recordresponse.gif" , true , function ( editor , id ) { currentEditorForPopup = editor ; var filename , limit , seconds , app , dir , imageUrl ; if ( typeof audioFileName != "undefined" && typeof audioFileExtension != "undefined" ) { random_offset = Math . floor ( Math . random ( ) * 1000000001 ) ; filename = audioFileName + "_" + random_offset + "." + audioFileExtension ; } else { alert ( "filename is undefined, defaulting to test.au!" ) ; filename = "test.au" ; } if ( typeof audioLimit != "undefined" ) { limit = audioLimit ; } else { alert ( "limit is undefined, defaulting to 0" ) ; limit = 0 ; } if ( typeof audioSeconds != "undefined" ) { seconds = audioSeconds ; } else { alert ( "seconds is undefined, defaulting to 30" ) ; seconds = 30 ; } if ( typeof audioAppName != "undefined" ) { app = audioAppName ; } else { alert ( "app is undefined, defaulting to 'Audio Recording'" ) ; app = "Audio Recording" ; } if ( typeof audioDir != "undefined" ) { dir = audioDir ; } else { alert ( "dir is undefined, defaulting to temporary directory!" ) ; dir = "/tmp" ; } if ( typeof audioImageURL != "undefined" ) { imageUrl = audioImageURL ; } else { alert ( "imageUrl is undefined, setting a default location" ) ; imageUrl = inputRichTextDir + "/images/" ; } window . open ( inputRichTextDir + "/sakai-popups/recordSound.faces" + "?" + "filename=" + filename + "&" + "seconds=" + seconds + "&" + "limit=" + limit + "&" + "app=" + app + "&" + "dir=" + dir + "&" + "imageUrl=" + imageUrl , "_sakai_wysiwyg_popup" , "toolbar=no,menubar=no,personalbar=no,width=430,height=330," + "scrollbars=no,resizable=no" ) ; } ) ; config . registerButton ( "sakai_insertimage" , "Insert Image" , inputRichTextDir + "/images/ed_image.gif" , true , function ( editor , id ) { currentEditorForPopup = editor ; var results = window . open ( root + "sakai_popups/insertImage.faces" , "_sakai_wysiwyg_popup" , "toolbar=no,menubar=no,personalbar=no,width=650,height=500," + "scrollbars=no,resizable=yes" ) ; } ) ; config . registerButton ( "sakai_createlink" , "File Upload and Link" , inputRichTextDir + "/images/ed_link.gif" , true , function ( editor , id ) { currentEditorForPopup = editor ; var results = window . open ( root + "/sakai_popups/insertLink.faces" , "_sakai_wysiwyg_popup" , "toolbar=no,menubar=no,personalbar=no,width=650,height=380," + "scrollbars=no,resizable=yes" ) ; } ) ; }
Configure custom command buttons for configuration.
Configure custom command buttons for configuration .
// register custom button for smiling face //button ID, //tooltip, // image // textMode, // register custom button for sad face //button ID, //tooltip, // image // textMode, // register custom button for audio recording //button ID, //tooltip, // image // textMode, // this function is a little long because we are looking for global varibles // to be set in the calling page, if they are not there we provide defaults //before the rest of the work can be done. // first we need to look for global settings and if they don't exist // we use defaults, mostly OK, so we can comment out the debug alerts // SHOULD have unique filename, dir-- should leave in those 2 alerts // first, we look for file name // we make each call to this function use a different random offset // limit on retries (0 is unlimited) // maximum seconds to record // user facing application name // next, we look for directory for uploads, or use tmp as a default // this may work OK, but we shouldn't assume that this is a UNIX server //dir = "c:\\tmp"; // gets called when the button is clicked // register custom button for image insertion, adds functionality over the basic // dialog code in popups/insert_image.html //button ID, //tooltip, // image // textMode, // gets called when the button is clicked // register custom button for link insertion, adds functionality over the basic // dialog code in popups/insert_link.html //button ID, //tooltip, // image // textMode, // gets called when the button is clicked