{"action":"closed","issue":{"url":"https://api.github.com/repos/DrewDahlman/Mason/issues/25","labels_url":"https://api.github.com/repos/DrewDahlman/Mason/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/DrewDahlman/Mason/issues/25/comments","events_url":"https://api.github.com/repos/DrewDahlman/Mason/issues/25/events","html_url":"https://github.com/DrewDahlman/Mason/issues/25","id":26540976,"number":25,"title":"Extening the plugin to remove randomness and adding data layout attributes to HTML","user":{"login":"tomeralmog","id":4028996,"avatar_url":"https://avatars.githubusercontent.com/u/4028996?v=3","gravatar_id":"","url":"https://api.github.com/users/tomeralmog","html_url":"https://github.com/tomeralmog","followers_url":"https://api.github.com/users/tomeralmog/followers","following_url":"https://api.github.com/users/tomeralmog/following{/other_user}","gists_url":"https://api.github.com/users/tomeralmog/gists{/gist_id}","starred_url":"https://api.github.com/users/tomeralmog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomeralmog/subscriptions","organizations_url":"https://api.github.com/users/tomeralmog/orgs","repos_url":"https://api.github.com/users/tomeralmog/repos","events_url":"https://api.github.com/users/tomeralmog/events{/privacy}","received_events_url":"https://api.github.com/users/tomeralmog/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-01-29T18:19:16Z","updated_at":"2015-01-22T06:12:35Z","closed_at":"2015-01-22T06:12:35Z","body":"HI,\r\nThank you for the plugin.\r\nI needed the layout to be predetermined (i.e. I need to know which image to put on a [2,1] layout and on [1,2].\r\nI have extended a bit the plugin to enable that (you might want to include that on your next release):\r\non line 112 I have changed\r\nran = Math.floor(Math.random() * (settings.sizes.length - settings.promoted.length));\r\nto \r\nran = $sel.data(\"layout\");\r\nif(typeof(ran)=='undefined' || !ran){\r\n    ran = Math.floor(Math.random() * (settings.sizes.length - settings.promoted.length));\r\n}\r\n\r\nNow in the HTML you can add data-layout attribute which corresponds to the index of the sizes in the options:\r\ndiv class='box' data-layout=\"3\">4</div>\r\ndiv class='box' data-layout=\"0\">5</div>\r\ndiv class='box' data-layout=\"1\">6</div>\r\ndiv class='box' data-layout=\"2\">7</div>\r\n\r\nI have also changed the randomness of the fillers like this:\r\n\r\nline 191 (before the 2 for loops) add\r\nvar fillerNum = $(settings.filler.itemSelector).length;\r\n\r\nand then in line 212 change \r\n\r\nran = Math.floor(Math.random() * $(settings.filler.itemSelector).length);\r\n\r\nto \r\n\r\nran =  fillerNum -1;\r\n\r\nyou can probably add another Boolean variable in the option field for random true/false and set it there.\r\n\r\nHope this helps,\r\nThanks for the great plugin!\r\nTomer Almog\r\nwww.tomeralmog.com"}}