{"id":19693549,"url":"https://github.com/ezsystems/ezautosave","last_synced_at":"2025-04-29T09:31:45.907Z","repository":{"id":2049099,"uuid":"2986692","full_name":"ezsystems/ezautosave","owner":"ezsystems","description":"Content editing autosave extension for eZ Publish","archived":false,"fork":false,"pushed_at":"2020-02-18T09:25:17.000Z","size":141,"stargazers_count":22,"open_issues_count":0,"forks_count":16,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-05T14:51:12.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"zendframework/zf2","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ezsystems.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":"2011-12-15T09:59:11.000Z","updated_at":"2021-09-15T11:31:12.000Z","dependencies_parsed_at":"2022-08-20T11:40:51.531Z","dependency_job_id":null,"html_url":"https://github.com/ezsystems/ezautosave","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezsystems%2Fezautosave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezsystems%2Fezautosave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezsystems%2Fezautosave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezsystems%2Fezautosave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ezsystems","download_url":"https://codeload.github.com/ezsystems/ezautosave/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251473472,"owners_count":21595054,"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":[],"created_at":"2024-11-11T19:17:11.684Z","updated_at":"2025-04-29T09:31:45.371Z","avatar_url":"https://github.com/ezsystems.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"About eZ Autosave\n=================\n\nProject page: http://projects.ez.no/ezautosave\nRoadmap feature request:\nhttp://share.ez.no/feature-requests/auto-store-draft-feature\n\neZ Autosave enables the automatic and transparent saving of the draft\nwhile editing a content in eZ Publish. Based on this, it also provides\nan \"inline\" preview from the content edit in the administration\ninterface.\n\nThis extension is based on QH Autosave by Quoc-Huy NGUYEN DINH\n\n\nFeatures\n========\n\n- Regularly save the draft (interval defined in\n  `autosave.ini/[AutosaveSettings]/Interval`)\n- Save the draft when the user leaves a form field (enable/disable\n  through `autosave.ini/[AutosaveSettings]/TrackUserInput`)\n- Hide the \"Store draft\" button (enable/disable through\n  `autosave.ini/[AutosaveSettings]/HideStoreDraftButton`)\n- Try to save the draft if the editor unexpectedly quits the content\n  edit page (back button, close browser, ...)\n\nRequirements\n============\n\n- eZ Publish 2012.01 or 4.7 or newer\n- ezjscore\n\nTODO / Known issues\n===================\n\n- Add timeout support as soon as the YUI3 bug #2531308 is fixed\n  http://yuilibrary.com/projects/yui3/ticket/2531308\n- When timeout is implemented, add a Retry button in case of timeout\n- Use the output of the ezjscore action to update the content edit form:\n  for instance, after uploading an image, the preview could be updated\n  or the unvalidated field could be hightlighted.\n- Let the editor disable/enable the autosave process\n- Let the editor choose the interval between two autosave attempts\n\n\nTechnical notes\n===============\n\nThis extension provides a JavaScript component called `Y.eZ.AutoSubmit`.\nIt's the main part of the extension, it allows to automatically submit a\nform at fixed interval or because the user has changed something.\n\nThis component extends the EventTarget YUI3 component and then triggers\nsome events during its life. The available events are (see example below\nfor details):\n\n- init\n- beforesave\n- success\n- error\n- nochange\n- abort\n\nIt also listens for the event 'autosubmit:forcesave'. When this events\nis fired, the Y.eZ.AutoSubmit component will try to submit the form no\nmatter if its state has changed or not.\n\nExample:\n\n    {ezscript_require( array( 'ezjsc::yui3', 'ezautosubmit.js' ) )}\n    \u003cscript type=\"text/javascript\"\u003e\n\n    YUI(YUI3_config).use('ezautosubmit', function (Y) {\n\n        var as = new Y.eZ.AutoSubmit({\n            form: '#selectorToTheForm',\n            ignoreClass: 'no-autosave', // change in form fields with this class\n                                        // will not trigger an auto submit\n            action: 'url/to/post/the/form/content', // should answer in JSON\n            interval: 30, // number of seconds between two submit attempts\n            trackUserInput: true, // boolean, whether the component should try to\n                                  // submit the form if the user leaves a field\n                                  // and has made changes\n            enabled: function () { return true; } // optional function to\n                                                  // disable autosave in some circumstances\n            });\n\n        as.on('init', function () {\n            // init event\n            // triggered when the component is initialized\n            // if the `enabled` function returns false, this event is not\n            // triggered\n            // \"this\" is the Y.eZ.AutoSubmit instance\n        });\n\n        as.on('beforesave', function () {\n            // beforesave event\n            // triggered right before the form is automatically submitted\n            // \"this\" is the Y.eZ.AutoSubmit instance\n        });\n\n        as.on('sucess', function (e) {\n            // success event\n            // triggered if the form was correctly submitted\n            // e.json contains the server response in JSON\n            // \"this\" is the Y.eZ.AutoSubmit instance\n        });\n\n        as.on('error', function (e) {\n            // error event\n            // triggered if the form was not correctly submitted\n            // e.json contains the server response in JSON if the\n            // server response was JSON valid\n            // \"this\" is the Y.eZ.AutoSubmit instance\n        });\n\n        as.on('nochange', function () {\n            // nochange event\n            // triggered if the component tries to submit the form but no\n            // change has occurred since the last submit\n            // \"this\" is the Y.eZ.AutoSubmit instance\n        });\n\n        as.on('abort', function () {\n            // abort event\n            // triggered if the component tried to submit the form but the\n            // request is aborted for instance because of a call to stop()\n            // \"this\" is the Y.eZ.AutoSubmit instance\n        });\n\n        // from anywhere in the application, the following line will make\n        // the Y.eZ.AutoSubmit component to submit the form\n        Y.fire('autosubmit:forcesave');\n\n    });\n    \u003c/script\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezsystems%2Fezautosave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fezsystems%2Fezautosave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezsystems%2Fezautosave/lists"}