Permalink
Browse files

Remove deprecated code.

  • Loading branch information...
1 parent 5d8d385 commit cda01eb53a17c35839402ffb81b8d26c49d2690b @andreisebastianc committed Jun 3, 2012
Showing with 0 additions and 160 deletions.
  1. +0 −127 js/helpers.js
  2. +0 −33 meta/meta_social.php
View
127 js/helpers.js
@@ -1,127 +0,0 @@
-/**
- *
- * checks if an input field contains a valid email address
- * @param emailInputField the field whose value is checked
- * @param emailInputLabel the label of the input field
- */
-function isValidEmail(emailInputField,emailInputLabel){
- var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
-
- if(emailInputField.val() === '') {
- emailInputLabel.addClass('error');
- return false;
- }
- else if(!emailReg.test(emailInputField.val())) {
- emailInputLabel.addClass('error');
- return false;
- }
- emailInputLabel.removeClass('error');
- emailInputLabel.addClass('good');
- return true;
-}
-
-/**
- *
- * @return boolean has errors?
- *
- * Example of way to build array:
- var array=[];
- array[0] = {check : $('#message-me-form #name'),label : $('#message-me-form .name-label')};
- array[1] = {check : $('#message-me-form #message'),label : $('#message-me-form .message-label')};
- */
-function validateFields(arrayOfItemsToCheck){
- var hasError = false;
- var i;
- for (i=0; i<arrayOfItemsToCheck.length; i++) {
- if(arrayOfItemsToCheck[i].check.val() === ''){
- arrayOfItemsToCheck[i].display.removeClass('good').addClass('error');
- hasError = true;
- }
- else{
- if(arrayOfItemsToCheck[i].email){
- hasError = !isValidEmail(arrayOfItemsToCheck[i].check,arrayOfItemsToCheck[i].display);
- }
- else{
- arrayOfItemsToCheck[i].display.removeClass('error').addClass('good');
- }
- }
- }
- return hasError;
-}
-
-/**
- *
- *
- * Example of delegating this action to hide labels of input fields
- $('#message-me-form').delegate('#name, #email, #message','focus blur',hideInsideLabel);
- */
-function hideInsideLabel(event){
- if(event.type === 'focus' || event.type === 'focusin'){
- if($(this).val() === ''){
- $(this).parent().children('label').addClass('focused');
- }
- }
- if(event.type === 'blur' || event.type === 'focusout'){
- if($(this).val() === ''){
- $(this).parent().children('label').removeClass('focused');
- $(this).parent().children('label').show();
- }
- }
-
- if(event.type === 'change'){
- if($(this).val() !== ''){
- $(this).parent().children('label').hide();
- }
- else{
- $(this).parent().children('label').show();
- }
- }
-}
-
-/**
- *
- */
-function fixInputWithLabel(arrayOfItemsToCheck){
- var i;
- for (i=0; i<arrayOfItemsToCheck.length; i++) {
- if(arrayOfItemsToCheck[i].check.val() !== ''){
- arrayOfItemsToCheck[i].check.parent().children('label').hide();
- arrayOfItemsToCheck[i].display.addClass('good');
- }
- }
-}
-
-/**
- *
- */
-function clearInputFields(arrayOfItemsToCheck){
- var i;
- for (i=0; i<arrayOfItemsToCheck.length; i++) {
- arrayOfItemsToCheck[i].check.parent().children('label').show(400).removeClass('focused');
- arrayOfItemsToCheck[i].check.val('');
- arrayOfItemsToCheck[i].display.removeClass('good');
- }
-}
-
-/**
- *
- * @TODO finish
- * @TODO callbacks required
- */
-function hideAndRemove(element){
- element.hide(1000,function(){
- element.remove();
- });
-}
-
-/**
- *
- */
-function toggleCollapse(element){
- element = $.data(this,'element');
- $(element).animate({
- height: 'toggle'
- },500,function(){
- $(element).parent().toggleClass('minimized');
- });
-}
View
33 meta/meta_social.php
@@ -1,33 +0,0 @@
-<?php
-
-$social_meta_box = array(
- 'id' => 'social-meta-box',
- 'title' => 'Detalii suplimentare Social Media',
- 'page' => 'socialmedia',
- 'context' => 'normal',
- 'priority' => 'high',
- 'fields' => array(
- array(
- 'name' => 'URL',
- 'desc' => 'Adaugă adresa web a paginii.',
- 'id' => 'url',
- 'type' => 'text',
- 'std' => ''
- ),
- array(
- 'name' => 'meta_box',
- 'id' => 'meta_box',
- 'type' => 'hidden',
- 'std' => 'social_meta_box',
- 'hide' => true
- ),
- )
-);
-
-// Add meta box
-function smc_social_add_box() {
- global $social_meta_box;
- add_meta_box($social_meta_box['id'], $social_meta_box['title'], 'default_meta_show_box', $social_meta_box['page'], $social_meta_box['context'], $social_meta_box['priority'], $social_meta_box['fields']);
-}
-
-add_action('admin_menu', 'smc_social_add_box');

0 comments on commit cda01eb

Please sign in to comment.