javascript

  1. Britney

    XF 2.1 Adding javascript to header CSS

    So I'm trying to add javascript to my header, but it does not seem to work. Is there a specific file that you need to place the javascript in or how does it work? I've tried searching, but the only answer I came up with was that it is suppose to work in PAGE_CONTAINER, but that is not the case...
  2. Jean-Baptiste

    XF 2.1 Problems extending JS class

    Hello, I would like to extend the member tooltip JS XF.MemberTooltip, but I can't get it working. Here is my code : !function($, window, document, _undefined) { "use strict"; XF.MemberTooltipGM = XF.extend(XF.MemberTooltip, { __backup: { 'init': '_init'...
  3. CMTV

    XF 2.1 Can't get preview element

    Hi! In general, I need to analyze the DOM every time it is changed and maybe add some classes to inserted elements. In particular, I am trying to get a preview element which appears after clicking on "Preview" button. After researching the code for some time I figured out that I need to listen...
  4. CMTV

    XF 2.1 Disabling all form elements

    Hi! I want to disable all inputs, selects, textareas in certain div inside form tag. It is important to note, that I am using <xf:numberboxrow and similar code to create form fields. How can I do this? Is the following code correct? this.$options.find(':input').prop('disabled', true);
  5. CMTV

    'sorter.js' Improvements

    Hi! Sometimes you need to explicitly set a container for dragula. So, instead of this in sort.js: init: function () { this.dragula = dragula([this.$target[0]], { moves: XF.proxy(this, 'isMoveable'), accepts: XF.proxy(this, 'isValidTarget') }); }, I propse this: init...
  6. CMTV

    XF 2.1 Catch ajax form submit from JS

    Hi! I have a modal with simple form in it: <xf:if is="$isNew"> <xf:title>{{ phrase('CMTV_CB_add_param') }}</xf:title> <xf:else /> <xf:title>{{ phrase('CMTV_CB_edit_param') }}</xf:title> </xf:if> <xf:form action="{{ link('criteria-builder/params/validateParam') }}" class="block"...
  7. Alfa1

    XF 1.5 How to make a JS widget display in XF1?

    I would like to make this JavaScript widget display at the top of specific xenforo forums: <div class="ja-gadget-virtual-assistant-inline cleanslate"> <link rel="stylesheet" href="https://components.justanswer.com/css/ja-gadget-virtual-assistant-inline" /> <script type="text/javascript"...
  8. CMTV

    Fixed FieldAdder works wrong inside <xf:dependent>

    Hi! Try to add the code below somewhere in ACP: <xf:checkboxrow> <xf:option> <xf:dependent> <ul class="listPlain inputGroup-container"> <li class="inputGroup" data-xf-init="field-adder"> <xf:textbox /> </li>...
  9. WoodiE

    Subresource Integrity (SRI) support

    Xenforo gives us the option to load jQuery from outside sources (such as Google, Microsoft, and jQuery CDN's) via the AdminCP. It would be great, that instead of just linking directly to the .js file as it currently does, that Xenforo also added the Subresource Integrity (SRI) hash as well. I...
  10. Frode789

    XF 2.0 Defer parsing of JavaScript in XF2

    So I've read Chris saying that this is working as intended in XF2. Yet gtmetrix still gives me an F grade on this point, as several XF js files are parsed during initial page load.
  11. SyTry

    XF 2.0 Question about a script for xenforo 2

    Hello, I have a script made for XenForo 1.5 and I want to convert it to XenForo 2.0. There are 3 lines blocking me : $('iframe.redactor_textCtrl').contents().find('body').html(txt); $('iframe.redactor_textCtrl').contents().find('body').select()...
  12. hutch2323

    XF 2.0 Passing values from a textbox to .php function

    Hello again! I'm attempting to build a custom query page whereby a user (for admin use only) can enter a username into a textbox, click a search button, and retrieve the stored information connected to the username. Currently, I have blocks of code, but I'm not entirely sure how to combine it...
  13. CMTV

    XF 2.0 Accessing JS handler functions from outside

    Hi! Let's say I have two element handlers: A and B: XF.A = XF.Element.newHandler({ init: function() {}, test: function() { return 'hey!'; } }); XF.B = XF.Element.newHandler({ init: function() { // How to call "test()" function from A handler...
  14. kylerc

    Fixed JS Stripe Style Data not Being Processed

    Hello, We found an issue with payment modals for user upgrades using Stripe in UI.X. It would appear that the style data is not being correctly processed to initialize a Stripe paid user upgrade. Specifically the JSON.parse on payment.js line 510 is able to receiving the following from UI.X...
  15. CMTV

    XF 2.0 Including external library (js and css)

    How to include external library (js and css files) in specific template that requires jQuery? I tried this code in template forum_view: <xf:head option="questionthreads_iconpicker"> <!-- Iconpicker styles --> <link rel="stylesheet" href="{{...
  16. Lukas W.

    XF 2.0 Javascript & Addons

    Any intended structure and place for the javascript files that developers deploy alongside their addons? Do I put them to the non-existand folder js/addon? Do I have to manually add them to my addon deployment or is there any automatization? Or am I expected to put them into a template? I...
  17. T

    xenforo expert needed for customisation and mods

    We are looking for xenForo Developer to add 5-6 new mods to our forums. Here is what I need to be done for reference: - Custom New Thread Options - Reputaion System - Points System - Vote up & Vote Down for particular thread - Member Ranking System Also I want front page for my...
  18. sdrothrock

    XF 1.5 Text boxes sometimes do not appear

    This is another intermittent problem that's stumping me -- sometimes text boxes do not appear. I chalked it up to a delayed response/timeout and thought perhaps rendering templates from files would help, but it didn't. Using cloudflare and nginx, if that's relevant. Theme is Black Responsive...
  19. R

    Extend AutoValidator/Ignore errors

    I want to automatically trigger a button/submit a form, which is using the XenForo AutoValidator. However, I want to "catch" the error, so it does not show the error overlay it usually does if an error happens. The aim is to hide the button, so that the "form confirmation" happens automatically...
  20. Iomega0318

    Unmaintained PGN Chessboard 1.0

    Not really a request but noticed this thread here: https://xenforo.com/community/threads/chessboard-for-xenforo-available-or-not.117371/ So I decided to take it upon myself to do a simple, very simple example of what the OP was looking for, this can of course be taken much further and at some...
Top