jquery fullcalendar overwrite buildSkeleton method - fullcalendar

I'd like to overwrite the buildSkeleton method used in the fullCalendar plugin.
I'm trying to remove the table,tr,td and replace them with regular divs.
Thanks

If we take a look at https://github.com/arshaw/fullcalendar/blob/master/src/basic/BasicView.js you'll see the buildSkeleton is a private function. However, renderBasic is public and makes use of buildSkeleton.
If you can successfully override the renderBasic you should be all good to go. However, your optimal path might be to actually fork the project (it obviously is open source) and add in the option of using a div skeleton over a table skeleton.

Related

Focusing on window in AutoIT by class

I would like to focus on window of class 32770 so I use:
ControlFocus("[CLASS:#32770]","","Edit1")
ControlSetText("[CLASS:#32770]","","Edit1",$CmdLine[1])
ControlClick("[CLASS:#32770]","","Button1")
but it doesn't work. What's wrong?
I wanted to make this script workable on different language versions of Windows, that's why, instead of using explicit title, I tried to use class. Final solution was to use #MUILang.

The Binding Only Updates After Clicking the Element, Though the String in the Controller Has Already Been Updated (Angular 1.5)

I have an ng-class attribute (that I didn't write on my own). It is bound to a string variable in the controller . It looks like: <some-tag ng-class="'indicator_' + $ctrl.stringValue"></some-tag>.
When the window first load - it contain the correct data, but after the string is updated in the controller - the value in the class attribute only updates after I'm clicking the element (the click will open a list, but I don't think it's relevant).
I've read that the first thing to check in these cases, is that the code is surrounded by a $scope.$apply. It is, cause when I try to add it - I get an error saying "$digest already in progress".
Looking for $ctrl and ng-class info, I read the AngularJS component doc and this site, that gave me some basic background about these subjects.
The thing is, I couldn't find any examples of ng-class with $ctrl. Maybe it's irrelevant, but maybe not :)
Example for an irrelevant question I found in the subject is: Angular ngClass is not updating my classes even though my condition change as expected.
In general, most of the examples I found include curly brackets, which I don't think are relevant in this case, since I'm binding a string (maybe I'm mistaking about it :) ).
I suspect it probably didn't bind it correctly, I just don't know why.
Edit:
After continuing to search the subject, I'm no longer sure it's related to the ng-class (so I edited the title as well). It looks more like a refresh problem.
I'm puzzled as to why the page doesn't refresh, since everywhere I read - they say that the Angular should call the digest function on its own, and I should not interfere.
Edit2:
I'm working with typeScript, and the stringValue is updated via an event from a service. But the string does update - so I'm not sure it is a relevant information to understand the problem, but worth mentioning :)
Problem solved!! :D
All I had to do, is to add $timeout(0) after updating the string in the controller!
The explanation: it was a digest problem, and the reason I couldn't use $scope.$apply(), is because I was trying to do it directly. I needed to do a safe apply, which means - first make sure there's no digest on that scope, and then run apply.
Turns out that an easy way to do it, is to use $timeout(0).
I prepared a plunker with Angular 1.5.7 with a demo of what you described. There doesn't seem to be any problem, or anything special you should do. (I used a different alias for the controller, which is the best practice, but $ctrl works fine as well.)
https://plnkr.co/edit/wCpBQ5?p=preview
const DemoComponent = {
controller: DemoController,
controllerAs: 'demoCtrl',
template: `
<h2 ng-class="'demo_' + demoCtrl.classSuffix">{{ demoCtrl.classSuffix }}</h2>
<button ng-click="demoCtrl.changeClass()">Change Class</button>
`
}
angular.module('myapp', [])
.component('demo', DemoComponent);
It will be very helpful if you can reproduce the issue in plunker and post the link.
Otherwise, I hope you find the answer in this plunker.

gwt no CssResource'WithLookup' method

I've stumbled into a situation with gwt that does not seem to have a way around.
I've created a Composite widget with many dynamic clipped Image's so I can move the clipping like a tile-map. All went well until I start using a json as a TextResource describing the layout. The ui-binder does not work in my case.
I got ClientBundleWithLookup and ConstantsWithLookup working fine, but there is no lookup for the CSS classes. The lookup of the style() [as in the many examples] gives you this obfuscated chunk of the original css file - but there is no way to map these giberish names to what was originally in the css and in the json definitions.
I then thought of a way around is to send my css as a TextResource rather than the CssResource and process it manualy. After spending the entire day doing this - there is no styles on the browser since the generated gwt javascript look for these giberish names once running in the browser.
I need a way to lookup css style names at runtime, the ideal would be to have a CssResourceWithLookup class as well. Also there's no reflection so I cant map the java methods to pass to the setStyleName()'s.
I also spotted somewhere on google a way to produce a debug map of these names - however I don't see how this will actualy help me since these names change after every compile. So I'm throughly stuck. I just dont understand how the gwt team failed this 'lookup' functionality on half of the resource bundles.
Any one with a way around this - please?
#external may help you : it turns class names obfuscation off.
In MyStyles.css:
#external .style1, .style2;
.style1{
color: green;
}
.style2{
color: red;
}
In your Java code:
myTile1.addStyleNames("style1");
myTile2.addStyleNames("style2");

How do you dynamically load a CSS file into a Flex application?

I know that you can apply CSS in order to style objects in Flex using the StyleManager:
http://livedocs.adobe.com/flex/3/html/help.html?content=styles_07.html
You can also load compiled CSS files (SWFs) dynamically:
http://livedocs.adobe.com/flex/3/html/help.html?content=styles_10.html
However, I'm dynamically creating my CSS files using a web GUI and a server-side script.
If the CSS is changed, then the script would also need to compile the CSS into an SWF (which is not a viable option). Is there any way around this?
In this comment to an issue related to this in the Adobe bug tracker T. Busser is describing what might be a viable solution for you:
"I've created a small class that will 'parse' a CSS file read with an
HTTPService object. It takes apart the
string that is returned by the
HTTPService object, break it down into
selectors, and create a new
CSSStyleDeclaration object for each
selector that is found. Once all the
properties are assigned to the
CSSStyleDeclaration object it's added
to the StyleManager. It doesn't
perform any checks, you should make
sure the CSS file is well formed, but
it will be sufficient 99% of the time.
Stuff like #font, Embed() and
ClassReference() will hardly be used
by my customers. They do need the
ability to change colors and stuff
like that so they can easily theme the
Flex application to their house
style."
You could either try to contact this person for their solution or alternatively maybe use the code from this as3csslib project as a basis for writing something like what they're describing.
You can also implement dynamic stylesheet in flex like this . Here i found this article :
http://askmeflash.com/article_m.php?p=article&id=6
Edit: This solution does not work. All selectors that are taken out of the parser are converted to lowercase. This may work for your application but it will probably not...
I am leaving this answer here because it may help some people looking for a solution and warn others of the limitations of this method.
See my question: "Looking for CSS parser written in AS3" for a complete discussion but I found a CSS parser hidden inside the standard libraries. Here is how you can use it:
public function extractFromStyleSheet(css:String):void {
// Create a StyleSheet Object
var styleSheet:StyleSheet = new StyleSheet();
styleSheet.parseCSS(css);
// Iterate through the selector objects
var selectorNames:Array = styleSheet.styleNames;
for(var i:int=0; i<selectorNames.length; i++){
// Do something with each selector
trace("Selector: "+selelectorNames[i];
var properties:Object = styleSheet.getStyle(selectorNames[i]);
for (var property:String in properties){
// Do something with each property in the selector
trace("\t"+property+" -> "+properties[property]+"\n");
}
}
}
You can then apply the styles using:
cssStyle = new CSSStyleDeclaration();
cssStyle.setStyle("color", "<valid color>);
FlexGlobals.topLevelApplication.styleManager.setStyleDeclaration("Button", cssStyle, true);
The application of CSS in Flex is handled on the server side at compilation and not on the client side at run time.
I would see two options then for you (I'm not sure how practical either are):
Use a server side script to compile your CSS as a SWF then load them dynamically.
Parse a CSS Style sheet and use the setStyle functions in flex to apply the styles. An similar example to this approach is the Flex Style Explorer where you can check out the source.
Good luck.

How can I modify a CSS file programmatically?

I have a legacy application that I needed to implement a configuration page for to change text colors, fonts, etc.
This applications output is also replicated with a PHP web application, where the fonts, colors, etc. are configured in a style sheet.
I've not worked with CSS previously.
Is there a programatic way to modify the CSS and save it without resorting to string parsing or regex?
The application is VB6, but I could write a .net tool that would do the css manipulation if that was the only way.
You don't need to edit the existing one. You could have a new one that overrides the other -- you include this one after the other in your HTML. That's what the "Cascading" means.
It looks like someone's already done a VB.NET CSS parser which is F/OSS, so you could probably adapt it to your needs if you're comfortable with the license.
http://vbcssparser.sourceforge.net/
One hack is to create a PHP script that all output is passed through, which then replaces certain parts of CSS with configurable alternatives. If you use .htaccess you can make all output go through the script.
the best way i can think of solving this problem is creating an application that will get some values ( through the URL query ) and generate the appropriate css output based on a css templates
Check this out, it uses ASP.NET and C#.
In my work with the IE control (shadocvw.dll), it has an interesting ability to let you easily manage the CSS of a page and show the effects of modified CSS on a page in realtime. I've never dealt with the details of such implementations myself, but I recommend that as a possible solution worth looking at. Seeing as pretty much everyone is on IE 6 or later nowadays, you can skip the explanations about handling those who only have IE 5,4,3 or 2 installed.
Maybe the problem's solution, which is most simple for the programmer and a user is to edit css via html form, maybe. I suppose, to create css-file, which would be "default" or "standart" for this application, and just to read it, for example, by perl script, edit in html and to write it down. Here is just the simple example.
In css-file we have string like:
border-color: #008a77;
we have to to read this string, split it up, and send to a file, which will write it down. Get something like this in Perl:
tr/ / /s;
($vari, $value) = split(/:/, _$);
# # While you read file, you can just at the time to put this into html form
echo($vari.":<input type = text name = ".$vari." value = ".$value.">");
And here it is, you've got just simple html-form-data, you just shoul overwrite your css-file with new data like this:
...
print $vari[i].": ".$value.";\n";
...
and voila - you've got programmatical way of changing css. Ofcourse, you have to make it more universal, and more close to your particular problem.
Depending on how technically oriented your CSS editors are going to be, you could do it very simply by loading the whole thing up into a TextEdit field to let them edit it - then write it back to the file.
Parsing and creating an interface for all the possibilities of CSS would be an astronomical pain. :-)

Resources