New jQuery Plugin released for MySource Matrix


(Nic Hubbard) #41

[quote]Yep I am using matrixFrame. For standard pages I append “/_edit?asset_ei_screen=details” (Altough “_edit” will do as details is default) and it works fine. I have tried appending that to PDF files but since a pdf file has a complete url with .pdf extension adding “/_edit” gives a 404.


Cheers,



Jaco[/quote]



I see what you mean.



What you need to do it add /_edit?limbo_assetid=%asset_assetid% to the end of the URL. %asset_assetid% being the id of the asset that you would like to edit in simple edit.



Check out the original post about this.



Good luck, and let me know if you have any additional questions. :slight_smile:


(Jaco Roeloffs) #42

[quote]I see what you mean.


What you need to do it add /_edit?limbo_assetid=%asset_assetid% to the end of the URL. %asset_assetid% being the id of the asset that you would like to edit in simple edit.



Check out the original post about this.



Good luck, and let me know if you have any additional questions. :)[/quote]



Thanks for that Nic it worked! Searching these forums (effectively) is an art :stuck_out_tongue: , I am getting better though…



Jaco


(Nic Hubbard) #43

[quote]Thanks for that Nic it worked! Searching these forums (effectively) is an art :stuck_out_tongue: , I am getting better though…


Jaco[/quote]



Yeah, that post is really hard to find. I have it bookmarked. :slight_smile:


(Nic Hubbard) #44

Hey everyone,


I just updated jquery.matrix.js to add additional callbacks to matrixStatus, matrixDelete and matrixClone. Then new beforeComplete callback gets called before the ajax event occurs.



Hope this helps anyone out there using the plugin.



Also, I am more than happy to take suggestions or bug submissions for the plugin!



Good luck.


(Duncan Robertson) #45

Nic, I'm looking for a more elegant way of performing trigger deletes on the simple edit side. I've found lately that the whole:

    


is only working on a second or third click. So as you know I've been using jquery.matrix.js but I'm struggling to get your matrixDelete(); function to work. I think the error is on the trigger - do you have a specific trigger you're using? I'm sure I'm just being daft, but if you have any tips for using the function we'd appreciate it big time!

(Nic Hubbard) #46

Have you never gotten matrixDelete() to work for you? It should be very easy to setup. What specific problems are you having with it? Are you getting the confirmation alert, that asks you if you are sure you want to delete the asset? If you are, then you should also use Firebug in Firefox to make sure you are seeing the POST that it is doing, then you can see the exact string that it is adding if you are not using a custom one. It should be adding something like action=delete_asset which then you would mirror that in your trigger, using a URL Matches Condition.

I apologize for not having more detailed demos online, this is still something that I am working on, and will be online soon.

If you are still having issues with this, feel free to email me and I would be happy to help you!

(Nic Hubbard) #47

Here is my demo page that I have been working on:
http://www.zedsaid.com/projects/simple-edit-tools/jquery-matrix-test-suite



It is still not finished, but I thought I would let you look at it. Try using the matrixDelete() demos, and use Firebug to watch the ajax POST. Then, make sure you set your trigger’s URL match condition to match the action that is being sent. The urlSuffix option in the plugin can overwrite the default.



Hope this helps.


(Duncan Robertson) #48

Thanks for the mail Nic, that's making it all a bit clearer.


(Nic Hubbard) #49

I have made some updates to the jquery.matrix.js project. The first is a massive code clean-up.


Second, matrixForm() has recived some love, and now works with both Asset Builders and Custom Forms. There are also four new options:



  • errorArray
    [*]errorSource
    [*]errorMessage
    [*]onComplete


errorArray allows you to capture any form error messages into an array, which is then used to populate a javascript alert dialog, letting you know which errors your form has.

[b]errorSource[/b] takes a jquery selector, most likely a div that is wrapped around the forms error keyword. This must be used if errorArray is set to true, as it is used to gather the errors for the array.

[b]errorMessage[/b] allows you to customize the message that appears on the alert dialog.

[b]onComplete[/b] is used when errorArray is set to true. It will fire when there are no longer any items in the errorArray. Essentially, it tells you when the form has finally been submitted. Since this is a callback you can use any normal jquery within the function.

Hope this helps someone out there. Please let me know if you find any bugs as I would be happy to make the fixes right away. Also, suggestions are always welcome!

(Nic Hubbard) #50

Documentation has been updated. AND, demos are finally online!! Please let me know if you would like to see any other demos, or if the current ones needs to be changed.


jquery.matrix.js Demos ->


(Rachel Macdonald) #51

Hi Nic,


When trying to look at the examples for matrixFilter and the Asset Builder Demo I get a log-in screen…?


(Nic Hubbard) #52

[quote]Hi Nic,


When trying to look at the examples for matrixFilter and the Asset Builder Demo I get a log-in screen…?[/quote]



Good find. :slight_smile:



Sorry about that, they are now fixed. Sometimes working while logged in to a site is like working in a bubble. :slight_smile:


(Nic Hubbard) #53

Well, I thought today was a great day release a new version of my plugin (0.3). So, here it goes.


I updated the matrix.jquery.js project with some big new features. The most notable is matrixDelete and matrixStatus being able to be used without triggers. Here are the new features:



matrixDelete:

  • New option, trigger, which defaults to true. If you set this option to false, Matrix will not need a trigger to delete an asset. You just need to be sure to pass that asset id in through an anchor tags href attribute. Matrix will still use ajax to move your asset to the trash. Deleting multiple assets also supports this new feature. Note: Because this uses ajax GET and POST, Internet Explorer will run this feature much slower than other modern browsers. This is just a problem with IE.
  • New option, ajaxStatus, will give you real time text status for each asset that is being deleted. So, if this option is set to true, and you use multiple deleting, you will see the status for all assets. (Status includes things like, getting locks, submitting hippo, etc.)
  • onComplete works with these new feature as well.



    matrixStatus:
  • New options, trigger and ajaxStatus have been added to matrixStatus and are detailed above.



    Note: The features outlined above do follow permissions, and require the user deleting or changing the status to have permissions to the admin interface. If this is not the case, the plugin will let you know that you do not have permissions.



    matrixMap:
  • This is a new plugin that will load up your asset map using xml and ajax. ( Example )It is in a very early stage and currently can only be used to browse the tree. There are still issues with it, such as the stalks not being correct for lines or open/closed folders. But, things like type 2 links, and indicating if an asset has children work correctly. I am not entirely sure where this plugin is going to go. It would be a huge project to build all the features that the java asset map currently has. I would be interested in hearing what you guys think about this.



    Please give the new version of the plugin a download, and let me know what you think!



    Example

(Neo) #54

Looking forward to playing with it on my installation. Personally, jquery has saved our development a few times while using Matrix.


(Nic Hubbard) #55

Awesome! Glad to get more users trying my plugin. Let me know what you think and if you have any questions or problems. :)

(Jaco Roeloffs) #56

Hi Nic!


Your documentation is good, especially the demos are working well. :smiley:



Could you give us a basic trigger setup/steps for delete and status change?



Thanks for a great plugin!



Jaco


(Nic Hubbard) #57

No problem.

The trigger setup is pretty basic, you will be using the Asset Accessed Event for each. Here is an example of how you can set up a trigger to delete an asset:

[attachment=388:Picture_1.png]

[attachment=389:Picture_2.png]

When you set the URL matches condition, you must make sure to match this with your configuration in the plugin.

For the status change trigger, you can use something similar to the above, but for the action you would choose a Set Status action and then choose the status you would like to change the asset to.

Does that help?

Please let me know if you have any additional questions. :) Picture_1.png (64.8 KB) Picture_2.png (20.7 KB)

(Jaco Roeloffs) #58

[quote]Does that help?


Please let me know if you have any additional questions. :)[/quote]



Thanks Nic that helped get me alot with the trigger setup!


(Tbaatar) #59

Hi Nic,


I'm trying to delete Asset without trigger but can't get it working.



These are the steps I took:


  1. Jquery.Matrix.js - delete trigger set to false
  2. In my asset listing - <a href="%asset_assetid%" class="matrixDelete">delete.</a> %asset_name%



    Am I doing something wrong?

(Nic Hubbard) #60

[quote]Hi Nic,


I'm trying to delete Asset without trigger but can't get it working.



These are the steps I took:


  1. Jquery.Matrix.js - delete trigger set to false
  2. In my asset listing - <a href="%asset_assetid%" class="matrixDelete">delete.</a> %asset_name%



    Am I doing something wrong?[/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.