altctrl presentation geek

Download Altctrl Presentation Geek

If you can't read please download the document

Upload: freelancer

Post on 16-Apr-2017

513 views

Category:

Technology


0 download

TRANSCRIPT

ALTCTRL

Extensie firefoxca si greasemonkey , shiftspace, extensiile firefox dau putere utilizatorului asupra modului de interactionare cu webulAltctrl il ajuta la cumparaturile online

Scurta descriere

Dupa instalare, veti vedea textul altctrl pe status-bar in coltul din dreapta. Navigati in magazinul online preferat, ajungeti pe pagina de detalii a produsului , apoi click pe altctrl din status si veti obtine preturile de la celelate magazine.

ServerBrowserBrowserPachet jsonconfigurare initialaCerere date din cache/ stocare dateUpdate cachereutilizare date pentru alte cereriCerere din cacheComunicare client - server

Caz extrem de distribuire a parsarii+bandei in cazul a 100 de magazine online

jetty1) request getprices for100 stores2) 10 stores0) long polling req0) long polling req0) long polling req3) 10 stores req3) 10 stores req4) answer4) answer5) answer

Componente ce se afla in browserGlobal spaceAnonymous function / objectAltctrlXuliframes_altctrl_PriceRequester_altctrl_PriceListManagerOther functions

Declararea/interpretarea unei
functii anonime

(function(){// your code here})();

Obiecte in javascript pentru organizarea codului si usurarea mentenantei lui

Simplu: var myObj = {};varianta aleasa de mine:function _altctrl_PriceListManager(){ this.divLista = createNode('div'); this.storesTable = createNode('table');this.orderedStoreRows = [];....}adaugarea unei metode acestui obiect:_altctrl_PriceListManager.prototype.sortRows = function(){ this.orderedStoreRows.sort(sortByPrice); for(var i=0;i_altctrl_TIMEOUT_REQUEST){ _altctrl_list.priceRequesters[this.name].cancelWorkState(); } else this.priceCell.innerHTML=_altctrl_ticks[this.idx]; }-----------------------------------------------------var obj = this.priceListManager.storeRows[this.storeName];this.tickFlag = setInterval(function(){tickTack.apply(obj);},_altctrl_TICK_INTERVAL);

Apelarea unei functii in scopuri/contexte diferite cu pasarea unor argumente

function _altctrl_PriceRequester(storeName){ this.storeName=storeName; this.storeBrowser = getStoreBrowser(storeName); var obj = this; this.storeBrowser.addEventListener("load", function (event) { obj.processLoad.apply(obj,[event]); }, true);}