var MySCRIPT = (function() { // TODO BRS Aivars: Pārlikt lai id ielasās no db, skatīt piemēru produktos scriptu. function MySCRIPT(){ var _this = this; // Sub Categories _this.vIds = [ 19, 21, 23, 26, 28, 29, 31, 33, 34, 35, 36, 60, 61, 65, 66, 67, 68, 73, 74, 77, 78, 80, 81, 82, 84, 86, 87, 89, 91, 92, 93, 94, 98, 104, 106, 107, 109, 110, 111, 112, 113, // Base Categories 14, 15, 17, 40, 53, 105, 108 ]; } MySCRIPT.prototype.vIds = []; MySCRIPT.prototype.iCount = 0; MySCRIPT.prototype.doTheMagic = function(){ var _this = this; CBlank.prototype.bRecordOverWritten = false; CBase.jsModule.oTable.oBlank.bRecordOverWritten = true; CBlank.prototype.viewCallbackAfterShow = function(){ pr("save ->>" + CBase.jsModule.oTable.oBlank.url); $("[id^='a_title-']").blur(); $("#fsave").click(); this.bRecordOverWritten = true; }; var iIntRef = setInterval(function(){ if(CBase.jsModule.oTable.oBlank.bRecordOverWritten){ if(_this.vIds.length > 0){ CBase.jsModule.oTable.oBlank.bRecordOverWritten = false; pr("load (" + _this.iCount++ + ")"); CBase.jsModule.oTable.loadRecord(false, "/zsmkadmin/content/text-manager/action:edit/id:" + _this.vIds.pop()) }else{ clearInterval(iIntRef); } } }, 2000); }; return MySCRIPT; })(); var mm = new MySCRIPT(); mm.doTheMagic();