Add JavaScript documentation Sencha Architect - documentation

Is it possible to add documentation (not just comments) to your javascript methods in Sencha Architect. I cannot seem to add lines above methods because of the specific method views in Architect.
I am talking about the following documentation:
/**
* this documentation
*/
bla: function() {
//I do know how to add this comment!
}
UPDATE:
Seems that it is not possible :(
http://www.sencha.com/forum/showthread.php?281079-Sencha-Architect-Code-Documentation-%28JSDocs%
I will keep this thread open to see if someone knows a workaround to the problem.

Architect 3.1 or 3.1.1 will add commenting. It's done in prototype form but we are racing to add Ext JS 5 so it's on the back burner until then.

Related

Documentation for Xcode Source Editor Extension

I'm looking for some documentation of the new Xcode Source Editor Extensions in Xcode 8.
As far as I can see there is only the "documentation" found in the header file for XcodeKit. Would be great to get something that's more detailed and more official.
Very preliminary XcodeKit reference documentation is now available.
Our WWDC 2016 presentation introducing Xcode Source Editor Extensions remains the best walkthrough.
The very shortest version, however, is: Because App Extensions need to be embedded in an application, you need to first create a new macOS Cocoa Application, and then add a new Xcode Source Editor Extension to that application. Then the XcodeKit reference should help some in implementing that.
Not really a documentation but a good reference also
https://developer.apple.com/videos/play/wwdc2016/414/
Extensions, at the moment, are poorly documented. There are a lot of assumptions made (for example, did you know that you can execute the container app? Yup, it’s really nice for settings GUI - see this How To Execute Container App - Second Answer)
At the moment, there are a lot of things missing: for example, there isn’t a structure that shows the corresponding lines with the data object - though this is quickly created with the following code:
var matches: [NSTextCheckingResult] = []
do {
let regex = try NSRegularExpression(pattern: "\n", options: [])
matches = regex.matches(in: completeBuffer,
options: [],
range: NSMakeRange(0, completeBuffer.count))
}
catch {
}
This gives you the location of all the \n’s - you should be able to fill out the rest to give you starting and ending positions which should match up to the lines.
All in all, there is a lot to like about the extension, but there are quite a few things missing as well.
Currently the only available documentation is in the headers; there's nothing "unofficial" about them. If you have specific questions, please ask.

ExtJS 5 Custom Theme Testing

I recently started to create custom theme for ExtJS 5 by Sencha.
Following http://docs.sencha.com/extjs/5.0.0/core_concepts/theming.html I managed to create ThemeDemoApp, inherit ext-theme-neptune, change $base-color to green and refresh/rebuild ThemeDemoApp with my-custom-theme. All ok.
My problem is, ThemeDemoApp is quite poor for testing a custom theme. A panel, tab, button and a modal window. That's it?
After bit of googling I bumped into http://dev.sencha.com/ext/5.0.0/examples/themes/index.html. (Why isn't this mentioned in the guide?!) Heading says: View and test every Ext component against bundled Ext Themes, or your own custom themes.
My question is: How? How do I test my own custom theme against this example? Do I have to dig into the source (themes.js) and build such page/application myself?
The examples - including the Theme tester - is included in the ExtJS download.
You can modify the list of themes available by editing the shared/options-toolbar.js file.
To get it to find your theme, you'll either need to name it similar to the others (ext-theme-name), or modify themes.js accordingly.
Or you could just hack the theme.js file to hardcode your theme.
(Ext JS 4 used to create an example page for themes automatically - it doesn't seem to do that now, though)
According to advice at How do I include a JavaScript file in another JavaScript file? I decided to load both options-toolbar.js and themes.js (with just minor modification - commenting out Ext.onReady(...) function in themes.js) and I used functions getBasicPanel(), getCollapsedPanel(), etc. in my own application to create the same testing page (absolute-layout container that fits the page).
Anyhow, I guess Robert's answer is the correct one - there is no prearranged, ready-to-use functionality from Sencha :-(

How do I include a custom field client control JS file?

I'm trying to develop a custom field using the steps outlined here: http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/controls/types-of-controls/field-controls/building-a-custom-field-control
Unfortunately, I don't know how/where to include the client control js file, and it doesn't seem to say in the documentation. Can anyone explain how I might do this?
I'm very new to Sitefinity dev (as in this is the first thing I've done) and web dev in general, so feel free to suggest things that "should be obvious"
I also asked this question on the Sitefinity forums - I'll be sure to copy the answer here if I get one there.
Ok, got it.
First you need to set the processing options for the js file to Embedded Resource
Then add it to the AssemblyInfo.cs:
[assembly: WebResource("namespace.filename.js", "text/javascript")]
Then override the GetScriptReferences method in the class that inherits from FieldControl:
public override IEnumerable<ScriptReference> GetScriptReferences()
{
var baseReferences = new List<ScriptReference>(base.GetScriptReferences());
var newRef = new ScriptReference(javascriptPath, this.GetType().Assembly.FullName);
baseReferences.Add(newRef);
return baseReferences;
}

Sencha Touch testing build not working

I've finished my first app using sencha touch 2.2.1. Now I uploaded it onto my server and tried to access it with my phone. Everything works well. My Dashboard contains 6 buttons, but only 1 of them is working. Each other throws the following error
TypeError: 'undefined' is not an object (evaluating 'name.substring')
The error occurs in the function parseNamespace. But I don't know what is wrong. I build the app using Sencha Architect and in the preview everything was fine. The testing package was created using the build-button from architect. If anyone could help me, the app is located here: app.ttv-rees-groin.de
Many thanks
This may be issue with class loading. The classes which are referred in the event of button events may not be loaded at the time.
Those classes may be missed when packaging application.
My experience found that Architect's build and package tools created a bloated mess of unnecessary files far exceeding what was required. Technical details: Architect 2 - all builds, Sencha Touch 2.0-2.2.x including all versions in between, Sencha Cmd 3.x
The cleanest and leanest build technique for developing in Architect was to save then fire the build using Sencha Cmd.
sencha app build
This performs the default "production" build.
The difference in output in this case went from a 32MB dump of files in the production folder with all resources, library, extensions etc, to the minimum required files totalling 0.8MB, and no longer requiring the touch library as only the classes needed were compiled into the app.
As for the error at hand, this error has something to do with class namespace, alias and xtype.
(Quick thanks to http://ruidevnotes.wordpress.com/2013/07/25/sencha-ext-js-4-common-typeerror/, saving me quite a lot of typing for these 4 things to check).
Possible solutions:
If class has controller, make sure the controller’s views config match the namespace specified on the class view’s Ext.define. Example: (controller)
views : ['namespace.of.my.View']
When using class on other view as xtype, make sure view’s alias is
widget.[customXtype]
so when adding it as an item to other viems, use
xtype : [customXtype]
Make sure view’s controller is added on app.js controllers.
When class view has no controller and you wanted to use it on other views, make sure to add the namespace of that view on
Ext.require(['class.view.namespace.name']);
and specify the xtype config instead of alias.
On top of these points, I recall an issue with list plugins, that I believe behaves identical to the error you are encountering. Prebuild - would work. Post build, issues and errors. The way I was able to get around this error was via this technique:
requires: [
'Ext.XTemplate',
'Ext.plugin.ListPaging'
],
config: {
..., // other standard configs removed for brevity
plugins: [
{
xclass: 'Ext.plugin.ListPaging',
autoPaging: true,
type: 'listpaging'
}
]
}
The thing to note is the exaggerated plugins declaration. Without this comprehensive declaration, the ListPaging plugin caused all manner of pain and chaos, and solely after a build.
EDIT: spelling.

How to create fiddles for Sencha touch 2.1.1 or 2.2?

Since fiddles are very useful to explain and understand issues on any forum I would like to create fiddle for Sencha touch 2.1.1(which is the version I use) when I post here but http://www.senchafiddle.com/ only oppers Sencha-Touch-2.0.1 and http://jsfiddle.net/ doesn't even have any option for Sencha Touch, so how to make fiddles with latest versions?
You can try sencha playground by WalkingTree. I haven't played with it much but it seems legit.
You can have access to Sencha Touch 2.1 with New Senchafiddle
JSFiddle will work. Just need to specifiy the external resources. Sometimes SenchaFiddle gives me errors when I try to save my code. This is an alternative in case senchafiddle doesn't behave as expected.
Sencha CDN will have the required css and js files.
Eg. 2.2.1 css and js url
http://cdn.sencha.com/touch/sencha-touch-2.2.1/sencha-touch-all-debug.js
http://cdn.sencha.com/touch/sencha-touch-2.2.1/resources/css/sencha-touch.css
Other versions can be accessed like
http://cdn.sencha.com/touch/sencha-touch-2.1.1/resources/css/sencha-touch.css
http://cdn.sencha.com/touch/sencha-touch-2.1.1/sencha-touch-all-debug.js
Then I put everything I need inside the launch function in the code below.
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
launch: function () {
//Your code goes here.
}
});
Here is a demo.
The official Sencha Touch Fiddle now seems to be live:
fiddle.sencha.com
The other fiddle site (new.senchafiddle.com), marked at the answer above, no longer seems to be up and running.