mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +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
|
||||
* strength on each change to the passwod field.
|
||||
*/
|
||||
$(".pwd").passStrength({
|
||||
$(".pwd").passStrength({ /* {{{ */
|
||||
url: "../op/op.Ajax.php",
|
||||
onChange: function(data, target) {
|
||||
pwsp = 100*data.score;
|
||||
|
@ -40,10 +40,10 @@ $(document).ready( function() {
|
|||
$('#'+target+' div.bar').addClass('bar-danger');
|
||||
}
|
||||
}
|
||||
});
|
||||
}); /* }}} */
|
||||
|
||||
/* The typeahead functionality useѕ the rest api */
|
||||
$("#searchfield").typeahead({
|
||||
$("#searchfield").typeahead({ /* {{{ */
|
||||
minLength: 3,
|
||||
source: function(query, process) {
|
||||
$.get('../restapi/index.php/search', { query: query, limit: 8, mode: 'typeahead' }, function(data) {
|
||||
|
@ -69,10 +69,10 @@ $(document).ready( function() {
|
|||
else
|
||||
return '<i class="icon-search"></i> ' + item.substring(1);
|
||||
}
|
||||
});
|
||||
}); /* }}} */
|
||||
|
||||
/* Document chooser */
|
||||
$("[id^=choosedocsearch]").typeahead({
|
||||
$("[id^=choosedocsearch]").typeahead({ /* {{{ */
|
||||
minLength: 3,
|
||||
source: function(query, process) {
|
||||
// console.log(this.options);
|
||||
|
@ -97,10 +97,10 @@ $(document).ready( function() {
|
|||
strarr = item.split("#");
|
||||
return '<i class="icon-file"></i> ' + strarr[1];
|
||||
}
|
||||
});
|
||||
}); /* }}} */
|
||||
|
||||
/* Folder chooser */
|
||||
$("[id^=choosefoldersearch]").typeahead({
|
||||
$("[id^=choosefoldersearch]").typeahead({ /* {{{ */
|
||||
minLength: 3,
|
||||
source: function(query, process) {
|
||||
// console.log(this.options);
|
||||
|
@ -126,9 +126,9 @@ $(document).ready( function() {
|
|||
strarr = item.split("#");
|
||||
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();
|
||||
attr_rel = $(ev.currentTarget).attr('rel');
|
||||
attr_msg = $(ev.currentTarget).attr('msg');
|
||||
|
@ -162,9 +162,9 @@ $(document).ready( function() {
|
|||
},
|
||||
'json'
|
||||
);
|
||||
});
|
||||
}); /* }}} */
|
||||
|
||||
$('body').on('click', 'a.removefromclipboard', function(ev){
|
||||
$('body').on('click', 'a.removefromclipboard', function(ev){ /* {{{ */
|
||||
ev.preventDefault();
|
||||
attr_rel = $(ev.currentTarget).attr('rel');
|
||||
attr_msg = $(ev.currentTarget).attr('msg');
|
||||
|
@ -198,9 +198,9 @@ $(document).ready( function() {
|
|||
},
|
||||
'json'
|
||||
);
|
||||
});
|
||||
}); /* }}} */
|
||||
|
||||
$('body').on('click', 'a.lock-document-btn', function(ev){
|
||||
$('body').on('click', 'a.lock-document-btn', function(ev){ /* {{{ */
|
||||
ev.preventDefault();
|
||||
attr_rel = $(ev.currentTarget).attr('rel');
|
||||
attr_msg = $(ev.currentTarget).attr('msg');
|
||||
|
@ -232,9 +232,9 @@ $(document).ready( function() {
|
|||
},
|
||||
'json'
|
||||
);
|
||||
});
|
||||
}); /* }}} */
|
||||
|
||||
$('a.movefolder').click(function(ev){
|
||||
$('a.movefolder').click(function(ev){ /* {{{ */
|
||||
ev.preventDefault();
|
||||
attr_source = $(ev.currentTarget).attr('source');
|
||||
attr_dest = $(ev.currentTarget).attr('dest');
|
||||
|
@ -257,9 +257,9 @@ $(document).ready( function() {
|
|||
},
|
||||
'json'
|
||||
);
|
||||
});
|
||||
}); /* }}} */
|
||||
|
||||
$('a.movedocument').click(function(ev){
|
||||
$('a.movedocument').click(function(ev){ /* {{{ */
|
||||
ev.preventDefault();
|
||||
attr_source = $(ev.currentTarget).attr('source');
|
||||
attr_dest = $(ev.currentTarget).attr('dest');
|
||||
|
@ -282,9 +282,9 @@ $(document).ready( function() {
|
|||
},
|
||||
'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-lang]').val());
|
||||
// console.log($(ev.target).parent().children('[name=missing-lang-translation]').val());
|
||||
|
@ -310,8 +310,8 @@ $(document).ready( function() {
|
|||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}); /* }}} */
|
||||
|
||||
$(document).on('change', '.btn-file :file', function() {
|
||||
var input = $(this),
|
||||
numFiles = input.get(0).files ? input.get(0).files.length : 1,
|
||||
|
@ -322,7 +322,7 @@ $(document).ready( function() {
|
|||
$('#upload-files').on('fileselect', '.btn-file :file', function(event, numFiles, label) {
|
||||
var input = $(this).parents('.input-append').find(':text'),
|
||||
log = numFiles > 1 ? numFiles + ' files selected' : label;
|
||||
|
||||
|
||||
if( input.length ) {
|
||||
input.val(log);
|
||||
} else {
|
||||
|
@ -350,6 +350,7 @@ $(document).ready( function() {
|
|||
$(".chzn-select").chosen();
|
||||
});
|
||||
});
|
||||
|
||||
$('div.ajax').on('update', function(event, param1) {
|
||||
var element = $(this);
|
||||
var url = '';
|
||||
|
@ -374,6 +375,7 @@ $(document).ready( function() {
|
|||
$(".chzn-select").chosen();
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on("click", ".ajax-click", function() {
|
||||
var element = $(this);
|
||||
var url = element.data('href')+"?"+element.data('param1');
|
||||
|
@ -389,14 +391,9 @@ $(document).ready( function() {
|
|||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function allowDrop(ev) {
|
||||
ev.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
function onAddClipboard(ev) {
|
||||
function onAddClipboard(ev) { /* {{{ */
|
||||
ev.preventDefault();
|
||||
source_type = ev.originalEvent.dataTransfer.getData("type");
|
||||
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;
|
||||
//document.location = url;
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
(function( SeedDMSUpload, $, undefined ) {
|
||||
(function( SeedDMSUpload, $, undefined ) { /* {{{ */
|
||||
var ajaxurl = "../op/op.Ajax.php";
|
||||
var editBtnLabel = "Edit";
|
||||
var abortBtnLabel = "Abort";
|
||||
|
@ -460,7 +457,7 @@ function onAddClipboard(ev) {
|
|||
SeedDMSUpload.setMaxFileSizeMsg = function(msg) {
|
||||
maxFileSizeMsg = msg;
|
||||
}
|
||||
|
||||
|
||||
function sendFileToServer(formData,status) {
|
||||
formData.append('command', 'uploaddocument');
|
||||
var uploadURL = ajaxurl; //Upload URL
|
||||
|
@ -513,7 +510,7 @@ function onAddClipboard(ev) {
|
|||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
status.setAbort(jqXHR);
|
||||
}
|
||||
|
@ -543,8 +540,8 @@ function onAddClipboard(ev) {
|
|||
this.filename.html(name);
|
||||
this.size.html(sizeStr);
|
||||
}
|
||||
this.setProgress = function(progress) {
|
||||
var progressBarWidth =progress*this.progressBar.width()/ 100;
|
||||
this.setProgress = function(progress) {
|
||||
var progressBarWidth =progress*this.progressBar.width()/ 100;
|
||||
this.progressBar.find('div').animate({ width: progressBarWidth }, 10).html(progress + "% ");
|
||||
if(parseInt(progress) >= 100) {
|
||||
this.abort.hide();
|
||||
|
@ -586,7 +583,7 @@ function onAddClipboard(ev) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}( window.SeedDMSUpload = window.SeedDMSUpload || {}, jQuery ));
|
||||
}( window.SeedDMSUpload = window.SeedDMSUpload || {}, jQuery )); /* }}} */
|
||||
|
||||
$(document).ready(function() {
|
||||
var obj = $("#dragandrophandler");
|
||||
|
@ -611,22 +608,21 @@ $(document).ready(function() {
|
|||
SeedDMSUpload.handleFileUpload(files,obj);
|
||||
});
|
||||
|
||||
var folder = $(".table-row-folder");
|
||||
folder.on('dragenter', function (e) {
|
||||
$(document).on('dragenter', '.table-row-folder', function (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
$(e.currentTarget).css('border', '2px dashed #0B85A1');
|
||||
});
|
||||
folder.on('dragleave', function (e) {
|
||||
$(document).on('dragleave', '.table-row-folder', function (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
$(e.currentTarget).css('border', '0px solid white');
|
||||
});
|
||||
folder.on('dragover', function (e) {
|
||||
$(document).on('dragover', '.table-row-folder', function (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
folder.on('drop', function (e) {
|
||||
$(document).on('drop', '.table-row-folder', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
attr_rel = $(e.currentTarget).attr('rel');
|
||||
|
@ -642,7 +638,7 @@ $(document).ready(function() {
|
|||
document.location = url;
|
||||
}
|
||||
});
|
||||
folder.on('dragstart', function (e) {
|
||||
$(document).on('dragstart', '.table-row-folder', function (e) {
|
||||
attr_rel = $(e.target).attr('rel');
|
||||
if(typeof attr_rel == 'undefined')
|
||||
return;
|
||||
|
@ -650,8 +646,7 @@ $(document).ready(function() {
|
|||
e.originalEvent.dataTransfer.setData("type","folder");
|
||||
});
|
||||
|
||||
var doc = $(".table-row-document");
|
||||
doc.on('dragstart', function (e) {
|
||||
$(document).on('dragstart', '.table-row-document', function (e) {
|
||||
attr_rel = $(e.target).attr('rel');
|
||||
if(typeof attr_rel == 'undefined')
|
||||
return;
|
||||
|
@ -659,19 +654,19 @@ $(document).ready(function() {
|
|||
e.originalEvent.dataTransfer.setData("type","document");
|
||||
});
|
||||
|
||||
var clipboard = $("#main-clipboard div.alert");
|
||||
clipboard.on('dragenter', function (e) {
|
||||
/* Dropping item on alert below clipboard */
|
||||
$(document).on('dragenter', '#main-clipboard div.alert', function (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
$(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');
|
||||
});
|
||||
clipboard.on('dragover', function (e) {
|
||||
$(document).on('dragover', '#main-clipboard div.alert', function (e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
clipboard.on('drop', function (e) {
|
||||
$(document).on('drop', '#main-clipboard div.alert', function (e) {
|
||||
$(this).css('border', '0px dotted #0B85A1');
|
||||
onAddClipboard(e);
|
||||
});
|
||||
|
@ -680,7 +675,7 @@ $(document).ready(function() {
|
|||
attr_rel = $(e.srcElement).attr('rel');
|
||||
if(typeof attr_rel == 'undefined')
|
||||
return;
|
||||
$(e.srcElement).parent().css('border', '2px dashed #0B85A1');
|
||||
$(e.target).parent().css('border', '2px dashed #0B85A1');
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
@ -688,7 +683,7 @@ $(document).ready(function() {
|
|||
attr_rel = $(e.srcElement).attr('rel');
|
||||
if(typeof attr_rel == 'undefined')
|
||||
return;
|
||||
$(e.srcElement).parent().css('border', '0px solid white');
|
||||
$(e.target).parent().css('border', '0px solid white');
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
@ -699,7 +694,7 @@ $(document).ready(function() {
|
|||
$("#jqtree").on('drop', function (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
attr_rel = $(e.srcElement).attr('rel');
|
||||
attr_rel = $(e.target).attr('rel');
|
||||
if(typeof attr_rel == 'undefined')
|
||||
return;
|
||||
target_type = attr_rel.split("_")[0];
|
||||
|
@ -729,4 +724,4 @@ $(document).ready(function() {
|
|||
timeout: (typeof timeout == 'undefined' ? 1500 : timeout),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user