411
Mamba
Re: Thanks, XOOPS!
  • 2022/8/23 5:51

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Hi Deka87,

That was very nice of you to say that!!!

And it's great to hear that XOOPS and the XOOPS community made a positive contribution to your career choices, with which you're very satisfied!

Of course, if you find some extra time, even if it is only one hour per week, please feel free to contribute back to XOOPS! And maybe even recruit some of your co-workers to help us in moving XOOPS forward? We can always use some help here from professional developers!

Resized Image
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



412
deka87
Thanks, XOOPS!
  • 2022/8/22 22:14

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Hey guys! So good to be home. I joined this website long time ago to understand the basics of web developement. I was a student looking for a way to create websites. Just wanted to say that XOOPS and its community helped me a ton to understand who I want to be and how to achive that. I've been working as a front-end developer since then and I could not be happier about my choice. Thanks so much for this wonderful product.



413
Mamba
Updated API for XOOPS 2.5.11 Beta 2
  • 2022/8/13 14:53

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


As you know, the XOOPS Development Team has released XOOPS 2.5.11 Beta 2

The updated API you can find at: https://api.xoops.org/api2.5.11/apigen/tree.html
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



414
alain01
Re: XOOPS 2.5..11 beta 2 and the "install" directory
  • 2022/8/11 9:48

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


Ok, I reinstalled with right permission on the install directory.

I saw the message:
uou can remove install_remove_xxxxxxxxx

but in my root, i see "install" directory



415
Mamba
Re: XOOPS 2.5..11 beta 2 and the "install" directory
  • 2022/8/10 17:53

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


That's very strange - it never happened to me!

Maybe you didn't have the right permissions to the folder, so XOOPS couldn't rename it?
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



416
alain01
XOOPS 2.5..11 beta 2 and the "install" directory
  • 2022/8/10 12:58

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


Hello,
I've just tester XOOPS 2.5.11 beta 2 (local installation on wampp)

XOOPS Version XOOPS 2.5.11-Beta2
PHP Version 8.1.8
MySQL Version 8.0.29

and I want to understand this line:

Remove the folder install_remove_xxxxxxxxxxxxxxx (or install if it was not renamed automatically by the installer) from your server.

My wampp didn't rename this directory, so, it's "install".
Do you know why no rename ?



417
Cesagonchu
Re: Implement modal calculator

Thanks for sharing



418
Mamba
Re: Implement modal calculator
  • 2022/7/12 3:46

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Very cool!!!

Thank you for sharing!!!!
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



419
goffy
Implement modal calculator
  • 2022/7/11 15:33

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


Hi to all

in my modul wgsimpleacc I had the request to implement a simple calculator (if e.g. someone wants to sum up various small bills).
my goal was to implement a modal version.
I played around a little bit and I found (IMO) a good solution for this feature, which I want to share with you, maybe you can also use it.

first of all I need the modal form:
<div class="modal fade" id="calcModal" tabindex="-1" role="dialog" aria-labelledby="calcModalLabel" aria-hidden="true">
    <
div class="modal-dialog" role="document">
        <
div class="modal-content">
            <
div class="modal-header">
                <
h4 class="modal-title" id="calcModalLabel"><{$smarty.const._MA_WGSIMPLEACC_CALC}>h4>
                <
button type="button" class="close" data-dismiss="modal" aria-label="<{$smarty.const._CLOSE}>">
                    <
span class="btn btn-danger" aria-hidden="true">&times;span>
                button>
            div>
            <
div id="modal-body" class="modal-body">
                <
div class="calculator">
                    <
input id="calc-screen" type="text" class="calculator-screen" value="" disabled />
                    <
div class="calculator-keys">
                        <
button type="button" class="btn btn-warning operator" value="+">+button>
                        <
button type="button" class="btn btn-warning operator" value="-">-button>
                        <
button type="button" class="btn btn-warning operator" value="*">&times;button>
                        <
button type="button" class="btn btn-warning operator" value="/">&divide;button>
                        <
button type="button" class="btn btn-primary digit" value="7">7button>
                        <
button type="button" class="btn btn-primary digit" value="8">8button>
                        <
button type="button" class="btn btn-primary digit" value="9">9button>
                        <
button type="button" class="btn btn-primary digit" value="4">4button>
                        <
button type="button" class="btn btn-primary digit" value="5">5button>
                        <
button type="button" class="btn btn-primary digit" value="6">6button>
                        <
button type="button" class="btn btn-primary digit" value="1">1button>
                        <
button type="button" class="btn btn-primary digit" value="2">2button>
                        <
button type="button" class="btn btn-primary digit" value="3">3button>
                        <
button type="button" class="btn btn-primary digit" value="0">0button>
                        <
button type="button" class="btn btn-primary decimal" value="."><{$sepComma}>button>
                        <
button type="button" class="btn btn-danger all-clear" value="all-clear">ACbutton>
                        <
button type="button" class="btn btn-warning equal-sign operator" value="=">=button>
                    div>
                div>
            div>
            <
div class="modal-footer">
                <
button id="btnApplyResult" type="button" class="btn btn-secondary btn-success" data-dismiss="modal"><{$smarty.const._MA_WGSIMPLEACC_CALC_APPLY}>button>
            div>
        div>
    div>
div>


additional to bootstrap I have added some style:
.calculator {
        
border1px solid #ccc;
        
border-radius5px;
        
width100%;
    }
    .
calculator-screen {
        
width100%;
        
font-size5rem;
        
height80px;
        
bordernone;
        
background-color#252525;
        
color#fff;
        
text-alignright;
        
padding-right20px;
        
padding-left10px;
    }
    
button {
        
height60px;
        
font-size24px !important;
    }
    .
equal-sign {
        
height100%;
        
grid-area5;
    }
    .
equal-sign:hover {
        
background-color#4e9ed4;
    
}
    .
calculator-keys {
        
displaygrid;
        
grid-template-columnsrepeat(41fr);
        
grid-gap20px;
        
padding20px;
    }


for calculation itself I have implemented following code, which can handle click and keydown events:
const calculator = {
        
displayValue'0',
        
firstOperandnull,
        
waitingForSecondOperandfalse,
        
operatornull,
    };

    
//Manage Operators
    
const performCalculation = {
        
'+': (firstOperandsecondOperand) => firstOperand secondOperand,
        
'-': (firstOperandsecondOperand) => firstOperand secondOperand,
        
'*': (firstOperandsecondOperand) => firstOperand secondOperand,
        
'/': (firstOperandsecondOperand) => firstOperand secondOperand,
        
'=': (firstOperandsecondOperand) => secondOperand
    
};

    function 
inputDigit(digit) {
        const {
            
displayValue,
            
waitingForSecondOperand
        
} = calculator;

        if (
waitingForSecondOperand === true) {
            
calculator.displayValue digit;
            
calculator.waitingForSecondOperand false;
        } else {
            
calculator.displayValue displayValue === '0' digit displayValue digit;
        }

        
console.log(calculator);
    }

    function 
inputDecimal(dot) {
        
// If the `displayValue` does not contain a decimal point
        
if (!calculator.displayValue.includes(dot)) {
            
// Append the decimal point
            
calculator.displayValue += dot;
        }
    }

    function 
handleOperator(nextOperator) {
        const {
            
firstOperand,
            
displayValue,
            
operator
        
} = calculator
        
const inputValue parseFloat(displayValue);

        if (
operator && calculator.waitingForSecondOperand) {
            
calculator.operator nextOperator;
            
console.log(calculator);
            return;
        }

        if (
firstOperand == null) {
            
calculator.firstOperand inputValue;
        } else if (
operator) {
            const 
currentValue firstOperand || 0;
            const 
result performCalculation[operator](currentValueinputValue);

            
calculator.displayValue String(result.toFixed(2));
            
calculator.firstOperand result;
        }

        
calculator.waitingForSecondOperand true;
        
calculator.operator nextOperator;
        
console.log(calculator);
    }

    function 
updateDisplay() {
        const 
display document.querySelector('.calculator-screen');
        
display.value calculator.displayValue;
    }
    function 
resetCalculator() {
        
calculator.displayValue '0';
        
calculator.firstOperand null;
        
calculator.secondOperand null;
        
calculator.currentValue 0;
        
calculator.waitingForSecondOperand false;
    }

    
updateDisplay();

    
//code for button clicks
    
const keys document.querySelector('.calculator-keys');
    
keys.addEventListener('click', (event) => {
        const {
            
target
        
} = event;
        if (!
target.matches('button')) {
            return;
        }
        if (
target.classList.contains('operator')) {
            
handleOperator(target.value);
            
updateDisplay();
            return;
        }
        if (
target.classList.contains('decimal')) {
            
inputDecimal(target.value);
            
updateDisplay();
            return;
        }
        if (
target.classList.contains('all-clear')) {
            
resetCalculator();
            
updateDisplay();
            return;
        }
        
inputDigit(target.value);
        
updateDisplay();
    });

    
//code for keydown events
    
document.getElementById("calcModal").addEventListener('keydown', function(event) {
        var 
key event.key.toString();

        if (
key == '<{$sepComma}>') {
            
inputDecimal('.');
            
updateDisplay();
            return;
        }
        if (
key == '+' || key == '-' || key == '/' || key == '*') {
            
handleOperator(event.key);
            
updateDisplay();
            return;
        }
        if (
key == 'Enter') {
            
handleOperator('=');
            
updateDisplay();
            return;
        }
        if (
key == 'Delete') {
            
resetCalculator();
            
updateDisplay();
            return;
        }
        if (
key == '0' || key == '1' || key == '2' || key == '3' || key == '4' || key == '5' || key == '6' || key == '7' || key == '8' || key == '9') {
            
//alculator.waitingForSecondOperand = false;
            
inputDigit(event.key);
            
updateDisplay();
            return;
        }
        if (
key == '<{$sepThousand}>') {
            
//ignore thousands
            
return;
        }
        
//alert($key);
    
}, true);

    
//code for applying result to field of calling form
    
$(function () {
        $(
"#btnApplyResult").click(function () {
            const 
display document.querySelector('.calculator-screen');
            
$result display.value;
            
$result $result.replace(".""<{$sepComma}>");
            
document.getElementById("tra_amount").value $result;
        });
    });


finally in my form I added a button to call the modal form:
$traAmountTray = new XoopsFormElementTray(_MA_WGSIMPLEACC_TRANSACTION_AMOUNT' ');
        
$traAmountTray->addElement(new XoopsFormText('''tra_amount'20150$traAmount));
        
$button = new XoopsFormButton('''calcAmount'_MA_WGSIMPLEACC_CALCULATOR);
        
$button->setExtra('onclick="$('#calcModal').modal();"');
        
$traAmountTray->addElement($button);
        
$form->addElement($traAmountTray);



have fun



420
Mamba
Re: Login Block does not work
  • 2022/7/7 6:15

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


It works with Publisher, e.g. here, but it doesn't work with Forums, e.g. here
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs




TopTop
« 1 ... 39 40 41 (42) 43 44 45 ... 29425 »



Login

Who's Online

297 user(s) are online (89 user(s) are browsing Support Forums)


Members: 0


Guests: 297


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits