1 /** @fileoverview Widget gerenciador de conteúdo 2 3 @version 1.0 4 @author Matheus Martins Teixeira <a href="mailto:mteixeira@grad.icmc.usp.br"><mteixeira@grad.icmc.usp.br></a> 5 */ 6 7 /* 8 * ***** BEGIN LICENSE BLOCK ***** 9 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 10 * 11 * The contents of this file are subject to the Mozilla Public License Version 12 * 1.1 (the "License"); you may not use this file except in compliance with 13 * the License. You may obtain a copy of the License at 14 * http://www.mozilla.org/MPL/ 15 * 16 * Software distributed under the License is distributed on an "AS IS" basis, 17 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 18 * for the specific language governing rights and limitations under the 19 * License. 20 * 21 * The Original Code is TelaSocial 22 * 23 * The Initial Developer of the Original Code is Taboca TelaSocial. 24 * Portions created by the Initial Developer are Copyright (C) 2010 25 * the Initial Developer. All Rights Reserved. 26 * 27 * Contributor(s): 28 * @author Matheus Teixeira <teixeira.mdk@gmail.com> 29 * 30 * Alternatively, the contents of this file may be used under the terms of 31 * either the GNU General Public License Version 2 or later (the "GPL"), or 32 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 33 * in which case the provisions of the GPL or the LGPL are applicable instead 34 * of those above. If you wish to allow use of your version of this file only 35 * under the terms of either the GPL or the LGPL, and not to allow others to 36 * use your version of this file under the terms of the MPL, indicate your 37 * decision by deleting the provisions above and replace them with the notice 38 * and other provisions required by the GPL or the LGPL. If you do not delete 39 * the provisions above, a recipient may use your version of this file under 40 * the terms of any one of the MPL, the GPL or the LGPL. 41 * 42 * ***** END LICENSE BLOCK ***** */ 43 44 /** 45 Objeto com as funções para o widget contentCheck 46 @class 47 @name contentCheck 48 */ 49 var contentCheck = { 50 /** 51 Inicia o widget 52 @public 53 @function 54 */ 55 start : function() { 56 contentCheck.checkFrames(); 57 }, 58 /** 59 Verifica as abas que possuem conteúdo, as que não possuirem serão ocultadas. 60 @public 61 @function 62 */ 63 checkFrames : function() { 64 $('#main').find('iframe').each(function() { 65 var s = this; 66 setTimeout(function() { 67 if($(s).contents().find('#hascontent')[0] != null) 68 if($(s).contents().find('#hascontent')[0].value == 0) { 69 console.log($(s).attr('id') + " não tem conteudo!"); 70 $("#panel_" + $(s).attr('id')).hide(); 71 72 } else { 73 console.log($(s).attr('id') + " tem conteudo!"); 74 $("#panel_" + $(s).attr('id')).show(); 75 } 76 }, 10000); 77 }); 78 } 79 }