-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addons:
load_when_embedded
config (#11765)
Add an extra addons config to decide whether or not force the injection of addons when the page is embedded (eg. iframe). By default, we are not loading addons if embedded. Required by readthedocs/addons#415 Closes readthedocs/addons#412
- Loading branch information
Showing
8 changed files
with
144 additions
and
5 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
readthedocs/projects/migrations/0133_addons_load_when_embedded.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 4.2.16 on 2024-11-13 12:00 | ||
|
||
from django.db import migrations, models | ||
from django_safemigrate import Safe | ||
|
||
|
||
class Migration(migrations.Migration): | ||
safe = Safe.before_deploy | ||
|
||
dependencies = [ | ||
('projects', '0132_addons_linkpreviews_fields'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='addonsconfig', | ||
name='options_load_when_embedded', | ||
field=models.BooleanField(default=False, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='historicaladdonsconfig', | ||
name='options_load_when_embedded', | ||
field=models.BooleanField(default=False, null=True), | ||
), | ||
] |
25 changes: 25 additions & 0 deletions
25
readthedocs/projects/migrations/0134_addons_load_when_embedded_notnull.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 4.2.16 on 2024-11-13 12:01 | ||
|
||
from django.db import migrations, models | ||
from django_safemigrate import Safe | ||
|
||
|
||
class Migration(migrations.Migration): | ||
safe = Safe.after_deploy | ||
|
||
dependencies = [ | ||
('projects', '0133_addons_load_when_embedded'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='addonsconfig', | ||
name='options_load_when_embedded', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AlterField( | ||
model_name='historicaladdonsconfig', | ||
name='options_load_when_embedded', | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
35 changes: 35 additions & 0 deletions
35
readthedocs/projects/migrations/0135_addons_customscript.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Generated by Django 4.2.16 on 2024-11-13 13:34 | ||
|
||
from django.db import migrations, models | ||
from django_safemigrate import Safe | ||
|
||
|
||
class Migration(migrations.Migration): | ||
safe = Safe.before_deploy | ||
|
||
dependencies = [ | ||
('projects', '0134_addons_load_when_embedded_notnull'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='addonsconfig', | ||
name='customscript_enabled', | ||
field=models.BooleanField(default=False, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='addonsconfig', | ||
name='customscript_src', | ||
field=models.CharField(blank=True, help_text='URL to a JavaScript file to inject at serve time', max_length=512, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='historicaladdonsconfig', | ||
name='customscript_enabled', | ||
field=models.BooleanField(default=False, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='historicaladdonsconfig', | ||
name='customscript_src', | ||
field=models.CharField(blank=True, help_text='URL to a JavaScript file to inject at serve time', max_length=512, null=True), | ||
), | ||
] |
25 changes: 25 additions & 0 deletions
25
readthedocs/projects/migrations/0136_addons_customscript_notnull.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 4.2.16 on 2024-11-13 13:36 | ||
|
||
from django.db import migrations, models | ||
from django_safemigrate import Safe | ||
|
||
|
||
class Migration(migrations.Migration): | ||
safe = Safe.after_deploy | ||
|
||
dependencies = [ | ||
('projects', '0135_addons_customscript'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='addonsconfig', | ||
name='customscript_enabled', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AlterField( | ||
model_name='historicaladdonsconfig', | ||
name='customscript_enabled', | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters