mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
various minor cleanups
This commit is contained in:
parent
e9c116cd7a
commit
192700fd26
|
@ -27,7 +27,7 @@ $(document).ready( function() {
|
||||||
/* change the color and length of the bar graph showing the password
|
/* change the color and length of the bar graph showing the password
|
||||||
* strength on each change to the passwod field.
|
* strength on each change to the passwod field.
|
||||||
*/
|
*/
|
||||||
$(".pwd").passStrength({
|
$(".pwd").passStrength({ /* {{{ */
|
||||||
url: "../op/op.Ajax.php",
|
url: "../op/op.Ajax.php",
|
||||||
onChange: function(data, target) {
|
onChange: function(data, target) {
|
||||||
pwsp = 100*data.score;
|
pwsp = 100*data.score;
|
||||||
|
@ -40,10 +40,10 @@ $(document).ready( function() {
|
||||||
$('#'+target+' div.bar').addClass('bar-danger');
|
$('#'+target+' div.bar').addClass('bar-danger');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}); /* }}} */
|
||||||
|
|
||||||
/* The typeahead functionality useѕ the rest api */
|
/* The typeahead functionality useѕ the rest api */
|
||||||
$("#searchfield").typeahead({
|
$("#searchfield").typeahead({ /* {{{ */
|
||||||
minLength: 3,
|
minLength: 3,
|
||||||
source: function(query, process) {
|
source: function(query, process) {
|
||||||
$.get('../restapi/index.php/search', { query: query, limit: 8, mode: 'typeahead' }, function(data) {
|
$.get('../restapi/index.php/search', { query: query, limit: 8, mode: 'typeahead' }, function(data) {
|
||||||
|
@ -69,10 +69,10 @@ $(document).ready( function() {
|
||||||
else
|
else
|
||||||
return '<i class="icon-search"></i> ' + item.substring(1);
|
return '<i class="icon-search"></i> ' + item.substring(1);
|
||||||
}
|
}
|
||||||
});
|
}); /* }}} */
|
||||||
|
|
||||||
/* Document chooser */
|
/* Document chooser */
|
||||||
$("[id^=choosedocsearch]").typeahead({
|
$("[id^=choosedocsearch]").typeahead({ /* {{{ */
|
||||||
minLength: 3,
|
minLength: 3,
|
||||||
source: function(query, process) {
|
source: function(query, process) {
|
||||||
// console.log(this.options);
|
// console.log(this.options);
|
||||||
|
@ -97,10 +97,10 @@ $(document).ready( function() {
|
||||||
strarr = item.split("#");
|
strarr = item.split("#");
|
||||||
return '<i class="icon-file"></i> ' + strarr[1];
|
return '<i class="icon-file"></i> ' + strarr[1];
|
||||||
}
|
}
|
||||||
});
|
}); /* }}} */
|
||||||
|
|
||||||
/* Folder chooser */
|
/* Folder chooser */
|
||||||
$("[id^=choosefoldersearch]").typeahead({
|
$("[id^=choosefoldersearch]").typeahead({ /* {{{ */
|
||||||
minLength: 3,
|
minLength: 3,
|
||||||
source: function(query, process) {
|
source: function(query, process) {
|
||||||
// console.log(this.options);
|
// console.log(this.options);
|
||||||
|
@ -126,9 +126,9 @@ $(document).ready( function() {
|
||||||
strarr = item.split("#");
|
strarr = item.split("#");
|
||||||
return '<i class="icon-folder-close-alt"></i> ' + strarr[1];
|
return '<i class="icon-folder-close-alt"></i> ' + strarr[1];
|
||||||
}
|
}
|
||||||
});
|
}); /* }}} */
|
||||||
|
|
||||||
$('body').on('click', 'a.addtoclipboard', function(ev){
|
$('body').on('click', 'a.addtoclipboard', function(ev) { /* {{{ */
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
attr_rel = $(ev.currentTarget).attr('rel');
|
attr_rel = $(ev.currentTarget).attr('rel');
|
||||||
attr_msg = $(ev.currentTarget).attr('msg');
|
attr_msg = $(ev.currentTarget).attr('msg');
|
||||||
|
@ -162,9 +162,9 @@ $(document).ready( function() {
|
||||||
},
|
},
|
||||||
'json'
|
'json'
|
||||||
);
|
);
|
||||||
});
|
}); /* }}} */
|
||||||
|
|
||||||
$('body').on('click', 'a.removefromclipboard', function(ev){
|
$('body').on('click', 'a.removefromclipboard', function(ev){ /* {{{ */
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
attr_rel = $(ev.currentTarget).attr('rel');
|
attr_rel = $(ev.currentTarget).attr('rel');
|
||||||
attr_msg = $(ev.currentTarget).attr('msg');
|
attr_msg = $(ev.currentTarget).attr('msg');
|
||||||
|
@ -198,9 +198,9 @@ $(document).ready( function() {
|
||||||
},
|
},
|
||||||
'json'
|
'json'
|
||||||
);
|
);
|
||||||
});
|
}); /* }}} */
|
||||||
|
|
||||||
$('body').on('click', 'a.lock-document-btn', function(ev){
|
$('body').on('click', 'a.lock-document-btn', function(ev){ /* {{{ */
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
attr_rel = $(ev.currentTarget).attr('rel');
|
attr_rel = $(ev.currentTarget).attr('rel');
|
||||||
attr_msg = $(ev.currentTarget).attr('msg');
|
attr_msg = $(ev.currentTarget).attr('msg');
|
||||||
|
@ -232,9 +232,9 @@ $(document).ready( function() {
|
||||||
},
|
},
|
||||||
'json'
|
'json'
|
||||||
);
|
);
|
||||||
});
|
}); /* }}} */
|
||||||
|
|
||||||
$('a.movefolder').click(function(ev){
|
$('a.movefolder').click(function(ev){ /* {{{ */
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
attr_source = $(ev.currentTarget).attr('source');
|
attr_source = $(ev.currentTarget).attr('source');
|
||||||
attr_dest = $(ev.currentTarget).attr('dest');
|
attr_dest = $(ev.currentTarget).attr('dest');
|
||||||
|
@ -257,9 +257,9 @@ $(document).ready( function() {
|
||||||
},
|
},
|
||||||
'json'
|
'json'
|
||||||
);
|
);
|
||||||
});
|
}); /* }}} */
|
||||||
|
|
||||||
$('a.movedocument').click(function(ev){
|
$('a.movedocument').click(function(ev){ /* {{{ */
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
attr_source = $(ev.currentTarget).attr('source');
|
attr_source = $(ev.currentTarget).attr('source');
|
||||||
attr_dest = $(ev.currentTarget).attr('dest');
|
attr_dest = $(ev.currentTarget).attr('dest');
|
||||||
|
@ -282,9 +282,9 @@ $(document).ready( function() {
|
||||||
},
|
},
|
||||||
'json'
|
'json'
|
||||||
);
|
);
|
||||||
});
|
}); /* }}} */
|
||||||
|
|
||||||
$('.send-missing-translation a').click(function(ev){
|
$('.send-missing-translation a').click(function(ev){ /* {{{ */
|
||||||
// console.log($(ev.target).parent().children('[name=missing-lang-key]').val());
|
// console.log($(ev.target).parent().children('[name=missing-lang-key]').val());
|
||||||
// console.log($(ev.target).parent().children('[name=missing-lang-lang]').val());
|
// console.log($(ev.target).parent().children('[name=missing-lang-lang]').val());
|
||||||
// console.log($(ev.target).parent().children('[name=missing-lang-translation]').val());
|
// console.log($(ev.target).parent().children('[name=missing-lang-translation]').val());
|
||||||
|
@ -310,7 +310,7 @@ $(document).ready( function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}); /* }}} */
|
||||||
|
|
||||||
$(document).on('change', '.btn-file :file', function() {
|
$(document).on('change', '.btn-file :file', function() {
|
||||||
var input = $(this),
|
var input = $(this),
|
||||||
|
@ -350,6 +350,7 @@ $(document).ready( function() {
|
||||||
$(".chzn-select").chosen();
|
$(".chzn-select").chosen();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('div.ajax').on('update', function(event, param1) {
|
$('div.ajax').on('update', function(event, param1) {
|
||||||
var element = $(this);
|
var element = $(this);
|
||||||
var url = '';
|
var url = '';
|
||||||
|
@ -374,6 +375,7 @@ $(document).ready( function() {
|
||||||
$(".chzn-select").chosen();
|
$(".chzn-select").chosen();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("body").on("click", ".ajax-click", function() {
|
$("body").on("click", ".ajax-click", function() {
|
||||||
var element = $(this);
|
var element = $(this);
|
||||||
var url = element.data('href')+"?"+element.data('param1');
|
var url = element.data('href')+"?"+element.data('param1');
|
||||||
|
@ -391,12 +393,7 @@ $(document).ready( function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function allowDrop(ev) {
|
function onAddClipboard(ev) { /* {{{ */
|
||||||
ev.preventDefault();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onAddClipboard(ev) {
|
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
source_type = ev.originalEvent.dataTransfer.getData("type");
|
source_type = ev.originalEvent.dataTransfer.getData("type");
|
||||||
source_id = ev.originalEvent.dataTransfer.getData("id");
|
source_id = ev.originalEvent.dataTransfer.getData("id");
|
||||||
|
@ -431,9 +428,9 @@ function onAddClipboard(ev) {
|
||||||
//url = "../op/op.AddToClipboard.php?id="+source_id+"&type="+source_type;
|
//url = "../op/op.AddToClipboard.php?id="+source_id+"&type="+source_type;
|
||||||
//document.location = url;
|
//document.location = url;
|
||||||
}
|
}
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
(function( SeedDMSUpload, $, undefined ) {
|
(function( SeedDMSUpload, $, undefined ) { /* {{{ */
|
||||||
var ajaxurl = "../op/op.Ajax.php";
|
var ajaxurl = "../op/op.Ajax.php";
|
||||||
var editBtnLabel = "Edit";
|
var editBtnLabel = "Edit";
|
||||||
var abortBtnLabel = "Abort";
|
var abortBtnLabel = "Abort";
|
||||||
|
@ -586,7 +583,7 @@ function onAddClipboard(ev) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}( window.SeedDMSUpload = window.SeedDMSUpload || {}, jQuery ));
|
}( window.SeedDMSUpload = window.SeedDMSUpload || {}, jQuery )); /* }}} */
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var obj = $("#dragandrophandler");
|
var obj = $("#dragandrophandler");
|
||||||
|
@ -611,22 +608,21 @@ $(document).ready(function() {
|
||||||
SeedDMSUpload.handleFileUpload(files,obj);
|
SeedDMSUpload.handleFileUpload(files,obj);
|
||||||
});
|
});
|
||||||
|
|
||||||
var folder = $(".table-row-folder");
|
$(document).on('dragenter', '.table-row-folder', function (e) {
|
||||||
folder.on('dragenter', function (e) {
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(e.currentTarget).css('border', '2px dashed #0B85A1');
|
$(e.currentTarget).css('border', '2px dashed #0B85A1');
|
||||||
});
|
});
|
||||||
folder.on('dragleave', function (e) {
|
$(document).on('dragleave', '.table-row-folder', function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(e.currentTarget).css('border', '0px solid white');
|
$(e.currentTarget).css('border', '0px solid white');
|
||||||
});
|
});
|
||||||
folder.on('dragover', function (e) {
|
$(document).on('dragover', '.table-row-folder', function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
folder.on('drop', function (e) {
|
$(document).on('drop', '.table-row-folder', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
attr_rel = $(e.currentTarget).attr('rel');
|
attr_rel = $(e.currentTarget).attr('rel');
|
||||||
|
@ -642,7 +638,7 @@ $(document).ready(function() {
|
||||||
document.location = url;
|
document.location = url;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
folder.on('dragstart', function (e) {
|
$(document).on('dragstart', '.table-row-folder', function (e) {
|
||||||
attr_rel = $(e.target).attr('rel');
|
attr_rel = $(e.target).attr('rel');
|
||||||
if(typeof attr_rel == 'undefined')
|
if(typeof attr_rel == 'undefined')
|
||||||
return;
|
return;
|
||||||
|
@ -650,8 +646,7 @@ $(document).ready(function() {
|
||||||
e.originalEvent.dataTransfer.setData("type","folder");
|
e.originalEvent.dataTransfer.setData("type","folder");
|
||||||
});
|
});
|
||||||
|
|
||||||
var doc = $(".table-row-document");
|
$(document).on('dragstart', '.table-row-document', function (e) {
|
||||||
doc.on('dragstart', function (e) {
|
|
||||||
attr_rel = $(e.target).attr('rel');
|
attr_rel = $(e.target).attr('rel');
|
||||||
if(typeof attr_rel == 'undefined')
|
if(typeof attr_rel == 'undefined')
|
||||||
return;
|
return;
|
||||||
|
@ -659,19 +654,19 @@ $(document).ready(function() {
|
||||||
e.originalEvent.dataTransfer.setData("type","document");
|
e.originalEvent.dataTransfer.setData("type","document");
|
||||||
});
|
});
|
||||||
|
|
||||||
var clipboard = $("#main-clipboard div.alert");
|
/* Dropping item on alert below clipboard */
|
||||||
clipboard.on('dragenter', function (e) {
|
$(document).on('dragenter', '#main-clipboard div.alert', function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(this).css('border', '2px dashed #0B85A1');
|
$(this).css('border', '2px dashed #0B85A1');
|
||||||
});
|
});
|
||||||
clipboard.on('dragleave', function (e) {
|
$(document).on('dragleave', '#main-clipboard div.alert', function (e) {
|
||||||
$(this).css('border', '0px solid white');
|
$(this).css('border', '0px solid white');
|
||||||
});
|
});
|
||||||
clipboard.on('dragover', function (e) {
|
$(document).on('dragover', '#main-clipboard div.alert', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
clipboard.on('drop', function (e) {
|
$(document).on('drop', '#main-clipboard div.alert', function (e) {
|
||||||
$(this).css('border', '0px dotted #0B85A1');
|
$(this).css('border', '0px dotted #0B85A1');
|
||||||
onAddClipboard(e);
|
onAddClipboard(e);
|
||||||
});
|
});
|
||||||
|
@ -680,7 +675,7 @@ $(document).ready(function() {
|
||||||
attr_rel = $(e.srcElement).attr('rel');
|
attr_rel = $(e.srcElement).attr('rel');
|
||||||
if(typeof attr_rel == 'undefined')
|
if(typeof attr_rel == 'undefined')
|
||||||
return;
|
return;
|
||||||
$(e.srcElement).parent().css('border', '2px dashed #0B85A1');
|
$(e.target).parent().css('border', '2px dashed #0B85A1');
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
@ -688,7 +683,7 @@ $(document).ready(function() {
|
||||||
attr_rel = $(e.srcElement).attr('rel');
|
attr_rel = $(e.srcElement).attr('rel');
|
||||||
if(typeof attr_rel == 'undefined')
|
if(typeof attr_rel == 'undefined')
|
||||||
return;
|
return;
|
||||||
$(e.srcElement).parent().css('border', '0px solid white');
|
$(e.target).parent().css('border', '0px solid white');
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
@ -699,7 +694,7 @@ $(document).ready(function() {
|
||||||
$("#jqtree").on('drop', function (e) {
|
$("#jqtree").on('drop', function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
attr_rel = $(e.srcElement).attr('rel');
|
attr_rel = $(e.target).attr('rel');
|
||||||
if(typeof attr_rel == 'undefined')
|
if(typeof attr_rel == 'undefined')
|
||||||
return;
|
return;
|
||||||
target_type = attr_rel.split("_")[0];
|
target_type = attr_rel.split("_")[0];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user