Webshim calendar configuration - webshim

1.Is it possible to make the "clear" button on the datepicker to be available after I picked a date in both my inputs. After I done it, its impossible to clear the date.
<input name="fromDate" id="fromDate" type="date" min="" max="" />
<input name="untilDate" id="untilDate" type="date" min="" max="" data-dependent-validation='{"from": "fromDate", "prop": "required"}' />
If I picked one I dont want it be possible to post without the other one. That's why im using 'data-dependent-validation'.
(I notice their wasn't any language suport on the "clear" button. At least not into swedish).
2.Is their any suport to open up a specific month? Got a own made calendar and want the picker to open up in the month that I choosen. And not todays date as default.
3.Will you include a date spinner as an option for the date picker? (good for mobiles).
OT: I notice on my iphone 4s that the "requierd" attribute was ignored on all off my inputs. Is that anything you noticed? Works as it should on my PC and windows 8 phone.

a) Make clear available:
I think you shouldn't set it to required. Instead you could write something like this:
$('#fromDate').on('change', function(){
if(!$.prop(this, 'value'){
$('#untilDate').prop('value', '');
}
});
Does this help?
b) clear locale
Yeah, I know. I was very lazy here. It would be extreme nice, if you could compare english and swedish locale for me and do a PR with improved and more usable errormessages/locale settings
Yes. There is the "startValue" option. See in action (afarkas.github.io/webshim/demos/demos/cfgs/input-date.html#startValue=2012-12-12&startView=2):
input type="date" data-date='{"startValue": "2010-12-12"}' /
a) Currently not. My mobile strategy is to leave input widgets native on mobile and only set replaceUI on desktop.
b) required not working on iOS. Which iOS version are you using? I'm not aware, but if it's iOS 5.1.1+, I will look into it.

Related

CFCLIENT: Doc examples do not work; Can't get anything to work?

So I realize that the new CF11 mobile features have been received with some very mixed reviews, but I wanted to try them out to see if I could use them for some really simple device detection, however I cannot get anything to actually work.
For example, I am looking at the doc for cfclientsettings, specifically at the first example on the page under the "Device detection" heading. Here's the code for reference (I formatted it a little to ensure it's easy to read here):
<cfClientSettings detectDevice=true />
<cfclient>
<cffunction access="public" name="showCanvasSupport" returntype="void">
<cfset evalStr = "document.getElementById('canvas').innerHTML='" & cfclient.canvas & "'">
</cffunction>
</cfclient>
Canvas support -<b id="canvas"></b><br>
<button onclick="invokeCFClientFunction('showCanvasSupport',null)">Show canvas support</button>
Creating a new .cfm page and adding this code produces the text and button on the page, but clicking the button throws a JS error in Chrome: "Uncaught The function signature is invokeCFClientFunction(functionName [, arg1, arg2, arg3, ...], successCallback, failureCallback). The functionName, successCallback and failureCallback are mandatory. If you don't have a successCallback or failureCallback, null can be passed as the value."
Ok, not great. So I checked some more docs and decided to add another null argument to the invokeCFClientFunction() call to fix the missing callback. This at least corrects the JS error, but now nothing at all happens when clicking the button.
So after some more fussing, I arrived at the following code, which still does not work, but seems closer:
<cfClientSettings detectDevice=true />
<cfclient>
<cffunction access="public" name="showCanvasSupport" returntype="void">
<cfscript>
document.getElementById('canvas').innerHTML=cfclient.canvas;
</cfscript>
</cffunction>
</cfclient>
Canvas support -<b id="canvas"></b><br>
<button onclick="invokeCFClientFunction('showCanvasSupport',null,null)">Show canvas support</button>
So this code, when you click the button, sets the innerHTML of the canvas element to "undefined". Awesome.
Honestly, I've been trying every example I can find for using cfclient and NONE of them work. Is there some secret I'm missing? I have a sneaking suspicion that if I'm not creating a 'Mobile Project' in CFBuilder that this stuff doesn't work? If so that's stupid and they don't state that in the docs really.
What I'm trying to do, in the end, is simply use cfclient for some basic device detection and to grab the width of the browser/device to do some basic media query style detection very much like in the "Using media queries" section of the cfclientsettings doc. I just want to grab the width and then set a session variable based on it.
I am running a fully patched developer version of CF11 on my Win7 machine setup with IIS. Any and all support is welcome.
Cross post on Adobe Forums: https://forums.adobe.com/thread/1929387
After bashing my head on my keyboard for a while more, I've gotten the cfclient scope working.
I finally found this page in the docs: Device Detection
At first glance, this page seems almost identical to the cfclientsettings doc page, even having the same code examples.
However, where the cfclientsettings doc uses the scope like this:
cfclient.canvas
The Device Detection doc page writes it like this:
cfclient.properties.canvas
Boom. That's of course all it took. What a waste of time. All the cfclient scoped variables work just fine if you add ".properties" in there.
I'm still not sure if the cfclientsettings doc is just plain wrong, or if it's referencing it in a different context. I'll definitely add a comment to it on that point.
(Also, the JavaScript still fails for this example on both doc versions, so there's that.)
Hope this helps somebody who wants to do simple ColdFusion client device detection.
Let me preface this answer by stating that I have never used cfclient and I am only relaying the documentation that I found online for it's use. This was too long for a comment.
You stated:
I have a sneaking suspicion that if I'm not creating a 'Mobile Project' in CFBuilder that this stuff doesn't work? If so that's stupid and they don't state that in the docs really.
I think they do state that in the documentation actually. Here is what I found. At the beginning of the Client-side CFML (for mobile development) document it states:
Before you begin – To try out the examples provided in this document, you need to set up the ColdFusion mobile development environment. See Configuring the development environment.
I am not going to repeat all of the information here as it is fairly substantial but the Configuring the development environment page mentions that you must install ColdFusion Server 11, install ColdFusion Builder and then create a 'ColdFusion Mobile Project' within Builder to help you along.
However that page also states that you can convert an existing ColdFusion project automatically by following the steps under Migrating existing projects where you 'Apply CF Mobile Nature' to the project from within ColdFusion Builder. This may be the piece that you are missing.
I think if you read through the documents that I referenced it may get you going. Also here is a link to their Building Mobile Applications documentation which contains an overview of the entire process.

chrome after post forms ,try to get another captcha image?

I'm using the django-simple-captcha in django forms,i used it in a
subclass of sessionwizardform,and in the last wizard form,i put a captcha field in it .
at first ,things goes all right ,but after few days ,may be by the duplication of the stale files i installed. in a word ,when i test the wizard form .In the chrome ,the captcha displays pic well,but i fill the right checking words ,in the last post of the form ,it did not post the data,and get another pic for you to validate.
and i found some answer by my previous question ,but i still can not solve it ,the help url is https://github.com/mbi/django-simple-captcha/issus/41 ,and my previous question url is django-simple-captcha-keeps-saying-invalid-captcha .
in it ,i described the detail of my django-simple-captcha.
likewise ,i'm still not know much about the globally and the virturenv, I have the django-simple-captcha uninstalled and reinstalled ,have the django uninstalled and reinstalled ,
...
but none of these worked ,and i do not re-defined the CAPTCHA_OUTPUT_FORMATin my settings.in the chrome ,i tested like
this
<td width="70%" class="text-left">
<img src="/captcha/image/d61b817a32d5aee07a4c2f8ce3cf71ccc7dea85f/" alt="captcha" class="captcha">
<input class="form-control" id="id_xy_assist-captcha_0" name="xy_assist-captcha_0" type="hidden" value="d61b817a32d5aee07a4c2f8ce3cf71ccc7dea85f">
<input class="form-control" id="id_xy_assist-captcha_1" name="xy_assist-captcha_1" type="text">
</td>
and i think this is allright,but in the chrome after all the fields
post ,there is another get captcha image which make this wizard form data can never be saved.and without this captcha field ,everything is right .
and comparing with the issues/41 in the url.
my test of captcha has two Internal Server Error,one for /test/,one for /test-modelform/.
and there is not any captcha directory except this one ?
could any one help me find a way to solve it ?
i am usint python 3.3 ,and i'd like django-simple-captcha reserved,which is really simple.
after hours checking codes and testing ,i found my programming is very poor ,i canot resolve this question ,and since i 'm a newby.
nearly tried all ways ,i solved it by this :
i copy his code to the newest django-simple-captcha's fields.py and reserves the classclass BaseCaptchaTextInput,
but the test in the captcha is not passed ,and i ignore it.
and i think my python's class has not well understand , and have to spend time on it to improve myself.

wrong result from cfmodule with firefox

In coldfusion 8, I used bellow code to view "UserDesc"field data from database table that is working on well IE and chrome but not on Firefox. On firefox it does not display on fckeditor,but shows on textarea. please suggest any change in code.
<cfmodule
template="fckeditor/fckeditor.cfm"
basePath="../views/fckeditor/"
instanceName="Question"
value='#UrlDecode(UserDesc)#'
width="530"
height="260">
There are a few newer ways to use the ckeditor in Coldfusion. You can just use the following (this may be cf9+ only, i'm not sure):
<cftextarea name="Question" id="Question"
richtext="yes"
value="#UrlDecode(UserDesc)#">
</cftextarea>
Or you could just use the javascript one as demo'd here (this should work for any version of coldfusion): http://ckeditor.com/demo You would just have to put your value in between the opening and closing text area tags.

How to get multiple language sites set up in Sitecore?

I am just starting to add support for multiple languages on my site... having a spot of trouble. Here are the steps I've taken so far:
In Control Panel -> Globalization, added a new language (German)
Added a new <site> definition in Web.config with hostName="localGerman.com" and language="de". Also added an alias in my hosts file for localgerman.com to point to localhost and added the host header in IIS.
Went to an item in my tree and added a new version for German. Published whole site.
Now, the host/site setup seems to work OK. When to go to http://localgerman.com/ I get my home page, with lots of missing data... there is no German version... so seems to be using the correct language.
However... when I go to the item I've added a German version of, I still get blank data. In the debugger, I can see that Sitecore.Context.Item is the German version... but all the fields are blank. Item["Content"] returns an empty string. If I manually set the language to "en" on the URL (http://localgerman.com/myitem.aspx?sc_lang=en), then I get the English version with data.
What am I missing here?
Also... when loading the German home page... my menu is blank. Presumably because the items which generate this content do not have German versions. I was under the assumption that when a language-specific version for a given item could not be loaded, then the default language version is used? But this does not seem to be the case. Am I wrong?
OK, looks like I just had the language code wrong. Setting the site language to "de-DE" instead of just "de" worked.
This is a little confusing because the default sites use language="en" instead of en-US.
You added a German version of an item, but did you fill in the fields in German ? Any localizable fields (non-shared) will be empty by default when a new version is created. It sounds like you did the other parts correctly.
The menu being blank is expected: When you try to get an language version of an item that doesn't exist, Sitecore will return null.

Sitecore set/change default language from 'en'

Can anyone recommend the best way to change the default language in Sitecore 6.1. On a fresh install, the typical language for all items is 'en' English, witha nice little USA flag and all.
However, we are setting up a system which is targeting en-AU and en-NZ. When I rename the main 'en' language item in any database, every other item is left without a version in the "correct" language. I recall in the past that renaming this item causes an update across the whole system, but that didn't seem to be the case when I tried it today.
Is there an easy "Sitecore" way to convert all default items to the primary language en-AU? I've considered running a sql update script over the database, but am hoping there is a neater way of doing it.
I don't think that changing anything about the en-language is a good idea. A lot of internal Sitecore objects are based on that language and you could risk loosing labels and help texts in the Sitecore UI.
We usually create all templates, renderings and layouts in the en-language and then create the content items for each language.
Instead you should set the language property in web.config for your site.
Here is an example that we are using from one of our multi-language solutions:
<site name="website_no" hostName="www.site.no|site.no" language="no" />
<site name="website_en" hostName="www.site.com|site.com" language="en" />
<site name="website" language="sv" />
The last line catches all requests not caught by the two first ones.
Couldn't get a site to use Danish as default language for backend UI based on value language="da" in <site...> tag. Changed it to da-DK, which made it work. Don't know if this is expected behaviour, but one might use the fully qualified ISO code to make sure, things are good.