Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vitmalina committed Dec 26, 2015
1 parent c5d6169 commit 466ec61
Show file tree
Hide file tree
Showing 16 changed files with 200 additions and 183 deletions.
9 changes: 6 additions & 3 deletions dist/w2ui-fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@ w2utils.formatters = {
w2utils.event = {

on: function (edata, handler) {
var $ = jQuery;
// allow 'eventName:after' syntax
if (typeof edata == 'string' && edata.indexOf(':') != -1) {
var tmp = edata.split(':');
Expand All @@ -1601,6 +1602,7 @@ w2utils.event = {
},

off: function (edata, handler) {
var $ = jQuery;
// allow 'eventName:after' syntax
if (typeof edata == 'string' && edata.indexOf(':') != -1) {
var tmp = edata.split(':');
Expand Down Expand Up @@ -1633,6 +1635,7 @@ w2utils.event = {
},

trigger: function (edata) {
var $ = jQuery;
var edata = $.extend({ type: null, phase: 'before', target: null, doneHandlers: [] }, edata, {
isStopped : false,
isCancelled : false,
Expand Down Expand Up @@ -2486,12 +2489,12 @@ w2utils.event = {
'<tr index="'+ f + '" style="'+ (mitem.style ? mitem.style : '') +'" '+ (mitem.tooltip ? 'title="'+ mitem.tooltip +'"' : '') +
' class="'+ bg +' '+ (options.index === f ? 'w2ui-selected' : '') + ' ' + (mitem.disabled === true ? 'w2ui-disabled' : '') +'"'+
' onmousedown="if ('+ (mitem.disabled === true ? 'true' : 'false') + ') return;'+
' $.fn.w2menuDown(event, \''+ f +'\');"'+
' jQuery.fn.w2menuDown(event, \''+ f +'\');"'+
' onmouseout="if ('+ (mitem.disabled === true ? 'true' : 'false') + ') return;'+
' $.fn.w2menuOut(event, \''+ f +'\');"'+
' jQuery.fn.w2menuOut(event, \''+ f +'\');"'+
' onclick="event.stopPropagation(); '+
' if ('+ (mitem.disabled === true ? 'true' : 'false') + ') return;'+
' $.fn.w2menuClick(event, \''+ f +'\');">'+
' jQuery.fn.w2menuClick(event, \''+ f +'\');">'+
imgd +
' <td class="menu-text" colspan="'+ colspan +'">'+ txt +'</td>'+
' <td class="menu-count">'+
Expand Down
4 changes: 2 additions & 2 deletions dist/w2ui-fields.min.js

Large diffs are not rendered by default.

63 changes: 33 additions & 30 deletions dist/w2ui.js

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions dist/w2ui.min.js

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions src/w2grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
'columns' : { type: 'drop', id: 'w2ui-column-on-off', icon: 'w2ui-icon-columns', tooltip: 'Show/hide columns', arrow: false, html: '' },
'search' : { type: 'html', id: 'w2ui-search',
html: '<div class="w2ui-icon icon-search-down w2ui-search-down" title="'+ w2utils.lang('Select Search Field') +'" '+
'onclick="var obj = w2ui[$(this).parents(\'div.w2ui-grid\').attr(\'name\')]; obj.searchShowFields();"></div>'
'onclick="var obj = w2ui[jQuery(this).parents(\'div.w2ui-grid\').attr(\'name\')]; obj.searchShowFields();"></div>'
},
'search-go': { type: 'drop', id: 'w2ui-search-advanced', icon: 'w2ui-icon-search', text: 'Search', tooltip: 'Open Search Fields' },
'add' : { type: 'button', id: 'w2ui-add', text: 'Add New', tooltip: 'Add new record', icon: 'w2ui-icon-plus' },
Expand Down Expand Up @@ -1988,7 +1988,7 @@
if (this.searches[s].hidden === true || this.searches[s].simple === false) continue;
}
html += '<tr '+ (w2utils.isIOS ? 'onTouchStart' : 'onClick') +'="w2ui[\''+ this.name +'\'].initAllField(\''+ search.field +'\');'+
' event.stopPropagation(); $(\'#grid_'+ this.name +'_search_all\').w2overlay({ name: \''+ this.name +'-searchFields\' });">'+
' event.stopPropagation(); jQuery(\'#grid_'+ this.name +'_search_all\').w2overlay({ name: \''+ this.name +'-searchFields\' });">'+
' <td><input type="radio" tabIndex="-1" '+ (search.field == this.last.field ? 'checked="checked"' : '') +'/></td>'+
' <td>'+ search.caption +'</td>'+
'</tr>';
Expand Down Expand Up @@ -4608,7 +4608,7 @@
' <td style="width: 30px; text-align: center; padding-right: 3px; color: #888;">'+
' <span class="w2ui-column-check w2ui-icon-'+ (!obj.show.lineNumbers ? 'empty' : 'check') +'"></span>'+
' </td>'+
' <td onclick="$(\'.w2ui-overlay\')[0].hide();">'+
' <td onclick="jQuery(\'.w2ui-overlay\')[0].hide();">'+
' <label>'+ w2utils.lang('Line #') +'</label>'+
' </td>'+
'</tr>';
Expand All @@ -4625,7 +4625,7 @@
' <td style="width: 30px; text-align: center; padding-right: 3px; color: #888;">'+
' <span class="w2ui-column-check w2ui-icon-'+ (col.hidden ? 'empty' : 'check') +'"></span>'+
' </td>'+
' <td onclick="$(\'.w2ui-overlay\')[0].hide();">'+
' <td onclick="jQuery(\'.w2ui-overlay\')[0].hide();">'+
' <label>'+ w2utils.stripTags(tmp) +'</label>'+
' </td>'+
'</tr>';
Expand All @@ -4640,7 +4640,7 @@
' <input type="text" style="width: 45px" value="'+ this.offset +'" '+
' onkeypress="if (event.keyCode == 13) { '+
' w2ui[\''+ obj.name +'\'].skip(this.value); '+
' $(\'.w2ui-overlay\')[0].hide(); '+
' jQuery(\'.w2ui-overlay\')[0].hide(); '+
' }"/> '+ w2utils.lang('Records')+
' </div>'+
'</td></tr>';
Expand Down Expand Up @@ -4981,8 +4981,8 @@
' onchange="'+
' var grid = w2ui[\''+ this.name +'\']; '+
' var val = this.value; '+
' var sel = $(this).data(\'selected\');'+
' var fld = $(this).data(\'w2field\'); '+
' var sel = jQuery(this).data(\'selected\');'+
' var fld = jQuery(this).data(\'w2field\'); '+
' if (fld) val = fld.clean(val);'+
' if (fld &amp;&amp; fld.type == \'list\' &amp;&amp; sel &amp;&amp; typeof sel.id == \'undefined\') {'+
' grid.searchReset();'+
Expand Down Expand Up @@ -5928,7 +5928,7 @@
' onclick="var grid = w2ui[\''+ obj.name +'\'];'+
' if (this.checked) grid.selectAll(); else grid.selectNone();'+
' if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true;'+
' clearTimeout(grid.last.kbd_timer); $(grid.box).find(\'#grid_'+ this.name + '_focus\').focus();/* keep focus */' +
' clearTimeout(grid.last.kbd_timer); jQuery(grid.box).find(\'#grid_'+ this.name + '_focus\').focus();/* keep focus */' +
' "/>'+
' </div>'+
'</td>';
Expand Down Expand Up @@ -6446,8 +6446,8 @@
: ''
) +
(this.selectType == 'row' ?
' onmouseover="$(\'#grid_'+ this.name +'_rec_\'+ w2utils.escapeId($(this).attr(\'recid\'))).addClass(\'w2ui-record-hover\')"'+
' onmouseout ="$(\'#grid_'+ this.name +'_rec_\'+ w2utils.escapeId($(this).attr(\'recid\'))).removeClass(\'w2ui-record-hover\')"'
' onmouseover="jQuery(\'#grid_'+ this.name +'_rec_\'+ w2utils.escapeId(jQuery(this).attr(\'recid\'))).addClass(\'w2ui-record-hover\')"'+
' onmouseout ="jQuery(\'#grid_'+ this.name +'_rec_\'+ w2utils.escapeId(jQuery(this).attr(\'recid\'))).removeClass(\'w2ui-record-hover\')"'
:
'') +
' style="height: '+ this.recordHeight +'px; '+ (!isRowSelected && typeof record['style'] == 'string' ? record['style'] : '') +'" '+
Expand All @@ -6460,16 +6460,16 @@
(record.w2ui && record.w2ui.expanded === true ? ' w2ui-expanded' : '') + '" ' +
(summary !== true ?
(w2utils.isIOS ?
' onclick = "var obj = w2ui[\''+ this.name +'\']; obj.dblClick($(this).attr(\'recid\'), event);"'
' onclick = "var obj = w2ui[\''+ this.name +'\']; obj.dblClick(jQuery(this).attr(\'recid\'), event);"'
:
' onclick = "var obj = w2ui[\''+ this.name +'\']; obj.click($(this).attr(\'recid\'), event);"'+
' oncontextmenu = "var obj = w2ui[\''+ this.name +'\']; obj.contextMenu($(this).attr(\'recid\'), null, event);"'
' onclick = "var obj = w2ui[\''+ this.name +'\']; obj.click(jQuery(this).attr(\'recid\'), event);"'+
' oncontextmenu = "var obj = w2ui[\''+ this.name +'\']; obj.contextMenu(jQuery(this).attr(\'recid\'), null, event);"'
)
: ''
) +
(this.selectType == 'row' ?
' onmouseover="$(\'#grid_'+ this.name +'_frec_\' + w2utils.escapeId($(this).attr(\'recid\'))).addClass(\'w2ui-record-hover\')"'+
' onmouseout ="$(\'#grid_'+ this.name +'_frec_\' + w2utils.escapeId($(this).attr(\'recid\'))).removeClass(\'w2ui-record-hover\')"'
' onmouseover="jQuery(\'#grid_'+ this.name +'_frec_\' + w2utils.escapeId(jQuery(this).attr(\'recid\'))).addClass(\'w2ui-record-hover\')"'+
' onmouseout ="jQuery(\'#grid_'+ this.name +'_frec_\' + w2utils.escapeId(jQuery(this).attr(\'recid\'))).removeClass(\'w2ui-record-hover\')"'
:
'') +
' style="height: '+ this.recordHeight +'px; '+ (!isRowSelected && typeof record['style'] == 'string' ? record['style'] : '') +'" '+
Expand All @@ -6491,10 +6491,10 @@
' <input class="w2ui-grid-select-check" type="checkbox" tabindex="-1" '+ (isRowSelected ? 'checked="checked"' : '') +
' onmousedown="if (event.stopPropagation) event.stopPropagation();"'+
' onclick="var grid = w2ui[\''+ this.name +'\'];'+
' var recid = $(this).parents(\'tr\').attr(\'recid\'); '+
' var recid = jQuery(this).parents(\'tr\').attr(\'recid\'); '+
' if (!grid.multiSelect) { grid.selectNone(); }'+
' if (this.checked) grid.select(recid); else grid.unselect(recid);'+
' clearTimeout(grid.last.kbd_timer); $(grid.box).find(\'#grid_'+ this.name + '_focus\').focus(); /* keep focus */' +
' clearTimeout(grid.last.kbd_timer); jQuery(grid.box).find(\'#grid_'+ this.name + '_focus\').focus(); /* keep focus */' +
' "/>'+
' </div>'
:
Expand All @@ -6510,7 +6510,7 @@
'<td id="grid_'+ this.name +'_cell_'+ ind +'_expand' + (summary ? '_s' : '') + '" class="w2ui-grid-data w2ui-col-expand">'+
(summary !== true ?
' <div ondblclick="if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true;" '+
' onclick="w2ui[\''+ this.name +'\'].toggle($(this).parents(\'tr\').attr(\'recid\')); '+
' onclick="w2ui[\''+ this.name +'\'].toggle(jQuery(this).parents(\'tr\').attr(\'recid\')); '+
' if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true;">'+
' '+ tmp_img +' </div>'
:
Expand Down Expand Up @@ -6611,7 +6611,7 @@
? (record.w2ui.expanded ? 'w2ui-icon-collapse' : 'w2ui-icon-expand')
: 'w2ui-icon-empty'
) +'" '+
' onclick="event.stopPropagation(); w2ui[\''+ this.name + '\'].toggle($(this).parents(\'tr\').attr(\'recid\'))"></span>';
' onclick="event.stopPropagation(); w2ui[\''+ this.name + '\'].toggle(jQuery(this).parents(\'tr\').attr(\'recid\'))"></span>';
}
// info bubble
if (col.info === true) col.info = {};
Expand Down
8 changes: 4 additions & 4 deletions src/w2sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,8 @@
html =
'<div class="w2ui-node-group" id="node_'+ nd.id +'"'+
' onclick="w2ui[\''+ obj.name +'\'].toggle(\''+ nd.id +'\')"'+
' onmouseout="$(this).find(\'span:nth-child(1)\').css(\'color\', \'transparent\')" '+
' onmouseover="$(this).find(\'span:nth-child(1)\').css(\'color\', \'inherit\')">'+
' onmouseout="jQuery(this).find(\'span:nth-child(1)\').css(\'color\', \'transparent\')" '+
' onmouseover="jQuery(this).find(\'span:nth-child(1)\').css(\'color\', \'inherit\')">'+
((nd.groupShowHide && nd.collapsible) ? '<span>'+ (!nd.hidden && nd.expanded ? w2utils.lang('Hide') : w2utils.lang('Show')) +'</span>' : '<span></span>') +
(typeof nd.text == 'function' ? nd.text.call(nd) : '<span>'+ nd.text +'</span>') +
'</div>'+
Expand Down Expand Up @@ -875,10 +875,10 @@
'<div class="w2ui-node-sub" id="node_'+ nd.id +'_sub" style="'+ nd.style +';'+ (!nd.hidden && nd.expanded ? '' : 'display: none;') +'"></div>';
if (obj.flat) {
html = '<div class="w2ui-node '+ (nd.selected ? 'w2ui-selected' : '') +' '+ (nd.disabled ? 'w2ui-disabled' : '') +'" id="node_'+ nd.id +'" style="'+ (nd.hidden ? 'display: none;' : '') +'"'+
' onmouseover="$(this).find(\'.w2ui-node-data\').w2tag(w2utils.base64decode(\''+
' onmouseover="jQuery(this).find(\'.w2ui-node-data\').w2tag(w2utils.base64decode(\''+
w2utils.base64encode(text + (nd.count || nd.count === 0 ? ' - <span class="w2ui-node-count">'+ nd.count +'</span>' : '')) + '\'), '+
' { id: \'' + nd.id + '\', left: -5 })"'+
' onmouseout="$(this).find(\'.w2ui-node-data\').w2tag(null, { id: \'' + nd.id + '\' })"'+
' onmouseout="jQuery(this).find(\'.w2ui-node-data\').w2tag(null, { id: \'' + nd.id + '\' })"'+
' ondblclick="w2ui[\''+ obj.name +'\'].dblClick(\''+ nd.id +'\', event);"'+
' oncontextmenu="w2ui[\''+ obj.name +'\'].contextMenu(\''+ nd.id +'\', event);"'+
' onClick="w2ui[\''+ obj.name +'\'].click(\''+ nd.id +'\', event); ">'+
Expand Down
8 changes: 4 additions & 4 deletions src/w2toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,10 @@
html += '<table cellpadding="0" cellspacing="0" '+ (this.tooltip == 'normal' && item.tooltip != null ? 'title="'+ w2utils.lang(item.tooltip) +'"' : '') +
' class="w2ui-button '+ (item.checked ? 'checked' : '') +'" '+
' onclick = "var el=w2ui[\''+ this.name + '\']; if (el) el.click(\''+ item.id +'\', event);" '+
' onmouseover = "' + (!item.disabled ? "$(this).addClass('over'); w2ui['"+ this.name +"'].tooltipShow('"+ item.id +"', event);" : "") + '"'+
' onmouseout = "' + (!item.disabled ? "$(this).removeClass('over').removeClass('down'); w2ui['"+ this.name +"'].tooltipHide('"+ item.id +"', event);" : "") + '"'+
' onmousedown = "' + (!item.disabled ? "$(this).addClass('down');" : "") + '"'+
' onmouseup = "' + (!item.disabled ? "$(this).removeClass('down');" : "") + '"'+
' onmouseover = "' + (!item.disabled ? "jQuery(this).addClass('over'); w2ui['"+ this.name +"'].tooltipShow('"+ item.id +"', event);" : "") + '"'+
' onmouseout = "' + (!item.disabled ? "jQuery(this).removeClass('over').removeClass('down'); w2ui['"+ this.name +"'].tooltipHide('"+ item.id +"', event);" : "") + '"'+
' onmousedown = "' + (!item.disabled ? "jQuery(this).addClass('down');" : "") + '"'+
' onmouseup = "' + (!item.disabled ? "jQuery(this).removeClass('down');" : "") + '"'+
'><tbody>'+
'<tr><td>'+
' <table cellpadding="1" cellspacing="0"><tbody>'+
Expand Down
9 changes: 6 additions & 3 deletions src/w2utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1581,6 +1581,7 @@ w2utils.formatters = {
w2utils.event = {

on: function (edata, handler) {
var $ = jQuery;
// allow 'eventName:after' syntax
if (typeof edata == 'string' && edata.indexOf(':') != -1) {
var tmp = edata.split(':');
Expand All @@ -1600,6 +1601,7 @@ w2utils.event = {
},

off: function (edata, handler) {
var $ = jQuery;
// allow 'eventName:after' syntax
if (typeof edata == 'string' && edata.indexOf(':') != -1) {
var tmp = edata.split(':');
Expand Down Expand Up @@ -1632,6 +1634,7 @@ w2utils.event = {
},

trigger: function (edata) {
var $ = jQuery;
var edata = $.extend({ type: null, phase: 'before', target: null, doneHandlers: [] }, edata, {
isStopped : false,
isCancelled : false,
Expand Down Expand Up @@ -2485,12 +2488,12 @@ w2utils.event = {
'<tr index="'+ f + '" style="'+ (mitem.style ? mitem.style : '') +'" '+ (mitem.tooltip ? 'title="'+ mitem.tooltip +'"' : '') +
' class="'+ bg +' '+ (options.index === f ? 'w2ui-selected' : '') + ' ' + (mitem.disabled === true ? 'w2ui-disabled' : '') +'"'+
' onmousedown="if ('+ (mitem.disabled === true ? 'true' : 'false') + ') return;'+
' $.fn.w2menuDown(event, \''+ f +'\');"'+
' jQuery.fn.w2menuDown(event, \''+ f +'\');"'+
' onmouseout="if ('+ (mitem.disabled === true ? 'true' : 'false') + ') return;'+
' $.fn.w2menuOut(event, \''+ f +'\');"'+
' jQuery.fn.w2menuOut(event, \''+ f +'\');"'+
' onclick="event.stopPropagation(); '+
' if ('+ (mitem.disabled === true ? 'true' : 'false') + ') return;'+
' $.fn.w2menuClick(event, \''+ f +'\');">'+
' jQuery.fn.w2menuClick(event, \''+ f +'\');">'+
imgd +
' <td class="menu-text" colspan="'+ colspan +'">'+ txt +'</td>'+
' <td class="menu-count">'+
Expand Down
Loading

0 comments on commit 466ec61

Please sign in to comment.