{"id":24909057,"url":"https://github.com/dubbs/jquery-printevents","last_synced_at":"2025-10-16T20:31:48.608Z","repository":{"id":57282301,"uuid":"96931514","full_name":"dubbs/jquery-printevents","owner":"dubbs","description":"This plugin publishes jQuery events before and after print","archived":false,"fork":false,"pushed_at":"2017-07-12T16:21:32.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T05:12:21.988Z","etag":null,"topics":["events","javascript","jquery","jquery-plugin","print","publish-subscribe","pubsub"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dubbs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-11T19:53:49.000Z","updated_at":"2017-07-12T16:22:38.000Z","dependencies_parsed_at":"2022-09-11T04:23:24.684Z","dependency_job_id":null,"html_url":"https://github.com/dubbs/jquery-printevents","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubbs%2Fjquery-printevents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubbs%2Fjquery-printevents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubbs%2Fjquery-printevents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dubbs%2Fjquery-printevents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dubbs","download_url":"https://codeload.github.com/dubbs/jquery-printevents/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236745686,"owners_count":19198059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["events","javascript","jquery","jquery-plugin","print","publish-subscribe","pubsub"],"created_at":"2025-02-02T02:35:37.441Z","updated_at":"2025-10-16T20:31:43.344Z","avatar_url":"https://github.com/dubbs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery Print Events\n\nThis plugin publishes jQuery events before and after print.  It normalizes [onbeforeprint](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeprint)/[onafterprint](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onafterprint) and [window.matchMedia](https://developer.mozilla.org/en/docs/Web/API/Window/matchMedia) using techniques described in this [article](https://www.tjvantoll.com/2012/06/15/detecting-print-requests-with-javascript/).\n\n## Usage\nInclude dependencies:\n```html\n\u003cscript src=\"//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"jquery.printevents.js\"\u003e\u003c/script\u003e\n```\nCreate subscribers for the published events:\n```js\n$(document).on('print:before', function () {\n  // run code before print\n});\n\n$(document).on('print:after', function () {\n  // run code after print\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdubbs%2Fjquery-printevents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdubbs%2Fjquery-printevents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdubbs%2Fjquery-printevents/lists"}