How to use select - 10 common examples

To help you get started, we’ve selected a few select examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bioversity / Crop-Ontology / main.js View on Github external
post: function(req, res) {
            var emailPar = req.getParameter('email');
            var secret = req.getParameter('secret');
            var newpassword = req.getParameter('newpassword');
            var renewpassword = req.getParameter('renewpassword');

            var data = {};
            data.email = emailPar;
            data.secret = secret;

            var user = select('user')
                        .find({ 
                            email: emailPar,
                            password: secret
                        })
                        .limit(1);

            user.values(function(values) {
                if(!values.length)  {
                    data.error = 'Something went wrong. Try recovering your password again!';
                } else {
                    // we found a user, let's change its password
                    // we can get the user select scope from above, sweet!
                    if(isblank(newpassword)) {
                        data.error = "Your password can't be blank";
                    } else if(!newpassword.equals(renewpassword)) {
                        data.error = "Your passwords don't match. Re-type them";
github zenorocha / clipboard.js / src / clipboard-action.js View on Github external
this.fakeElem.style.border = '0';
        this.fakeElem.style.padding = '0';
        this.fakeElem.style.margin = '0';
        // Move element out of screen horizontally
        this.fakeElem.style.position = 'absolute';
        this.fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px';
        // Move element to the same position vertically
        let yPosition = window.pageYOffset || document.documentElement.scrollTop;
        this.fakeElem.style.top = `${yPosition}px`;

        this.fakeElem.setAttribute('readonly', '');
        this.fakeElem.value = this.text;

        this.container.appendChild(this.fakeElem);

        this.selectedText = select(this.fakeElem);
        this.copyText();
    }
github abhishekbalam / keeplinkin / keeplinkin / static / js / clipboard.js-master / src / clipboard-action.js View on Github external
this.fakeElem.style.border = '0';
        this.fakeElem.style.padding = '0';
        this.fakeElem.style.margin = '0';
        // Move element out of screen horizontally
        this.fakeElem.style.position = 'absolute';
        this.fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px';
        // Move element to the same position vertically
        let yPosition = window.pageYOffset || document.documentElement.scrollTop;
        this.fakeElem.style.top = `${yPosition}px`;

        this.fakeElem.setAttribute('readonly', '');
        this.fakeElem.value = this.text;

        this.container.appendChild(this.fakeElem);

        this.selectedText = select(this.fakeElem);
        this.copyText();
    }
github decidim / decidim / decidim-core / app / packs / src / decidim / clipboard.js View on Github external
$(document).on("click", "[data-clipboard-copy]", (ev) => {
    const $el = $(ev.target);
    if (!$el.data("clipboard-copy") || $el.data("clipboard-copy").length < 1) {
      return;
    }

    const $input = $($el.data("clipboard-copy"));
    if ($input.length < 1 || !$input.is("input, textarea, select")) {
      return;
    }

    // Get the available text to clipboard.
    const selectedText = select($input[0]);
    if (!selectedText || selectedText.length < 1) {
      return;
    }

    // Move the selected text to clipboard.
    const $temp = $(`<textarea>${selectedText}</textarea>`).css({
      width: 1,
      height: 1
    });
    $el.after($temp);
    $temp.select();

    const copyDone = () =&gt; {
      $temp.remove();
      $el.focus();
    };
github thx / magix-gallery / build / src / mx-tree / index.js View on Github external
var readOnly = (ops.readOnly + '') === 'true';
        var hasLine = (ops.hasLine + '') === 'true';
        var valueKey = ops.valueKey || 'value';
        var textKey = ops.textKey || 'text';
        var parentKey = ops.parentKey || 'pValue';
        // 是否需要全选功能,默认关闭
        var needAll = (ops.needAll + '') === 'true';
        // 是否可展开收起,默认false
        var needExpand = (ops.needExpand + '') === 'true';
        // 组织树状结构
        var info = Util.listToTree(ops.list, valueKey, parentKey);
        var list;
        if (needAll) {
            var all = {};
            all[valueKey] = me.id + '_all';
            all[textKey] = I18n['select.all'];
            all.isAll = true;
            all.children = info.list;
            list = [all];
        }
        else {
            list = info.list;
        }
        // 展开收起状态,默认false
        // 切换数据时保留历史展开收起状态
        var close = (ops.close + '') === 'true';
        var map = {};
        var _lp1 = function (arr) {
            arr.forEach(function (item) {
                map[item[valueKey]] = close;
                if (item.children && item.children.length > 0) {
                    _lp1(item.children);
github micromata / projectforge / projectforge-webapp / src / components / design / ReactSelect.jsx View on Github external
return (
        
            <span>{label}</span>
            {tooltipElement}
             (option[valueProperty])}
                getOptionLabel={getOptionLabel || getOptionLabelDefault}
                loadOptions={loadOptions}
                defaultOptions={defaultOptions}
                id={id}
                isMulti={multi}
                placeholder={translations['select.placeholder'] || ''}
                cache={{}}
                value={value || null}
                {...props}
            /&gt;
            
        
    );
}
github micromata / projectforge / projectforge-webapp / src / containers / page / calendar / CalendarPage.jsx View on Github external
<form>
                                
                                    
                                        <select> (option.title)}
                                            getOptionValue={option =&gt; (option.id)}
                                            isClearable
                                            isMulti
                                            onChange={this.onChange}
                                            options={options}
                                            placeholder={translations['select.placeholder']}
                                            setMultiValue={this.handleMultiValueChange}
                                            styles={customStyles}
                                            values={colors}
                                            value={activeCalendars.map(option =&gt; ({
                                                ...option,
                                                filterType: 'COLOR_PICKER',
                                                label: option.title,
                                            }))}
                                            // loadOptions={loadOptions}
                                            // defaultOptions={defaultOptions}
                                        /&gt;
                                    
                                    
                                        </select></form>
github openbaton / NFVO / gui / src / main / resources / static / js / controllers / dataCenterController.js View on Github external
$scope.alerts = [];
            $scope.datacenter = {};
            $scope.file = '';

            var urlDC = '/api/v1/datacenters/';
            loadDatacenter();

            $scope.dataSelect = ['select..', 'TEST', 'AMAZON', 'OPENSTACK'];
            $scope.city = 'Berlin';
            $scope.locations = serviceAPI.getLocations();
            $scope.selection = $scope.dataSelect[0];
            $scope.locationRadio = $scope.locations[0];
            $scope.locationChecked = {};
            var dataCenterJ = {};
            $scope.switch = [];
            dataCenterJ['select..'] = {};
            dataCenterJ['OPENSTACK'] = {
                "name": "datacenter-1",
                "location": {
//                    "name": "Munich",
//                    "latitude": 48.13513,
//                    "longitude": 11.58198
                },
                "type": "OPENSTACK",
                "switch": {
                    "ports": [
                        {
                            "capacity": 30000,
                            "portNumber": 1
                        }
                    ],
                    "dpid": "datacenter-1",
github openbaton / NFVO / src / main / resources / static / js / controllers / vimInstanceController.js View on Github external
}
            else {
                showError('Problem with the VIM Instance');

            }
        };

        $scope.dataSelect = ['select..', 'TEST', 'AMAZON', 'OPENSTACK'];
        $scope.city = 'Berlin';
        $scope.locations = serviceAPI.getLocations();
        $scope.selection = $scope.dataSelect[0];
        $scope.locationRadio = $scope.locations[0];
        $scope.locationChecked = {};
        var dataCenterJ = {};
        $scope.switch = [];
        dataCenterJ['select..'] = {};
        dataCenterJ['OPENSTACK'] = {
            "name": "datacenter-1",
            "location": {
//                    "name": "Munich",
//                    "latitude": 48.13513,
//                    "longitude": 11.58198
            },
            "type": "OPENSTACK",
            "switch": {
                "ports": [
                    {
                        "capacity": 30000,
                        "portNumber": 1
                    }
                ],
                "dpid": "datacenter-1",
github AudithSoftworks / Uniform / www / javascripts / themer.js View on Github external
vert += vertChange;
			}

			return vert;
		}

		// Get some values and convert them to numbers
		$('.autoGrab').each(function () {
			var $e = $(this),
				id = $e.attr('id');
			grab[id] = $e.val();
		});

		// First five rows are select spans
		offset = sprites('select', "right", offset, "", -grab.selectHeight, states.bar);
		replacements['select.height'] = px(grab.selectHeight);

		// Next five rows are select divs - the cap on the left side
		offset = sprites('selectCap', 0, offset, 0, -grab.selectHeight, states.bar);

		// 10 checkbox states on a single row
		offset = sprites('checkbox', 0, offset, -grab.checkWidth, 0, states.tile);
		replacements['checkbox.height'] = px(grab.checkHeight);
		replacements['checkbox.width'] = px(grab.checkWidth);
		offset -= grab.checkHeight;

		// 10 radio states on a single row
		offset = sprites('radio', 0, offset, -grab.radioWidth, 0, states.tile);
		replacements['radio.height'] = px(grab.radioHeight);
		replacements['radio.width'] = px(grab.radioWidth);
		offset -= grab.checkHeight;

select

Programmatically select the text of a HTML element

MIT
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis