Where to edit sublime text js beautify setting? - sublime-text-plugin

I am trying to use sublime text Javascript Beautify plugin, and it says I need to change to below setting:
{
"indent_size": 4,
"indent_char": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"jslint_happy": false,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": false,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0,
// jsbeautify options
"format_on_save": true
}
Where exactly do I have to make this change in sublime text?

All package settings can be accessed from the Preferences/Package Settings menu.

Related

How can I fix an element at the screen in react native. Something like a position fixed in css

Because there's no position fixed in react native:
Invariant Violation: Invalid prop position of value fixed supplied to StyleSheet input, expected one of ["absolute","relative"].
StyleSheet input: {
"position": "fixed",
"top": 465,
"height": 40,
"width": 300,
"borderWidth": 1,
"paddingHorizontal": 20,
"margin": 5,
"borderRadius": 20
}
in react native, you can use
Position:'absolute',
left:0,
top:0,
remember position absolute is limited to its parent view

Writing If condition inside DT datatable options?

Apologies for not being able to provide a reproducible example, but below is the options for my datatable. Basically, if the screenshot button is pressed - I don't want the scroll feature enabled - otherwise it should be enabled. Thank you for any help or recommendations! The if statement initially evaluates as false, but the scroll feature is still disabled by default.
Also, does anyone know the meaning of life?
` options = list(dom = 't', paging = FALSE, ordering = FALSE,
#pageLength = -1,
if(input$screenshot > 0){
scrollY=NULL
} else {
scrollY='50vh'
}
, scrollCollapse = TRUE`
Keep it simple. Write your if condition outside the DT renderer, inside an observer to a reactive variable. Also, instead of using an action button for screenshot I would suggest you to use a toggle button. This would allow you to enable and disable scrolling instead of just disabling it altogether.
# You initialize the table with scrolling enabled
react <- reactiveValues(scrollCondition="50vh")
# Toggle button returns TRUE when enabled and FALSE when disabled. So when screenshots are set to TRUE, we make the scrollY property NULL.
observeEvent(input$screenshot,{
if(input$screenshot==TRUE){
react$scrollCondition <- NULL
}else{
react$scrollCondition <- "50vh'"
}
})
`options = list(dom = 't', paging = FALSE, ordering = FALSE,
scrollY= react$scrollCondition,
scrollCollapse = TRUE`
Hope this helps.

iMacro script to press keyboard button

I want a iMacro script that can press keyboard button on every 15 minutes
On every 15 min "Shift + S" should be pressed.
Or any other add on for Firefox will also work that does this thing.
Try this script for Firefox 'iMacros':
while (true) {
var doc = window.document;
var event = doc.createEvent("KeyboardEvent");
event.initKeyEvent("keypress", true, true, window, false, false, true, false, 0, 83);
doc.getElementsByTagName("html")[0].dispatchEvent(event);
iimPlayCode("WAIT SECONDS=900");
}

Configuration of django-ckeditor

I playing around with django-ckeditor and I have a few questions:
My configuration in django settings.py is:
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'full',
'height': 300,
'width': 800,
},
}
1) What do I have to change in the settings to get an inline-editor (the toolbar only appears if I click into the textarea)?
2) Right now height is set to 300px. If I write more text I get vertical scrollbars. Is there a way to avoid scrollbars and make an auto resize of the editor (means the height of the editor increases with every new line I put in)?

KO Grid Scrollbars not visible & Display issues

I am having two problems with KOgrid.
1) I could not get scroll bars in the kogrid .It is very difficult to do data entry without scroll bars.
2) I also could not get kogrid to working wihout specifying hard coded height and width.In my application I can not have a fixed height and width.
Did anybody else had the same issue ?
I tried a workaround suggestion from this thread ( using jQuery fix as last line in my viewmodel).
KO Grid Display Isseues, On resize Gird shows one row. Images also included
that just increased that size of the grid but it did not display any data . However, when I resize the page data shows up.
Below are my HTML and kogrid options ( I tried with and without paging options, Ideally I do not want to use paging )
<div data-bind="koGrid: gridOptions"
style="height: 800px; background-color: none;width: 1850px;">
</div>
self.gridOptions = {
data: self.mydatarray,
footerVisible: true,
displaySelectionCheckbox: true,
afterSelectionChange: self.RowSelectionChange,
rowHeight: 50,
selectWithCheckboxOnly: true,
enableSorting: false,
multiSelect: true,
selectedItems: self.SelectedRows,
enableColumnResize: true,
showFilter: false,
canSelectRows: true,
enablePaging: true,
pagingOptions: {
currentPage: ko.observable(1),
pageSize: ko.observable(3),
pageSizes: ko.observableArray([3, 6, 9])
},
rowTemplate: errrowtmpl,
columnDefs: [
{ field: 'Customer', displayName: 'Customer', cellTemplate: Customersddedittmpl, headerCellTemplate: headercelltmpl },
...
...
{ field: 'GenNotes', displayName: 'GenNotes', cellTemplate: simpleedittmpl, headerCellTemplate: headercelltmpl }
]
}
Please let me know if you need any more information
Thanks
Kenner Dev
I found a solution to the problems I am facing.
1) I used Jquery to add scroll bar. I added code line below as last line of my data loading function. I am not sure id this breaks any other KOGrid functionality.In my application I did some basic testing and it seems to be working fine.
$("div.kgViewport").css("overflow", "scroll");
2) I still dont know how to solve this problem 100%. It still does not work unless fixed width and height are mentioned in style. In my app I used vw and vh as opposed fixed width and height to solve the problem of making it work on all screen sizes.
<div data-bind="koGrid: gridOptions"
style="height: 73vh;overflow:scroll;width: 96vw;"></div>