Sponsored Content
The Lounge What is on Your Mind? New Icons Coming from Font Awesome Post 303020796 by Neo on Friday 27th of July 2018 04:44:09 PM
Old 07-27-2018
New Icons Coming from Font Awesome

Finally making some progress on getting rid of the 10 year old buttons with modern day fonts and icons thanks to a responsive web design tutorial by Brad Traversy who's video pointed me to Font Awesome.

The buttons and icons were pretty easy to implement but it too me a number of hours (embarrassingly enough) to rewrite the 10 year old Javascript vBulletin code so "multiquote selection" worked. But it works now! LOL



Image

Original JS code by vBulletin, maybe 10 years old:


Code:
https://www.unix.com/clientscript/vbulletin_multi_quote.js?v=387

New hacked code which could be better, but nevermind, it works fine I think:

Code:
function mq_init(D) {
    var C = fetch_cookie("vbulletin_multiquote");

    if (C != null && C != "") { C = C.split(",") }
    else { C = new Array() } var E; var A = fetch_tags(D, "i");
    for (var B = 0; B < A.length; B++) {
        if (A[B].id && A[B].id.substr(0, 3) == "mq_") {
            E = A[B].id.substr(3); A[B].onclick = function (F) { return mq_click(this.id.substr(3)) };
            change_mq_image(E, (PHP.in_array(E, C) > -1 ? true : false))
        }
    }
}
function mq_click(F) {
    var D = fetch_cookie("vbulletin_multiquote");
    var B = new Array(); var E = false; if (D != null && D != "") {
        D = D.split(","); for (C in D) {
            if (!YAHOO.lang.hasOwnProperty(D, C)) { continue } if (D[C] == F) { E = true }
            else { if (D[C]) { B.push(D[C]) } }
       }
    } change_mq_image(F, (E ? false : true));
    if (!E) {
        B.push(F);
        if (typeof mqlimit != "undefined" && mqlimit > 0) {
            for (var C = 0; C < (B.length - mqlimit); C++) {
                var A = B.shift();
                change_mq_image(A, false)
            }
        }
    } set_cookie("vbulletin_multiquote", B.join(",")); return false
}
function change_mq_image(C, B) {
    var A = "mq_"+C;
    
         if (B == true) {
            if($("#"+A).hasClass("far"))
            {
              $("#"+A).removeClass("far");
              $("#"+A).addClass("fas");
        }
            }
        else {
            if($("#"+A).hasClass("fas"))
            {
              $("#"+A).removeClass("fas");
              $("#"+A).addClass("far");
            }
        }
  }
//mq_init(fetch_object("posts"));

I will implement this for everyone when I am not so tired for getting this to work.

Yeah! Finally we are moving off those terrible legacy vB buttons!!!!
These 2 Users Gave Thanks to Neo For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

redhat 7.2 icons on desktop

Hello all, Is there a way to change the behavior of the gnome desktop manager so that when your iconify a window it will be place on the desktop intead on on the task manager (gnome-panel)? It gets confusing having to loook throught the gnome-panle for the window I want when you have alot of... (1 Reply)
Discussion started by: larry
1 Replies

2. Post Here to Contact Site Administrators and Moderators

Dotted thread icons

Can you guys please enable the "dotted" icon option, so that the thread icon for a thread in which a user has posted in will appear with a dot in it? Thanks, Aaron (2 Replies)
Discussion started by: Spetnik
2 Replies

3. Solaris

How to get a second Icons - Window!

Hey everybody! I'd like to get a second Window for my program Icons, any Idea how to solve this problem?? :confused: thanks, Tom (3 Replies)
Discussion started by: TomStyria
3 Replies

4. Red Hat

Menu Icons for the Application

Hi All, I created an RPM for my application. After clicking the rpm, I managed to place the files in repective locations also I have "JServer" menus in the "Application" menu (The redhat one). But the problem is the icons are not appearing in that menu. I placed my icons/images in... (0 Replies)
Discussion started by: jw_amp
0 Replies

5. AIX

CDE: why no icons?

Why my cde show no icons? I have installed X11.Dt.ToolTalk 7.1.3.15 C F AIX CDE ToolTalk Support X11.Dt.adt 7.1.3.0 C F AIX CDE Application X11.Dt.bitmaps 7.1.0.0 C F AIX CDE Bitmaps X11.Dt.compat ... (8 Replies)
Discussion started by: Linusolaradm1
8 Replies

6. What is on Your Mind?

New Mobile Navbar Icons from Font Awesome

Just changed the mobile site to use Font Awesome icons. Here is the new top navbar view (unregistered users) https://www.unix.com/members/1-albums214-picture903.jpeg (2 Replies)
Discussion started by: Neo
2 Replies

7. Web Development

New Font Awesome Icons in Quick Reply Editor

Working on the Quick Reply Editor, I have replaced a number of icons (see image below) with Font Awesome Icons. Was planning to replace all of them, but for some reason, replacing a few of them causes the script / template to break (which is odd) so I left them for now. ... (6 Replies)
Discussion started by: Neo
6 Replies

8. What is on Your Mind?

Quick Update on UNIX.COM Site Renovation: Bootstrap, Font Awesome and jQuery

Here is an update on the site renovation: After a lot of analysis and example programming, including testing out a number of Javascript framework and libraries, in the short term, we are getting the most bang-for-the-buck from these three basic, core tech areas: Bootstrap (CSS and... (2 Replies)
Discussion started by: Neo
2 Replies
All times are GMT -4. The time now is 03:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy