New jQuery Plugin released for MySource Matrix


(Tbaatar) #61

[quote]You need to do something like the following:

    delete.


I add the a before the asset id just to make the page valid, the plugin will strip any non-numerical characters from the ID. So, the plugin needs the id passed to it through the elements ID property, then it will work.

Just added an example of this to the demo page: http://www.zedsaid.com/projects/simple-edit-tools

Please let me know if it goes well for you, as multiple testings proved it to work quite well.[/quote]

Thanks for info.

Without the trigger is working at work server but on my personal server I get Hip Error even thought I'm logged in as System Administrator.
If I release the Asset Lock and run the Ajax Delete it works.

Another question Nic, do you use the same method in the Anchor tag for Trigger delete?
    Delete Asset


Thanks.

(Nic Hubbard) #62

[quote]Thanks for info.


Without the trigger is working at work server but on my personal server I get Hip Error even thought I'm logged in as System Administrator.

If I release the Asset Lock and run the Ajax Delete it works.



Another question Nic, do you use the same method in the Anchor tag for Trigger delete?

    Delete Asset


Thanks.[/quote]

This has been tested in 3.18.x and 3.20.x, but not in 3.22.0 which it looks like you have at home. I will need to do some testing to see if anything has changed that I need to account for.

As for the trigger, that is up to you. Look a few posts back in this thread, and you will see an example I gave. The trigger is based on a URL match condition, so you DO want to send the href="%asset_url%" in the link, then then set your urlSuffix accordingly.

(Nic Hubbard) #63

[quote]Without the trigger is working at work server but on my personal server I get Hip Error even thought I'm logged in as System Administrator.
If I release the Asset Lock and run the Ajax Delete it works.[/quote]



I have tested this in 3.22.0 and I can confirm that it works.



What kind of asset are you trying to delete? Could you let me know what kind of error messages you are getting? Also, if possible, could you let me know what you are seeing in the Firebug console? Are you seeing js errors? Also, if you are using ajaxStatus, does it show the hippo progress?



Thanks for helping me with this.


(Duncan Robertson) #64

Nic I've been looking at this all afternoon, I just can't get the delete asset to work. The trigger is working fine, the animation is working fine (so I know it's binding to the the matrixDelete event) but nothing happens. What would you place in the a tag?

    
    
    
    
    Nic Delete
    
<script src="jquery.matrix.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	// Matrix Delete
	$('a.matrixDelete').matrixDelete({
		urlSuffix: '&action=delete_asset',
		onComplete: function() {
		$(this).parent().animate({ 
			width: "70%",
			opacity: 0.4,
			marginLeft: "0.6in",
			fontSize: "3em"
		  }, 1500 ); 
		$(this).parent().fadeOut('slow'); 
		}
	});
		
});

</script>
</head>
<body>

<a class="matrixDelete" href="%asset_assetid%">Delete %asset_name% ?</a>

</body>
</html></pre>

(Nic Hubbard) #65

If you ARE using a trigger to delete, you need to use %asset_url% for the href:

    Delete %asset_name% ?


If you watch Firebug you can see the ajax POST, which would have been missing the URL without the %asset_url% keyword.

Sorry, I will add this to the docs...

(Duncan Robertson) #66

Sweet let me give it another go tomorrow. Just installed another fresh 3.22.0 - dig that video asset.


(Nic Hubbard) #67

:)’ /> Good. Yeah, it is super useful. I had needed one for a long time, so I figured I would just write it myself. <img src=‘http://forums.matrix.squiz.net/public/style_emoticons/<#EMO_DIR#>/smile.gif’ class=‘bbc_emoticon’ alt=’:slight_smile:


(Tbaatar) #68

I got it working now.


I had child trigger enabled but not my Root trigger container. :wacko:







Thanks.


(Nic Hubbard) #69

[quote]I got it working now.


I had child trigger enabled but not my Root trigger container. :wacko:







Thanks.[/quote]



Glad to help. :slight_smile:


(Duncan Robertson) #70

Got it working too Nic - epic. Wrote a few mods on the action itself but it's flipping awesome.


EDIT: Thanks so much.


(Nic Hubbard) #71

[quote]Got it working too Nic - epic. Wrote a few mods on the action itself but it's flipping awesome.


EDIT: Thanks so much.[/quote]



Good, glad it is working now.



Let me know if you think of any ways that I could improve the plugin. :slight_smile:


(Duncan Robertson) #72

It might be handy to split the plugin down to the individual function level. Like a plugin to delete, plugin to clone and so on. Don't know. It might just be a bit easier to understand for suckers like me.


(Nic Hubbard) #73

Do you mean package these in separate .js files?

Currently they are all different plugins, matrixDelete(), matrixClone() ect. are all their own function, representing their own plugins. I have just packaged them all in the same .js file for ease of use. :)

(Nic Hubbard) #74

I would be very interested to hear if you are using the jQuery Matrix plugin. If you are, would you let me know?!


Thanks.


(Rachel Macdonald) #75

We are, though the only thing I'm doing at the moment is allowing staff to trash from simple edit.


(Nic Hubbard) #76

Very cool, glad to hear it is getting used!

(Robin Shi) #77

Hi Nic,


I have got two questions.



When I use the non-trigger method, it returns the error of “acquire locks” and asks me to login even though i have logged in as sys admin. the other question is how to delete the files with public URL like http://www.domain.com/__data/assets/pdf_file/0005/92282/file.pdf with the Ajax plugin?



many thanks,



Robin


(Nic Hubbard) #78

[quote]Hi Nic,


I have got two questions.



When I use the non-trigger method, it returns the error of “acquire locks” and asks me to login even though i have logged in as sys admin. the other question is how to delete the files with public URL like http://www.domain.com/__data/assets/pdf_file/0005/92282/file.pdf with the Ajax plugin?



many thanks,



Robin[/quote]



Hi Robin,



To delete a file asset with public URL, you will just use the following:


    /?a=%asset_assetid%


That way, the asset ID will get accessed and recognized by the trigger, as the public Apache URL won't.

As for the error. Has it worked for you in the past? And what version of Matrix are you using, and what type of asset are you deleting?

(Robin Shi) #79

[quote]Hi Robin,


To delete a file asset with public URL, you will just use the following:


    /?a=%asset_assetid%


That way, the asset ID will get accessed and recognized by the trigger, as the public Apache URL won't.

As for the error. Has it worked for you in the past? And what version of Matrix are you using, and what type of asset are you deleting?[/quote]
Hi Nic,

Thanks for quick reply. It's the first time I implement your Ajax plugin for multiple delete, it seems not work for our system. Maybe more to do with the HIPO settings. The plugin launches HIPO successfully but the HIPOs are just pending there. I am using 3.20.2.

Since the trigger method covers file asset, I will use trigger method.

Many many thanks,

Robin :lol:' /> :lol: <img src='http://forums.matrix.squiz.net/public/style_emoticons/<#EMO_DIR#>/laugh.gif' class='bbc_emoticon' alt=':lol:

(Nic Hubbard) #80

Maybe the no trigger method needs some bug fixes.

Could you let me know how to set this up, so I can see if it is indeed a bug?