{"action":"opened","issue":{"url":"https://api.github.com/repos/thexerteproject/xerteonlinetoolkits/issues/795","repository_url":"https://api.github.com/repos/thexerteproject/xerteonlinetoolkits","labels_url":"https://api.github.com/repos/thexerteproject/xerteonlinetoolkits/issues/795/labels{/name}","comments_url":"https://api.github.com/repos/thexerteproject/xerteonlinetoolkits/issues/795/comments","events_url":"https://api.github.com/repos/thexerteproject/xerteonlinetoolkits/issues/795/events","html_url":"https://github.com/thexerteproject/xerteonlinetoolkits/issues/795","id":364440197,"node_id":"MDU6SXNzdWUzNjQ0NDAxOTc=","number":795,"title":"new feature: add customPageChanged function to theme js files","user":{"login":"ronm123","id":5167146,"node_id":"MDQ6VXNlcjUxNjcxNDY=","avatar_url":"https://avatars2.githubusercontent.com/u/5167146?v=4","gravatar_id":"","url":"https://api.github.com/users/ronm123","html_url":"https://github.com/ronm123","followers_url":"https://api.github.com/users/ronm123/followers","following_url":"https://api.github.com/users/ronm123/following{/other_user}","gists_url":"https://api.github.com/users/ronm123/gists{/gist_id}","starred_url":"https://api.github.com/users/ronm123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronm123/subscriptions","organizations_url":"https://api.github.com/users/ronm123/orgs","repos_url":"https://api.github.com/users/ronm123/repos","events_url":"https://api.github.com/users/ronm123/events{/privacy}","received_events_url":"https://api.github.com/users/ronm123/received_events","type":"User","site_admin":false},"labels":[{"id":521765043,"node_id":"MDU6TGFiZWw1MjE3NjUwNDM=","url":"https://api.github.com/repos/thexerteproject/xerteonlinetoolkits/labels/XOT%20template","name":"XOT template","color":"bfd4f2","default":false},{"id":55111054,"node_id":"MDU6TGFiZWw1NTExMTA1NA==","url":"https://api.github.com/repos/thexerteproject/xerteonlinetoolkits/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":55111056,"node_id":"MDU6TGFiZWw1NTExMTA1Ng==","url":"https://api.github.com/repos/thexerteproject/xerteonlinetoolkits/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/thexerteproject/xerteonlinetoolkits/milestones/2","html_url":"https://github.com/thexerteproject/xerteonlinetoolkits/milestone/2","labels_url":"https://api.github.com/repos/thexerteproject/xerteonlinetoolkits/milestones/2/labels","id":2264024,"node_id":"MDk6TWlsZXN0b25lMjI2NDAyNA==","number":2,"title":"ASAP/High priority","description":"these issues/improvements are most important/most urgent or just quick to implement.","creator":{"login":"ronm123","id":5167146,"node_id":"MDQ6VXNlcjUxNjcxNDY=","avatar_url":"https://avatars2.githubusercontent.com/u/5167146?v=4","gravatar_id":"","url":"https://api.github.com/users/ronm123","html_url":"https://github.com/ronm123","followers_url":"https://api.github.com/users/ronm123/followers","following_url":"https://api.github.com/users/ronm123/following{/other_user}","gists_url":"https://api.github.com/users/ronm123/gists{/gist_id}","starred_url":"https://api.github.com/users/ronm123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronm123/subscriptions","organizations_url":"https://api.github.com/users/ronm123/orgs","repos_url":"https://api.github.com/users/ronm123/repos","events_url":"https://api.github.com/users/ronm123/events{/privacy}","received_events_url":"https://api.github.com/users/ronm123/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":26,"state":"open","created_at":"2017-01-19T13:09:42Z","updated_at":"2018-09-27T11:59:03Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-09-27T11:59:03Z","updated_at":"2018-09-27T11:59:03Z","closed_at":null,"author_association":"COLLABORATOR","body":"Hi all\r\nI'm looking to add some custom script to a themes.js file in a way that is used/called on page change. I've briefly discussed this with @torinfo and @FayCross and agreed it would be a useful option for themes to be able to include if required. So the plan is to add a function to the theme.js file e.g. \r\n`function customPageChanged{\r\n//add code to execute here when each page model is loaded\r\n}`\r\nand then trigger that at the end of x_setUpPage() in xenith with customPageChanged();\r\n\r\nI have this working but if just called via customPageChanged and the function doesn't exist in a particular theme then the console obviously shows an error e.g. Uncaught ReferenceError: customPageChanged is not defined.\r\n\r\nSo I'm using `if (typeof customPageChanged == 'function') {\r\n        customPageChanged();;\r\n    }`\r\nwhich works fine and avoids any error.\r\n\r\nQuestion are:\r\nIs this enhancement and the name of the custom function ok?\r\nIs there a better way of doing this?\r\nWhat about the page script optional property that has options to only execute one or everytime the page is viewed - I can't find where that option is detected or whether I should include an option like this  somehow too?"}}
{"actor":{"display_login":"ronm123"}}