MrLoick / any-balance-providers

Automatically exported from code.google.com/p/any-balance-providers
2 stars 3 forks source link

Patch for /trunk/ab-cell-beeline-new/main.js #200

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Вывод текущего тарифа, оставшегося 
Интернет-трафика для Казахстана

Original issue reported on code.google.com by starose...@gmail.com on 24 Oct 2014 at 2:05

Attachments:

GoogleCodeExporter commented 9 years ago
Патч применен не полностью, есть замечания 
по коду, к примеру :
+   if(!isset(prefs.country) || !isset(baseurls[prefs.country])){
+       AnyBalance.trace("Unknown country: " + prefs.country + ", defaulting to ru");
+       prefs.country = 'ru';
+   }

Это ни к чему, потому что пользователь 
никогда не сможет запустить провайдера с 
неизвестным регионом так что 
первоначальный вариант не нуждается в 
изменении
var baseurl = 'https://my.beeline.' + (prefs.country || 'ru') + '/';

Original comment by stark...@gmail.com on 26 Oct 2014 at 2:07

GoogleCodeExporter commented 9 years ago
Спасибо, учту. Эту часть патча всё ещё нужно 
применить, в казахстанском кабинете поиск 
блока бонусов немного отличается от 
российского:
-   var re = new RegExp("loadingAccumulators = function\\(\\) 
\\{PrimeFaces\\.\\w+\\s*\\(\\s*\\{[^}]*update:\\s*'" + (exact ? "" : "[^']*") + 
name);
+   var prefs = AnyBalance.getPreferences();
+   
+   if (!isset(prefs.country) || prefs.country == 'ru')
+       var re = new RegExp("loadingAccumulators = function\\(\\) 
\\{PrimeFaces\\.\\w+\\s*\\(\\s*\\{[^}]*update:\\s*'" + (exact ? "" : "[^']*") + 
name);
+   else if (prefs.country == 'kz')
+       var re = new RegExp("loadingServices = function\\(\\) 
\\{PrimeFaces\\.\\w+\\s*\\(\\s*\\{[^}]*update:\\s*'" + (exact ? "" : "[^']*") + 
name);

Original comment by starose...@gmail.com on 26 Oct 2014 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by stark...@gmail.com on 3 Feb 2015 at 4:30