﻿// JScript File

(function($) {
      
 
  // Define the hello button
  $.cleditor.buttons.templatePag = {
    name: "templatePag",
    image: "templatePag.png",
    title: "Aggiungi un template di pagina",
    command: "inserthtml",
    popupName: "templatePag",    
    //popupClass: "cleditorPrompt",
    //popupContent: "Enter your name:<br><input type=text size=10><br><input type=button value=Submit>",
    buttonClick: templatePagClick
  };
      
 
  // Add the button to the default controls before the bold button
  $.cleditor.defaultOptions.controls = $.cleditor.defaultOptions.controls
    .replace("bold", "");
      
 
  // Handle the hello button click event
  function templatePagClick(e, data) {
      
    //$.popUp('EditorRepositoryLink.aspx?vuota=true&idS="', '', 'popUpL', 900, 600);
    var editor = data.editor;
    editor.focus();
    apri_finestra_nobar('EditorPaginaTemplate.aspx?vuota=true&idS="', 'editorPopUp', 1000, 700);
    
//    // Wire up the submit button click event
//    $(data.popup).children(":button")
//      .unbind("click")
//      .bind("click", function(e) {
//      
// 
//        // Get the editor
//        var editor = data.editor;
//      
// 
//        // Get the entered name
//        var name = $(data.popup).find(":text").val();
//      
// 
//        // Insert some html into the document
//        var html = "Hello " + name;
//        editor.execCommand(data.command, html, null, data.button);
//      
// 
//        // Hide the popup and set focus back to the editor
//        editor.hidePopups();
//        editor.focus();
//      
// 
//      });
//      
 
  }
      
 
})(jQuery);
