Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <textarea class="PatchListScrape"></textarea>
	<div class="Select-With-Text-Input">
		<div class="selectBox">
			<span class="selected"></span>
			<span class="selectArrow">&#9660</span>
			<div class="selectOptions" >
				<span class="selectOption" value="Released">Released</span>
				<span class="selectOption" value="Changed">Changed</span>
				<span class="selectOption" value="Increased">Increased</span>
			</div>
		</div>
		<input type="text" class="TextInput" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.">
	</div>
	<div class="Select-With-Text-Input">
		<div class="selectBox">
			<span class="selected"></span>
			<span class="selectArrow">&#9660</span>
			<div class="selectOptions" >
				<span class="selectOption" value="Released">Released</span>
				<span class="selectOption" value="Changed">Changed</span>
				<span class="selectOption" value="Increased">Increased</span>
			</div>
		</div>
		<input type="text" class="TextInput" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.">
	</div>
	<div class="Select-With-Text-Input">
		<div class="selectBox">
			<span class="selected"></span>
			<span class="selectArrow">&#9660</span>
			<div class="selectOptions" >
				<span class="selectOption" value="Released">Released</span>
				<span class="selectOption" value="Changed">Changed</span>
				<span class="selectOption" value="Increased">Increased</span>
			</div>
		</div>
		<input type="text" class="TextInput" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.">
	</div>
	
	<div class="TESTZONE"></div>
              
            
!

CSS

              
                @charset "utf-8";

/** ====================================================================== **/
/**                        TornHQ GLOBAL STYLESHEET                        **/
/** ====================================================================== **/
/**                                                                        **/
/** All content is copyright © 2016 - 2020 by TornHQ. All Rights Reserved. **/
/** Usage of TornHQ content on any other site is strictly prohibited.      **/
/**                                                                        **/
/** TornHQ is a help/tutorial/fan based website developed for Torn and not **/
/** developed by Torn. Images and content  taken from  Torn are subject to **/
/** © 2004-2020 Chedburn Networks LTD.                                     **/
/**                                                                        **/
/** Version 1.0                                                            **/
/**                                                                        **/
/** ====================================================================== **/



/** ======================================== **/
/**           RESET  DEFAULT  STYLES         **/
/** ======================================== **/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section, img {
	display: block;
}
body { line-height: 1; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
* {
	outline: none;
	padding: 0px;
	margin: 0px
}
button {
	border: none;
	padding: 0px;
	margin: 0px;
	background: none;
	cursor: pointer;
}
/** ========= RESET  DEFAULT  STYLES ======= **/



/** ======================================== **/
/**              GENERAL STYLES              **/
/** ======================================== **/

/** ==================== **/
/**        GENERAL       **/
/** ==================== **/

body {
    padding:50px;
}
.Select-With-Text-Input {
	position: relative;
	height: 32px;
	border: 1px solid #CCC;
	border-radius: 6px;
	box-shadow:0 1px 2px rgba(0,0,0,.4);
}
.Select-With-Text-Input .TextInput {
	position: relative;
	height: 30px;
	width: calc(100% - 197px);
	line-height: 30px;
	color:#888;
	text-indent: 10px;
	border: none;
}

div.selectBox {
	position: relative;
    text-align:left;
    line-height:30px;
    clear:both;
    color:#888;
	cursor: pointer;
}
span.selected {
    width:127px;
    text-indent:20px;
    overflow:hidden;
}
span.selectArrow {
    width:30px;
    text-align:center;
    font-size:10px;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -o-user-select: none;
    user-select: none;
}
 
span.selectArrow,span.selected {
    position:relative;
    float:left;
    height:30px;
    z-index:1;
}

div.selectOptions {
    position:absolute;
	margin-top: 32px;
	margin-left: -1px;
    width:150px;
	border-left:1px solid #FFFFFF;
    border-left:1px solid #ccc;
	border-right:1px solid #ccc;
	border-bottom:1px solid #ccc;
    border-bottom-right-radius:6px;
    border-bottom-left-radius:6px;
	box-shadow:0 1px 2px rgba(0,0,0,.4);
    overflow:hidden;
    background:#f6f6f6;
    padding-top:2px;
    display:none;
	z-index:9999;
}
     
span.selectOption {
    display:block;
    width:80%;
    line-height:20px;
    padding:5px 10%;
}
 
span.selectOption:hover {
    color:#f6f6f6;
    background:#4096ee;         
} 

              
            
!

JS

              
                function enableSelectBoxes(){
	$('div.selectBox').each(function(){
		$(this).children('span.selected').html($(this).children('div.selectOptions').children('span.selectOption:first').html());
		$(this).attr('value',$(this).children('div.selectOptions').children('span.selectOption:first').attr('value'));

		$(this).children('span.selected,span.selectArrow').click(function(){
			if($(this).parent().children('div.selectOptions').css('display') == 'none'){
				$(this).closest('.Select-With-Text-Input').css('border-radius','6px 6px 6px 0px');
				$(this).parent().children('div.selectOptions').css('display','block');
			}
			else {
				$(this).parent().children('div.selectOptions').css('display','none');
				$(this).closest('.Select-With-Text-Input').css('border-radius','6px 6px 6px 6px');
			}
		});

		$(this).find('span.selectOption').click(function(){
			$(this).parent().css('display','none');
			$(this).closest('div.selectBox').attr('value',$(this).attr('value'));
			$(this).parent().siblings('span.selected').html($(this).html());
			$(this).closest('.Select-With-Text-Input').css('border-radius','6px 6px 6px 6px');
		});
	});				
}

$(document).ready(function() {
	enableSelectBoxes();
	
	$(".PatchListScrape").bind("paste", function(e){

		const pastedElement = e.originalEvent.clipboardData.getData('text');
		const regexp = /- (\[|)(\S+)((\]|) )(.*)/g;
		const matches1 = pastedElement.matchAll(regexp);
		const matches2 = pastedElement.matchAll(regexp);
		var cetegory;
		var categories = [];
		var selectCategory;
		var patchList;
		
		for (const match of matches1) {
			var cetegory = match[2].replace(']','');
			if($.inArray(cetegory, categories)<0) {
				categories.push(cetegory);
			}
		}
		categories.forEach(function(item) {
			if (selectCategory) {
				selectCategory = selectCategory + "\n			<span class=\"selectOption\" value=\"" + item + "\">" + item + "</span>";
			} else {
				selectCategory = "			<span class=\"selectOption\" value=\"" + item + "\">" + item + "</span>";
			}
		});

		var createCategoryDrop = "	<div class=\"selectBox\">\n		<span class=\"selected\"></span>\n		<span class=\"selectArrow\">&#9660</span>\n		<div class=\"selectOptions\">\n" + selectCategory + "\n		</div>\n	</div>\n";
		
		for (const match of matches2) {
			cetegory = match[2].replace(']','');
			var content = match[5];
			if (patchList) {
				patchList = "<div class=\"Select-With-Text-Input\">\n" + createCategoryDrop + "	<input type=\"text\" class=\"TextInput\" value=\"" + content + "\">\n</div>\n" + patchList;
			} else {
				patchList = "<div class=\"Select-With-Text-Input\">\n" + createCategoryDrop + "	<input type=\"text\" class=\"TextInput\" value=\"" + content + "\">\n</div>\n";
			}
		}
		$(".TESTZONE").append(patchList);
		enableSelectBoxes();
	});
});
              
            
!
999px

Console