Extension talk:Semantic Forms Inputs

Jump to: navigation, search

About this board

By clicking "Add topic", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL
Kghbln (talkcontribs)

The Menuselect input type is depending on the Semantic TreeView extension. Are there plans to further support this input type or will it be phased out? I guess a note about this should be on this extension's page. Cheers

F.trott (talkcontribs)

Semantic TreeView is IMHO not maintainable. Instead I improved the tree format of Extension:SemanticResultFormats. Guess I should also update the menuselect documentation,

M art in (talkcontribs)

I have got an other question abou menuselect: is it possible to select a value the type comma and selcet a second value? Becau in my case the first value is always been overwritten! Thanks for help.

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)

Sorry, it is not possible to create a comma separated list with menuselect.

M art in (talkcontribs)

Thank you for the fast answer! What do you recommend instead? More multiselcet fields in a row mapping the same Property? Or maybe change the JavaScript of multiselect? If yes: where?

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)

You could try some other input type, e.g. the twolistboxes input type available in the development version of the extension. You could of course also have several inputs or use a multiple template form. If you want to patch menuselect, have a look at the libs/menuselect.js file.

M art in (talkcontribs)

If I put more multiselctfields in a row for the same property the last textfield overwrites the others. So I will try to change the libs/menuselect.js file.

This post was posted by M art in, but signed as Zym.

M art in (talkcontribs)

Ok, First sucess. Line 219-227 was: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" );

// set visible value and leave input inputShow .attr( "value", content.text() ) .blur(); I changed to: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" ); if(inputShow.val()) {var mycontent=inputShow.val()+','+content.text();} else {var mycontent=content.text();}

// set visible value and leave input inputShow .attr( "value", mycontent) .blur();

But after clicking "Save" the last value is taken! What do I do wrong? what's missing?

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)

There is a difference between the displayed value and the value sent back to the server. With your change you only change the displayed value. Try finding a line like jQuery( "#" + inputID ).attr( "value", content.text() ); and work on that.

M art in (talkcontribs)

Thank you for your help!

I made some changes from line 219-246. Origin was: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" );

// set visible value and leave input inputShow .attr( "value", content.text() ) .blur();

// set hidden value that gets sent back to the server var link = content.children( "a" );

// if content is link if ( link.length == 1 ) {

// use title set by MW jQuery( "#" + inputID ).attr( "value", link.data( "title" ) );

} else {

// just use text of list item jQuery( "#" + inputID ).attr( "value", content.text() );

} return false;

} );

Now my code: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" ); if(inputShow.val()) {var mycontent=inputShow.val()+','+content.text();} else {var mycontent=content.text(); }

// set visible value and leave input inputShow .attr( "value", mycontent) .blur();

// set hidden value that gets sent back to the server var link = content.children( "a" );

// if content is link if ( link.length == 1 ) {

// use title set by MW jQuery( "#" + inputID ).attr( "value", link.data( "title" ) );

} else {

// just use text of list item jQuery( "#" + inputID ).attr( "value", inputShow.val() );

} return false;

} );

It works ;-)

This post was posted by M art in, but signed as Zym.

M art in (talkcontribs)

Just an other idea: Could it possible to define the behavier in the form with something like:

field|foo|input type=menuselect |structure=... |behavier=add/overwrite

But I'm not so much into php to change this.

This post was posted by M art in, but signed as Zym.

Reply to "Menuselect"
Ozstang65 (talkcontribs)

Hi, I've just installed Inputs and I'm having a problem with the datepicker. The year selection seems to be fixed in a 10 year period either side of the default (or last selected) year. Scrolling thru to years not appearing in the list is not possible. MW 1.18, SF 2.3.1, SFI 0.5, SMW 1.6.1.

Fault is not dependednt on the "first date =" variable

I've tried IE on XP an Firefox on Mac OSX, same result.

Is it a bug or a problem with my settings somewhere?

Cheers - Scott

F.trott (talkcontribs)

You are right. What would be the expected behaviour, though?

Ozstang65 (talkcontribs)

Sorry for the delayed reply, been rather busy of late...

I would expect it to keep scrolling back/forward through the years until you stopped pressing the up or down arrow. One of the forms I am using it in is to input a vehicle's year of manufacture. When someone begins to fill out the form and selects the year then they can only scroll back as far as 2001. This may confuse some into thinking that they cannot enter a date prior to that.

F.trott (talkcontribs)

I would like it to work a bit differently than you proposed (e.g. like this, preferably with a click-and-hold feature for fast forward/backward), but I agree, that something like that would be a really nice feature. The problem is, it would require a change to the jQuery datepicker code, which is out of the scope of this extension. I will note it as a feature request, but better don't hold your breath on it.

If you are really intent on having this, you would have to drive it. I.e get someone at jqueryui.com to implement your feature and then kick me again to use it.

(What I probably could do is give you some option where you could set the years shown in the dropdown.)

Ozstang65 (talkcontribs)

Either way would work. I'd be surprised if it's hard to fix the existing control though. When you click on the year control, if you select the earliest year in the list the control disappears and shows the year selected. The next time you click on the control the year previously selected is centred in the list and you can go back another ten years. The control can eventually be 'hacked' to get back to the year that you want, you just can't get there via the scroll buttons.

FrancoIacomella~mediawikiwiki (talkcontribs)

Hi! To change the range of years you can add the following change in the datepicker.js file. Look for this piece of code:

inputShow.datepicker( {
                        'showOn': 'both',
                        'buttonImage': params.buttonImage,
                        'buttonImageOnly': false,
                        'changeMonth': true,
                        'changeYear': true,
                        'altFormat': 'yy/mm/dd',
                        // Today button does not work (http://dev.jqueryui.com/ticket/4045)
                        // do not show button panel for now
                        // TODO: show date picker button panel when bug is fixed
                        'showButtonPanel': false,
                        'firstDay': params.firstDay,
                        'showWeek': params.showWeek,
                        'dateFormat': params.dateFormat,
                        'beforeShowDay': function ( date ) {return SFI_DP_checkDate( '#' + input_id + '_show', date );}
                } );

Then add the following line inside that block:

'yearRange': 'c-200:c+10',

That will change the range of years (200 in the past from today's year and 10 years in the future). More info can be found in DatePicker documentation.

This post was posted by FrancoIacomella~mediawikiwiki, but signed as FrancoIacomella.

Reply to "No year scrolling"

Styling for datepicker fields is only applied to mandatory fields in SF 3.2

3
Lbillett (talkcontribs)

I noticed that with SF 3.2, the fancy new css applied to input fields is not applied to fields with input type=datepicker (or datetimepicker) unless the field is also set as mandatory. Functionally things are fine. Afraid that's the extent of my ability to help.

Kghbln (talkcontribs)

I can confirm this but never got around reporting it. I added the following including some other modification to "MediaWiki:Common.css" to enforce the same appearance for datepickers:

/* Semantic Forms Inputs */
.hasDatepicker {
    width: 95px;
    border: 1px solid #bbb;
    border-radius: 3px;
    display: inline-block;
    margin-left: 0;
    max-width: 100%;
    padding: 4px 8px;
}
Reply to "Styling for datepicker fields is only applied to mandatory fields in SF 3.2"

Ubuntu SWM Semantic Form date picker error: jquery.ui.position: Error Module jquery.ui.position has failed dependencies

2
Fustbariclation (talkcontribs)

I'm having a problem with date picker in a Semantic Form. I'm getting this error message:

jquery.ui.position: Error Module jquery.ui.position has failed dependencies

I've tried to find a solution, but, so far, no luck. Any suggestions?

Ubuntu: 3.16.0-31-generic #43-Ubuntu SMP Tue Mar 10 17:37:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

MediaWiki Versions look OK - all current.

F.trott (talkcontribs)

No idea. Maybe you could try to set debug=true in the URL and then find the actual trigger of the error using Firebug or the like.

Reply to "Ubuntu SWM Semantic Form date picker error: jquery.ui.position: Error Module jquery.ui.position has failed dependencies"

Datepicker error: Undefined offset: -1 in [...]/extensions/SemanticFormsInputs/includes/SFI_DatePicker.php on line 287

1
Zabien (talkcontribs)

Hello,

I get this datepicker error on two wikis, running on 1.23.1 /SFI 0.9.0 alpha and 1.23.6 / SFI 0.7.

  • Undefined offset: 0 in [...]/extensions/SemanticFormsInputs/includes/SFI_DatePicker.php on line 283
  • Undefined offset: -1 in [...]/extensions/SemanticFormsInputs/includes/SFI_DatePicker.php on line 287

The corresponding lines in the PHP file are about the minDate and maxDate.

281 // correct min/max date to the first/last allowed value
282 				if ( !$minDate || $minDate < $enabledDates[0][0] ) {
283 					$minDate = $enabledDates[0][0];
284 				}
285 
286 				if ( !$maxDate || $maxDate > $enabledDates[count( $enabledDates ) - 1][1] ) {
287 					$maxDate = $enabledDates[count( $enabledDates ) - 1][1];

I can acces, fill in and save the form, but would quite like to get rid of the error message. I have taken out the "data format" part, but with no effect. Any ideas what I could do to fix this error?

Reply to "Datepicker error: Undefined offset: -1 in [...]/extensions/SemanticFormsInputs/includes/SFI_DatePicker.php on line 287"
Kghbln (talkcontribs)

The last version was officially released in May 2013. In the meantime amongst others the big I18n change catering for new versions of MW has occurred. I guess this will make upgrading easier for people.

Reply to "What about doing a 0.8.0 release?"

Will this extension be made available though Composer ?

2
Heinrich krebs (talkcontribs)

That's pretty much the question: Will this extension be made available though Composer ?

F.trott (talkcontribs)

Not in the short term, I am afraid. Unless somebody provides a patch.

Reply to "Will this extension be made available though Composer ?"
AdSvS (talkcontribs)

Hi, in the datepicker.js code the showButtonPanel is 'false' because there seemed to be a bug with the button panel. When I change the showButtonPanel to 'true' however it seems to work fine.

Is it safe to make it 'true' and if it is, could there be a type specific parameter for this?

F.trott (talkcontribs)

If it works, set it to true.

(Before implementing new params the whole thing could use a makeover of the code, including an update of the widget.)

Reply to "Today button"
Clifford.kasper (talkcontribs)

Setup

MediaWiki 1.21.2
PHP 5.3.17
MySQL 5.5.33
Lua 5.1.5
Semantic Forms Version 2.7
Semantic Forms Inputs Version 0.7

I have tried SFI 0.9alpha with the same results.


Issue
I keep getting the following error:
Ext.semanticforms.main: TypeError: Cannot read property ‘initFunctions’ of undefined

I have tried different browsers and different accounts, updated extension file permissions, etc with no luck. When I use F12 in Chrome is makes a reference to the Vector skin but I'm not sure what to make of it. Can anybody help me?

Thanks.

F.trott (talkcontribs)

Sorry, I totally missed this. If it is still of interest, my best guess is that some JavaScript error (possibly from another extension) prevents the main SF module to load. Check the browser console JavaScript errors (Ctrl+Shift+J on FireFox).

Reply to "SFI not working -- Giving error"

menuselect and datepick acts innormal, seems something wrong with the JS

3
121.33.247.50 (talkcontribs)

MediaWiki 1.22alpha (8b6be1c) 1.22wmf21 Semantic Forms (版本2.6) Semantic Forms Inputs (版本0.7)

i have testest the simplest Form, containing only a single {{{field}}}, and copied the example menuselect codes.

after i have saved, i can see the top lev contents with the triangle icons, but the lev2 triangle icons shows up too without text content. When i move mouse on it, nothing pop out.


Another problem with datepicker: the set of icons used to select date occurs twice in the same line, and both function normally.

both 2 problems could turn normal after i do a search,(i am using this form as a query form, so i can search on the same page)

121.33.247.50 04:23, 14 November 2014 (UTC)

Extirpate (talkcontribs)

finally, i found that this is the problem of menuselect and queryformlink

when i use menuselect in a normal form invoked by {{#formlink}} , everything is ok.

but when i use menuselect in a form invoked by {{#queryformlink}}, then this bug occurs.

is there anyone can help? thx!

F.trott (talkcontribs)

This should be fixed in the latest SF development version. Please give it a try.

Reply to "menuselect and datepick acts innormal, seems something wrong with the JS"