Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
['webView:didStartProvisionalLoadForFrame:', 'v@:@@', function() { /*self, _cmd, frame*/ this.fireEvent('loading'); }.bind(this)],
['webView:didFinishLoadForFrame:', 'v@:@@', fireLoad.bind(this)],
['webView:didCommitLoadForFrame:', 'v@:@@', function() { /*self, _cmd, frame*/ this.fireEvent('request'); }.bind(this)],
// DEPRECATED IN OSX YOSEMITE, Not entirely sure how useful this is anyways. Most window.close events are ignored
// by browsers anyways.
// @event close
// @memberof WebView
// @description Fires when a request to close the frame has occured (e.g., window.close in HTML javascript)
['webView:willCloseFrame:', 'v@:@@', function() { /*self, _cmd, frame*/ this.fireEvent('close'); }.bind(this)],
//['webView:didChangeLocationWithinPageForFrame:', 'v@:@@', function(self, _cmd, notif) { }.bind(this)],
['webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:', 'v@:@@d@@', function() { this.fireEvent('redirect'); }.bind(this)],
['webView:createWebViewWithRequest:', '@@:@@', fireNewWindow.bind(this)],
['webView:decidePolicyForNavigationAction:request:frame:decisionListener:','v@:@@@@@', createWebViewPolicyHandler().bind(this)]
]);
Container.call(this, properties, options, inherited);
this.native = this.nativeView = this.nativeViewClass('alloc')('initWithFrame',$.NSMakeRect(0,0,500,480),'frameName',$('main'),'groupName',$('main'));
var tintWebKitResponseDelegate = createWebViewBridge();
var id = (Math.random()*100000).toString();
process.bridge.objc.delegates[id] = this;
this.private.commDelegate = tintWebKitResponseDelegate('alloc')('initWithJavascriptObject',$(id));
this.private.commDelegate.fireEvent = this.fireEvent;
this.nativeView('setShouldUpdateWhileOffscreen',$.YES);
this.nativeView('setFrameLoadDelegate', this.nativeView);
this.nativeView('setPolicyDelegate', this.nativeView);
this.nativeView('setShouldCloseWithWindow',$.YES);
}
this.nativeView('setUIDelegate', this.nativeView);
this.nativeView('setTranslatesAutoresizingMaskIntoConstraints',$.NO);
util.setProperties(this, properties, inherited);
function DateWell(properties, options, inherited) {
options = options || {};
this.nativeClass = this.nativeClass || $.System.Windows.Controls.Calendar;
this.nativeViewClass = this.nativeViewClass || $.System.Windows.Controls.Calendar;
Container.call(this, properties, options, inherited || true);
this.native.SelectedDate = new Date();
this.nativeView.SelectionMode = $.System.Windows.Controls.CalendarSelectionMode.SingleDate;
util.setProperties(this, properties, inherited);
}
function ImageWell(properties, options, inherited) {
options = options || {};
options.delegates = options.delegates || [];
this.nativeClass = this.nativeClass || $.NSImageView;
this.nativeViewClass = this.nativeViewClass || $.NSImageView;
Container.call(this, properties, options, inherited || true);
this.native('setEditable', $.YES);
this.native('setImageAlignment', $.NSImageAlignCenter);
this.native('setImageFrameStyle', $.NSImageFrameNone);
this.animates = false;
this.alignment = "center";
utilities.setProperties(this, properties, inherited);
}
function Scroll(properties, options, inherited) {
options = options || {};
this.nativeClass = this.nativeClass || $.System.Windows.Controls.ScrollViewer;
this.nativeViewClass = this.nativeViewClass || $.System.Windows.Controls.ScrollViewer;
Container.call(this, properties, options, inherited || true);
this.native.HorizontalContentAlignment = $.System.Windows.HorizontalAlignment.Left;
this.native.VerticalAlignment = $.System.Windows.HorizontalAlignment.Top;
this.private.border = null;
this.appendChild = null;
this.removeChild = null;
this.private.background = null;
util.setProperties(this, properties, inherited);
}
function ColorWell(properties, options, inherited) {
options = options || {};
options.initViewOnly = true;
this.nativeClass = this.nativeClass || $.System.Windows.Controls.Border;
this.nativeViewClass = this.nativeViewClass || $.System.Windows.Controls.Border;
Container.call(this, properties, options, inherited || true);
this.native.Width = 30;
this.native.Height = 20;
util.setProperties(this, properties, inherited);
}
function Slider(properties, options, inherited) {
options = options || {};
this.nativeClass = this.nativeClass || $.NSSlider;
this.nativeViewClass = this.nativeViewClass || $.NSSlider;
Container.call(this, properties, options, inherited || true);
this.native('setMinValue', 0);
this.native('setMaxValue', 1);
this.native('setDoubleValue', 0);
util.setProperties(this, properties, inherited);
}
function Button(properties, options, inherited) {
options = options || {};
options.mouseDownBlocks = true;
this.nativeClass = this.nativeClass || $.NSButton;
this.nativeViewClass = this.nativeViewClass || $.NSButton;
Container.call(this, properties, options, inherited);
this.private.img = null;
this.private.buttonStyle = this.private.buttonType = "normal";
this.native('setButtonType',$.NSMomentaryLightButton);
this.native('setBezelStyle',$.NSTexturedRoundedBezelStyle);
this.native('cell')('setWraps',$.NO);
this.native('setTitle', $(""));
util.setProperties(this, properties, inherited);
}