HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URL's added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<div class="wrap">
<div id="icon-options-general" class="icon32"></div>
<h2>New Publisher</h2>
<form name="new_publish_list" method="post" action="">
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-2">
<!-- main content -->
<div id="post-body-content">
<div class="meta-box-sortables ui-sortable">
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<!-- Toggle -->
<h3 class="hndle"><span></span>
</h3>
<div class="inside">
<div>
<table class="publisher-table">
<input type="hidden" name="form_submitted" value="Y">
<tr>
<td>
<label for="publisher-name"><h4>Pubisher Name</h4></label>
</td>
<td>
<input type="text" id="publisher-name" name="publisher-name">
<input type="hidden" value="" name="old-publisher-name">
</td>
</tr>
<tr>
<td>
<label for="publisher-description"><h4>Publisher Category</h4></label>
</td>
<td>
<textarea id="textarea"></textarea>
</td>
</tr>
<tr>
<td>
<label for="categories-check"><h4>Does Publisher have categories?</h4></label>
</td>
<td>
<input type="checkbox" name="category" id="categories-check">
</td>
</tr>
</table>
<div id="test"></div>
<input type="hidden" id="category-total" value="0" name="category-total">
</div>
<br class="clear" />
</div>
<!-- .inside -->
</div>
<!-- .postbox -->
</div>
<!-- .meta-box-sortables .ui-sortable -->
</div>
<!-- post-body-content -->
<!-- sidebar -->
<div id="postbox-container-1" class="postbox-container">
<div class="meta-box-sortables">
<div class="postbox">
<div class="handlediv" title="Click to toggle"><br></div>
<!-- Toggle -->
<div class="inside">
<p>Click here to update all changes and publish:</p>
<button class="button-primary save_button" type="submit">Save</button>
</div>
<!-- .inside -->
</div>
<!-- .postbox -->
</div>
<!-- .meta-box-sortables -->
</div>
<!-- #postbox-container-1 .postbox-container -->
</div>
<!-- #post-body .metabox-holder .columns-2 -->
<br class="clear">
</div>
<!-- #poststuff -->
</form>
</div> <!-- .wrap -->
body {
margin: 0 auto;
width: 80%;
background: #44dfba;
}
.publisher-table {
table-layout: fixed;
}
.publisher-table td {
min-width: 50%;
}
.category-box {
background: #eee;
border: grey solid 1px;
border-radius: 4px;
padding-bottom: 10px;
margin-bottom: 10px;
}
.products-container {
background: #ccc;
}
.product-box {
margin: 10px;
border: #808080 solid 1px;
border-radius: 4px;
}
.toggle-arrow,
.toggle-arrow-category {
float: right;
height: 1.2em;
vertical-align: middle;
cursor: pointer;
padding: 5px;
}
.button {
float: right;
margin-right: 10px;
}
/*.save_button {
margin: 10px 0!important;
}*/
.inside {
margin: 0!important;
}
hr {
border: #808080 1px dotted;
border-bottom: none;
}
.wp-menu-image img {
padding: 0;
}
.row-title {
vertical-align: top!important;
padding: 0.6em;
}
/*
Add new publisher page css
*/
.lsm-add-new-h2 {
margin-left: 4px;
padding: 4px 8px;
position: relative;
top: -3px;
text-decoration: none;
border: medium none;
border-radius: 2px;
background: #E0E0E0 none repeat scroll 0% 0%;
text-shadow: none;
font-weight: 600;
font-size: 13px;
}
.lsm-top-title {
margin-top: 1em;
font-size: 1.8em;
}
/**
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
.clear:before,
.clear:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.clear:after {
clear: both;
}
/**
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.clear {
*zoom: 1;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
// Known overall bugs = 0;
//
// IMPORTANT NOTES:
//
// 1 - When a function is added that adds or removes products (even by removing a category), the "ammendProductSelectors()" function must be called to keep the unique selectors for each product in line
// 2 - When using a variable involving a class or an ID, you must concatenate the prefix '#' or '.' if needed. The need for this will be removed once the plugin is in the final stage of development
//
//
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
var $ = jQuery
var pluginURL = "/new_wordpress/wp-content/plugins/Custom_Plugin_2"
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
// Class and ID variables //
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
var jqueryDivID = 'test' // This DIV is defined in the actual HTML/PHP file and is not dynamically added
// Change here, change everywhere
// variables used to append the catagories HTML
var checkBoxID = 'categories-check'
var categoryBoxClass = 'category-box'
var catagoriesContainerID = 'catagories-container-'
var mainCategoryTitleClass = 'category-title'
var categoriesTableID = 'category-table-'
var labelTitleClass = 'label-title'
var labelTitleID = 'label-title-'
var labelDescriptionID = 'label-description-'
var labelDescriptionClass = 'label-description'
var categoryNameClass = 'category-input'
var categoryNameID = 'category-input-'
var categoryDescriptionClass = 'category-description'
var categoryDescriptionID = 'category-description-'
var categoryTextareaID = 'category-textarea-'
var categoryTextareaClass = 'category-textarea'
var tableID = 'category-table-'
var tableClass = 'category-table'
var productsContainerID = 'products-container-'
var productsContainerClass = 'products-container'
var categoryRemoveButtonClass = 'category-remove-button'
var hiddenProductCountID = 'hidden-input-product-count-'
var hiddenProductCountClass = 'hidden-input-product-count'
// variables used to append the products HTML
var productsLabelTitleID = 'product-label-name-'
var productsLabelTitleClass = 'product-label-name'
var productsLabelDescriptionID = 'product-label-description-'
var productsLabelDescriptionClass = 'product-label-description'
var productsTextareaID = 'category-textarea'
var productsTextareaClass = 'product-textarea'
var productLabelID = 'product-label-'
var productLabelClass = 'product-label'
var toggleArrowClass = 'toggle-arrow-category'
var productsInnerContainerID = 'products-inner-container-'
var productsInnerContainerClass = 'products-inner-container'
var removeProductButtonClass = 'remove-product-button'
var productsRemoveButtonClass = 'remove-product-button'
var addProductsButtonClass = 'products-add-button'
var productsTitleID = 'products-title-'
var productsTitleClass = 'products-title'
//image urls
var upArrow = '/images/up-arrow.png'
var downArrow = '/images/down-arrow.png'
// when on the edit screen, sets up all categories with the correct ID, when adding a new category
var categoryCount = $( '#' + jqueryDivID ).children('.' . categoryBoxClass).length
var totalProducts = $( '#' + jqueryDivID ).find('.' . productsInnerContainerClass ).length
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
// Check functions //
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
// checks box if info is pulled from the database on specific category as default //
////////////////////////////////////////////////////////////////////////////////////
$(document).ready(function() { //Known bugs = 0;
if ( categoryCount <= 0 ) {
$('#categories-check').prop('checked', false)
ammendProductSelectors()
} else {
$('#categories-check').prop('checked', true)
ammendProductSelectors()
// on the 'Manage Page', this is needed to append the correct number to the hidden field, of products within a category. If this is not here, the products will not be saved as the value will be set to 0
ammendProductsOnLoad()
}
$('form').keypress(function (e) {
var charCode = e.charCode || e.keyCode || e.which;
if (charCode == 13) {
stopEvent(e);
}
});
})
// Counts and ammends all inner products
function ammendProductsOnLoad() {
var a = 0;
while ( a <= categoryCount ) {
innerProductCount(a)
a++
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
// Variable functions //
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////
// function used to generate categories HTML //
///////////////////////////////////////////////
function appendCategory() { //Known bugs = 0;
categoryCount++
var categoriesHtml ='<div id="' + catagoriesContainerID + categoryCount + '" class="' + categoryBoxClass + ' clear">'
+'<h1 class="' + mainCategoryTitleClass + '">Category ' + categoryCount + '</h1>'
+'<img value="' + categoryCount + '" class="' + toggleArrowClass + ' hide" src="' + pluginURL + upArrow + '"> '
+'<table class="' + tableClass + '" id="' + categoriesTableID + categoryCount + '" style="text-align: right;">'
+'<tr>'
+'<td class="row-title">'
+'<label class="' + labelTitleClass + '" id="' + labelTitleID + categoryCount + '" for="' + categoryNameID + categoryCount + '">'
+'Category ' + categoryCount + ' Name'
+'</label>'
+'</td>'
+'<td><input type="text" name="' + categoryNameID + categoryCount + '" id="' + categoryNameID + categoryCount + '" placeholder="e.g., Adobe, Microsoft, Manage Engine, etc.." class="regular-text ' + categoryNameClass + '" />'
+'</tr>'
+'<tr>'
+'<td class="row-title ' + labelDescriptionClass + '">'
+'<label class="' + categoryDescriptionClass + '" for="' + categoryTextareaID + categoryCount + '">'
+'Category ' + categoryCount + ' Description'
+'</label>'
+'</td>'
+'<td>'
+'<textarea class="' + categoryTextareaClass + '" id="' + categoryTextareaID + categoryCount + '" name="' + categoryTextareaID + categoryCount + '" style="width: 100%;" rows="10">'
+'</textarea>'
+'</td>'
+'</tr>'
+'</table>'
+'<div id="' + productsContainerID + categoryCount + '" class="' + productsContainerClass + '" value="0" name></div>'
+ '<input class="' + hiddenProductCountClass + '" id="' + hiddenProductCountID + categoryCount + '" name="' + hiddenProductCountID + categoryCount + '" type="hidden" value="0">'
+'<button type="button" value="' + categoryCount + '" class="button-secondary button ' + addProductsButtonClass + '" onclick="addProduct($(this).attr(\'value\'))">Add Product</button>'
+'<button type="button" value="' + categoryCount + '" class="button-secondary button ' + productsRemoveButtonClass + '" onclick="removeAllProducts($(this).attr(\'value\'))">Remove All Products</button>'
+'<button type="button" value="' + categoryCount + '" class="button-secondary button ' + categoryRemoveButtonClass + '" onclick="removeCategory($(this).attr(\'value\'))">Remove Category</button>'
+'<button type="button" class="button-secondary button" onclick="addCategory()">Add Category</button>'
return categoriesHtml
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// Category manipulation //
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Replaces details of category to match actual position in form for easde of submission //
///////////////////////////////////////////////////////////////////////////////////////////
function alterCategorySelectors() { //Known bugs = 0;
var i = 1
$( '.' + categoryBoxClass ).each(function() {
$( this ).find( '.' + mainCategoryTitleClass ).text('Category ' + i)
$( this ).find( '.' + labelTitleClass ).text( 'Category ' + i + ' Name').attr( {
id: labelTitleID + i,
for: categoryNameID + i
} )
$( this ).find( '.' + categoryNameClass ).attr( {
id: categoryNameID + i,
name: categoryNameID + i
} )
$( this ).find( '.' + categoryTextareaClass ).attr( {
id: categoryTextareaID + i,
name: categoryTextareaID + i
} )
$( this ).find( '.' + categoryDescriptionClass ).text( 'Category ' + i + ' Description').attr( {
id: categoryDescriptionID + i,
for: categoryTextareaID + i
} )
$( this ).find( '.' + productsContainerClass ).attr( 'id', productsContainerID + i )
$( this ).find( '.' + categoryRemoveButtonClass ).attr( 'value', i )
$( this ).find( '.toggle-arrow-category' ).attr( 'value', i )
$( this ).find( '.' + addProductsButtonClass ).attr( 'value', i )
$( this ).find( '.' + productsRemoveButtonClass ).attr( 'value', i )
$( this ).find( '.' + tableClass ).attr( 'id', categoriesTableID + i )
$( this ).attr( 'id', catagoriesContainerID + i )
$( this ).find( '.' + hiddenProductCountClass ).attr( {
id: hiddenProductCountID + i,
name: hiddenProductCountID + i
} ) // no class is available at the moment
i++
})
}
/////////////////////////////////////////////////////
// adds category box when checked and removes also //
/////////////////////////////////////////////////////
$( '#' + checkBoxID).click(function(){ //Known bugs = 0;
if ($(this).prop('checked') === true) {
$( '#' + jqueryDivID ).append(appendCategory())
countCategories()
} else {
if (confirm('Are you sure you want to delete all categories?')) {
categoryCount = 0
$('#' + jqueryDivID ).empty()
countCategories()
} else {
return false
}
}
});
//////////////////////////////////////////////////////
// function to toggle display state of category box //
//////////////////////////////////////////////////////
$( '#' + jqueryDivID ).on('click', '.' + toggleArrowClass, function() { //Known bugs = 0;
var selectorNum = $(this).attr('value')
var tableNumber = $('#' + categoriesTableID + selectorNum )
var tableProducts = $('#' + categoriesTableID + selectorNum ).siblings('.' + productsContainerClass )
//if currently up arrow
if ($(this).attr('src') === pluginURL + upArrow) {
$(this).attr('src', pluginURL + downArrow)
tableNumber.hide()
tableProducts.hide()
}
else {
$(this).attr('src', pluginURL + upArrow)
tableNumber.show();
tableProducts.show()
}
});
/////////////////////////////////////////////////////////////////
// function adds category to the bottom of the categories list //
/////////////////////////////////////////////////////////////////
function addCategory() { //Known bugs = 0;
$('#' + jqueryDivID ).append(appendCategory())
countCategories()
}
///////////////////////////////////////////////////////////////////////////////////////
// Removes category on click and appends details of category cound and product count //
///////////////////////////////////////////////////////////////////////////////////////
function removeCategory(i) { //Known bugs = 0;
categoryCount--
$( '#' + catagoriesContainerID + i ).remove()
if (categoryCount < 1) {
$('input[name="category"]').prop('checked', false)
$( '#' + jqueryDivID ).empty()
categoryCount = 0
}
alterCategorySelectors()
ammendProductsOnLoad()
countCategories()
// TO DO: add line here to count all of the products on removal of category and realign
}
//function to count categories
function countCategories() {
var categoryCount2 = $( '#' + jqueryDivID ).children('.' . categoryBoxClass).length
$( '#category-total' ).attr( 'value', categoryCount2 )
ammendProductSelectors()
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// Product manipulation //
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////
// function used to generate products HTML //
/////////////////////////////////////////////
function appendProduct(i) { //Known bugs = 0;
// increases the total of products by one, to be used where unique selectors are required only
totalProducts++
// makes sure that the product number that is appended to the ened of the category box, is in the correct numerical order
productNumber = ($('#' + productsContainerID + i ).children('.' + productsInnerContainerClass ).length) + 1
var productsHtml = '<div class="' + productsInnerContainerClass + '" id="' + productsInnerContainerID + totalProducts + '">'
+ '<table style="text-align: right;">'
+ '<tbody>'
+ '<tr>'
+ '<td class="row-title">'
+ '<label class="' + productsLabelTitleClass + '" for="' + productsTitleID + totalProducts + '">Product ' + productNumber +' Name</label>'
+ '</td>'
+ '<td>'
+ '<input id="' + productsTitleID + totalProducts + '" name="' + productsTitleID + totalProducts + '" placeholder="e.g., Adobe, Microsoft, Manage Engine, etc.." class="regular-text ' + productsTitleClass + '" type="text">'
+ '</td>'
+ '</tr>'
+ '<tr>'
+ '<td class="row-title">'
+ '<label class="' + productsLabelDescriptionClass + '" for="' + productsTextareaID + totalProducts + '">Product ' + productNumber +' Description</label>'
+ '</td>'
+ '<td>'
+ '<textarea id="' + productsTextareaID + totalProducts + '" class="' + productsTextareaClass + '" name="' + productsTextareaID + totalProducts + '" style="width: 100%;" rows="10"></textarea>'
+ '</td>'
+ '</tr>'
+ '<tr>'
+ '<td colspan="2">'
+ '<button type="button" class="button-secondary button ' + removeProductButtonClass + '" value="' + totalProducts + '" onclick="removeProduct($(this).attr(\'value\'))">Remove product</button>'
+ '</td>'
+ '</tr>'
+ '</tbody>'
+ '</table>'
+ '<hr>'
+ '</div>'
ammendProductSelectors()
return productsHtml
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// On updating the number of products in a list, the value in #products-container-x needs to be updated //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
function innerProductCount(i) {
var parentContainer = $( '#' + productsContainerID + i )
var selectedElementsLength = parentContainer.children('.'+ productsInnerContainerClass ).length
parentContainer.siblings('#' + hiddenProductCountID + i).attr('value', selectedElementsLength)
parentContainer.attr('value', selectedElementsLength)
console.log( parentContainer.attr( 'value' ) )
}
////////////////////////////////////////
// Appends new product field to table //
////////////////////////////////////////
function addProduct(i) { //Known bugs = 0;
// the i variale is passed through from the buttons value attribute that is unique to that category and it's poisiton in the list.
thisProduct = $('#' + productsContainerID + i )
thisProduct.append(appendProduct(i))
innerProductCount(i)
ammendProductSelectors()
}
///////////////////////////////////////
// Removes single product from table //
///////////////////////////////////////
function removeProduct(i) { //Known bugs = 0 (1 removed);
//On removing product from a cateogry, it will count the products in that category and redefine the produst-container- ID // SOLVED: The "AlterProductNums()" function must be called first before calling the ammend-products-selectors
// defineds container to be removed using passed variable from the button clicked, on the product list
var spottedDiv = $('#' + productsInnerContainerID + i )
// used to select the index of the category so labels and description titles can be ammended in alterProductsNums function
var productNumber = spottedDiv.parents('.category-box').find('.products-inner-container').length
var parentDiv = spottedDiv.parent().attr('id').replace( productsContainerID, '')
// removes container where button was clicked
spottedDiv.remove()
// reduces the amount of total products by 1 in a single category
productNumber--
// alters products within a category so they are still displayed in numerical order
alterProductsNums(parentDiv)
// changes important selectors off all products so data can be stored
ammendProductSelectors()
return productNumber
}
//////////////////////////////////////////
// Removes products from relevant table //
//////////////////////////////////////////
function removeAllProducts(i) { //Known bugs = 0;
// I variable is passed through the button clicked which holds the value of the category to be removed
if (confirm('Are you sure you want to remove all products in the category?')) {
$('#' + productsContainerID + i ).empty()
//alters uique selectors for input fields and text areas in products, so they can easily be stored and recalled by the sql functions
ammendProductSelectors()
} else {
return false
}
}
//////////////////////////////////////////////////////////////////////////////////
// On removing a product, edits the product information to keep numerical order //
//////////////////////////////////////////////////////////////////////////////////
function ammendProductSelectors() { // Known bugs = 0 (1 removed);
// text input/area lables are not lining up on adding a new product. (need to add rule fr the id's and for's in to the function)
// SOLVED: Added relevant information to the unique slectors function
var b = 1
$( '.' + productsInnerContainerClass ).each(function() {
// updates the name of the product iput and textarea fields so it can be parsed to the database
$( this ).find( '.' + productsLabelTitleClass ).attr( 'for', productsTitleID + b)
$( this ).find( '.' + productsTitleClass ).attr( {
id: productsTitleID + b,
name: productsTitleID + b
} )
$( this ).find( '.' + productsTextareaClass ).attr({
name: productsTextareaID + b,
id: productsTextareaID + b
})
$( this ).find( '.' + productsLabelDescriptionClass ).attr( {
id: productsLabelDescriptionID + b,
for: productsTextareaID + b
})
// updates the remove button value to match the new product position
$( this ).find( '.' + removeProductButtonClass ).attr( 'value', b )
// alters unique selector for inned container
$( this ).attr( 'id', productsInnerContainerID + b )
b++
})
}
///////////////////////////////////////////////////////////////////////////
// On removing a product,edits the visible content per category NOT ALL //
///////////////////////////////////////////////////////////////////////////
function alterProductsNums(i) {
//Known bugs = 0;
var q = 1
innerProductCount(i);
var selectedElements = $( '#' + productsContainerID + i ).children('.'+ productsInnerContainerClass )
selectedElements.each(function() {
$( this ).find( '.' + productsLabelDescriptionClass )
.attr( 'id', productsLabelDescriptionID + q )
.text( 'Product ' + q + ' Description')
//Product name label and input area
$( this ).find( '.' + productLabelClass ).text( 'Product ' + q + ' Name')
$( this ).find( '.' + productsLabelTitleClass ).text( 'Product ' + q + ' Name' )
$( this ).attr( 'id', productsInnerContainerID + q )
q++
})
}
Also see: Tab Triggers