Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #19

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open

Dev #19

Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e824a8d
flask server and apis
Jan 28, 2022
072f605
query update
Jan 31, 2022
601d13a
clone button updates
Feb 1, 2022
190e9d3
working copy update draft
mezez Feb 8, 2022
73cf1ab
new working copy
mezez Feb 23, 2022
e3c998b
draft-wip
mezez Feb 24, 2022
b34ad73
remote wikidata clone and scripts update
mezez Mar 3, 2022
86f5579
clone button spacing
mezez Mar 15, 2022
7157a48
additional comments
mezez Apr 4, 2022
e96102b
algorithm updates
mezez Apr 14, 2022
3f54a75
algorithm updates optimised
mezez Apr 14, 2022
b0ccba6
code base cleanup
mezez Apr 19, 2022
4f5f3e7
Merge branch 'master' into remote-autocomplete-and-clone
mezez Apr 19, 2022
74919a3
autocomplete redesign
mezez Apr 26, 2022
e6c63a5
autocomplete redesign fixes
mezez Apr 26, 2022
de4c3d9
remote-autocomplete-and-clone
mezez May 3, 2022
5b370a4
ui enhancement and bug fix
mezez May 9, 2022
9734e2f
api updates and frontend scripts update
mezez May 17, 2022
289fa52
frontend scripts update
mezez May 17, 2022
423a4bb
frontend scripts update
mezez May 17, 2022
43b10ea
frontend scripts update
mezez May 17, 2022
5958e00
bug fix
mezez May 20, 2022
d48f970
add loader
mezez May 30, 2022
871fe9f
wikidata qid and pid sync
mezez Jun 1, 2022
4284aea
wikidata qid and pid sync update
mezez Jun 3, 2022
a8e8fb4
qid and pid sync method update
mezez Jun 3, 2022
ecaa6f9
qid and pid sync method update
mezez Jun 3, 2022
0066076
qid and pid sync method update
mezez Jun 3, 2022
cb5ef66
qid and pid sync method update
mezez Jun 3, 2022
8af7e81
boilter plate extension changes
mezez Jun 21, 2022
cd937c4
boilter plate extension changes
mezez Jun 21, 2022
13c2a35
Extension updates
mezez Jun 22, 2022
8d46dfa
Extension updates
mezez Jun 22, 2022
6f71afd
Extension refactor
mezez Jun 22, 2022
711e90d
only enable extension if user is logged in
mezez Jun 22, 2022
4995775
Merge branch 'master' into remote-autocomplete-and-clone
mezez Jul 6, 2022
363af69
wikibase sync extension updates
mezez Jul 6, 2022
4f63bf8
clear console logs
mezez Jul 6, 2022
fcb16bc
extension updates
mezez Jul 11, 2022
f32c0fa
refactor and updates
mezez Jul 12, 2022
607edde
wikibase extension reversal and updates
mezez Jul 19, 2022
4497a5c
Merge branch 'remote-autocomplete-and-clone' into dev
D063520 Jul 19, 2022
487d6b9
Merge branch 'remote-autocomplete-and-clone' into dev
D063520 Jul 19, 2022
7267504
Clean code that is not needed
D063520 Jul 19, 2022
5cbd6e6
Refactoring code
D063520 Jul 19, 2022
a956a4c
Clean unnecessary comment
D063520 Jul 19, 2022
ff37c49
Refactoring the code
D063520 Jul 19, 2022
55e4011
change sparql class to singleton
mezez Jul 26, 2022
7af2417
Refactoring matching the extention layout and wgServer property grabbed
D063520 Aug 8, 2022
6cf2005
Fix bug related to deplayed autocompletion
D063520 Aug 8, 2022
c917ee9
Clean code
D063520 Aug 8, 2022
32cebf5
Move to new verison of Pywikibot
D063520 Feb 14, 2023
4367d10
Update util.py
D063520 May 23, 2023
918a646
Clean .DS_Store
DiaZork Oct 13, 2023
86af1d1
Adding docker
DiaZork Oct 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
working copy update draft
  • Loading branch information
mezez committed Feb 8, 2022
commit 190e9d3304f1377150d2b94838683161b7775d84
41 changes: 36 additions & 5 deletions wikibase-scripts/working-copy copy.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ var _propertyId = "";
var _propertyLabel = "";

var cloneButtonCounter = 0;
var parentIDCounter = 0;
var autoInputIDCounter = 0;
var propertyDetailArray = [];
var cloneButtonIdPrefix = 'clone_btn_';
var currentlyClickedCloneButtonId = '';
@@ -53,26 +55,55 @@ var _wikibasesync_base_url = "http://127.0.0.1:5000/";
//if (entries.length == 3) {
//console.log(added_node);
focusInput = document.getElementsByClassName("ui-suggester-input ui-entityselector-input")[0].value;
console.log(focusInput);
//console.log(focusInput);

//always remove clone button while typing
//var inputWithSuggestionParent = $('#new .ui-entityselector-input').parent();
$("#new .ui-entityselector-input").on("focus", "", function (e) {
var _focused = $(':focus');
console.log(_focused);
$(':focus').attr('id', 'autoCompleteInput'+autoInputIDCounter);
autoInputIDCounter = autoInputIDCounter + 1;

//find the closest parent that has a button
$(this).closest(':has(button)').attr('id', 'autoCompleteInputParent'+parentIDCounter);
parentIDCounter = parentIDCounter + 1;
});

$("#new .ui-entityselector-input").on("keydown", "", function (e) {
var _focused = $(':focus')
if (_focused.get(0).id === undefined || _focused.get(0).id.length < 5) {
$(':focus').attr('id', 'autoCompleteInput'+autoInputIDCounter);
autoInputIDCounter = autoInputIDCounter + 1;

//find the closest parent that has a button
$(this).closest(':has(button)').attr('id', 'autoCompleteInputParent'+parentIDCounter);
parentIDCounter = parentIDCounter + 1;s
}


var _focused = $(':focus')

console.log(_focused.get(0).id);
console.log("key down");
//$(".mez-appended-button").remove();

//find the closest parent that has a button
var closestParentWithButton = $(this).closest(':has(button)');
var closestCloneButton = closestParentWithButton.children('button')[0];
// var closestCloneButtinId = closestCloneButton.attr('id');
var closestParentWithButtonID = closestParentWithButton.get(0).id;
// closestCloneButton = $(this).parentsUntil(closestParentWithButton).nextAll('button').first();
console.log(closestParentWithButton);
//var closestCloneButton = closestParentWithButton.children('button').eq(0)
var closestCloneButton = $("#"+closestParentWithButtonID).children('button').eq(0)
var closestCloneButtonId = closestCloneButton.get(0).id;

//.parentsUntil(closest) will call all parents until the closest parent that has a button
// .nextAll('button') will call the buttons that comes only next each parents
// .first() will filter the first one that comes next
//see https://stackoverflow.com/questions/23784755/jquery-closest-button-after-input/23785154

//var foundButton = $(this).parentsUntil(closestParentWithButton).nextAll('button').first();
console.log(closestCloneButton);
console.log(closestCloneButtonId);
$("#"+closestCloneButtonId).remove();
});
//}
if (focusInput) {