Sponsored Content
Top Forums Web Development Turning jQuery Code into Vue.js Post 303025723 by Scott on Saturday 10th of November 2018 12:23:08 PM
Old 11-10-2018
My "security" suggestion was just a guess.. probably not a very good one, or the right one for the wrong reasons! Encapsulation is good!

When the Vue instance is instantiated the execution context in JS knows about vbuserId, but that doesn't bind it in any way to the Vue instance. I've googled it to death, and can't find a way to make that happen. But it's certainly easy to update both, outside of the context of the Vue components with, for example, a function:
Code:
var vm  =
  new Vue({
    el: "#vue-navbar"
  });

var u = vm.$children["0"];

function updateId(newId) {
  vbuserId = newId || 0;
  u.id = vbuserId;
}

Of course, to anyone who is concerned, this vbuserId is only used for the purposes of displaying an avatar (and only either your own or the default, silhouette one, and doesn't "make you" that user Smilie
 

6 More Discussions You Might Find Interesting

1. What is on Your Mind?

JQuery and CSS Flex Code for Responsive WOL Page

I have just wrote this jQuery to the WOL page, so the table of users on line will not need scrollbars and will instead transform into a responsive table: <script> jQuery(document).ready(function (){ jQuery("#neo-who-flex-tcat"). css({"display":"flex","flex-flow":"row wrap", ... (0 Replies)
Discussion started by: Neo
0 Replies

2. What is on Your Mind?

JQuery and CSS Flex Code for Responsive Forum Home Page

So far, I have completed making the home page more responsive (except for the forum stats at the top and the WOL box at the bottom, they still use scroll bars). xevV3_iZ8-s For full screen use the link below and set your YT resolution to 1080p60 HD https://youtu.be/xevV3_iZ8-s Here is... (1 Reply)
Discussion started by: Neo
1 Replies

3. What is on Your Mind?

JQuery to Add Code Tags to Selected Text

Hey. Someone find or write some jQuery code where we can select text with our mouse and then click or double click the highlighted / selected text and then it will wrap code tags around the highlighted text (in our editors). :) (0 Replies)
Discussion started by: Neo
0 Replies

4. Web Development

Simple Vue.js Component to Redirect to External Web Page Using Vue Router

Vue Router has some quirks and on of the quirks is that it is not reliable when adding external links using the vue-router library. After struggling with many solutions, I have found that creating a simple Vue.js component like this one seems to work the best (so far): Component Example: ... (0 Replies)
Discussion started by: Neo
0 Replies

5. Web Development

Vue JS 2 Tutorial by The Net Ninja: A Recommended Vue.js Video Tutorial Series

A number of people have asked me how to get started with Vue.js and my reply before today was to Google "Vue.js". That has changed and my recommendation to anyone who wants to learn the fastest growing, easiest to learn and use Vue.js web dev framework is to watch this video tutorial series: ... (0 Replies)
Discussion started by: Neo
0 Replies

6. Web Development

Vue.js component: Beautiful code highlighter

Sooner than later I will render forum discussions in Vue.js to complement the standard way of showing forum threads. Today, I ran across this component, vue-code-highlight Beautiful code syntax highlighting as Vue.js component. https://www.unix.com/members/1-albums225-picture1199.jpg ... (1 Reply)
Discussion started by: Neo
1 Replies
DMXAddInput(3)						     Library Functions Manual						    DMXAddInput(3)

NAME
DMXAddInput, DMXAddBackendInput, DMXAddConsoleInput - attach a new input SYNOPSIS
#include <X11/extensions/dmxext.h> Bool DMXAddInput(Display *dpy, unsigned int mask, DMXInputAttributes *attr, int *id); Bool DMXAddBackendInput(Display *dpy, int screen, int sendsCore, int *newId); Bool DMXAddConsoleInput(Display *dpy, const char *name, int sendsCore, int *newId); DESCRIPTION
DMXAddInput() is used to attach a new input (or a previously detached input) to the Xdmx(1) server. mask specifies the fields in attr that are active, and id returns the device if of the first device in the series that is added. The value of mask is computed from the following values: DMXInputType DMXInputPhysicalScreen DMXInputSendsCore The DMXInputAttributes structure is: typedef struct { DMXInputEnum inputType; int physicalScreen; int physicalId; Bool isCore; Bool sendsCore; const char *name; Bool detached; } DMXInputAttributes; inputType may have the value DMXConsoleInputType or DMXBackendInputType . For console devices, name will specify the display to be used. For back-end devices, physicalScreen will specify the Xdmx(1) screen number. If sendsCore is True, the new device will be added as a true core device. If a device was removed with DMXRemoveInput(3) an attempt will be made to reconnect the previous devices (sendsCore is ignored in this case). DMXAddBackendInput() is a helper function that is used to add input from a back-end server. With this function, screen refers to the back- end screen, sendsCore is True if the new input should send core events (and it ignored if the input has been detached), and newId will hold the device id of the first device in the series added. DMXAddConsoleInput() is a helper function that is used to add input from a console. With this function, name is the name of the console display, sendsCore is True if the new input should send core events (and it ignored if the input has been detached), and newId will hold the device id of the first device in the series added. RETURN VALUE
DMXAddInput() returns True on success and False otherwise. DMXAddInput() can generate BadValue (if inputType is invalid or physicalScreen is out of range), BadAccess (if the input has already been attached or if the backend screen is currently detached). NOTES
Local devices cannot be attached or detached. Attributes that are not specified will default to 0. This may lead to unintended results. SEE ALSO
DMXRemoveInput(3), DMX(3), Xdmx(1) X Version 11 libdmx 1.1.2 DMXAddInput(3)
All times are GMT -4. The time now is 07:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy