﻿// Tutto
(function($) {
      
 
  // Define the hello button
  $.cleditor.buttons.rep = {
    name: "rep",
    image: "rep.png",
    title: "Apri repository",
    command: "inserthtml",
    popupName: "rep",    
    //popupClass: "cleditorPrompt",
    //popupContent: "Enter your name:<br><input type=text size=10><br><input type=button value=Submit>",
    buttonClick: repClick
  };
      
 
  // 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 repClick(e, data) {
      
    //$.popUp('EditorRepositoryLink.aspx?vuota=true&idS="', '', 'popUpL', 900, 600);
    var editor = data.editor;
    editor.focus();
    apri_finestra_nobar('EditorRepositoryLink.aspx?vuota=true&a=100&e=1&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);


// rep solo immmagini
(function($) {
      
 
  // Define the hello button
  $.cleditor.buttons.repSoloImg = {
    name: "repSoloImg",
    image: "rep.png",
    title: "Apri repository",
    command: "inserthtml",
    popupName: "repSoloImg",    
    //popupClass: "cleditorPrompt",
    //popupContent: "Enter your name:<br><input type=text size=10><br><input type=button value=Submit>",
    buttonClick: repSoloImgClick
  };
      
 
  // 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 repSoloImgClick(e, data) {
          
    var editor = data.editor;
    editor.focus();
    apri_finestra_nobar('EditorRepositoryLink.aspx?vuota=true&a=0&e=1&idT=1&idS="', 'editorPopUp', 1000, 700);   
 
  }
      
 
})(jQuery);

// rep solo video/audio
(function($) {
      
 
  // Define the hello button
  $.cleditor.buttons.repSoloVid = {
    name: "repSoloVid",
    image: "rep.png",
    title: "Apri repository",
    command: "inserthtml",
    popupName: "repSoloVid",    
    //popupClass: "cleditorPrompt",
    //popupContent: "Enter your name:<br><input type=text size=10><br><input type=button value=Submit>",
    buttonClick: repSoloVidClick
  };
      
 
  // 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 repSoloVidClick(e, data) {
      
    //$.popUp('EditorRepositoryLink.aspx?vuota=true&idS="', '', 'popUpL', 900, 600);
    var editor = data.editor;
    editor.focus();
    apri_finestra_nobar('EditorRepositoryLink.aspx?vuota=true&a=0&e=1&idT=2&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);


// rep solo allegati
(function($) {
      
 
  // Define the hello button
  $.cleditor.buttons.repSoloAll = {
    name: "repSoloAll",
    image: "rep.png",
    title: "Apri repository",
    command: "inserthtml",
    popupName: "repSoloAll",    
    //popupClass: "cleditorPrompt",
    //popupContent: "Enter your name:<br><input type=text size=10><br><input type=button value=Submit>",
    buttonClick: repSoloAllClick
  };
      
 
  // 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 repSoloAllClick(e, data) {
      
    //$.popUp('EditorRepositoryLink.aspx?vuota=true&idS="', '', 'popUpL', 900, 600);
    var editor = data.editor;
    editor.focus();
    apri_finestra_nobar('EditorRepositoryLink.aspx?vuota=true&e=1&idT=3&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);
