Hi,
In many cases, we might need to apply the zero-clipboard functionality to elements that do not have an id, but only a selector instead.
So I was thinking about some rebuilding of the module, to make it more flexible in terms of what can be processed for zero-clipboard and how. (I'm thinking more like the approach used with modalframes).
I will work on that during the weekend, and submit a patch the new code when done :)
Tell me what you think
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | zeroclipboard-rebuild-1408888-5.patch | 15.46 KB | khaled.zaidan |
| #3 | zeroclipboard.tar_.gz | 10.23 KB | khaled.zaidan |
| #2 | zeroclipboard.tar_.gz | 9.47 KB | khaled.zaidan |
| #1 | zeroclipboard.tar_.gz | 9.47 KB | khaled.zaidan |
Comments
Comment #1
khaled.zaidan commentedOK, sorry this took so long, I got busy working on other stuff.
Anyway, here it goes, a rough rebuild of the module is attached here.
Now it is enough to use:
Drupal.zeroClipboard.process(elementSelector, stringOrCallback, specialCSSForSpanContainer);to process a page element with zero-clipboard. the second argument can either be string that is to be copied to clipboard, or a callback that would return the string to be copied (for the sake of a more dynamic approach).
The only 2 things I didn't touch were the *.install file and the drush integration. I don't have experience in these 2 issues. So I would appreciate it if someone could have a look at those.
Comment #2
khaled.zaidan commentedOk I just checked the *.install hook_requirements(), and fixed some texts. And tested the drush command.
Here is a slightly modified build of the module.
Now we only need the module maintainer's attention to commit these changes to the module.
Comment #3
khaled.zaidan commentedOK I just keep editing this!
I just added the settings page, and made possible to specify the selectors with the their correspondent clipboard values in the settings page.
Modified the README.txt files accordingly.
PS. This is turning into a primitive version control here in this issue. I really hope the maintainer sees this soon!
Comment #4
matt v. commentedkhaled.zaidan,
Can you submit your changes as a patch, as described on the project's Version control page? That will make it easier to review your changes.
Thanks!
Comment #5
khaled.zaidan commentedHi Matt,
Thanks for getting in touch! Here's the patch :)
Comment #6
khaled.zaidan commentedAny news?
Comment #7
mohammed j. razembump!
Comment #8
mohammed j. razemCan we get this pushed to Drupal 6, as Drupal 7 depends on the new version which needs to be committed.
I think this should be a 2.x branch as well.
Thanks
Razem
Comment #9
khaled.zaidan commentedChanges committed and are now available in version 2.x :)
Comment #10
khaled.zaidan commentedMarking this issue as closed.