46 Commits

Author SHA1 Message Date
Barry Hughes
b3119b3157
When adding URLs, new HTML rows should have unique HTML IDs. (#3431)
* When adding URLs, new HTML rows should have unique HTML IDs.
* Fix newly added assertions in Format_General::test_string2htmlid()

Co-authored-by: ྅༻ Ǭɀħ ༄༆ཉ <ozh@ozh.org>
2022-10-04 20:06:48 +02:00
྅༻ Ǭɀħ ༄༆ཉ
b347c36b33
Fix that fucking encoding problem (#2690)
This commit's changelog

- less encode/decode
- update jQuery & remove old ones
- No encoding in JS
- Also, 4 spaces in JS too, duh
- IDN domain functions
- Use mb_ functions to preverse IDN domains
- Support for UTF8MB4
- update install procedure
- update upgrade procedure. Note: The log table will be left untouched by the upgrade, it's impossible to make a convenient upgrade script for thousands of rows. The only problem will be if someone uses UTF8 short URLs (eg `http://sho.rt/éé💩`)
- Handle normalization of IDN domains & tests
- Fix warning on 7.2 and 7.3
- Deal with encoding in bookmarklets
- Enclose upgrade queries in a transaction
- Force no caching upon install or upgrade. Note: Strange behavior: if YOURLS hosted on an IDN domain, browser (FF at least) caches the redirection from admin/index.php to admin/install.php
- Support for IDN YOURLS hosting
- Tests for IDN YOURLS hosting
- Fix code (that will never get run again)
- Don't cache ajax requests
- Remove unnecessary function call
- Add comment doc block
- More IDN sanitizing tests
- IDN : Screw the "open dots". Who's going to type domain。com instead of domain.com anyway? Seriously. (although these do pass on my dev box)
- Deprecate yourls_lowercase_scheme_domain()
- Update doc to reflect DB change
2020-10-10 16:09:36 +02:00
BestNa.me Labs
209e95e093 Correcting title attr. of display_link
Correction in `edit_link_save`:
Plugging in `data.url.title` as (untrimmed) `title` attribute (instead of plugging in `data.url.url`) when setting the variable `display_link`.
2016-03-29 08:47:56 +02:00
BestNa.me Labs
c86e97aeaa Remove an ineffective line of code
Removes an ineffective line of code in `edit_link_save()` with an undefined variable `data.url.date` (this is because `data.url.date` is not set in the function invoked via ajax, i.e. in `yourls_edit_link()` in functions.php).
2016-03-23 20:59:18 +01:00
BestNa.me Labs
af866b3e65 Re-enable actions only if edit-save succeeded
Fixes a flaw in `edit_link_save()` in insert.js:

On exit, `edit_link_save()` re-enables all buttons of the action column, regardless of the value of `status` as returned by the ajax call (`action=edit_save`), i.e. also if the `status` is `fail` which means that the edit row remains visible. Because of that, it is then possible to open another edit row for the same keyword/long URL row. It is even possible to repeat this, introducing an arbitrary number of open edit rows with the same content.
2016-03-22 20:09:38 +01:00
BestNa.me Labs
60931f49c1 Re-enable cancel on exiting edit_link_save()
Fixes a flaw in `edit_link_save()` in insert.js:

On exit, `edit_link_save()` correctly ends the loading state of the cancel button (i.e. the element with id `edit-close-y...`), but leaves the element disabled. This gets evident if and only if the ajax call (`action=edit_save`) returns with a `status` of `fail`, since only then the edit row with the disabled cancel button will not be faded out.
2016-03-21 21:00:04 +01:00
BestNa.me Labs
786ca58707 Reworking decrease_total_clicks( id ) 2016-03-12 08:51:23 +01:00
BestNa.me Labs
323b32734a Added decrease_total_clicks( id ) + call
Added a function `decrease_total_clicks( id )` in js/insert.js which decreases the element containing the number of total clicks on the admin page by the value contained in the element `$('#clicks-' + id)` (i.e. by the value picked from the 'Clicks' column of the respective deleted row). Now called this method at the appropriate place in function `remove_link(id)`, thereby passing on `id` as parameter.
2016-03-10 21:58:58 +01:00
ozh
7346eb23ec Don't prefill empty input field. Fixes #1716.
No need to use a jQuery fallback, by the way.
2014-10-24 17:11:59 +02:00
ozh
d44c196513 Fix search for "http://..."
Fixes #1576, followup to #1512
2014-01-02 14:09:48 +01:00
LeoColomb
3daf6593d8 Fix end of line 2013-04-07 12:52:52 +02:00
Ozh
ad46b96e0e Update jQuery to 1.9.1 (older versions left in case a plugin uses them)
git-svn-id: http://yourls.googlecode.com/svn/trunk@889 12232710-3e20-11de-b438-597f59cd7555
2013-02-19 18:05:29 +00:00
Ozh
c21af711e7 More unique JS function names. Fixes issue 1276. Stupid Chrome.
git-svn-id: http://yourls.googlecode.com/svn/trunk@880 12232710-3e20-11de-b438-597f59cd7555
2013-02-13 10:11:50 +00:00
Ozh
840b145291 Proper use of escaping functions. Fixes issue 1079. Fixes issue 909. Thanks @nic_waller
git-svn-id: http://yourls.googlecode.com/svn/trunk@815 12232710-3e20-11de-b438-597f59cd7555
2012-12-09 22:04:25 +00:00
ozhozh
2e106c666e Toggle share boxes only on successful requests
git-svn-id: http://yourls.googlecode.com/svn/trunk@684 12232710-3e20-11de-b438-597f59cd7555
2011-08-31 19:31:55 +00:00
ozhozh
62bbb82db1 Implementation of the zclip jQuery plugin (a nice ZeroClipboard wrapper)
git-svn-id: http://yourls.googlecode.com/svn/trunk@636 12232710-3e20-11de-b438-597f59cd7555
2011-06-12 18:22:40 +00:00
ozhozh
6c3bb82368 Massive commit
- renamed index_ajax.php to admin-ajax.php: name more accurate, no underscore to avoid error with htaccess RewriteCond (wtf?)
- renamed all parameters "mode" to "action"
- added nonces to Add, Edit, Save, Delete buttons. Fixes issue 425.
- changed behavior & args of yourls_verify_nonce()
- cosmetic tweak in CSS (edit row bg color)
- new function: yourls_site_url() to return YOURLS_SITE with http(s) preference
- comply to SSL pref when loading ressources. Fixes issue 512.
- Ajax URL now echoed in head, complying to SSL pref

git-svn-id: http://yourls.googlecode.com/svn/trunk@511 12232710-3e20-11de-b438-597f59cd7555
2010-10-09 11:41:41 +00:00
ozhozh
5d279803b0 Better display of titles in list and share box. Fixes issue 433. Fixes issue 455.
git-svn-id: http://yourls.googlecode.com/svn/trunk@493 12232710-3e20-11de-b438-597f59cd7555
2010-08-24 11:53:01 +00:00
ozhozh
961430e823 Rename #tblUrl with #main-table. I didn't like it and it didn't always make sense.
git-svn-id: http://yourls.googlecode.com/svn/trunk@475 12232710-3e20-11de-b438-597f59cd7555
2010-08-04 15:22:05 +00:00
ozhozh
cc2c634f73 JS tweaks
git-svn-id: http://yourls.googlecode.com/svn/trunk@446 12232710-3e20-11de-b438-597f59cd7555
2010-07-01 18:51:55 +00:00
ozhozh
6041ca38f7 Remove unwanted console.log()
git-svn-id: http://yourls.googlecode.com/svn/trunk@439 12232710-3e20-11de-b438-597f59cd7555
2010-07-01 13:18:19 +00:00
ozhozh
61d0d14209 - Better handling of feedback message with long strings
- Hopefully better handling of UTF8 titles in pages

git-svn-id: http://yourls.googlecode.com/svn/trunk@438 12232710-3e20-11de-b438-597f59cd7555
2010-07-01 12:33:50 +00:00
ozhozh
503753cd40 Better toggle "No URL found" when no links in DB or when deleting all links
git-svn-id: http://yourls.googlecode.com/svn/trunk@437 12232710-3e20-11de-b438-597f59cd7555
2010-07-01 08:36:25 +00:00
ozhozh
c185ed8018 Minor JS tweakage
git-svn-id: http://yourls.googlecode.com/svn/trunk@429 12232710-3e20-11de-b438-597f59cd7555
2010-06-27 19:08:42 +00:00
ozhozh
33a3bee994 Fix buttons not re-enabled after action
git-svn-id: http://yourls.googlecode.com/svn/trunk@426 12232710-3e20-11de-b438-597f59cd7555
2010-06-27 18:42:42 +00:00
ozhozh
f89d383891 Add a new action button to pop the share box
git-svn-id: http://yourls.googlecode.com/svn/trunk@425 12232710-3e20-11de-b438-597f59cd7555
2010-06-25 21:20:10 +00:00
ozhozh
f19d1c27ba Add click-and-copy stuff to Share boxes in info page and bookmarklet page
git-svn-id: http://yourls.googlecode.com/svn/trunk@423 12232710-3e20-11de-b438-597f59cd7555
2010-06-25 20:49:41 +00:00
ozhozh
a8db6e49d0 Save title in database
- updated saving/editing functions
- updated install/upgrade functions
- updated display
- updated ajax

git-svn-id: http://yourls.googlecode.com/svn/trunk@415 12232710-3e20-11de-b438-597f59cd7555
2010-06-25 15:40:05 +00:00
ozhozh
d55fcce6a0 - Move common js utils in common.js
- Add notify bar jquery plugin for prettier feedback

git-svn-id: http://yourls.googlecode.com/svn/trunk@407 12232710-3e20-11de-b438-597f59cd7555
2010-06-15 16:09:25 +00:00
ozhozh
9d396b3c3e JS improvements: fix Firebug warning about keycodes.
Added: Sharebox when shortening from within the admin page. Fixes issue 365.

git-svn-id: http://yourls.googlecode.com/svn/trunk@403 12232710-3e20-11de-b438-597f59cd7555
2010-06-15 12:18:31 +00:00
ozhozh
a9ad30b3b5 Implemented ZeroClipboard. Fixes issue 131.
git-svn-id: http://yourls.googlecode.com/svn/trunk@386 12232710-3e20-11de-b438-597f59cd7555
2010-06-11 14:53:58 +00:00
ozhozh
3117669658 Move tablesorting stuff to the proper JS file
git-svn-id: http://yourls.googlecode.com/svn/trunk@332 12232710-3e20-11de-b438-597f59cd7555
2010-04-23 15:23:55 +00:00
ozhozh
898e36377d JS tweak: decrement counter when deleting a link
git-svn-id: http://yourls.googlecode.com/svn/trunk@224 12232710-3e20-11de-b438-597f59cd7555
2009-10-09 21:41:27 +00:00
ozhozh
85b2f129b2 JS minor tweak
git-svn-id: http://yourls.googlecode.com/svn/trunk@223 12232710-3e20-11de-b438-597f59cd7555
2009-10-09 21:19:41 +00:00
ozhozh
cd8a3b2bf6 - Fixed JS error when editing a link
- Add ?version= when inserting a JS or CSS in the head


git-svn-id: http://yourls.googlecode.com/svn/trunk@217 12232710-3e20-11de-b438-597f59cd7555
2009-10-04 12:40:37 +00:00
ozhozh
c7f3f1db46 Fixes issue 99, again.
git-svn-id: http://yourls.googlecode.com/svn/trunk@210 12232710-3e20-11de-b438-597f59cd7555
2009-09-27 18:20:59 +00:00
ozhozh
220ae9f2d2 Fix sort order on admin index when some filtering is set. Fixes issue 99.
git-svn-id: http://yourls.googlecode.com/svn/trunk@204 12232710-3e20-11de-b438-597f59cd7555
2009-09-27 12:20:17 +00:00
ozhozh
85458bf0b7 Fix stupid js error when editing a link
git-svn-id: http://yourls.googlecode.com/svn/trunk@139 12232710-3e20-11de-b438-597f59cd7555
2009-09-13 09:17:11 +00:00
ozhozh
e47a36393a Big cosmetic commit
- fixed width layout
- icons for action buttons
- link to stats from main admin page
- trim too long urls in the admin page

git-svn-id: http://yourls.googlecode.com/svn/trunk@136 12232710-3e20-11de-b438-597f59cd7555
2009-09-12 11:55:22 +00:00
ozhozh
b8efb35918 Make insert.js independent from tablesorter.js
git-svn-id: http://yourls.googlecode.com/svn/trunk@119 12232710-3e20-11de-b438-597f59cd7555
2009-09-04 20:44:14 +00:00
ozhozh
8f6fabba4b 1.4-alpha massive commit:
- now using a global object $ydb for everything related to DB and other globally needed stuff
- change in DB schema: now storing URLs with their keyword as used in shorturl, allowing for any keyword length
- change in DB schema: new table for storing various options including next_id, dropping table of the same name
- change in DB schema: new table for storing hits (for stats)
- added an upgrader from 1.3 to 1.4
- improved the installer, with .htaccess file creation


git-svn-id: http://yourls.googlecode.com/svn/trunk@103 12232710-3e20-11de-b438-597f59cd7555
2009-09-02 20:26:34 +00:00
lesterchan
350f846ed0 Allow https://
git-svn-id: http://yourls.googlecode.com/svn/trunk@58 12232710-3e20-11de-b438-597f59cd7555
2009-07-29 16:33:24 +00:00
lesterchan
b49c58ec9c replace admin/index_ajax.php to just index_ajax.php
git-svn-id: http://yourls.googlecode.com/svn/trunk@9 12232710-3e20-11de-b438-597f59cd7555
2009-05-12 15:51:00 +00:00
lesterchan
fe2c153179 - Moved to /admin/ folder
- Rename go.php to yourls-go.php
- Rename api.php to yours-api.php
- Created login.php placeholder

git-svn-id: http://yourls.googlecode.com/svn/trunk@7 12232710-3e20-11de-b438-597f59cd7555
2009-05-12 15:22:27 +00:00
lesterchan
278a61e1c3 - Renamed insert.php to admin.php
- Renamed insert_ajax.php to admin_ajax.php
- Added readme.html
- Added more description in config-sample.php

git-svn-id: http://yourls.googlecode.com/svn/trunk@6 12232710-3e20-11de-b438-597f59cd7555
2009-05-12 14:15:54 +00:00
ozhozh
2f6b480e8b Initial commit (importing from http://svn.planetozh.com/ozhin)
git-svn-id: http://yourls.googlecode.com/svn/trunk@3 12232710-3e20-11de-b438-597f59cd7555
2009-05-11 20:30:26 +00:00