Jump to content

jimfog

Members
  • Posts

    1,803
  • Joined

  • Last visited

2 Followers

About jimfog

  • Birthday 10/28/1979

Previous Fields

  • Languages
    Englsh, Greek

Contact Methods

  • MSN
    papageorgiou40@hotmail.com

Profile Information

  • Location
    Athens, Greece
  • Interests
    Computing, in any form of it, whether is web development, control theory or other, enjoy reading history books, especially WWII books, movies, fast cars(i do not have one, just a humble toyota yaris).

Recent Profile Visitors

28,234 profile views

jimfog's Achievements

Dedicated Member

Dedicated Member (4/7)

31

Reputation

  1. Take a look at these 3 classes: var EventDragging = /** @class */ (function (_super) { __extends(EventDragging, _super);//it seems this code sets the obj prototype function EventDragging(settings) { var _this = _super.call(this, settings) || this; //some props here _this.handlePointerDown = function (ev) { }; var hitDragging = _this.hitDragging = new HitDragging(_this.dragging, interactionSettingsStore); hitDragging.emitter.on('pointerdown', _this.handlePointerDown); return _this; } return EventDragging; }(Interaction)); var Emitter = /** @class */ (function () { function Emitter() { this.handlers = {}; this.thisContext = null; } Emitter.prototype.on = function (type, handler) { addToHash(this.handlers, type, handler); }; Emitter.prototype.trigger = function (type) {//η select callback μαλλον πυροδοτειται απο εδω var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } var attachedHandlers = this.handlers[type] || []; var optionHandler = this.options && this.options[type]; var handlers = [].concat(optionHandler || [], attachedHandlers); for (var _a = 0, handlers_1 = handlers; _a < handlers_1.length; _a++) { var handler = handlers_1[_a]; handler.apply(this.thisContext, args);//handler called here } }; return Emitter; }()); var HitDragging = /** @class */ (function () { function HitDragging(dragging, droppableStore) { var _this = this; this.handlePointerDown = function (ev) { _this.emitter.trigger('pointerdown', ev);//goes to pointerdown method of EvenDragging Class }; } }; return HitDragging; }()); Inside the EventDragging class a new Instance of HitDragging class is created....and a listener attached(on)...this patter is event/emitter patter from Node.js and since this is not node a polyfill is made-look at the on method inside the emitter class. The code for triggering the handlePointerDown method inside the EventDragging class is found inside the HitDragging class..in the trigger method call(also taken from the emitter class) The codebase I study has various instances of The HitDragging class-in the above example you see one of them Each time a different instance is accesed-the value of this references(depending on some factors) a different instance of the Htdragging class. Despite searching extensively I have not found the code responsible for this reference change.-furthermore there is nowhere a bind method or arrow function to set the reference accordingly. Keep in must that this code is an emulation of event emiiter patter(pub/sub) found in node. Node has native functions for the above(on/trigger method). Any idea as to where I shoud direct my search...a clue maybe.
  2. The solution is questionable...so any suggestions are welcome.
  3. On top of my PHP scripts I have session checking code: if (!isset($_SESSION['regular_user'])) { if ((isset($_COOKIE['cookiename']))) {// check for existense of persistent cookie (the user ticked the remember me option) } else { header("Location: ../Frontend/login.php"); } } I am using also Facebook Social Login(JS SDK)...and on every page I must check also if the user is connected to my App. Than means JS code-Facebook API request and ajax request to create sessions. Js cannot be placed on top of the page before PHP session code. What are my alternatives? The only solution I have found so far is to put the ajax request/FB api call inside a PHP script that is required in the page that contains the above code...along w the HTML of course. What do you think?
  4. Yes it seems redundant...but as you imply there is no point investigating further...since modern JS provides native inheritance functionality. And with the above our discussion is cncluded..thanks.
  5. I think yours answer explains things very good...there is one last point that I would like to be clarified cause it creates confusion to me. So inheritance in old JS is achieved with these 2 steps... If there is sth I do not understand is why to use setObjectPrototype in th first place...after testing the code it seems clear that the "bulk" of the work is done from the second part..(dymmy constructor etc). I just want some last comments on this...THX.
  6. well...object.setPrototypeof seems to work only w objects...but. I do not know if you are familiar with the extends pollyfill(it simulates class inheritance)....ES6 made it native https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/extends One post about _extends pollyfill is here https://stackoverflow.com/questions/45954157/understanding-the-extends-function-generated-by-typescript Go where it says about Note 2. By reading it you will reach the conclusion that setPrototypeof accepts constructor functions as arguments which does not make sense...since as you said and according to mdn accepts only objects. WHat do you think?
  7. I am trying to use objectSetPrototype. here is the code w 2 classes var A = /** @class */ (function () { function A() { this.name='6'; } A.prototype.test=function() { return 'john'; }; return A; }()); var B = /** @class */ (function (_super) { function B() { return _super !== null && _super.apply(this, arguments) || this; } B.prototype.othertest=function(){return 'Anna'}; return B; }(A)); Object.setPrototypeOf(B,A); var testInheritance=new B(); console.log(testInheritance.test()); nonetheless testInheritance.test() does not print in the console "john" as it should...no inheritance taking place. I get the following mesaage in the console: Uncaught TypeError: testInheritance.test is not a function Furthermore:It is interesrting to see what B.prototype prints in the console https://1drv.ms/u/s!AjCBrCpLQye-ihUHb_9Ta5FLkDXp?e=FiIsAn Take a look at the red arrow it points to the [[prototype]] and confirms that f A() was set as prototype...nonetheless as already said inheritance is not taking place I Cannot call test() which is a method f A-after instantiating B of course.
  8. that did,,,not used to in applying the rules of logic in sql...probably you might say that they no differ from other languages and you would be right....anyway..tnanks.
  9. take a look at this query...it has a series of AND clasues..pay attention to the 3rd commented..it sums up what I want to do. SELECT lastname,city FROM users INNER JOIN business_users ON business_users.user_ID=users.user_ID WHERE users.active=1 AND business_users.sched_entered =1 AND business_users.services_entered=1 --and business.users.staff_entered=1 only if business.users.sraff_enfaged_in_appt=1 AND lastname LIKE 'p%'; I want to ask as prerequisite business.users.staff_entered ONLY if business.users.sraff_enfaged_in_appt column is true. How I would go about achieving that?
  10. unless my provider gives me a static IP..correct?
  11. I know that apache with htaccess offers the choice of allowing access to a site only from one IP. The question is if this has any sense if the allowed IP is dynamic?
  12. Ok...I will put it this way in case I was not specific. The user might put whatever value he/she likes...even values not matching any value from the menu....and he leaves the value there in the input with no selection making....that is undesirable but in the case of autocomplete scenarios we are examining probable..entering a custom value and NOT choosing from the menu. Unless I miss sth in the above logic. In case I confused you sorry...what I am trying to say is that I must find a way to enforce selection..that is the key here.
  13. well...datalist seems to have some browser incosistencies plus the fact that it has the same drawback search like functionality....the user can enter whatever value he likes. The nice thing about select is that the user can only choose from predefined options but that bad thing is that it is not the best solution when a menu has many choices...in my case about 70.
  14. there is one slight problem though with this "search like" feature. The user can enter an invalid value...a value not included in the medical specialties....whereas with a dropdown menu(select tag) he//she can only enter predefined(valid) values. Any workaround to the above problem?
  15. some clarifications.... You said ajax call for the auto complete...kind like a search feature?...keyword is sent w ajax then query echo the results back. When you say to limit the choice....I suppose you mean what is actually seen by the user....the specialties are 65+ one way or the other. The results appearing(the specialties) must reflect the keyword...and when typing a keyword the user will see only the specialties starting from that keyword....which is less than 10. I do not see a problem with that. From the moment he starts typing the keyword in reality he/she never sees 65 options. I hope it is more clear now...what do you think?
×
×
  • Create New...