﻿// JScript File

(function($) {
      
 
  // Define the hello button
  $.cleditor.buttons.linkPag = {
    name: "linkPag",
    image: "linkPag.png",
    title: "Aggiungi un link ad una pagina",
    command: "inserthtml",
    popupName: "linkPag",    
    //popupClass: "cleditorPrompt",
    //popupContent: "Enter your name:<br><input type=text size=10><br><input type=button value=Submit>",
    buttonClick: linkPagClick
  };
      
 
  // 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 linkPagClick(e, data) {
      
    //$.popUp('EditorRepositoryLink.aspx?vuota=true&idS="', '', 'popUpL', 900, 600);
    var editor = data.editor;
    editor.focus();
    apri_finestra_nobar('EditorPaginaLink.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);
