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

Comments

khaled.zaidan’s picture

StatusFileSize
new9.47 KB

OK, 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.

khaled.zaidan’s picture

StatusFileSize
new9.47 KB

Ok 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.

khaled.zaidan’s picture

StatusFileSize
new10.23 KB

OK 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!

matt v.’s picture

khaled.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!

khaled.zaidan’s picture

StatusFileSize
new15.46 KB

Hi Matt,

Thanks for getting in touch! Here's the patch :)

khaled.zaidan’s picture

Status: Active » Needs review

Any news?

mohammed j. razem’s picture

Status: Needs review » Reviewed & tested by the community

bump!

mohammed j. razem’s picture

Category: support » feature

Can 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

khaled.zaidan’s picture

Status: Reviewed & tested by the community » Fixed

Changes committed and are now available in version 2.x :)

khaled.zaidan’s picture

Status: Fixed » Closed (fixed)

Marking this issue as closed.