1 /*
  2  * ***** BEGIN LICENSE BLOCK *****
  3  * Zimbra Collaboration Suite Web Client
  4  * Copyright (C) 2013, 2014, 2015, 2016 Synacor, Inc.
  5  *
  6  * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License");
  7  * you may not use this file except in compliance with the License.
  8  * You may obtain a copy of the License at: https://www.zimbra.com/license
  9  * The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15
 10  * have been added to cover use of software over a computer network and provide for limited attribution
 11  * for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
 12  *
 13  * Software distributed under the License is distributed on an "AS IS" basis,
 14  * WITHOUT WARRANTY OF ANY KIND, either express or implied.
 15  * See the License for the specific language governing rights and limitations under the License.
 16  * The Original Code is Zimbra Open Source Web Client.
 17  * The Initial Developer of the Original Code is Zimbra, Inc.  All rights to the Original Code were
 18  * transferred by Zimbra, Inc. to Synacor, Inc. on September 14, 2015.
 19  *
 20  * All portions of the code are Copyright (C) 2013, 2014, 2015, 2016 Synacor, Inc. All Rights Reserved.
 21  * ***** END LICENSE BLOCK *****
 22  */
 23 
 24 /**
 25  * Creates the social application.
 26  * @class
 27  * This class represents the social application.
 28  *
 29  * @param	{DwtControl}	container		the container
 30  *
 31  * @extends		ZmApp
 32  */
 33 ZmSocialApp = function(container) {
 34 	ZmApp.call(this, ZmApp.SOCIAL, container);
 35 }
 36 
 37 ZmSocialApp.prototype = new ZmApp;
 38 ZmSocialApp.prototype.constructor = ZmSocialApp;
 39 
 40 ZmSocialApp.prototype.isZmSocialApp = true;
 41 ZmSocialApp.prototype.toString = function() {	return "ZmSocialApp"; };
 42 
 43 //
 44 // Constants
 45 //
 46 
 47 ZmApp.SOCIAL                        = ZmId.APP_SOCIAL;
 48 ZmApp.CLASS[ZmApp.SOCIAL]		    = "ZmSocialApp";
 49 ZmApp.SETTING[ZmApp.SOCIAL]		    = ZmSetting.SOCIAL_ENABLED;
 50 ZmApp.UPSELL_SETTING[ZmApp.SOCIAL]	= ZmSetting.SOCIAL_EXTERNAL_ENABLED;
 51 ZmApp.LOAD_SORT[ZmApp.SOCIAL]	    = 100;
 52 
 53 ZmSocialApp.prototype._registerApp = function() {
 54 	ZmApp.registerApp(ZmApp.SOCIAL, {
 55 		nameKey:            "communityName",
 56 		icon:               "Globe",
 57 		chooserTooltipKey:  "goToSocial",
 58 		chooserSort:        32,
 59 		defaultSort:        100,
 60 		upsellUrl:			ZmSetting.SOCIAL_EXTERNAL_URL
 61 	});
 62 
 63 	// overwrite community name with value from settings, if any
 64 	var appName = appCtxt.get(ZmSetting.SOCIAL_NAME);
 65 	if (appName) {
 66 		ZmMsg[ZmApp.NAME[this._name]] = appName;
 67 	}
 68 };
 69 
 70 // User has clicked refresh button
 71 ZmSocialApp.prototype.runRefresh = function() {
 72 
 73 	var mainCtlr = appCtxt.getAppController(),
 74 		communityView = mainCtlr._appIframeView[ZmApp.SOCIAL];
 75 
 76 	if (communityView) {
 77 		communityView.runRefresh();
 78 	}
 79 };
 80