PageSourceSearch

https://abo.optionfinance.fr/core/aboshop/wishlist.factory.js?v=

js optionfinance.fr collected 2026-10-02 03:30:04 UTC 4,290 bytes, 113 lines download raw bytes

1'use strict'; //
2
3// ****************************************************
4//  Gestion du Panier
5// ****************************************************
6angular.module('AboShopApp').factory('wishlistManager', ['$q', '$rootScope','TbsWS','Auth', function ($q, $rootScope, TbsWS,Auth) {
7    	var factory = {};
8    	factory.WISHLIST_ERROR = "error";
9		factory.WISHLIST_SUCCESS = "success";
10		factory.WISHLIST_EXISTS = "exists";
11        
12        factory.getWishlistForm = function getWishlistForm(){
13        	var wishlistForm = {};
14        	wishlistForm.info = {};
15        	wishlistForm.info.message = [];
16        	wishlistForm.alert = {};
17        	wishlistForm.alert.message = [];
18        	wishlistForm.success = {};
19        	wishlistForm.success.message = [];
20        	wishlistForm.fields = [];
21        	wishlistForm.other = [];
22        	
23        	return wishlistForm;
24        };
25        
26        factory.deleteToWishlist = function deleteToWishlist(product){
27        	var deferred = $q.defer();
28        	
29        	TbsWS.call('deletetowishlist/' + product.refProduit + '/' + product.tarif.refTarif, 'private').then(
30		          function(result){
31	        		if(result && result.key === "deletetowishlist"){
32	        			var status = result.value;
33			          	if(!status || status === undefined){
34			          		deferred.resolve(false);
35			          	} else {
36		          			status = status.replace(/"/g,'');
37			          		if(status == factory.WISHLIST_SUCCESS){
38				          		deferred.resolve(true);
39				          	} else {
40				          		deferred.resolve(false);
41				          	}
42			          	}
43			         } else {
44			         	deferred.resolve(false);
45			         }
46		          }
47		          ,function(error) {
48		          	  console.error(error);
49		          	  deferred.resolve(false);
50		        }
51		    );
52	        return deferred.promise;
53        };
54        
55        factory.getWishlist = function getWishlist(){
56        	var deferred = $q.defer();
57        	TbsWS.call('getwishlist/' + $rootScope.preferredLanguage, 'private').then(
58		          function(products){
59		          	deferred.resolve(products);
60		          }
61		          ,function(error) {
62		          	  console.error(error);
63		          	  deferred.resolve(false);
64		        }
65		    );
66        	return deferred.promise;
67        };
68        
69        factory.addToWishlist = function addToWishlist(wishlistForm, product){
70        	wishlistForm.info.message = [];
71        	wishlistForm.alert.message = [];
72        	wishlistForm.success.message = [];
73        	
74        	var deferred = $q.defer();
75        	
76        	if(!Auth.isClientConnecte()){
77        		$rootScope.openModalWishlist("DICO_WISHLIST_AJOUT_TITRE","DICO_WISHLIST_CONNEXION_REQUISE");
78			    deferred.resolve(false);
79        	} else {
80        		TbsWS.call('addtowishlist/' + product.refProduit + '/' + product.tarif.refTarif, 'private').then(
81			          function(result){
82		        		if(result && result.key === "addtowishlist"){
83		        			var status = result.value;
84				          	if(!status || status === undefined){
85					          	wishlistForm.alert.message.push("DICO_ERREUR_WISHLIST_REPONSE_INCOHERENTE");
86				          		deferred.resolve(false);
87				          	} else {
88			          			status = status.replace(/"/g,'');
89				          		if(status == factory.WISHLIST_SUCCESS){
90				          			$rootScope.openModalWishlist("DICO_WISHLIST_AJOUT_TITRE","DICO_WISHLIST_AJOUT_MESSAGE");
91					          		deferred.resolve(true);
92					          	} else if(status == factory.WISHLIST_EXISTS){
93					          		$rootScope.openModalWishlist("DICO_WISHLIST_AJOUT_TITRE","DICO_WISHLIST_DEJA_AJOUTE_MESSAGE");
94				          			deferred.resolve(true);
95					          	} else {
96					          		wishlistForm.alert.message.push("DICO_ERREUR_WISHLIST_AJOUT_PRODUIT");
97					          		deferred.resolve(false);
98					          	}
99				          	}
100				         } else {
101				         	deferred.resolve(false);
102				         }
103			          }
104			          ,function(error) {
105			          	  console.error(error);
106			          	  deferred.resolve(false);
107			        }
108			    );
109        	}
110	        return deferred.promise;
111		};
112        return factory;
113    }]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.