this._proxy = new WCF.Action.Proxy({
showLoadingOverlay: false
});
+
+ // register instance
+ WCF.System.ObjectStore.add('WCF.User.ProfilePreview', this);
},
/**
});
this._proxy.sendRequest();
}
+ },
+
+ /**
+ * Purages a cached user profile.
+ *
+ * @param integer userID
+ */
+ purge: function(userID) {
+ delete this._userProfiles[userID];
+
+ // purge content cache
+ this._data = { };
}
});
var $notification = new WCF.System.Notification();
$notification.show();
+
+ // force rebuilding of popover cache
+ var self = this;
+ WCF.System.ObjectStore.invoke('WCF.User.ProfilePreview', function(profilePreview) {
+ profilePreview.purge(self._userID);
+ });
}
});
var $notification = new WCF.System.Notification();
$notification.show();
+
+ // force rebuilding of popover cache
+ var self = this;
+ WCF.System.ObjectStore.invoke('WCF.User.ProfilePreview', function(profilePreview) {
+ profilePreview.purge(self._userID);
+ });
}
});
}
};
+/**
+ * Stores object references for global access.
+ */
+WCF.System.ObjectStore = {
+ /**
+ * list of objects grouped by identifier
+ * @var object<array>
+ */
+ _objects: { },
+
+ /**
+ * Adds a new object to the collection.
+ *
+ * @param string identifier
+ * @param object object
+ */
+ add: function(identifier, obj) {
+ if (this._objects[identifier] === undefined) {
+ this._objects[identifier] = [ ];
+ }
+
+ this._objects[identifier].push(obj);
+ },
+
+ /**
+ * Invokes a callback passing the matching objects as a parameter.
+ *
+ * @param string identifier
+ * @param object callback
+ */
+ invoke: function(identifier, callback) {
+ if (this._objects[identifier]) {
+ for (var $i = 0; $i < this._objects[identifier].length; $i++) {
+ callback(this._objects[identifier][$i]);
+ }
+ }
+ }
+};
+
WCF.System.Page = { };
WCF.System.Page.Multiple = Class.extend({