{"id":19670335,"url":"https://github.com/notacouch/rloader","last_synced_at":"2025-02-27T04:43:19.799Z","repository":{"id":29837402,"uuid":"33382111","full_name":"notacouch/rloader","owner":"notacouch","description":"Automatically exported from code.google.com/p/rloader","archived":false,"fork":false,"pushed_at":"2017-01-12T15:54:24.000Z","size":15,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T03:33:01.874Z","etag":null,"topics":["dependency-manager","javascript","lazyloading"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notacouch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-03T20:47:03.000Z","updated_at":"2024-11-24T02:59:01.000Z","dependencies_parsed_at":"2022-09-06T15:21:04.705Z","dependency_job_id":null,"html_url":"https://github.com/notacouch/rloader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notacouch%2Frloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notacouch%2Frloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notacouch%2Frloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notacouch%2Frloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notacouch","download_url":"https://codeload.github.com/notacouch/rloader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240980800,"owners_count":19888343,"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":["dependency-manager","javascript","lazyloading"],"created_at":"2024-11-11T17:05:56.606Z","updated_at":"2025-02-27T04:43:19.775Z","avatar_url":"https://github.com/notacouch.png","language":"JavaScript","readme":"Loads resources like css and js files when you need them with one line of code.\n\nIt keeps track off the items that allready have been loaded.\nIf the same resource is called (loaded) twice it will load it only once.\n\nThis is handy when you load pieces of content (widgets) with Ajax that needs the same resources. This form off loading items is also called **lazy** loading\nand it can REALLY REALLY help you to speed up websites and webapplications.\n\n\nThis plugin is very simple, but effective in use.. So Enjoy\n\n\n\n\n# Usage #\n\n\n## CSS parameters ##\n\n  * src: (string: the url to the css file)\n  * cache: (true or false)  default: true (see the global settings)\n  * callback: (string or function)  name of your function fired when loading is done\n  * arg: (string or JSON object) arguments, parameters for your callback function\n\n\n## JS parameters ##\n\n  * src: (string: the url to the js file)\n  * async: (true or false)  default: true  (see the global settings)\n  * cache: (true or false)  default: true  (see the global settings)\n  * callback: (string or function)  name of your function fired when loading is done\n  * arg: (string or JSON object) arguments, parameters for your callback function\n  * excecute: (true or false) default: false, run the script itself e.g. even if cached already\n\n\n## Events ##\n  * event    'beforeload'        Fired before the list gets loaded.\n  * event    'onready'           Fired when every resource in the list is loaded (finished).\n\n\n\u003e parameters:\n\u003e \u003e func: (string or function)     name of your function fired when loading is done\n\n\n\u003e arg:  (string or JSON object)  optional arguments, parameters to parse to your callback function\n\n\n## Making global settings ##\n\nYou can make global settings that rloader will use as a default for all resources.\nWhen the parameters are omitted in the resources (css or js), the global settings will be used\nas the default !\n\n  * defaultcache:    (true or false)  default: true    (so use browser caching by default)\n  * defaultasync:    (true or false)  default: true    (so load it async by default)\n\n\n# Examples #\n\n**Load 1 resource**\n\n```\n$.rloader({src:'/js/ctpgn.widget.min.js', callback:initwidget, arg:'MyArg'});\n```\n\n\u003e ---\n\n**Loads 2 resources**\n```\n$.rloader([ {src:'/css/widget.css'},{src:'/js/ctpgn.widget.min.js'} ]);\n```\n_note: the default async and cache options will be used_\n\n\u003e ---\n\n**Loads 2 resources and fires an event when ready**\n```\n$.rloader([ {src:'/css/widget.css'},{src:'/js/ctpgn.widget.min.js'}, {event:'onready', func:'init_widget', arg:(parameters)} ]);\n```\n_note: the default async and cache options will be used_\n\n\u003e ---\n\n**Changing global settings**\n```\n $.rloader({defaultcache:false});\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotacouch%2Frloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotacouch%2Frloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotacouch%2Frloader/lists"}