I think there should be an option to set weather youd like to confirm the removal of items on mysite.
If set to true a box of some kind should pop up and ask if you are shure, if Yes, remove else Keep.

What do you think?

Comments

agentrickard’s picture

Version: 5.x-2.3 » master

Seems reasonable but not essential. It's easy to add something back if you delete by mistake.

I would like to see a javaScript confirmation of changes/saves/etc.

I would call that an "advanced javaScript/CSS trick" for the next release.

Filing against HEAD and adding to the roadmap. http://groups.drupal.org/node/4945

agentrickard’s picture

Status: Active » Needs review

I am about to commit a small change that prints a "Changes saved" message using jQuery. It's not the full feature, but it is helpful.

To use, change this function in mysite.js:

function mysite_ajax_call(serial) {
  var serial = serial.replace(/&/g, ':');
  var serial = serial.replace(/=m/g, '=');  
  var data = serial.replace(/mysite-sort/g, '');
  var url = document.URL;
  var request = url.replace(/mysite.+/, 'ajax/mysite-sort/') + data;
  $.get(request);
  // display a message to the user
  $("div.messages").empty();  
  $("div.mysite-ajax").empty();  
  $("div.mysite-ajax").fadeIn(1000, function(){
    $("div.mysite-ajax").append('<div class="messages">Changes saved</div>');
  });  
  $("div.mysite-ajax").fadeOut(5000, function(){
    $("div.mysite-ajax").empty();  
  });  
}

Then add this line to your Format templates:

  // ajax-generated message class
  $output =  '<div class="mysite-ajax"></div>'; 
agentrickard’s picture

Should be:

  // ajax-generated message class
  $output .=  '<div class="mysite-ajax"></div>';  

The .= is important.

agentrickard’s picture

Status: Needs review » Active

Modified a bit and committed to HEAD.

Leaving this task open, because confirmation of removal is separate.

agentrickard’s picture

I am moving forward on delete confirmation, using the traditional FormsAPI method.

The process is simple:

1) The site admin can choose to enable "confirmation of deletes" for all users.

2) If TRUE, users will be challenged with a web form for confirming their next deletion.

3) At this time, the user can select the option to 'not display this message again', effectively turning off the challenge in future.

The code is just about ready. It will require running update.php, since I added a 'confirm' column to the {mysite} table.

agentrickard’s picture

Status: Active » Fixed

Woo. Added to 5.x.2.9.

When installing, you must run update.php!

Anonymous’s picture

Status: Fixed » Closed (fixed)